Changeset 3155330
- Timestamp:
- 09/20/2024 05:56:42 PM (18 months ago)
- Location:
- dragblock
- Files:
-
- 351 added
- 7 edited
-
tags/24.09.20 (added)
-
tags/24.09.20/LICENSE (added)
-
tags/24.09.20/README.md (added)
-
tags/24.09.20/assets (added)
-
tags/24.09.20/assets/css (added)
-
tags/24.09.20/assets/css/animate.min.css (added)
-
tags/24.09.20/assets/images (added)
-
tags/24.09.20/assets/images/brands (added)
-
tags/24.09.20/assets/images/brands/favicon-16x16.png (added)
-
tags/24.09.20/assets/images/brands/favicon-192x192.png (added)
-
tags/24.09.20/assets/images/brands/favicon-20x20.png (added)
-
tags/24.09.20/assets/images/brands/favicon-32x32.png (added)
-
tags/24.09.20/assets/images/demo (added)
-
tags/24.09.20/assets/images/demo/blank.png (added)
-
tags/24.09.20/assets/jsons (added)
-
tags/24.09.20/assets/jsons/default-theme.json (added)
-
tags/24.09.20/build (added)
-
tags/24.09.20/build/1701.js (added)
-
tags/24.09.20/build/197.js (added)
-
tags/24.09.20/build/2131.js (added)
-
tags/24.09.20/build/2196.js (added)
-
tags/24.09.20/build/2233.js (added)
-
tags/24.09.20/build/2497.js (added)
-
tags/24.09.20/build/2618.js (added)
-
tags/24.09.20/build/2800.js (added)
-
tags/24.09.20/build/2906.js (added)
-
tags/24.09.20/build/3073.js (added)
-
tags/24.09.20/build/3590.js (added)
-
tags/24.09.20/build/3768.js (added)
-
tags/24.09.20/build/3915.js (added)
-
tags/24.09.20/build/4162.js (added)
-
tags/24.09.20/build/4169.js (added)
-
tags/24.09.20/build/4521.js (added)
-
tags/24.09.20/build/4685.js (added)
-
tags/24.09.20/build/5083.js (added)
-
tags/24.09.20/build/5257.js (added)
-
tags/24.09.20/build/5330.js (added)
-
tags/24.09.20/build/5422.js (added)
-
tags/24.09.20/build/5538.js (added)
-
tags/24.09.20/build/5694.js (added)
-
tags/24.09.20/build/5959.js (added)
-
tags/24.09.20/build/612.js (added)
-
tags/24.09.20/build/6176.js (added)
-
tags/24.09.20/build/6312.js (added)
-
tags/24.09.20/build/6356.js (added)
-
tags/24.09.20/build/6376.js (added)
-
tags/24.09.20/build/6506.js (added)
-
tags/24.09.20/build/6543.js (added)
-
tags/24.09.20/build/68.js (added)
-
tags/24.09.20/build/7234.js (added)
-
tags/24.09.20/build/7905.js (added)
-
tags/24.09.20/build/8469.js (added)
-
tags/24.09.20/build/8509.js (added)
-
tags/24.09.20/build/8633.js (added)
-
tags/24.09.20/build/9122.js (added)
-
tags/24.09.20/build/9132.js (added)
-
tags/24.09.20/build/9154.js (added)
-
tags/24.09.20/build/9209.js (added)
-
tags/24.09.20/build/952.js (added)
-
tags/24.09.20/build/9665.js (added)
-
tags/24.09.20/build/9729.js (added)
-
tags/24.09.20/build/applications (added)
-
tags/24.09.20/build/applications/admin-menu (added)
-
tags/24.09.20/build/applications/admin-menu/client (added)
-
tags/24.09.20/build/applications/admin-menu/client/block.json (added)
-
tags/24.09.20/build/applications/admin-menu/client/index.asset.php (added)
-
tags/24.09.20/build/applications/admin-menu/client/index.css (added)
-
tags/24.09.20/build/applications/admin-menu/client/index.js (added)
-
tags/24.09.20/build/applications/admin-menu/client/style-index.css (added)
-
tags/24.09.20/build/applications/admin-menu/server (added)
-
tags/24.09.20/build/applications/admin-menu/server/admin-common-inline-init-script.php (added)
-
tags/24.09.20/build/applications/admin-menu/server/index.php (added)
-
tags/24.09.20/build/applications/admin-menu/server/menu-register.php (added)
-
tags/24.09.20/build/applications/custom-fields (added)
-
tags/24.09.20/build/applications/custom-fields/client (added)
-
tags/24.09.20/build/applications/custom-fields/client/admin (added)
-
tags/24.09.20/build/applications/custom-fields/client/admin/block.json (added)
-
tags/24.09.20/build/applications/custom-fields/client/admin/index.asset.php (added)
-
tags/24.09.20/build/applications/custom-fields/client/admin/index.css (added)
-
tags/24.09.20/build/applications/custom-fields/client/admin/index.js (added)
-
tags/24.09.20/build/applications/custom-fields/client/editor (added)
-
tags/24.09.20/build/applications/custom-fields/client/editor/block.json (added)
-
tags/24.09.20/build/applications/custom-fields/client/editor/index.asset.php (added)
-
tags/24.09.20/build/applications/custom-fields/client/editor/index.css (added)
-
tags/24.09.20/build/applications/custom-fields/client/editor/index.js (added)
-
tags/24.09.20/build/applications/custom-fields/client/front (added)
-
tags/24.09.20/build/applications/custom-fields/client/front/block.json (added)
-
tags/24.09.20/build/applications/custom-fields/client/front/index.asset.php (added)
-
tags/24.09.20/build/applications/custom-fields/client/front/index.css (added)
-
tags/24.09.20/build/applications/custom-fields/client/front/index.js (added)
-
tags/24.09.20/build/applications/custom-fields/server (added)
-
tags/24.09.20/build/applications/custom-fields/server/custom-fields-admin-page.php (added)
-
tags/24.09.20/build/applications/custom-fields/server/custom-fields-defines.php (added)
-
tags/24.09.20/build/applications/custom-fields/server/custom-fields-enqueue.php (added)
-
tags/24.09.20/build/applications/custom-fields/server/index.php (added)
-
tags/24.09.20/build/applications/editor-command-line (added)
-
tags/24.09.20/build/applications/editor-command-line/client (added)
-
tags/24.09.20/build/applications/editor-command-line/client/block.json (added)
-
tags/24.09.20/build/applications/editor-command-line/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-command-line/client/index.css (added)
-
tags/24.09.20/build/applications/editor-command-line/client/index.js (added)
-
tags/24.09.20/build/applications/editor-command-line/server (added)
-
tags/24.09.20/build/applications/editor-command-line/server/editor-command-line-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-command-line/server/index.php (added)
-
tags/24.09.20/build/applications/editor-init (added)
-
tags/24.09.20/build/applications/editor-init/client (added)
-
tags/24.09.20/build/applications/editor-init/client/editor (added)
-
tags/24.09.20/build/applications/editor-init/client/editor/block.json (added)
-
tags/24.09.20/build/applications/editor-init/client/editor/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-init/client/editor/index.css (added)
-
tags/24.09.20/build/applications/editor-init/client/editor/index.js (added)
-
tags/24.09.20/build/applications/editor-init/client/front (added)
-
tags/24.09.20/build/applications/editor-init/client/front/block.json (added)
-
tags/24.09.20/build/applications/editor-init/client/front/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-init/client/front/index.js (added)
-
tags/24.09.20/build/applications/editor-init/client/front/style-index.css (added)
-
tags/24.09.20/build/applications/editor-init/server (added)
-
tags/24.09.20/build/applications/editor-init/server/editor-init-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-init/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-appearance (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/client (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/client/block.json (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/client/index.css (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/client/index.js (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/server (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/server/appearance-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-panel-appearance/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-attributes (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/client (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/client/block.json (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/client/index.css (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/client/index.js (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/server (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/server/attributes-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/server/attributes-render.php (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/server/attributes-uid.php (added)
-
tags/24.09.20/build/applications/editor-panel-attributes/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-content (added)
-
tags/24.09.20/build/applications/editor-panel-content/client (added)
-
tags/24.09.20/build/applications/editor-panel-content/client/block.json (added)
-
tags/24.09.20/build/applications/editor-panel-content/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-panel-content/client/index.css (added)
-
tags/24.09.20/build/applications/editor-panel-content/client/index.js (added)
-
tags/24.09.20/build/applications/editor-panel-content/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-panel-content/server (added)
-
tags/24.09.20/build/applications/editor-panel-content/server/content-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-panel-content/server/content-render.php (added)
-
tags/24.09.20/build/applications/editor-panel-content/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-database (added)
-
tags/24.09.20/build/applications/editor-panel-database/client (added)
-
tags/24.09.20/build/applications/editor-panel-database/client/block.json (added)
-
tags/24.09.20/build/applications/editor-panel-database/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/client/index.css (added)
-
tags/24.09.20/build/applications/editor-panel-database/client/index.js (added)
-
tags/24.09.20/build/applications/editor-panel-database/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-panel-database/server (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/database-cus-tax-example.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/database-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/database-loader.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/database-render.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/database-stats.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/database-tax-query.php (added)
-
tags/24.09.20/build/applications/editor-panel-database/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-interactions (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/client (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/client/block.json (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/client/index.css (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/client/index.js (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/server (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-interactions/server/interactions-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-panel-renderability (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/client (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/client/block.json (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/client/index.css (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/client/index.js (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/server (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/server/index.php (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/server/renderability-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/server/renderability-render copy.php (added)
-
tags/24.09.20/build/applications/editor-panel-renderability/server/renderability-render.php (added)
-
tags/24.09.20/build/applications/editor-toolbars (added)
-
tags/24.09.20/build/applications/editor-toolbars/client (added)
-
tags/24.09.20/build/applications/editor-toolbars/client/block.json (added)
-
tags/24.09.20/build/applications/editor-toolbars/client/index.asset.php (added)
-
tags/24.09.20/build/applications/editor-toolbars/client/index.css (added)
-
tags/24.09.20/build/applications/editor-toolbars/client/index.js (added)
-
tags/24.09.20/build/applications/editor-toolbars/client/style-index.css (added)
-
tags/24.09.20/build/applications/editor-toolbars/server (added)
-
tags/24.09.20/build/applications/editor-toolbars/server/editor-toolbars-enqueue.php (added)
-
tags/24.09.20/build/applications/editor-toolbars/server/index.php (added)
-
tags/24.09.20/build/applications/font-library (added)
-
tags/24.09.20/build/applications/font-library/client (added)
-
tags/24.09.20/build/applications/font-library/client/block.json (added)
-
tags/24.09.20/build/applications/font-library/client/font-readers (added)
-
tags/24.09.20/build/applications/font-library/client/font-readers/block.json (added)
-
tags/24.09.20/build/applications/font-library/client/font-readers/index.asset.php (added)
-
tags/24.09.20/build/applications/font-library/client/font-readers/index.js (added)
-
tags/24.09.20/build/applications/font-library/client/index.asset.php (added)
-
tags/24.09.20/build/applications/font-library/client/index.css (added)
-
tags/24.09.20/build/applications/font-library/client/index.js (added)
-
tags/24.09.20/build/applications/font-library/server (added)
-
tags/24.09.20/build/applications/font-library/server/class-dragblock-font-form-messages.php (added)
-
tags/24.09.20/build/applications/font-library/server/class-dragblock-fonts-page.php (added)
-
tags/24.09.20/build/applications/font-library/server/class-dragblock-google-fonts.php (added)
-
tags/24.09.20/build/applications/font-library/server/class-dragblock-local-fonts.php (added)
-
tags/24.09.20/build/applications/font-library/server/class-dragblock-manage-fonts-admin.php (added)
-
tags/24.09.20/build/applications/font-library/server/class-dragblock-react-app.php (added)
-
tags/24.09.20/build/applications/font-library/server/fonts-render-faces.php (added)
-
tags/24.09.20/build/applications/font-library/server/fonts-theme-json.php (added)
-
tags/24.09.20/build/applications/font-library/server/fonts.php (added)
-
tags/24.09.20/build/applications/font-library/server/index.php (added)
-
tags/24.09.20/build/applications/form-entries (added)
-
tags/24.09.20/build/applications/form-entries/client (added)
-
tags/24.09.20/build/applications/form-entries/client/block.json (added)
-
tags/24.09.20/build/applications/form-entries/client/index.asset.php (added)
-
tags/24.09.20/build/applications/form-entries/client/index.css (added)
-
tags/24.09.20/build/applications/form-entries/client/index.js (added)
-
tags/24.09.20/build/applications/form-entries/client/style-index.css (added)
-
tags/24.09.20/build/applications/form-entries/server (added)
-
tags/24.09.20/build/applications/form-entries/server/form-admin-page.php (added)
-
tags/24.09.20/build/applications/form-entries/server/form-custom-post-type.php (added)
-
tags/24.09.20/build/applications/form-entries/server/form-defines.php (added)
-
tags/24.09.20/build/applications/form-entries/server/form-enqueues.php (added)
-
tags/24.09.20/build/applications/form-entries/server/form-render.php (added)
-
tags/24.09.20/build/applications/form-entries/server/form-submission.php (added)
-
tags/24.09.20/build/applications/form-entries/server/index.php (added)
-
tags/24.09.20/build/applications/patterns (added)
-
tags/24.09.20/build/applications/patterns/client (added)
-
tags/24.09.20/build/applications/patterns/client/block.json (added)
-
tags/24.09.20/build/applications/patterns/client/index.asset.php (added)
-
tags/24.09.20/build/applications/patterns/client/index.css (added)
-
tags/24.09.20/build/applications/patterns/client/index.js (added)
-
tags/24.09.20/build/applications/patterns/client/style-index.css (added)
-
tags/24.09.20/build/applications/patterns/server (added)
-
tags/24.09.20/build/applications/patterns/server/index.php (added)
-
tags/24.09.20/build/applications/patterns/server/patterns-admin-page.php (added)
-
tags/24.09.20/build/applications/patterns/server/patterns-defines.php (added)
-
tags/24.09.20/build/applications/patterns/server/patterns-enqueue.php (added)
-
tags/24.09.20/build/applications/patterns/server/patterns-loader.php (added)
-
tags/24.09.20/build/applications/post-views (added)
-
tags/24.09.20/build/applications/post-views/server (added)
-
tags/24.09.20/build/applications/post-views/server/index.php (added)
-
tags/24.09.20/build/applications/post-views/server/post-views-defines.php (added)
-
tags/24.09.20/build/applications/post-views/server/post-views-record.php (added)
-
tags/24.09.20/build/applications/shortcodes (added)
-
tags/24.09.20/build/applications/shortcodes/server (added)
-
tags/24.09.20/build/applications/shortcodes/server/index.php (added)
-
tags/24.09.20/build/applications/shortcodes/server/shortcodes-link.php (added)
-
tags/24.09.20/build/applications/shortcodes/server/shortcodes-post.php (added)
-
tags/24.09.20/build/applications/theme-settings (added)
-
tags/24.09.20/build/applications/theme-settings/server (added)
-
tags/24.09.20/build/applications/theme-settings/server/default-theme-json.php (added)
-
tags/24.09.20/build/applications/theme-settings/server/index.php (added)
-
tags/24.09.20/build/applications/tutorials (added)
-
tags/24.09.20/build/applications/tutorials/client (added)
-
tags/24.09.20/build/applications/tutorials/client/editor (added)
-
tags/24.09.20/build/applications/tutorials/client/editor/block.json (added)
-
tags/24.09.20/build/applications/tutorials/client/editor/index.asset.php (added)
-
tags/24.09.20/build/applications/tutorials/client/editor/index.css (added)
-
tags/24.09.20/build/applications/tutorials/client/editor/index.js (added)
-
tags/24.09.20/build/applications/tutorials/client/editor/style-index.css (added)
-
tags/24.09.20/build/applications/tutorials/server (added)
-
tags/24.09.20/build/applications/tutorials/server/index.php (added)
-
tags/24.09.20/build/applications/tutorials/server/tutorials-enqueue.php (added)
-
tags/24.09.20/build/blocks (added)
-
tags/24.09.20/build/blocks/block-register.php (added)
-
tags/24.09.20/build/blocks/form (added)
-
tags/24.09.20/build/blocks/form/block.json (added)
-
tags/24.09.20/build/blocks/form/index.asset.php (added)
-
tags/24.09.20/build/blocks/form/index.css (added)
-
tags/24.09.20/build/blocks/form/index.js (added)
-
tags/24.09.20/build/blocks/icon (added)
-
tags/24.09.20/build/blocks/icon/block.json (added)
-
tags/24.09.20/build/blocks/icon/index.asset.php (added)
-
tags/24.09.20/build/blocks/icon/index.css (added)
-
tags/24.09.20/build/blocks/icon/index.js (added)
-
tags/24.09.20/build/blocks/iframe (added)
-
tags/24.09.20/build/blocks/iframe/block.json (added)
-
tags/24.09.20/build/blocks/iframe/index.asset.php (added)
-
tags/24.09.20/build/blocks/iframe/index.css (added)
-
tags/24.09.20/build/blocks/iframe/index.js (added)
-
tags/24.09.20/build/blocks/image (added)
-
tags/24.09.20/build/blocks/image/block.json (added)
-
tags/24.09.20/build/blocks/image/index.asset.php (added)
-
tags/24.09.20/build/blocks/image/index.css (added)
-
tags/24.09.20/build/blocks/image/index.js (added)
-
tags/24.09.20/build/blocks/input (added)
-
tags/24.09.20/build/blocks/input/block.json (added)
-
tags/24.09.20/build/blocks/input/index.asset.php (added)
-
tags/24.09.20/build/blocks/input/index.css (added)
-
tags/24.09.20/build/blocks/input/index.js (added)
-
tags/24.09.20/build/blocks/link (added)
-
tags/24.09.20/build/blocks/link/block.json (added)
-
tags/24.09.20/build/blocks/link/index.asset.php (added)
-
tags/24.09.20/build/blocks/link/index.css (added)
-
tags/24.09.20/build/blocks/link/index.js (added)
-
tags/24.09.20/build/blocks/option (added)
-
tags/24.09.20/build/blocks/option/block.json (added)
-
tags/24.09.20/build/blocks/option/index.asset.php (added)
-
tags/24.09.20/build/blocks/option/index.css (added)
-
tags/24.09.20/build/blocks/option/index.js (added)
-
tags/24.09.20/build/blocks/pattern (added)
-
tags/24.09.20/build/blocks/pattern/block.json (added)
-
tags/24.09.20/build/blocks/pattern/index.asset.php (added)
-
tags/24.09.20/build/blocks/pattern/index.css (added)
-
tags/24.09.20/build/blocks/pattern/index.js (added)
-
tags/24.09.20/build/blocks/select (added)
-
tags/24.09.20/build/blocks/select/block.json (added)
-
tags/24.09.20/build/blocks/select/index.asset.php (added)
-
tags/24.09.20/build/blocks/select/index.css (added)
-
tags/24.09.20/build/blocks/select/index.js (added)
-
tags/24.09.20/build/blocks/text (added)
-
tags/24.09.20/build/blocks/text/block.json (added)
-
tags/24.09.20/build/blocks/text/index.asset.php (added)
-
tags/24.09.20/build/blocks/text/index.css (added)
-
tags/24.09.20/build/blocks/text/index.js (added)
-
tags/24.09.20/build/blocks/textarea (added)
-
tags/24.09.20/build/blocks/textarea/block.json (added)
-
tags/24.09.20/build/blocks/textarea/index.asset.php (added)
-
tags/24.09.20/build/blocks/textarea/index.css (added)
-
tags/24.09.20/build/blocks/textarea/index.js (added)
-
tags/24.09.20/build/blocks/wrapper (added)
-
tags/24.09.20/build/blocks/wrapper/block.json (added)
-
tags/24.09.20/build/blocks/wrapper/index.asset.php (added)
-
tags/24.09.20/build/blocks/wrapper/index.css (added)
-
tags/24.09.20/build/blocks/wrapper/index.js (added)
-
tags/24.09.20/build/index.php (added)
-
tags/24.09.20/build/library (added)
-
tags/24.09.20/build/library/server (added)
-
tags/24.09.20/build/library/server/index.php (added)
-
tags/24.09.20/build/library/server/lib-ajax.php (added)
-
tags/24.09.20/build/library/server/lib-common.php (added)
-
tags/24.09.20/build/library/server/lib-enqueue.php (added)
-
tags/24.09.20/build/library/server/lib-identify.php (added)
-
tags/24.09.20/build/settings (added)
-
tags/24.09.20/build/settings/server (added)
-
tags/24.09.20/build/settings/server/index.php (added)
-
tags/24.09.20/build/settings/server/settings-sanitization.php (added)
-
tags/24.09.20/dragblock.php (added)
-
tags/24.09.20/languages (added)
-
tags/24.09.20/languages/dragblock.pot (added)
-
tags/24.09.20/readme.txt (added)
-
trunk/build/blocks/pattern/index.asset.php (modified) (1 diff)
-
trunk/build/blocks/pattern/index.js (modified) (1 diff)
-
trunk/build/blocks/wrapper/index.asset.php (modified) (1 diff)
-
trunk/build/blocks/wrapper/index.js (modified) (1 diff)
-
trunk/build/index.php (modified) (1 diff)
-
trunk/dragblock.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dragblock/trunk/build/blocks/pattern/index.asset.php
r3149699 r3155330 1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => ' 5785a13b8830cb3f8d50');1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '23380a36eb0bbb445e94'); -
dragblock/trunk/build/blocks/pattern/index.js
r3149699 r3155330 1 !function(){"use strict";var t=window.wp.blocks,e=window.wp.element,s=window.wp.i18n,a=window.wp.data,i=window.React,r=window.wp.components,c=window.lodash;class n{constructor(t,e,s=4,a=2){this.ITEM_TYPE=t,this.TITLE=e,this.ITEM_PER_ROW=s,this.ITEM_PER_PAGE=s*a,this.onRequestClose=()=>{},this.onSelectItem=t=>{}}}class o{constructor(t,e=!1,s=2592e6){this.k=t,this.disable_cache=e,this.cache_ttl=e?1e4:s}read=t=>function(t){if(!t)return null;t="dragblock__"+t;let e=localStorage.getItem(t);if(!e&&(e=window[t],!e))return null;const s=JSON.parse(e);return s.value?s.expiry&&(new Date).getTime()>s.expiry?(localStorage.removeItem(t),null):s.value:null}(t);write=(t,e)=>{!function(t,e,s=null){const a=new Date;if(!t)return;t="dragblock__"+t;const i={value:e,expiry:null===s?null:a.getTime()+s};try{localStorage.setItem(t,JSON.stringify(i))}catch(e){window[t]=JSON.stringify(i)}}(t,e,this.cache_ttl)};delete=t=>{!function(t){t&&(t="dragblock__"+t,localStorage.removeItem(t))}(t)};readCats=()=>this.read(this.k.cats());writeCats=t=>{this.write(this.k.cats(),t)};deleteCats=()=>{this.delete(this.k.cats())};readCatItemIds=t=>this.read(this.k.cat(t));writeCatItemIds=(t,e)=>{this.write(this.k.cat(t),e)};deleteCatItemIds=t=>{this.delete(this.k.cat(t))};readItem=t=>this.read(this.k.item(t));writeItem=(t,e)=>{this.write(this.k.item(t),e)};deleteItem=t=>{this.delete(this.k.item(t))};readItems=t=>{let e={};for(let s of t){let t=this.readItem(s);t&&(e[s]=t)}return e};writeItems=t=>{for(let e in t){let s=t[e];this.writeItem(e,s)}};deleteItems=t=>{for(let e of t)this.deleteItem(e)};readSearchTerms=()=>this.read(this.k.searches());writeSearchTerms=t=>{this.write(this.k.searches(),t)};deleteSearchTerms=()=>{this.delete(this.k.searches())};flatSearchTerm=t=>t.toLowerCase().replace(/[^a-z0-9]+/g," ");searchSlug=t=>this.flatSearchTerm(t).replaceAll(" ","-");readSearchItemIds=t=>this.read(this.k.search(this.searchSlug(t)));writeSearchItemIds=(t,e)=>{let s=this.readSearchTerms();s||(s={});let a=this.searchSlug(t);s[a]||(s[a]=t,this.writeSearchTerms(s)),this.write(this.k.search(a),e)};deleteSearchItemIds=t=>{this.delete(this.k.search(this.searchSlug(t)))};searchItemsInCache=t=>{let e=this.flatSearchTerm(t);const s=!isNaN(t);s||(e=e.split(" "));const a=[],i=this.readCats();for(const t in i){const i=this.readCatItemIds(t);if(i)for(const t of i){if(s){t.toString().includes(e)&&a.push(t);continue}const i=this.readItem(t);if(!i||!i.name)continue;const r=this.flatSearchTerm(i.name).replaceAll(" ","");let c=!0;for(const t of e)if(!r.includes(t)){c=!1;break}c&&a.push(t)}}return a}}const h="dragblock-api-fetch-last-option";function l(t){t.rootPath||(t.rootPath="https://dragblock.com/wp-json/"),t.processor||(t.processor="dragblockdotcom"),function({rootPath:t=wpApiSettings.root,processor:e="dragblock",routeName:s="",method:a="POST",params:i=null,thenCallback:r=function(t){},catchCallback:n=function(t){}}){let o=`${t}${e}/v2/${s}`;const l={method:a,headers:{"Content-Type":"application/json"}};"POST"===a||"PUT"===a?l.body=JSON.stringify(i):"GET"===a&&i&&(o+=`?${new URLSearchParams(i).toString()}`),window[h]=l,fetch(o,l).then((t=>t.json())).then((t=>{if(!t.success||!t.data)return t.data&&(0,c.isObject)(t.data)&&(t.data=JSON.stringify(t.data)),void n(new Error(t.data||t.message||JSON.stringify(t)));r(t.data)})).catch(n)}(t)}class m{constructor(t,e=72,s=(()=>{})){this.k=t,this.maxResponseItemNumber=e,this.defaultCatchCallback=s}cats=(t,e=this.defaultCatchCallback)=>{l({routeName:this.k.cats(),thenCallback:t,catchCallback:e})};catItemIds=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.cat(),params:{cat_id:t,item_per_page:this.maxResponseItemNumber},thenCallback:e,catchCallback:s})};search=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.search(),params:{search_term:t,item_per_page:this.maxResponseItemNumber},thenCallback:e,catchCallback:s})};item=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.item(),params:{item_id:t},thenCallback:e,catchCallback:s})};items=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.items(),params:{item_ids:t,item_per_page:this.maxResponseItemNumber},thenCallback:e,catchCallback:s})}}class g{constructor(t){this.itemType=t,this.cats=()=>this.itemType+"-categories",this.cat=(t=null)=>this.itemType+"-category"+(t?"__"+t:""),this.item=(t=null)=>this.itemType+"-item"+(t?"__"+t:""),this.items=()=>this.itemType+"-items",this.search=(t=null)=>this.itemType+"-search"+(t?"__"+t:""),this.searches=()=>this.itemType+"-searches"}}class d{constructor(){this.searchTerm=null,this.setSearchTerm=function(t){},this.typingSearchTimeout=null,this.setTypingSearchTimeout=function(t){},this.cats=null,this.setCats=function(t){},this.catId=null,this.setCatId=function(t){},this.page=1,this.setPage=function(t){},this.maxPage=1,this.setMaxPage=function(t){},this.items=null,this.setItems=function(t){},this.isFetching=!1,this.setIsFetching=function(t){},this.isInserting=!1,this.setIsInserting=function(t){},this.message=null,this.setMessage=function(t){},this.error=null,this.setError=function(t){},this._initializeStates()}_initializeStates(){Object.keys(this).forEach((t=>{if("function"==typeof this[t])return;const[e,s]=(0,i.useState)(this[t]);this[t]=e,this[`set${this._capitalize(t)}`]=s}))}_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}}class u{#t=!1;#e=!1;#s=1e3;constructor(t,e){this.props=t,this.states=e,this.k=new g(this.props.ITEM_TYPE),this.cache=new o(this.k,this.#e),this.fetch=new m(this.k,this.props.ITEM_PER_PAGE,(t=>{this.#t&&console.log("Fetch Error Callback [setError]",t),this.states.setError(t.message||t.data||JSON.stringify(t))}))}triggers=()=>{if(this.states.isInserting){if(!this.states.message){const t=(0,s.__)("Downloading and Inserting item ...","dragblock");this.#t&&console.log("trigger [setMessage] ",t),this.states.setMessage(t)}return}if(this.states.error||this.states.isFetching)return;if(!this.states.cats){const t=(0,s.__)("Loading categories ...","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),this.states.setMessage(t),void this.loadCats()}if(this.states.searchTerm){if(this.states.typingSearchTimeout)return void(this.#t&&console.log("trigger typing search ..."));if(this.states.searchTerm.length<3&&isNaN(this.states.searchTerm)){const t=(0,s.__)("The search term is so general!","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}let t=this.loadSearchItemIds(this.states.searchTerm);if(!t){const t=(0,s.__)("Loading search results ...","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}if(0===t.length){const t=(0,s.__)("No item found for the search term","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}return void this.displayArchive(t)}if(!this.states.catId){const t=Object.keys(this.states.cats)[0];return this.#t&&console.log("trigger [setCatId,setItems] ",t,null),this.states.setCatId(t),void this.states.setItems(null)}let t=this.loadCatItemIds(this.states.catId);if(!t){const t=(0,s.__)("Loading category items ...","dragblock");return this.#t&&console.log("trigger [message,setItems,states.catId] ",t,null,this.states.catId),this.states.setMessage(t),void this.states.setItems(null)}if(0===t.length){const t=(0,s.__)("No item found for the category","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}this.#t&&console.log("trigger display cats",t),this.displayArchive(t)};onRequestRefresh=()=>{this.#t&&console.log("onRequestRefresh [setItems] null"),this.states.setItems(null),this.cache.deleteCats(),this.states.setMessage((0,s.__)("Refreshing currenty query ...","dragblock")),this.states.searchTerm?this.loadSearchItemIds(this.states.searchTerm,!0):this.states.catId&&this.loadCatItemIds(this.states.catId,!0)};onSearchChange=t=>{if(this.states.isFetching)return;const e=(0,s.__)("Searching ...","dragblock");this.#t&&console.log("searchOnChange [setSearchTerm,setItems,setCatId,setMessage] ",t,null,null,e),this.states.setSearchTerm(t),this.states.setItems(null),this.states.setCatId(null),this.states.setMessage(e),this.states.typingSearchTimeout&&clearTimeout(this.states.typingSearchTimeout),this.states.setTypingSearchTimeout(setTimeout((()=>{this.#t&&console.log("searchOnChange [setTypingSearchTimeout]",null),this.states.setTypingSearchTimeout(null)}),this.#s))};onCategoryClick=t=>{this.states.setSearchTerm(""),this.states.setCatId(t),this.states.setItems(null),this.states.setPage(1),this.states.setMaxPage(1)};onPrevClick=()=>{this.states.page<2||this.states.setPage(this.states.page-1)};onNextClick=()=>{this.states.page>=this.states.maxPage||this.states.setPage(this.states.page+1)};loadCats=(t=!1)=>{if(!t){let t=this.cache.readCats();if(t&&Object.keys(t).length)return this.#t&&console.log("loadCats [setCats]",t),void this.states.setCats(t)}this.states.setIsFetching(!0),this.fetch.cats((t=>{if(this.states.setIsFetching(!1),t&&(0,c.isObject)(t)&&Object.keys(t).length>0){for(let e in t)if(isNaN(e)){const t=(0,s.__)("Wrong categories data!","dragblocked");return this.#t&&console.log("loadCats [setError]",t),void this.states.setError(t)}return this.#t&&console.log("loadCats [setCats]",t),this.states.setCats(t),void this.cache.writeCats(t)}const e=(0,s.__)("Not categories found!","dragblocked");this.#t&&console.log("loadCats [setError]",e),this.states.setError(e)}))};loadArchiveItemIds=(t,e,s,a,i=!1)=>{if(!i){let s=e(t);if(s)return s}this.#t&&console.log("loadArchiveItemIds [setIsFetching]",!0),this.states.setIsFetching(!0),a(t,(e=>{if(this.#t&&console.log("loadArchiveItemIds",t,"[setIsFetching]",!1,e),this.states.setIsFetching(!1),e&&(0,c.isArray)(e)&&e.length>0){for(let t of e)if(isNaN(t))return void s(t,[]);s(t,e.map((t=>parseInt(t))))}else s(t,[])}))};displayArchive=t=>{if(this.states.page<1||this.states.page>this.states.maxPage||!t||!t.length)return;t=t.map((t=>parseInt(t)));let e=[];const a=(this.states.page-1)*this.props.ITEM_PER_PAGE,i=Math.min(t.length,a+this.props.ITEM_PER_PAGE);for(let s=a;s<i;s++)e.push(t[s]);const r=Object.keys(this.states.items||{}).map((t=>Number(t)));if(e=(0,c.pull)(e,...r),0===e.length)return;let n=this.loadItems(e);if(!n){const t=(0,s.__)("Loading items ...","dragblock");return this.#t&&console.log("displayArchive [setMessage]",t),void this.states.setMessage(t)}if(this.#t&&console.log("displayArchive [setItems]",{itemIds:t,showingItemIds:r,remainItemIds:e,nextItems:n}),this.states.setItems(n),this.states.setMaxPage(Math.ceil(t.length/this.props.ITEM_PER_PAGE)),Object.keys(n).length>0)this.#t&&console.log("displayArchive [setMessage]",null),this.states.setMessage(null);else{const t=(0,s.__)("No item found","dragblock");this.#t&&console.log("displayArchive [setMessage]",t),this.states.setMessage(t)}};loadCatItemIds=(t,e=!1)=>this.loadArchiveItemIds(t,this.cache.readCatItemIds,this.cache.writeCatItemIds,this.fetch.catItemIds,e);loadSearchItemIds=(t,e=!1)=>{if(!e){const e=this.cache.searchItemsInCache(t);if(e){if(!isNaN(t)&&e.length)return e;if(e.length>=this.props.ITEM_PER_PAGE)return e;this.#t&&console.log("Search in cached does not return enough results")}}return this.loadArchiveItemIds(t,this.cache.readSearchItemIds,this.cache.writeSearchItemIds,this.fetch.search,e)};loadItems=(t,e=!1)=>{let s={},a=new Set([...t]);if(!e){for(let e of t){let t=this.cache.readItem(e);t&&(s[e]=t,a.delete(e))}if(0===a.size)return s}this.states.setIsFetching(!0),this.fetch.items(Array.from(a),(t=>{if(this.states.setIsFetching(!1),t&&Object.keys(t).length>0)for(const e in t)s[e]=t[e],this.cache.writeItem(e,t[e])}))};setItem=(t,e=!1)=>{if(!e){const e=this.cache.readItem(t);if(e&&e.content)return void this.props.onSelectItem(e.content)}this.#t&&console.log("setItem [setIsInserting]",!0),this.states.setIsInserting(!0),this.fetch.item(t,(t=>{if(this.#t&&console.log("setItem [setMessage,setIsInserting]",null,!1),this.states.setMessage(null),this.states.setIsInserting(!1),t&&(0,c.isObject)(t)&&t.content)return void this.props.onSelectItem(t.content);const e=(0,s.__)("Failed loading item content","dragblock");this.#t&&console.log("setItem [setError]",e),this.states.setError(e)}))}}const I=()=>dragBlockIcons?.iconChevronLeft,p=()=>dragBlockIcons?.iconChevronRight,f=()=>dragBlockIcons?.iconReusableBlock;function k(t){const a=new d,n=new u(t,a);(0,i.useEffect)((()=>{n.triggers()}));const o=null!==a.cats&&Object.keys(a.cats).length>0,h=null!==a.items&&Object.keys(a.items).length>0,l=!a.isInserting&&!a.error,m=([t,s],a)=>{const i=s.src?(0,e.createElement)("span",{className:"image"},(0,e.createElement)("img",{loading:"lazy",src:s.src})):null,c=(0,e.createElement)("span",{className:"title"},(0,e.createElement)("strong",{className:"id"},"#",t),""!==s.name&&(0,e.createElement)("span",{className:"name"},s.name));return(0,e.createElement)(r.Button,{key:a,className:"item",onClick:()=>{n.setItem(t)}},i,c)},g={gridTemplateColumns:`repeat(${t.ITEM_PER_ROW},1fr)`};return(0,e.createElement)(r.Modal,{className:`dragblock-item-inserter ${t.ITEM_TYPE}`,title:t.TITLE,onRequestClose:t.onRequestClose,isFullScreen:!0,__experimentalHideHeader:!l,size:l?"fill":"small",headerActions:(0,e.createElement)("div",{className:"header"},h&&(0,e.createElement)("div",{className:"pagination"},(0,e.createElement)(r.Button,{disabled:a.page<2,onClick:n.onPrevClick,icon:I()}),(0,e.createElement)("span",{className:"info"},a.page,"/",a.maxPage),(0,e.createElement)(r.Button,{disabled:a.page>=a.maxPage,onClick:n.onNextClick,icon:p()})),!a.isFetching&&!a.isInserting&&!a.error&&(0,e.createElement)(r.Button,{icon:f(),label:(0,s.__)("Refresh Cache","dragblock"),onClick:n.onRequestRefresh}))},!(0,c.isEmpty)(a.error)&&(0,e.createElement)("div",{className:"error"},a.error),a.isInserting&&(0,e.createElement)("h2",{className:"inserting-message"},a.message),l&&(0,e.createElement)("div",{className:"inner"},(0,e.createElement)("div",{className:"sidebar"},(0,e.createElement)(r.SearchControl,{value:a.searchTerm,onChange:n.onSearchChange,disabled:a.isFetching}),o&&(0,e.createElement)(r.MenuGroup,{className:"categories",label:(0,s.__)("Categories","dragblock")},Object.entries(a.cats).map((([t,s],i)=>(0,e.createElement)(r.MenuItem,{key:i,isPressed:a.catId===t,className:"category",onClick:()=>{n.onCategoryClick(t)}},s.name," ",(0,e.createElement)("span",null,s.count))))))," ",(0,e.createElement)("div",{className:"items"},h&&(0,e.createElement)("div",{className:"grid",style:g},Object.entries(a.items).map(m)),!(0,c.isEmpty)(a.message)&&(0,e.createElement)("div",{className:"message"},a.message))))}window.wp.blockEditor,window.wp.hooks;var E=JSON.parse('{"u2":"dragblock/pattern"}');(0,t.registerBlockType)(E.u2,{edit:function(i){const{clientId:r}=i,{replaceBlocks:c,removeBlocks:o}=(0,a.useDispatch)("core/block-editor"),h=new n("pattern",(0,s.__)("DragBlock Patterns","dragblock"));return h.onRequestClose=function(){o(r)},h.onSelectItem=function(e){setInserterOpen(!1);const s=(0,t.rawHandler)({HTML:e});c(r,s)},(0,e.createElement)(k,{...h})},save:function(t){return null}})}();1 !function(){"use strict";var t=window.wp.blocks,e=window.wp.element,s=window.wp.i18n,a=window.wp.data,i=window.React,r=window.wp.components,c=window.lodash;class n{constructor(t,e,s=4,a=2){this.ITEM_TYPE=t,this.TITLE=e,this.ITEM_PER_ROW=s,this.ITEM_PER_PAGE=s*a,this.onRequestClose=()=>{},this.onSelectItem=t=>{}}}class h{constructor(t,e=!1,s=2592e6){this.k=t,this.disable_cache=e,this.cache_ttl=e?1e4:s}read=t=>function(t){if(!t)return null;t="dragblock__"+t;let e=localStorage.getItem(t);if(!e&&(e=window[t],!e))return null;const s=JSON.parse(e);return s.value?s.expiry&&(new Date).getTime()>s.expiry?(localStorage.removeItem(t),null):s.value:null}(t);write=(t,e)=>{!function(t,e,s=null){const a=new Date;if(!t)return;t="dragblock__"+t;const i={value:e,expiry:null===s?null:a.getTime()+s};try{localStorage.setItem(t,JSON.stringify(i))}catch(e){window[t]=JSON.stringify(i)}}(t,e,this.cache_ttl)};delete=t=>{!function(t){t&&(t="dragblock__"+t,localStorage.removeItem(t))}(t)};readCats=()=>this.read(this.k.cats());writeCats=t=>{this.write(this.k.cats(),t)};deleteCats=()=>{this.delete(this.k.cats())};readCatItemIds=t=>this.read(this.k.cat(t));writeCatItemIds=(t,e)=>{this.write(this.k.cat(t),e)};deleteCatItemIds=t=>{this.delete(this.k.cat(t))};readItem=t=>this.read(this.k.item(t));writeItem=(t,e)=>{this.write(this.k.item(t),e)};deleteItem=t=>{this.delete(this.k.item(t))};readItems=t=>{let e={};for(let s of t){let t=this.readItem(s);t&&(e[s]=t)}return e};writeItems=t=>{for(let e in t){let s=t[e];this.writeItem(e,s)}};deleteItems=t=>{for(let e of t)this.deleteItem(e)};readSearchTerms=()=>this.read(this.k.searches());writeSearchTerms=t=>{this.write(this.k.searches(),t)};deleteSearchTerms=()=>{this.delete(this.k.searches())};flatSearchTerm=t=>t.toLowerCase().replace(/[^a-z0-9]+/g," ");searchSlug=t=>this.flatSearchTerm(t).replaceAll(" ","-");readSearchItemIds=t=>this.read(this.k.search(this.searchSlug(t)));writeSearchItemIds=(t,e)=>{let s=this.readSearchTerms();s||(s={});let a=this.searchSlug(t);s[a]||(s[a]=t,this.writeSearchTerms(s)),this.write(this.k.search(a),e)};deleteSearchItemIds=t=>{this.delete(this.k.search(this.searchSlug(t)))};searchItemsInCache=t=>{let e=this.flatSearchTerm(t);const s=!isNaN(t);s||(e=e.split(" "));const a=[],i=this.readCats();for(const t in i){const i=this.readCatItemIds(t);if(i)for(const t of i){if(s){t.toString().includes(e)&&a.push(t);continue}const i=this.readItem(t);if(!i||!i.name)continue;const r=this.flatSearchTerm(i.name).replaceAll(" ","");let c=!0;for(const t of e)if(!r.includes(t)){c=!1;break}c&&a.push(t)}}return a}}const o="dragblock-api-fetch-last-option";function l(t){t.rootPath||(t.rootPath="https://dragblock.com/wp-json/"),t.processor||(t.processor="dragblockdotcom"),function({rootPath:t=wpApiSettings.root,processor:e="dragblock",routeName:s="",method:a="POST",params:i=null,thenCallback:r=function(t){},catchCallback:n=function(t){}}){let h=`${t}${e}/v2/${s}`;const l={method:a,headers:{"Content-Type":"application/json"}};"POST"===a||"PUT"===a?l.body=JSON.stringify(i):"GET"===a&&i&&(h+=`?${new URLSearchParams(i).toString()}`),window[o]=l,fetch(h,l).then((t=>t.json())).then((t=>{if(!t.success||!t.data)return t.data&&(0,c.isObject)(t.data)&&(t.data=JSON.stringify(t.data)),void n(new Error(t.data||t.message||JSON.stringify(t)));r(t.data)})).catch(n)}(t)}class m{constructor(t,e=72,s=(()=>{})){this.k=t,this.maxResponseItemNumber=e,this.defaultCatchCallback=s}cats=(t,e=this.defaultCatchCallback)=>{l({routeName:this.k.cats(),thenCallback:t,catchCallback:e})};catItemIds=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.cat(),params:{cat_id:t,item_per_page:this.maxResponseItemNumber},thenCallback:e,catchCallback:s})};search=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.search(),params:{search_term:t,item_per_page:this.maxResponseItemNumber},thenCallback:e,catchCallback:s})};item=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.item(),params:{item_id:t},thenCallback:e,catchCallback:s})};items=(t,e,s=this.defaultCatchCallback)=>{l({routeName:this.k.items(),params:{item_ids:t,item_per_page:this.maxResponseItemNumber},thenCallback:e,catchCallback:s})}}class g{constructor(t){this.itemType=t,this.cats=()=>this.itemType+"-categories",this.cat=(t=null)=>this.itemType+"-category"+(t?"__"+t:""),this.item=(t=null)=>this.itemType+"-item"+(t?"__"+t:""),this.items=()=>this.itemType+"-items",this.search=(t=null)=>this.itemType+"-search"+(t?"__"+t:""),this.searches=()=>this.itemType+"-searches"}}class d{constructor(){this.searchTerm=null,this.setSearchTerm=function(t){},this.typingSearchTimeout=null,this.setTypingSearchTimeout=function(t){},this.cats=null,this.setCats=function(t){},this.catId=null,this.setCatId=function(t){},this.page=1,this.setPage=function(t){},this.maxPage=1,this.setMaxPage=function(t){},this.items=null,this.setItems=function(t){},this.isFetching=!1,this.setIsFetching=function(t){},this.isInserting=!1,this.setIsInserting=function(t){},this.message=null,this.setMessage=function(t){},this.error=null,this.setError=function(t){},this._initializeStates()}_initializeStates(){Object.keys(this).forEach((t=>{if("function"==typeof this[t])return;const[e,s]=(0,i.useState)(this[t]);this[t]=e,this[`set${this._capitalize(t)}`]=s}))}_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)}}class u{#t=!1;#e=!1;#s=1e3;constructor(t,e){this.props=t,this.states=e,this.k=new g(this.props.ITEM_TYPE),this.cache=new h(this.k,this.#e),this.fetch=new m(this.k,this.props.ITEM_PER_PAGE,(t=>{this.#t&&console.log("Fetch Error Callback [setError]",t),this.states.setError(t.message||t.data||JSON.stringify(t))}))}triggers=()=>{if(this.states.isInserting){if(!this.states.message){const t=(0,s.__)("Downloading and Inserting item ...","dragblock");this.#t&&console.log("trigger [setMessage] ",t),this.states.setMessage(t)}return}if(this.states.error||this.states.isFetching)return;if(!this.states.cats){const t=(0,s.__)("Loading categories ...","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),this.states.setMessage(t),void this.loadCats()}if(this.states.searchTerm){if(this.states.typingSearchTimeout)return void(this.#t&&console.log("trigger typing search ..."));if(this.states.searchTerm.length<3&&isNaN(this.states.searchTerm)){const t=(0,s.__)("The search term is so general!","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}let t=this.loadSearchItemIds(this.states.searchTerm);if(!t){const t=(0,s.__)("Loading search results ...","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}if(0===t.length){const t=(0,s.__)("No item found for the search term","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}return void this.displayArchive(t)}if(!this.states.catId){const t=Object.keys(this.states.cats)[0];return this.#t&&console.log("trigger [setCatId,setItems] ",t,null),this.states.setCatId(t),void this.states.setItems(null)}let t=this.loadCatItemIds(this.states.catId);if(!t){const t=(0,s.__)("Loading category items ...","dragblock");return this.#t&&console.log("trigger [message,setItems,states.catId] ",t,null,this.states.catId),this.states.setMessage(t),void this.states.setItems(null)}if(0===t.length){const t=(0,s.__)("No item found for the category","dragblock");return this.#t&&console.log("trigger [setMessage] ",t),void this.states.setMessage(t)}this.#t&&console.log("trigger display cats",t),this.displayArchive(t)};onRequestRefresh=()=>{let t=!0;this.#t&&console.log("onRequestRefresh [setItems] null"),this.states.setItems(null),this.states.setMessage((0,s.__)("Refreshing currenty query ...","dragblock")),this.states.searchTerm?this.loadSearchItemIds(this.states.searchTerm,t):this.states.catId&&(this.loadCats(t),this.loadCatItemIds(this.states.catId,t))};onSearchChange=t=>{if(this.states.isFetching)return;const e=(0,s.__)("Searching ...","dragblock");this.#t&&console.log("searchOnChange [setSearchTerm,setItems,setCatId,setMessage] ",t,null,null,e),this.states.setSearchTerm(t),this.states.setItems(null),this.states.setCatId(null),this.states.setMessage(e),this.states.typingSearchTimeout&&clearTimeout(this.states.typingSearchTimeout),this.states.setTypingSearchTimeout(setTimeout((()=>{this.#t&&console.log("searchOnChange [setTypingSearchTimeout]",null),this.states.setTypingSearchTimeout(null)}),this.#s))};onCategoryClick=t=>{this.states.setSearchTerm(""),this.states.setCatId(t),this.states.setItems(null),this.states.setPage(1),this.states.setMaxPage(1)};onPrevClick=()=>{this.states.page<2||this.states.setPage(this.states.page-1)};onNextClick=()=>{this.states.page>=this.states.maxPage||this.states.setPage(this.states.page+1)};loadCachedCats=()=>{let t=this.cache.readCats();return t&&Object.keys(t).length?(this.#t&&console.log("loadCats [setCats]",t),this.states.setCats(t),t):null};loadCats=(t=!1)=>{!t&&this.loadCachedCats()||(this.states.setIsFetching(!0),this.fetch.cats((t=>{if(this.states.setIsFetching(!1),t&&(0,c.isObject)(t)&&Object.keys(t).length>0){for(let e in t)if(isNaN(e)){if(this.loadCachedCats())return;const t=(0,s.__)("Wrong categories data!","dragblocked");return this.#t&&console.log("loadCats [setError]",t),void this.states.setError(t)}return this.#t&&console.log("loadCats [setCats]",t),this.states.setCats(t),void this.cache.writeCats(t)}if(this.loadCachedCats())return;const e=(0,s.__)("Not categories found!","dragblocked");this.#t&&console.log("loadCats [setError]",e),this.states.setError(e)})))};loadArchiveItemIds=(t,e,s,a,i=!1)=>{if(!i){let s=e(t);if(s)return s}this.#t&&console.log("loadArchiveItemIds [setIsFetching]",!0),this.states.setIsFetching(!0),a(t,(e=>{if(this.#t&&console.log("loadArchiveItemIds",t,"[setIsFetching]",!1,e),this.states.setIsFetching(!1),e&&(0,c.isArray)(e)&&e.length>0){for(let a of e)if(isNaN(a))return void s(t,[]);e=(0,c.shuffle)(e.map((t=>parseInt(t)))),s(t,e)}else s(t,[])}))};displayArchive=t=>{if(this.states.page<1||this.states.page>this.states.maxPage||!t||!t.length)return;t=t.map((t=>parseInt(t)));let e=[];const a=(this.states.page-1)*this.props.ITEM_PER_PAGE,i=Math.min(t.length,a+this.props.ITEM_PER_PAGE);for(let s=a;s<i;s++)e.push(t[s]);const r=Object.keys(this.states.items||{}).map((t=>Number(t)));if(e=(0,c.pull)(e,...r),0===e.length)return;let n=this.loadItems(e);if(!n){const t=(0,s.__)("Loading items ...","dragblock");return this.#t&&console.log("displayArchive [setMessage]",t),void this.states.setMessage(t)}if(this.#t&&console.log("displayArchive [setItems]",{itemIds:t,showingItemIds:r,remainItemIds:e,nextItems:n}),this.states.setItems(n),this.states.setMaxPage(Math.ceil(t.length/this.props.ITEM_PER_PAGE)),Object.keys(n).length>0)this.#t&&console.log("displayArchive [setMessage]",null),this.states.setMessage(null);else{const t=(0,s.__)("No item found","dragblock");this.#t&&console.log("displayArchive [setMessage]",t),this.states.setMessage(t)}};loadCatItemIds=(t,e=!1)=>this.loadArchiveItemIds(t,this.cache.readCatItemIds,this.cache.writeCatItemIds,this.fetch.catItemIds,e);loadSearchItemIds=(t,e=!1)=>{if(!e){const e=this.cache.searchItemsInCache(t);if(e){if(!isNaN(t)&&e.length)return e;if(e.length>=this.props.ITEM_PER_PAGE)return e;this.#t&&console.log("Search in cached does not return enough results")}}return this.loadArchiveItemIds(t,this.cache.readSearchItemIds,this.cache.writeSearchItemIds,this.fetch.search,e)};loadItems=(t,e=!1)=>{let s={},a=new Set([...t]);if(!e){for(let e of t){let t=this.cache.readItem(e);t&&(s[e]=t,a.delete(e))}if(0===a.size)return s}this.states.setIsFetching(!0),this.fetch.items(Array.from(a),(t=>{if(this.states.setIsFetching(!1),t&&Object.keys(t).length>0)for(const e in t)s[e]=t[e],this.cache.writeItem(e,t[e])}))};setItem=(t,e=!1)=>{if(!e){const e=this.cache.readItem(t);if(e&&e.content)return void this.props.onSelectItem(e.content)}this.#t&&console.log("setItem [setIsInserting]",!0),this.states.setIsInserting(!0),this.fetch.item(t,(t=>{if(this.#t&&console.log("setItem [setMessage,setIsInserting]",null,!1),this.states.setMessage(null),this.states.setIsInserting(!1),t&&(0,c.isObject)(t)&&t.content)return void this.props.onSelectItem(t.content);const e=(0,s.__)("Failed loading item content","dragblock");this.#t&&console.log("setItem [setError]",e),this.states.setError(e)}))}}const I=()=>dragBlockIcons?.iconChevronLeft,f=()=>dragBlockIcons?.iconChevronRight,p=()=>dragBlockIcons?.iconReusableBlock;function k(t){const a=new d,n=new u(t,a);(0,i.useEffect)((()=>{n.triggers()}));const h=null!==a.cats&&Object.keys(a.cats).length>0,o=null!==a.items&&Object.keys(a.items).length>0,l=!a.isInserting&&!a.error,m=([t,s],a)=>{const i=s.src?(0,e.createElement)("span",{className:"image"},(0,e.createElement)("img",{loading:"lazy",src:s.src})):null,c=(0,e.createElement)("span",{className:"title"},(0,e.createElement)("strong",{className:"id"},"#",t),""!==s.name&&(0,e.createElement)("span",{className:"name"},s.name));return(0,e.createElement)(r.Button,{key:a,className:"item",onClick:()=>{n.setItem(t)}},i,c)},g={gridTemplateColumns:`repeat(${t.ITEM_PER_ROW},1fr)`};return(0,e.createElement)(r.Modal,{className:`dragblock-item-inserter ${t.ITEM_TYPE}`,title:t.TITLE,onRequestClose:t.onRequestClose,isFullScreen:!0,__experimentalHideHeader:!l,size:l?"fill":"small",headerActions:(0,e.createElement)("div",{className:"header"},o&&(0,e.createElement)("div",{className:"pagination"},(0,e.createElement)(r.Button,{disabled:a.page<2,onClick:n.onPrevClick,icon:I()}),(0,e.createElement)("span",{className:"info"},a.page,"/",a.maxPage),(0,e.createElement)(r.Button,{disabled:a.page>=a.maxPage,onClick:n.onNextClick,icon:f()})),!a.isFetching&&!a.isInserting&&!a.error&&(0,e.createElement)(r.Button,{icon:p(),label:(0,s.__)("Refresh Cache","dragblock"),onClick:n.onRequestRefresh}))},!(0,c.isEmpty)(a.error)&&(0,e.createElement)("div",{className:"error"},a.error),a.isInserting&&(0,e.createElement)("h2",{className:"inserting-message"},a.message),l&&(0,e.createElement)("div",{className:"inner"},(0,e.createElement)("div",{className:"sidebar"},(0,e.createElement)(r.SearchControl,{value:a.searchTerm,onChange:n.onSearchChange,disabled:a.isFetching}),h&&(0,e.createElement)(r.MenuGroup,{className:"categories",label:(0,s.__)("Categories","dragblock")},Object.entries(a.cats).map((([t,s],i)=>(0,e.createElement)(r.MenuItem,{key:i,isPressed:a.catId===t,className:"category",onClick:()=>{n.onCategoryClick(t)}},s.name," ",(0,e.createElement)("span",null,s.count))))))," ",(0,e.createElement)("div",{className:"items"},o&&(0,e.createElement)("div",{className:"grid",style:g},Object.entries(a.items).map(m)),!(0,c.isEmpty)(a.message)&&(0,e.createElement)("div",{className:"message"},a.message))))}window.wp.blockEditor,window.wp.hooks;var E=JSON.parse('{"u2":"dragblock/pattern"}');(0,t.registerBlockType)(E.u2,{edit:function(i){const{clientId:r}=i,{replaceBlocks:c,removeBlocks:h}=(0,a.useDispatch)("core/block-editor"),o=new n("pattern",(0,s.__)("DragBlock Patterns","dragblock"));return o.onRequestClose=function(){h(r)},o.onSelectItem=function(e){const s=(0,t.rawHandler)({HTML:e});c(r,s)},(0,e.createElement)(k,{...o})},save:function(t){return null}})}(); -
dragblock/trunk/build/blocks/wrapper/index.asset.php
r3149699 r3155330 1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => ' 46c1d4cc71752e692df5');1 <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '21e6e3521324cf538538'); -
dragblock/trunk/build/blocks/wrapper/index.js
r3149699 r3155330 1 !function(){"use strict";var e=window.wp.blocks,t=window.wp.element,s=window.wp.i18n,a=window.React,i=window.wp.components,r=window.wp.data,l=window.wp.blockEditor;const n=()=>dragBlockIcons?.iconFolder,c=()=>dragBlockIcons?.iconBigPlus,o=()=>dragBlockIcons?.iconChevronLeft,h=()=>dragBlockIcons?.iconChevronRight, m=()=>dragBlockIcons?.iconReusableBlock;function g({rootClientId:e}){return(0,t.createElement)(l.Inserter,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e})=>(0,t.createElement)(i.Button,{variant:"secondary",title:(0,s.__)("Add a Child","dragblock"),onClick:e},c()),isAppender:!0})}var d=window.lodash;class u{constructor(e,t,s=4,a=2){this.ITEM_TYPE=e,this.TITLE=t,this.ITEM_PER_ROW=s,this.ITEM_PER_PAGE=s*a,this.onRequestClose=()=>{},this.onSelectItem=e=>{}}}class I{constructor(e,t=!1,s=2592e6){this.k=e,this.disable_cache=t,this.cache_ttl=t?1e4:s}read=e=>function(e){if(!e)return null;e="dragblock__"+e;let t=localStorage.getItem(e);if(!t&&(t=window[e],!t))return null;const s=JSON.parse(t);return s.value?s.expiry&&(new Date).getTime()>s.expiry?(localStorage.removeItem(e),null):s.value:null}(e);write=(e,t)=>{!function(e,t,s=null){const a=new Date;if(!e)return;e="dragblock__"+e;const i={value:t,expiry:null===s?null:a.getTime()+s};try{localStorage.setItem(e,JSON.stringify(i))}catch(t){window[e]=JSON.stringify(i)}}(e,t,this.cache_ttl)};delete=e=>{!function(e){e&&(e="dragblock__"+e,localStorage.removeItem(e))}(e)};readCats=()=>this.read(this.k.cats());writeCats=e=>{this.write(this.k.cats(),e)};deleteCats=()=>{this.delete(this.k.cats())};readCatItemIds=e=>this.read(this.k.cat(e));writeCatItemIds=(e,t)=>{this.write(this.k.cat(e),t)};deleteCatItemIds=e=>{this.delete(this.k.cat(e))};readItem=e=>this.read(this.k.item(e));writeItem=(e,t)=>{this.write(this.k.item(e),t)};deleteItem=e=>{this.delete(this.k.item(e))};readItems=e=>{let t={};for(let s of e){let e=this.readItem(s);e&&(t[s]=e)}return t};writeItems=e=>{for(let t in e){let s=e[t];this.writeItem(t,s)}};deleteItems=e=>{for(let t of e)this.deleteItem(t)};readSearchTerms=()=>this.read(this.k.searches());writeSearchTerms=e=>{this.write(this.k.searches(),e)};deleteSearchTerms=()=>{this.delete(this.k.searches())};flatSearchTerm=e=>e.toLowerCase().replace(/[^a-z0-9]+/g," ");searchSlug=e=>this.flatSearchTerm(e).replaceAll(" ","-");readSearchItemIds=e=>this.read(this.k.search(this.searchSlug(e)));writeSearchItemIds=(e,t)=>{let s=this.readSearchTerms();s||(s={});let a=this.searchSlug(e);s[a]||(s[a]=e,this.writeSearchTerms(s)),this.write(this.k.search(a),t)};deleteSearchItemIds=e=>{this.delete(this.k.search(this.searchSlug(e)))};searchItemsInCache=e=>{let t=this.flatSearchTerm(e);const s=!isNaN(e);s||(t=t.split(" "));const a=[],i=this.readCats();for(const e in i){const i=this.readCatItemIds(e);if(i)for(const e of i){if(s){e.toString().includes(t)&&a.push(e);continue}const i=this.readItem(e);if(!i||!i.name)continue;const r=this.flatSearchTerm(i.name).replaceAll(" ","");let l=!0;for(const e of t)if(!r.includes(e)){l=!1;break}l&&a.push(e)}}return a}}const p="dragblock-api-fetch-last-option";function f(e){e.rootPath||(e.rootPath="https://dragblock.com/wp-json/"),e.processor||(e.processor="dragblockdotcom"),function({rootPath:e=wpApiSettings.root,processor:t="dragblock",routeName:s="",method:a="POST",params:i=null,thenCallback:r=function(e){},catchCallback:l=function(e){}}){let n=`${e}${t}/v2/${s}`;const c={method:a,headers:{"Content-Type":"application/json"}};"POST"===a||"PUT"===a?c.body=JSON.stringify(i):"GET"===a&&i&&(n+=`?${new URLSearchParams(i).toString()}`),window[p]=c,fetch(n,c).then((e=>e.json())).then((e=>{if(!e.success||!e.data)return e.data&&(0,d.isObject)(e.data)&&(e.data=JSON.stringify(e.data)),void l(new Error(e.data||e.message||JSON.stringify(e)));r(e.data)})).catch(l)}(e)}class k{constructor(e,t=72,s=(()=>{})){this.k=e,this.maxResponseItemNumber=t,this.defaultCatchCallback=s}cats=(e,t=this.defaultCatchCallback)=>{f({routeName:this.k.cats(),thenCallback:e,catchCallback:t})};catItemIds=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.cat(),params:{cat_id:e,item_per_page:this.maxResponseItemNumber},thenCallback:t,catchCallback:s})};search=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.search(),params:{search_term:e,item_per_page:this.maxResponseItemNumber},thenCallback:t,catchCallback:s})};item=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.item(),params:{item_id:e},thenCallback:t,catchCallback:s})};items=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.items(),params:{item_ids:e,item_per_page:this.maxResponseItemNumber},thenCallback:t,catchCallback:s})}}class E{constructor(e){this.itemType=e,this.cats=()=>this.itemType+"-categories",this.cat=(e=null)=>this.itemType+"-category"+(e?"__"+e:""),this.item=(e=null)=>this.itemType+"-item"+(e?"__"+e:""),this.items=()=>this.itemType+"-items",this.search=(e=null)=>this.itemType+"-search"+(e?"__"+e:""),this.searches=()=>this.itemType+"-searches"}}class b{constructor(){this.searchTerm=null,this.setSearchTerm=function(e){},this.typingSearchTimeout=null,this.setTypingSearchTimeout=function(e){},this.cats=null,this.setCats=function(e){},this.catId=null,this.setCatId=function(e){},this.page=1,this.setPage=function(e){},this.maxPage=1,this.setMaxPage=function(e){},this.items=null,this.setItems=function(e){},this.isFetching=!1,this.setIsFetching=function(e){},this.isInserting=!1,this.setIsInserting=function(e){},this.message=null,this.setMessage=function(e){},this.error=null,this.setError=function(e){},this._initializeStates()}_initializeStates(){Object.keys(this).forEach((e=>{if("function"==typeof this[e])return;const[t,s]=(0,a.useState)(this[e]);this[e]=t,this[`set${this._capitalize(e)}`]=s}))}_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}}class C{#e=!1;#t=!1;#s=1e3;constructor(e,t){this.props=e,this.states=t,this.k=new E(this.props.ITEM_TYPE),this.cache=new I(this.k,this.#t),this.fetch=new k(this.k,this.props.ITEM_PER_PAGE,(e=>{this.#e&&console.log("Fetch Error Callback [setError]",e),this.states.setError(e.message||e.data||JSON.stringify(e))}))}triggers=()=>{if(this.states.isInserting){if(!this.states.message){const e=(0,s.__)("Downloading and Inserting item ...","dragblock");this.#e&&console.log("trigger [setMessage] ",e),this.states.setMessage(e)}return}if(this.states.error||this.states.isFetching)return;if(!this.states.cats){const e=(0,s.__)("Loading categories ...","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),this.states.setMessage(e),void this.loadCats()}if(this.states.searchTerm){if(this.states.typingSearchTimeout)return void(this.#e&&console.log("trigger typing search ..."));if(this.states.searchTerm.length<3&&isNaN(this.states.searchTerm)){const e=(0,s.__)("The search term is so general!","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}let e=this.loadSearchItemIds(this.states.searchTerm);if(!e){const e=(0,s.__)("Loading search results ...","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}if(0===e.length){const e=(0,s.__)("No item found for the search term","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}return void this.displayArchive(e)}if(!this.states.catId){const e=Object.keys(this.states.cats)[0];return this.#e&&console.log("trigger [setCatId,setItems] ",e,null),this.states.setCatId(e),void this.states.setItems(null)}let e=this.loadCatItemIds(this.states.catId);if(!e){const e=(0,s.__)("Loading category items ...","dragblock");return this.#e&&console.log("trigger [message,setItems,states.catId] ",e,null,this.states.catId),this.states.setMessage(e),void this.states.setItems(null)}if(0===e.length){const e=(0,s.__)("No item found for the category","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}this.#e&&console.log("trigger display cats",e),this.displayArchive(e)};onRequestRefresh=()=>{this.#e&&console.log("onRequestRefresh [setItems] null"),this.states.setItems(null),this.cache.deleteCats(),this.states.setMessage((0,s.__)("Refreshing currenty query ...","dragblock")),this.states.searchTerm?this.loadSearchItemIds(this.states.searchTerm,!0):this.states.catId&&this.loadCatItemIds(this.states.catId,!0)};onSearchChange=e=>{if(this.states.isFetching)return;const t=(0,s.__)("Searching ...","dragblock");this.#e&&console.log("searchOnChange [setSearchTerm,setItems,setCatId,setMessage] ",e,null,null,t),this.states.setSearchTerm(e),this.states.setItems(null),this.states.setCatId(null),this.states.setMessage(t),this.states.typingSearchTimeout&&clearTimeout(this.states.typingSearchTimeout),this.states.setTypingSearchTimeout(setTimeout((()=>{this.#e&&console.log("searchOnChange [setTypingSearchTimeout]",null),this.states.setTypingSearchTimeout(null)}),this.#s))};onCategoryClick=e=>{this.states.setSearchTerm(""),this.states.setCatId(e),this.states.setItems(null),this.states.setPage(1),this.states.setMaxPage(1)};onPrevClick=()=>{this.states.page<2||this.states.setPage(this.states.page-1)};onNextClick=()=>{this.states.page>=this.states.maxPage||this.states.setPage(this.states.page+1)};loadCats=(e=!1)=>{if(!e){let e=this.cache.readCats();if(e&&Object.keys(e).length)return this.#e&&console.log("loadCats [setCats]",e),void this.states.setCats(e)}this.states.setIsFetching(!0),this.fetch.cats((e=>{if(this.states.setIsFetching(!1),e&&(0,d.isObject)(e)&&Object.keys(e).length>0){for(let t in e)if(isNaN(t)){const e=(0,s.__)("Wrong categories data!","dragblocked");return this.#e&&console.log("loadCats [setError]",e),void this.states.setError(e)}return this.#e&&console.log("loadCats [setCats]",e),this.states.setCats(e),void this.cache.writeCats(e)}const t=(0,s.__)("Not categories found!","dragblocked");this.#e&&console.log("loadCats [setError]",t),this.states.setError(t)}))};loadArchiveItemIds=(e,t,s,a,i=!1)=>{if(!i){let s=t(e);if(s)return s}this.#e&&console.log("loadArchiveItemIds [setIsFetching]",!0),this.states.setIsFetching(!0),a(e,(t=>{if(this.#e&&console.log("loadArchiveItemIds",e,"[setIsFetching]",!1,t),this.states.setIsFetching(!1),t&&(0,d.isArray)(t)&&t.length>0){for(let e of t)if(isNaN(e))return void s(e,[]);s(e,t.map((e=>parseInt(e))))}else s(e,[])}))};displayArchive=e=>{if(this.states.page<1||this.states.page>this.states.maxPage||!e||!e.length)return;e=e.map((e=>parseInt(e)));let t=[];const a=(this.states.page-1)*this.props.ITEM_PER_PAGE,i=Math.min(e.length,a+this.props.ITEM_PER_PAGE);for(let s=a;s<i;s++)t.push(e[s]);const r=Object.keys(this.states.items||{}).map((e=>Number(e)));if(t=(0,d.pull)(t,...r),0===t.length)return;let l=this.loadItems(t);if(!l){const e=(0,s.__)("Loading items ...","dragblock");return this.#e&&console.log("displayArchive [setMessage]",e),void this.states.setMessage(e)}if(this.#e&&console.log("displayArchive [setItems]",{itemIds:e,showingItemIds:r,remainItemIds:t,nextItems:l}),this.states.setItems(l),this.states.setMaxPage(Math.ceil(e.length/this.props.ITEM_PER_PAGE)),Object.keys(l).length>0)this.#e&&console.log("displayArchive [setMessage]",null),this.states.setMessage(null);else{const e=(0,s.__)("No item found","dragblock");this.#e&&console.log("displayArchive [setMessage]",e),this.states.setMessage(e)}};loadCatItemIds=(e,t=!1)=>this.loadArchiveItemIds(e,this.cache.readCatItemIds,this.cache.writeCatItemIds,this.fetch.catItemIds,t);loadSearchItemIds=(e,t=!1)=>{if(!t){const t=this.cache.searchItemsInCache(e);if(t){if(!isNaN(e)&&t.length)return t;if(t.length>=this.props.ITEM_PER_PAGE)return t;this.#e&&console.log("Search in cached does not return enough results")}}return this.loadArchiveItemIds(e,this.cache.readSearchItemIds,this.cache.writeSearchItemIds,this.fetch.search,t)};loadItems=(e,t=!1)=>{let s={},a=new Set([...e]);if(!t){for(let t of e){let e=this.cache.readItem(t);e&&(s[t]=e,a.delete(t))}if(0===a.size)return s}this.states.setIsFetching(!0),this.fetch.items(Array.from(a),(e=>{if(this.states.setIsFetching(!1),e&&Object.keys(e).length>0)for(const t in e)s[t]=e[t],this.cache.writeItem(t,e[t])}))};setItem=(e,t=!1)=>{if(!t){const t=this.cache.readItem(e);if(t&&t.content)return void this.props.onSelectItem(t.content)}this.#e&&console.log("setItem [setIsInserting]",!0),this.states.setIsInserting(!0),this.fetch.item(e,(e=>{if(this.#e&&console.log("setItem [setMessage,setIsInserting]",null,!1),this.states.setMessage(null),this.states.setIsInserting(!1),e&&(0,d.isObject)(e)&&e.content)return void this.props.onSelectItem(e.content);const t=(0,s.__)("Failed loading item content","dragblock");this.#e&&console.log("setItem [setError]",t),this.states.setError(t)}))}}function _(e){const r=new b,l=new C(e,r);(0,a.useEffect)((()=>{l.triggers()}));const n=null!==r.cats&&Object.keys(r.cats).length>0,c=null!==r.items&&Object.keys(r.items).length>0,g=!r.isInserting&&!r.error,u=([e,s],a)=>{const r=s.src?(0,t.createElement)("span",{className:"image"},(0,t.createElement)("img",{loading:"lazy",src:s.src})):null,n=(0,t.createElement)("span",{className:"title"},(0,t.createElement)("strong",{className:"id"},"#",e),""!==s.name&&(0,t.createElement)("span",{className:"name"},s.name));return(0,t.createElement)(i.Button,{key:a,className:"item",onClick:()=>{l.setItem(e)}},r,n)},I={gridTemplateColumns:`repeat(${e.ITEM_PER_ROW},1fr)`};return(0,t.createElement)(i.Modal,{className:`dragblock-item-inserter ${e.ITEM_TYPE}`,title:e.TITLE,onRequestClose:e.onRequestClose,isFullScreen:!0,__experimentalHideHeader:!g,size:g?"fill":"small",headerActions:(0,t.createElement)("div",{className:"header"},c&&(0,t.createElement)("div",{className:"pagination"},(0,t.createElement)(i.Button,{disabled:r.page<2,onClick:l.onPrevClick,icon:o()}),(0,t.createElement)("span",{className:"info"},r.page,"/",r.maxPage),(0,t.createElement)(i.Button,{disabled:r.page>=r.maxPage,onClick:l.onNextClick,icon:h()})),!r.isFetching&&!r.isInserting&&!r.error&&(0,t.createElement)(i.Button,{icon:m(),label:(0,s.__)("Refresh Cache","dragblock"),onClick:l.onRequestRefresh}))},!(0,d.isEmpty)(r.error)&&(0,t.createElement)("div",{className:"error"},r.error),r.isInserting&&(0,t.createElement)("h2",{className:"inserting-message"},r.message),g&&(0,t.createElement)("div",{className:"inner"},(0,t.createElement)("div",{className:"sidebar"},(0,t.createElement)(i.SearchControl,{value:r.searchTerm,onChange:l.onSearchChange,disabled:r.isFetching}),n&&(0,t.createElement)(i.MenuGroup,{className:"categories",label:(0,s.__)("Categories","dragblock")},Object.entries(r.cats).map((([e,s],a)=>(0,t.createElement)(i.MenuItem,{key:a,isPressed:r.catId===e,className:"category",onClick:()=>{l.onCategoryClick(e)}},s.name," ",(0,t.createElement)("span",null,s.count))))))," ",(0,t.createElement)("div",{className:"items"},c&&(0,t.createElement)("div",{className:"grid",style:I},Object.entries(r.items).map(u)),!(0,d.isEmpty)(r.message)&&(0,t.createElement)("div",{className:"message"},r.message))))}window.wp.hooks;var v=JSON.parse('{"u2":"dragblock/wrapper"}');(0,e.registerBlockType)(v.u2,{usesContext:["dragblockParentStyles"],edit:function(c){const{attributes:o,setAttributes:h,clientId:m,isSelected:d}=c;let{dragBlockTagName:I,dragBlockClientId:p,dragBlockStyles:f}=o;const[k,E]=(0,a.useState)(!1),{replaceInnerBlocks:b}=(0,r.useDispatch)("core/block-editor"),C=(0,r.select)("core/block-editor").getBlockCount(m),v=(0,l.useBlockProps)(),{children:T,...S}=(0,l.useInnerBlocksProps)(v,{orientation:"horizontal",renderAppender:!1}),w=C||f&&f.length;w||(S.className||(S.className=""),S.className+=" dragblock-has-no-children");const y=w?null:(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"wrapper-inserters"},(0,t.createElement)(g,{rootClientId:m}),(0,t.createElement)(i.Button,{variant:"secondary",title:(0,s.__)("Insert Template","dragblock"),onClick:()=>E(!0)},n()))),N=(0,t.createElement)(t.Fragment,null,T,y);I||(I="div");const B=React.createElement(I,{...S},N),P=new u("pattern",(0,s.__)("DragBlock Patterns","dragblock"));P.onRequestClose=function(){E(!1)},P.onSelectItem=function(t){E(!1);const s=(0,e.rawHandler)({HTML:t});b(m,s)};const M=k&&(0,t.createElement)(_,{...P});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l.InspectorControls,{group:"advanced"},(0,t.createElement)(i.SelectControl,{label:(0,s.__)("Tag Name","dragblock"),value:I,onChange:e=>{h({dragBlockTagName:e,dragBlockClientId:m})},options:[{value:"div",label:"div"},{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"nav",label:"nav"},{value:"button",label:"button"},{value:"ul",label:"ul"},{value:"li",label:"li"},{value:"blockquote",label:"blockquote"},{value:"section",label:"section"},{value:"header",label:"header"},{value:"footer",label:"footer"},{value:"main",label:"main"},{value:"article",label:"article"},{value:"aside",label:"aside"},{value:"pre",label:"pre"},{value:"label",label:"label"},{value:"fieldset",label:"fieldset"},{value:"legend",label:"legend"}]})),B,M)},save:function(e){const{attributes:s}=e,{dragBlockTagName:a}=s;let i=l.useBlockProps.save();const r=React.createElement(a||"div",{...i},(0,t.createElement)(l.InnerBlocks.Content,null));return(0,t.createElement)(t.Fragment,null,r)}})}();1 !function(){"use strict";var e=window.wp.blocks,t=window.wp.element,s=window.wp.i18n,a=window.React,i=window.wp.components,r=window.wp.data,l=window.wp.blockEditor;const n=()=>dragBlockIcons?.iconFolder,c=()=>dragBlockIcons?.iconBigPlus,o=()=>dragBlockIcons?.iconChevronLeft,h=()=>dragBlockIcons?.iconChevronRight,d=()=>dragBlockIcons?.iconReusableBlock;function m({rootClientId:e}){return(0,t.createElement)(l.Inserter,{position:"bottom center",rootClientId:e,__experimentalIsQuick:!0,renderToggle:({onToggle:e})=>(0,t.createElement)(i.Button,{variant:"secondary",title:(0,s.__)("Add a Child","dragblock"),onClick:e},c()),isAppender:!0})}var g=window.lodash;class u{constructor(e,t,s=4,a=2){this.ITEM_TYPE=e,this.TITLE=t,this.ITEM_PER_ROW=s,this.ITEM_PER_PAGE=s*a,this.onRequestClose=()=>{},this.onSelectItem=e=>{}}}class I{constructor(e,t=!1,s=2592e6){this.k=e,this.disable_cache=t,this.cache_ttl=t?1e4:s}read=e=>function(e){if(!e)return null;e="dragblock__"+e;let t=localStorage.getItem(e);if(!t&&(t=window[e],!t))return null;const s=JSON.parse(t);return s.value?s.expiry&&(new Date).getTime()>s.expiry?(localStorage.removeItem(e),null):s.value:null}(e);write=(e,t)=>{!function(e,t,s=null){const a=new Date;if(!e)return;e="dragblock__"+e;const i={value:t,expiry:null===s?null:a.getTime()+s};try{localStorage.setItem(e,JSON.stringify(i))}catch(t){window[e]=JSON.stringify(i)}}(e,t,this.cache_ttl)};delete=e=>{!function(e){e&&(e="dragblock__"+e,localStorage.removeItem(e))}(e)};readCats=()=>this.read(this.k.cats());writeCats=e=>{this.write(this.k.cats(),e)};deleteCats=()=>{this.delete(this.k.cats())};readCatItemIds=e=>this.read(this.k.cat(e));writeCatItemIds=(e,t)=>{this.write(this.k.cat(e),t)};deleteCatItemIds=e=>{this.delete(this.k.cat(e))};readItem=e=>this.read(this.k.item(e));writeItem=(e,t)=>{this.write(this.k.item(e),t)};deleteItem=e=>{this.delete(this.k.item(e))};readItems=e=>{let t={};for(let s of e){let e=this.readItem(s);e&&(t[s]=e)}return t};writeItems=e=>{for(let t in e){let s=e[t];this.writeItem(t,s)}};deleteItems=e=>{for(let t of e)this.deleteItem(t)};readSearchTerms=()=>this.read(this.k.searches());writeSearchTerms=e=>{this.write(this.k.searches(),e)};deleteSearchTerms=()=>{this.delete(this.k.searches())};flatSearchTerm=e=>e.toLowerCase().replace(/[^a-z0-9]+/g," ");searchSlug=e=>this.flatSearchTerm(e).replaceAll(" ","-");readSearchItemIds=e=>this.read(this.k.search(this.searchSlug(e)));writeSearchItemIds=(e,t)=>{let s=this.readSearchTerms();s||(s={});let a=this.searchSlug(e);s[a]||(s[a]=e,this.writeSearchTerms(s)),this.write(this.k.search(a),t)};deleteSearchItemIds=e=>{this.delete(this.k.search(this.searchSlug(e)))};searchItemsInCache=e=>{let t=this.flatSearchTerm(e);const s=!isNaN(e);s||(t=t.split(" "));const a=[],i=this.readCats();for(const e in i){const i=this.readCatItemIds(e);if(i)for(const e of i){if(s){e.toString().includes(t)&&a.push(e);continue}const i=this.readItem(e);if(!i||!i.name)continue;const r=this.flatSearchTerm(i.name).replaceAll(" ","");let l=!0;for(const e of t)if(!r.includes(e)){l=!1;break}l&&a.push(e)}}return a}}const p="dragblock-api-fetch-last-option";function f(e){e.rootPath||(e.rootPath="https://dragblock.com/wp-json/"),e.processor||(e.processor="dragblockdotcom"),function({rootPath:e=wpApiSettings.root,processor:t="dragblock",routeName:s="",method:a="POST",params:i=null,thenCallback:r=function(e){},catchCallback:l=function(e){}}){let n=`${e}${t}/v2/${s}`;const c={method:a,headers:{"Content-Type":"application/json"}};"POST"===a||"PUT"===a?c.body=JSON.stringify(i):"GET"===a&&i&&(n+=`?${new URLSearchParams(i).toString()}`),window[p]=c,fetch(n,c).then((e=>e.json())).then((e=>{if(!e.success||!e.data)return e.data&&(0,g.isObject)(e.data)&&(e.data=JSON.stringify(e.data)),void l(new Error(e.data||e.message||JSON.stringify(e)));r(e.data)})).catch(l)}(e)}class k{constructor(e,t=72,s=(()=>{})){this.k=e,this.maxResponseItemNumber=t,this.defaultCatchCallback=s}cats=(e,t=this.defaultCatchCallback)=>{f({routeName:this.k.cats(),thenCallback:e,catchCallback:t})};catItemIds=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.cat(),params:{cat_id:e,item_per_page:this.maxResponseItemNumber},thenCallback:t,catchCallback:s})};search=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.search(),params:{search_term:e,item_per_page:this.maxResponseItemNumber},thenCallback:t,catchCallback:s})};item=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.item(),params:{item_id:e},thenCallback:t,catchCallback:s})};items=(e,t,s=this.defaultCatchCallback)=>{f({routeName:this.k.items(),params:{item_ids:e,item_per_page:this.maxResponseItemNumber},thenCallback:t,catchCallback:s})}}class E{constructor(e){this.itemType=e,this.cats=()=>this.itemType+"-categories",this.cat=(e=null)=>this.itemType+"-category"+(e?"__"+e:""),this.item=(e=null)=>this.itemType+"-item"+(e?"__"+e:""),this.items=()=>this.itemType+"-items",this.search=(e=null)=>this.itemType+"-search"+(e?"__"+e:""),this.searches=()=>this.itemType+"-searches"}}class C{constructor(){this.searchTerm=null,this.setSearchTerm=function(e){},this.typingSearchTimeout=null,this.setTypingSearchTimeout=function(e){},this.cats=null,this.setCats=function(e){},this.catId=null,this.setCatId=function(e){},this.page=1,this.setPage=function(e){},this.maxPage=1,this.setMaxPage=function(e){},this.items=null,this.setItems=function(e){},this.isFetching=!1,this.setIsFetching=function(e){},this.isInserting=!1,this.setIsInserting=function(e){},this.message=null,this.setMessage=function(e){},this.error=null,this.setError=function(e){},this._initializeStates()}_initializeStates(){Object.keys(this).forEach((e=>{if("function"==typeof this[e])return;const[t,s]=(0,a.useState)(this[e]);this[e]=t,this[`set${this._capitalize(e)}`]=s}))}_capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}}class b{#e=!1;#t=!1;#s=1e3;constructor(e,t){this.props=e,this.states=t,this.k=new E(this.props.ITEM_TYPE),this.cache=new I(this.k,this.#t),this.fetch=new k(this.k,this.props.ITEM_PER_PAGE,(e=>{this.#e&&console.log("Fetch Error Callback [setError]",e),this.states.setError(e.message||e.data||JSON.stringify(e))}))}triggers=()=>{if(this.states.isInserting){if(!this.states.message){const e=(0,s.__)("Downloading and Inserting item ...","dragblock");this.#e&&console.log("trigger [setMessage] ",e),this.states.setMessage(e)}return}if(this.states.error||this.states.isFetching)return;if(!this.states.cats){const e=(0,s.__)("Loading categories ...","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),this.states.setMessage(e),void this.loadCats()}if(this.states.searchTerm){if(this.states.typingSearchTimeout)return void(this.#e&&console.log("trigger typing search ..."));if(this.states.searchTerm.length<3&&isNaN(this.states.searchTerm)){const e=(0,s.__)("The search term is so general!","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}let e=this.loadSearchItemIds(this.states.searchTerm);if(!e){const e=(0,s.__)("Loading search results ...","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}if(0===e.length){const e=(0,s.__)("No item found for the search term","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}return void this.displayArchive(e)}if(!this.states.catId){const e=Object.keys(this.states.cats)[0];return this.#e&&console.log("trigger [setCatId,setItems] ",e,null),this.states.setCatId(e),void this.states.setItems(null)}let e=this.loadCatItemIds(this.states.catId);if(!e){const e=(0,s.__)("Loading category items ...","dragblock");return this.#e&&console.log("trigger [message,setItems,states.catId] ",e,null,this.states.catId),this.states.setMessage(e),void this.states.setItems(null)}if(0===e.length){const e=(0,s.__)("No item found for the category","dragblock");return this.#e&&console.log("trigger [setMessage] ",e),void this.states.setMessage(e)}this.#e&&console.log("trigger display cats",e),this.displayArchive(e)};onRequestRefresh=()=>{let e=!0;this.#e&&console.log("onRequestRefresh [setItems] null"),this.states.setItems(null),this.states.setMessage((0,s.__)("Refreshing currenty query ...","dragblock")),this.states.searchTerm?this.loadSearchItemIds(this.states.searchTerm,e):this.states.catId&&(this.loadCats(e),this.loadCatItemIds(this.states.catId,e))};onSearchChange=e=>{if(this.states.isFetching)return;const t=(0,s.__)("Searching ...","dragblock");this.#e&&console.log("searchOnChange [setSearchTerm,setItems,setCatId,setMessage] ",e,null,null,t),this.states.setSearchTerm(e),this.states.setItems(null),this.states.setCatId(null),this.states.setMessage(t),this.states.typingSearchTimeout&&clearTimeout(this.states.typingSearchTimeout),this.states.setTypingSearchTimeout(setTimeout((()=>{this.#e&&console.log("searchOnChange [setTypingSearchTimeout]",null),this.states.setTypingSearchTimeout(null)}),this.#s))};onCategoryClick=e=>{this.states.setSearchTerm(""),this.states.setCatId(e),this.states.setItems(null),this.states.setPage(1),this.states.setMaxPage(1)};onPrevClick=()=>{this.states.page<2||this.states.setPage(this.states.page-1)};onNextClick=()=>{this.states.page>=this.states.maxPage||this.states.setPage(this.states.page+1)};loadCachedCats=()=>{let e=this.cache.readCats();return e&&Object.keys(e).length?(this.#e&&console.log("loadCats [setCats]",e),this.states.setCats(e),e):null};loadCats=(e=!1)=>{!e&&this.loadCachedCats()||(this.states.setIsFetching(!0),this.fetch.cats((e=>{if(this.states.setIsFetching(!1),e&&(0,g.isObject)(e)&&Object.keys(e).length>0){for(let t in e)if(isNaN(t)){if(this.loadCachedCats())return;const e=(0,s.__)("Wrong categories data!","dragblocked");return this.#e&&console.log("loadCats [setError]",e),void this.states.setError(e)}return this.#e&&console.log("loadCats [setCats]",e),this.states.setCats(e),void this.cache.writeCats(e)}if(this.loadCachedCats())return;const t=(0,s.__)("Not categories found!","dragblocked");this.#e&&console.log("loadCats [setError]",t),this.states.setError(t)})))};loadArchiveItemIds=(e,t,s,a,i=!1)=>{if(!i){let s=t(e);if(s)return s}this.#e&&console.log("loadArchiveItemIds [setIsFetching]",!0),this.states.setIsFetching(!0),a(e,(t=>{if(this.#e&&console.log("loadArchiveItemIds",e,"[setIsFetching]",!1,t),this.states.setIsFetching(!1),t&&(0,g.isArray)(t)&&t.length>0){for(let a of t)if(isNaN(a))return void s(e,[]);t=(0,g.shuffle)(t.map((e=>parseInt(e)))),s(e,t)}else s(e,[])}))};displayArchive=e=>{if(this.states.page<1||this.states.page>this.states.maxPage||!e||!e.length)return;e=e.map((e=>parseInt(e)));let t=[];const a=(this.states.page-1)*this.props.ITEM_PER_PAGE,i=Math.min(e.length,a+this.props.ITEM_PER_PAGE);for(let s=a;s<i;s++)t.push(e[s]);const r=Object.keys(this.states.items||{}).map((e=>Number(e)));if(t=(0,g.pull)(t,...r),0===t.length)return;let l=this.loadItems(t);if(!l){const e=(0,s.__)("Loading items ...","dragblock");return this.#e&&console.log("displayArchive [setMessage]",e),void this.states.setMessage(e)}if(this.#e&&console.log("displayArchive [setItems]",{itemIds:e,showingItemIds:r,remainItemIds:t,nextItems:l}),this.states.setItems(l),this.states.setMaxPage(Math.ceil(e.length/this.props.ITEM_PER_PAGE)),Object.keys(l).length>0)this.#e&&console.log("displayArchive [setMessage]",null),this.states.setMessage(null);else{const e=(0,s.__)("No item found","dragblock");this.#e&&console.log("displayArchive [setMessage]",e),this.states.setMessage(e)}};loadCatItemIds=(e,t=!1)=>this.loadArchiveItemIds(e,this.cache.readCatItemIds,this.cache.writeCatItemIds,this.fetch.catItemIds,t);loadSearchItemIds=(e,t=!1)=>{if(!t){const t=this.cache.searchItemsInCache(e);if(t){if(!isNaN(e)&&t.length)return t;if(t.length>=this.props.ITEM_PER_PAGE)return t;this.#e&&console.log("Search in cached does not return enough results")}}return this.loadArchiveItemIds(e,this.cache.readSearchItemIds,this.cache.writeSearchItemIds,this.fetch.search,t)};loadItems=(e,t=!1)=>{let s={},a=new Set([...e]);if(!t){for(let t of e){let e=this.cache.readItem(t);e&&(s[t]=e,a.delete(t))}if(0===a.size)return s}this.states.setIsFetching(!0),this.fetch.items(Array.from(a),(e=>{if(this.states.setIsFetching(!1),e&&Object.keys(e).length>0)for(const t in e)s[t]=e[t],this.cache.writeItem(t,e[t])}))};setItem=(e,t=!1)=>{if(!t){const t=this.cache.readItem(e);if(t&&t.content)return void this.props.onSelectItem(t.content)}this.#e&&console.log("setItem [setIsInserting]",!0),this.states.setIsInserting(!0),this.fetch.item(e,(e=>{if(this.#e&&console.log("setItem [setMessage,setIsInserting]",null,!1),this.states.setMessage(null),this.states.setIsInserting(!1),e&&(0,g.isObject)(e)&&e.content)return void this.props.onSelectItem(e.content);const t=(0,s.__)("Failed loading item content","dragblock");this.#e&&console.log("setItem [setError]",t),this.states.setError(t)}))}}function _(e){const r=new C,l=new b(e,r);(0,a.useEffect)((()=>{l.triggers()}));const n=null!==r.cats&&Object.keys(r.cats).length>0,c=null!==r.items&&Object.keys(r.items).length>0,m=!r.isInserting&&!r.error,u=([e,s],a)=>{const r=s.src?(0,t.createElement)("span",{className:"image"},(0,t.createElement)("img",{loading:"lazy",src:s.src})):null,n=(0,t.createElement)("span",{className:"title"},(0,t.createElement)("strong",{className:"id"},"#",e),""!==s.name&&(0,t.createElement)("span",{className:"name"},s.name));return(0,t.createElement)(i.Button,{key:a,className:"item",onClick:()=>{l.setItem(e)}},r,n)},I={gridTemplateColumns:`repeat(${e.ITEM_PER_ROW},1fr)`};return(0,t.createElement)(i.Modal,{className:`dragblock-item-inserter ${e.ITEM_TYPE}`,title:e.TITLE,onRequestClose:e.onRequestClose,isFullScreen:!0,__experimentalHideHeader:!m,size:m?"fill":"small",headerActions:(0,t.createElement)("div",{className:"header"},c&&(0,t.createElement)("div",{className:"pagination"},(0,t.createElement)(i.Button,{disabled:r.page<2,onClick:l.onPrevClick,icon:o()}),(0,t.createElement)("span",{className:"info"},r.page,"/",r.maxPage),(0,t.createElement)(i.Button,{disabled:r.page>=r.maxPage,onClick:l.onNextClick,icon:h()})),!r.isFetching&&!r.isInserting&&!r.error&&(0,t.createElement)(i.Button,{icon:d(),label:(0,s.__)("Refresh Cache","dragblock"),onClick:l.onRequestRefresh}))},!(0,g.isEmpty)(r.error)&&(0,t.createElement)("div",{className:"error"},r.error),r.isInserting&&(0,t.createElement)("h2",{className:"inserting-message"},r.message),m&&(0,t.createElement)("div",{className:"inner"},(0,t.createElement)("div",{className:"sidebar"},(0,t.createElement)(i.SearchControl,{value:r.searchTerm,onChange:l.onSearchChange,disabled:r.isFetching}),n&&(0,t.createElement)(i.MenuGroup,{className:"categories",label:(0,s.__)("Categories","dragblock")},Object.entries(r.cats).map((([e,s],a)=>(0,t.createElement)(i.MenuItem,{key:a,isPressed:r.catId===e,className:"category",onClick:()=>{l.onCategoryClick(e)}},s.name," ",(0,t.createElement)("span",null,s.count))))))," ",(0,t.createElement)("div",{className:"items"},c&&(0,t.createElement)("div",{className:"grid",style:I},Object.entries(r.items).map(u)),!(0,g.isEmpty)(r.message)&&(0,t.createElement)("div",{className:"message"},r.message))))}window.wp.hooks;var v=JSON.parse('{"u2":"dragblock/wrapper"}');(0,e.registerBlockType)(v.u2,{usesContext:["dragblockParentStyles"],edit:function(c){const{attributes:o,setAttributes:h,clientId:d,isSelected:g}=c;let{dragBlockTagName:I,dragBlockClientId:p,dragBlockStyles:f}=o;const[k,E]=(0,a.useState)(!1),{replaceInnerBlocks:C}=(0,r.useDispatch)("core/block-editor"),b=(0,r.select)("core/block-editor").getBlockCount(d),v=(0,l.useBlockProps)(),{children:T,...S}=(0,l.useInnerBlocksProps)(v,{orientation:"horizontal",renderAppender:!1}),w=b||f&&f.length;w||(S.className||(S.className=""),S.className+=" dragblock-has-no-children");const y=w?null:(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{className:"wrapper-inserters"},(0,t.createElement)(m,{rootClientId:d}),(0,t.createElement)(i.Button,{variant:"secondary",title:(0,s.__)("Insert Template","dragblock"),onClick:()=>E(!0)},n()))),N=(0,t.createElement)(t.Fragment,null,T,y);I||(I="div");const B=React.createElement(I,{...S},N),P=new u("pattern",(0,s.__)("DragBlock Patterns","dragblock"));P.onRequestClose=function(){E(!1)},P.onSelectItem=function(t){E(!1);const s=(0,e.rawHandler)({HTML:t});C(d,s)};const M=k&&(0,t.createElement)(_,{...P});return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(l.InspectorControls,{group:"advanced"},(0,t.createElement)(i.SelectControl,{label:(0,s.__)("Tag Name","dragblock"),value:I,onChange:e=>{h({dragBlockTagName:e,dragBlockClientId:d})},options:[{value:"div",label:"div"},{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"},{value:"nav",label:"nav"},{value:"button",label:"button"},{value:"ul",label:"ul"},{value:"li",label:"li"},{value:"blockquote",label:"blockquote"},{value:"section",label:"section"},{value:"header",label:"header"},{value:"footer",label:"footer"},{value:"main",label:"main"},{value:"article",label:"article"},{value:"aside",label:"aside"},{value:"pre",label:"pre"},{value:"label",label:"label"},{value:"fieldset",label:"fieldset"},{value:"legend",label:"legend"}]})),B,M)},save:function(e){const{attributes:s}=e,{dragBlockTagName:a}=s;let i=l.useBlockProps.save();const r=React.createElement(a||"div",{...i},(0,t.createElement)(l.InnerBlocks.Content,null));return(0,t.createElement)(t.Fragment,null,r)}})}(); -
dragblock/trunk/build/index.php
r3147820 r3155330 266 266 require_once 'blocks/block-register.php'; 267 267 require_once 'applications/tutorials/server/index.php'; 268 require_once 'applications/patterns/server/index.php'; 268 // dev-reply#20298. 269 269 require_once 'applications/form-entries/server/index.php'; 270 270 require_once 'applications/font-library/server/index.php'; -
dragblock/trunk/dragblock.php
r3149699 r3155330 6 6 * Requires at least: 5.9 7 7 * Requires PHP: 7.0 8 * Version: 24.09. 108 * Version: 24.09.20 9 9 * Author: DragBlock.Com 10 10 * Author URI: https://dragblock.com … … 32 32 defined('WP_ENVIRONMENT_TYPE') && WP_ENVIRONMENT_TYPE === 'local' 33 33 ); 34 define('DRAGBLOCK_VERSION', DRAGBLOCK_IS_LOCAL ? time() : '24.09. 10');34 define('DRAGBLOCK_VERSION', DRAGBLOCK_IS_LOCAL ? time() : '24.09.20'); 35 35 36 36 require_once 'build/index.php'; -
dragblock/trunk/readme.txt
r3149699 r3155330 5 5 Requires at least: 5.9 6 6 Requires PHP: 7.4 7 Stable tag: 24.09. 107 Stable tag: 24.09.20 8 8 Tested up to: 6.6.1 9 9 License: GPLv2 or later … … 60 60 61 61 == Changelog == 62 = 24.09.20 = 63 * Stable changes for pattern inserter 64 62 65 = 24.09.10 = 63 66 * Fixed bug for loading categories in pattern inserter
Note: See TracChangeset
for help on using the changeset viewer.