├── vendor ├── estebanforge │ └── hyperfields │ │ ├── hyperfields │ │ ├── metabox-demo.php │ │ ├── simple-example.php │ │ ├── simple-metabox-test.php │ │ ├── index.html │ │ └── conditional-logic-test.php │ │ ├── vendor │ │ ├── composer │ │ │ ├── installed.json │ │ │ ├── autoload_namespaces.php │ │ │ ├── autoload_psr4.php │ │ │ ├── autoload_files.php │ │ │ ├── installed.php │ │ │ ├── platform_check.php │ │ │ ├── LICENSE │ │ │ ├── autoload_real.php │ │ │ └── autoload_classmap.php │ │ └── autoload.php │ │ ├── src │ │ ├── HeadingField.php │ │ ├── SeparatorField.php │ │ ├── templates │ │ │ ├── field-separator.php │ │ │ ├── field-hidden.php │ │ │ ├── field-heading.php │ │ │ ├── index.html │ │ │ ├── field-html.php │ │ │ ├── field-time.php │ │ │ ├── field-footer-scripts.php │ │ │ ├── field-datetime.php │ │ │ ├── field-checkbox.php │ │ │ ├── field-header-scripts.php │ │ │ ├── field-color.php │ │ │ ├── field-date.php │ │ │ ├── field-rich-text.php │ │ │ ├── field-multiselect.php │ │ │ ├── field-radio.php │ │ │ ├── field-oembed.php │ │ │ ├── field-sidebar.php │ │ │ ├── field-file.php │ │ │ ├── field-set.php │ │ │ ├── field-radio-image.php │ │ │ ├── field-association.php │ │ │ └── field-image.php │ │ ├── Assets.php │ │ ├── Admin │ │ │ ├── Activation.php │ │ │ └── index.html │ │ ├── Container │ │ │ ├── ContainerFactory.php │ │ │ └── index.html │ │ ├── index.html │ │ ├── OptionsSection.php │ │ ├── PostField.php │ │ ├── TermField.php │ │ ├── UserField.php │ │ ├── BlockFieldAdapter.php │ │ └── CustomField.php │ │ ├── composer.lock │ │ ├── hyperfields.php │ │ ├── composer.json │ │ ├── includes │ │ └── index.html │ │ ├── hyperoptions │ │ ├── index.html │ │ └── conditional-logic-test.php │ │ ├── CHANGELOG.md │ │ └── README.md ├── starfederation │ └── datastar-php │ │ ├── src │ │ ├── .gitattributes │ │ ├── enums │ │ │ ├── EventType.php │ │ │ └── ElementPatchMode.php │ │ ├── events │ │ │ ├── Location.php │ │ │ ├── EventInterface.php │ │ │ ├── PatchSignals.php │ │ │ ├── RemoveElements.php │ │ │ └── ExecuteScript.php │ │ ├── ServerSentEventData.php │ │ └── Consts.php │ │ ├── LICENSE.md │ │ ├── composer.json │ │ └── README.md ├── composer │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_files.php │ ├── platform_check.php │ ├── LICENSE │ ├── installed.php │ └── autoload_real.php └── autoload.php ├── assets ├── js │ ├── map-field.asset.php │ ├── admin-options.asset.php │ ├── conditional-fields.asset.php │ ├── editor.asset.php │ ├── admin-options.js │ ├── map-field.js │ └── editor.js ├── libs │ ├── htmx-extensions │ │ ├── debug.js │ │ ├── ajax-header.js │ │ ├── alpine-morph.js │ │ ├── method-override.js │ │ ├── path-params.js │ │ ├── morphdom-swap.js │ │ ├── restored.js │ │ ├── disable-element.js │ │ ├── remove-me.js │ │ ├── json-enc.js │ │ ├── event-header.js │ │ ├── include-vals.js │ │ ├── path-deps.js │ │ ├── multi-swap.js │ │ ├── index.html │ │ ├── class-tools.js │ │ ├── response-targets.js │ │ ├── head-support.js │ │ ├── client-side-templates.js │ │ └── loading-states.js │ └── index.html ├── css │ └── index.html └── index.html ├── context7.json ├── .wp-org-assets ├── icon-128x128.png ├── icon-256x256.png ├── screenshot-1.png ├── screenshot-2.png ├── banner-1544x500.png ├── banner-1544x500.xcf ├── banner-772x250.png ├── icon-1024x1024.png └── icon-1024x1024.xcf ├── docs ├── faq.md ├── hypermedia-libraries.md ├── installation.md ├── library-detection.md ├── helper-functions.md └── index.md ├── .gitignore ├── SECURITY.md ├── .editorconfig ├── hypermedia ├── noswap │ ├── htmx-demo.hp.php │ ├── index.html │ ├── alpine-ajax-demo.hp.php │ └── datastar-demo.hp.php └── index.html ├── .ci ├── setup-sqlite-dropin.php └── version-bump.php ├── src ├── Theme.php ├── Admin │ ├── Activation.php │ └── index.html ├── js │ ├── admin-options.js │ ├── map-field.js │ └── index.html ├── Libraries │ ├── AlpineAjaxLib.php │ └── index.html ├── Compatibility.php ├── index.html ├── Blocks │ ├── index.html │ └── FieldGroup.php └── Router.php ├── api-for-htmx.php ├── run-tests ├── hyperblocks ├── quote-block │ ├── block.json │ └── render.php ├── content-card │ ├── block.json │ └── render.php ├── hero-banner │ ├── block.json │ └── render.php └── index.html ├── index.html ├── includes └── index.html ├── languages └── index.html ├── uninstall.php ├── pest.php ├── package.json ├── composer.json ├── phpunit.xml └── README.txt /vendor/estebanforge/hyperfields/hyperfields/metabox-demo.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/js/map-field.asset.php: -------------------------------------------------------------------------------- 1 | array(), 'version' => '03cb22a1a2757b894790'); 2 | -------------------------------------------------------------------------------- /assets/js/admin-options.asset.php: -------------------------------------------------------------------------------- 1 | array(), 'version' => 'b7aeb82d44f034f5390e'); 2 | -------------------------------------------------------------------------------- /assets/js/conditional-fields.asset.php: -------------------------------------------------------------------------------- 1 | array(), 'version' => 'd56116140cc4c8c9152a'); 2 | -------------------------------------------------------------------------------- /context7.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://context7.com/estebanforge/hyperpress", 3 | "public_key": "pk_Ms2cIHgncfsrkPJBt5Mko" 4 | } -------------------------------------------------------------------------------- /.wp-org-assets/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/icon-128x128.png -------------------------------------------------------------------------------- /.wp-org-assets/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/icon-256x256.png -------------------------------------------------------------------------------- /.wp-org-assets/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/screenshot-1.png -------------------------------------------------------------------------------- /.wp-org-assets/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/screenshot-2.png -------------------------------------------------------------------------------- /.wp-org-assets/banner-1544x500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/banner-1544x500.png -------------------------------------------------------------------------------- /.wp-org-assets/banner-1544x500.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/banner-1544x500.xcf -------------------------------------------------------------------------------- /.wp-org-assets/banner-772x250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/banner-772x250.png -------------------------------------------------------------------------------- /.wp-org-assets/icon-1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/icon-1024x1024.png -------------------------------------------------------------------------------- /.wp-org-assets/icon-1024x1024.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EstebanForge/Hypermedia-API-WordPress/HEAD/.wp-org-assets/icon-1024x1024.xcf -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [], 3 | "dev": false, 4 | "dev-package-names": [] 5 | } 6 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/.gitattributes: -------------------------------------------------------------------------------- 1 | Constants.php linguist-generated=true 2 | enums/ElementPatchMode.php linguist-generated=true 3 | enums/EventType.php linguist-generated=true -------------------------------------------------------------------------------- /assets/js/editor.asset.php: -------------------------------------------------------------------------------- 1 | array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '3533a090ed44fa36b136'); 2 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($baseDir . '/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ./wp-org-assets/htmx-api-wp-logo.psd 2 | /node_modules/ 3 | deploy.sh 4 | deploy-notag.sh 5 | TODO.md 6 | .wp-org-assets/htmx-api-wp-logo.psd 7 | rules-wordpress.md 8 | .php-cs-fixer.cache 9 | 10 | # Test artifacts 11 | coverage/ 12 | .phpunit.result.cache 13 | wp-content/ 14 | deploy-readme-only.sh 15 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/enums/EventType.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/starfederation/datastar-php/src'), 10 | 'HyperPress\\' => array($baseDir . '/src'), 11 | 'HyperFields\\' => array($vendorDir . '/estebanforge/hyperfields/src'), 12 | ); 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | indent_style = space 12 | 13 | [*.yml] 14 | indent_style = space 15 | indent_size = 2 16 | 17 | [*.md] 18 | trim_trailing_whitespace = false 19 | 20 | [{*.txt,wp-config-sample.php}] 21 | end_of_line = crlf 22 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $baseDir . '/includes/helpers.php', 10 | '0522701f5d113a2ff6373ccc834dd7d6' => $baseDir . '/includes/backward-compatibility.php', 11 | 'c1c635284e1ca7836efff979fb09390f' => $baseDir . '/bootstrap.php', 12 | ); 13 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/debug.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-debug@2.0.2/debug.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | htmx.defineExtension("debug",{onEvent:function(e,o){if(console.debug)console.debug(e,o);else{if(!console)throw new Error("NO CONSOLE SUPPORTED");console.log("DEBUG:",e,o)}}}); 8 | //# sourceMappingURL=/sm/2483c4a8f9035299d91a9561dd6a36f3fa5f8aa9eafdad3eafc6514520cbc835.map -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/ajax-header.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-ajax-header@2.0.3/dist/ajax-header.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";htmx.defineExtension("ajax-header",{onEvent:function(e,t){"htmx:configRequest"===e&&(t.detail.headers["X-Requested-With"]="XMLHttpRequest")}}); 8 | //# sourceMappingURL=/sm/3268047fbcb939c2be5257dd45a252becf78b55874b452269979707d6a106335.map -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/events/Location.php: -------------------------------------------------------------------------------- 1 | script = "setTimeout(() => window.location = '$uri')"; 13 | 14 | foreach ($options as $key => $value) { 15 | if (property_exists($this, $key)) { 16 | $this->{$key} = $value; 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/estebanforge/hyperfields/includes/helpers.php', 10 | '0522701f5d113a2ff6373ccc834dd7d6' => $vendorDir . '/estebanforge/hyperfields/includes/backward-compatibility.php', 11 | 'c1c635284e1ca7836efff979fb09390f' => $vendorDir . '/estebanforge/hyperfields/bootstrap.php', 12 | 'b4e0b991acd5ddad926ebc747d73282f' => $baseDir . '/bootstrap.php', 13 | ); 14 | -------------------------------------------------------------------------------- /hypermedia/noswap/htmx-demo.hp.php: -------------------------------------------------------------------------------- 1 | 'success', 17 | 'nonce' => wp_create_nonce('hyperpress_nonce'), 18 | 'message' => 'Server-side processing done.', 19 | 'params' => $hp_vals, 20 | ] 21 | ); 22 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-separator.php: -------------------------------------------------------------------------------- 1 | 6 | 15 |
16 |
17 |
-------------------------------------------------------------------------------- /assets/libs/htmx-extensions/alpine-morph.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-alpine-morph@2.0.2/alpine-morph.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | htmx.defineExtension("alpine-morph",{isInlineSwap:function(n){return"morph"===n},handleSwap:function(n,e,i){if("morph"===n)return i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?(Alpine.morph(e,i.firstElementChild),[e]):(Alpine.morph(e,i.outerHTML),[e])}}); 8 | //# sourceMappingURL=/sm/ac5b03e48d2ec1e0c6427ec93688bfa28e683b2ee2682723c24ad078b5ff8b82.map -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/method-override.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-method-override@2.0.3/dist/method-override.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";htmx.defineExtension("method-override",{onEvent:function(e,t){if("htmx:configRequest"===e){var o=t.detail.verb;"get"!==o&&"post"!==o&&(t.detail.headers["X-HTTP-Method-Override"]=o.toUpperCase(),t.detail.verb="post")}}}); 8 | //# sourceMappingURL=/sm/9b1413300cd2a2f6a137102e3885260b6b96308d137f821574b8fe3b7e2f3a01.map -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/path-params.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-path-params@2.0.2/dist/path-params.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";htmx.defineExtension("path-params",{onEvent:function(e,t){"htmx:configRequest"===e&&(t.detail.path=t.detail.path.replace(/{([^}]+)}/g,(function(e,a){var n=t.detail.parameters[a];return delete t.detail.parameters[a],void 0===n?"{"+a+"}":encodeURIComponent(n)})))}}); 8 | //# sourceMappingURL=/sm/b130af9ff78c90abcdcb74a7587323fee1b61bb941ba9ba7aa97668b4f3cdccb.map -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/morphdom-swap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-morphdom-swap@2.0.2/dist/morphdom-swap.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";htmx.defineExtension("morphdom-swap",{isInlineSwap:function(o){return"morphdom"===o},handleSwap:function(o,m,r){if("morphdom"===o)return r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?(morphdom(m,r.firstElementChild||r.firstChild),[m]):(morphdom(m,r.outerHTML),[m])}}); 8 | //# sourceMappingURL=/sm/da5f46ca7a395541ac5bc6b003204aabfc3399af780649a7d29a074a1ce046ac.map -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/restored.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-restored@2.0.2/dist/restored.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";htmx.defineExtension("restored",{onEvent:function(e,r){if("htmx:restored"===e){var t=r.detail.document.querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']"),o=Array.from(t).find((e=>e.outerHTML===r.detail.elt.outerHTML));r.detail.triggerEvent(o,"restored")}}}); 8 | //# sourceMappingURL=/sm/003df42b50b3829b42663fc17e9d50486fc1bfcbb15120c9ef093dd8b33bbbc2.map -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "8263667c674e6bb7abed786c785c68a7", 8 | "packages": [], 9 | "packages-dev": [], 10 | "aliases": [], 11 | "minimum-stability": "RC", 12 | "stability-flags": {}, 13 | "prefer-stable": true, 14 | "prefer-lowest": false, 15 | "platform": { 16 | "php": ">=8.1" 17 | }, 18 | "platform-dev": {}, 19 | "plugin-api-version": "2.9.0" 20 | } 21 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/disable-element.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-disable-element@2.0.2/disable-element.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | !function(){"use strict";htmx.defineExtension("disable-element",{onEvent:function(e,t){const n=t.detail.elt,l=n.getAttribute("hx-disable-element"),i="self"==l?[n]:document.querySelectorAll(l);for(var s=0;seventType = $eventType; 24 | $this->data = $data; 25 | $this->eventId = $eventId; 26 | $this->retryDuration = $retryDuration; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/remove-me.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-remove-me@2.0.2/remove-me.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | !function(){function e(e){var t=e.getAttribute("remove-me")||e.getAttribute("data-remove-me");t&&setTimeout((function(){e.parentElement.removeChild(e)}),htmx.parseInterval(t))}htmx.defineExtension("remove-me",{onEvent:function(t,r){if("htmx:afterProcessNode"===t){var o=r.detail.elt;if(o.getAttribute&&(e(o),o.querySelectorAll))for(var n=o.querySelectorAll("[remove-me], [data-remove-me]"),m=0;m array( 3 | 'name' => 'estebanforge/hyperfields', 4 | 'pretty_version' => '1.0.1', 5 | 'version' => '1.0.1.0', 6 | 'reference' => null, 7 | 'type' => 'wordpress-plugin', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => false, 11 | ), 12 | 'versions' => array( 13 | 'estebanforge/hyperfields' => array( 14 | 'pretty_version' => '1.0.1', 15 | 'version' => '1.0.1.0', 16 | 'reference' => null, 17 | 'type' => 'wordpress-plugin', 18 | 'install_path' => __DIR__ . '/../../', 19 | 'aliases' => array(), 20 | 'dev_requirement' => false, 21 | ), 22 | ), 23 | ); 24 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/json-enc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-json-enc@2.0.3/json-enc.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | !function(){let n;htmx.defineExtension("json-enc",{init:function(e){n=e},onEvent:function(n,e){"htmx:configRequest"===n&&(e.detail.headers["Content-Type"]="application/json")},encodeParameters:function(e,t,o){e.overrideMimeType("text/json");const i={};t.forEach((function(n,e){Object.hasOwn(i,e)?(Array.isArray(i[e])||(i[e]=[i[e]]),i[e].push(n)):i[e]=n}));const s=n.getExpressionVars(o);return Object.keys(i).forEach((function(n){i[n]=Object.hasOwn(s,n)?s[n]:i[n]})),JSON.stringify(i)}})}(); 8 | //# sourceMappingURL=/sm/b8de7541f9a9441388a80611ad8e4d48fb8b5bdd8ff94a29fa35571e58740232.map -------------------------------------------------------------------------------- /src/Admin/Activation.php: -------------------------------------------------------------------------------- 1 | 19 | 20 | > -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/event-header.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-event-header@2.0.2/dist/event-header.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";htmx.defineExtension("event-header",{onEvent:function(e,t){"htmx:configRequest"===e&&t.detail.triggeringEvent&&(t.detail.headers["Triggering-Event"]=function(e){var t={};for(var n in e)t[n]=e[n];return JSON.stringify(t,(function(e,t){if(t instanceof Node){var n=t.tagName;return n?(n=n.toLowerCase(),t.id&&(n+="#"+t.id),t.classList&&t.classList.length&&(n+="."+t.classList.toString().replace(" ",".")),n):"Node"}return t instanceof Window?"Window":t}))}(t.detail.triggeringEvent))}}); 8 | //# sourceMappingURL=/sm/5b737cdcb145da6f036f0a6544b577ceffd345bf56db6d275a5ca4a06a070c55.map -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/include-vals.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-include-vals@2.0.2/dist/include-vals.esm.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | import htmx from"htmx.org";(function(){function mergeObjects(e,t){for(var l in t)t.hasOwnProperty(l)&&(e[l]=t[l]);return e}htmx.defineExtension("include-vals",{onEvent:function(name,evt){if("htmx:configRequest"===name){var includeValsElt=htmx.closest(evt.detail.elt,"[include-vals],[data-include-vals]");if(includeValsElt){var includeVals=includeValsElt.getAttribute("include-vals")||includeValsElt.getAttribute("data-include-vals"),valuesToInclude=eval("({"+includeVals+"})");mergeObjects(evt.detail.parameters,valuesToInclude)}}}})})(); 8 | //# sourceMappingURL=/sm/b2cd017ab1095df071c76dcf53b78a24645f1008c0ab0a9c639b7c3670ddf1af.map -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/enums/ElementPatchMode.php: -------------------------------------------------------------------------------- 1 | {this.textContent="Copied!",this.classList.add("button-primary"),this.classList.remove("button-secondary"),setTimeout((()=>{this.textContent=e,this.classList.add("button-secondary"),this.classList.remove("button-primary")}),2e3)})).catch((t=>{console.error("Failed to copy: ",t)}))}))}))})); -------------------------------------------------------------------------------- /src/js/admin-options.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded",(function(){const t=document.querySelector("#hyperpress_options_active_library");t&&t.addEventListener("change",(function(){const t=document.querySelector('p.submit input[type="submit"]');if(t){const e=document.createElement("span");e.className="spinner is-active",e.style.float="none",e.style.marginTop="5px",t.parentNode.insertBefore(e,t.nextSibling)}document.querySelector("#hyperpress-options-form").submit()})),document.querySelectorAll(".copy-api-url").forEach((function(t){t.addEventListener("click",(function(){const t=this.getAttribute("data-clipboard-text"),e=this.textContent;navigator.clipboard.writeText(t).then((()=>{this.textContent="Copied!",this.classList.add("button-primary"),this.classList.remove("button-secondary"),setTimeout((()=>{this.textContent=e,this.classList.add("button-secondary"),this.classList.remove("button-primary")}),2e3)})).catch((t=>{console.error("Failed to copy: ",t)}))}))}))})); -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-heading.php: -------------------------------------------------------------------------------- 1 | 17 | 18 |
> 19 | 20 |

21 | 22 | 23 | 24 |

25 | 26 |
27 | -------------------------------------------------------------------------------- /run-tests: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | HyperPress. 13 | 14 | In the case of HTMX, you can also enable any of its extensions in the plugin's options page: Settings > HyperPress. 15 | 16 | ## Local vs CDN Loading 17 | 18 | The plugin includes local copies of all libraries for privacy and offline development. You can choose to load from: 19 | 20 | 1. **Local files** (default): Libraries are served from your WordPress installation 21 | 2. **CDN**: Optional CDN loading from jsdelivr.net. Will always load the latest version of the library. 22 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/path-deps.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-path-deps@2.0.2/path-deps.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | (function(){"use strict";function t(t,e){if("ignore"===t)return!1;for(var n=t.split("/"),r=e.split("/"),i=0;i HyperPress. 8 | 9 | ## Installation via Composer 10 | If you want to use this plugin as a library, you can install it via Composer. This allows you to use hypermedia libraries in your own plugins or themes, without the need to install this plugin. 11 | 12 | ```bash 13 | composer require estebanforge/hyperpress 14 | ``` 15 | 16 | This plugin/library will determine which instance of itself is the newer one when WordPress is loading. Then, it will use the newer instance between all competing plugins or themes. This is to avoid conflicts with other plugins or themes that may be using the same library for their Hypermedia implementation. 17 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 80100)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | throw new \RuntimeException( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues) 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 80100)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | throw new \RuntimeException( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues) 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /src/Libraries/AlpineAjaxLib.php: -------------------------------------------------------------------------------- 1 | main = $main; 34 | } 35 | 36 | /** 37 | * Get available extensions for Alpine Ajax. 38 | * This method is included for API consistency but currently returns an empty array 39 | * as Alpine Ajax does not have extensions in the same way HTMX does. 40 | * 41 | * @return array An empty array. 42 | */ 43 | public function getExtensions(): array 44 | { 45 | return []; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright © Star Federation 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/Compatibility.php: -------------------------------------------------------------------------------- 1 | =8.1" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "HyperFields\\": "src/" 21 | }, 22 | "files": [ 23 | "includes/helpers.php", 24 | "includes/backward-compatibility.php", 25 | "bootstrap.php" 26 | ] 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { 30 | "HyperFields\\Tests\\": "tests/" 31 | } 32 | }, 33 | 34 | "config": { 35 | "allow-plugins": { 36 | "composer/installers": true 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /hyperblocks/quote-block/block.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyperblocks/quote-block-json", 3 | "title": "HB Quote Block (JSON)", 4 | "description": "A quote block with author attribution and styling - block.json implementation.", 5 | "category": "widgets", 6 | "icon": "format-quote", 7 | "keywords": ["quote", "blockquote", "author", "testimonial"], 8 | "supports": { 9 | "html": false, 10 | "anchor": true, 11 | "spacing": { 12 | "padding": true, 13 | "margin": true 14 | } 15 | }, 16 | "attributes": { 17 | "quote_text": { 18 | "type": "string", 19 | "default": "" 20 | }, 21 | "quote_author": { 22 | "type": "string", 23 | "default": "" 24 | }, 25 | "author_title": { 26 | "type": "string", 27 | "default": "" 28 | }, 29 | "background_color": { 30 | "type": "string", 31 | "default": "#f9f9f9" 32 | }, 33 | "text_color": { 34 | "type": "string", 35 | "default": "#333333" 36 | } 37 | }, 38 | "render": "file:./render.php" 39 | } -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /hyperblocks/content-card/block.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyperblocks/content-card-json", 3 | "title": "HB Content Card (JSON)", 4 | "description": "A content card block with title, image, and nested content area - block.json implementation.", 5 | "category": "widgets", 6 | "icon": "table-col-before", 7 | "keywords": ["card", "content", "image", "nested"], 8 | "supports": { 9 | "html": false, 10 | "anchor": true, 11 | "spacing": { 12 | "padding": true, 13 | "margin": true 14 | } 15 | }, 16 | "attributes": { 17 | "card_title": { 18 | "type": "string", 19 | "default": "" 20 | }, 21 | "image_url": { 22 | "type": "string", 23 | "default": "" 24 | }, 25 | "image_alt": { 26 | "type": "string", 27 | "default": "" 28 | }, 29 | "background_color": { 30 | "type": "string", 31 | "default": "#ffffff" 32 | }, 33 | "text_color": { 34 | "type": "string", 35 | "default": "#333333" 36 | } 37 | }, 38 | "render": "file:./render.php" 39 | } -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/hyperfields/simple-example.php: -------------------------------------------------------------------------------- 1 | where('post') 33 | ->setContext('side'); 34 | 35 | $container 36 | ->addField(HyperFields::makeField('text', 'test_text', 'Test Text')) 37 | ->addField(HyperFields::makeField('textarea', 'test_textarea', 'Test Textarea')) 38 | ->addField(HyperFields::makeField('checkbox', 'test_checkbox', 'Test Checkbox')); 39 | } 40 | 41 | // Activate with: add_action('init', 'hyperfields_simple_example'); 42 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "starfederation/datastar-php", 3 | "description": "A PHP SDK for working with Datastar.", 4 | "version": "1.0.0-RC.4", 5 | "type": "library", 6 | "license": "mit", 7 | "require": { 8 | "php": ">=8.1" 9 | }, 10 | "require-dev": { 11 | "craftcms/ecs": "dev-main", 12 | "craftcms/phpstan": "dev-main", 13 | "pestphp/pest": "^3.5" 14 | }, 15 | "autoload": { 16 | "psr-4": { 17 | "starfederation\\datastar\\": "src/" 18 | } 19 | }, 20 | "scripts": { 21 | "ecs": "ecs check --ansi --fix", 22 | "phpstan": "phpstan --memory-limit=1G", 23 | "test": "vendor/bin/pest" 24 | }, 25 | "config": { 26 | "optimize-autoloader": true, 27 | "sort-packages": true, 28 | "allow-plugins": { 29 | "pestphp/pest-plugin": true 30 | } 31 | }, 32 | "authors": [ 33 | { 34 | "name": "Ben Croker", 35 | "homepage": "https://putyourlightson.com/", 36 | "role": "Author" 37 | } 38 | ], 39 | "support": { 40 | "docs": "https://github.com/starfederation/datastar-php", 41 | "source": "https://github.com/starfederation/datastar-php", 42 | "issues": "https://github.com/starfederation/datastar-php/issues" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/hyperfields/simple-metabox-test.php: -------------------------------------------------------------------------------- 1 | where('post') 33 | ->setContext('side'); 34 | 35 | $container 36 | ->addField(HyperFields::makeField('text', 'test_text', 'Test Text')) 37 | ->addField(HyperFields::makeField('textarea', 'test_textarea', 'Test Textarea')) 38 | ->addField(HyperFields::makeField('checkbox', 'test_checkbox', 'Test Checkbox')); 39 | } 40 | 41 | // Activate with: add_action('init', 'hyperfields_simple_metabox_test'); 42 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/Consts.php: -------------------------------------------------------------------------------- 1 | OpenStreetMap contributors'}).addTo(d);let c=L.marker([n,a],{draggable:!0}).addTo(d);c.on("dragend",(function(t){const e=c.getLatLng();l.value=e.lat,r.value=e.lng})),d.on("click",(function(t){const e=t.latlng;c.setLatLng(e),l.value=e.lat,r.value=e.lng}));const g=document.querySelector(`.hyperpress-geocode-button[data-field="${e}"]`);g&&g.addEventListener("click",(function(){const t=s.value;t&&fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(t)}`).then((t=>t.json())).then((t=>{if(t&&t.length>0){const e=parseFloat(t[0].lat),n=parseFloat(t[0].lon),a=new L.LatLng(e,n);d.setView(a,o),c.setLatLng(a),l.value=e,r.value=n}else alert("Address not found.")})).catch((t=>console.error("Error during geocoding:",t)))}))}))})); -------------------------------------------------------------------------------- /assets/js/map-field.js: -------------------------------------------------------------------------------- 1 | document.addEventListener("DOMContentLoaded",(function(){const t=document.querySelectorAll(".hyperpress-map-canvas");0!==t.length&&t.forEach((function(t){const e=t.dataset.field,n=parseFloat(t.dataset.lat)||51.505,a=parseFloat(t.dataset.lng)||-.09,o=parseInt(t.dataset.zoom,10)||13,l=document.getElementById(e+"_lat"),r=document.getElementById(e+"_lng"),s=document.getElementById(e+"_address"),d=L.map(t).setView([n,a],o);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© OpenStreetMap contributors'}).addTo(d);let c=L.marker([n,a],{draggable:!0}).addTo(d);c.on("dragend",(function(t){const e=c.getLatLng();l.value=e.lat,r.value=e.lng})),d.on("click",(function(t){const e=t.latlng;c.setLatLng(e),l.value=e.lat,r.value=e.lng}));const g=document.querySelector(`.hyperpress-geocode-button[data-field="${e}"]`);g&&g.addEventListener("click",(function(){const t=s.value;t&&fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(t)}`).then((t=>t.json())).then((t=>{if(t&&t.length>0){const e=parseFloat(t[0].lat),n=parseFloat(t[0].lon),a=new L.LatLng(e,n);d.setView(a,o),c.setLatLng(a),l.value=e,r.value=n}else alert("Address not found.")})).catch((t=>console.error("Error during geocoding:",t)))}))}))})); -------------------------------------------------------------------------------- /hyperblocks/hero-banner/block.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hyperblocks/hero-banner-json", 3 | "title": "HB Hero Banner (JSON)", 4 | "description": "A hero banner block with headline, subtitle, and call-to-action button - block.json implementation.", 5 | "category": "widgets", 6 | "icon": "format-image", 7 | "keywords": ["hero", "banner", "cta", "headline"], 8 | "supports": { 9 | "html": false, 10 | "anchor": true, 11 | "spacing": { 12 | "padding": true, 13 | "margin": true 14 | } 15 | }, 16 | "attributes": { 17 | "headline": { 18 | "type": "string", 19 | "default": "" 20 | }, 21 | "subtitle": { 22 | "type": "string", 23 | "default": "" 24 | }, 25 | "button_url": { 26 | "type": "string", 27 | "default": "" 28 | }, 29 | "button_text": { 30 | "type": "string", 31 | "default": "Learn More" 32 | }, 33 | "background_color": { 34 | "type": "string", 35 | "default": "#ffffff" 36 | }, 37 | "text_color": { 38 | "type": "string", 39 | "default": "#333333" 40 | } 41 | }, 42 | "render": "file:./render.php" 43 | } -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/Container/ContainerFactory.php: -------------------------------------------------------------------------------- 1 | init(); 27 | 28 | return $container; 29 | } 30 | 31 | /** 32 | * Create a term meta container. 33 | */ 34 | public static function makeTermMeta(string $id, string $title): TermMetaContainer 35 | { 36 | $container = new TermMetaContainer($id, $title); 37 | $container->init(); 38 | 39 | return $container; 40 | } 41 | 42 | /** 43 | * Create a user meta container. 44 | */ 45 | public static function makeUserMeta(string $id, string $title): UserMetaContainer 46 | { 47 | $container = new UserMetaContainer($id, $title); 48 | $container->init(); 49 | 50 | return $container; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /hypermedia/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /includes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /languages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/Admin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/Blocks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/js/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/libs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /hyperblocks/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/Libraries/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /hypermedia/noswap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/includes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /uninstall.php: -------------------------------------------------------------------------------- 1 | get_results("SELECT option_name FROM $wpdb->options WHERE option_name LIKE '_hxwp_%' OR option_name LIKE 'hxwp_%' OR option_name LIKE '_hyperpress_%' OR option_name LIKE 'hyperpress_%'"); 35 | 36 | if (is_array($hp_options) && !empty($hp_options)) { 37 | foreach ($hp_options as $option) { 38 | delete_option($option->option_name); 39 | } 40 | } 41 | 42 | // Flush rewrite rules 43 | flush_rewrite_rules(); 44 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/hyperfields/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/hyperoptions/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/Admin/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/Container/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | You shall not pass! 14 | 15 | 16 | 17 | 18 | 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /pest.php: -------------------------------------------------------------------------------- 1 | in('Unit'); 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Expectations 20 | |-------------------------------------------------------------------------- 21 | | 22 | | When you're writing tests, you often need to check that values meet 23 | | certain conditions. The "expect()" function gives you access to a set 24 | | of "expectation" methods that you can use to assert different 25 | | conditions. 26 | | 27 | */ 28 | 29 | expect()->extend('toBeOne', function () { 30 | return $this->toBe(1); 31 | }); 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Functions 36 | |-------------------------------------------------------------------------- 37 | | 38 | | While Pest is very powerful out-of-the-box, you may have some testing 39 | | code specific to your project that you don't want to repeat in every 40 | | file. Here you can also expose helpers as globals to make them 41 | | available in your tests. 42 | | 43 | */ 44 | 45 | function something() 46 | { 47 | // .. 48 | } -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/class-tools.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-class-tools@2.0.3/class-tools.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | !function(){function t(t){var e=t.split(/\s+/);if(e.length>1){var s,a,l=e[0],i=e[1].trim();if(i.indexOf(":")>0){var n=i.split(":");s=n[0],a=htmx.parseInterval(n[1])}else s=i,a=100;return{operation:l,cssClass:s,delay:a}}return null}function e(t,e,s,a){setTimeout((function(){t.classList[e.operation].call(t.classList,e.cssClass)}),a)}function s(t,e,s,a){setTimeout((function(){setInterval((function(){t.classList[e.operation].call(t.classList,e.cssClass)}),e.delay)}),a)}function a(a){if(a.getAttribute){var l=a.getAttribute("classes")||a.getAttribute("data-classes");l&&function(a,l){for(var i=l.split("&"),n=0;n 21 | 22 |
> 23 | 24 |
25 | 26 |
27 | 28 | 29 |
30 |
31 | 36 |
37 | 38 | 39 |

40 | 41 |
42 |
43 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [1.0.2] - 2024-12-07 4 | 5 | ### Added 6 | - Complete custom field system for WordPress 7 | - Post meta, term meta, and user meta container support 8 | - Options pages with sections and tabs 9 | - Conditional logic for dynamic field visibility 10 | - Field types: text, textarea, email, URL, number, select, checkbox, radio, date, color, image, file, wysiwyg, code editor 11 | - Repeater fields for creating dynamic field groups 12 | - Template loader with automatic asset enqueuing 13 | - Block field adapter for Gutenberg integration 14 | - Backward compatibility layer for legacy class names 15 | - PSR-4 autoloading with Composer 16 | - Comprehensive field validation and sanitization 17 | - Admin assets manager for styles and scripts 18 | - Helper functions for field value retrieval 19 | 20 | ### Features 21 | - **Metaboxes**: Add custom fields to posts, pages, and custom post types 22 | - **Options Pages**: Create settings pages with organized sections and tabs 23 | - **Conditional Logic**: Show/hide fields based on other field values 24 | - **Flexible Containers**: Support for post meta, term meta, user meta, and options 25 | - **Rich Field Types**: Extensive collection of field types for any use case 26 | - **Developer-Friendly**: Clean API with extensive hooks and filters 27 | - **Performance**: Optimized autoloading and asset management 28 | - **Extensible**: Easy to extend with custom field types and containers 29 | 30 | ### Requirements 31 | - PHP 8.1 or higher 32 | - WordPress 5.0 or higher 33 | - Composer for dependency management 34 | 35 | -------------------------------------------------------------------------------- /hypermedia/noswap/alpine-ajax-demo.hp.php: -------------------------------------------------------------------------------- 1 | $status, 39 | 'nonce' => wp_create_nonce('hyperpress_nonce'), 40 | 'message' => $message, 41 | 'demo_type' => $demo_type, 42 | 'params' => $hp_vals, 43 | 'timestamp' => current_time('mysql'), 44 | ] 45 | ); 46 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/events/PatchSignals.php: -------------------------------------------------------------------------------- 1 | signals = $signals; 21 | 22 | foreach ($options as $key => $value) { 23 | if (property_exists($this, $key)) { 24 | $this->{$key} = $value; 25 | } 26 | } 27 | } 28 | 29 | /** 30 | * @inerhitdoc 31 | */ 32 | public function getEventType(): EventType 33 | { 34 | return EventType::PatchSignals; 35 | } 36 | 37 | /** 38 | * @inerhitdoc 39 | */ 40 | public function getDataLines(): array 41 | { 42 | $dataLines = []; 43 | 44 | if ($this->onlyIfMissing !== Consts::DEFAULT_PATCH_SIGNALS_ONLY_IF_MISSING) { 45 | $dataLines[] = $this->getDataLine(Consts::ONLY_IF_MISSING_DATALINE_LITERAL, $this->getBooleanAsString($this->onlyIfMissing)); 46 | } 47 | 48 | $data = is_array($this->signals) ? json_encode($this->signals) : $this->signals; 49 | 50 | return array_merge( 51 | $dataLines, 52 | $this->getMultiDataLines(Consts::SIGNALS_DATALINE_LITERAL, $data), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'name' => 'estebanforge/hyperpress', 4 | 'pretty_version' => '3.0.2', 5 | 'version' => '3.0.2.0', 6 | 'reference' => null, 7 | 'type' => 'wordpress-plugin', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => false, 11 | ), 12 | 'versions' => array( 13 | 'estebanforge/hyperfields' => array( 14 | 'pretty_version' => '1.0.2', 15 | 'version' => '1.0.2.0', 16 | 'reference' => '911199a77337fb02354c9e45ad112bfec40d4503', 17 | 'type' => 'wordpress-plugin', 18 | 'install_path' => __DIR__ . '/../estebanforge/hyperfields', 19 | 'aliases' => array(), 20 | 'dev_requirement' => false, 21 | ), 22 | 'estebanforge/hyperpress' => array( 23 | 'pretty_version' => '3.0.2', 24 | 'version' => '3.0.2.0', 25 | 'reference' => null, 26 | 'type' => 'wordpress-plugin', 27 | 'install_path' => __DIR__ . '/../../', 28 | 'aliases' => array(), 29 | 'dev_requirement' => false, 30 | ), 31 | 'starfederation/datastar-php' => array( 32 | 'pretty_version' => '1.0.0-RC.4', 33 | 'version' => '1.0.0.0-RC4', 34 | 'reference' => '919c57674bc19e4523eb56926844ad16829f4eee', 35 | 'type' => 'library', 36 | 'install_path' => __DIR__ . '/../starfederation/datastar-php', 37 | 'aliases' => array(), 38 | 'dev_requirement' => false, 39 | ), 40 | ), 41 | ); 42 | -------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/src/events/RemoveElements.php: -------------------------------------------------------------------------------- 1 | selector = $selector; 22 | 23 | foreach ($options as $key => $value) { 24 | if (property_exists($this, $key)) { 25 | $this->{$key} = $value; 26 | } 27 | } 28 | } 29 | 30 | /** 31 | * @inerhitdoc 32 | */ 33 | public function getEventType(): EventType 34 | { 35 | return EventType::PatchElements; 36 | } 37 | 38 | /** 39 | * @inerhitdoc 40 | */ 41 | public function getDataLines(): array 42 | { 43 | $dataLines = [ 44 | $this->getDataLine(Consts::SELECTOR_DATALINE_LITERAL, $this->selector), 45 | $this->getDataLine(Consts::MODE_DATALINE_LITERAL, ElementPatchMode::Remove->value), 46 | ]; 47 | 48 | if ($this->useViewTransition !== Consts::DEFAULT_ELEMENTS_USE_VIEW_TRANSITIONS) { 49 | $dataLines[] = $this->getDataLine(Consts::USE_VIEW_TRANSITION_DATALINE_LITERAL, $this->getBooleanAsString($this->useViewTransition)); 50 | } 51 | 52 | return $dataLines; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/OptionsSection.php: -------------------------------------------------------------------------------- 1 | id = $id; 17 | $this->title = $title; 18 | $this->description = $description; 19 | } 20 | 21 | public function setDescription(string $description): self 22 | { 23 | $this->description = $description; 24 | 25 | return $this; 26 | } 27 | 28 | public function getId(): string 29 | { 30 | return $this->id; 31 | } 32 | 33 | public function getTitle(): string 34 | { 35 | return $this->title; 36 | } 37 | 38 | public function getDescription(): string 39 | { 40 | return $this->description; 41 | } 42 | 43 | public function addField(Field $field): self 44 | { 45 | $this->fields[$field->getName()] = $field; 46 | $field->setContext('option'); 47 | 48 | return $this; 49 | } 50 | 51 | public function getFields(): array 52 | { 53 | return $this->fields; 54 | } 55 | 56 | public function render(): void 57 | { 58 | if ($this->description) { 59 | echo '

' . esc_html($this->description) . '

'; 60 | } 61 | } 62 | 63 | public static function make(string $id, string $title, string $description = ''): self 64 | { 65 | return new self($id, $title, $description); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-time.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
> 24 | 28 | 29 |
30 | 36 | class="regular-text hyperpress-time-picker"> 37 | 38 | 39 |

40 | 41 |
42 |
-------------------------------------------------------------------------------- /hyperblocks/content-card/render.php: -------------------------------------------------------------------------------- 1 | 27 | 28 |
29 | 30 |
31 | <?= esc_attr($image_alt ?: $card_title) ?> 34 |
35 | 36 |
37 | 38 |
39 | 40 |
41 |
42 |
-------------------------------------------------------------------------------- /src/Blocks/FieldGroup.php: -------------------------------------------------------------------------------- 1 | name = $name; 51 | $this->id = $id; 52 | } 53 | 54 | /** 55 | * Create a new FieldGroup instance. 56 | * 57 | * @param string $name The field group name. 58 | * @param string $id The field group ID. 59 | * @return self 60 | */ 61 | public static function make(string $name, string $id): self 62 | { 63 | return new self($name, $id); 64 | } 65 | 66 | /** 67 | * Add fields to the group. 68 | * 69 | * @param Field[] $fields An array of Field objects. 70 | * @return self 71 | */ 72 | public function addFields(array $fields): self 73 | { 74 | $this->fields = array_merge($this->fields, $fields); 75 | 76 | return $this; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-footer-scripts.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
> 24 | 28 | 29 |
30 | 38 | 39 | 40 |

41 | 42 |
43 |
-------------------------------------------------------------------------------- /hyperblocks/quote-block/render.php: -------------------------------------------------------------------------------- 1 | 27 | 28 |
29 |
30 | 31 |
32 | 33 |
34 | 35 | 36 | , 37 | 38 |
39 | 40 |
"
41 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-datetime.php: -------------------------------------------------------------------------------- 1 | 23 | 24 |
> 25 | 29 | 30 |
31 | 37 | class="regular-text hyperpress-datetime-picker"> 38 | 39 | 40 |

41 | 42 |
43 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-checkbox.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
> 24 |
25 |
26 | 29 |
30 |
31 | 32 | 33 | 39 |
40 |
41 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-header-scripts.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
> 24 | 28 | 29 |
30 | 41 | 42 | 43 |

44 | 45 |
46 |
-------------------------------------------------------------------------------- /docs/library-detection.md: -------------------------------------------------------------------------------- 1 | # Library Detection Functions 2 | 3 | **`hp_is_library_mode(): bool`** 4 | 5 | Detects whether the plugin is running as a WordPress plugin or as a Composer library. Useful for conditional functionality. 6 | 7 | ```php 8 | if (hp_is_library_mode()) { 9 | // Running as composer library - no admin interface 10 | // Configure via filters only 11 | add_filter('hyperpress/default_options', function($defaults) { 12 | $defaults['active_library'] = 'htmx'; 13 | return $defaults; 14 | }); 15 | } else { 16 | // Running as WordPress plugin - full functionality available 17 | add_action('admin_menu', 'my_admin_menu'); 18 | } 19 | 20 | // Datastar-specific library mode configuration 21 | if (hp_is_library_mode()) { 22 | // Configure Datastar for production use as library 23 | add_filter('hyperpress/default_options', function($defaults) { 24 | $defaults['active_library'] = 'datastar'; 25 | $defaults['load_from_cdn'] = false; // Use local files for reliability 26 | $defaults['load_datastar_backend'] = true; // Enable in wp-admin 27 | return $defaults; 28 | }); 29 | 30 | // Register custom SSE endpoints for the plugin using this library 31 | add_filter('hyperpress/register_template_path', function($paths) { 32 | $paths['my-plugin'] = plugin_dir_path(__FILE__) . 'datastar-templates/'; 33 | return $paths; 34 | }); 35 | } else { 36 | // Plugin mode - users can configure via admin interface 37 | // Add custom Datastar functionality only when running as main plugin 38 | add_action('wp_enqueue_scripts', function() { 39 | if (get_option('hyperpress_active_library') === 'datastar') { 40 | wp_add_inline_script('datastar', 'console.log("Datastar ready for SSE!");'); 41 | } 42 | }); 43 | } 44 | ``` 45 | -------------------------------------------------------------------------------- /hyperblocks/hero-banner/render.php: -------------------------------------------------------------------------------- 1 | 28 | 29 |
30 | 31 | 32 | 33 |
34 | 37 | 38 | 39 |
40 | 41 |
-------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | $filesToLoad = \Composer\Autoload\ComposerStaticInit9df57b10e795f620526ee79a8e50f778::$files; 37 | $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 38 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 39 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 40 | 41 | require $file; 42 | } 43 | }, null, null); 44 | foreach ($filesToLoad as $fileIdentifier => $file) { 45 | $requireFile($fileIdentifier, $file); 46 | } 47 | 48 | return $loader; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/PostField.php: -------------------------------------------------------------------------------- 1 | post_id = $post_id; 16 | $field->setContext('post'); 17 | 18 | return $field; 19 | } 20 | 21 | public function setMetaKeyPrefix(string $prefix): self 22 | { 23 | $this->meta_key_prefix = $prefix; 24 | 25 | return $this; 26 | } 27 | 28 | public function getMetaKey(): string 29 | { 30 | $key = $this->meta_key_prefix . $this->getName(); 31 | 32 | return apply_filters('hyperpress/fields/post_field_meta_key', $key, $this->getName(), $this->post_id); 33 | } 34 | 35 | public function getValue(): mixed 36 | { 37 | $value = get_post_meta($this->post_id, $this->getMetaKey(), true); 38 | 39 | if ($value === '' || $value === false) { 40 | $value = $this->getDefault(); 41 | } 42 | 43 | return $this->sanitizeValue($value); 44 | } 45 | 46 | public function setValue(mixed $value): bool 47 | { 48 | $sanitized_value = $this->sanitizeValue($value); 49 | 50 | if (!$this->validateValue($sanitized_value)) { 51 | return false; 52 | } 53 | 54 | return update_post_meta($this->post_id, $this->getMetaKey(), $sanitized_value) !== false; 55 | } 56 | 57 | public function deleteValue(): bool 58 | { 59 | return delete_post_meta($this->post_id, $this->getMetaKey()) !== false; 60 | } 61 | 62 | public function getPostId(): int 63 | { 64 | return $this->post_id; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/TermField.php: -------------------------------------------------------------------------------- 1 | term_id = $term_id; 16 | $field->setContext('term'); 17 | 18 | return $field; 19 | } 20 | 21 | public function setMetaKeyPrefix(string $prefix): self 22 | { 23 | $this->meta_key_prefix = $prefix; 24 | 25 | return $this; 26 | } 27 | 28 | public function getMetaKey(): string 29 | { 30 | $key = $this->meta_key_prefix . $this->getName(); 31 | 32 | return apply_filters('hyperpress/fields/term_field_meta_key', $key, $this->getName(), $this->term_id); 33 | } 34 | 35 | public function getValue(): mixed 36 | { 37 | $value = get_term_meta($this->term_id, $this->getMetaKey(), true); 38 | 39 | if ($value === '' || $value === false) { 40 | $value = $this->getDefault(); 41 | } 42 | 43 | return $this->sanitizeValue($value); 44 | } 45 | 46 | public function setValue(mixed $value): bool 47 | { 48 | $sanitized_value = $this->sanitizeValue($value); 49 | 50 | if (!$this->validateValue($sanitized_value)) { 51 | return false; 52 | } 53 | 54 | return update_term_meta($this->term_id, $this->getMetaKey(), $sanitized_value) !== false; 55 | } 56 | 57 | public function deleteValue(): bool 58 | { 59 | return delete_term_meta($this->term_id, $this->getMetaKey()) !== false; 60 | } 61 | 62 | public function getTermId(): int 63 | { 64 | return $this->term_id; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/UserField.php: -------------------------------------------------------------------------------- 1 | user_id = $user_id; 16 | $field->setContext('user'); 17 | 18 | return $field; 19 | } 20 | 21 | public function setMetaKeyPrefix(string $prefix): self 22 | { 23 | $this->meta_key_prefix = $prefix; 24 | 25 | return $this; 26 | } 27 | 28 | public function getMetaKey(): string 29 | { 30 | $key = $this->meta_key_prefix . $this->getName(); 31 | 32 | return apply_filters('hyperpress/fields/user_field_meta_key', $key, $this->getName(), $this->user_id); 33 | } 34 | 35 | public function getValue(): mixed 36 | { 37 | $value = get_user_meta($this->user_id, $this->getMetaKey(), true); 38 | 39 | if ($value === '' || $value === false) { 40 | $value = $this->getDefault(); 41 | } 42 | 43 | return $this->sanitizeValue($value); 44 | } 45 | 46 | public function setValue(mixed $value): bool 47 | { 48 | $sanitized_value = $this->sanitizeValue($value); 49 | 50 | if (!$this->validateValue($sanitized_value)) { 51 | return false; 52 | } 53 | 54 | return update_user_meta($this->user_id, $this->getMetaKey(), $sanitized_value) !== false; 55 | } 56 | 57 | public function deleteValue(): bool 58 | { 59 | return delete_user_meta($this->user_id, $this->getMetaKey()) !== false; 60 | } 61 | 62 | public function getUserId(): int 63 | { 64 | return $this->user_id; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/hyperfields/conditional-logic-test.php: -------------------------------------------------------------------------------- 1 | where('post') 16 | ->setContext('normal') 17 | ->setPriority('high'); 18 | 19 | $container 20 | ->addField(HyperFields::makeField('select', 'show_extra_fields', 'Show Extra Fields?') 21 | ->setOptions([ 22 | 'no' => 'No', 23 | 'yes' => 'Yes', 24 | ]) 25 | ->setDefault('no')) 26 | 27 | ->addField(HyperFields::makeField('text', 'extra_text_field', 'Extra Text Field') 28 | ->setConditionalLogic([ 29 | 'relation' => 'AND', 30 | 'conditions' => [[ 31 | 'field' => 'show_extra_fields', 32 | 'compare' => '=', 33 | 'value' => 'yes', 34 | ]], 35 | ]) 36 | ->setPlaceholder('This field is shown conditionally')) 37 | 38 | ->addField(HyperFields::makeField('textarea', 'extra_textarea_field', 'Extra Textarea Field') 39 | ->setConditionalLogic([ 40 | 'relation' => 'AND', 41 | 'conditions' => [[ 42 | 'field' => 'show_extra_fields', 43 | 'compare' => '=', 44 | 'value' => 'yes', 45 | ]], 46 | ]) 47 | ->setPlaceholder('Another conditionally shown field')); 48 | 49 | // Register the container 50 | $container->register(); 51 | } 52 | 53 | // Activate the test 54 | add_action('init', 'hyperfields_metabox_conditional_logic_test'); 55 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | $filesToLoad = \Composer\Autoload\ComposerStaticInit0b1779e428d95f593360c4ae583abcbc::$files; 37 | $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 38 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 39 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 40 | 41 | require $file; 42 | } 43 | }, null, null); 44 | foreach ($filesToLoad as $fileIdentifier => $file) { 45 | $requireFile($fileIdentifier, $file); 46 | } 47 | 48 | return $loader; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-color.php: -------------------------------------------------------------------------------- 1 | 23 | 24 |
> 25 |
26 |
27 | 31 |
32 |
33 | 39 | class="hyperpress-color-picker"> 40 | 41 | 42 |

43 | 44 |
45 |
46 |
-------------------------------------------------------------------------------- /assets/libs/htmx-extensions/response-targets.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-response-targets@2.0.4/response-targets.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | !function(){var e;function r(e,r){return e.substring(0,r.length)===r}function t(e){e.detail.isError?htmx.config.responseTargetUnsetsError&&(e.detail.isError=!1):htmx.config.responseTargetSetsError&&(e.detail.isError=!0)}htmx.defineExtension("response-targets",{init:function(r){e=r,void 0===htmx.config.responseTargetUnsetsError&&(htmx.config.responseTargetUnsetsError=!0),void 0===htmx.config.responseTargetSetsError&&(htmx.config.responseTargetSetsError=!1),void 0===htmx.config.responseTargetPrefersExisting&&(htmx.config.responseTargetPrefersExisting=!1),void 0===htmx.config.responseTargetPrefersRetargetHeader&&(htmx.config.responseTargetPrefersRetargetHeader=!0)},onEvent:function(s,n){if("htmx:beforeSwap"===s&&n.detail.xhr&&200!==n.detail.xhr.status){if(n.detail.target){if(htmx.config.responseTargetPrefersExisting)return n.detail.shouldSwap=!0,t(n),!0;if(htmx.config.responseTargetPrefersRetargetHeader&&n.detail.xhr.getAllResponseHeaders().match(/HX-Retarget:/i))return n.detail.shouldSwap=!0,t(n),!0}if(!n.detail.requestConfig)return!0;var i=function(t,s){if(!t||!s)return null;var n=s.toString(),i=[n,n.substring(0,2)+"*",n.substring(0,2)+"x",n.substring(0,1)+"*",n.substring(0,1)+"x",n.substring(0,1)+"**",n.substring(0,1)+"xx","*","x","***","xxx"];(r(n,"4")||r(n,"5"))&&i.push("error");for(var o=0;oscript = $script; 23 | 24 | foreach ($options as $key => $value) { 25 | if (property_exists($this, $key)) { 26 | $this->{$key} = $value; 27 | } 28 | } 29 | } 30 | 31 | /** 32 | * @inerhitdoc 33 | */ 34 | public function getEventType(): EventType 35 | { 36 | return EventType::PatchElements; 37 | } 38 | 39 | /** 40 | * @inerhitdoc 41 | */ 42 | public function getDataLines(): array 43 | { 44 | $dataLines = []; 45 | $dataLines[] = $this->getDataLine(Consts::SELECTOR_DATALINE_LITERAL, 'body'); 46 | $dataLines[] = $this->getDataLine(Consts::MODE_DATALINE_LITERAL, ElementPatchMode::Append->value); 47 | 48 | $elements = 'attributes as $key => $value) { 51 | $elements .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"'; 52 | } 53 | 54 | if ($this->autoRemove) { 55 | $elements .= ' ' . 'data-effect="el.remove()"'; 56 | } 57 | 58 | $elements .= '>' . $this->script . ''; 59 | 60 | return array_merge( 61 | $dataLines, 62 | $this->getMultiDataLines(Consts::ELEMENTS_DATALINE_LITERAL, $elements), 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-date.php: -------------------------------------------------------------------------------- 1 | 23 | 24 |
> 25 |
26 |
27 | 31 |
32 |
33 | 39 | class="regular-text hyperpress-date-picker"> 40 | 41 | 42 |

43 | 44 |
45 |
46 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-rich-text.php: -------------------------------------------------------------------------------- 1 | $name_attr, 25 | 'textarea_rows' => 10, 26 | 'media_buttons' => true, 27 | 'teeny' => false, 28 | 'quicktags' => true, 29 | 'tinymce' => [ 30 | 'toolbar1' => 'bold,italic,underline,|,bullist,numlist,|,link,unlink,|,pastetext,removeformat', 31 | 'toolbar2' => 'formatselect,|,outdent,indent,|,undo,redo', 32 | 'toolbar3' => '', 33 | ], 34 | ]; 35 | 36 | // Allow customization via filter 37 | $editor_settings = apply_filters('hyperpress/fields/rich_text_editor_settings', $editor_settings, $name); 38 | ?> 39 | 40 |
> 41 | 45 | 46 |
47 | 48 | 49 | 50 |

51 | 52 |
53 |
54 | -------------------------------------------------------------------------------- /src/Router.php: -------------------------------------------------------------------------------- 1 | -1){const f=document.createElement("html");var n=t.replace(/]*>|>)([\s\S]*?)<\/svg>/gim,"").match(/(]*>|>)([\s\S]*?)<\/head>)/im);if(n){var d=[],a=[],o=[],h=[];f.innerHTML=n;var i=f.querySelector("head"),m=document.head;if(null==i)return;var u=new Map;for(const e of i.children)u.set(e.outerHTML,e);var s=e.getAttributeValue(i,"hx-head")||r;for(const t of m.children){var l=u.has(t.outerHTML),c="re-eval"===t.getAttribute("hx-head"),g="true"===e.getAttributeValue(t,"hx-preserve");l||g?c?a.push(t):(u.delete(t.outerHTML),o.push(t)):"append"===s?c&&(a.push(t),h.push(t)):!1!==e.triggerEvent(document.body,"htmx:removingHeadElement",{headElement:t})&&a.push(t)}h.push(...u.values());for(const t of h){var v=document.createRange().createContextualFragment(t.outerHTML);!1!==e.triggerEvent(document.body,"htmx:addingHeadElement",{headElement:v})&&(m.appendChild(v),d.push(v))}for(const t of a)!1!==e.triggerEvent(document.body,"htmx:removingHeadElement",{headElement:t})&&m.removeChild(t);e.triggerEvent(document.body,"htmx:afterHeadMerge",{added:d,kept:o,removed:a})}}}htmx.defineExtension("head-support",{init:function(r){e=r,htmx.on("htmx:afterSwap",(function(r){let n=r.detail.xhr;if(n){var d=n.response;e.triggerEvent(document.body,"htmx:beforeHeadMerge",r.detail)&&t(d,r.detail.boosted?"merge":"append")}})),htmx.on("htmx:historyRestore",(function(r){e.triggerEvent(document.body,"htmx:beforeHeadMerge",r.detail)&&(r.detail.cacheMiss?t(r.detail.serverResponse,"merge"):t(r.detail.item.head,"merge"))})),htmx.on("htmx:historyItemCreated",(function(e){e.detail.item.head=document.head.outerHTML}))}})}(); 8 | //# sourceMappingURL=/sm/1868f0aea5c9a8df6bb1a3d1df79f14656342e0ce8090abcf344d1dfcf5c939e.map -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "estebanforge/hyperpress", 3 | "description": "Supercharge WordPress with the power of hypermedia. Use HTMX, Alpine Ajax, and Datastar to create rich, interactive blocks and pages—all with the simplicity of PHP.", 4 | "type": "wordpress-plugin", 5 | "version": "3.0.3", 6 | "license": "GPL-2.0-or-later", 7 | "authors": [ 8 | { 9 | "name": "Esteban Cuevas", 10 | "email": "esteban@actitud.xyz" 11 | } 12 | ], 13 | "minimum-stability": "RC", 14 | "prefer-stable": true, 15 | "require": { 16 | "php": ">=8.1", 17 | "starfederation/datastar-php": "^1.0", 18 | "estebanforge/hyperfields": "^1.0.1" 19 | }, 20 | "scripts": { 21 | 22 | "test:setup": "php setup-sqlite-db.php", 23 | "cs:fix": "php-cs-fixer fix", 24 | "dump-autoload-prod": "@php composer dump-autoload --optimize --no-dev", 25 | "dump-autoload-dev": "@php composer dump-autoload", 26 | "production": [ 27 | "@cs-fix", 28 | "@dump-autoload-prod" 29 | ], 30 | "post-install-cmd": [ 31 | "@cs-fix", 32 | "@dump-autoload-prod", 33 | "php .ci/setup-sqlite-dropin.php" 34 | ], 35 | "post-update-cmd": [ 36 | "@cs-fix", 37 | "@dump-autoload-prod", 38 | "php .ci/setup-sqlite-dropin.php" 39 | ], 40 | "version-bump": "php .ci/version-bump.php" 41 | }, 42 | "autoload": { 43 | "psr-4": { 44 | "HyperPress\\": "src/" 45 | }, 46 | "files": [ 47 | "bootstrap.php" 48 | ], 49 | "exclude-from-classmap": [ 50 | "**/vendor/starfederation/datastar-php/**" 51 | ] 52 | }, 53 | "autoload-dev": { 54 | "psr-4": { 55 | "HyperPress\\Tests\\": "tests/" 56 | } 57 | }, 58 | "config": { 59 | "allow-plugins": { 60 | "composer/installers": true 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/hyperoptions/conditional-logic-test.php: -------------------------------------------------------------------------------- 1 | set_icon('dashicons-admin-generic') 16 | ->setPosition(100); 17 | 18 | // Test Section 19 | $test_section = $container->addSection('test', 'Test Section', 'Test conditional logic functionality'); 20 | 21 | $test_section 22 | ->addField(HyperFields::makeField('select', 'show_extra_fields', 'Show Extra Fields?') 23 | ->setOptions([ 24 | 'no' => 'No', 25 | 'yes' => 'Yes', 26 | ]) 27 | ->setDefault('no')) 28 | 29 | ->addField(HyperFields::makeField('text', 'extra_text_field', 'Extra Text Field') 30 | ->setConditionalLogic([ 31 | 'relation' => 'AND', 32 | 'conditions' => [[ 33 | 'field' => 'show_extra_fields', 34 | 'compare' => '=', 35 | 'value' => 'yes', 36 | ]], 37 | ]) 38 | ->setPlaceholder('This field is shown conditionally')) 39 | 40 | ->addField(HyperFields::makeField('textarea', 'extra_textarea_field', 'Extra Textarea Field') 41 | ->setConditionalLogic([ 42 | 'relation' => 'AND', 43 | 'conditions' => [[ 44 | 'field' => 'show_extra_fields', 45 | 'compare' => '=', 46 | 'value' => 'yes', 47 | ]], 48 | ]) 49 | ->setPlaceholder('Another conditionally shown field')); 50 | 51 | $container->register(); 52 | } 53 | 54 | // Activate the test 55 | add_action('init', 'hyperfields_conditional_logic_test'); 56 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-multiselect.php: -------------------------------------------------------------------------------- 1 | 25 | 26 |
> 27 | 31 | 32 |
33 | 45 | 46 | 47 |

48 | 49 |
50 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-radio.php: -------------------------------------------------------------------------------- 1 | 26 | 27 |
> 28 | 32 | 33 |
34 |
35 | $option_label): ?> 36 | 44 | 45 |
46 | 47 | 48 |

49 | 50 |
51 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-oembed.php: -------------------------------------------------------------------------------- 1 | 23 | 24 |
> 25 | 29 | 30 |
31 | 37 | class="regular-text hyperpress-oembed-input"> 38 | 39 | 42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 | 50 |

51 | 52 |
53 |
54 | -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/client-side-templates.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-client-side-templates@2.0.2/client-side-templates.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | htmx.defineExtension("client-side-templates",{transformResponse:function(e,t,r){var n=htmx.closest(r,"[mustache-template]");if(n){var a=JSON.parse(e),s=n.getAttribute("mustache-template");if(w=htmx.find("#"+s))return Mustache.render(w.innerHTML,a);throw new Error("Unknown mustache template: "+s)}var i=htmx.closest(r,"[mustache-array-template]");if(i){if(a=JSON.parse(e),s=i.getAttribute("mustache-array-template"),w=htmx.find("#"+s))return Mustache.render(w.innerHTML,{data:a});throw new Error("Unknown mustache template: "+s)}var m=htmx.closest(r,"[handlebars-template]");if(m){a=JSON.parse(e),s=m.getAttribute("handlebars-template");var l=htmx.find("#"+s).innerHTML;if(u=Handlebars.compile(l))return u(a);throw new Error("Unknown handlebars template: "+s)}var o=htmx.closest(r,"[handlebars-array-template]");if(o){var u;if(a=JSON.parse(e),s=o.getAttribute("handlebars-array-template"),l=htmx.find("#"+s).innerHTML,u=Handlebars.compile(l))return u(a);throw new Error("Unknown handlebars template: "+s)}var p=htmx.closest(r,"[nunjucks-template]");if(p){a=JSON.parse(e);var h=p.getAttribute("nunjucks-template");return(w=htmx.find("#"+h))?nunjucks.renderString(w.innerHTML,a):nunjucks.render(h,a)}var c=htmx.closest(r,"[xslt-template]");if(c){if(s=c.getAttribute("xslt-template"),w=htmx.find("#"+s)){var d=w.innerHTML?(new DOMParser).parseFromString(w.innerHTML,"application/xml"):w.contentDocument,f=new XSLTProcessor;f.importStylesheet(d),a=(new DOMParser).parseFromString(e,"application/xml");var x=f.transformToFragment(a,document);return(new XMLSerializer).serializeToString(x)}throw new Error("Unknown XSLT template: "+s)}var w,b=htmx.closest(r,"[nunjucks-array-template]");return b?(a=JSON.parse(e),h=b.getAttribute("nunjucks-array-template"),(w=htmx.find("#"+h))?nunjucks.renderString(w.innerHTML,{data:a}):nunjucks.render(h,{data:a})):e}}); 8 | //# sourceMappingURL=/sm/5a4da8fa1e5730576db5f26136afa6be8bb49e990875a8e79870f132b4e50339.map -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-sidebar.php: -------------------------------------------------------------------------------- 1 | ['name' => __('— Select —', 'api-for-htmx')]] + $sidebars; 31 | ?> 32 | 33 |
> 34 | 38 | 39 |
40 | 50 | 51 | 52 |

53 | 54 |
55 |
56 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-file.php: -------------------------------------------------------------------------------- 1 | 22 | 23 |
> 24 | 28 | 29 |
30 |
31 | 37 | class="regular-text hyperpress-file-url"> 38 | 41 |
42 | 43 | 44 |
45 | 46 | 47 | 48 |
49 | 50 | 51 | 52 |

53 | 54 |
55 |
56 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-set.php: -------------------------------------------------------------------------------- 1 | 27 | 28 |
> 29 | 33 | 34 |
35 | 36 | 37 | 38 |
39 | $option_label): ?> 40 | 48 | 49 |
50 | 51 | 52 |

53 | 54 |
55 |
-------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-radio-image.php: -------------------------------------------------------------------------------- 1 | 26 | 27 |
> 28 | 32 | 33 |
34 |
35 | $option_image): ?> 36 | 47 | 48 |
49 | 50 | 51 |

52 | 53 |
54 |
-------------------------------------------------------------------------------- /vendor/starfederation/datastar-php/README.md: -------------------------------------------------------------------------------- 1 | [![Stable Version](https://img.shields.io/packagist/v/starfederation/datastar-php?label=stable)]((https://packagist.org/packages/starfederation/datastar-php)) 2 | [![Total Downloads](https://img.shields.io/packagist/dt/starfederation/datastar-php)](https://packagist.org/packages/starfederation/datastar-php) 3 | 4 |

5 | 6 | # Datastar PHP SDK 7 | 8 | This package provides a PHP SDK for working with [Datastar](https://data-star.dev/). 9 | 10 | ## License 11 | 12 | This package is licensed for free under the MIT License. 13 | 14 | ## Requirements 15 | 16 | This package requires PHP 8.1 or later. 17 | 18 | ## Installation 19 | 20 | Install using composer. 21 | 22 | ```shell 23 | composer require starfederation/datastar-php 24 | ``` 25 | 26 | ## Usage 27 | 28 | ```php 29 | use starfederation\datastar\ServerSentEventGenerator; 30 | 31 | // Reads signals from the request. 32 | $signals = ServerSentEventGenerator::readSignals(); 33 | ``` 34 | 35 | ```php 36 | use starfederation\datastar\enums\EventType; 37 | use starfederation\datastar\enums\ElementPatchMode; 38 | use starfederation\datastar\ServerSentEventGenerator; 39 | 40 | // Creates a new `ServerSentEventGenerator` instance. 41 | $sse = new ServerSentEventGenerator(); 42 | 43 | // Sends the response headers. 44 | // If your framework has its own way of sending response headers, manually send the headers returned by `ServerSentEventGenerator::headers()` instead. 45 | $sse->sendHeaders(); 46 | 47 | // Patches elements into the DOM. 48 | $sse->patchElements('
', [ 49 | 'selector' => '#my-div', 50 | 'mode' => ElementPatchMode::Append, 51 | 'useViewTransition' => true, 52 | ]); 53 | 54 | // Patches elements into the DOM. 55 | $sse->removeElements('#my-div', [ 56 | 'useViewTransition' => true, 57 | ]); 58 | 59 | // Patches signals. 60 | $sse->patchSignals('{foo: 123}', [ 61 | 'onlyIfMissing' => true, 62 | ]); 63 | 64 | // Executes JavaScript in the browser. 65 | $sse->executeScript('console.log("Hello, world!")', [ 66 | 'autoRemove' => true, 67 | 'attributes' => [ 68 | 'type' => 'application/javascript', 69 | ], 70 | ]); 71 | 72 | // Redirects the browser by setting the location to the provided URI. 73 | $sse->location('/guide'); 74 | ``` 75 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-association.php: -------------------------------------------------------------------------------- 1 | $post_type, 27 | 'posts_per_page' => -1, 28 | 'post_status' => 'publish', 29 | ]); 30 | 31 | $value = is_array($value) ? $value : [$value]; 32 | ?> 33 | 34 |
> 35 | 39 | 40 |
41 | 54 | 55 | 56 |

57 | 58 |
59 |
60 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/composer/InstalledVersions.php', 10 | 'HyperFields\\Admin\\Activation' => $baseDir . '/src/Admin/Activation.php', 11 | 'HyperFields\\Admin\\Options' => $baseDir . '/src/Admin/Options.php', 12 | 'HyperFields\\Admin\\OptionsMigration' => $baseDir . '/src/Admin/OptionsMigration.php', 13 | 'HyperFields\\Assets' => $baseDir . '/src/Assets.php', 14 | 'HyperFields\\BlockFieldAdapter' => $baseDir . '/src/BlockFieldAdapter.php', 15 | 'HyperFields\\ConditionalLogic' => $baseDir . '/src/ConditionalLogic.php', 16 | 'HyperFields\\Container\\Container' => $baseDir . '/src/Container/Container.php', 17 | 'HyperFields\\Container\\ContainerFactory' => $baseDir . '/src/Container/ContainerFactory.php', 18 | 'HyperFields\\Container\\PostMetaContainer' => $baseDir . '/src/Container/PostMetaContainer.php', 19 | 'HyperFields\\Container\\TermMetaContainer' => $baseDir . '/src/Container/TermMetaContainer.php', 20 | 'HyperFields\\Container\\UserMetaContainer' => $baseDir . '/src/Container/UserMetaContainer.php', 21 | 'HyperFields\\CustomField' => $baseDir . '/src/CustomField.php', 22 | 'HyperFields\\Field' => $baseDir . '/src/Field.php', 23 | 'HyperFields\\HeadingField' => $baseDir . '/src/HeadingField.php', 24 | 'HyperFields\\HyperFields' => $baseDir . '/src/HyperFields.php', 25 | 'HyperFields\\Log' => $baseDir . '/src/Log.php', 26 | 'HyperFields\\OptionField' => $baseDir . '/src/OptionField.php', 27 | 'HyperFields\\OptionsPage' => $baseDir . '/src/OptionsPage.php', 28 | 'HyperFields\\OptionsSection' => $baseDir . '/src/OptionsSection.php', 29 | 'HyperFields\\PostField' => $baseDir . '/src/PostField.php', 30 | 'HyperFields\\Registry' => $baseDir . '/src/Registry.php', 31 | 'HyperFields\\RepeaterField' => $baseDir . '/src/RepeaterField.php', 32 | 'HyperFields\\SeparatorField' => $baseDir . '/src/SeparatorField.php', 33 | 'HyperFields\\TabsField' => $baseDir . '/src/TabsField.php', 34 | 'HyperFields\\TemplateLoader' => $baseDir . '/src/TemplateLoader.php', 35 | 'HyperFields\\TermField' => $baseDir . '/src/TermField.php', 36 | 'HyperFields\\UserField' => $baseDir . '/src/UserField.php', 37 | ); 38 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/templates/field-image.php: -------------------------------------------------------------------------------- 1 | 23 | 24 |
> 25 | 29 | 30 |
31 |
32 | 33 | 34 | 37 | 38 | 41 | 42 |
43 | 44 | 45 | 46 |
47 |
48 | 49 | 50 |

51 | 52 |
53 |
54 | -------------------------------------------------------------------------------- /assets/js/editor.js: -------------------------------------------------------------------------------- 1 | (()=>{"use strict";const e=window.React,t=window.wp.blocks,o=window.wp.blockEditor,r=window.wp.components,n=window.wp.i18n,l=window.wp.element;function a({attributes:t,setAttributes:a,name:c}){const i=(0,o.useBlockProps)(),[s,p]=(0,l.useState)([]),[m,u]=(0,l.useState)(""),[f,d]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{wp.apiFetch({path:`/hyperblocks/v1/block-fields?name=${c}`}).then((e=>{p(e||[])})).catch((e=>{console.error("Failed to fetch block fields:",e),p([])}))}),[c]),(0,l.useEffect)((()=>{c&&!f&&(d(!0),wp.apiFetch({path:"/hyperblocks/v1/render-preview",method:"POST",data:{blockName:c,attributes:t}}).then((e=>{e.success?u(e.html):u(`
Preview Error: ${e.error}
`)})).catch((e=>{console.error("Failed to fetch preview:",e),u('
Preview failed to load
')})).finally((()=>{d(!1)})))}),[t,c]),(0,e.createElement)("div",{...i},(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)(r.PanelBody,{title:(0,n.__)("Block Settings","hyperblocks")},s.map((o=>function(o){const n={key:o.name,label:o.label,value:t[o.name],onChange:e=>function(e,t){a({[e]:t})}(o.name,e)};switch(o.type){case"text":return(0,e.createElement)(r.TextControl,{...n,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0});case"textarea":return(0,e.createElement)(r.TextareaControl,{...n,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0});case"color":return(0,e.createElement)(r.ColorPalette,{...n,colors:[{name:"Red",color:"#f00"},{name:"Blue",color:"#00f"},{name:"Green",color:"#0f0"},{name:"Yellow",color:"#fff000"},{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"}]});case"url":return(0,e.createElement)(r.TextControl,{...n,type:"url",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0});default:return(0,e.createElement)(r.TextControl,{...n,help:`Unknown field type: ${o.type}`,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}}(o))))),f&&(0,e.createElement)("div",{className:"hyperblocks-loading"},(0,e.createElement)("p",null,(0,n.__)("Loading preview...","hyperblocks"))),!f&&m&&(0,e.createElement)("div",{className:"hyperblocks-preview",dangerouslySetInnerHTML:{__html:m}}),!f&&!m&&(0,e.createElement)("div",{className:"hyperblocks-placeholder"},(0,e.createElement)("p",null,(0,n.__)("Configure your block settings to see a preview.","hyperblocks"))))}window.hyperBlocksConfig&&window.hyperBlocksConfig.forEach((function(e){(0,t.registerBlockType)(e.name,{title:e.title,icon:e.icon,category:"widgets",edit:a,save:function(){return null}})}))})(); -------------------------------------------------------------------------------- /assets/libs/htmx-extensions/loading-states.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Minified by jsDelivr using Terser v5.39.0. 3 | * Original file: /npm/htmx-ext-loading-states@2.0.2/loading-states.js 4 | * 5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files 6 | */ 7 | !function(){const t=[];function n(t,n){document.body.contains(t)&&n()}function a(a,o,i,c){const e=htmx.closest(a,"[data-loading-delay]");if(e){const a=e.getAttribute("data-loading-delay")||200,f=setTimeout((function(){i(),t.push((function(){n(o,c)}))}),a);t.push((function(){n(o,(function(){clearTimeout(f)}))}))}else i(),t.push((function(){n(o,c)}))}function o(t,n,a){return Array.from(htmx.findAll(t,"["+n+"]")).filter((function(t){return function(t,n){const a=htmx.closest(t,"[data-loading-path]");return!a||a.getAttribute("data-loading-path")===n}(t,a)}))}function i(t){return t.getAttribute("data-loading-target")?Array.from(htmx.findAll(t.getAttribute("data-loading-target"))):[t]}htmx.defineExtension("loading-states",{onEvent:function(n,c){if("htmx:beforeRequest"===n){const t=(e=c.target,htmx.closest(e,"[data-loading-states]")||document.body),n={};["data-loading","data-loading-class","data-loading-class-remove","data-loading-disable","data-loading-aria-busy"].forEach((function(a){n[a]=o(t,a,c.detail.pathInfo.requestPath)})),n["data-loading"].forEach((function(t){i(t).forEach((function(n){a(t,n,(function(){n.style.display=t.getAttribute("data-loading")||"inline-block"}),(function(){n.style.display="none"}))}))})),n["data-loading-class"].forEach((function(t){const n=t.getAttribute("data-loading-class").split(" ");i(t).forEach((function(o){a(t,o,(function(){n.forEach((function(t){o.classList.add(t)}))}),(function(){n.forEach((function(t){o.classList.remove(t)}))}))}))})),n["data-loading-class-remove"].forEach((function(t){const n=t.getAttribute("data-loading-class-remove").split(" ");i(t).forEach((function(o){a(t,o,(function(){n.forEach((function(t){o.classList.remove(t)}))}),(function(){n.forEach((function(t){o.classList.add(t)}))}))}))})),n["data-loading-disable"].forEach((function(t){i(t).forEach((function(n){a(t,n,(function(){n.disabled=!0}),(function(){n.disabled=!1}))}))})),n["data-loading-aria-busy"].forEach((function(t){i(t).forEach((function(n){a(t,n,(function(){n.setAttribute("aria-busy","true")}),(function(){n.removeAttribute("aria-busy")}))}))}))}var e;if("htmx:beforeOnLoad"===n)for(;t.length>0;)t.shift()()}})}(); 8 | //# sourceMappingURL=/sm/6aa3fcdb19acd54eb35e8e0eeaa2bc87d2bba061c085676837459d0e5514f01f.map -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | ./tests/Integration 17 | 18 | 19 | ./tests/Feature 20 | 21 | 22 | 23 | 24 | ./src 25 | 26 | 27 | ./src/Block 28 | ./src/Fields/templates 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/README.md: -------------------------------------------------------------------------------- 1 | # HyperFields 2 | 3 | A powerful custom field system for WordPress, providing metaboxes, options pages, and conditional logic. 4 | 5 | ## Installation 6 | 7 | ### As a Plugin 8 | 9 | 1. Download the plugin zip file 10 | 2. Upload to your WordPress plugins directory 11 | 3. Activate the plugin 12 | 13 | ### As a Composer Library 14 | 15 | ```bash 16 | composer require estebanforge/hyperfields 17 | ``` 18 | 19 | Then include the bootstrap file in your project: 20 | 21 | ```php 22 | require_once 'path/to/hyperfields/bootstrap.php'; 23 | ``` 24 | 25 | ## Usage 26 | 27 | ### Helper Functions 28 | 29 | HyperFields provides convenient helper functions with the `hf_` prefix: 30 | 31 | ```php 32 | // Create a field 33 | $field = hf_field('text', 'my_field', 'My Field'); 34 | 35 | // Get field value 36 | $value = hf_get_field('my_field', 'option', ['option_group' => 'my_options']); 37 | 38 | // Update field value 39 | hf_update_field('my_field', 'new value', 'option', ['option_group' => 'my_options']); 40 | 41 | // Create an options page 42 | $page = hf_option_page('My Settings', 'my-settings'); 43 | ``` 44 | 45 | ### Creating Fields 46 | 47 | ```php 48 | use HyperFields\Field; 49 | use HyperFields\OptionsPage; 50 | 51 | // Create an options page 52 | $page = OptionsPage::make('My Settings', 'my-settings'); 53 | 54 | // Add fields 55 | $page->addField( 56 | Field::make('text', 'site_title', 'Site Title') 57 | ->setDefault('My Awesome Site') 58 | ->setRequired() 59 | ); 60 | 61 | // Render the page 62 | $page->render(); 63 | ``` 64 | 65 | ## Field Types 66 | 67 | - text 68 | - textarea 69 | - number 70 | - email 71 | - url 72 | - color 73 | - date 74 | - datetime 75 | - time 76 | - image 77 | - file 78 | - select 79 | - multiselect 80 | - checkbox 81 | - radio 82 | - radio_image 83 | - rich_text 84 | - hidden 85 | - html 86 | - map 87 | - oembed 88 | - separator 89 | - header_scripts 90 | - footer_scripts 91 | - set 92 | - sidebar 93 | - association 94 | - tabs 95 | - custom 96 | - heading 97 | - media_gallery 98 | 99 | ## Features 100 | 101 | - Conditional logic 102 | - Validation 103 | - Sanitization 104 | - Multiple storage types (post meta, user meta, term meta, options) 105 | - Custom field containers 106 | - Repeater fields 107 | - Tabbed interfaces 108 | - Extensive hooks and filters 109 | 110 | ## Requirements 111 | 112 | - PHP 8.1+ 113 | - WordPress 5.0+ 114 | 115 | ## License 116 | 117 | GPL-2.0-or-later 118 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/BlockFieldAdapter.php: -------------------------------------------------------------------------------- 1 | field = $field; 15 | $this->block_attributes = $block_attributes; 16 | } 17 | 18 | public static function fromField(Field $field, array $blockAttributes = []): self 19 | { 20 | return new self($field, $blockAttributes); 21 | } 22 | 23 | public function getValue(): mixed 24 | { 25 | $field_name = $this->field->getName(); 26 | $default = $this->field->getDefault(); 27 | 28 | return $this->block_attributes[$field_name] ?? $default; 29 | } 30 | 31 | public function setValue(mixed $value): void 32 | { 33 | // Block attributes are handled by Gutenberg, not stored directly 34 | // This method exists for interface consistency 35 | } 36 | 37 | public function getField(): Field 38 | { 39 | return $this->field; 40 | } 41 | 42 | public function getAttributeName(): string 43 | { 44 | return $this->field->getName(); 45 | } 46 | 47 | public function toBlockAttribute(): array 48 | { 49 | $fieldType = $this->field->getType(); 50 | $default = $this->field->getDefault(); 51 | 52 | // Map field types to WordPress block attribute types 53 | $typeMap = [ 54 | 'text' => 'string', 55 | 'textarea' => 'string', 56 | 'number' => 'number', 57 | 'email' => 'string', 58 | 'url' => 'string', 59 | 'color' => 'string', 60 | 'date' => 'string', 61 | 'datetime' => 'string', 62 | 'image' => 'number', // Store as attachment ID 63 | 'file' => 'string', // Store as URL or ID 64 | 'select' => 'string', 65 | 'checkbox' => 'boolean', 66 | 'radio' => 'string', 67 | 'wysiwyg' => 'string', 68 | ]; 69 | 70 | $attributeType = $typeMap[$fieldType] ?? 'string'; 71 | 72 | return [ 73 | 'type' => $attributeType, 74 | 'default' => $default, 75 | ]; 76 | } 77 | 78 | public function sanitizeForBlock(mixed $value): mixed 79 | { 80 | return $this->field->sanitizeValue($value); 81 | } 82 | 83 | public function validateForBlock(mixed $value): bool 84 | { 85 | return $this->field->validateValue($value); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | === HyperPress: Modern Hypermedia for WordPress === 2 | Contributors: tcattd 3 | Tags: hypermedia, ajax, htmx, alpinejs, datastar 4 | Stable tag: 3.0.3 5 | Requires at least: 6.4 6 | Tested up to: 6.6 7 | Requires PHP: 8.1 8 | License: GPLv2 or later 9 | License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 | 11 | Supercharge WordPress with Hypermedia. Build interactive blocks & pages with Datastar, HTMX or Alpine Ajax—all using simple PHP. No JS required. 12 | 13 | == Description == 14 | Supercharge WordPress with the power of hypermedia. Use Datastar, HTMX or Alpine Ajax to create rich, interactive blocks and pages—all with the simplicity of PHP. No JavaScript required. 15 | 16 | Hypermedia is a concept that extends the idea of hypertext by allowing for more complex interactions and data representations. It enables the use of AJAX, WebSockets, and Server-Sent Events directly in HTML using attributes, without writing any JavaScript. It reuses an "old" concept, [Hypermedia](https://hypermedia.systems/), to handle the modern web in a more HTML-like and natural way. 17 | 18 | Check the [full feature set at here](https://github.com/EstebanForge/HyperPress). 19 | 20 | This plugin include several Hypermedia libraries by default, locally from the plugin folder. Currently, it includes: 21 | 22 | - [HTMX](https://htmx.org/) with [Hyperscript](https://hyperscript.org/). 23 | - [Alpine Ajax](https://alpine-ajax.js.org/) with [Alpine.js](https://alpinejs.dev/). 24 | - [Datastar](https://data-star.dev/). 25 | 26 | The plugin has an opt-in option, not enforced, to include these third-party libraries from a CDN (using the unpkg.com service). You must explicitly enable this option for privacy and security reasons. 27 | 28 | == Installation == 29 | 1. Install HyperPress from WordPress repository. Plugins > Add New > Search for: HyperPress (or Hypermedia). Activate it. 30 | 2. Configure HyperPress at Settings > HyperPress. 31 | 3. Enjoy. 32 | 33 | == Frequently Asked Questions == 34 | = Where is the FAQ? = 35 | You can [read the full FAQ at GitHub](https://github.com/EstebanForge/HyperPress/blob/main/docs/faq.md). 36 | 37 | = Suggestions, Support? = 38 | Please, open [a discussion](https://github.com/EstebanForge/HyperPress/discussions). 39 | 40 | = Found a Bug or Error? = 41 | Please, open [an issue](https://github.com/EstebanForge/HyperPress/issues). 42 | 43 | == Screenshots == 44 | 1. Main options page. 45 | 2. About 46 | 47 | == Upgrade Notice == 48 | Nothing to see here. 49 | 50 | == Changelog == 51 | [Check the changelog at GitHub](https://github.com/EstebanForge/HyperPress/blob/master/CHANGELOG.md). 52 | -------------------------------------------------------------------------------- /vendor/estebanforge/hyperfields/src/CustomField.php: -------------------------------------------------------------------------------- 1 | render_callback = $callback; 22 | 23 | return $this; 24 | } 25 | 26 | public function setSanitizeCallback(string $callback): self 27 | { 28 | $this->sanitize_callback = $callback; 29 | 30 | return $this; 31 | } 32 | 33 | public function setValidateCallback(string $callback): self 34 | { 35 | $this->validate_callback = $callback; 36 | 37 | return $this; 38 | } 39 | 40 | public function setAssets(array $assets): self 41 | { 42 | $this->assets = $assets; 43 | 44 | return $this; 45 | } 46 | 47 | public function getRenderCallback(): string 48 | { 49 | return $this->render_callback; 50 | } 51 | 52 | public function getSanitizeCallback(): string 53 | { 54 | return $this->sanitize_callback; 55 | } 56 | 57 | public function getValidateCallback(): string 58 | { 59 | return $this->validate_callback; 60 | } 61 | 62 | public function getAssets(): array 63 | { 64 | return $this->assets; 65 | } 66 | 67 | public function sanitizeValue(mixed $value): mixed 68 | { 69 | if (!empty($this->sanitize_callback) && is_callable($this->sanitize_callback)) { 70 | return call_user_func($this->sanitize_callback, $value); 71 | } 72 | 73 | return sanitize_text_field((string) $value); 74 | } 75 | 76 | public function validateValue(mixed $value): bool 77 | { 78 | if (!empty($this->validate_callback) && is_callable($this->validate_callback)) { 79 | return (bool) call_user_func($this->validate_callback, $value); 80 | } 81 | 82 | return true; 83 | } 84 | 85 | public function toArray(): array 86 | { 87 | return array_merge(parent::toArray(), [ 88 | 'render_callback' => $this->render_callback, 89 | 'sanitize_callback' => $this->sanitize_callback, 90 | 'validate_callback' => $this->validate_callback, 91 | 'assets' => $this->assets, 92 | ]); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /hypermedia/noswap/datastar-demo.hp.php: -------------------------------------------------------------------------------- 1 | '', 'email' => '']; 38 | break; 39 | case 'fetch_merge': 40 | $message = 'Data fetched and merged successfully!'; 41 | $extra_data['serverTime'] = current_time('Y-m-d H:i:s'); 42 | $extra_data['randomNumber'] = wp_rand(1, 1000); 43 | break; 44 | default: 45 | $message = 'Datastar request processed via noswap template.'; 46 | } 47 | 48 | // For Datastar, we need to send the response in a format that can be merged into the store 49 | $response_data = [ 50 | 'status' => $status, 51 | 'nonce' => wp_create_nonce('hyperpress_nonce'), 52 | 'message' => $message, 53 | 'demo_type' => $demo_type, 54 | 'params' => $hp_vals, 55 | 'timestamp' => current_time('mysql'), 56 | ]; 57 | 58 | // Merge any extra data 59 | $response_data = array_merge($response_data, $extra_data); 60 | 61 | // Send appropriate headers for Datastar store merging 62 | if (!headers_sent()) { 63 | // For Datastar, we can send data that gets merged into the store 64 | header('Content-Type: text/vnd.datastar'); 65 | 66 | // Send a merge fragment that updates the store 67 | echo 'data: merge ' . wp_json_encode($response_data) . "\n\n"; 68 | } else { 69 | // Fallback to standard response 70 | hp_send_header_response( 71 | wp_create_nonce('hyperpress_nonce'), 72 | $response_data 73 | ); 74 | } 75 | -------------------------------------------------------------------------------- /docs/helper-functions.md: -------------------------------------------------------------------------------- 1 | # Helper Functions 2 | 3 | Core helpers for endpoints, responses, validation, library mode, Datastar SSE integration, and field CRUD. 4 | 5 | Source: `src/plugins/HyperPress/includes/helpers.php` 6 | 7 | ## Endpoints 8 | 9 | ```php 10 | hp_get_endpoint_url(string $template_path = ''): string 11 | hp_endpoint_url(string $template_path = ''): void 12 | ``` 13 | 14 | - Always prefer these to hardcoding `/wp-html/v1/...`. 15 | - Use inside templates and theme code. 16 | 17 | ## Responses and Errors 18 | 19 | ```php 20 | hp_send_header_response(array $data = [], string $action = null): void 21 | hp_die(string $message = '', bool $display_error = false): void 22 | ``` 23 | 24 | - Send structured HX-Trigger responses for noswap actions. 25 | - `hp_die()` returns 200 to let hypermedia libraries handle errors gracefully. 26 | 27 | ## Security 28 | 29 | ```php 30 | hp_validate_request(array $hmvals = null, string $action = null): bool 31 | ``` 32 | 33 | - Validates nonce from header or request and optional action. 34 | - Supports both new (`hyperpress_nonce`) and legacy (`hxwp_nonce`) nonces. 35 | 36 | ## Library Mode 37 | 38 | ```php 39 | hp_is_library_mode(): bool 40 | ``` 41 | 42 | - Detects if HyperPress is loaded as a Composer library vs active plugin. 43 | 44 | ## Datastar (SSE) Integration 45 | 46 | ```php 47 | hp_ds_sse(): ?ServerSentEventGenerator 48 | hp_ds_read_signals(): array 49 | hp_ds_patch_elements(string $html, array $options = []): void 50 | hp_ds_remove_elements(string $selector, array $options = []): void 51 | hp_ds_patch_signals(mixed $signals, array $options = []): void 52 | hp_ds_execute_script(string $script, array $options = []): void 53 | hp_ds_location(string $url): void 54 | ``` 55 | 56 | - Real-time UI updates via SSE with patch/remove/signals/script/location helpers. 57 | 58 | ### Rate Limiting (SSE) 59 | 60 | ```php 61 | hp_ds_is_rate_limited(array $options = []): bool 62 | ``` 63 | 64 | - Returns true when the request is blocked by the rate limiter. 65 | - Sends SSE feedback (error element + updated signals) when enabled. 66 | - Options include `requests_per_window`, `time_window_seconds`, `identifier`, `send_sse_response`, `error_message`, `error_selector`. 67 | 68 | ## Field CRUD 69 | 70 | ```php 71 | hp_get_field(string $name, $source = null, array $args = []) 72 | hp_update_field(string $name, $value, $source = null, array $args = []): bool 73 | hp_delete_field(string $name, $source = null, array $args = []): bool 74 | ``` 75 | 76 | - Works with post/user/term meta and options, resolved by `hp_resolve_field_context()`. 77 | - Pass `['type' => '...']` to `hp_update_field()` to enable sanitization via `Field::sanitizeValue()`. 78 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # HyperPress Documentation 2 | 3 | Documentation for the HyperPress plugin, with its Hypermedia REST API, and its libraries: HyperFields and HyperBlocks. 4 | 5 | ## Index 6 | 7 | - [Installation](./installation.md) 8 | - [How to use](./how-to-use.md) 9 | - [Passing Data to Templates](./how-to-use.md#passing-data-to-templates) 10 | - [No Swap Response Templates](./how-to-use.md#no-swap-response-templates) 11 | - [Hypermedia Libraries](./hypermedia-libraries.md) 12 | 13 | - [HyperBlocks](./hyperblocks.md) 14 | - [Getting Started](./hyperblocks.md#getting-started) 15 | - [Why HyperBlocks](./hyperblocks.md#why-hyperblocks) 16 | - [Two Development Approaches](./hyperblocks.md#two-development-approaches) 17 | - [Fluent API](./hyperblocks.md#1-fluent-api) 18 | - [block.json Approach](./hyperblocks.md#2-blockjson-approach-wordpress-standard) 19 | - [Block Fields in Inspector](./hyperblocks.md#block-fields-in-inspector) 20 | - [REST API](./hyperblocks.md#rest-api) 21 | - [Side-by-Side Comparison](./hyperblocks.md#side-by-side-comparison) 22 | - [Auto-Discovery & Registration](./hyperblocks.md#auto-discovery--registration) 23 | - [When to Choose Which](./hyperblocks.md#when-to-choose-which) 24 | - [Technical Details](./hyperblocks.md#technical-details) 25 | - [Demo Blocks Included](./hyperblocks.md#demo-blocks-included) 26 | - [Notes](./hyperblocks.md#notes) 27 | 28 | - [Helper Functions](./helper-functions.md) 29 | - [Datastar Helper Functions](./datastar-helpers.md) 30 | - [Quick Start: Minimal SSE Example](./datastar-helpers.md#quick-start-minimal-sse-example) 31 | - [HyperBlocks Examples](./hyperblocks-examples.md) 32 | - [Options Page Compact Input](./options-compact-input.md) 33 | 34 | - [Developer Configuration](./developer-configuration.md) 35 | - [Managing Frontend Libraries](./developer-configuration.md#managing-frontend-libraries) 36 | - [Using Hypermedia Libraries in your plugin](./developer-configuration.md#using-hypermedia-libraries-in-your-plugin) 37 | - [Programmatic Configuration via Filters](./developer-configuration.md#programmatic-configuration-via-filters) 38 | - [Register Custom Template Paths](./developer-configuration.md#register-custom-template-paths) 39 | - [Customize Sanitization](./developer-configuration.md#customize-sanitization) 40 | - [Customize Asset Loading](./developer-configuration.md#customize-asset-loading) 41 | - [Disable Admin Interface Completely](./developer-configuration.md#disable-admin-interface-completely) 42 | - [Library Detection](./library-detection.md) 43 | - [Security & Validation](./security.md) 44 | - [FAQ](./faq.md) 45 | - [CHANGELOG](../CHANGELOG.md) 46 | -------------------------------------------------------------------------------- /.ci/version-bump.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | $files = [ 9 | 'package.json', 10 | 'composer.json', 11 | 'README.txt', 12 | 'api-for-htmx.php', 13 | 'SECURITY.md', 14 | ]; 15 | 16 | $pluginDir = __DIR__ . '/../'; 17 | 18 | function getCurrentVersion(string $file): ?string 19 | { 20 | $content = file_get_contents($file); 21 | if (preg_match('/"version"\s*:\s*"([0-9]+\.[0-9]+\.[0-9]+)"/', $content, $m)) { 22 | return $m[1]; 23 | } 24 | if (preg_match('/Stable tag:\s*([0-9]+\.[0-9]+\.[0-9]+)/', $content, $m)) { 25 | return $m[1]; 26 | } 27 | if (preg_match('/Version:\s*([0-9]+\.[0-9]+\.[0-9]+)/', $content, $m)) { 28 | return $m[1]; 29 | } 30 | if (preg_match('/\|\s*([0-9]+\.[0-9]+\.[0-9]+)\s*\|/', $content, $m)) { 31 | return $m[1]; 32 | } 33 | 34 | return null; 35 | } 36 | 37 | function bumpVersion(string $oldVersion, string $newVersion, string $file): void 38 | { 39 | $content = file_get_contents($file); 40 | $content = preg_replace('/' . preg_quote($oldVersion, '/') . '(?!\d)/', $newVersion, $content); 41 | file_put_contents($file, $content); 42 | } 43 | 44 | // Find current version from any file 45 | $currentVersion = null; 46 | foreach ($files as $file) { 47 | $path = $pluginDir . $file; 48 | if (file_exists($path)) { 49 | $currentVersion = getCurrentVersion($path); 50 | if ($currentVersion) { 51 | break; 52 | } 53 | } 54 | } 55 | if (!$currentVersion) { 56 | fwrite(STDERR, "Could not determine current version.\n"); 57 | exit(1); 58 | } 59 | 60 | if ($argc < 2) { 61 | echo "Current version: $currentVersion\n"; 62 | echo "Enter new version: "; 63 | $input = fgets(STDIN); 64 | 65 | if ($input === false) { 66 | fwrite(STDERR, "Failed to read input.\n"); 67 | exit(1); 68 | } 69 | 70 | $newVersion = trim($input); 71 | 72 | if (empty($newVersion)) { 73 | fwrite(STDERR, "No version provided.\n"); 74 | exit(1); 75 | } 76 | 77 | if (!preg_match('/^[0-9]+\.[0-9]+\.[0-9]+$/', $newVersion)) { 78 | fwrite(STDERR, "Invalid version format. Use semantic versioning (e.g., 1.2.3).\n"); 79 | exit(1); 80 | } 81 | } else { 82 | $newVersion = $argv[1]; 83 | } 84 | 85 | foreach ($files as $file) { 86 | $path = $pluginDir . $file; 87 | if (file_exists($path)) { 88 | bumpVersion($currentVersion, $newVersion, $path); 89 | echo "Updated $file\n"; 90 | } 91 | } 92 | 93 | echo "Bumped from $currentVersion to $newVersion\n"; 94 | --------------------------------------------------------------------------------