@wordpress/edit-widgets 7.2.0 → 7.3.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/build/blocks/widget-area/edit/index.cjs +10 -8
- package/build/blocks/widget-area/edit/index.cjs.map +1 -1
- package/build/blocks/widget-area/edit/inner-blocks.cjs +10 -8
- package/build/blocks/widget-area/edit/inner-blocks.cjs.map +1 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.cjs.map +1 -1
- package/build/blocks/widget-area/index.cjs +9 -7
- package/build/blocks/widget-area/index.cjs.map +1 -1
- package/build/components/error-boundary/index.cjs.map +1 -1
- package/build/components/header/document-tools/index.cjs +20 -10
- package/build/components/header/document-tools/index.cjs.map +1 -1
- package/build/components/header/index.cjs +12 -10
- package/build/components/header/index.cjs.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.cjs +5 -0
- package/build/components/keyboard-shortcut-help-modal/config.cjs.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs +9 -7
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.cjs.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.cjs +12 -11
- package/build/components/keyboard-shortcut-help-modal/index.cjs.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs +34 -13
- package/build/components/keyboard-shortcut-help-modal/shortcut.cjs.map +1 -1
- package/build/components/keyboard-shortcuts/index.cjs.map +1 -1
- package/build/components/layout/index.cjs +19 -13
- package/build/components/layout/index.cjs.map +1 -1
- package/build/components/layout/interface.cjs +27 -13
- package/build/components/layout/interface.cjs.map +1 -1
- package/build/components/layout/unsaved-changes-warning.cjs.map +1 -1
- package/build/components/more-menu/index.cjs +14 -9
- package/build/components/more-menu/index.cjs.map +1 -1
- package/build/components/secondary-sidebar/index.cjs +10 -8
- package/build/components/secondary-sidebar/index.cjs.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.cjs +9 -7
- package/build/components/secondary-sidebar/inserter-sidebar.cjs.map +1 -1
- package/build/components/sidebar/index.cjs +23 -15
- package/build/components/sidebar/index.cjs.map +1 -1
- package/build/components/welcome-guide/index.cjs +5 -1
- package/build/components/welcome-guide/index.cjs.map +1 -1
- package/build/components/widget-areas-block-editor-content/index.cjs +10 -8
- package/build/components/widget-areas-block-editor-content/index.cjs.map +1 -1
- package/build/components/widget-areas-block-editor-provider/index.cjs +10 -8
- package/build/components/widget-areas-block-editor-provider/index.cjs.map +1 -1
- package/build/constants.cjs +0 -2
- package/build/constants.cjs.map +1 -1
- package/build/index.cjs +12 -10
- package/build/index.cjs.map +1 -1
- package/build/store/actions.cjs +11 -7
- package/build/store/actions.cjs.map +1 -1
- package/build/store/index.cjs +14 -12
- package/build/store/index.cjs.map +1 -1
- package/build/store/selectors.cjs +3 -1
- package/build/store/selectors.cjs.map +1 -1
- package/build-module/blocks/widget-area/index.mjs.map +1 -1
- package/build-module/components/header/document-tools/index.mjs +10 -2
- package/build-module/components/header/document-tools/index.mjs.map +1 -1
- package/build-module/components/header/undo-redo/redo.mjs.map +1 -1
- package/build-module/components/header/undo-redo/undo.mjs.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs +5 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.mjs.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.mjs.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs +34 -13
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs.map +1 -1
- package/build-module/components/layout/index.mjs +5 -1
- package/build-module/components/layout/index.mjs.map +1 -1
- package/build-module/components/layout/interface.mjs +16 -4
- package/build-module/components/layout/interface.mjs.map +1 -1
- package/build-module/components/more-menu/index.mjs +4 -1
- package/build-module/components/more-menu/index.mjs.map +1 -1
- package/build-module/components/sidebar/index.mjs +14 -8
- package/build-module/components/sidebar/index.mjs.map +1 -1
- package/build-module/components/welcome-guide/index.mjs +5 -1
- package/build-module/components/welcome-guide/index.mjs.map +1 -1
- package/build-module/constants.mjs +1 -2
- package/build-module/constants.mjs.map +1 -1
- package/build-module/index.mjs +2 -2
- package/build-module/index.mjs.map +1 -1
- package/build-module/store/actions.mjs +11 -7
- package/build-module/store/actions.mjs.map +1 -1
- package/build-module/store/selectors.mjs +3 -1
- package/build-module/store/selectors.mjs.map +1 -1
- package/build-style/style-rtl.css +42 -37
- package/build-style/style.css +42 -37
- package/build-types/blocks/widget-area/edit/index.d.ts +10 -0
- package/build-types/blocks/widget-area/edit/index.d.ts.map +1 -0
- package/build-types/blocks/widget-area/edit/inner-blocks.d.ts +4 -0
- package/build-types/blocks/widget-area/edit/inner-blocks.d.ts.map +1 -0
- package/build-types/blocks/widget-area/edit/use-is-dragging-within.d.ts +12 -0
- package/build-types/blocks/widget-area/edit/use-is-dragging-within.d.ts.map +1 -0
- package/build-types/blocks/widget-area/index.d.ts +14 -0
- package/build-types/blocks/widget-area/index.d.ts.map +1 -0
- package/build-types/components/error-boundary/index.d.ts +14 -0
- package/build-types/components/error-boundary/index.d.ts.map +1 -0
- package/build-types/components/header/document-tools/index.d.ts +3 -0
- package/build-types/components/header/document-tools/index.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts +3 -0
- package/build-types/components/header/index.d.ts.map +1 -0
- package/build-types/components/header/undo-redo/redo.d.ts +3 -0
- package/build-types/components/header/undo-redo/redo.d.ts.map +1 -0
- package/build-types/components/header/undo-redo/undo.d.ts +3 -0
- package/build-types/components/header/undo-redo/undo.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +3 -0
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
- package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +5 -0
- package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +25 -0
- package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
- package/build-types/components/keyboard-shortcuts/index.d.ts +7 -0
- package/build-types/components/keyboard-shortcuts/index.d.ts.map +1 -0
- package/build-types/components/layout/index.d.ts +5 -0
- package/build-types/components/layout/index.d.ts.map +1 -0
- package/build-types/components/layout/interface.d.ts +5 -0
- package/build-types/components/layout/interface.d.ts.map +1 -0
- package/build-types/components/layout/unsaved-changes-warning.d.ts +10 -0
- package/build-types/components/layout/unsaved-changes-warning.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts +2 -0
- package/build-types/components/more-menu/index.d.ts.map +1 -0
- package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
- package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
- package/build-types/components/notices/index.d.ts +3 -0
- package/build-types/components/notices/index.d.ts.map +1 -0
- package/build-types/components/save-button/index.d.ts +3 -0
- package/build-types/components/save-button/index.d.ts.map +1 -0
- package/build-types/components/secondary-sidebar/index.d.ts +2 -0
- package/build-types/components/secondary-sidebar/index.d.ts.map +1 -0
- package/build-types/components/secondary-sidebar/inserter-sidebar.d.ts +2 -0
- package/build-types/components/secondary-sidebar/inserter-sidebar.d.ts.map +1 -0
- package/build-types/components/secondary-sidebar/list-view-sidebar.d.ts +2 -0
- package/build-types/components/secondary-sidebar/list-view-sidebar.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts +2 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -0
- package/build-types/components/sidebar/widget-areas.d.ts +4 -0
- package/build-types/components/sidebar/widget-areas.d.ts.map +1 -0
- package/build-types/components/welcome-guide/index.d.ts +2 -0
- package/build-types/components/welcome-guide/index.d.ts.map +1 -0
- package/build-types/components/widget-areas-block-editor-content/index.d.ts +4 -0
- package/build-types/components/widget-areas-block-editor-content/index.d.ts.map +1 -0
- package/build-types/components/widget-areas-block-editor-provider/index.d.ts +6 -0
- package/build-types/components/widget-areas-block-editor-provider/index.d.ts.map +1 -0
- package/build-types/constants.d.ts +2 -0
- package/build-types/constants.d.ts.map +1 -0
- package/build-types/filters/index.d.ts +3 -0
- package/build-types/filters/index.d.ts.map +1 -0
- package/build-types/filters/move-to-widget-area.d.ts +2 -0
- package/build-types/filters/move-to-widget-area.d.ts.map +1 -0
- package/build-types/filters/replace-media-upload.d.ts +2 -0
- package/build-types/filters/replace-media-upload.d.ts.map +1 -0
- package/build-types/hooks/use-last-selected-widget-area.d.ts +9 -0
- package/build-types/hooks/use-last-selected-widget-area.d.ts.map +1 -0
- package/build-types/hooks/use-widget-library-insertion-point.d.ts +3 -0
- package/build-types/hooks/use-widget-library-insertion-point.d.ts.map +1 -0
- package/build-types/index.d.ts +16 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/store/actions.d.ts +144 -0
- package/build-types/store/actions.d.ts.map +1 -0
- package/build-types/store/constants.d.ts +5 -0
- package/build-types/store/constants.d.ts.map +1 -0
- package/build-types/store/index.d.ts +9 -0
- package/build-types/store/index.d.ts.map +1 -0
- package/build-types/store/private-selectors.d.ts +3 -0
- package/build-types/store/private-selectors.d.ts.map +1 -0
- package/build-types/store/reducer.d.ts +73 -0
- package/build-types/store/reducer.d.ts.map +1 -0
- package/build-types/store/resolvers.d.ts +17 -0
- package/build-types/store/resolvers.d.ts.map +1 -0
- package/build-types/store/selectors.d.ts +159 -0
- package/build-types/store/selectors.d.ts.map +1 -0
- package/build-types/store/transformers.d.ts +16 -0
- package/build-types/store/transformers.d.ts.map +1 -0
- package/build-types/store/utils.d.ts +53 -0
- package/build-types/store/utils.d.ts.map +1 -0
- package/package.json +33 -33
- package/src/components/header/style.scss +1 -1
- package/src/components/keyboard-shortcut-help-modal/config.js +3 -0
- package/src/components/keyboard-shortcut-help-modal/index.jsx +0 -2
- package/src/components/keyboard-shortcut-help-modal/shortcut.jsx +43 -29
- package/src/components/sidebar/index.jsx +1 -1
- package/src/components/sidebar/style.scss +6 -0
- package/src/components/welcome-guide/style.scss +1 -1
- package/src/components/widget-areas-block-editor-content/style.scss +1 -1
- package/src/constants.js +0 -1
- package/src/index.jsx +2 -7
- package/src/store/actions.js +8 -12
- package/src/store/selectors.js +4 -1
- package/src/store/test/actions.jsdom.test.js +47 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-widget-library-insertion-point.d.ts","sourceRoot":"","sources":["../../src/hooks/use-widget-library-insertion-point.js"],"names":[],"mappings":"AAMA,QAAA,MAAM,8BAA8B,WAkDnC,CAAC;eAEa,8BAA8B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import './store';
|
|
2
|
+
import './filters';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes the block editor in the widgets screen.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} id ID of the root element to render the screen in.
|
|
7
|
+
* @param {Object} settings Block editor settings.
|
|
8
|
+
*/
|
|
9
|
+
export declare function initializeEditor(id: string, settings: Object): import("react-dom/client").Root;
|
|
10
|
+
/**
|
|
11
|
+
* Compatibility export under the old `initialize` name.
|
|
12
|
+
*/
|
|
13
|
+
export declare const initialize: typeof initializeEditor;
|
|
14
|
+
export declare function reinitializeEditor(): void;
|
|
15
|
+
export { store } from './store';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.jsx"],"names":[],"mappings":"AAqBA,OAAO,SAAS,CAAC;AACjB,OAAO,WAAW,CAAC;AAYnB;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,EAAE,EAHzB,MAGyB,EAAE,QAAQ,EAFnC,MAEmC,mCAgD7C;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,yBAAmB,CAAC;AAE3C,wBAAgB,kBAAkB,SAKjC;AAkBD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-unlock.d.ts","sourceRoot":"","sources":["../src/lock-unlock.js"],"names":[],"mappings":"AAEA,eAAO,MAAQ,IAAI,mDAAE,MAAM,iCAIzB,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persists a stub post with given ID to core data store. The post is meant to be in-memory only and
|
|
3
|
+
* shouldn't be saved via the API.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} id Post ID.
|
|
6
|
+
* @param {Array} blocks Blocks the post should consist of.
|
|
7
|
+
* @return {Object} The post object.
|
|
8
|
+
*/
|
|
9
|
+
export declare const persistStubPost: (id: string, blocks: any[]) => Object;
|
|
10
|
+
/**
|
|
11
|
+
* Converts all the blocks from edited widget areas into widgets,
|
|
12
|
+
* and submits a batch request to save everything at once.
|
|
13
|
+
*
|
|
14
|
+
* Creates a snackbar notice on either success or error.
|
|
15
|
+
*
|
|
16
|
+
* @return {Function} An action creator.
|
|
17
|
+
*/
|
|
18
|
+
export declare const saveEditedWidgetAreas: () => Function;
|
|
19
|
+
/**
|
|
20
|
+
* Converts all the blocks from specified widget areas into widgets,
|
|
21
|
+
* and submits a batch request to save everything at once.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object[]} widgetAreas Widget areas to save.
|
|
24
|
+
* @return {Function} An action creator.
|
|
25
|
+
*/
|
|
26
|
+
export declare const saveWidgetAreas: (widgetAreas: Object[]) => Function;
|
|
27
|
+
/**
|
|
28
|
+
* Converts all the blocks from a widget area specified by ID into widgets,
|
|
29
|
+
* and submits a batch request to save everything at once.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} widgetAreaId ID of the widget area to process.
|
|
32
|
+
* @return {Function} An action creator.
|
|
33
|
+
*/
|
|
34
|
+
export declare const saveWidgetArea: (widgetAreaId: string) => Function;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the clientId stored for a particular widgetId.
|
|
37
|
+
*
|
|
38
|
+
* @param {number} clientId Client id.
|
|
39
|
+
* @param {number} widgetId Widget id.
|
|
40
|
+
*
|
|
41
|
+
* @return {Object} Action.
|
|
42
|
+
*/
|
|
43
|
+
export declare function setWidgetIdForClientId(clientId: number, widgetId: number): Object;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the open state of all the widget areas.
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} widgetAreasOpenState The open states of all the widget areas.
|
|
48
|
+
*
|
|
49
|
+
* @return {Object} Action.
|
|
50
|
+
*/
|
|
51
|
+
export declare function setWidgetAreasOpenState(widgetAreasOpenState: Object): Object;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the open state of the widget area.
|
|
54
|
+
*
|
|
55
|
+
* @param {string} clientId The clientId of the widget area.
|
|
56
|
+
* @param {boolean} isOpen Whether the widget area should be opened.
|
|
57
|
+
*
|
|
58
|
+
* @return {Object} Action.
|
|
59
|
+
*/
|
|
60
|
+
export declare function setIsWidgetAreaOpen(clientId: string, isOpen: boolean): Object;
|
|
61
|
+
/**
|
|
62
|
+
* Returns an action object used to open/close the inserter.
|
|
63
|
+
*
|
|
64
|
+
* @param {boolean|Object} value Whether the inserter should be
|
|
65
|
+
* opened (true) or closed (false).
|
|
66
|
+
* To specify an insertion point,
|
|
67
|
+
* use an object.
|
|
68
|
+
* @param {string} value.rootClientId The root client ID to insert at.
|
|
69
|
+
* @param {number} value.insertionIndex The index to insert at.
|
|
70
|
+
*
|
|
71
|
+
* @return {Object} Action object.
|
|
72
|
+
*/
|
|
73
|
+
export declare function setIsInserterOpened(value: boolean | Object): Object;
|
|
74
|
+
/**
|
|
75
|
+
* Returns an action object used to open/close the list view.
|
|
76
|
+
*
|
|
77
|
+
* @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.
|
|
78
|
+
* @return {Object} Action object.
|
|
79
|
+
*/
|
|
80
|
+
export declare function setIsListViewOpened(isOpen: boolean): Object;
|
|
81
|
+
/**
|
|
82
|
+
* Returns an action object signalling that the user closed the sidebar.
|
|
83
|
+
*
|
|
84
|
+
* @return {Object} Action creator.
|
|
85
|
+
*/
|
|
86
|
+
export declare const closeGeneralSidebar: () => Object;
|
|
87
|
+
/**
|
|
88
|
+
* Action that handles moving a block between widget areas
|
|
89
|
+
*
|
|
90
|
+
* @param {string} clientId The clientId of the block to move.
|
|
91
|
+
* @param {string} widgetAreaId The id of the widget area to move the block to.
|
|
92
|
+
*/
|
|
93
|
+
export declare const moveBlockToWidgetArea: (clientId: string, widgetAreaId: string) => ({ dispatch, select, registry }: {
|
|
94
|
+
dispatch: any;
|
|
95
|
+
registry: any;
|
|
96
|
+
select: any;
|
|
97
|
+
}) => Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Returns an action object used to signal that widget saving is unlocked.
|
|
100
|
+
*
|
|
101
|
+
* @param {string} lockName The lock name.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```js
|
|
105
|
+
* import { store as widgetStore } from '@wordpress/edit-widgets';
|
|
106
|
+
* import { useDispatch } from '@wordpress/data';
|
|
107
|
+
*
|
|
108
|
+
* const ExampleComponent = () => {
|
|
109
|
+
* const { unlockWidgetSaving } = useDispatch( widgetStore );
|
|
110
|
+
* return (
|
|
111
|
+
* <Button onClick={ () => unlockWidgetSaving( 'lockName' ) }>
|
|
112
|
+
* { __( 'Unlock Widget Saving' ) }
|
|
113
|
+
* </Button>
|
|
114
|
+
* );
|
|
115
|
+
* };
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @return {Object} Action object
|
|
119
|
+
*/
|
|
120
|
+
export declare function unlockWidgetSaving(lockName: string): Object;
|
|
121
|
+
/**
|
|
122
|
+
* Returns an action object used to signal that widget saving is locked.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} lockName The lock name.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```js
|
|
128
|
+
* import { store as widgetStore } from '@wordpress/edit-widgets';
|
|
129
|
+
* import { useDispatch } from '@wordpress/data';
|
|
130
|
+
*
|
|
131
|
+
* const ExampleComponent = () => {
|
|
132
|
+
* const { lockWidgetSaving } = useDispatch( widgetStore );
|
|
133
|
+
* return (
|
|
134
|
+
* <Button onClick={ () => lockWidgetSaving( 'lockName' ) }>
|
|
135
|
+
* { __( 'Lock Widget Saving' ) }
|
|
136
|
+
* </Button>
|
|
137
|
+
* );
|
|
138
|
+
* };
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* @return {Object} Action object
|
|
142
|
+
*/
|
|
143
|
+
export declare function lockWidgetSaving(lockName: string): Object;
|
|
144
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.js"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,OAJjB,MAAM,oBAEL,MAgBV,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,gBAuBhC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,gBAHjB,MAAM,EAAE,aAqBjB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,iBAHhB,MAAM,aAwMf,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAE,QAAQ,EALrC,MAKqC,EAAE,QAAQ,EAJ/C,MAI+C,GAF9C,MAAM,CAQjB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAE,oBAAoB,EAJlD,MAIkD,GAFjD,MAAM,CAOjB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAE,QAAQ,EALlC,MAKkC,EAAE,MAAM,EAJ1C,OAI0C,GAFzC,MAAM,CAQjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAE,KAAK,EAT/B,OAAO,GAAC,MASuB,GAF9B,MAAM,CAOjB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAE,MAAM,EAHhC,OAGgC,GAF/B,MAAM,CAOjB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAFpB,MAQV,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,aAHvB,MAAM,gBACN,MAAM;;;;mBA0Cf,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAAE,QAAQ,EAnBjC,MAmBiC,GAFhC,MAAM,CAOjB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAE,QAAQ,EAnB/B,MAmB+B,GAF9B,MAAM,CAOjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/store/constants.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.js"],"names":[],"mappings":"AAwBA;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAFR,MAEsD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../src/store/private-selectors.js"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAE,KAAK,KAAA,OAE1C;AAED,wBAAgB,2BAA2B,CAAE,KAAK,KAAA,OAEjD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controls the open state of the widget areas.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} state Redux state.
|
|
5
|
+
* @param {Object} action Redux action.
|
|
6
|
+
*
|
|
7
|
+
* @return {Array} Updated state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function widgetAreasOpenState(state: Object | undefined, action: Object): any[];
|
|
10
|
+
/**
|
|
11
|
+
* Reducer to set the block inserter panel open or closed.
|
|
12
|
+
*
|
|
13
|
+
* Note: this reducer interacts with the list view panel reducer
|
|
14
|
+
* to make sure that only one of the two panels is open at the same time.
|
|
15
|
+
*
|
|
16
|
+
* @param {Object} state Current state.
|
|
17
|
+
* @param {Object} action Dispatched action.
|
|
18
|
+
*/
|
|
19
|
+
export declare function blockInserterPanel(state: Object | undefined, action: Object): any;
|
|
20
|
+
/**
|
|
21
|
+
* Reducer to set the list view panel open or closed.
|
|
22
|
+
*
|
|
23
|
+
* Note: this reducer interacts with the inserter panel reducer
|
|
24
|
+
* to make sure that only one of the two panels is open at the same time.
|
|
25
|
+
*
|
|
26
|
+
* @param {Object} state Current state.
|
|
27
|
+
* @param {Object} action Dispatched action.
|
|
28
|
+
*/
|
|
29
|
+
export declare function listViewPanel(state: Object | undefined, action: Object): any;
|
|
30
|
+
/**
|
|
31
|
+
* This reducer does nothing aside initializing a ref to the list view toggle.
|
|
32
|
+
* We will have a unique ref per "editor" instance.
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} state
|
|
35
|
+
* @return {Object} Reference to the list view toggle button.
|
|
36
|
+
*/
|
|
37
|
+
export declare function listViewToggleRef(state?: Object): Object;
|
|
38
|
+
/**
|
|
39
|
+
* This reducer does nothing aside initializing a ref to the inserter sidebar toggle.
|
|
40
|
+
* We will have a unique ref per "editor" instance.
|
|
41
|
+
*
|
|
42
|
+
* @param {Object} state
|
|
43
|
+
* @return {Object} Reference to the inserter sidebar toggle button.
|
|
44
|
+
*/
|
|
45
|
+
export declare function inserterSidebarToggleRef(state?: Object): Object;
|
|
46
|
+
/**
|
|
47
|
+
* Widget saving lock.
|
|
48
|
+
*
|
|
49
|
+
* When widget saving is locked, the widget cannot be updated.
|
|
50
|
+
*
|
|
51
|
+
* @param {Object} state Current state.
|
|
52
|
+
* @param {Object} action Dispatched action.
|
|
53
|
+
*
|
|
54
|
+
* @return {Object} Updated state.
|
|
55
|
+
*/
|
|
56
|
+
export declare function widgetSavingLock(state: Object | undefined, action: Object): Object;
|
|
57
|
+
declare const _default: import("redux").Reducer<{
|
|
58
|
+
blockInserterPanel: typeof blockInserterPanel;
|
|
59
|
+
inserterSidebarToggleRef: Object;
|
|
60
|
+
listViewPanel: typeof listViewPanel;
|
|
61
|
+
listViewToggleRef: Object;
|
|
62
|
+
widgetAreasOpenState: any[];
|
|
63
|
+
widgetSavingLock: Object;
|
|
64
|
+
}, import("redux").Action<string>, Partial<{
|
|
65
|
+
blockInserterPanel: Object | undefined;
|
|
66
|
+
inserterSidebarToggleRef: Object | undefined;
|
|
67
|
+
listViewPanel: Object | undefined;
|
|
68
|
+
listViewToggleRef: Object | undefined;
|
|
69
|
+
widgetAreasOpenState: Object | undefined;
|
|
70
|
+
widgetSavingLock: Object | undefined;
|
|
71
|
+
}>>;
|
|
72
|
+
export default _default;
|
|
73
|
+
//# sourceMappingURL=reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAE,KAAK,EALhC,MAAM,YAK+B,EAAE,MAAM,EAJ7C,MAI6C,SAiBvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,KAAK,EAH9B,MAAM,YAGgC,EAAE,MAAM,EAF9C,MAE8C,OAQxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAE,KAAK,EAHzB,MAAM,YAG2B,EAAE,MAAM,EAFzC,MAEyC,OAQnD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAE,KAAK,GAH7B,MAGiD,GAFhD,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAE,KAAK,GAHpC,MAGwD,GAFvD,MAAM,CAIjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAL5B,MAAM,YAK2B,EAAE,MAAM,EAJzC,MAIyC,GAFxC,MAAM,CAejB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a "stub" widgets post reflecting all available widget areas. The
|
|
3
|
+
* post is meant as a convenient to only exists in runtime and should never be saved. It
|
|
4
|
+
* enables a convenient way of editing the widgets by using a regular post editor.
|
|
5
|
+
*
|
|
6
|
+
* Fetches all widgets from all widgets aras, converts them into blocks, and hydrates a new post with them.
|
|
7
|
+
*
|
|
8
|
+
* @return {Function} An action creator.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getWidgetAreas: () => Function;
|
|
11
|
+
/**
|
|
12
|
+
* Fetches all widgets from all widgets ares, and groups them by widget area Id.
|
|
13
|
+
*
|
|
14
|
+
* @return {Function} An action creator.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getWidgets: () => Function;
|
|
17
|
+
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../src/store/resolvers.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,gBAgDzB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBA4BrB,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export type Block = import('@wordpress/blocks').Block;
|
|
2
|
+
/**
|
|
3
|
+
* Returns all API widgets.
|
|
4
|
+
*
|
|
5
|
+
* @return {Object[]} API List of widgets.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getWidgets: {
|
|
8
|
+
(): Partial<import("@wordpress/core-data").UnstableBase<any>> | Partial<import("@wordpress/core-data").Block<any>> | Partial<import("@wordpress/core-data").Comment<any>> | Partial<import("@wordpress/core-data").FontCollection<any>> | Partial<import("@wordpress/core-data").GlobalStyles<any>> | Partial<import("@wordpress/core-data").GlobalStylesRevision<any>> | Partial<import("@wordpress/core-data").Icon<any>> | Partial<import("@wordpress/core-data").IconCollection<any>> | Partial<import("@wordpress/core-data").MenuLocation<any>> | Partial<import("@wordpress/core-data").NavMenu<any>> | Partial<import("@wordpress/core-data").NavMenuItem<any>> | Partial<import("@wordpress/core-data").Navigation<any>> | Partial<import("@wordpress/core-data").Plugin<any>> | Partial<import("@wordpress/core-data").PostRevision<any>> | Partial<import("@wordpress/core-data").PostStatusObject<any>> | Partial<import("@wordpress/core-data").Settings<any>> | Partial<import("@wordpress/core-data").Sidebar<any>> | Partial<import("@wordpress/core-data").Taxonomy<any>> | Partial<import("@wordpress/core-data").Term<any>> | Partial<import("@wordpress/core-data").Theme<any>> | Partial<import("@wordpress/core-data").Type<any>> | Partial<import("@wordpress/core-data").User<any>> | Partial<import("@wordpress/core-data").Widget<any>> | Partial<import("@wordpress/core-data").WidgetType<any>> | Partial<import("@wordpress/core-data").WpFontFamily<any>> | Partial<import("@wordpress/core-data").WpTemplate<any>> | Partial<import("@wordpress/core-data").WpTemplatePart<any>> | Partial<import("@wordpress/core-data").OmitNevers<import("@wordpress/core-data").BaseEntityRecords.Attachment<any>> & Record<never, never>>;
|
|
9
|
+
isRegistrySelector?: boolean;
|
|
10
|
+
registry?: any;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Returns API widget data for a particular widget ID.
|
|
14
|
+
*
|
|
15
|
+
* @param {number} id Widget ID.
|
|
16
|
+
*
|
|
17
|
+
* @return {Object} API widget data for a particular widget ID.
|
|
18
|
+
*/
|
|
19
|
+
export declare const getWidget: {
|
|
20
|
+
(state: any, id: any): any;
|
|
21
|
+
isRegistrySelector?: boolean;
|
|
22
|
+
registry?: any;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Returns all API widget areas.
|
|
26
|
+
*
|
|
27
|
+
* @return {Object[]} API List of widget areas.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getWidgetAreas: {
|
|
30
|
+
(): (import("@wordpress/core-data").UnstableBase<any> | import("@wordpress/core-data").Block<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").FontCollection<any> | import("@wordpress/core-data").GlobalStyles<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").Icon<any> | import("@wordpress/core-data").IconCollection<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Navigation<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").PostStatusObject<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Term<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpFontFamily<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any> | import("@wordpress/core-data").Attachment<any> | Partial<import("@wordpress/core-data").UnstableBase<any> | import("@wordpress/core-data").Block<any> | import("@wordpress/core-data").Comment<any> | import("@wordpress/core-data").FontCollection<any> | import("@wordpress/core-data").GlobalStyles<any> | import("@wordpress/core-data").GlobalStylesRevision<any> | import("@wordpress/core-data").Icon<any> | import("@wordpress/core-data").IconCollection<any> | import("@wordpress/core-data").MenuLocation<any> | import("@wordpress/core-data").NavMenu<any> | import("@wordpress/core-data").NavMenuItem<any> | import("@wordpress/core-data").Navigation<any> | import("@wordpress/core-data").Page<any> | import("@wordpress/core-data").Plugin<any> | import("@wordpress/core-data").Post<any> | import("@wordpress/core-data").PostRevision<any> | import("@wordpress/core-data").PostStatusObject<any> | import("@wordpress/core-data").Settings<any> | import("@wordpress/core-data").Sidebar<any> | import("@wordpress/core-data").Taxonomy<any> | import("@wordpress/core-data").Term<any> | import("@wordpress/core-data").Theme<any> | import("@wordpress/core-data").Type<any> | import("@wordpress/core-data").User<any> | import("@wordpress/core-data").Widget<any> | import("@wordpress/core-data").WidgetType<any> | import("@wordpress/core-data").WpFontFamily<any> | import("@wordpress/core-data").WpTemplate<any> | import("@wordpress/core-data").WpTemplatePart<any> | import("@wordpress/core-data").Attachment<any>>)[] | null;
|
|
31
|
+
isRegistrySelector?: boolean;
|
|
32
|
+
registry?: any;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Returns widgetArea containing a block identify by given widgetId
|
|
36
|
+
*
|
|
37
|
+
* @param {string} widgetId The ID of the widget.
|
|
38
|
+
* @return {Object} Containing widget area.
|
|
39
|
+
*/
|
|
40
|
+
export declare const getWidgetAreaForWidgetId: {
|
|
41
|
+
(state: any, widgetId: any): any;
|
|
42
|
+
isRegistrySelector?: boolean;
|
|
43
|
+
registry?: any;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Given a child client id, returns the parent widget area block.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} clientId The client id of a block in a widget area.
|
|
49
|
+
*
|
|
50
|
+
* @return {Block | null} The widget area block.
|
|
51
|
+
* @type {(state: Record<string, unknown>, clientId: string) => Block | null}
|
|
52
|
+
*/
|
|
53
|
+
export declare const getParentWidgetAreaBlock: (state: Record<string, unknown>, clientId: string) => Block | null;
|
|
54
|
+
/**
|
|
55
|
+
* Returns all edited widget area entity records.
|
|
56
|
+
*
|
|
57
|
+
* @return {Object[]} List of edited widget area entity records.
|
|
58
|
+
*/
|
|
59
|
+
export declare const getEditedWidgetAreas: {
|
|
60
|
+
(state: any, ids: any): any;
|
|
61
|
+
isRegistrySelector?: boolean;
|
|
62
|
+
registry?: any;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Returns all blocks representing reference widgets.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} referenceWidgetName Optional. If given, only reference widgets with this name will be returned.
|
|
68
|
+
* @return {Array} List of all blocks representing reference widgets
|
|
69
|
+
*/
|
|
70
|
+
export declare const getReferenceWidgetBlocks: {
|
|
71
|
+
(state: any, referenceWidgetName?: any): any[];
|
|
72
|
+
isRegistrySelector?: boolean;
|
|
73
|
+
registry?: any;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Returns true if any widget area is currently being saved.
|
|
77
|
+
*
|
|
78
|
+
* @return {boolean} True if any widget area is currently being saved. False otherwise.
|
|
79
|
+
*/
|
|
80
|
+
export declare const isSavingWidgetAreas: {
|
|
81
|
+
(): boolean;
|
|
82
|
+
isRegistrySelector?: boolean;
|
|
83
|
+
registry?: any;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Gets whether the widget area is opened.
|
|
87
|
+
*
|
|
88
|
+
* @param {Array} state The open state of the widget areas.
|
|
89
|
+
* @param {string} clientId The clientId of the widget area.
|
|
90
|
+
*
|
|
91
|
+
* @return {boolean} True if the widget area is open.
|
|
92
|
+
*/
|
|
93
|
+
export declare const getIsWidgetAreaOpen: (state: any[], clientId: string) => boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Returns true if the inserter is opened.
|
|
96
|
+
*
|
|
97
|
+
* @param {Object} state Global application state.
|
|
98
|
+
*
|
|
99
|
+
* @return {boolean} Whether the inserter is opened.
|
|
100
|
+
*/
|
|
101
|
+
export declare function isInserterOpened(state: Object): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Get the insertion point for the inserter.
|
|
104
|
+
*
|
|
105
|
+
* @param {Object} state Global application state.
|
|
106
|
+
*
|
|
107
|
+
* @return {Object} The root client ID and index to insert at.
|
|
108
|
+
*/
|
|
109
|
+
export declare function __experimentalGetInsertionPoint(state: Object): Object;
|
|
110
|
+
/**
|
|
111
|
+
* Returns true if a block can be inserted into a widget area.
|
|
112
|
+
*
|
|
113
|
+
* @param {Array} state The open state of the widget areas.
|
|
114
|
+
* @param {string} blockName The name of the block being inserted.
|
|
115
|
+
*
|
|
116
|
+
* @return {boolean} True if the block can be inserted in a widget area.
|
|
117
|
+
*/
|
|
118
|
+
export declare const canInsertBlockInWidgetArea: {
|
|
119
|
+
(state: any, blockName: any): boolean;
|
|
120
|
+
isRegistrySelector?: boolean;
|
|
121
|
+
registry?: any;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Returns true if the list view is opened.
|
|
125
|
+
*
|
|
126
|
+
* @param {Object} state Global application state.
|
|
127
|
+
*
|
|
128
|
+
* @return {boolean} Whether the list view is opened.
|
|
129
|
+
*/
|
|
130
|
+
export declare function isListViewOpened(state: Object): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Returns whether widget saving is locked.
|
|
133
|
+
*
|
|
134
|
+
* @param {Object} state Global application state.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```jsx
|
|
138
|
+
* import { __ } from '@wordpress/i18n';
|
|
139
|
+
* import { store as widgetStore } from '@wordpress/edit-widgets';
|
|
140
|
+
* import { useSelect } from '@wordpress/data';
|
|
141
|
+
*
|
|
142
|
+
* const ExampleComponent = () => {
|
|
143
|
+
* const isSavingLocked = useSelect(
|
|
144
|
+
* ( select ) => select( widgetStore ).isWidgetSavingLocked(),
|
|
145
|
+
* []
|
|
146
|
+
* );
|
|
147
|
+
*
|
|
148
|
+
* return isSavingLocked ? (
|
|
149
|
+
* <p>{ __( 'Widget saving is locked' ) }</p>
|
|
150
|
+
* ) : (
|
|
151
|
+
* <p>{ __( 'Widget saving is not locked' ) }</p>
|
|
152
|
+
* );
|
|
153
|
+
* };
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @return {boolean} Is locked.
|
|
157
|
+
*/
|
|
158
|
+
export declare function isWidgetSavingLocked(state: Object): boolean;
|
|
159
|
+
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.js"],"names":[],"mappings":"AAcI,YAA6C,KAAK,GAAxC,OAAO,mBAAmB,EAAE,KAAK,CAAO;AAOtD;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;CA4BtB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;CAKrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;CAOxB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;CAepC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,EAF3B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,KAAK,GAAG,IAavE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;CA2BhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;CAwBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;CAmC7B,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,2BAJrB,MAAM,KAEL,OAKX,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAJ5B,MAI4B,GAF3B,OAAO,CAIlB;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAE,KAAK,EAJ3C,MAI2C,GAF1C,MAAM,CAQjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;CAkBtC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAJ5B,MAI4B,GAF3B,OAAO,CAIlB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAAE,KAAK,EAxBhC,MAwBgC,GAF/B,OAAO,CAIlB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a widget entity record into a block.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} widget The widget entity record.
|
|
5
|
+
* @return {Object} a block (converted from the entity record).
|
|
6
|
+
*/
|
|
7
|
+
export declare function transformWidgetToBlock(widget: Object): Object;
|
|
8
|
+
/**
|
|
9
|
+
* Converts a block to a widget entity record.
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} block The block.
|
|
12
|
+
* @param {?Object} relatedWidget A related widget entity record from the API (optional).
|
|
13
|
+
* @return {Object} the widget object (converted from block).
|
|
14
|
+
*/
|
|
15
|
+
export declare function transformBlockToWidget(block: Object, relatedWidget?: Object | null): Object;
|
|
16
|
+
//# sourceMappingURL=transformers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../src/store/transformers.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAE,MAAM,EAHnC,MAGmC,GAFlC,MAAM,CAgCjB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAE,KAAK,EAJlC,MAIkC,EAAE,aAAa,GAHhD,MAAM,OAG+C,GAFrD,MAAM,CAiCjB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Kind" of the navigation post.
|
|
3
|
+
*
|
|
4
|
+
* @type {string}
|
|
5
|
+
*/
|
|
6
|
+
export declare const KIND: string;
|
|
7
|
+
/**
|
|
8
|
+
* "post type" of the navigation post.
|
|
9
|
+
*
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
export declare const WIDGET_AREA_ENTITY_TYPE: string;
|
|
13
|
+
/**
|
|
14
|
+
* "post type" of the widget area post.
|
|
15
|
+
*
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
export declare const POST_TYPE: string;
|
|
19
|
+
/**
|
|
20
|
+
* Builds an ID for a new widget area post.
|
|
21
|
+
*
|
|
22
|
+
* @param {number} widgetAreaId Widget area id.
|
|
23
|
+
* @return {string} An ID.
|
|
24
|
+
*/
|
|
25
|
+
export declare const buildWidgetAreaPostId: (widgetAreaId: number) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Builds an ID for a global widget areas post.
|
|
28
|
+
*
|
|
29
|
+
* @return {string} An ID.
|
|
30
|
+
*/
|
|
31
|
+
export declare const buildWidgetAreasPostId: () => string;
|
|
32
|
+
/**
|
|
33
|
+
* Builds a query to resolve sidebars.
|
|
34
|
+
*
|
|
35
|
+
* @return {Object} Query.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildWidgetAreasQuery(): Object;
|
|
38
|
+
/**
|
|
39
|
+
* Builds a query to resolve widgets.
|
|
40
|
+
*
|
|
41
|
+
* @return {Object} Query.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildWidgetsQuery(): Object;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a stub post with given id and set of blocks. Used as a governing entity records
|
|
46
|
+
* for all widget areas.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} id Post ID.
|
|
49
|
+
* @param {Array} blocks The list of blocks.
|
|
50
|
+
* @return {Object} A stub post object formatted in compliance with the data layer.
|
|
51
|
+
*/
|
|
52
|
+
export declare const createStubPost: (id: string, blocks: any[]) => Object;
|
|
53
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/store/utils.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAFP,MAEgB,CAAC;AAE3B;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAF1B,MAEsC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAFZ,MAEyB,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,iBAHvB,MAAM,KACL,MAGoB,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAFvB,MAE8C,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,qBAAqB,IAFzB,MAAM,CAMjB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAFrB,MAAM,CAOjB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAJhB,MAAM,oBAEL,MAWT,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -45,43 +45,43 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@wordpress/a11y": "^5.
|
|
49
|
-
"@wordpress/admin-ui": "^3.
|
|
50
|
-
"@wordpress/api-fetch": "^8.
|
|
51
|
-
"@wordpress/base-styles": "^15.
|
|
52
|
-
"@wordpress/block-editor": "^20.
|
|
53
|
-
"@wordpress/block-library": "^12.
|
|
54
|
-
"@wordpress/blocks": "^17.
|
|
55
|
-
"@wordpress/components": "^45.
|
|
56
|
-
"@wordpress/compose": "^9.
|
|
57
|
-
"@wordpress/core-data": "^9.
|
|
58
|
-
"@wordpress/data": "^11.
|
|
59
|
-
"@wordpress/deprecated": "^5.
|
|
60
|
-
"@wordpress/dom": "^5.
|
|
61
|
-
"@wordpress/element": "^10.
|
|
62
|
-
"@wordpress/hooks": "^5.
|
|
63
|
-
"@wordpress/i18n": "^7.
|
|
64
|
-
"@wordpress/icons": "^21.
|
|
65
|
-
"@wordpress/interface": "^11.
|
|
66
|
-
"@wordpress/keyboard-shortcuts": "^6.
|
|
67
|
-
"@wordpress/keycodes": "^5.
|
|
68
|
-
"@wordpress/media-utils": "^6.
|
|
69
|
-
"@wordpress/notices": "^6.
|
|
70
|
-
"@wordpress/patterns": "^3.
|
|
71
|
-
"@wordpress/plugins": "^8.
|
|
72
|
-
"@wordpress/preferences": "^5.
|
|
73
|
-
"@wordpress/private-apis": "^3.
|
|
74
|
-
"@wordpress/theme": "^5.
|
|
75
|
-
"@wordpress/ui": "^0.
|
|
76
|
-
"@wordpress/url": "^5.
|
|
77
|
-
"@wordpress/widgets": "^5.
|
|
48
|
+
"@wordpress/a11y": "^5.3.0",
|
|
49
|
+
"@wordpress/admin-ui": "^3.3.0",
|
|
50
|
+
"@wordpress/api-fetch": "^8.3.0",
|
|
51
|
+
"@wordpress/base-styles": "^15.2.0",
|
|
52
|
+
"@wordpress/block-editor": "^20.2.0",
|
|
53
|
+
"@wordpress/block-library": "^12.3.0",
|
|
54
|
+
"@wordpress/blocks": "^17.3.0",
|
|
55
|
+
"@wordpress/components": "^45.1.0",
|
|
56
|
+
"@wordpress/compose": "^9.3.0",
|
|
57
|
+
"@wordpress/core-data": "^9.3.0",
|
|
58
|
+
"@wordpress/data": "^11.3.0",
|
|
59
|
+
"@wordpress/deprecated": "^5.3.0",
|
|
60
|
+
"@wordpress/dom": "^5.3.0",
|
|
61
|
+
"@wordpress/element": "^10.3.0",
|
|
62
|
+
"@wordpress/hooks": "^5.3.0",
|
|
63
|
+
"@wordpress/i18n": "^7.3.0",
|
|
64
|
+
"@wordpress/icons": "^21.1.0",
|
|
65
|
+
"@wordpress/interface": "^11.3.0",
|
|
66
|
+
"@wordpress/keyboard-shortcuts": "^6.3.0",
|
|
67
|
+
"@wordpress/keycodes": "^5.3.0",
|
|
68
|
+
"@wordpress/media-utils": "^6.3.0",
|
|
69
|
+
"@wordpress/notices": "^6.3.0",
|
|
70
|
+
"@wordpress/patterns": "^3.3.0",
|
|
71
|
+
"@wordpress/plugins": "^8.3.0",
|
|
72
|
+
"@wordpress/preferences": "^5.3.0",
|
|
73
|
+
"@wordpress/private-apis": "^3.3.0",
|
|
74
|
+
"@wordpress/theme": "^5.1.0",
|
|
75
|
+
"@wordpress/ui": "^0.28.0",
|
|
76
|
+
"@wordpress/url": "^5.3.0",
|
|
77
|
+
"@wordpress/widgets": "^5.3.0",
|
|
78
78
|
"clsx": "^2.1.1"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@testing-library/dom": "^10.4.2",
|
|
82
82
|
"@testing-library/react": "^16.3.3",
|
|
83
83
|
"deep-freeze": "^0.0.1",
|
|
84
|
-
"vitest": "^5.1.
|
|
84
|
+
"vitest": "^5.1.1"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"react": "^18 || ^19",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "7f19202f61aeba8f4bdce892a1a0df485ad76e2b"
|
|
94
94
|
}
|