@wordpress/block-library 10.5.2-next.v.202608281122.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -1
- package/build/audio/edit.cjs +5 -5
- package/build/audio/edit.cjs.map +2 -2
- package/build/audio/index.cjs +0 -37
- package/build/audio/index.cjs.map +3 -3
- package/build/button/index.cjs +0 -34
- package/build/button/index.cjs.map +3 -3
- package/build/code/index.cjs +0 -17
- package/build/code/index.cjs.map +3 -3
- package/build/comment-template/edit.cjs.map +1 -1
- package/build/cover/index.cjs +0 -38
- package/build/cover/index.cjs.map +3 -3
- package/build/details/index.cjs +0 -17
- package/build/details/index.cjs.map +3 -3
- package/build/file/index.cjs +0 -43
- package/build/file/index.cjs.map +3 -3
- package/build/footnotes/format.cjs +1 -1
- package/build/footnotes/format.cjs.map +2 -2
- package/build/gallery/dynamic-gallery.cjs +22 -12
- package/build/gallery/dynamic-gallery.cjs.map +2 -2
- package/build/heading/index.cjs +0 -16
- package/build/heading/index.cjs.map +3 -3
- package/build/image/image.cjs +7 -5
- package/build/image/image.cjs.map +2 -2
- package/build/image/index.cjs +0 -81
- package/build/image/index.cjs.map +3 -3
- package/build/image/use-open-image-media-editor-modal.cjs +81 -14
- package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
- package/build/index.cjs +0 -10
- package/build/index.cjs.map +2 -2
- package/build/latest-posts/edit.cjs.map +1 -1
- package/build/list-item/edit.cjs +14 -11
- package/build/list-item/edit.cjs.map +2 -2
- package/build/list-item/hooks/index.cjs +6 -9
- package/build/list-item/hooks/index.cjs.map +2 -2
- package/build/list-item/hooks/use-enter.cjs +62 -67
- package/build/list-item/hooks/use-enter.cjs.map +3 -3
- package/build/list-item/hooks/use-merge.cjs +26 -44
- package/build/list-item/hooks/use-merge.cjs.map +3 -3
- package/build/list-item/hooks/use-multi-select-tab.cjs +80 -0
- package/build/list-item/hooks/use-multi-select-tab.cjs.map +7 -0
- package/build/list-item/hooks/use-tab.cjs +65 -0
- package/build/list-item/hooks/use-tab.cjs.map +7 -0
- package/build/list-item/index.cjs +0 -17
- package/build/list-item/index.cjs.map +3 -3
- package/build/list-item/utils.cjs +169 -0
- package/build/list-item/utils.cjs.map +7 -0
- package/build/math/block.json +3 -0
- package/build/media-text/index.cjs +0 -50
- package/build/media-text/index.cjs.map +3 -3
- package/build/media-text/media-container.cjs +16 -11
- package/build/media-text/media-container.cjs.map +2 -2
- package/build/more/index.cjs +0 -18
- package/build/more/index.cjs.map +3 -3
- package/build/navigation/constants.cjs +1 -1
- package/build/navigation/constants.cjs.map +1 -1
- package/build/navigation-link/block.json +1 -1
- package/build/navigation-link/deprecated.cjs +69 -0
- package/build/navigation-link/deprecated.cjs.map +7 -0
- package/build/navigation-link/index.cjs +6 -74
- package/build/navigation-link/index.cjs.map +4 -4
- package/build/{form-submit-button/init.cjs → navigation-link/variations.cjs} +23 -8
- package/build/navigation-link/variations.cjs.map +7 -0
- package/build/navigation-submenu/index.cjs +0 -32
- package/build/navigation-submenu/index.cjs.map +3 -3
- package/build/paragraph/index.cjs +0 -17
- package/build/paragraph/index.cjs.map +3 -3
- package/build/paragraph/use-enter.cjs +8 -4
- package/build/paragraph/use-enter.cjs.map +2 -2
- package/build/post-template/edit.cjs +3 -1
- package/build/post-template/edit.cjs.map +2 -2
- package/build/preformatted/index.cjs +0 -17
- package/build/preformatted/index.cjs.map +3 -3
- package/build/pullquote/index.cjs +0 -24
- package/build/pullquote/index.cjs.map +3 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs +13 -5
- package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs.map +2 -2
- package/build/query/edit/inspector-controls/index.cjs +9 -4
- package/build/query/edit/inspector-controls/index.cjs.map +2 -2
- package/build/query/edit/query-content.cjs +30 -9
- package/build/query/edit/query-content.cjs.map +3 -3
- package/build/query/utils.cjs +11 -4
- package/build/query/utils.cjs.map +2 -2
- package/build/search/edit.cjs +3 -1
- package/build/search/edit.cjs.map +2 -2
- package/build/search/index.cjs +0 -31
- package/build/search/index.cjs.map +3 -3
- package/build/site-tagline/edit.cjs +11 -17
- package/build/site-tagline/edit.cjs.map +2 -2
- package/build/site-title/edit.cjs +12 -18
- package/build/site-title/edit.cjs.map +2 -2
- package/build/social-link/index.cjs +0 -31
- package/build/social-link/index.cjs.map +3 -3
- package/build/verse/index.cjs +0 -17
- package/build/verse/index.cjs.map +3 -3
- package/build/video/index.cjs +0 -40
- package/build/video/index.cjs.map +3 -3
- package/build/video/tracks-editor.cjs +2 -3
- package/build/video/tracks-editor.cjs.map +3 -3
- package/build-module/audio/edit.mjs +5 -5
- package/build-module/audio/edit.mjs.map +2 -2
- package/build-module/audio/index.mjs +0 -37
- package/build-module/audio/index.mjs.map +2 -2
- package/build-module/button/index.mjs +0 -34
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/code/index.mjs +0 -17
- package/build-module/code/index.mjs.map +2 -2
- package/build-module/comment-template/edit.mjs.map +1 -1
- package/build-module/cover/index.mjs +0 -38
- package/build-module/cover/index.mjs.map +2 -2
- package/build-module/details/index.mjs +0 -17
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/file/index.mjs +1 -44
- package/build-module/file/index.mjs.map +2 -2
- package/build-module/footnotes/format.mjs +1 -1
- package/build-module/footnotes/format.mjs.map +2 -2
- package/build-module/gallery/dynamic-gallery.mjs +23 -13
- package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
- package/build-module/heading/index.mjs +1 -21
- package/build-module/heading/index.mjs.map +2 -2
- package/build-module/image/image.mjs +7 -5
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/index.mjs +0 -81
- package/build-module/image/index.mjs.map +2 -2
- package/build-module/image/use-open-image-media-editor-modal.mjs +84 -14
- package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
- package/build-module/index.mjs +0 -10
- package/build-module/index.mjs.map +2 -2
- package/build-module/latest-posts/edit.mjs.map +1 -1
- package/build-module/list-item/edit.mjs +20 -18
- package/build-module/list-item/edit.mjs.map +2 -2
- package/build-module/list-item/hooks/index.mjs +8 -10
- package/build-module/list-item/hooks/index.mjs.map +2 -2
- package/build-module/list-item/hooks/use-enter.mjs +63 -58
- package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
- package/build-module/list-item/hooks/use-merge.mjs +27 -35
- package/build-module/list-item/hooks/use-merge.mjs.map +2 -2
- package/build-module/list-item/hooks/use-multi-select-tab.mjs +59 -0
- package/build-module/list-item/hooks/use-multi-select-tab.mjs.map +7 -0
- package/build-module/list-item/hooks/use-tab.mjs +44 -0
- package/build-module/list-item/hooks/use-tab.mjs.map +7 -0
- package/build-module/list-item/index.mjs +0 -17
- package/build-module/list-item/index.mjs.map +2 -2
- package/build-module/list-item/utils.mjs +140 -0
- package/build-module/list-item/utils.mjs.map +7 -0
- package/build-module/math/block.json +3 -0
- package/build-module/media-text/index.mjs +0 -50
- package/build-module/media-text/index.mjs.map +2 -2
- package/build-module/media-text/media-container.mjs +17 -12
- package/build-module/media-text/media-container.mjs.map +2 -2
- package/build-module/more/index.mjs +0 -18
- package/build-module/more/index.mjs.map +2 -2
- package/build-module/navigation/constants.mjs +1 -1
- package/build-module/navigation/constants.mjs.map +1 -1
- package/build-module/navigation-link/block.json +1 -1
- package/build-module/navigation-link/deprecated.mjs +48 -0
- package/build-module/navigation-link/deprecated.mjs.map +7 -0
- package/build-module/navigation-link/index.mjs +7 -75
- package/build-module/navigation-link/index.mjs.map +3 -3
- package/build-module/navigation-link/variations.mjs +22 -0
- package/build-module/navigation-link/variations.mjs.map +7 -0
- package/build-module/navigation-submenu/index.mjs +1 -33
- package/build-module/navigation-submenu/index.mjs.map +2 -2
- package/build-module/paragraph/index.mjs +0 -17
- package/build-module/paragraph/index.mjs.map +2 -2
- package/build-module/paragraph/use-enter.mjs +8 -4
- package/build-module/paragraph/use-enter.mjs.map +2 -2
- package/build-module/post-template/edit.mjs +3 -1
- package/build-module/post-template/edit.mjs.map +2 -2
- package/build-module/preformatted/index.mjs +0 -17
- package/build-module/preformatted/index.mjs.map +2 -2
- package/build-module/pullquote/index.mjs +0 -24
- package/build-module/pullquote/index.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs +14 -6
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs.map +2 -2
- package/build-module/query/edit/inspector-controls/index.mjs +9 -4
- package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
- package/build-module/query/edit/query-content.mjs +32 -11
- package/build-module/query/edit/query-content.mjs.map +2 -2
- package/build-module/query/utils.mjs +10 -7
- package/build-module/query/utils.mjs.map +2 -2
- package/build-module/search/edit.mjs +4 -2
- package/build-module/search/edit.mjs.map +2 -2
- package/build-module/search/index.mjs +0 -31
- package/build-module/search/index.mjs.map +2 -2
- package/build-module/site-tagline/edit.mjs +13 -19
- package/build-module/site-tagline/edit.mjs.map +2 -2
- package/build-module/site-title/edit.mjs +14 -20
- package/build-module/site-title/edit.mjs.map +2 -2
- package/build-module/social-link/index.mjs +0 -31
- package/build-module/social-link/index.mjs.map +2 -2
- package/build-module/verse/index.mjs +0 -17
- package/build-module/verse/index.mjs.map +2 -2
- package/build-module/video/index.mjs +0 -40
- package/build-module/video/index.mjs.map +2 -2
- package/build-module/video/tracks-editor.mjs +3 -5
- package/build-module/video/tracks-editor.mjs.map +2 -2
- package/build-style/columns/style-rtl.css +1 -1
- package/build-style/columns/style.css +1 -1
- package/build-style/comment-template/style-rtl.css +0 -1
- package/build-style/comment-template/style.css +0 -1
- package/build-style/cover/style-rtl.css +1 -2
- package/build-style/cover/style.css +1 -2
- package/build-style/editor-rtl.css +20 -81
- package/build-style/editor.css +20 -81
- package/build-style/gallery/style-rtl.css +2 -4
- package/build-style/gallery/style.css +2 -4
- package/build-style/group/theme-rtl.css +1 -1
- package/build-style/group/theme.css +1 -1
- package/build-style/heading/style-rtl.css +1 -1
- package/build-style/heading/style.css +1 -1
- package/build-style/icon/style-rtl.css +3 -0
- package/build-style/icon/style.css +3 -0
- package/build-style/image/editor-rtl.css +0 -1
- package/build-style/image/editor.css +0 -1
- package/build-style/list/style-rtl.css +1 -1
- package/build-style/list/style.css +1 -1
- package/build-style/media-text/style-rtl.css +2 -3
- package/build-style/media-text/style.css +2 -3
- package/build-style/navigation/editor-rtl.css +8 -0
- package/build-style/navigation/editor.css +8 -0
- package/build-style/paragraph/style-rtl.css +1 -1
- package/build-style/paragraph/style.css +1 -1
- package/build-style/playlist/style-rtl.css +1 -2
- package/build-style/playlist/style.css +1 -2
- package/build-style/playlist-track/style-rtl.css +1 -2
- package/build-style/playlist-track/style.css +1 -2
- package/build-style/preformatted/style-rtl.css +1 -1
- package/build-style/preformatted/style.css +1 -1
- package/build-style/query/editor-rtl.css +5 -15
- package/build-style/query/editor.css +5 -15
- package/build-style/read-more/style-rtl.css +0 -1
- package/build-style/read-more/style.css +0 -1
- package/build-style/reset-rtl.css +1 -3
- package/build-style/reset.css +1 -3
- package/build-style/search/style-rtl.css +1 -3
- package/build-style/search/style.css +1 -3
- package/build-style/site-logo/editor-rtl.css +1 -2
- package/build-style/site-logo/editor.css +1 -2
- package/build-style/style-rtl.css +18 -77
- package/build-style/style.css +18 -77
- package/build-style/tab-list/style-rtl.css +1 -3
- package/build-style/tab-list/style.css +1 -3
- package/build-style/template-part/editor-rtl.css +4 -8
- package/build-style/template-part/editor.css +4 -8
- package/build-style/template-part/theme-rtl.css +1 -1
- package/build-style/template-part/theme.css +1 -1
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/build-style/video/style-rtl.css +1 -2
- package/build-style/video/style.css +1 -2
- package/build-types/navigation-link/deprecated.d.ts +48 -0
- package/build-types/navigation-link/deprecated.d.ts.map +1 -0
- package/package.json +43 -43
- package/src/accordion/index.php +2 -2
- package/src/accordion-item/index.php +1 -1
- package/src/audio/edit.jsx +6 -7
- package/src/audio/index.js +0 -37
- package/src/breadcrumbs/index.php +4 -4
- package/src/button/index.js +0 -34
- package/src/button/style.scss +16 -15
- package/src/button/test/{get-experimental-label.js → get-experimental-label.jsdom.test.js} +1 -0
- package/src/button/test/get-updated-link-attributes.js +1 -0
- package/src/button/test/utils.js +1 -0
- package/src/categories/index.php +4 -0
- package/src/code/index.js +0 -18
- package/src/code/test/utils.js +1 -0
- package/src/columns/style.scss +2 -1
- package/src/columns/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/columns/test/utils.js +1 -0
- package/src/comment-template/edit.jsx +1 -1
- package/src/comment-template/index.php +2 -2
- package/src/comment-template/test/index.js +1 -0
- package/src/common.scss +51 -50
- package/src/cover/README.md +37 -0
- package/src/cover/index.js +0 -39
- package/src/cover/style.scss +3 -3
- package/src/cover/test/{edit.js → edit.jsdom.test.js} +18 -17
- package/src/cover/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/details/index.js +0 -18
- package/src/editor.scss +0 -2
- package/src/embed/editor.scss +1 -0
- package/src/embed/test/{index.js → index.jsdom.test.js} +5 -1
- package/src/file/index.js +1 -43
- package/src/footnotes/format.jsx +5 -1
- package/src/gallery/dynamic-gallery.jsx +31 -4
- package/src/gallery/test/dynamic-source.js +1 -0
- package/src/gallery/test/{edit.js → edit.jsdom.test.js} +4 -0
- package/src/gallery/test/responsive-styles.js +1 -0
- package/src/gallery/test/shared.js +1 -0
- package/src/gallery/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/gallery/test/{use-get-new-images.jsx → use-get-new-images.jsdom.test.jsx} +1 -0
- package/src/gallery/test/variations.js +1 -0
- package/src/group/test/{placeholder.jsx → placeholder.jsdom.test.jsx} +1 -0
- package/src/group/theme.scss +1 -1
- package/src/heading/index.js +1 -22
- package/src/heading/index.php +1 -1
- package/src/heading/style.scss +1 -1
- package/src/heading/test/shared.js +1 -0
- package/src/home-link/index.php +2 -2
- package/src/html/test/{index.js → index.jsdom.test.js} +9 -0
- package/src/html/test/{utils.js → utils.jsdom.test.js} +1 -0
- package/src/icon/index.php +18 -6
- package/src/icon/style.scss +7 -0
- package/src/image/image.jsx +18 -11
- package/src/image/index.js +0 -80
- package/src/image/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/image/test/{use-open-image-media-editor-modal.js → use-open-image-media-editor-modal.jsdom.test.js} +343 -28
- package/src/image/use-open-image-media-editor-modal.js +184 -21
- package/src/index.jsx +0 -11
- package/src/latest-posts/edit.jsx +1 -1
- package/src/latest-posts/test/{deprecated.js → deprecated.jsdom.test.js} +1 -0
- package/src/list/index.php +1 -1
- package/src/list/style.scss +1 -1
- package/src/list-item/edit.jsx +20 -20
- package/src/list-item/hooks/index.js +2 -3
- package/src/list-item/hooks/use-enter.js +82 -70
- package/src/list-item/hooks/use-merge.js +28 -36
- package/src/list-item/hooks/use-multi-select-tab.js +83 -0
- package/src/list-item/hooks/use-tab.js +62 -0
- package/src/list-item/index.js +0 -18
- package/src/list-item/utils.js +236 -0
- package/src/math/README.md +2 -0
- package/src/math/block.json +3 -0
- package/src/media-text/index.js +0 -50
- package/src/media-text/media-container.jsx +22 -12
- package/src/media-text/style.scss +2 -1
- package/src/media-text/test/image-fill.js +1 -0
- package/src/more/index.js +0 -19
- package/src/navigation/constants.js +1 -1
- package/src/navigation/edit/test/are-blocks-dirty.js +1 -0
- package/src/navigation/edit/test/{layout-custom-properties.js → layout-custom-properties.jsdom.test.js} +8 -7
- package/src/navigation/edit/test/{navigation-menu-selector.jsx → navigation-menu-selector.jsdom.test.jsx} +23 -14
- package/src/navigation/edit/test/{overlay-template-part-selector.jsx → overlay-template-part-selector.jsdom.test.jsx} +22 -20
- package/src/navigation/edit/test/{responsive-wrapper.jsx → responsive-wrapper.jsdom.test.jsx} +14 -13
- package/src/navigation/edit/test/{use-create-overlay.js → use-create-overlay.jsdom.test.js} +19 -24
- package/src/navigation/edit/test/utils.js +1 -0
- package/src/navigation/editor.scss +13 -0
- package/src/navigation/index.php +14 -14
- package/src/navigation/test/{menu-items-to-blocks.js → menu-items-to-blocks.jsdom.test.js} +3 -2
- package/src/navigation/test/{use-navigation-menu.js → use-navigation-menu.jsdom.test.js} +7 -4
- package/src/navigation/test/{view.js → view.jsdom.test.js} +4 -2
- package/src/navigation-link/block.json +1 -1
- package/src/navigation-link/deprecated.tsx +58 -0
- package/src/navigation-link/{index.jsx → index.js} +5 -77
- package/src/navigation-link/index.php +5 -5
- package/src/navigation-link/shared/test/{controls.jsx → controls.jsdom.test.jsx} +18 -18
- package/src/navigation-link/shared/test/update-attributes.test.js +52 -51
- package/src/navigation-link/shared/test/{use-enable-link-status-validation.test.js → use-enable-link-status-validation.jsdom.test.js} +8 -6
- package/src/navigation-link/shared/test/{use-entity-binding.js → use-entity-binding.jsdom.test.js} +12 -11
- package/src/navigation-link/shared/test/{use-handle-link-change.test.js → use-handle-link-change.jsdom.test.js} +23 -20
- package/src/navigation-link/shared/test/{use-link-preview.test.js → use-link-preview.jsdom.test.js} +17 -14
- package/src/navigation-link/test/__snapshots__/{hooks.js.snap → hooks.jsdom.test.js.snap} +23 -6
- package/src/navigation-link/test/block-labelling.js +1 -0
- package/src/navigation-link/test/{hooks.js → hooks.jsdom.test.js} +1 -0
- package/src/navigation-link/variations.js +19 -0
- package/src/navigation-submenu/index.js +1 -33
- package/src/page-list/index.php +10 -10
- package/src/page-list/test/{convert-to-navigation-links.js → convert-to-navigation-links.jsdom.test.js} +3 -2
- package/src/paragraph/index.js +0 -18
- package/src/paragraph/style.scss +1 -1
- package/src/paragraph/use-enter.js +13 -6
- package/src/pattern/test/index.js +1 -0
- package/src/playlist/test/{edit-component.jsx → edit-component.jsdom.test.jsx} +31 -30
- package/src/playlist/test/{edit.js → edit.jsdom.test.js} +1 -0
- package/src/playlist/test/{transforms.js → transforms.jsdom.test.js} +1 -0
- package/src/playlist-track/test/{edit.jsx → edit.jsdom.test.jsx} +20 -19
- package/src/post-author/index.php +3 -3
- package/src/post-author-biography/index.php +3 -3
- package/src/post-author-name/index.php +3 -3
- package/src/post-comments-link/index.php +4 -4
- package/src/post-date/test/{edit.js → edit.jsdom.test.js} +1 -0
- package/src/post-template/edit.jsx +3 -1
- package/src/post-time-to-read/index.php +3 -3
- package/src/post-title/style.scss +1 -0
- package/src/preformatted/index.js +0 -18
- package/src/preformatted/style.scss +1 -1
- package/src/pullquote/index.js +0 -24
- package/src/query/edit/inspector-controls/enhanced-pagination-control.jsx +13 -6
- package/src/query/edit/inspector-controls/index.jsx +9 -4
- package/src/query/edit/query-content.jsx +31 -8
- package/src/query/editor.scss +1 -7
- package/src/query/index.php +2 -2
- package/src/query/test/{utils.js → utils.jsdom.test.js} +1 -0
- package/src/query/utils.js +15 -11
- package/src/quote/test/{migrate.js → migrate.jsdom.test.js} +1 -0
- package/src/read-more/index.php +1 -1
- package/src/search/edit.jsx +12 -2
- package/src/search/index.js +0 -30
- package/src/search/index.php +1 -1
- package/src/separator/test/{edit.jsx → edit.jsdom.test.jsx} +5 -4
- package/src/site-logo/index.php +1 -1
- package/src/site-tagline/edit.jsx +18 -27
- package/src/site-title/edit.jsx +20 -27
- package/src/social-link/index.js +0 -32
- package/src/social-link/index.php +0 -1
- package/src/style.scss +0 -1
- package/src/table/editor.scss +1 -0
- package/src/table/style.scss +2 -0
- package/src/table/test/state.js +1 -0
- package/src/table/test/utils.js +1 -0
- package/src/table-of-contents/index.php +3 -3
- package/src/template-part/theme.scss +1 -1
- package/src/utils/test/search-patterns.js +1 -0
- package/src/utils/test/{style-state.js → style-state.jsdom.test.js} +1 -0
- package/src/utils/test/{waveform-player-dependency.js → waveform-player-dependency.jsdom.test.js} +15 -21
- package/src/verse/index.js +0 -18
- package/src/verse/style.scss +1 -0
- package/src/video/index.js +0 -40
- package/src/video/test/variations.js +1 -0
- package/src/video/tracks-editor.jsx +4 -5
- package/build/form/block.json +0 -65
- package/build/form/deprecated.cjs +0 -111
- package/build/form/deprecated.cjs.map +0 -7
- package/build/form/edit.cjs +0 -180
- package/build/form/edit.cjs.map +0 -7
- package/build/form/icons.cjs +0 -33
- package/build/form/icons.cjs.map +0 -7
- package/build/form/index.cjs +0 -118
- package/build/form/index.cjs.map +0 -7
- package/build/form/init.cjs +0 -28
- package/build/form/init.cjs.map +0 -7
- package/build/form/save.cjs +0 -40
- package/build/form/save.cjs.map +0 -7
- package/build/form/utils.cjs +0 -61
- package/build/form/utils.cjs.map +0 -7
- package/build/form/variations.cjs +0 -152
- package/build/form/variations.cjs.map +0 -7
- package/build/form/view.cjs +0 -48
- package/build/form/view.cjs.map +0 -7
- package/build/form-input/block.json +0 -72
- package/build/form-input/deprecated.cjs +0 -252
- package/build/form-input/deprecated.cjs.map +0 -7
- package/build/form-input/edit.cjs +0 -206
- package/build/form-input/edit.cjs.map +0 -7
- package/build/form-input/icons.cjs +0 -33
- package/build/form-input/icons.cjs.map +0 -7
- package/build/form-input/index.cjs +0 -63
- package/build/form-input/index.cjs.map +0 -7
- package/build/form-input/init.cjs +0 -28
- package/build/form-input/init.cjs.map +0 -7
- package/build/form-input/save.cjs +0 -88
- package/build/form-input/save.cjs.map +0 -7
- package/build/form-input/variations.cjs +0 -105
- package/build/form-input/variations.cjs.map +0 -7
- package/build/form-submission-notification/block.json +0 -19
- package/build/form-submission-notification/edit.cjs +0 -71
- package/build/form-submission-notification/edit.cjs.map +0 -7
- package/build/form-submission-notification/index.cjs +0 -73
- package/build/form-submission-notification/index.cjs.map +0 -7
- package/build/form-submission-notification/init.cjs +0 -28
- package/build/form-submission-notification/init.cjs.map +0 -7
- package/build/form-submission-notification/save.cjs +0 -54
- package/build/form-submission-notification/save.cjs.map +0 -7
- package/build/form-submission-notification/variations.cjs +0 -78
- package/build/form-submission-notification/variations.cjs.map +0 -7
- package/build/form-submit-button/block.json +0 -15
- package/build/form-submit-button/edit.cjs +0 -36
- package/build/form-submit-button/edit.cjs.map +0 -7
- package/build/form-submit-button/index.cjs +0 -75
- package/build/form-submit-button/index.cjs.map +0 -7
- package/build/form-submit-button/init.cjs.map +0 -7
- package/build/form-submit-button/save.cjs +0 -32
- package/build/form-submit-button/save.cjs.map +0 -7
- package/build/list-item/hooks/use-indent-list-item.cjs +0 -79
- package/build/list-item/hooks/use-indent-list-item.cjs.map +0 -7
- package/build/list-item/hooks/use-outdent-list-item.cjs +0 -106
- package/build/list-item/hooks/use-outdent-list-item.cjs.map +0 -7
- package/build/list-item/hooks/use-space.cjs +0 -83
- package/build/list-item/hooks/use-space.cjs.map +0 -7
- package/build/query/edit/enhanced-pagination-modal.cjs +0 -89
- package/build/query/edit/enhanced-pagination-modal.cjs.map +0 -7
- package/build-module/form/block.json +0 -65
- package/build-module/form/deprecated.mjs +0 -96
- package/build-module/form/deprecated.mjs.map +0 -7
- package/build-module/form/edit.mjs +0 -170
- package/build-module/form/edit.mjs.map +0 -7
- package/build-module/form/icons.mjs +0 -8
- package/build-module/form/icons.mjs.map +0 -7
- package/build-module/form/index.mjs +0 -83
- package/build-module/form/index.mjs.map +0 -7
- package/build-module/form/init.mjs +0 -7
- package/build-module/form/init.mjs.map +0 -7
- package/build-module/form/save.mjs +0 -19
- package/build-module/form/save.mjs.map +0 -7
- package/build-module/form/utils.mjs +0 -35
- package/build-module/form/utils.mjs.map +0 -7
- package/build-module/form/variations.mjs +0 -134
- package/build-module/form/variations.mjs.map +0 -7
- package/build-module/form/view.mjs +0 -46
- package/build-module/form/view.mjs.map +0 -7
- package/build-module/form-input/block.json +0 -72
- package/build-module/form-input/deprecated.mjs +0 -226
- package/build-module/form-input/deprecated.mjs.map +0 -7
- package/build-module/form-input/edit.mjs +0 -186
- package/build-module/form-input/edit.mjs.map +0 -7
- package/build-module/form-input/icons.mjs +0 -8
- package/build-module/form-input/icons.mjs.map +0 -7
- package/build-module/form-input/index.mjs +0 -25
- package/build-module/form-input/index.mjs.map +0 -7
- package/build-module/form-input/init.mjs +0 -7
- package/build-module/form-input/init.mjs.map +0 -7
- package/build-module/form-input/save.mjs +0 -62
- package/build-module/form-input/save.mjs.map +0 -7
- package/build-module/form-input/variations.mjs +0 -84
- package/build-module/form-input/variations.mjs.map +0 -7
- package/build-module/form-submission-notification/block.json +0 -19
- package/build-module/form-submission-notification/edit.mjs +0 -45
- package/build-module/form-submission-notification/edit.mjs.map +0 -7
- package/build-module/form-submission-notification/index.mjs +0 -35
- package/build-module/form-submission-notification/index.mjs.map +0 -7
- package/build-module/form-submission-notification/init.mjs +0 -7
- package/build-module/form-submission-notification/init.mjs.map +0 -7
- package/build-module/form-submission-notification/save.mjs +0 -23
- package/build-module/form-submission-notification/save.mjs.map +0 -7
- package/build-module/form-submission-notification/variations.mjs +0 -57
- package/build-module/form-submission-notification/variations.mjs.map +0 -7
- package/build-module/form-submit-button/block.json +0 -15
- package/build-module/form-submit-button/edit.mjs +0 -15
- package/build-module/form-submit-button/edit.mjs.map +0 -7
- package/build-module/form-submit-button/index.mjs +0 -37
- package/build-module/form-submit-button/index.mjs.map +0 -7
- package/build-module/form-submit-button/init.mjs +0 -7
- package/build-module/form-submit-button/init.mjs.map +0 -7
- package/build-module/form-submit-button/save.mjs +0 -11
- package/build-module/form-submit-button/save.mjs.map +0 -7
- package/build-module/list-item/hooks/use-indent-list-item.mjs +0 -58
- package/build-module/list-item/hooks/use-indent-list-item.mjs.map +0 -7
- package/build-module/list-item/hooks/use-outdent-list-item.mjs +0 -85
- package/build-module/list-item/hooks/use-outdent-list-item.mjs.map +0 -7
- package/build-module/list-item/hooks/use-space.mjs +0 -52
- package/build-module/list-item/hooks/use-space.mjs.map +0 -7
- package/build-module/query/edit/enhanced-pagination-modal.mjs +0 -72
- package/build-module/query/edit/enhanced-pagination-modal.mjs.map +0 -7
- package/build-style/form-input/editor-rtl.css +0 -19
- package/build-style/form-input/editor.css +0 -19
- package/build-style/form-input/style-rtl.css +0 -48
- package/build-style/form-input/style.css +0 -48
- package/build-style/form-submission-notification/editor-rtl.css +0 -30
- package/build-style/form-submission-notification/editor.css +0 -30
- package/build-style/form-submit-button/style-rtl.css +0 -3
- package/build-style/form-submit-button/style.css +0 -3
- package/src/form/README.md +0 -90
- package/src/form/block.json +0 -65
- package/src/form/deprecated.jsx +0 -93
- package/src/form/edit.jsx +0 -169
- package/src/form/icons.jsx +0 -7
- package/src/form/index.js +0 -91
- package/src/form/index.php +0 -197
- package/src/form/init.js +0 -3
- package/src/form/save.jsx +0 -15
- package/src/form/utils.js +0 -36
- package/src/form/variations.js +0 -133
- package/src/form/view.js +0 -54
- package/src/form-input/README.md +0 -74
- package/src/form-input/block.json +0 -72
- package/src/form-input/deprecated.jsx +0 -248
- package/src/form-input/edit.jsx +0 -187
- package/src/form-input/editor.scss +0 -24
- package/src/form-input/icons.jsx +0 -7
- package/src/form-input/index.js +0 -22
- package/src/form-input/index.php +0 -47
- package/src/form-input/init.js +0 -3
- package/src/form-input/save.jsx +0 -89
- package/src/form-input/style.scss +0 -64
- package/src/form-input/variations.js +0 -82
- package/src/form-submission-notification/README.md +0 -50
- package/src/form-submission-notification/block.json +0 -19
- package/src/form-submission-notification/edit.jsx +0 -44
- package/src/form-submission-notification/editor.scss +0 -45
- package/src/form-submission-notification/index.js +0 -33
- package/src/form-submission-notification/index.php +0 -48
- package/src/form-submission-notification/init.js +0 -3
- package/src/form-submission-notification/save.jsx +0 -18
- package/src/form-submission-notification/variations.js +0 -56
- package/src/form-submit-button/README.md +0 -54
- package/src/form-submit-button/block.json +0 -15
- package/src/form-submit-button/edit.jsx +0 -12
- package/src/form-submit-button/index.js +0 -35
- package/src/form-submit-button/init.js +0 -3
- package/src/form-submit-button/save.jsx +0 -10
- package/src/form-submit-button/style.scss +0 -3
- package/src/list-item/hooks/use-indent-list-item.js +0 -73
- package/src/list-item/hooks/use-outdent-list-item.js +0 -100
- package/src/list-item/hooks/use-space.js +0 -66
- package/src/query/edit/enhanced-pagination-modal.jsx +0 -77
- /package/src/utils/test/{waveform-player.jsx → waveform-player.jsdom.test.jsx} +0 -0
- /package/src/utils/test/{waveform-utils.js → waveform-utils.jsdom.test.js} +0 -0
package/build/form/utils.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form/utils.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\n\nexport const formSubmissionNotificationSuccess = [\n\t'core/form-submission-notification',\n\t{\n\t\ttype: 'success',\n\t},\n\t[\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\tcontent:\n\t\t\t\t\t'<mark style=\"background-color:rgba(0, 0, 0, 0);color:#345C00\" class=\"has-inline-color\">' +\n\t\t\t\t\t__( 'Your form has been submitted successfully' ) +\n\t\t\t\t\t'</mark>',\n\t\t\t},\n\t\t],\n\t],\n];\nexport const formSubmissionNotificationError = [\n\t'core/form-submission-notification',\n\t{\n\t\ttype: 'error',\n\t},\n\t[\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\tcontent:\n\t\t\t\t\t'<mark style=\"background-color:rgba(0, 0, 0, 0);color:#CF2E2E\" class=\"has-inline-color\">' +\n\t\t\t\t\t__( 'There was an error submitting your form.' ) +\n\t\t\t\t\t'</mark>',\n\t\t\t},\n\t\t],\n\t],\n];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AAEZ,IAAM,oCAAoC;AAAA,EAChD;AAAA,EACA;AAAA,IACC,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC;AAAA,MACC;AAAA,MACA;AAAA,QACC,SACC,gGACA,gBAAI,2CAA4C,IAChD;AAAA,MACF;AAAA,IACD;AAAA,EACD;AACD;AACO,IAAM,kCAAkC;AAAA,EAC9C;AAAA,EACA;AAAA,IACC,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC;AAAA,MACC;AAAA,MACA;AAAA,QACC,SACC,gGACA,gBAAI,0CAA2C,IAC/C;AAAA,MACF;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/block-library/src/form/variations.js
|
|
21
|
-
var variations_exports = {};
|
|
22
|
-
__export(variations_exports, {
|
|
23
|
-
default: () => variations_default
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(variations_exports);
|
|
26
|
-
var import_i18n = require("@wordpress/i18n");
|
|
27
|
-
var import_utils = require("./utils.cjs");
|
|
28
|
-
var variations = [
|
|
29
|
-
{
|
|
30
|
-
name: "comment-form",
|
|
31
|
-
title: (0, import_i18n.__)("Experimental Comment form"),
|
|
32
|
-
description: (0, import_i18n.__)("A comment form for posts and pages."),
|
|
33
|
-
attributes: {
|
|
34
|
-
submissionMethod: "custom",
|
|
35
|
-
action: "{SITE_URL}/wp-comments-post.php",
|
|
36
|
-
method: "post",
|
|
37
|
-
anchor: "comment-form"
|
|
38
|
-
},
|
|
39
|
-
isDefault: false,
|
|
40
|
-
innerBlocks: [
|
|
41
|
-
[
|
|
42
|
-
"core/form-input",
|
|
43
|
-
{
|
|
44
|
-
type: "text",
|
|
45
|
-
name: "author",
|
|
46
|
-
label: (0, import_i18n.__)("Name"),
|
|
47
|
-
required: true,
|
|
48
|
-
visibilityPermissions: "logged-out"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
[
|
|
52
|
-
"core/form-input",
|
|
53
|
-
{
|
|
54
|
-
type: "email",
|
|
55
|
-
name: "email",
|
|
56
|
-
label: (0, import_i18n.__)("Email"),
|
|
57
|
-
required: true,
|
|
58
|
-
visibilityPermissions: "logged-out"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
[
|
|
62
|
-
"core/form-input",
|
|
63
|
-
{
|
|
64
|
-
type: "textarea",
|
|
65
|
-
name: "comment",
|
|
66
|
-
label: (0, import_i18n.__)("Comment"),
|
|
67
|
-
required: true,
|
|
68
|
-
visibilityPermissions: "all"
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
["core/form-submit-button", {}]
|
|
72
|
-
],
|
|
73
|
-
scope: ["inserter", "transform"],
|
|
74
|
-
isActive: (blockAttributes) => !blockAttributes?.type || blockAttributes?.type === "text"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: "wp-privacy-form",
|
|
78
|
-
title: (0, import_i18n.__)("Experimental Privacy Request Form"),
|
|
79
|
-
keywords: ["GDPR"],
|
|
80
|
-
description: (0, import_i18n.__)("A form to request data exports and/or deletion."),
|
|
81
|
-
attributes: {
|
|
82
|
-
submissionMethod: "custom",
|
|
83
|
-
action: "",
|
|
84
|
-
method: "post",
|
|
85
|
-
anchor: "gdpr-form"
|
|
86
|
-
},
|
|
87
|
-
isDefault: false,
|
|
88
|
-
innerBlocks: [
|
|
89
|
-
import_utils.formSubmissionNotificationSuccess,
|
|
90
|
-
import_utils.formSubmissionNotificationError,
|
|
91
|
-
[
|
|
92
|
-
"core/paragraph",
|
|
93
|
-
{
|
|
94
|
-
content: (0, import_i18n.__)(
|
|
95
|
-
"To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps."
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
],
|
|
99
|
-
[
|
|
100
|
-
"core/form-input",
|
|
101
|
-
{
|
|
102
|
-
type: "email",
|
|
103
|
-
name: "email",
|
|
104
|
-
label: (0, import_i18n.__)("Enter your email address."),
|
|
105
|
-
required: true,
|
|
106
|
-
visibilityPermissions: "all"
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
[
|
|
110
|
-
"core/form-input",
|
|
111
|
-
{
|
|
112
|
-
type: "checkbox",
|
|
113
|
-
name: "export_personal_data",
|
|
114
|
-
label: (0, import_i18n.__)("Request data export"),
|
|
115
|
-
required: false,
|
|
116
|
-
visibilityPermissions: "all"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
[
|
|
120
|
-
"core/form-input",
|
|
121
|
-
{
|
|
122
|
-
type: "checkbox",
|
|
123
|
-
name: "remove_personal_data",
|
|
124
|
-
label: (0, import_i18n.__)("Request data deletion"),
|
|
125
|
-
required: false,
|
|
126
|
-
visibilityPermissions: "all"
|
|
127
|
-
}
|
|
128
|
-
],
|
|
129
|
-
["core/form-submit-button", {}],
|
|
130
|
-
[
|
|
131
|
-
"core/form-input",
|
|
132
|
-
{
|
|
133
|
-
type: "hidden",
|
|
134
|
-
name: "wp-action",
|
|
135
|
-
value: "wp_privacy_send_request"
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
[
|
|
139
|
-
"core/form-input",
|
|
140
|
-
{
|
|
141
|
-
type: "hidden",
|
|
142
|
-
name: "wp-privacy-request",
|
|
143
|
-
value: "1"
|
|
144
|
-
}
|
|
145
|
-
]
|
|
146
|
-
],
|
|
147
|
-
scope: ["inserter", "transform"],
|
|
148
|
-
isActive: (blockAttributes) => !blockAttributes?.type || blockAttributes?.type === "text"
|
|
149
|
-
}
|
|
150
|
-
];
|
|
151
|
-
var variations_default = variations;
|
|
152
|
-
//# sourceMappingURL=variations.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form/variations.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n} from './utils.js';\n\nconst variations = [\n\t{\n\t\tname: 'comment-form',\n\t\ttitle: __( 'Experimental Comment form' ),\n\t\tdescription: __( 'A comment form for posts and pages.' ),\n\t\tattributes: {\n\t\t\tsubmissionMethod: 'custom',\n\t\t\taction: '{SITE_URL}/wp-comments-post.php',\n\t\t\tmethod: 'post',\n\t\t\tanchor: 'comment-form',\n\t\t},\n\t\tisDefault: false,\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\tname: 'author',\n\t\t\t\t\tlabel: __( 'Name' ),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvisibilityPermissions: 'logged-out',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'email',\n\t\t\t\t\tname: 'email',\n\t\t\t\t\tlabel: __( 'Email' ),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvisibilityPermissions: 'logged-out',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'textarea',\n\t\t\t\t\tname: 'comment',\n\t\t\t\t\tlabel: __( 'Comment' ),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvisibilityPermissions: 'all',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[ 'core/form-submit-button', {} ],\n\t\t],\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\t! blockAttributes?.type || blockAttributes?.type === 'text',\n\t},\n\t{\n\t\tname: 'wp-privacy-form',\n\t\ttitle: __( 'Experimental Privacy Request Form' ),\n\t\tkeywords: [ 'GDPR' ],\n\t\tdescription: __( 'A form to request data exports and/or deletion.' ),\n\t\tattributes: {\n\t\t\tsubmissionMethod: 'custom',\n\t\t\taction: '',\n\t\t\tmethod: 'post',\n\t\t\tanchor: 'gdpr-form',\n\t\t},\n\t\tisDefault: false,\n\t\tinnerBlocks: [\n\t\t\tformSubmissionNotificationSuccess,\n\t\t\tformSubmissionNotificationError,\n\t\t\t[\n\t\t\t\t'core/paragraph',\n\t\t\t\t{\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'email',\n\t\t\t\t\tname: 'email',\n\t\t\t\t\tlabel: __( 'Enter your email address.' ),\n\t\t\t\t\trequired: true,\n\t\t\t\t\tvisibilityPermissions: 'all',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\tname: 'export_personal_data',\n\t\t\t\t\tlabel: __( 'Request data export' ),\n\t\t\t\t\trequired: false,\n\t\t\t\t\tvisibilityPermissions: 'all',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'checkbox',\n\t\t\t\t\tname: 'remove_personal_data',\n\t\t\t\t\tlabel: __( 'Request data deletion' ),\n\t\t\t\t\trequired: false,\n\t\t\t\t\tvisibilityPermissions: 'all',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[ 'core/form-submit-button', {} ],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'hidden',\n\t\t\t\t\tname: 'wp-action',\n\t\t\t\t\tvalue: 'wp_privacy_send_request',\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t'core/form-input',\n\t\t\t\t{\n\t\t\t\t\ttype: 'hidden',\n\t\t\t\t\tname: 'wp-privacy-request',\n\t\t\t\t\tvalue: '1',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\t! blockAttributes?.type || blockAttributes?.type === 'text',\n\t},\n];\n\nexport default variations;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,mBAGO;AAEP,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,2BAA4B;AAAA,IACvC,iBAAa,gBAAI,qCAAsC;AAAA,IACvD,YAAY;AAAA,MACX,kBAAkB;AAAA,MAClB,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,IACT;AAAA,IACA,WAAW;AAAA,IACX,aAAa;AAAA,MACZ;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,WAAO,gBAAI,MAAO;AAAA,UAClB,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,WAAO,gBAAI,OAAQ;AAAA,UACnB,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,WAAO,gBAAI,SAAU;AAAA,UACrB,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA,CAAE,2BAA2B,CAAC,C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;AAAA,IACD;AAAA,IACA,OAAO,CAAE,YAAY,WAAY;AAAA,IACjC,UAAU,CAAE,oBACX,CAAE,iBAAiB,QAAQ,iBAAiB,SAAS;AAAA,EACvD;AACD;AAEA,IAAO,qBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/build/form/view.cjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// packages/block-library/src/form/view.js
|
|
4
|
-
var formSettings;
|
|
5
|
-
try {
|
|
6
|
-
formSettings = JSON.parse(
|
|
7
|
-
document.getElementById(
|
|
8
|
-
"wp-script-module-data-@wordpress/block-library/form/view"
|
|
9
|
-
)?.textContent
|
|
10
|
-
);
|
|
11
|
-
} catch {
|
|
12
|
-
}
|
|
13
|
-
document.querySelectorAll("form.wp-block-form").forEach(function(form) {
|
|
14
|
-
if (!formSettings || !form.action || !form.action.startsWith("mailto:")) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const redirectNotification = (status) => {
|
|
18
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
19
|
-
urlParams.append("wp-form-result", status);
|
|
20
|
-
window.location.search = urlParams.toString();
|
|
21
|
-
};
|
|
22
|
-
form.addEventListener("submit", async function(event) {
|
|
23
|
-
event.preventDefault();
|
|
24
|
-
const formData = Object.fromEntries(new FormData(form).entries());
|
|
25
|
-
formData.formAction = form.action;
|
|
26
|
-
formData._ajax_nonce = formSettings.nonce;
|
|
27
|
-
formData.action = formSettings.action;
|
|
28
|
-
formData._wp_http_referer = window.location.href;
|
|
29
|
-
formData.formAction = form.action;
|
|
30
|
-
try {
|
|
31
|
-
const response = await fetch(formSettings.ajaxUrl, {
|
|
32
|
-
method: "POST",
|
|
33
|
-
headers: {
|
|
34
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
35
|
-
},
|
|
36
|
-
body: new URLSearchParams(formData).toString()
|
|
37
|
-
});
|
|
38
|
-
if (response.ok) {
|
|
39
|
-
redirectNotification("success");
|
|
40
|
-
} else {
|
|
41
|
-
redirectNotification("error");
|
|
42
|
-
}
|
|
43
|
-
} catch {
|
|
44
|
-
redirectNotification("error");
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=view.cjs.map
|
package/build/form/view.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form/view.js"],
|
|
4
|
-
"sourcesContent": ["let formSettings;\ntry {\n\tformSettings = JSON.parse(\n\t\tdocument.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/block-library/form/view'\n\t\t)?.textContent\n\t);\n} catch {}\n\ndocument.querySelectorAll( 'form.wp-block-form' ).forEach( function ( form ) {\n\t// Bail If the form settings not provided or the form is not using the mailto: action.\n\tif (\n\t\t! formSettings ||\n\t\t! form.action ||\n\t\t! form.action.startsWith( 'mailto:' )\n\t) {\n\t\treturn;\n\t}\n\n\tconst redirectNotification = ( status ) => {\n\t\tconst urlParams = new URLSearchParams( window.location.search );\n\t\turlParams.append( 'wp-form-result', status );\n\t\twindow.location.search = urlParams.toString();\n\t};\n\n\t// Add an event listener for the form submission.\n\tform.addEventListener( 'submit', async function ( event ) {\n\t\tevent.preventDefault();\n\t\t// Get the form data and merge it with the form action and nonce.\n\t\tconst formData = Object.fromEntries( new FormData( form ).entries() );\n\t\tformData.formAction = form.action;\n\t\tformData._ajax_nonce = formSettings.nonce;\n\t\tformData.action = formSettings.action;\n\t\tformData._wp_http_referer = window.location.href;\n\t\tformData.formAction = form.action;\n\n\t\ttry {\n\t\t\tconst response = await fetch( formSettings.ajaxUrl, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: new URLSearchParams( formData ).toString(),\n\t\t\t} );\n\t\t\tif ( response.ok ) {\n\t\t\t\tredirectNotification( 'success' );\n\t\t\t} else {\n\t\t\t\tredirectNotification( 'error' );\n\t\t\t}\n\t\t} catch {\n\t\t\tredirectNotification( 'error' );\n\t\t}\n\t} );\n} );\n"],
|
|
5
|
-
"mappings": ";;;AAAA,IAAI;AACJ,IAAI;AACH,iBAAe,KAAK;AAAA,IACnB,SAAS;AAAA,MACR;AAAA,IACD,GAAG;AAAA,EACJ;AACD,QAAQ;AAAC;AAET,SAAS,iBAAkB,oBAAqB,EAAE,QAAS,SAAW,MAAO;AAE5E,MACC,CAAE,gBACF,CAAE,KAAK,UACP,CAAE,KAAK,OAAO,WAAY,SAAU,GACnC;AACD;AAAA,EACD;AAEA,QAAM,uBAAuB,CAAE,WAAY;AAC1C,UAAM,YAAY,IAAI,gBAAiB,OAAO,SAAS,MAAO;AAC9D,cAAU,OAAQ,kBAAkB,MAAO;AAC3C,WAAO,SAAS,SAAS,UAAU,SAAS;AAAA,EAC7C;AAGA,OAAK,iBAAkB,UAAU,eAAiB,OAAQ;AACzD,UAAM,eAAe;AAErB,UAAM,WAAW,OAAO,YAAa,IAAI,SAAU,IAAK,EAAE,QAAQ,CAAE;AACpE,aAAS,aAAa,KAAK;AAC3B,aAAS,cAAc,aAAa;AACpC,aAAS,SAAS,aAAa;AAC/B,aAAS,mBAAmB,OAAO,SAAS;AAC5C,aAAS,aAAa,KAAK;AAE3B,QAAI;AACH,YAAM,WAAW,MAAM,MAAO,aAAa,SAAS;AAAA,QACnD,QAAQ;AAAA,QACR,SAAS;AAAA,UACR,gBAAgB;AAAA,QACjB;AAAA,QACA,MAAM,IAAI,gBAAiB,QAAS,EAAE,SAAS;AAAA,MAChD,CAAE;AACF,UAAK,SAAS,IAAK;AAClB,6BAAsB,SAAU;AAAA,MACjC,OAAO;AACN,6BAAsB,OAAQ;AAAA,MAC/B;AAAA,IACD,QAAQ;AACP,2BAAsB,OAAQ;AAAA,IAC/B;AAAA,EACD,CAAE;AACH,CAAE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
|
-
"apiVersion": 3,
|
|
4
|
-
"__experimental": true,
|
|
5
|
-
"name": "core/form-input",
|
|
6
|
-
"title": "Input Field",
|
|
7
|
-
"category": "widgets",
|
|
8
|
-
"ancestor": [ "core/form" ],
|
|
9
|
-
"description": "The basic building block for forms.",
|
|
10
|
-
"keywords": [ "input", "form" ],
|
|
11
|
-
"textdomain": "default",
|
|
12
|
-
"attributes": {
|
|
13
|
-
"type": {
|
|
14
|
-
"type": "string",
|
|
15
|
-
"default": "text"
|
|
16
|
-
},
|
|
17
|
-
"name": {
|
|
18
|
-
"type": "string"
|
|
19
|
-
},
|
|
20
|
-
"label": {
|
|
21
|
-
"type": "rich-text",
|
|
22
|
-
"default": "Label",
|
|
23
|
-
"selector": ".wp-block-form-input__label-content",
|
|
24
|
-
"source": "rich-text",
|
|
25
|
-
"role": "content"
|
|
26
|
-
},
|
|
27
|
-
"inlineLabel": {
|
|
28
|
-
"type": "boolean",
|
|
29
|
-
"default": false
|
|
30
|
-
},
|
|
31
|
-
"required": {
|
|
32
|
-
"type": "boolean",
|
|
33
|
-
"default": false,
|
|
34
|
-
"selector": ".wp-block-form-input__input",
|
|
35
|
-
"source": "attribute",
|
|
36
|
-
"attribute": "required"
|
|
37
|
-
},
|
|
38
|
-
"placeholder": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"selector": ".wp-block-form-input__input",
|
|
41
|
-
"source": "attribute",
|
|
42
|
-
"attribute": "placeholder",
|
|
43
|
-
"role": "content"
|
|
44
|
-
},
|
|
45
|
-
"value": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"default": "",
|
|
48
|
-
"selector": "input",
|
|
49
|
-
"source": "attribute",
|
|
50
|
-
"attribute": "value"
|
|
51
|
-
},
|
|
52
|
-
"visibilityPermissions": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"default": "all"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"supports": {
|
|
58
|
-
"anchor": true,
|
|
59
|
-
"reusable": false,
|
|
60
|
-
"spacing": {
|
|
61
|
-
"margin": [ "top", "bottom" ]
|
|
62
|
-
},
|
|
63
|
-
"__experimentalBorder": {
|
|
64
|
-
"radius": true,
|
|
65
|
-
"__experimentalSkipSerialization": true,
|
|
66
|
-
"__experimentalDefaultControls": {
|
|
67
|
-
"radius": true
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"style": [ "wp-block-form-input" ]
|
|
72
|
-
}
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/block-library/src/form-input/deprecated.jsx
|
|
31
|
-
var deprecated_exports = {};
|
|
32
|
-
__export(deprecated_exports, {
|
|
33
|
-
default: () => deprecated_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(deprecated_exports);
|
|
36
|
-
var import_clsx = __toESM(require("clsx"));
|
|
37
|
-
var import_remove_accents = __toESM(require("remove-accents"));
|
|
38
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
39
|
-
var import_dom = require("@wordpress/dom");
|
|
40
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
-
var getNameFromLabelV1 = (content) => {
|
|
42
|
-
return (0, import_remove_accents.default)((0, import_dom.__unstableStripHTML)(content)).replace(/[^\p{L}\p{N}]+/gu, "-").toLowerCase().replace(/(^-+)|(-+$)/g, "");
|
|
43
|
-
};
|
|
44
|
-
var v2 = {
|
|
45
|
-
attributes: {
|
|
46
|
-
type: {
|
|
47
|
-
type: "string",
|
|
48
|
-
default: "text"
|
|
49
|
-
},
|
|
50
|
-
name: {
|
|
51
|
-
type: "string"
|
|
52
|
-
},
|
|
53
|
-
label: {
|
|
54
|
-
type: "string",
|
|
55
|
-
default: "Label",
|
|
56
|
-
selector: ".wp-block-form-input__label-content",
|
|
57
|
-
source: "html",
|
|
58
|
-
role: "content"
|
|
59
|
-
},
|
|
60
|
-
inlineLabel: {
|
|
61
|
-
type: "boolean",
|
|
62
|
-
default: false
|
|
63
|
-
},
|
|
64
|
-
required: {
|
|
65
|
-
type: "boolean",
|
|
66
|
-
default: false,
|
|
67
|
-
selector: ".wp-block-form-input__input",
|
|
68
|
-
source: "attribute",
|
|
69
|
-
attribute: "required"
|
|
70
|
-
},
|
|
71
|
-
placeholder: {
|
|
72
|
-
type: "string",
|
|
73
|
-
selector: ".wp-block-form-input__input",
|
|
74
|
-
source: "attribute",
|
|
75
|
-
attribute: "placeholder",
|
|
76
|
-
role: "content"
|
|
77
|
-
},
|
|
78
|
-
value: {
|
|
79
|
-
type: "string",
|
|
80
|
-
default: "",
|
|
81
|
-
selector: "input",
|
|
82
|
-
source: "attribute",
|
|
83
|
-
attribute: "value"
|
|
84
|
-
},
|
|
85
|
-
visibilityPermissions: {
|
|
86
|
-
type: "string",
|
|
87
|
-
default: "all"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
supports: {
|
|
91
|
-
anchor: true,
|
|
92
|
-
reusable: false,
|
|
93
|
-
spacing: {
|
|
94
|
-
margin: ["top", "bottom"]
|
|
95
|
-
},
|
|
96
|
-
__experimentalBorder: {
|
|
97
|
-
radius: true,
|
|
98
|
-
__experimentalSkipSerialization: true,
|
|
99
|
-
__experimentalDefaultControls: {
|
|
100
|
-
radius: true
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
save({ attributes }) {
|
|
105
|
-
const { type, name, label, inlineLabel, required, placeholder, value } = attributes;
|
|
106
|
-
const borderProps = (0, import_block_editor.__experimentalGetBorderClassesAndStyles)(attributes);
|
|
107
|
-
const colorProps = (0, import_block_editor.__experimentalGetColorClassesAndStyles)(attributes);
|
|
108
|
-
const inputStyle = {
|
|
109
|
-
...borderProps.style,
|
|
110
|
-
...colorProps.style
|
|
111
|
-
};
|
|
112
|
-
const inputClasses = (0, import_clsx.default)(
|
|
113
|
-
"wp-block-form-input__input",
|
|
114
|
-
colorProps.className,
|
|
115
|
-
borderProps.className
|
|
116
|
-
);
|
|
117
|
-
const TagName = type === "textarea" ? "textarea" : "input";
|
|
118
|
-
const blockProps = import_block_editor.useBlockProps.save();
|
|
119
|
-
if ("hidden" === type) {
|
|
120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type, name, value });
|
|
121
|
-
}
|
|
122
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
123
|
-
"label",
|
|
124
|
-
{
|
|
125
|
-
className: (0, import_clsx.default)("wp-block-form-input__label", {
|
|
126
|
-
"is-label-inline": inlineLabel
|
|
127
|
-
}),
|
|
128
|
-
children: [
|
|
129
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "wp-block-form-input__label-content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.RichText.Content, { value: label }) }),
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
-
TagName,
|
|
132
|
-
{
|
|
133
|
-
className: inputClasses,
|
|
134
|
-
type: "textarea" === type ? void 0 : type,
|
|
135
|
-
name: name || getNameFromLabelV1(label),
|
|
136
|
-
required,
|
|
137
|
-
"aria-required": required,
|
|
138
|
-
placeholder: placeholder || void 0,
|
|
139
|
-
style: inputStyle
|
|
140
|
-
}
|
|
141
|
-
)
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
) });
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
var v1 = {
|
|
148
|
-
attributes: {
|
|
149
|
-
type: {
|
|
150
|
-
type: "string",
|
|
151
|
-
default: "text"
|
|
152
|
-
},
|
|
153
|
-
name: {
|
|
154
|
-
type: "string"
|
|
155
|
-
},
|
|
156
|
-
label: {
|
|
157
|
-
type: "string",
|
|
158
|
-
default: "Label",
|
|
159
|
-
selector: ".wp-block-form-input__label-content",
|
|
160
|
-
source: "html",
|
|
161
|
-
role: "content"
|
|
162
|
-
},
|
|
163
|
-
inlineLabel: {
|
|
164
|
-
type: "boolean",
|
|
165
|
-
default: false
|
|
166
|
-
},
|
|
167
|
-
required: {
|
|
168
|
-
type: "boolean",
|
|
169
|
-
default: false,
|
|
170
|
-
selector: ".wp-block-form-input__input",
|
|
171
|
-
source: "attribute",
|
|
172
|
-
attribute: "required"
|
|
173
|
-
},
|
|
174
|
-
placeholder: {
|
|
175
|
-
type: "string",
|
|
176
|
-
selector: ".wp-block-form-input__input",
|
|
177
|
-
source: "attribute",
|
|
178
|
-
attribute: "placeholder",
|
|
179
|
-
role: "content"
|
|
180
|
-
},
|
|
181
|
-
value: {
|
|
182
|
-
type: "string",
|
|
183
|
-
default: "",
|
|
184
|
-
selector: "input",
|
|
185
|
-
source: "attribute",
|
|
186
|
-
attribute: "value"
|
|
187
|
-
},
|
|
188
|
-
visibilityPermissions: {
|
|
189
|
-
type: "string",
|
|
190
|
-
default: "all"
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
supports: {
|
|
194
|
-
className: false,
|
|
195
|
-
anchor: true,
|
|
196
|
-
reusable: false,
|
|
197
|
-
spacing: {
|
|
198
|
-
margin: ["top", "bottom"]
|
|
199
|
-
},
|
|
200
|
-
__experimentalBorder: {
|
|
201
|
-
radius: true,
|
|
202
|
-
__experimentalSkipSerialization: true,
|
|
203
|
-
__experimentalDefaultControls: {
|
|
204
|
-
radius: true
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
save({ attributes }) {
|
|
209
|
-
const { type, name, label, inlineLabel, required, placeholder, value } = attributes;
|
|
210
|
-
const borderProps = (0, import_block_editor.__experimentalGetBorderClassesAndStyles)(attributes);
|
|
211
|
-
const colorProps = (0, import_block_editor.__experimentalGetColorClassesAndStyles)(attributes);
|
|
212
|
-
const inputStyle = {
|
|
213
|
-
...borderProps.style,
|
|
214
|
-
...colorProps.style
|
|
215
|
-
};
|
|
216
|
-
const inputClasses = (0, import_clsx.default)(
|
|
217
|
-
"wp-block-form-input__input",
|
|
218
|
-
colorProps.className,
|
|
219
|
-
borderProps.className
|
|
220
|
-
);
|
|
221
|
-
const TagName = type === "textarea" ? "textarea" : "input";
|
|
222
|
-
if ("hidden" === type) {
|
|
223
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type, name, value });
|
|
224
|
-
}
|
|
225
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
226
|
-
"label",
|
|
227
|
-
{
|
|
228
|
-
className: (0, import_clsx.default)("wp-block-form-input__label", {
|
|
229
|
-
"is-label-inline": inlineLabel
|
|
230
|
-
}),
|
|
231
|
-
children: [
|
|
232
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "wp-block-form-input__label-content", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.RichText.Content, { value: label }) }),
|
|
233
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
234
|
-
TagName,
|
|
235
|
-
{
|
|
236
|
-
className: inputClasses,
|
|
237
|
-
type: "textarea" === type ? void 0 : type,
|
|
238
|
-
name: name || getNameFromLabelV1(label),
|
|
239
|
-
required,
|
|
240
|
-
"aria-required": required,
|
|
241
|
-
placeholder: placeholder || void 0,
|
|
242
|
-
style: inputStyle
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
]
|
|
246
|
-
}
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
var deprecated = [v2, v1];
|
|
251
|
-
var deprecated_default = deprecated;
|
|
252
|
-
//# sourceMappingURL=deprecated.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-input/deprecated.jsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport removeAccents from 'remove-accents';\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,\n} from '@wordpress/block-editor';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\nconst getNameFromLabelV1 = ( content ) => {\n\treturn (\n\t\tremoveAccents( stripHTML( content ) )\n\t\t\t// Convert anything that's not a letter or number to a hyphen.\n\t\t\t.replace( /[^\\p{L}\\p{N}]+/gu, '-' )\n\t\t\t// Convert to lowercase\n\t\t\t.toLowerCase()\n\t\t\t// Remove any remaining leading or trailing hyphens.\n\t\t\t.replace( /(^-+)|(-+$)/g, '' )\n\t);\n};\n\nconst v2 = {\n\tattributes: {\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'text',\n\t\t},\n\t\tname: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tlabel: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Label',\n\t\t\tselector: '.wp-block-form-input__label-content',\n\t\t\tsource: 'html',\n\t\t\trole: 'content',\n\t\t},\n\t\tinlineLabel: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\trequired: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tselector: '.wp-block-form-input__input',\n\t\t\tsource: 'attribute',\n\t\t\tattribute: 'required',\n\t\t},\n\t\tplaceholder: {\n\t\t\ttype: 'string',\n\t\t\tselector: '.wp-block-form-input__input',\n\t\t\tsource: 'attribute',\n\t\t\tattribute: 'placeholder',\n\t\t\trole: 'content',\n\t\t},\n\t\tvalue: {\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\tselector: 'input',\n\t\t\tsource: 'attribute',\n\t\t\tattribute: 'value',\n\t\t},\n\t\tvisibilityPermissions: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'all',\n\t\t},\n\t},\n\tsupports: {\n\t\tanchor: true,\n\t\treusable: false,\n\t\tspacing: {\n\t\t\tmargin: [ 'top', 'bottom' ],\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tradius: true,\n\t\t\t__experimentalSkipSerialization: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tradius: true,\n\t\t\t},\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { type, name, label, inlineLabel, required, placeholder, value } =\n\t\t\tattributes;\n\n\t\tconst borderProps = getBorderClassesAndStyles( attributes );\n\t\tconst colorProps = getColorClassesAndStyles( attributes );\n\n\t\tconst inputStyle = {\n\t\t\t...borderProps.style,\n\t\t\t...colorProps.style,\n\t\t};\n\n\t\tconst inputClasses = clsx(\n\t\t\t'wp-block-form-input__input',\n\t\t\tcolorProps.className,\n\t\t\tborderProps.className\n\t\t);\n\t\tconst TagName = type === 'textarea' ? 'textarea' : 'input';\n\n\t\tconst blockProps = useBlockProps.save();\n\n\t\tif ( 'hidden' === type ) {\n\t\t\treturn <input type={ type } name={ name } value={ value } />;\n\t\t}\n\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/label-has-associated-control */ }\n\t\t\t\t<label\n\t\t\t\t\tclassName={ clsx( 'wp-block-form-input__label', {\n\t\t\t\t\t\t'is-label-inline': inlineLabel,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"wp-block-form-input__label-content\">\n\t\t\t\t\t\t<RichText.Content value={ label } />\n\t\t\t\t\t</span>\n\t\t\t\t\t<TagName\n\t\t\t\t\t\tclassName={ inputClasses }\n\t\t\t\t\t\ttype={ 'textarea' === type ? undefined : type }\n\t\t\t\t\t\tname={ name || getNameFromLabelV1( label ) }\n\t\t\t\t\t\trequired={ required }\n\t\t\t\t\t\taria-required={ required }\n\t\t\t\t\t\tplaceholder={ placeholder || undefined }\n\t\t\t\t\t\tstyle={ inputStyle }\n\t\t\t\t\t/>\n\t\t\t\t</label>\n\t\t\t\t{ /* eslint-enable jsx-a11y/label-has-associated-control */ }\n\t\t\t</div>\n\t\t);\n\t},\n};\n\n// Version without wrapper div in saved markup\n// See: https://github.com/WordPress/gutenberg/pull/56507\nconst v1 = {\n\tattributes: {\n\t\ttype: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'text',\n\t\t},\n\t\tname: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tlabel: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'Label',\n\t\t\tselector: '.wp-block-form-input__label-content',\n\t\t\tsource: 'html',\n\t\t\trole: 'content',\n\t\t},\n\t\tinlineLabel: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t},\n\t\trequired: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tselector: '.wp-block-form-input__input',\n\t\t\tsource: 'attribute',\n\t\t\tattribute: 'required',\n\t\t},\n\t\tplaceholder: {\n\t\t\ttype: 'string',\n\t\t\tselector: '.wp-block-form-input__input',\n\t\t\tsource: 'attribute',\n\t\t\tattribute: 'placeholder',\n\t\t\trole: 'content',\n\t\t},\n\t\tvalue: {\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\tselector: 'input',\n\t\t\tsource: 'attribute',\n\t\t\tattribute: 'value',\n\t\t},\n\t\tvisibilityPermissions: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'all',\n\t\t},\n\t},\n\tsupports: {\n\t\tclassName: false,\n\t\tanchor: true,\n\t\treusable: false,\n\t\tspacing: {\n\t\t\tmargin: [ 'top', 'bottom' ],\n\t\t},\n\t\t__experimentalBorder: {\n\t\t\tradius: true,\n\t\t\t__experimentalSkipSerialization: true,\n\t\t\t__experimentalDefaultControls: {\n\t\t\t\tradius: true,\n\t\t\t},\n\t\t},\n\t},\n\tsave( { attributes } ) {\n\t\tconst { type, name, label, inlineLabel, required, placeholder, value } =\n\t\t\tattributes;\n\n\t\tconst borderProps = getBorderClassesAndStyles( attributes );\n\t\tconst colorProps = getColorClassesAndStyles( attributes );\n\n\t\tconst inputStyle = {\n\t\t\t...borderProps.style,\n\t\t\t...colorProps.style,\n\t\t};\n\n\t\tconst inputClasses = clsx(\n\t\t\t'wp-block-form-input__input',\n\t\t\tcolorProps.className,\n\t\t\tborderProps.className\n\t\t);\n\t\tconst TagName = type === 'textarea' ? 'textarea' : 'input';\n\n\t\tif ( 'hidden' === type ) {\n\t\t\treturn <input type={ type } name={ name } value={ value } />;\n\t\t}\n\n\t\t/* eslint-disable jsx-a11y/label-has-associated-control */\n\t\treturn (\n\t\t\t<label\n\t\t\t\tclassName={ clsx( 'wp-block-form-input__label', {\n\t\t\t\t\t'is-label-inline': inlineLabel,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<span className=\"wp-block-form-input__label-content\">\n\t\t\t\t\t<RichText.Content value={ label } />\n\t\t\t\t</span>\n\t\t\t\t<TagName\n\t\t\t\t\tclassName={ inputClasses }\n\t\t\t\t\ttype={ 'textarea' === type ? undefined : type }\n\t\t\t\t\tname={ name || getNameFromLabelV1( label ) }\n\t\t\t\t\trequired={ required }\n\t\t\t\t\taria-required={ required }\n\t\t\t\t\tplaceholder={ placeholder || undefined }\n\t\t\t\t\tstyle={ inputStyle }\n\t\t\t\t/>\n\t\t\t</label>\n\t\t);\n\t\t/* eslint-enable jsx-a11y/label-has-associated-control */\n\t},\n};\n\nconst deprecated = [ v2, v1 ];\n\nexport default deprecated;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,4BAA0B;AAC1B,0BAKO;AACP,iBAAiD;AAgGvC;AA9FV,IAAM,qBAAqB,CAAE,YAAa;AACzC,aACC,sBAAAA,aAAe,WAAAC,qBAAW,OAAQ,CAAE,EAElC,QAAS,oBAAoB,GAAI,EAEjC,YAAY,EAEZ,QAAS,gBAAgB,EAAG;AAEhC;AAEA,IAAM,KAAK;AAAA,EACV,YAAY;AAAA,IACX,MAAM;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACL,MAAM;AAAA,IACP;AAAA,IACA,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,MAAM;AAAA,IACP;AAAA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