@wordpress/block-library 10.6.1-next.v.202609031004.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 +9 -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/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 +12 -9
- 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 +1 -2
- 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/index.cjs +0 -10
- package/build/index.cjs.map +2 -2
- 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/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/index.cjs +9 -4
- package/build/query/edit/inspector-controls/index.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/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 +12 -9
- 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 +1 -2
- 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/index.mjs +0 -10
- package/build-module/index.mjs.map +2 -2
- 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/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/index.mjs +9 -4
- package/build-module/query/edit/inspector-controls/index.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/editor-rtl.css +8 -51
- package/build-style/editor.css +8 -51
- package/build-style/navigation/editor-rtl.css +8 -0
- package/build-style/navigation/editor.css +8 -0
- package/build-style/style-rtl.css +0 -47
- package/build-style/style.css +0 -47
- package/build-types/navigation-link/deprecated.d.ts +48 -0
- package/build-types/navigation-link/deprecated.d.ts.map +1 -0
- package/package.json +42 -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/test/get-experimental-label.jsdom.test.js +1 -0
- package/src/code/index.js +0 -18
- package/src/columns/test/transforms.jsdom.test.js +1 -0
- package/src/comment-template/index.php +2 -2
- package/src/cover/index.js +0 -39
- package/src/cover/test/edit.jsdom.test.js +18 -17
- package/src/cover/test/transforms.jsdom.test.js +1 -0
- package/src/details/index.js +0 -18
- package/src/editor.scss +0 -2
- package/src/embed/test/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 +5 -2
- package/src/gallery/test/edit.jsdom.test.js +4 -0
- package/src/gallery/test/transforms.jsdom.test.js +1 -0
- package/src/gallery/test/use-get-new-images.jsdom.test.jsx +1 -0
- package/src/group/test/placeholder.jsdom.test.jsx +1 -0
- package/src/heading/index.js +1 -22
- package/src/heading/index.php +1 -1
- package/src/home-link/index.php +2 -2
- package/src/html/test/index.jsdom.test.js +9 -0
- package/src/html/test/utils.jsdom.test.js +1 -0
- package/src/image/image.jsx +1 -4
- package/src/image/index.js +0 -80
- package/src/image/test/transforms.jsdom.test.js +1 -0
- package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +30 -29
- package/src/index.jsx +0 -11
- package/src/latest-posts/test/deprecated.jsdom.test.js +1 -0
- package/src/list/index.php +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/media-text/index.js +0 -50
- package/src/media-text/media-container.jsx +22 -12
- package/src/more/index.js +0 -19
- package/src/navigation/constants.js +1 -1
- package/src/navigation/edit/test/layout-custom-properties.jsdom.test.js +8 -7
- package/src/navigation/edit/test/navigation-menu-selector.jsdom.test.jsx +23 -14
- package/src/navigation/edit/test/overlay-template-part-selector.jsdom.test.jsx +22 -20
- package/src/navigation/edit/test/responsive-wrapper.jsdom.test.jsx +14 -13
- package/src/navigation/edit/test/use-create-overlay.jsdom.test.js +19 -24
- package/src/navigation/editor.scss +13 -0
- package/src/navigation/index.php +14 -14
- package/src/navigation/test/menu-items-to-blocks.jsdom.test.js +3 -2
- package/src/navigation/test/use-navigation-menu.jsdom.test.js +7 -4
- package/src/navigation/test/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.jsdom.test.jsx +18 -18
- package/src/navigation-link/shared/test/use-enable-link-status-validation.jsdom.test.js +8 -6
- package/src/navigation-link/shared/test/use-entity-binding.jsdom.test.js +12 -11
- package/src/navigation-link/shared/test/use-handle-link-change.jsdom.test.js +23 -20
- package/src/navigation-link/shared/test/use-link-preview.jsdom.test.js +17 -14
- package/src/navigation-link/test/__snapshots__/hooks.jsdom.test.js.snap +2 -2
- package/src/navigation-link/test/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.jsdom.test.js +3 -2
- package/src/paragraph/index.js +0 -18
- package/src/paragraph/use-enter.js +13 -6
- package/src/playlist/test/edit-component.jsdom.test.jsx +31 -30
- package/src/playlist/test/edit.jsdom.test.js +1 -0
- package/src/playlist/test/transforms.jsdom.test.js +1 -0
- package/src/playlist-track/test/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.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/preformatted/index.js +0 -18
- package/src/pullquote/index.js +0 -24
- package/src/query/edit/inspector-controls/index.jsx +9 -4
- package/src/query/index.php +2 -2
- package/src/query/test/utils.jsdom.test.js +1 -0
- package/src/quote/test/migrate.jsdom.test.js +1 -0
- package/src/read-more/index.php +1 -1
- package/src/search/index.js +0 -30
- package/src/search/index.php +1 -1
- package/src/separator/test/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-of-contents/index.php +3 -3
- package/src/utils/test/style-state.jsdom.test.js +1 -0
- package/src/utils/test/waveform-player-dependency.jsdom.test.js +15 -21
- package/src/verse/index.js +0 -18
- package/src/video/index.js +0 -40
- 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-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-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 -46
- package/build-style/form-input/style.css +0 -46
- 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
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/form/index.js
|
|
2
|
-
import { addFilter } from "@wordpress/hooks";
|
|
3
|
-
import { __ } from "@wordpress/i18n";
|
|
4
|
-
import initBlock from "../utils/init-block.mjs";
|
|
5
|
-
import edit from "./edit.mjs";
|
|
6
|
-
import metadata from "./block.json";
|
|
7
|
-
import save from "./save.mjs";
|
|
8
|
-
import variations from "./variations.mjs";
|
|
9
|
-
import deprecated from "./deprecated.mjs";
|
|
10
|
-
import { icon } from "./icons.mjs";
|
|
11
|
-
import {
|
|
12
|
-
formSubmissionNotificationSuccess,
|
|
13
|
-
formSubmissionNotificationError
|
|
14
|
-
} from "./utils.mjs";
|
|
15
|
-
var { name } = metadata;
|
|
16
|
-
var TEMPLATE = [
|
|
17
|
-
formSubmissionNotificationSuccess,
|
|
18
|
-
formSubmissionNotificationError,
|
|
19
|
-
[
|
|
20
|
-
"core/form-input",
|
|
21
|
-
{
|
|
22
|
-
type: "text",
|
|
23
|
-
label: __("Name"),
|
|
24
|
-
required: true
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
[
|
|
28
|
-
"core/form-input",
|
|
29
|
-
{
|
|
30
|
-
type: "email",
|
|
31
|
-
label: __("Email"),
|
|
32
|
-
required: true
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
[
|
|
36
|
-
"core/form-input",
|
|
37
|
-
{
|
|
38
|
-
type: "textarea",
|
|
39
|
-
label: __("Comment"),
|
|
40
|
-
required: true
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
["core/form-submit-button", {}]
|
|
44
|
-
];
|
|
45
|
-
var settings = {
|
|
46
|
-
icon,
|
|
47
|
-
template: TEMPLATE,
|
|
48
|
-
edit,
|
|
49
|
-
save,
|
|
50
|
-
deprecated,
|
|
51
|
-
variations,
|
|
52
|
-
example: {}
|
|
53
|
-
};
|
|
54
|
-
var init = () => {
|
|
55
|
-
const DISALLOWED_PARENTS = ["core/form"];
|
|
56
|
-
addFilter(
|
|
57
|
-
"blockEditor.__unstableCanInsertBlockType",
|
|
58
|
-
"core/block-library/preventInsertingFormIntoAnotherForm",
|
|
59
|
-
(canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => {
|
|
60
|
-
if (blockType.name !== "core/form") {
|
|
61
|
-
return canInsert;
|
|
62
|
-
}
|
|
63
|
-
for (const disallowedParentType of DISALLOWED_PARENTS) {
|
|
64
|
-
const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(
|
|
65
|
-
rootClientId,
|
|
66
|
-
disallowedParentType
|
|
67
|
-
).length;
|
|
68
|
-
if (hasDisallowedParent) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
return initBlock({ name, metadata, settings });
|
|
76
|
-
};
|
|
77
|
-
export {
|
|
78
|
-
init,
|
|
79
|
-
metadata,
|
|
80
|
-
name,
|
|
81
|
-
settings
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form/index.js"],
|
|
4
|
-
"sourcesContent": ["import { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport variations from './variations';\nimport deprecated from './deprecated';\nimport { icon } from './icons';\nimport {\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n} from './utils';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst TEMPLATE = [\n\tformSubmissionNotificationSuccess,\n\tformSubmissionNotificationError,\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'text',\n\t\t\tlabel: __( 'Name' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'email',\n\t\t\tlabel: __( 'Email' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[\n\t\t'core/form-input',\n\t\t{\n\t\t\ttype: 'textarea',\n\t\t\tlabel: __( 'Comment' ),\n\t\t\trequired: true,\n\t\t},\n\t],\n\t[ 'core/form-submit-button', {} ],\n];\n\nexport const settings = {\n\ticon,\n\ttemplate: TEMPLATE,\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n\texample: {},\n};\n\nexport const init = () => {\n\t// Prevent adding forms inside forms.\n\tconst DISALLOWED_PARENTS = [ 'core/form' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'core/block-library/preventInsertingFormIntoAnotherForm',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/form' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,OAAO,eAAe;AACtB,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,YAAY;AACrB;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAEP,IAAM,EAAE,KAAK,IAAI;AAIjB,IAAM,WAAW;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO,GAAI,MAAO;AAAA,MAClB,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO,GAAI,OAAQ;AAAA,MACnB,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA;AAAA,IACC;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,OAAO,GAAI,SAAU;AAAA,MACrB,UAAU;AAAA,IACX;AAAA,EACD;AAAA,EACA,CAAE,2BAA2B,CAAC,CAAE;AACjC;AAEO,IAAM,WAAW;AAAA,EACvB;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAC;AACX;AAEO,IAAM,OAAO,MAAM;AAEzB,QAAM,qBAAqB,CAAE,WAAY;AACzC;AAAA,IACC;AAAA,IACA;AAAA,IACA,CACC,WACA,WACA,cACA,EAAE,UAAU,2BAA2B,MACnC;AACJ,UAAK,UAAU,SAAS,aAAc;AACrC,eAAO;AAAA,MACR;AAEA,iBAAY,wBAAwB,oBAAqB;AACxD,cAAM,sBACL,SAAU,YAAa,GAAG,SAAS,wBACnC;AAAA,UACC;AAAA,UACA;AAAA,QACD,EAAE;AACH,YAAK,qBAAsB;AAC1B,iBAAO;AAAA,QACR;AAAA,MACD;AACA,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO,UAAW,EAAE,MAAM,UAAU,SAAS,CAAE;AAChD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/form/save.jsx
|
|
2
|
-
import { InnerBlocks, useBlockProps } from "@wordpress/block-editor";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
function save({ attributes }) {
|
|
5
|
-
const blockProps = useBlockProps.save();
|
|
6
|
-
const { submissionMethod } = attributes;
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
"form",
|
|
9
|
-
{
|
|
10
|
-
...blockProps,
|
|
11
|
-
encType: submissionMethod === "email" ? "text/plain" : null,
|
|
12
|
-
children: /* @__PURE__ */ jsx(InnerBlocks.Content, {})
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
save as default
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=save.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form/save.jsx"],
|
|
4
|
-
"sourcesContent": ["import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst blockProps = useBlockProps.save();\n\tconst { submissionMethod } = attributes;\n\n\treturn (\n\t\t<form\n\t\t\t{ ...blockProps }\n\t\t\tencType={ submissionMethod === 'email' ? 'text/plain' : null }\n\t\t>\n\t\t\t<InnerBlocks.Content />\n\t\t</form>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAAA,SAAS,aAAa,qBAAqB;AAWxC;AATY,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM,aAAa,cAAc,KAAK;AACtC,QAAM,EAAE,iBAAiB,IAAI;AAE7B,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,SAAU,qBAAqB,UAAU,eAAe;AAAA,MAExD,8BAAC,YAAY,SAAZ,EAAoB;AAAA;AAAA,EACtB;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/form/utils.js
|
|
2
|
-
import { __ } from "@wordpress/i18n";
|
|
3
|
-
var formSubmissionNotificationSuccess = [
|
|
4
|
-
"core/form-submission-notification",
|
|
5
|
-
{
|
|
6
|
-
type: "success"
|
|
7
|
-
},
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
"core/paragraph",
|
|
11
|
-
{
|
|
12
|
-
content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">' + __("Your form has been submitted successfully") + "</mark>"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
]
|
|
16
|
-
];
|
|
17
|
-
var formSubmissionNotificationError = [
|
|
18
|
-
"core/form-submission-notification",
|
|
19
|
-
{
|
|
20
|
-
type: "error"
|
|
21
|
-
},
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
"core/paragraph",
|
|
25
|
-
{
|
|
26
|
-
content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">' + __("There was an error submitting your form.") + "</mark>"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
]
|
|
30
|
-
];
|
|
31
|
-
export {
|
|
32
|
-
formSubmissionNotificationError,
|
|
33
|
-
formSubmissionNotificationSuccess
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=utils.mjs.map
|
|
@@ -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,SAAS,UAAU;AAEZ,IAAM,oCAAoC;AAAA,EAChD;AAAA,EACA;AAAA,IACC,MAAM;AAAA,EACP;AAAA,EACA;AAAA,IACC;AAAA,MACC;AAAA,MACA;AAAA,QACC,SACC,4FACA,GAAI,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,4FACA,GAAI,0CAA2C,IAC/C;AAAA,MACF;AAAA,IACD;AAAA,EACD;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/form/variations.js
|
|
2
|
-
import { __ } from "@wordpress/i18n";
|
|
3
|
-
import {
|
|
4
|
-
formSubmissionNotificationSuccess,
|
|
5
|
-
formSubmissionNotificationError
|
|
6
|
-
} from "./utils.mjs";
|
|
7
|
-
var variations = [
|
|
8
|
-
{
|
|
9
|
-
name: "comment-form",
|
|
10
|
-
title: __("Experimental Comment form"),
|
|
11
|
-
description: __("A comment form for posts and pages."),
|
|
12
|
-
attributes: {
|
|
13
|
-
submissionMethod: "custom",
|
|
14
|
-
action: "{SITE_URL}/wp-comments-post.php",
|
|
15
|
-
method: "post",
|
|
16
|
-
anchor: "comment-form"
|
|
17
|
-
},
|
|
18
|
-
isDefault: false,
|
|
19
|
-
innerBlocks: [
|
|
20
|
-
[
|
|
21
|
-
"core/form-input",
|
|
22
|
-
{
|
|
23
|
-
type: "text",
|
|
24
|
-
name: "author",
|
|
25
|
-
label: __("Name"),
|
|
26
|
-
required: true,
|
|
27
|
-
visibilityPermissions: "logged-out"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
[
|
|
31
|
-
"core/form-input",
|
|
32
|
-
{
|
|
33
|
-
type: "email",
|
|
34
|
-
name: "email",
|
|
35
|
-
label: __("Email"),
|
|
36
|
-
required: true,
|
|
37
|
-
visibilityPermissions: "logged-out"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"core/form-input",
|
|
42
|
-
{
|
|
43
|
-
type: "textarea",
|
|
44
|
-
name: "comment",
|
|
45
|
-
label: __("Comment"),
|
|
46
|
-
required: true,
|
|
47
|
-
visibilityPermissions: "all"
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
["core/form-submit-button", {}]
|
|
51
|
-
],
|
|
52
|
-
scope: ["inserter", "transform"],
|
|
53
|
-
isActive: (blockAttributes) => !blockAttributes?.type || blockAttributes?.type === "text"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: "wp-privacy-form",
|
|
57
|
-
title: __("Experimental Privacy Request Form"),
|
|
58
|
-
keywords: ["GDPR"],
|
|
59
|
-
description: __("A form to request data exports and/or deletion."),
|
|
60
|
-
attributes: {
|
|
61
|
-
submissionMethod: "custom",
|
|
62
|
-
action: "",
|
|
63
|
-
method: "post",
|
|
64
|
-
anchor: "gdpr-form"
|
|
65
|
-
},
|
|
66
|
-
isDefault: false,
|
|
67
|
-
innerBlocks: [
|
|
68
|
-
formSubmissionNotificationSuccess,
|
|
69
|
-
formSubmissionNotificationError,
|
|
70
|
-
[
|
|
71
|
-
"core/paragraph",
|
|
72
|
-
{
|
|
73
|
-
content: __(
|
|
74
|
-
"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."
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
[
|
|
79
|
-
"core/form-input",
|
|
80
|
-
{
|
|
81
|
-
type: "email",
|
|
82
|
-
name: "email",
|
|
83
|
-
label: __("Enter your email address."),
|
|
84
|
-
required: true,
|
|
85
|
-
visibilityPermissions: "all"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
[
|
|
89
|
-
"core/form-input",
|
|
90
|
-
{
|
|
91
|
-
type: "checkbox",
|
|
92
|
-
name: "export_personal_data",
|
|
93
|
-
label: __("Request data export"),
|
|
94
|
-
required: false,
|
|
95
|
-
visibilityPermissions: "all"
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
"core/form-input",
|
|
100
|
-
{
|
|
101
|
-
type: "checkbox",
|
|
102
|
-
name: "remove_personal_data",
|
|
103
|
-
label: __("Request data deletion"),
|
|
104
|
-
required: false,
|
|
105
|
-
visibilityPermissions: "all"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
["core/form-submit-button", {}],
|
|
109
|
-
[
|
|
110
|
-
"core/form-input",
|
|
111
|
-
{
|
|
112
|
-
type: "hidden",
|
|
113
|
-
name: "wp-action",
|
|
114
|
-
value: "wp_privacy_send_request"
|
|
115
|
-
}
|
|
116
|
-
],
|
|
117
|
-
[
|
|
118
|
-
"core/form-input",
|
|
119
|
-
{
|
|
120
|
-
type: "hidden",
|
|
121
|
-
name: "wp-privacy-request",
|
|
122
|
-
value: "1"
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
],
|
|
126
|
-
scope: ["inserter", "transform"],
|
|
127
|
-
isActive: (blockAttributes) => !blockAttributes?.type || blockAttributes?.type === "text"
|
|
128
|
-
}
|
|
129
|
-
];
|
|
130
|
-
var variations_default = variations;
|
|
131
|
-
export {
|
|
132
|
-
variations_default as default
|
|
133
|
-
};
|
|
134
|
-
//# sourceMappingURL=variations.mjs.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,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,OACM;AAEP,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,OAAO,GAAI,2BAA4B;AAAA,IACvC,aAAa,GAAI,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,OAAO,GAAI,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,OAAO,GAAI,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,OAAO,GAAI,SAAU;AAAA,UACrB,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA,CAAE,2BAA2B,CAAC,CAAE;AAAA,IACjC;AAAA,IACA,OAAO,CAAE,YAAY,WAAY;AAAA,IACjC,UAAU,CAAE,oBACX,CAAE,iBAAiB,QAAQ,iBAAiB,SAAS;AAAA,EACvD;AAAA,EACA;AAAA,IACC,MAAM;AAAA,IACN,OAAO,GAAI,mCAAoC;AAAA,IAC/C,UAAU,CAAE,MAAO;AAAA,IACnB,aAAa,GAAI,iDAAkD;AAAA,IACnE,YAAY;AAAA,MACX,kBAAkB;AAAA,MAClB,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,QAAQ;AAAA,IACT;AAAA,IACA,WAAW;AAAA,IACX,aAAa;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,SAAS;AAAA,YACR;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,OAAO,GAAI,2BAA4B;AAAA,UACvC,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,OAAO,GAAI,qBAAsB;AAAA,UACjC,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,OAAO,GAAI,uBAAwB;AAAA,UACnC,UAAU;AAAA,UACV,uBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,MACA,CAAE,2BAA2B,CAAC,CAAE;AAAA,MAChC;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,MACD;AAAA,MACA;AAAA,QACC;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,MACD;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
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/form/view.js
|
|
2
|
-
var formSettings;
|
|
3
|
-
try {
|
|
4
|
-
formSettings = JSON.parse(
|
|
5
|
-
document.getElementById(
|
|
6
|
-
"wp-script-module-data-@wordpress/block-library/form/view"
|
|
7
|
-
)?.textContent
|
|
8
|
-
);
|
|
9
|
-
} catch {
|
|
10
|
-
}
|
|
11
|
-
document.querySelectorAll("form.wp-block-form").forEach(function(form) {
|
|
12
|
-
if (!formSettings || !form.action || !form.action.startsWith("mailto:")) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const redirectNotification = (status) => {
|
|
16
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
17
|
-
urlParams.append("wp-form-result", status);
|
|
18
|
-
window.location.search = urlParams.toString();
|
|
19
|
-
};
|
|
20
|
-
form.addEventListener("submit", async function(event) {
|
|
21
|
-
event.preventDefault();
|
|
22
|
-
const formData = Object.fromEntries(new FormData(form).entries());
|
|
23
|
-
formData.formAction = form.action;
|
|
24
|
-
formData._ajax_nonce = formSettings.nonce;
|
|
25
|
-
formData.action = formSettings.action;
|
|
26
|
-
formData._wp_http_referer = window.location.href;
|
|
27
|
-
formData.formAction = form.action;
|
|
28
|
-
try {
|
|
29
|
-
const response = await fetch(formSettings.ajaxUrl, {
|
|
30
|
-
method: "POST",
|
|
31
|
-
headers: {
|
|
32
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
33
|
-
},
|
|
34
|
-
body: new URLSearchParams(formData).toString()
|
|
35
|
-
});
|
|
36
|
-
if (response.ok) {
|
|
37
|
-
redirectNotification("success");
|
|
38
|
-
} else {
|
|
39
|
-
redirectNotification("error");
|
|
40
|
-
}
|
|
41
|
-
} catch {
|
|
42
|
-
redirectNotification("error");
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=view.mjs.map
|
|
@@ -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
|
-
}
|