@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,71 +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-submission-notification/edit.jsx
|
|
31
|
-
var edit_exports = {};
|
|
32
|
-
__export(edit_exports, {
|
|
33
|
-
default: () => edit_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(edit_exports);
|
|
36
|
-
var import_i18n = require("@wordpress/i18n");
|
|
37
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
38
|
-
var import_data = require("@wordpress/data");
|
|
39
|
-
var import_clsx = __toESM(require("clsx"));
|
|
40
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
41
|
-
var Edit = ({ attributes, clientId }) => {
|
|
42
|
-
const { type } = attributes;
|
|
43
|
-
const blockProps = (0, import_block_editor.useBlockProps)({
|
|
44
|
-
className: (0, import_clsx.default)("wp-block-form-submission-notification", {
|
|
45
|
-
[`form-notification-type-${type}`]: type
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
const { hasInnerBlocks } = (0, import_data.useSelect)(
|
|
49
|
-
(select) => {
|
|
50
|
-
const { getBlock } = select(import_block_editor.store);
|
|
51
|
-
const block = getBlock(clientId);
|
|
52
|
-
return {
|
|
53
|
-
hasInnerBlocks: !!(block && block.innerBlocks.length)
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
[clientId]
|
|
57
|
-
);
|
|
58
|
-
const innerBlocksProps = (0, import_block_editor.useInnerBlocksProps)(blockProps, {
|
|
59
|
-
renderAppender: hasInnerBlocks ? void 0 : import_block_editor.InnerBlocks.ButtonBlockAppender
|
|
60
|
-
});
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
...innerBlocksProps,
|
|
65
|
-
"data-message-success": (0, import_i18n.__)("Submission success notification"),
|
|
66
|
-
"data-message-error": (0, import_i18n.__)("Submission error notification")
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
var edit_default = Edit;
|
|
71
|
-
//# sourceMappingURL=edit.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submission-notification/edit.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport clsx from 'clsx';\n\nconst Edit = ( { attributes, clientId } ) => {\n\tconst { type } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-form-submission-notification', {\n\t\t\t[ `form-notification-type-${ type }` ]: type,\n\t\t} ),\n\t} );\n\n\tconst { hasInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: hasInnerBlocks\n\t\t\t? undefined\n\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\t{ ...innerBlocksProps }\n\t\t\tdata-message-success={ __( 'Submission success notification' ) }\n\t\t\tdata-message-error={ __( 'Submission error notification' ) }\n\t\t/>\n\t);\n};\nexport default Edit;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,0BAKO;AACP,kBAA0B;AAC1B,kBAAiB;AA4Bf;AA1BF,IAAM,OAAO,CAAE,EAAE,YAAY,SAAS,MAAO;AAC5C,QAAM,EAAE,KAAK,IAAI;AACjB,QAAM,iBAAa,mCAAe;AAAA,IACjC,eAAW,YAAAA,SAAM,yCAAyC;AAAA,MACzD,CAAE,0BAA2B,IAAK,EAAG,GAAG;AAAA,IACzC,CAAE;AAAA,EACH,CAAE;AAEF,QAAM,EAAE,eAAe,QAAI;AAAA,IAC1B,CAAE,WAAY;AACb,YAAM,EAAE,SAAS,IAAI,OAAQ,oBAAAC,KAAiB;AAC9C,YAAM,QAAQ,SAAU,QAAS;AACjC,aAAO;AAAA,QACN,gBAAgB,CAAC,EAAI,SAAS,MAAM,YAAY;AAAA,MACjD;AAAA,IACD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AAEA,QAAM,uBAAmB,yCAAqB,YAAY;AAAA,IACzD,gBAAgB,iBACb,SACA,gCAAY;AAAA,EAChB,CAAE;AAEF,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,4BAAuB,gBAAI,iCAAkC;AAAA,MAC7D,0BAAqB,gBAAI,+BAAgC;AAAA;AAAA,EAC1D;AAEF;AACA,IAAO,eAAQ;",
|
|
6
|
-
"names": ["clsx", "blockEditorStore"]
|
|
7
|
-
}
|
|
@@ -1,73 +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 name2 in all)
|
|
10
|
-
__defProp(target, name2, { get: all[name2], 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-submission-notification/index.js
|
|
31
|
-
var form_submission_notification_exports = {};
|
|
32
|
-
__export(form_submission_notification_exports, {
|
|
33
|
-
init: () => init,
|
|
34
|
-
metadata: () => import_block.default,
|
|
35
|
-
name: () => name,
|
|
36
|
-
settings: () => settings
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(form_submission_notification_exports);
|
|
39
|
-
var import_icons = require("@wordpress/icons");
|
|
40
|
-
var import_i18n = require("@wordpress/i18n");
|
|
41
|
-
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
42
|
-
var import_edit = __toESM(require("./edit.cjs"));
|
|
43
|
-
var import_block = __toESM(require("./block.json"));
|
|
44
|
-
var import_save = __toESM(require("./save.cjs"));
|
|
45
|
-
var import_variations = __toESM(require("./variations.cjs"));
|
|
46
|
-
var { name } = import_block.default;
|
|
47
|
-
var TEMPLATE = [
|
|
48
|
-
[
|
|
49
|
-
"core/paragraph",
|
|
50
|
-
{
|
|
51
|
-
content: (0, import_i18n.__)(
|
|
52
|
-
"Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options."
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
];
|
|
57
|
-
var settings = {
|
|
58
|
-
icon: import_icons.group,
|
|
59
|
-
template: TEMPLATE,
|
|
60
|
-
edit: import_edit.default,
|
|
61
|
-
save: import_save.default,
|
|
62
|
-
variations: import_variations.default,
|
|
63
|
-
example: {}
|
|
64
|
-
};
|
|
65
|
-
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
init,
|
|
69
|
-
metadata,
|
|
70
|
-
name,
|
|
71
|
-
settings
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submission-notification/index.js"],
|
|
4
|
-
"sourcesContent": ["import { group as icon } from '@wordpress/icons';\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';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst TEMPLATE = [\n\t[\n\t\t'core/paragraph',\n\t\t{\n\t\t\tcontent: __(\n\t\t\t\t\"Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options.\"\n\t\t\t),\n\t\t},\n\t],\n];\n\nexport const settings = {\n\ticon,\n\ttemplate: TEMPLATE,\n\tedit,\n\tsave,\n\tvariations,\n\texample: {},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAC9B,kBAAmB;AACnB,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AAEvB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIjB,IAAM,WAAW;AAAA,EAChB;AAAA,IACC;AAAA,IACA;AAAA,MACC,aAAS;AAAA,QACR;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,WAAW;AAAA,EACvB,mBAAAC;AAAA,EACA,UAAU;AAAA,EACV,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,8BAAAC;AAAA,EACA,SAAS,CAAC;AACX;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
-
"names": ["metadata", "icon", "edit", "save", "variations", "initBlock", "metadata"]
|
|
7
|
-
}
|
|
@@ -1,28 +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-submission-notification/init.js
|
|
21
|
-
var init_exports = {};
|
|
22
|
-
__export(init_exports, {
|
|
23
|
-
default: () => init_default
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(init_exports);
|
|
26
|
-
var import__ = require("./index.cjs");
|
|
27
|
-
var init_default = (0, import__.init)();
|
|
28
|
-
//# sourceMappingURL=init.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submission-notification/init.js"],
|
|
4
|
-
"sourcesContent": ["import { init } from '.';\n\nexport default init();\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAqB;AAErB,IAAO,mBAAQ,eAAK;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,54 +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-submission-notification/save.jsx
|
|
31
|
-
var save_exports = {};
|
|
32
|
-
__export(save_exports, {
|
|
33
|
-
default: () => save
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(save_exports);
|
|
36
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
37
|
-
var import_clsx = __toESM(require("clsx"));
|
|
38
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
-
function save({ attributes }) {
|
|
40
|
-
const { type } = attributes;
|
|
41
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
-
"div",
|
|
43
|
-
{
|
|
44
|
-
...import_block_editor.useInnerBlocksProps.save(
|
|
45
|
-
import_block_editor.useBlockProps.save({
|
|
46
|
-
className: (0, import_clsx.default)("wp-block-form-submission-notification", {
|
|
47
|
-
[`form-notification-type-${type}`]: type
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=save.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submission-notification/save.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';\nimport clsx from 'clsx';\n\nexport default function save( { attributes } ) {\n\tconst { type } = attributes;\n\n\treturn (\n\t\t<div\n\t\t\t{ ...useInnerBlocksProps.save(\n\t\t\t\tuseBlockProps.save( {\n\t\t\t\t\tclassName: clsx( 'wp-block-form-submission-notification', {\n\t\t\t\t\t\t[ `form-notification-type-${ type }` ]: type,\n\t\t\t\t\t} ),\n\t\t\t\t} )\n\t\t\t) }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmD;AACnD,kBAAiB;AAMf;AAJa,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM,EAAE,KAAK,IAAI;AAEjB,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG,wCAAoB;AAAA,QACxB,kCAAc,KAAM;AAAA,UACnB,eAAW,YAAAA,SAAM,yCAAyC;AAAA,YACzD,CAAE,0BAA2B,IAAK,EAAG,GAAG;AAAA,UACzC,CAAE;AAAA,QACH,CAAE;AAAA,MACH;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
-
"names": ["clsx"]
|
|
7
|
-
}
|
|
@@ -1,78 +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-submission-notification/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 variations = [
|
|
28
|
-
{
|
|
29
|
-
name: "form-submission-success",
|
|
30
|
-
title: (0, import_i18n.__)("Form Submission Success"),
|
|
31
|
-
description: (0, import_i18n.__)("Success message for form submissions."),
|
|
32
|
-
attributes: {
|
|
33
|
-
type: "success"
|
|
34
|
-
},
|
|
35
|
-
isDefault: true,
|
|
36
|
-
innerBlocks: [
|
|
37
|
-
[
|
|
38
|
-
"core/paragraph",
|
|
39
|
-
{
|
|
40
|
-
content: (0, import_i18n.__)("Your form has been submitted successfully."),
|
|
41
|
-
backgroundColor: "#00D084",
|
|
42
|
-
textColor: "#000000",
|
|
43
|
-
style: {
|
|
44
|
-
elements: { link: { color: { text: "#000000" } } }
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
],
|
|
49
|
-
scope: ["inserter", "transform"],
|
|
50
|
-
isActive: (blockAttributes) => !blockAttributes?.type || blockAttributes?.type === "success"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
name: "form-submission-error",
|
|
54
|
-
title: (0, import_i18n.__)("Form Submission Error"),
|
|
55
|
-
description: (0, import_i18n.__)("Error/failure message for form submissions."),
|
|
56
|
-
attributes: {
|
|
57
|
-
type: "error"
|
|
58
|
-
},
|
|
59
|
-
isDefault: false,
|
|
60
|
-
innerBlocks: [
|
|
61
|
-
[
|
|
62
|
-
"core/paragraph",
|
|
63
|
-
{
|
|
64
|
-
content: (0, import_i18n.__)("There was an error submitting your form."),
|
|
65
|
-
backgroundColor: "#CF2E2E",
|
|
66
|
-
textColor: "#FFFFFF",
|
|
67
|
-
style: {
|
|
68
|
-
elements: { link: { color: { text: "#FFFFFF" } } }
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
],
|
|
73
|
-
scope: ["inserter", "transform"],
|
|
74
|
-
isActive: (blockAttributes) => !blockAttributes?.type || blockAttributes?.type === "error"
|
|
75
|
-
}
|
|
76
|
-
];
|
|
77
|
-
var variations_default = variations;
|
|
78
|
-
//# sourceMappingURL=variations.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submission-notification/variations.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\n\nconst variations = [\n\t{\n\t\tname: 'form-submission-success',\n\t\ttitle: __( 'Form Submission Success' ),\n\t\tdescription: __( 'Success message for form submissions.' ),\n\t\tattributes: {\n\t\t\ttype: 'success',\n\t\t},\n\t\tisDefault: true,\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/paragraph',\n\t\t\t\t{\n\t\t\t\t\tcontent: __( 'Your form has been submitted successfully.' ),\n\t\t\t\t\tbackgroundColor: '#00D084',\n\t\t\t\t\ttextColor: '#000000',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\telements: { link: { color: { text: '#000000' } } },\n\t\t\t\t\t},\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 === 'success',\n\t},\n\t{\n\t\tname: 'form-submission-error',\n\t\ttitle: __( 'Form Submission Error' ),\n\t\tdescription: __( 'Error/failure message for form submissions.' ),\n\t\tattributes: {\n\t\t\ttype: 'error',\n\t\t},\n\t\tisDefault: false,\n\t\tinnerBlocks: [\n\t\t\t[\n\t\t\t\t'core/paragraph',\n\t\t\t\t{\n\t\t\t\t\tcontent: __( 'There was an error submitting your form.' ),\n\t\t\t\t\tbackgroundColor: '#CF2E2E',\n\t\t\t\t\ttextColor: '#FFFFFF',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\telements: { link: { color: { text: '#FFFFFF' } } },\n\t\t\t\t\t},\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 === 'error',\n\t},\n];\n\nexport default variations;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AAEnB,IAAM,aAAa;AAAA,EAClB;AAAA,IACC,MAAM;AAAA,IACN,WAAO,gBAAI,yBAA0B;AAAA,IACrC,iBAAa,gBAAI,uCAAwC;AAAA,IACzD,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,IACX,aAAa;AAAA,MACZ;AAAA,QACC;AAAA,QACA;AAAA,UACC,aAAS,gBAAI,4CAA6C;AAAA,UAC1D,iBAAiB;AAAA,UACjB,WAAW;AAAA,UACX,OAAO;AAAA,YACN,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE,EAAE;AAAA,UAClD;AAAA,QACD;AAAA,MACD;AAAA,IACD;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,WAAO,gBAAI,uBAAwB;AAAA,IACnC,iBAAa,gBAAI,6CAA8C;AAAA,IAC/D,YAAY;AAAA,MACX,MAAM;AAAA,IACP;AAAA,IACA,WAAW;AAAA,IACX,aAAa;AAAA,MACZ;AAAA,QACC;AAAA,QACA;AAAA,UACC,aAAS,gBAAI,0CAA2C;AAAA,UACxD,iBAAiB;AAAA,UACjB,WAAW;AAAA,UACX,OAAO;AAAA,YACN,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE,EAAE;AAAA,UAClD;AAAA,QACD;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,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
|
-
"apiVersion": 3,
|
|
4
|
-
"__experimental": true,
|
|
5
|
-
"name": "core/form-submit-button",
|
|
6
|
-
"title": "Form Submit Button",
|
|
7
|
-
"category": "widgets",
|
|
8
|
-
"icon": "button",
|
|
9
|
-
"ancestor": [ "core/form" ],
|
|
10
|
-
"allowedBlocks": [ "core/buttons", "core/button" ],
|
|
11
|
-
"description": "A submission button for forms.",
|
|
12
|
-
"keywords": [ "submit", "button", "form" ],
|
|
13
|
-
"textdomain": "default",
|
|
14
|
-
"style": [ "wp-block-form-submit-button" ]
|
|
15
|
-
}
|
|
@@ -1,36 +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-submit-button/edit.jsx
|
|
21
|
-
var edit_exports = {};
|
|
22
|
-
__export(edit_exports, {
|
|
23
|
-
default: () => edit_default
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(edit_exports);
|
|
26
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
var Edit = () => {
|
|
29
|
-
const blockProps = (0, import_block_editor.useBlockProps)();
|
|
30
|
-
const innerBlocksProps = (0, import_block_editor.useInnerBlocksProps)(blockProps, {
|
|
31
|
-
templateLock: "all"
|
|
32
|
-
});
|
|
33
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "wp-block-form-submit-wrapper", ...innerBlocksProps });
|
|
34
|
-
};
|
|
35
|
-
var edit_default = Edit;
|
|
36
|
-
//# sourceMappingURL=edit.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submit-button/edit.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';\n\nconst Edit = () => {\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplateLock: 'all',\n\t} );\n\treturn (\n\t\t<div className=\"wp-block-form-submit-wrapper\" { ...innerBlocksProps } />\n\t);\n};\nexport default Edit;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmD;AAQjD;AANF,IAAM,OAAO,MAAM;AAClB,QAAM,iBAAa,mCAAc;AACjC,QAAM,uBAAmB,yCAAqB,YAAY;AAAA,IACzD,cAAc;AAAA,EACf,CAAE;AACF,SACC,4CAAC,SAAI,WAAU,gCAAiC,GAAG,kBAAmB;AAExE;AACA,IAAO,eAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,75 +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 name2 in all)
|
|
10
|
-
__defProp(target, name2, { get: all[name2], 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-submit-button/index.js
|
|
31
|
-
var form_submit_button_exports = {};
|
|
32
|
-
__export(form_submit_button_exports, {
|
|
33
|
-
init: () => init,
|
|
34
|
-
metadata: () => import_block.default,
|
|
35
|
-
name: () => name,
|
|
36
|
-
settings: () => settings
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(form_submit_button_exports);
|
|
39
|
-
var import_i18n = require("@wordpress/i18n");
|
|
40
|
-
var import_init_block = __toESM(require("../utils/init-block.cjs"));
|
|
41
|
-
var import_edit = __toESM(require("./edit.cjs"));
|
|
42
|
-
var import_block = __toESM(require("./block.json"));
|
|
43
|
-
var import_save = __toESM(require("./save.cjs"));
|
|
44
|
-
var { name } = import_block.default;
|
|
45
|
-
var TEMPLATE = [
|
|
46
|
-
[
|
|
47
|
-
"core/buttons",
|
|
48
|
-
{},
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
"core/button",
|
|
52
|
-
{
|
|
53
|
-
text: (0, import_i18n.__)("Submit"),
|
|
54
|
-
tagName: "button",
|
|
55
|
-
type: "submit"
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
]
|
|
59
|
-
]
|
|
60
|
-
];
|
|
61
|
-
var settings = {
|
|
62
|
-
template: TEMPLATE,
|
|
63
|
-
edit: import_edit.default,
|
|
64
|
-
save: import_save.default,
|
|
65
|
-
example: {}
|
|
66
|
-
};
|
|
67
|
-
var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
|
|
68
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
-
0 && (module.exports = {
|
|
70
|
-
init,
|
|
71
|
-
metadata,
|
|
72
|
-
name,
|
|
73
|
-
settings
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submit-button/index.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst TEMPLATE = [\n\t[\n\t\t'core/buttons',\n\t\t{},\n\t\t[\n\t\t\t[\n\t\t\t\t'core/button',\n\t\t\t\t{\n\t\t\t\t\ttext: __( 'Submit' ),\n\t\t\t\t\ttagName: 'button',\n\t\t\t\t\ttype: 'submit',\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t],\n];\n\nexport const settings = {\n\ttemplate: TEMPLATE,\n\tedit,\n\tsave,\n\texample: {},\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAAsB;AACtB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AAEjB,IAAM,EAAE,KAAK,IAAI,aAAAA;AAIjB,IAAM,WAAW;AAAA,EAChB;AAAA,IACC;AAAA,IACA,CAAC;AAAA,IACD;AAAA,MACC;AAAA,QACC;AAAA,QACA;AAAA,UACC,UAAM,gBAAI,QAAS;AAAA,UACnB,SAAS;AAAA,UACT,MAAM;AAAA,QACP;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,WAAW;AAAA,EACvB,UAAU;AAAA,EACV,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAS,CAAC;AACX;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
|
|
6
|
-
"names": ["metadata", "edit", "save", "initBlock", "metadata"]
|
|
7
|
-
}
|
|
@@ -1,32 +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-submit-button/save.jsx
|
|
21
|
-
var save_exports = {};
|
|
22
|
-
__export(save_exports, {
|
|
23
|
-
default: () => save
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(save_exports);
|
|
26
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
function save() {
|
|
29
|
-
const blockProps = import_block_editor.useBlockProps.save();
|
|
30
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "wp-block-form-submit-wrapper", ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.InnerBlocks.Content, {}) });
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=save.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/form-submit-button/save.jsx"],
|
|
4
|
-
"sourcesContent": ["import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';\n\nexport default function save() {\n\tconst blockProps = useBlockProps.save();\n\treturn (\n\t\t<div className=\"wp-block-form-submit-wrapper\" { ...blockProps }>\n\t\t\t<InnerBlocks.Content />\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA2C;AAMxC;AAJY,SAAR,OAAwB;AAC9B,QAAM,aAAa,kCAAc,KAAK;AACtC,SACC,4CAAC,SAAI,WAAU,gCAAiC,GAAG,YAClD,sDAAC,gCAAY,SAAZ,EAAoB,GACtB;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,79 +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/list-item/hooks/use-indent-list-item.js
|
|
21
|
-
var use_indent_list_item_exports = {};
|
|
22
|
-
__export(use_indent_list_item_exports, {
|
|
23
|
-
default: () => useIndentListItem
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(use_indent_list_item_exports);
|
|
26
|
-
var import_element = require("@wordpress/element");
|
|
27
|
-
var import_data = require("@wordpress/data");
|
|
28
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
29
|
-
var import_blocks = require("@wordpress/blocks");
|
|
30
|
-
function useIndentListItem(clientId) {
|
|
31
|
-
const { replaceBlocks, selectionChange, multiSelect } = (0, import_data.useDispatch)(import_block_editor.store);
|
|
32
|
-
const {
|
|
33
|
-
getBlock,
|
|
34
|
-
getPreviousBlockClientId,
|
|
35
|
-
getSelectionStart,
|
|
36
|
-
getSelectionEnd,
|
|
37
|
-
hasMultiSelection,
|
|
38
|
-
getMultiSelectedBlockClientIds,
|
|
39
|
-
getBlockRootClientId,
|
|
40
|
-
getBlockAttributes
|
|
41
|
-
} = (0, import_data.useSelect)(import_block_editor.store);
|
|
42
|
-
return (0, import_element.useCallback)(() => {
|
|
43
|
-
const _hasMultiSelection = hasMultiSelection();
|
|
44
|
-
const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId];
|
|
45
|
-
const clonedBlocks = clientIds.map(
|
|
46
|
-
(_clientId) => (0, import_blocks.cloneBlock)(getBlock(_clientId))
|
|
47
|
-
);
|
|
48
|
-
const previousSiblingId = getPreviousBlockClientId(clientId);
|
|
49
|
-
const newListItem = (0, import_blocks.cloneBlock)(getBlock(previousSiblingId));
|
|
50
|
-
const parentListId = getBlockRootClientId(clientId);
|
|
51
|
-
const parentListAttributes = getBlockAttributes(parentListId);
|
|
52
|
-
if (!newListItem.innerBlocks?.length) {
|
|
53
|
-
newListItem.innerBlocks = [
|
|
54
|
-
(0, import_blocks.createBlock)("core/list", {
|
|
55
|
-
ordered: parentListAttributes.ordered
|
|
56
|
-
})
|
|
57
|
-
];
|
|
58
|
-
}
|
|
59
|
-
newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks);
|
|
60
|
-
const selectionStart = getSelectionStart();
|
|
61
|
-
const selectionEnd = getSelectionEnd();
|
|
62
|
-
replaceBlocks([previousSiblingId, ...clientIds], [newListItem]);
|
|
63
|
-
if (!_hasMultiSelection) {
|
|
64
|
-
selectionChange(
|
|
65
|
-
clonedBlocks[0].clientId,
|
|
66
|
-
selectionEnd.attributeKey,
|
|
67
|
-
selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset,
|
|
68
|
-
selectionEnd.offset
|
|
69
|
-
);
|
|
70
|
-
} else {
|
|
71
|
-
multiSelect(
|
|
72
|
-
clonedBlocks[0].clientId,
|
|
73
|
-
clonedBlocks[clonedBlocks.length - 1].clientId
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
}, [clientId]);
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=use-indent-list-item.cjs.map
|