@wordpress/customize-widgets 4.35.0 → 5.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 +7 -0
- package/build/components/block-appender/index.js +2 -2
- package/build/components/block-appender/index.js.map +1 -1
- package/build/components/block-inspector-button/index.js +5 -4
- package/build/components/block-inspector-button/index.js.map +1 -1
- package/build/components/customize-widgets/index.js +24 -18
- package/build/components/customize-widgets/index.js.map +1 -1
- package/build/components/error-boundary/index.js +12 -10
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/focus-control/index.js +5 -4
- package/build/components/focus-control/index.js.map +1 -1
- package/build/components/header/index.js +48 -44
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter/index.js +25 -21
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +50 -45
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/more-menu/index.js +65 -54
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/sidebar-block-editor/index.js +42 -34
- package/build/components/sidebar-block-editor/index.js.map +1 -1
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js +5 -4
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build/components/sidebar-controls/index.js +5 -4
- package/build/components/sidebar-controls/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +44 -33
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/filters/move-to-sidebar.js +16 -12
- package/build/filters/move-to-sidebar.js.map +1 -1
- package/build/filters/wide-widget-display.js +2 -2
- package/build/filters/wide-widget-display.js.map +1 -1
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build-module/components/block-appender/index.js +2 -2
- package/build-module/components/block-appender/index.js.map +1 -1
- package/build-module/components/block-inspector-button/index.js +5 -4
- package/build-module/components/block-inspector-button/index.js.map +1 -1
- package/build-module/components/customize-widgets/index.js +25 -18
- package/build-module/components/customize-widgets/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +12 -10
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/focus-control/index.js +5 -4
- package/build-module/components/focus-control/index.js.map +1 -1
- package/build-module/components/header/index.js +50 -44
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter/index.js +26 -21
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +51 -45
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/more-menu/index.js +67 -54
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/sidebar-block-editor/index.js +44 -34
- package/build-module/components/sidebar-block-editor/index.js.map +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +5 -4
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build-module/components/sidebar-controls/index.js +5 -4
- package/build-module/components/sidebar-controls/index.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +45 -33
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/filters/move-to-sidebar.js +18 -12
- package/build-module/filters/move-to-sidebar.js.map +1 -1
- package/build-module/filters/wide-widget-display.js +2 -2
- package/build-module/filters/wide-widget-display.js.map +1 -1
- package/build-module/index.js +3 -3
- package/build-module/index.js.map +1 -1
- package/package.json +24 -23
- package/src/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useViewportMatch","store","coreStore","useSelect","useMemo","createPortal","BlockList","BlockToolbar","BlockInspector","privateApis","blockEditorPrivateApis","__unstableBlockSettingsMenuFirstItem","uploadMedia","preferencesStore","blockLibraryPrivateApis","BlockInspectorButton","Header","useInserter","SidebarEditorProvider","WelcomeGuide","KeyboardShortcuts","BlockAppender","unlock","ExperimentalBlockCanvas","BlockCanvas","BlockKeyboardShortcuts","SidebarBlockEditor","blockEditorSettings","sidebar","inserter","inspector","isInserterOpened","setIsInserterOpened","isMediumViewport","hasUploadPermissions","isFixedToolbarActive","keepCaretInsideBlock","isWelcomeGuideActive","select","_select$canUser","get","canUser","settings","mediaUploadBlockEditor","onError","argumentsObject","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalSetIsInserterOpened","mediaUpload","hasFixedToolbar","__unstableHasCustomAppender","
|
|
1
|
+
{"version":3,"names":["useViewportMatch","store","coreStore","useSelect","useMemo","createPortal","BlockList","BlockToolbar","BlockInspector","privateApis","blockEditorPrivateApis","__unstableBlockSettingsMenuFirstItem","uploadMedia","preferencesStore","blockLibraryPrivateApis","BlockInspectorButton","Header","useInserter","SidebarEditorProvider","WelcomeGuide","KeyboardShortcuts","BlockAppender","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ExperimentalBlockCanvas","BlockCanvas","BlockKeyboardShortcuts","SidebarBlockEditor","blockEditorSettings","sidebar","inserter","inspector","isInserterOpened","setIsInserterOpened","isMediumViewport","hasUploadPermissions","isFixedToolbarActive","keepCaretInsideBlock","isWelcomeGuideActive","select","_select$canUser","get","canUser","settings","mediaUploadBlockEditor","onError","argumentsObject","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalSetIsInserterOpened","mediaUpload","hasFixedToolbar","__unstableHasCustomAppender","children","Register","undo","redo","save","hideDragHandle","shouldIframe","styles","defaultEditorStyles","height","renderAppender","onSubmit","event","preventDefault","contentContainer","onClose","closeMenu"],"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo, createPortal } from '@wordpress/element';\nimport {\n\tBlockList,\n\tBlockToolbar,\n\tBlockInspector,\n\tprivateApis as blockEditorPrivateApis,\n\t__unstableBlockSettingsMenuFirstItem,\n} from '@wordpress/block-editor';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport BlockInspectorButton from '../block-inspector-button';\nimport Header from '../header';\nimport useInserter from '../inserter/use-inserter';\nimport SidebarEditorProvider from './sidebar-editor-provider';\nimport WelcomeGuide from '../welcome-guide';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport BlockAppender from '../block-appender';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockCanvas: BlockCanvas } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nexport default function SidebarBlockEditor( {\n\tblockEditorSettings,\n\tsidebar,\n\tinserter,\n\tinspector,\n} ) {\n\tconst [ isInserterOpened, setIsInserterOpened ] = useInserter( inserter );\n\tconst isMediumViewport = useViewportMatch( 'small' );\n\tconst {\n\t\thasUploadPermissions,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tisWelcomeGuideActive,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tselect( coreStore ).canUser( 'create', 'media' ) ?? true,\n\t\t\tisFixedToolbarActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tisWelcomeGuideActive: !! get(\n\t\t\t\t'core/customize-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isMediumViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t__unstableHasCustomAppender: true,\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisMediumViewport,\n\t\tkeepCaretInsideBlock,\n\t\tsetIsInserterOpened,\n\t] );\n\n\tif ( isWelcomeGuideActive ) {\n\t\treturn <WelcomeGuide sidebar={ sidebar } />;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\n\t\t\t<SidebarEditorProvider sidebar={ sidebar } settings={ settings }>\n\t\t\t\t<KeyboardShortcuts\n\t\t\t\t\tundo={ sidebar.undo }\n\t\t\t\t\tredo={ sidebar.redo }\n\t\t\t\t\tsave={ sidebar.save }\n\t\t\t\t/>\n\n\t\t\t\t<Header\n\t\t\t\t\tsidebar={ sidebar }\n\t\t\t\t\tinserter={ inserter }\n\t\t\t\t\tisInserterOpened={ isInserterOpened }\n\t\t\t\t\tsetIsInserterOpened={ setIsInserterOpened }\n\t\t\t\t\tisFixedToolbarActive={\n\t\t\t\t\t\tisFixedToolbarActive || ! isMediumViewport\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isFixedToolbarActive || ! isMediumViewport ) && (\n\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t) }\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ false }\n\t\t\t\t\tstyles={ settings.defaultEditorStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t>\n\t\t\t\t\t<BlockList renderAppender={ BlockAppender } />\n\t\t\t\t</BlockCanvas>\n\n\t\t\t\t{ createPortal(\n\t\t\t\t\t// This is a temporary hack to prevent button component inside <BlockInspector>\n\t\t\t\t\t// from submitting form when type=\"button\" is not specified.\n\t\t\t\t\t<form onSubmit={ ( event ) => event.preventDefault() }>\n\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t</form>,\n\t\t\t\t\tinspector.contentContainer[ 0 ]\n\t\t\t\t) }\n\t\t\t</SidebarEditorProvider>\n\n\t\t\t<__unstableBlockSettingsMenuFirstItem>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<BlockInspectorButton\n\t\t\t\t\t\tinspector={ inspector }\n\t\t\t\t\t\tcloseMenu={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</__unstableBlockSettingsMenuFirstItem>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,EAAEC,YAAY,QAAQ,oBAAoB;AAC1D,SACCC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,WAAW,IAAIC,sBAAsB,EACrCC,oCAAoC,QAC9B,yBAAyB;AAChC,SAASC,WAAW,Q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A,CACtC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -10,6 +9,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
10
9
|
import useSidebarBlockEditor from './use-sidebar-block-editor';
|
|
11
10
|
import useBlocksFocusControl from '../focus-control/use-blocks-focus-control';
|
|
12
11
|
import { unlock } from '../../lock-unlock';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const {
|
|
14
14
|
ExperimentalBlockEditorProvider
|
|
15
15
|
} = unlock(blockEditorPrivateApis);
|
|
@@ -20,12 +20,13 @@ export default function SidebarEditorProvider({
|
|
|
20
20
|
}) {
|
|
21
21
|
const [blocks, onInput, onChange] = useSidebarBlockEditor(sidebar);
|
|
22
22
|
useBlocksFocusControl(blocks);
|
|
23
|
-
return
|
|
23
|
+
return /*#__PURE__*/_jsx(ExperimentalBlockEditorProvider, {
|
|
24
24
|
value: blocks,
|
|
25
25
|
onInput: onInput,
|
|
26
26
|
onChange: onChange,
|
|
27
27
|
settings: settings,
|
|
28
|
-
useSubRegistry: false
|
|
29
|
-
|
|
28
|
+
useSubRegistry: false,
|
|
29
|
+
children: children
|
|
30
|
+
});
|
|
30
31
|
}
|
|
31
32
|
//# sourceMappingURL=sidebar-editor-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","blockEditorPrivateApis","useSidebarBlockEditor","useBlocksFocusControl","unlock","ExperimentalBlockEditorProvider","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange","
|
|
1
|
+
{"version":3,"names":["privateApis","blockEditorPrivateApis","useSidebarBlockEditor","useBlocksFocusControl","unlock","jsx","_jsx","ExperimentalBlockEditorProvider","SidebarEditorProvider","sidebar","settings","children","blocks","onInput","onChange","value","useSubRegistry"],"sources":["@wordpress/customize-widgets/src/components/sidebar-block-editor/sidebar-editor-provider.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useSidebarBlockEditor from './use-sidebar-block-editor';\nimport useBlocksFocusControl from '../focus-control/use-blocks-focus-control';\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\n\nexport default function SidebarEditorProvider( {\n\tsidebar,\n\tsettings,\n\tchildren,\n} ) {\n\tconst [ blocks, onInput, onChange ] = useSidebarBlockEditor( sidebar );\n\n\tuseBlocksFocusControl( blocks );\n\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\tvalue={ blocks }\n\t\t\tonInput={ onInput }\n\t\t\tonChange={ onChange }\n\t\t\tsettings={ settings }\n\t\t\tuseSubRegistry={ false }\n\t\t>\n\t\t\t{ children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,qBAAqB,MAAM,2CAA2C;AAE7E,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAM;EAAEC;AAAgC,CAAC,GAAGH,MAAM,CAAEH,sBAAuB,CAAC;AAE5E,eAAe,SAASO,qBAAqBA,CAAE;EAC9CC,OAAO;EACPC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM,CAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAE,GAAGZ,qBAAqB,CAAEO,OAAQ,CAAC;EAEtEN,qBAAqB,CAAES,MAAO,CAAC;EAE/B,oBACCN,IAAA,CAACC,+BAA+B;IAC/BQ,KAAK,EAAGH,MAAQ;IAChBC,OAAO,EAAGA,OAAS;IACnBC,QAAQ,EAAGA,QAAU;IACrBJ,QAAQ,EAAGA,QAAU;IACrBM,cAAc,EAAG,KAAO;IAAAL,QAAA,EAEtBA;EAAQ,CACsB,CAAC;AAEpC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
5
4
|
import { createContext, useMemo, useContext } from '@wordpress/element';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
export const SidebarControlsContext = createContext();
|
|
7
7
|
export default function SidebarControls({
|
|
8
8
|
sidebarControls,
|
|
@@ -13,9 +13,10 @@ export default function SidebarControls({
|
|
|
13
13
|
sidebarControls,
|
|
14
14
|
activeSidebarControl
|
|
15
15
|
}), [sidebarControls, activeSidebarControl]);
|
|
16
|
-
return
|
|
17
|
-
value: context
|
|
18
|
-
|
|
16
|
+
return /*#__PURE__*/_jsx(SidebarControlsContext.Provider, {
|
|
17
|
+
value: context,
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
19
20
|
}
|
|
20
21
|
export function useSidebarControls() {
|
|
21
22
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useMemo","useContext","SidebarControlsContext","SidebarControls","sidebarControls","activeSidebarControl","children","context","
|
|
1
|
+
{"version":3,"names":["createContext","useMemo","useContext","jsx","_jsx","SidebarControlsContext","SidebarControls","sidebarControls","activeSidebarControl","children","context","Provider","value","useSidebarControls","useActiveSidebarControl"],"sources":["@wordpress/customize-widgets/src/components/sidebar-controls/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useMemo, useContext } from '@wordpress/element';\n\nexport const SidebarControlsContext = createContext();\n\nexport default function SidebarControls( {\n\tsidebarControls,\n\tactiveSidebarControl,\n\tchildren,\n} ) {\n\tconst context = useMemo(\n\t\t() => ( {\n\t\t\tsidebarControls,\n\t\t\tactiveSidebarControl,\n\t\t} ),\n\t\t[ sidebarControls, activeSidebarControl ]\n\t);\n\n\treturn (\n\t\t<SidebarControlsContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</SidebarControlsContext.Provider>\n\t);\n}\n\nexport function useSidebarControls() {\n\tconst { sidebarControls } = useContext( SidebarControlsContext );\n\n\treturn sidebarControls;\n}\n\nexport function useActiveSidebarControl() {\n\tconst { activeSidebarControl } = useContext( SidebarControlsContext );\n\n\treturn activeSidebarControl;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExE,OAAO,MAAMC,sBAAsB,GAAGL,aAAa,CAAC,CAAC;AAErD,eAAe,SAASM,eAAeA,CAAE;EACxCC,eAAe;EACfC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,OAAO,GAAGT,OAAO,CACtB,OAAQ;IACPM,eAAe;IACfC;EACD,CAAC,CAAE,EACH,CAAED,eAAe,EAAEC,oBAAoB,CACxC,CAAC;EAED,oBACCJ,IAAA,CAACC,sBAAsB,CAACM,QAAQ;IAACC,KAAK,EAAGF,OAAS;IAAAD,QAAA,EAC/CA;EAAQ,CACsB,CAAC;AAEpC;AAEA,OAAO,SAASI,kBAAkBA,CAAA,EAAG;EACpC,MAAM;IAAEN;EAAgB,CAAC,GAAGL,UAAU,CAAEG,sBAAuB,CAAC;EAEhE,OAAOE,eAAe;AACvB;AAEA,OAAO,SAASO,uBAAuBA,CAAA,EAAG;EACzC,MAAM;IAAEN;EAAqB,CAAC,GAAGN,UAAU,CAAEG,sBAAuB,CAAC;EAErE,OAAOG,oBAAoB;AAC5B","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -6,6 +5,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
5
|
import { Button, ExternalLink } from '@wordpress/components';
|
|
7
6
|
import { useDispatch } from '@wordpress/data';
|
|
8
7
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
export default function WelcomeGuide({
|
|
10
11
|
sidebar
|
|
11
12
|
}) {
|
|
@@ -13,37 +14,48 @@ export default function WelcomeGuide({
|
|
|
13
14
|
toggle
|
|
14
15
|
} = useDispatch(preferencesStore);
|
|
15
16
|
const isEntirelyBlockWidgets = sidebar.getWidgets().every(widget => widget.id.startsWith('block-'));
|
|
16
|
-
return
|
|
17
|
-
className: "customize-widgets-welcome-guide"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
17
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
18
|
+
className: "customize-widgets-welcome-guide",
|
|
19
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
20
|
+
className: "customize-widgets-welcome-guide__image__wrapper",
|
|
21
|
+
children: /*#__PURE__*/_jsxs("picture", {
|
|
22
|
+
children: [/*#__PURE__*/_jsx("source", {
|
|
23
|
+
srcSet: "https://s.w.org/images/block-editor/welcome-editor.svg",
|
|
24
|
+
media: "(prefers-reduced-motion: reduce)"
|
|
25
|
+
}), /*#__PURE__*/_jsx("img", {
|
|
26
|
+
className: "customize-widgets-welcome-guide__image",
|
|
27
|
+
src: "https://s.w.org/images/block-editor/welcome-editor.gif",
|
|
28
|
+
width: "312",
|
|
29
|
+
height: "240",
|
|
30
|
+
alt: ""
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
33
|
+
}), /*#__PURE__*/_jsx("h1", {
|
|
34
|
+
className: "customize-widgets-welcome-guide__heading",
|
|
35
|
+
children: __('Welcome to block Widgets')
|
|
36
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
37
|
+
className: "customize-widgets-welcome-guide__text",
|
|
38
|
+
children: isEntirelyBlockWidgets ? __('Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.') : __('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.')
|
|
39
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
40
|
+
className: "customize-widgets-welcome-guide__button",
|
|
41
|
+
variant: "primary",
|
|
42
|
+
onClick: () => toggle('core/customize-widgets', 'welcomeGuide'),
|
|
43
|
+
children: __('Got it')
|
|
44
|
+
}), /*#__PURE__*/_jsx("hr", {
|
|
45
|
+
className: "customize-widgets-welcome-guide__separator"
|
|
46
|
+
}), !isEntirelyBlockWidgets && /*#__PURE__*/_jsxs("p", {
|
|
47
|
+
className: "customize-widgets-welcome-guide__more-info",
|
|
48
|
+
children: [__('Want to stick with the old widgets?'), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx(ExternalLink, {
|
|
49
|
+
href: __('https://wordpress.org/plugins/classic-widgets/'),
|
|
50
|
+
children: __('Get the Classic Widgets plugin.')
|
|
51
|
+
})]
|
|
52
|
+
}), /*#__PURE__*/_jsxs("p", {
|
|
53
|
+
className: "customize-widgets-welcome-guide__more-info",
|
|
54
|
+
children: [__('New to the block editor?'), /*#__PURE__*/_jsx("br", {}), /*#__PURE__*/_jsx(ExternalLink, {
|
|
55
|
+
href: __('https://wordpress.org/documentation/article/wordpress-block-editor/'),
|
|
56
|
+
children: __("Here's a detailed guide.")
|
|
57
|
+
})]
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
48
60
|
}
|
|
49
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","Button","ExternalLink","useDispatch","store","preferencesStore","WelcomeGuide","sidebar","toggle","isEntirelyBlockWidgets","getWidgets","every","widget","id","startsWith","
|
|
1
|
+
{"version":3,"names":["__","Button","ExternalLink","useDispatch","store","preferencesStore","jsx","_jsx","jsxs","_jsxs","WelcomeGuide","sidebar","toggle","isEntirelyBlockWidgets","getWidgets","every","widget","id","startsWith","className","children","srcSet","media","src","width","height","alt","variant","onClick","href"],"sources":["@wordpress/customize-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button, ExternalLink } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function WelcomeGuide( { sidebar } ) {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isEntirelyBlockWidgets = sidebar\n\t\t.getWidgets()\n\t\t.every( ( widget ) => widget.id.startsWith( 'block-' ) );\n\n\treturn (\n\t\t<div className=\"customize-widgets-welcome-guide\">\n\t\t\t<div className=\"customize-widgets-welcome-guide__image__wrapper\">\n\t\t\t\t<picture>\n\t\t\t\t\t<source\n\t\t\t\t\t\tsrcSet=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t\t\t/>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName=\"customize-widgets-welcome-guide__image\"\n\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t/>\n\t\t\t\t</picture>\n\t\t\t</div>\n\t\t\t<h1 className=\"customize-widgets-welcome-guide__heading\">\n\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t</h1>\n\t\t\t<p className=\"customize-widgets-welcome-guide__text\">\n\t\t\t\t{ isEntirelyBlockWidgets\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Your theme provides different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t ) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"customize-widgets-welcome-guide__button\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tonClick={ () =>\n\t\t\t\t\ttoggle( 'core/customize-widgets', 'welcomeGuide' )\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ __( 'Got it' ) }\n\t\t\t</Button>\n\t\t\t<hr className=\"customize-widgets-welcome-guide__separator\" />\n\t\t\t{ ! isEntirelyBlockWidgets && (\n\t\t\t\t<p className=\"customize-widgets-welcome-guide__more-info\">\n\t\t\t\t\t{ __( 'Want to stick with the old widgets?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Get the Classic Widgets plugin.' ) }\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</p>\n\t\t\t) }\n\t\t\t<p className=\"customize-widgets-welcome-guide__more-info\">\n\t\t\t\t{ __( 'New to the block editor?' ) }\n\t\t\t\t<br />\n\t\t\t\t<ExternalLink\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( \"Here's a detail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CACF,CAAC,eACJO,IAAA,CAACN,MAAM;MACNkB,SAAS,EAAC,yCAAyC;MACnDQ,OAAO,EAAC,SAAS;MACjBC,OAAO,EAAGA,CAAA,KACThB,MAAM,CAAE,wBAAwB,EAAE,cAAe,CACjD;MAAAQ,QAAA,EAECpB,EAAE,CAAE,QAAS;IAAC,CACT,CAAC,eACTO,IAAA;MAAIY,SAAS,EAAC;IAA4C,CAAE,CAAC,EAC3D,CAAEN,sBAAsB,iBACzBJ,KAAA;MAAGU,SAAS,EAAC,4CAA4C;MAAAC,QAAA,GACtDpB,EAAE,CAAE,qCAAsC,CAAC,eAC7CO,IAAA,SAAK,CAAC,eACNA,IAAA,CAACL,YAAY;QACZ2B,IAAI,EAAG7B,EAAE,CACR,gDACD,CAAG;QAAAoB,QAAA,EAEDpB,EAAE,CAAE,iCAAkC;MAAC,CAC5B,CAAC;IAAA,CACb,CACH,eACDS,KAAA;MAAGU,SAAS,EAAC,4CAA4C;MAAAC,QAAA,GACtDpB,EAAE,CAAE,0BAA2B,CAAC,eAClCO,IAAA,SAAK,CAAC,eACNA,IAAA,CAACL,YAAY;QACZ2B,IAAI,EAAG7B,EAAE,CACR,qEACD,CAAG;QAAAoB,QAAA,EAEDpB,EAAE,CAAE,0BAA2B;MAAC,CACrB,CAAC;IAAA,CACb,CAAC;EAAA,CACA,CAAC;AAER","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -14,6 +13,9 @@ import { MoveToWidgetArea, getWidgetIdFromBlock } from '@wordpress/widgets';
|
|
|
14
13
|
import { useSidebarControls, useActiveSidebarControl } from '../components/sidebar-controls';
|
|
15
14
|
import { useFocusControl } from '../components/focus-control';
|
|
16
15
|
import { blockToWidget } from '../utils';
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
19
|
const withMoveToSidebarToolbarItem = createHigherOrderComponent(BlockEdit => props => {
|
|
18
20
|
let widgetId = getWidgetIdFromBlock(props);
|
|
19
21
|
const sidebarControls = useSidebarControls();
|
|
@@ -57,17 +59,21 @@ const withMoveToSidebarToolbarItem = createHigherOrderComponent(BlockEdit => pro
|
|
|
57
59
|
// Move focus to the moved widget and expand the sidebar.
|
|
58
60
|
focusWidget(widgetId);
|
|
59
61
|
}
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
63
|
+
children: [/*#__PURE__*/_jsx(BlockEdit, {
|
|
64
|
+
...props
|
|
65
|
+
}), hasMultipleSidebars && canInsertBlockInSidebar && /*#__PURE__*/_jsx(BlockControls, {
|
|
66
|
+
children: /*#__PURE__*/_jsx(MoveToWidgetArea, {
|
|
67
|
+
widgetAreas: sidebarControls.map(sidebarControl => ({
|
|
68
|
+
id: sidebarControl.id,
|
|
69
|
+
name: sidebarControl.params.label,
|
|
70
|
+
description: sidebarControl.params.description
|
|
71
|
+
})),
|
|
72
|
+
currentWidgetAreaId: activeSidebarControl?.id,
|
|
73
|
+
onSelect: moveToSidebar
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
71
77
|
}, 'withMoveToSidebarToolbarItem');
|
|
72
78
|
addFilter('editor.BlockEdit', 'core/customize-widgets/block-edit', withMoveToSidebarToolbarItem);
|
|
73
79
|
//# sourceMappingURL=move-to-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlockControls","store","blockEditorStore","createHigherOrderComponent","useSelect","useDispatch","addFilter","MoveToWidgetArea","getWidgetIdFromBlock","useSidebarControls","useActiveSidebarControl","useFocusControl","blockToWidget","withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","reverse","
|
|
1
|
+
{"version":3,"names":["BlockControls","store","blockEditorStore","createHigherOrderComponent","useSelect","useDispatch","addFilter","MoveToWidgetArea","getWidgetIdFromBlock","useSidebarControls","useActiveSidebarControl","useFocusControl","blockToWidget","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","withMoveToSidebarToolbarItem","BlockEdit","props","widgetId","sidebarControls","activeSidebarControl","hasMultipleSidebars","length","blockName","name","clientId","canInsertBlockInSidebar","select","canInsertBlockType","block","getBlock","removeBlock","focusWidget","moveToSidebar","sidebarControlId","newSidebarControl","find","sidebarControl","id","oldSetting","setting","newSetting","filter","sidebarAdapter","addedWidgetIds","setWidgets","getWidgets","reverse","children","widgetAreas","map","params","label","description","currentWidgetAreaId","onSelect"],"sources":["@wordpress/customize-widgets/src/filters/move-to-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { MoveToWidgetArea, getWidgetIdFromBlock } from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseSidebarControls,\n\tuseActiveSidebarControl,\n} from '../components/sidebar-controls';\nimport { useFocusControl } from '../components/focus-control';\nimport { blockToWidget } from '../utils';\n\nconst withMoveToSidebarToolbarItem = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tlet widgetId = getWidgetIdFromBlock( props );\n\t\tconst sidebarControls = useSidebarControls();\n\t\tconst activeSidebarControl = useActiveSidebarControl();\n\t\tconst hasMultipleSidebars = sidebarControls?.length > 1;\n\t\tconst blockName = props.name;\n\t\tconst clientId = props.clientId;\n\t\tconst canInsertBlockInSidebar = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// Use an empty string to represent the root block list, which\n\t\t\t\t// in the customizer editor represents a sidebar/widget area.\n\t\t\t\treturn select( blockEditorStore ).canInsertBlockType(\n\t\t\t\t\tblockName,\n\t\t\t\t\t''\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ blockName ]\n\t\t);\n\t\tconst block = useSelect(\n\t\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t\t[ clientId ]\n\t\t);\n\t\tconst { removeBlock } = useDispatch( blockEditorStore );\n\t\tconst [ , focusWidget ] = useFocusControl();\n\n\t\tfunction moveToSidebar( sidebarControlId ) {\n\t\t\tconst newSidebarControl = sidebarControls.find(\n\t\t\t\t( sidebarControl ) => sidebarControl.id === sidebarControlId\n\t\t\t);\n\n\t\t\tif ( widgetId ) {\n\t\t\t\t/**\n\t\t\t\t * If there's a widgetId, move it to the other sidebar.\n\t\t\t\t */\n\t\t\t\tconst oldSetting = activeSidebarControl.setting;\n\t\t\t\tconst newSetting = newSidebarControl.setting;\n\n\t\t\t\toldSetting( oldSetting().filter( ( id ) => id !== widgetId ) );\n\t\t\t\tnewSetting( [ ...newSetting(), widgetId ] );\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If there isn't a widgetId, it's most likely a inner block.\n\t\t\t\t * First, remove the block in the original sidebar,\n\t\t\t\t * then, create a new widget in the new sidebar and get back its widgetId.\n\t\t\t\t */\n\t\t\t\tconst sidebarAdapter = newSidebarControl.sidebarAdapter;\n\n\t\t\t\tremoveBlock( clientId );\n\t\t\t\tconst addedWidgetIds = sidebarAdapter.setWidgets( [\n\t\t\t\t\t...sidebarAdapter.getWidgets(),\n\t\t\t\t\tblockToWidget( block ),\n\t\t\t\t] );\n\t\t\t\t// The last non-null id is the added widget's id.\n\t\t\t\twidgetId = addedWidgetIds.reverse().find( ( id ) => !! id );\n\t\t\t}\n\n\t\t\t// Move focus to the moved widget and expand the sidebar.\n\t\t\tfocusWidget( widgetId );\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t\t{ hasMultipleSidebars && canInsertBlockInSidebar && (\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<MoveToWidgetArea\n\t\t\t\t\t\t\twidgetAreas={ sidebarControls.map(\n\t\t\t\t\t\t\t\t( sidebarControl ) => ( {\n\t\t\t\t\t\t\t\t\tid: sidebarControl.id,\n\t\t\t\t\t\t\t\t\tname: sidebarControl.params.label,\n\t\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\tsidebarControl.params.description,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcurrentWidgetAreaId={ activeSidebarControl?.id }\n\t\t\t\t\t\t\tonSelect={ moveToSidebar }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\t'withMoveToSidebarToolbarItem'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/block-edit',\n\twithMoveToSidebarToolbarItem\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,gBAAgB,EAAEC,oBAAoB,QAAQ,oBAAoB;;AAE3E;AACA;AACA;AACA,SACCC,kBAAkB,EAClBC,uBAAuB,QACjB,gCAAgC;AACvC,SAASC,eAAe,QAAQ,6BAA6B;AAC7D,SAASC,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ED/B,SAAS,CACR,kBAAkB,EAClB,mCAAmC,EACnCa,4BACD,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
5
4
|
import { createHigherOrderComponent } from '@wordpress/compose';
|
|
6
5
|
import { addFilter } from '@wordpress/hooks';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const {
|
|
8
8
|
wp
|
|
9
9
|
} = window;
|
|
@@ -13,7 +13,7 @@ const withWideWidgetDisplay = createHigherOrderComponent(BlockEdit => props => {
|
|
|
13
13
|
idBase
|
|
14
14
|
} = props.attributes;
|
|
15
15
|
const isWide = (_wp$customize$Widgets = wp.customize.Widgets.data.availableWidgets.find(widget => widget.id_base === idBase)?.is_wide) !== null && _wp$customize$Widgets !== void 0 ? _wp$customize$Widgets : false;
|
|
16
|
-
return
|
|
16
|
+
return /*#__PURE__*/_jsx(BlockEdit, {
|
|
17
17
|
...props,
|
|
18
18
|
isWide: isWide
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createHigherOrderComponent","addFilter","wp","window","withWideWidgetDisplay","BlockEdit","props","_wp$customize$Widgets","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide"
|
|
1
|
+
{"version":3,"names":["createHigherOrderComponent","addFilter","jsx","_jsx","wp","window","withWideWidgetDisplay","BlockEdit","props","_wp$customize$Widgets","idBase","attributes","isWide","customize","Widgets","data","availableWidgets","find","widget","id_base","is_wide"],"sources":["@wordpress/customize-widgets/src/filters/wide-widget-display.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\n\nconst { wp } = window;\n\nconst withWideWidgetDisplay = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { idBase } = props.attributes;\n\t\tconst isWide =\n\t\t\twp.customize.Widgets.data.availableWidgets.find(\n\t\t\t\t( widget ) => widget.id_base === idBase\n\t\t\t)?.is_wide ?? false;\n\n\t\treturn <BlockEdit { ...props } isWide={ isWide } />;\n\t},\n\t'withWideWidgetDisplay'\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/customize-widgets/wide-widget-display',\n\twithWideWidgetDisplay\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE7C,MAAM;EAAEC;AAAG,CAAC,GAAGC,MAAM;AAErB,MAAMC,qBAAqB,GAAGN,0BAA0B,CACrDO,SAAS,IAAQC,KAAK,IAAM;EAAA,IAAAC,qBAAA;EAC7B,MAAM;IAAEC;EAAO,CAAC,GAAGF,KAAK,CAACG,UAAU;EACnC,MAAMC,MAAM,IAAAH,qBAAA,GACXL,EAAE,CAACS,SAAS,CAACC,OAAO,CAACC,IAAI,CAACC,gBAAgB,CAACC,IAAI,CAC5CC,MAAM,IAAMA,MAAM,CAACC,OAAO,KAAKT,MAClC,CAAC,EAAEU,OAAO,cAAAX,qBAAA,cAAAA,qBAAA,GAAI,KAAK;EAEpB,oBAAON,IAAA,CAACI,SAAS;IAAA,GAAMC,KAAK;IAAGI,MAAM,EAAGA;EAAQ,CAAE,CAAC;AACpD,CAAC,EACD,uBACD,CAAC;AAEDX,SAAS,CACR,kBAAkB,EAClB,4CAA4C,EAC5CK,qBACD,CAAC","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
1
|
/**
|
|
3
2
|
* WordPress dependencies
|
|
4
3
|
*/
|
|
@@ -16,6 +15,7 @@ import CustomizeWidgets from './components/customize-widgets';
|
|
|
16
15
|
import getSidebarSection from './controls/sidebar-section';
|
|
17
16
|
import getSidebarControl from './controls/sidebar-control';
|
|
18
17
|
import './filters';
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
const {
|
|
20
20
|
wp
|
|
21
21
|
} = window;
|
|
@@ -39,7 +39,7 @@ export function initialize(editorName, blockEditorSettings) {
|
|
|
39
39
|
});
|
|
40
40
|
registerCoreBlocks(coreBlocks);
|
|
41
41
|
registerLegacyWidgetBlock();
|
|
42
|
-
if (
|
|
42
|
+
if (globalThis.IS_GUTENBERG_PLUGIN) {
|
|
43
43
|
__experimentalRegisterExperimentalCoreBlocks({
|
|
44
44
|
enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS
|
|
45
45
|
});
|
|
@@ -64,7 +64,7 @@ export function initialize(editorName, blockEditorSettings) {
|
|
|
64
64
|
sidebarControls.push(control);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
createRoot(container).render(
|
|
67
|
+
createRoot(container).render( /*#__PURE__*/_jsx(CustomizeWidgets, {
|
|
68
68
|
api: wp.customize,
|
|
69
69
|
sidebarControls: sidebarControls,
|
|
70
70
|
blockEditorSettings: blockEditorSettings
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","store","blocksStore","dispatch","preferencesStore","CustomizeWidgets","getSidebarSection","getSidebarControl","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","setDefaults","fixedToolbar","welcomeGuide","reapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","
|
|
1
|
+
{"version":3,"names":["createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","store","blocksStore","dispatch","preferencesStore","CustomizeWidgets","getSidebarSection","getSidebarControl","jsx","_jsx","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","setDefaults","fixedToolbar","welcomeGuide","reapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","SidebarControl","customize","sectionConstructor","sidebar","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","render","api"],"sources":["@wordpress/customize-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport CustomizeWidgets from './components/customize-widgets';\nimport getSidebarSection from './controls/sidebar-section';\nimport getSidebarControl from './controls/sidebar-control';\nimport './filters';\n\nconst { wp } = window;\n\nconst DISABLED_BLOCKS = [\n\t'core/more',\n\t'core/block',\n\t'core/freeform',\n\t'core/template-part',\n];\nconst ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n\n/**\n * Initializes the widgets block editor in the customizer.\n *\n * @param {string} editorName The editor name.\n * @param {Object} blockEditorSettings Block editor settings.\n */\nexport function initialize( editorName, blockEditorSettings ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/customize-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tDISABLED_BLOCKS.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( blockEditorSettings );\n\tregisterWidgetGroupBlock();\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\tconst SidebarControl = getSidebarControl( blockEditorSettings );\n\n\twp.customize.sectionConstructor.sidebar = getSidebarSection();\n\twp.customize.controlConstructor.sidebar_block_editor = SidebarControl;\n\n\tconst container = document.createElement( 'div' );\n\tdocument.body.appendChild( container );\n\n\twp.customize.bind( 'ready', () => {\n\t\tconst sidebarControls = [];\n\t\twp.customize.control.each( ( control ) => {\n\t\t\tif ( control instanceof SidebarControl ) {\n\t\t\t\tsidebarControls.push( control );\n\t\t\t}\n\t\t} );\n\n\t\tcreateRoot( container ).render(\n\t\t\t<CustomizeWidgets\n\t\t\t\tapi={ wp.customize }\n\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t/>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SACCC,kBAAkB,EAClBC,2BAA2B,EA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6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Widgets blocks in Customizer Module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -17,33 +17,34 @@
|
|
|
17
17
|
"url": "https://github.com/WordPress/gutenberg/issues"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=12"
|
|
20
|
+
"node": ">=18.12.0",
|
|
21
|
+
"npm": ">=8.19.2"
|
|
21
22
|
},
|
|
22
23
|
"main": "build/index.js",
|
|
23
24
|
"module": "build-module/index.js",
|
|
24
25
|
"react-native": "src/index",
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@babel/runtime": "^7.16.0",
|
|
27
|
-
"@wordpress/block-editor": "^
|
|
28
|
-
"@wordpress/block-library": "^
|
|
29
|
-
"@wordpress/blocks": "^
|
|
30
|
-
"@wordpress/components": "^
|
|
31
|
-
"@wordpress/compose": "^
|
|
32
|
-
"@wordpress/core-data": "^
|
|
33
|
-
"@wordpress/data": "^
|
|
34
|
-
"@wordpress/dom": "^
|
|
35
|
-
"@wordpress/element": "^
|
|
36
|
-
"@wordpress/hooks": "^
|
|
37
|
-
"@wordpress/i18n": "^
|
|
38
|
-
"@wordpress/icons": "^
|
|
39
|
-
"@wordpress/interface": "^
|
|
40
|
-
"@wordpress/is-shallow-equal": "^
|
|
41
|
-
"@wordpress/keyboard-shortcuts": "^
|
|
42
|
-
"@wordpress/keycodes": "^
|
|
43
|
-
"@wordpress/media-utils": "^
|
|
44
|
-
"@wordpress/preferences": "^
|
|
45
|
-
"@wordpress/private-apis": "^0.
|
|
46
|
-
"@wordpress/widgets": "^
|
|
28
|
+
"@wordpress/block-editor": "^13.0.0",
|
|
29
|
+
"@wordpress/block-library": "^9.0.0",
|
|
30
|
+
"@wordpress/blocks": "^13.0.0",
|
|
31
|
+
"@wordpress/components": "^28.0.0",
|
|
32
|
+
"@wordpress/compose": "^7.0.0",
|
|
33
|
+
"@wordpress/core-data": "^7.0.0",
|
|
34
|
+
"@wordpress/data": "^10.0.0",
|
|
35
|
+
"@wordpress/dom": "^4.0.0",
|
|
36
|
+
"@wordpress/element": "^6.0.0",
|
|
37
|
+
"@wordpress/hooks": "^4.0.0",
|
|
38
|
+
"@wordpress/i18n": "^5.0.0",
|
|
39
|
+
"@wordpress/icons": "^10.0.0",
|
|
40
|
+
"@wordpress/interface": "^6.0.0",
|
|
41
|
+
"@wordpress/is-shallow-equal": "^5.0.0",
|
|
42
|
+
"@wordpress/keyboard-shortcuts": "^5.0.0",
|
|
43
|
+
"@wordpress/keycodes": "^4.0.0",
|
|
44
|
+
"@wordpress/media-utils": "^5.0.0",
|
|
45
|
+
"@wordpress/preferences": "^4.0.0",
|
|
46
|
+
"@wordpress/private-apis": "^1.0.0",
|
|
47
|
+
"@wordpress/widgets": "^4.0.0",
|
|
47
48
|
"clsx": "^2.1.1",
|
|
48
49
|
"fast-deep-equal": "^3.1.3"
|
|
49
50
|
},
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"publishConfig": {
|
|
55
56
|
"access": "public"
|
|
56
57
|
},
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "2f30cddff15723ac7017fd009fc5913b7b419400"
|
|
58
59
|
}
|
package/src/index.js
CHANGED
|
@@ -61,7 +61,7 @@ export function initialize( editorName, blockEditorSettings ) {
|
|
|
61
61
|
} );
|
|
62
62
|
registerCoreBlocks( coreBlocks );
|
|
63
63
|
registerLegacyWidgetBlock();
|
|
64
|
-
if (
|
|
64
|
+
if ( globalThis.IS_GUTENBERG_PLUGIN ) {
|
|
65
65
|
__experimentalRegisterExperimentalCoreBlocks( {
|
|
66
66
|
enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,
|
|
67
67
|
} );
|