@wordpress/patterns 2.32.0 → 2.32.1-next.ff1cebbba.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/api/index.js +35 -29
- package/build/api/index.js.map +7 -1
- package/build/components/allow-overrides-modal.js +149 -112
- package/build/components/allow-overrides-modal.js.map +7 -1
- package/build/components/category-selector.js +59 -38
- package/build/components/category-selector.js.map +7 -1
- package/build/components/create-pattern-modal.js +162 -111
- package/build/components/create-pattern-modal.js.map +7 -1
- package/build/components/duplicate-pattern-modal.js +85 -66
- package/build/components/duplicate-pattern-modal.js.map +7 -1
- package/build/components/index.js +50 -33
- package/build/components/index.js.map +7 -1
- package/build/components/overrides-panel.js +44 -39
- package/build/components/overrides-panel.js.map +7 -1
- package/build/components/pattern-convert-button.js +144 -133
- package/build/components/pattern-convert-button.js.map +7 -1
- package/build/components/pattern-overrides-block-controls.js +109 -109
- package/build/components/pattern-overrides-block-controls.js.map +7 -1
- package/build/components/pattern-overrides-controls.js +86 -69
- package/build/components/pattern-overrides-controls.js.map +7 -1
- package/build/components/patterns-manage-button.js +96 -97
- package/build/components/patterns-manage-button.js.map +7 -1
- package/build/components/rename-pattern-category-modal.js +122 -111
- package/build/components/rename-pattern-category-modal.js.map +7 -1
- package/build/components/rename-pattern-modal.js +95 -73
- package/build/components/rename-pattern-modal.js.map +7 -1
- package/build/components/reset-overrides-control.js +61 -57
- package/build/components/reset-overrides-control.js.map +7 -1
- package/build/constants.js +57 -23
- package/build/constants.js.map +7 -1
- package/build/index.js +27 -24
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/private-apis.js +71 -48
- package/build/private-apis.js.map +7 -1
- package/build/private-hooks.js +57 -69
- package/build/private-hooks.js.map +7 -1
- package/build/store/actions.js +72 -85
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +50 -44
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +30 -14
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +26 -13
- package/build/store/selectors.js.map +7 -1
- package/build-module/api/index.js +14 -25
- package/build-module/api/index.js.map +7 -1
- package/build-module/components/allow-overrides-modal.js +131 -103
- package/build-module/components/allow-overrides-modal.js.map +7 -1
- package/build-module/components/category-selector.js +35 -29
- package/build-module/components/category-selector.js.map +7 -1
- package/build-module/components/create-pattern-modal.js +137 -99
- package/build-module/components/create-pattern-modal.js.map +7 -1
- package/build-module/components/duplicate-pattern-modal.js +53 -58
- package/build-module/components/duplicate-pattern-modal.js.map +7 -1
- package/build-module/components/index.js +22 -26
- package/build-module/components/index.js.map +7 -1
- package/build-module/components/overrides-panel.js +30 -34
- package/build-module/components/overrides-panel.js.map +7 -1
- package/build-module/components/pattern-convert-button.js +120 -125
- package/build-module/components/pattern-convert-button.js.map +7 -1
- package/build-module/components/pattern-overrides-block-controls.js +100 -103
- package/build-module/components/pattern-overrides-block-controls.js.map +7 -1
- package/build-module/components/pattern-overrides-controls.js +69 -58
- package/build-module/components/pattern-overrides-controls.js.map +7 -1
- package/build-module/components/patterns-manage-button.js +78 -91
- package/build-module/components/patterns-manage-button.js.map +7 -1
- package/build-module/components/rename-pattern-category-modal.js +106 -101
- package/build-module/components/rename-pattern-category-modal.js.map +7 -1
- package/build-module/components/rename-pattern-modal.js +80 -64
- package/build-module/components/rename-pattern-modal.js.map +7 -1
- package/build-module/components/reset-overrides-control.js +46 -51
- package/build-module/components/reset-overrides-control.js.map +7 -1
- package/build-module/constants.js +29 -18
- package/build-module/constants.js.map +7 -1
- package/build-module/index.js +6 -6
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/private-apis.js +31 -18
- package/build-module/private-apis.js.map +7 -1
- package/build-module/private-hooks.js +35 -64
- package/build-module/private-hooks.js.map +7 -1
- package/build-module/store/actions.js +44 -74
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +13 -32
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +9 -8
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +5 -9
- package/build-module/store/selectors.js.map +7 -1
- package/build-style/style-rtl.css +3 -138
- package/build-style/style.css +3 -138
- package/package.json +24 -17
- package/src/components/style.scss +5 -0
- package/src/style.scss +2 -1
- package/build/index.native.js +0 -18
- package/build/index.native.js.map +0 -1
- package/build-module/index.native.js +0 -11
- package/build-module/index.native.js.map +0 -1
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var rename_pattern_modal_exports = {};
|
|
19
|
+
__export(rename_pattern_modal_exports, {
|
|
20
|
+
default: () => RenamePatternModal
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
22
|
+
module.exports = __toCommonJS(rename_pattern_modal_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_components = require("@wordpress/components");
|
|
25
|
+
var import_core_data = require("@wordpress/core-data");
|
|
26
|
+
var import_data = require("@wordpress/data");
|
|
27
|
+
var import_element = require("@wordpress/element");
|
|
28
|
+
var import_html_entities = require("@wordpress/html-entities");
|
|
29
|
+
var import_i18n = require("@wordpress/i18n");
|
|
30
|
+
var import_notices = require("@wordpress/notices");
|
|
19
31
|
function RenamePatternModal({
|
|
20
32
|
onClose,
|
|
21
33
|
onError,
|
|
@@ -23,86 +35,96 @@ function RenamePatternModal({
|
|
|
23
35
|
pattern,
|
|
24
36
|
...props
|
|
25
37
|
}) {
|
|
26
|
-
const originalName = (0,
|
|
27
|
-
const [name, setName] = (0,
|
|
28
|
-
const [isSaving, setIsSaving] = (0,
|
|
38
|
+
const originalName = (0, import_html_entities.decodeEntities)(pattern.title);
|
|
39
|
+
const [name, setName] = (0, import_element.useState)(originalName);
|
|
40
|
+
const [isSaving, setIsSaving] = (0, import_element.useState)(false);
|
|
29
41
|
const {
|
|
30
42
|
editEntityRecord,
|
|
31
43
|
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
|
|
32
|
-
} = (0,
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
createErrorNotice
|
|
36
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
37
|
-
const onRename = async event => {
|
|
44
|
+
} = (0, import_data.useDispatch)(import_core_data.store);
|
|
45
|
+
const { createSuccessNotice, createErrorNotice } = (0, import_data.useDispatch)(import_notices.store);
|
|
46
|
+
const onRename = async (event) => {
|
|
38
47
|
event.preventDefault();
|
|
39
48
|
if (!name || name === pattern.title || isSaving) {
|
|
40
49
|
return;
|
|
41
50
|
}
|
|
42
51
|
try {
|
|
43
|
-
await editEntityRecord(
|
|
52
|
+
await editEntityRecord("postType", pattern.type, pattern.id, {
|
|
44
53
|
title: name
|
|
45
54
|
});
|
|
46
55
|
setIsSaving(true);
|
|
47
|
-
setName(
|
|
56
|
+
setName("");
|
|
48
57
|
onClose?.();
|
|
49
|
-
const savedRecord = await saveSpecifiedEntityEdits(
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
const savedRecord = await saveSpecifiedEntityEdits(
|
|
59
|
+
"postType",
|
|
60
|
+
pattern.type,
|
|
61
|
+
pattern.id,
|
|
62
|
+
["title"],
|
|
63
|
+
{ throwOnError: true }
|
|
64
|
+
);
|
|
52
65
|
onSuccess?.(savedRecord);
|
|
53
|
-
createSuccessNotice((0,
|
|
54
|
-
type:
|
|
55
|
-
id:
|
|
66
|
+
createSuccessNotice((0, import_i18n.__)("Pattern renamed"), {
|
|
67
|
+
type: "snackbar",
|
|
68
|
+
id: "pattern-update"
|
|
56
69
|
});
|
|
57
70
|
} catch (error) {
|
|
58
71
|
onError?.();
|
|
59
|
-
const errorMessage = error.message && error.code !==
|
|
72
|
+
const errorMessage = error.message && error.code !== "unknown_error" ? error.message : (0, import_i18n.__)("An error occurred while renaming the pattern.");
|
|
60
73
|
createErrorNotice(errorMessage, {
|
|
61
|
-
type:
|
|
62
|
-
id:
|
|
74
|
+
type: "snackbar",
|
|
75
|
+
id: "pattern-update"
|
|
63
76
|
});
|
|
64
77
|
} finally {
|
|
65
78
|
setIsSaving(false);
|
|
66
|
-
setName(
|
|
79
|
+
setName("");
|
|
67
80
|
}
|
|
68
81
|
};
|
|
69
82
|
const onRequestClose = () => {
|
|
70
83
|
onClose?.();
|
|
71
|
-
setName(
|
|
84
|
+
setName("");
|
|
72
85
|
};
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
children:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
label: (0, _i18n.__)('Name'),
|
|
87
|
-
value: name,
|
|
88
|
-
onChange: setName,
|
|
89
|
-
required: true
|
|
90
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
|
|
91
|
-
justify: "right",
|
|
92
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
import_components.Modal,
|
|
88
|
+
{
|
|
89
|
+
title: (0, import_i18n.__)("Rename"),
|
|
90
|
+
...props,
|
|
91
|
+
onRequestClose: onClose,
|
|
92
|
+
focusOnMount: "firstContentElement",
|
|
93
|
+
size: "small",
|
|
94
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("form", { onSubmit: onRename, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
import_components.TextControl,
|
|
97
|
+
{
|
|
98
|
+
__nextHasNoMarginBottom: true,
|
|
93
99
|
__next40pxDefaultSize: true,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
label: (0, import_i18n.__)("Name"),
|
|
101
|
+
value: name,
|
|
102
|
+
onChange: setName,
|
|
103
|
+
required: true
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
108
|
+
import_components.Button,
|
|
109
|
+
{
|
|
110
|
+
__next40pxDefaultSize: true,
|
|
111
|
+
variant: "tertiary",
|
|
112
|
+
onClick: onRequestClose,
|
|
113
|
+
children: (0, import_i18n.__)("Cancel")
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
import_components.Button,
|
|
118
|
+
{
|
|
119
|
+
__next40pxDefaultSize: true,
|
|
120
|
+
variant: "primary",
|
|
121
|
+
type: "submit",
|
|
122
|
+
children: (0, import_i18n.__)("Save")
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] })
|
|
126
|
+
] }) })
|
|
127
|
+
}
|
|
128
|
+
);
|
|
107
129
|
}
|
|
108
|
-
//# sourceMappingURL=rename-pattern-modal.js.map
|
|
130
|
+
//# sourceMappingURL=rename-pattern-modal.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/rename-pattern-modal.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function RenamePatternModal( {\n\tonClose,\n\tonError,\n\tonSuccess,\n\tpattern,\n\t...props\n} ) {\n\tconst originalName = decodeEntities( pattern.title );\n\tconst [ name, setName ] = useState( originalName );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst onRename = async ( event ) => {\n\t\tevent.preventDefault();\n\n\t\tif ( ! name || name === pattern.title || isSaving ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', pattern.type, pattern.id, {\n\t\t\t\ttitle: name,\n\t\t\t} );\n\n\t\t\tsetIsSaving( true );\n\t\t\tsetName( '' );\n\t\t\tonClose?.();\n\n\t\t\tconst savedRecord = await saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpattern.type,\n\t\t\t\tpattern.id,\n\t\t\t\t[ 'title' ],\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSuccess?.( savedRecord );\n\n\t\t\tcreateSuccessNotice( __( 'Pattern renamed' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-update',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tonError?.();\n\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while renaming the pattern.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'pattern-update',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsSaving( false );\n\t\t\tsetName( '' );\n\t\t}\n\t};\n\n\tconst onRequestClose = () => {\n\t\tonClose?.();\n\t\tsetName( '' );\n\t};\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Rename' ) }\n\t\t\t{ ...props }\n\t\t\tonRequestClose={ onClose }\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ onRename }>\n\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ name }\n\t\t\t\t\t\tonChange={ setName }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onRequestClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmGK;AAhGL,wBAMO;AACP,uBAAmC;AACnC,kBAA4B;AAC5B,qBAAyB;AACzB,2BAA+B;AAC/B,kBAAmB;AACnB,qBAAsC;AAEvB,SAAR,mBAAqC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,QAAM,mBAAe,qCAAgB,QAAQ,KAAM;AACnD,QAAM,CAAE,MAAM,OAAQ,QAAI,yBAAU,YAAa;AACjD,QAAM,CAAE,UAAU,WAAY,QAAI,yBAAU,KAAM;AAElD,QAAM;AAAA,IACL;AAAA,IACA,wCAAwC;AAAA,EACzC,QAAI,yBAAa,iBAAAA,KAAU;AAE3B,QAAM,EAAE,qBAAqB,kBAAkB,QAC9C,yBAAa,eAAAC,KAAa;AAE3B,QAAM,WAAW,OAAQ,UAAW;AACnC,UAAM,eAAe;AAErB,QAAK,CAAE,QAAQ,SAAS,QAAQ,SAAS,UAAW;AACnD;AAAA,IACD;AAEA,QAAI;AACH,YAAM,iBAAkB,YAAY,QAAQ,MAAM,QAAQ,IAAI;AAAA,QAC7D,OAAO;AAAA,MACR,CAAE;AAEF,kBAAa,IAAK;AAClB,cAAS,EAAG;AACZ,gBAAU;AAEV,YAAM,cAAc,MAAM;AAAA,QACzB;AAAA,QACA,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,CAAE,OAAQ;AAAA,QACV,EAAE,cAAc,KAAK;AAAA,MACtB;AAEA,kBAAa,WAAY;AAEzB,8BAAqB,gBAAI,iBAAkB,GAAG;AAAA,QAC7C,MAAM;AAAA,QACN,IAAI;AAAA,MACL,CAAE;AAAA,IACH,SAAU,OAAQ;AACjB,gBAAU;AAEV,YAAM,eACL,MAAM,WAAW,MAAM,SAAS,kBAC7B,MAAM,cACN,gBAAI,+CAAgD;AAExD,wBAAmB,cAAc;AAAA,QAChC,MAAM;AAAA,QACN,IAAI;AAAA,MACL,CAAE;AAAA,IACH,UAAE;AACD,kBAAa,KAAM;AACnB,cAAS,EAAG;AAAA,IACb;AAAA,EACD;AAEA,QAAM,iBAAiB,MAAM;AAC5B,cAAU;AACV,YAAS,EAAG;AAAA,EACb;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAQ,gBAAI,QAAS;AAAA,MACnB,GAAG;AAAA,MACL,gBAAiB;AAAA,MACjB,cAAa;AAAA,MACb,MAAK;AAAA,MAEL,sDAAC,UAAK,UAAW,UAChB,uDAAC,kBAAAC,sBAAA,EAAO,SAAQ,KACf;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,yBAAuB;AAAA,YACvB,uBAAqB;AAAA,YACrB,WAAQ,gBAAI,MAAO;AAAA,YACnB,OAAQ;AAAA,YACR,UAAW;AAAA,YACX,UAAQ;AAAA;AAAA,QACT;AAAA,QAEA,6CAAC,kBAAAC,sBAAA,EAAO,SAAQ,SACf;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,SAAU;AAAA,cAER,8BAAI,QAAS;AAAA;AAAA,UAChB;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,SAAQ;AAAA,cACR,MAAK;AAAA,cAEH,8BAAI,MAAO;AAAA;AAAA,UACd;AAAA,WACD;AAAA,SACD,GACD;AAAA;AAAA,EACD;AAEF;",
|
|
6
|
+
"names": ["coreStore", "noticesStore", "VStack", "HStack"]
|
|
7
|
+
}
|
|
@@ -1,46 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var reset_overrides_control_exports = {};
|
|
19
|
+
__export(reset_overrides_control_exports, {
|
|
20
|
+
default: () => ResetOverridesControl
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
* WordPress dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const CONTENT = 'content';
|
|
22
|
+
module.exports = __toCommonJS(reset_overrides_control_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
25
|
+
var import_components = require("@wordpress/components");
|
|
26
|
+
var import_data = require("@wordpress/data");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
const CONTENT = "content";
|
|
17
29
|
function ResetOverridesControl(props) {
|
|
18
30
|
const name = props.attributes.metadata?.name;
|
|
19
|
-
const registry = (0,
|
|
20
|
-
const isOverridden = (0,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
getBlockAttributes,
|
|
26
|
-
getBlockParentsByBlockName
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const registry = (0, import_data.useRegistry)();
|
|
32
|
+
const isOverridden = (0, import_data.useSelect)(
|
|
33
|
+
(select) => {
|
|
34
|
+
if (!name) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const { getBlockAttributes, getBlockParentsByBlockName } = select(import_block_editor.store);
|
|
38
|
+
const [patternClientId] = getBlockParentsByBlockName(
|
|
39
|
+
props.clientId,
|
|
40
|
+
"core/block",
|
|
41
|
+
true
|
|
42
|
+
);
|
|
43
|
+
if (!patternClientId) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const overrides = getBlockAttributes(patternClientId)[CONTENT];
|
|
47
|
+
if (!overrides) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return overrides.hasOwnProperty(name);
|
|
51
|
+
},
|
|
52
|
+
[props.clientId, name]
|
|
53
|
+
);
|
|
38
54
|
function onClick() {
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
const { getBlockAttributes, getBlockParentsByBlockName } = registry.select(import_block_editor.store);
|
|
56
|
+
const [patternClientId] = getBlockParentsByBlockName(
|
|
57
|
+
props.clientId,
|
|
58
|
+
"core/block",
|
|
59
|
+
true
|
|
60
|
+
);
|
|
44
61
|
if (!patternClientId) {
|
|
45
62
|
return;
|
|
46
63
|
}
|
|
@@ -48,30 +65,17 @@ function ResetOverridesControl(props) {
|
|
|
48
65
|
if (!overrides.hasOwnProperty(name)) {
|
|
49
66
|
return;
|
|
50
67
|
}
|
|
51
|
-
const {
|
|
52
|
-
updateBlockAttributes,
|
|
53
|
-
__unstableMarkLastChangeAsPersistent
|
|
54
|
-
} = registry.dispatch(_blockEditor.store);
|
|
68
|
+
const { updateBlockAttributes, __unstableMarkLastChangeAsPersistent } = registry.dispatch(import_block_editor.store);
|
|
55
69
|
__unstableMarkLastChangeAsPersistent();
|
|
56
|
-
let newOverrides = {
|
|
57
|
-
...overrides
|
|
58
|
-
};
|
|
70
|
+
let newOverrides = { ...overrides };
|
|
59
71
|
delete newOverrides[name];
|
|
60
72
|
if (!Object.keys(newOverrides).length) {
|
|
61
|
-
newOverrides =
|
|
73
|
+
newOverrides = void 0;
|
|
62
74
|
}
|
|
63
75
|
updateBlockAttributes(patternClientId, {
|
|
64
76
|
[CONTENT]: newOverrides
|
|
65
77
|
});
|
|
66
78
|
}
|
|
67
|
-
return
|
|
68
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
|
|
69
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
70
|
-
onClick: onClick,
|
|
71
|
-
disabled: !isOverridden,
|
|
72
|
-
children: (0, _i18n.__)('Reset')
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
});
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.__unstableBlockToolbarLastItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarButton, { onClick, disabled: !isOverridden, children: (0, import_i18n.__)("Reset") }) }) });
|
|
76
80
|
}
|
|
77
|
-
//# sourceMappingURL=reset-overrides-control.js.map
|
|
81
|
+
//# sourceMappingURL=reset-overrides-control.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/reset-overrides-control.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tstore as blockEditorStore,\n\t__unstableBlockToolbarLastItem as BlockToolbarLastItem,\n} from '@wordpress/block-editor';\nimport { ToolbarButton, ToolbarGroup } from '@wordpress/components';\nimport { useRegistry, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\nconst CONTENT = 'content';\n\nexport default function ResetOverridesControl( props ) {\n\tconst name = props.attributes.metadata?.name;\n\tconst registry = useRegistry();\n\tconst isOverridden = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! name ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getBlockAttributes, getBlockParentsByBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\t\tprops.clientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t\tif ( ! patternClientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst overrides = getBlockAttributes( patternClientId )[ CONTENT ];\n\n\t\t\tif ( ! overrides ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn overrides.hasOwnProperty( name );\n\t\t},\n\t\t[ props.clientId, name ]\n\t);\n\n\tfunction onClick() {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tprops.clientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\tif ( ! patternClientId ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst overrides = getBlockAttributes( patternClientId )[ CONTENT ];\n\n\t\tif ( ! overrides.hasOwnProperty( name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { updateBlockAttributes, __unstableMarkLastChangeAsPersistent } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\t\t__unstableMarkLastChangeAsPersistent();\n\n\t\tlet newOverrides = { ...overrides };\n\t\tdelete newOverrides[ name ];\n\n\t\tif ( ! Object.keys( newOverrides ).length ) {\n\t\t\tnewOverrides = undefined;\n\t\t}\n\n\t\tupdateBlockAttributes( patternClientId, {\n\t\t\t[ CONTENT ]: newOverrides,\n\t\t} );\n\t}\n\n\treturn (\n\t\t<BlockToolbarLastItem>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton onClick={ onClick } disabled={ ! isOverridden }>\n\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockToolbarLastItem>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmFI;AAhFJ,0BAGO;AACP,wBAA4C;AAC5C,kBAAuC;AACvC,kBAAmB;AAEnB,MAAM,UAAU;AAED,SAAR,sBAAwC,OAAQ;AACtD,QAAM,OAAO,MAAM,WAAW,UAAU;AACxC,QAAM,eAAW,yBAAY;AAC7B,QAAM,mBAAe;AAAA,IACpB,CAAE,WAAY;AACb,UAAK,CAAE,MAAO;AACb;AAAA,MACD;AAEA,YAAM,EAAE,oBAAoB,2BAA2B,IACtD,OAAQ,oBAAAA,KAAiB;AAC1B,YAAM,CAAE,eAAgB,IAAI;AAAA,QAC3B,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAEA,UAAK,CAAE,iBAAkB;AACxB;AAAA,MACD;AAEA,YAAM,YAAY,mBAAoB,eAAgB,EAAG,OAAQ;AAEjE,UAAK,CAAE,WAAY;AAClB;AAAA,MACD;AAEA,aAAO,UAAU,eAAgB,IAAK;AAAA,IACvC;AAAA,IACA,CAAE,MAAM,UAAU,IAAK;AAAA,EACxB;AAEA,WAAS,UAAU;AAClB,UAAM,EAAE,oBAAoB,2BAA2B,IACtD,SAAS,OAAQ,oBAAAA,KAAiB;AACnC,UAAM,CAAE,eAAgB,IAAI;AAAA,MAC3B,MAAM;AAAA,MACN;AAAA,MACA;AAAA,IACD;AAEA,QAAK,CAAE,iBAAkB;AACxB;AAAA,IACD;AAEA,UAAM,YAAY,mBAAoB,eAAgB,EAAG,OAAQ;AAEjE,QAAK,CAAE,UAAU,eAAgB,IAAK,GAAI;AACzC;AAAA,IACD;AAEA,UAAM,EAAE,uBAAuB,qCAAqC,IACnE,SAAS,SAAU,oBAAAA,KAAiB;AACrC,yCAAqC;AAErC,QAAI,eAAe,EAAE,GAAG,UAAU;AAClC,WAAO,aAAc,IAAK;AAE1B,QAAK,CAAE,OAAO,KAAM,YAAa,EAAE,QAAS;AAC3C,qBAAe;AAAA,IAChB;AAEA,0BAAuB,iBAAiB;AAAA,MACvC,CAAE,OAAQ,GAAG;AAAA,IACd,CAAE;AAAA,EACH;AAEA,SACC,4CAAC,oBAAAC,gCAAA,EACA,sDAAC,kCACA,sDAAC,mCAAc,SAAoB,UAAW,CAAE,cAC7C,8BAAI,OAAQ,GACf,GACD,GACD;AAEF;",
|
|
6
|
+
"names": ["blockEditorStore", "BlockToolbarLastItem"]
|
|
7
|
+
}
|
package/build/constants.js
CHANGED
|
@@ -1,27 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
EXCLUDED_PATTERN_SOURCES: () => EXCLUDED_PATTERN_SOURCES,
|
|
21
|
+
PARTIAL_SYNCING_SUPPORTED_BLOCKS: () => PARTIAL_SYNCING_SUPPORTED_BLOCKS,
|
|
22
|
+
PATTERN_DEFAULT_CATEGORY: () => PATTERN_DEFAULT_CATEGORY,
|
|
23
|
+
PATTERN_OVERRIDES_BINDING_SOURCE: () => PATTERN_OVERRIDES_BINDING_SOURCE,
|
|
24
|
+
PATTERN_SYNC_TYPES: () => PATTERN_SYNC_TYPES,
|
|
25
|
+
PATTERN_TYPES: () => PATTERN_TYPES,
|
|
26
|
+
PATTERN_USER_CATEGORY: () => PATTERN_USER_CATEGORY
|
|
5
27
|
});
|
|
6
|
-
|
|
7
|
-
const PATTERN_TYPES =
|
|
8
|
-
theme:
|
|
9
|
-
user:
|
|
28
|
+
module.exports = __toCommonJS(constants_exports);
|
|
29
|
+
const PATTERN_TYPES = {
|
|
30
|
+
theme: "pattern",
|
|
31
|
+
user: "wp_block"
|
|
10
32
|
};
|
|
11
|
-
const PATTERN_DEFAULT_CATEGORY =
|
|
12
|
-
const PATTERN_USER_CATEGORY =
|
|
13
|
-
const EXCLUDED_PATTERN_SOURCES =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
33
|
+
const PATTERN_DEFAULT_CATEGORY = "all-patterns";
|
|
34
|
+
const PATTERN_USER_CATEGORY = "my-patterns";
|
|
35
|
+
const EXCLUDED_PATTERN_SOURCES = [
|
|
36
|
+
"core",
|
|
37
|
+
"pattern-directory/core",
|
|
38
|
+
"pattern-directory/featured"
|
|
39
|
+
];
|
|
40
|
+
const PATTERN_SYNC_TYPES = {
|
|
41
|
+
full: "fully",
|
|
42
|
+
unsynced: "unsynced"
|
|
17
43
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'core/button': ['text', 'url', 'linkTarget', 'rel'],
|
|
24
|
-
'core/image': ['id', 'url', 'title', 'alt']
|
|
44
|
+
const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {
|
|
45
|
+
"core/paragraph": ["content"],
|
|
46
|
+
"core/heading": ["content"],
|
|
47
|
+
"core/button": ["text", "url", "linkTarget", "rel"],
|
|
48
|
+
"core/image": ["id", "url", "title", "alt"]
|
|
25
49
|
};
|
|
26
|
-
const PATTERN_OVERRIDES_BINDING_SOURCE =
|
|
27
|
-
|
|
50
|
+
const PATTERN_OVERRIDES_BINDING_SOURCE = "core/pattern-overrides";
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
EXCLUDED_PATTERN_SOURCES,
|
|
54
|
+
PARTIAL_SYNCING_SUPPORTED_BLOCKS,
|
|
55
|
+
PATTERN_DEFAULT_CATEGORY,
|
|
56
|
+
PATTERN_OVERRIDES_BINDING_SOURCE,
|
|
57
|
+
PATTERN_SYNC_TYPES,
|
|
58
|
+
PATTERN_TYPES,
|
|
59
|
+
PATTERN_USER_CATEGORY
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=constants.js.map
|
package/build/constants.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/constants.js"],
|
|
4
|
+
"sourcesContent": ["export const PATTERN_TYPES = {\n\ttheme: 'pattern',\n\tuser: 'wp_block',\n};\n\nexport const PATTERN_DEFAULT_CATEGORY = 'all-patterns';\nexport const PATTERN_USER_CATEGORY = 'my-patterns';\nexport const EXCLUDED_PATTERN_SOURCES = [\n\t'core',\n\t'pattern-directory/core',\n\t'pattern-directory/featured',\n];\nexport const PATTERN_SYNC_TYPES = {\n\tfull: 'fully',\n\tunsynced: 'unsynced',\n};\n\n// TODO: This should not be hardcoded. Maybe there should be a config and/or an UI.\nexport const PARTIAL_SYNCING_SUPPORTED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/button': [ 'text', 'url', 'linkTarget', 'rel' ],\n\t'core/image': [ 'id', 'url', 'title', 'alt' ],\n};\n\nexport const PATTERN_OVERRIDES_BINDING_SOURCE = 'core/pattern-overrides';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,gBAAgB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AACP;AAEO,MAAM,2BAA2B;AACjC,MAAM,wBAAwB;AAC9B,MAAM,2BAA2B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACD;AACO,MAAM,qBAAqB;AAAA,EACjC,MAAM;AAAA,EACN,UAAU;AACX;AAGO,MAAM,mCAAmC;AAAA,EAC/C,kBAAkB,CAAE,SAAU;AAAA,EAC9B,gBAAgB,CAAE,SAAU;AAAA,EAC5B,eAAe,CAAE,QAAQ,OAAO,cAAc,KAAM;AAAA,EACpD,cAAc,CAAE,MAAM,OAAO,SAAS,KAAM;AAC7C;AAEO,MAAM,mCAAmC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/index.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
14
|
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
|
+
store: () => import_store.store
|
|
14
22
|
});
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _privateApis[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
23
|
+
module.exports = __toCommonJS(index_exports);
|
|
24
|
+
var import_store = require("./store");
|
|
25
|
+
__reExport(index_exports, require("./private-apis"), module.exports);
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
store,
|
|
29
|
+
...require("./private-apis")
|
|
27
30
|
});
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nexport { store } from './store';\nexport * from './private-apis';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAsB;AACtB,0BAAc,2BAJd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/lock-unlock.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var lock_unlock_exports = {};
|
|
19
|
+
__export(lock_unlock_exports, {
|
|
20
|
+
lock: () => lock,
|
|
21
|
+
unlock: () => unlock
|
|
5
22
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
module.exports = __toCommonJS(lock_unlock_exports);
|
|
24
|
+
var import_private_apis = require("@wordpress/private-apis");
|
|
25
|
+
const { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
|
|
26
|
+
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
|
|
27
|
+
"@wordpress/patterns"
|
|
28
|
+
);
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
13
31
|
lock,
|
|
14
32
|
unlock
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.lock = lock;
|
|
18
|
-
//# sourceMappingURL=lock-unlock.js.map
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=lock-unlock.js.map
|