@wordpress/core-commands 1.32.0 → 1.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.
@@ -1,39 +1,53 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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 admin_navigation_commands_exports = {};
19
+ __export(admin_navigation_commands_exports, {
20
+ useAdminNavigationCommands: () => useAdminNavigationCommands
5
21
  });
6
- exports.useAdminNavigationCommands = useAdminNavigationCommands;
7
- var _commands = require("@wordpress/commands");
8
- var _i18n = require("@wordpress/i18n");
9
- var _icons = require("@wordpress/icons");
10
- var _element = require("@wordpress/element");
11
- var _coreData = require("@wordpress/core-data");
12
- var _data = require("@wordpress/data");
13
- /**
14
- * WordPress dependencies
15
- */
16
-
22
+ module.exports = __toCommonJS(admin_navigation_commands_exports);
23
+ var import_commands = require("@wordpress/commands");
24
+ var import_i18n = require("@wordpress/i18n");
25
+ var import_icons = require("@wordpress/icons");
26
+ var import_element = require("@wordpress/element");
27
+ var import_core_data = require("@wordpress/core-data");
28
+ var import_data = require("@wordpress/data");
17
29
  const getViewSiteCommand = () => function useViewSiteCommand() {
18
- const homeUrl = (0, _data.useSelect)(select => {
19
- // Site index.
20
- return select(_coreData.store).getEntityRecord('root', '__unstableBase')?.home;
30
+ const homeUrl = (0, import_data.useSelect)((select) => {
31
+ return select(import_core_data.store).getEntityRecord(
32
+ "root",
33
+ "__unstableBase"
34
+ )?.home;
21
35
  }, []);
22
- const commands = (0, _element.useMemo)(() => {
36
+ const commands = (0, import_element.useMemo)(() => {
23
37
  if (!homeUrl) {
24
38
  return [];
25
39
  }
26
- return [{
27
- name: 'core/view-site',
28
- label: (0, _i18n.__)('View site'),
29
- icon: _icons.external,
30
- callback: ({
31
- close
32
- }) => {
33
- close();
34
- window.open(homeUrl, '_blank');
40
+ return [
41
+ {
42
+ name: "core/view-site",
43
+ label: (0, import_i18n.__)("View site"),
44
+ icon: import_icons.external,
45
+ callback: ({ close }) => {
46
+ close();
47
+ window.open(homeUrl, "_blank");
48
+ }
35
49
  }
36
- }];
50
+ ];
37
51
  }, [homeUrl]);
38
52
  return {
39
53
  isLoading: false,
@@ -41,27 +55,32 @@ const getViewSiteCommand = () => function useViewSiteCommand() {
41
55
  };
42
56
  };
43
57
  function useAdminNavigationCommands(menuCommands) {
44
- const commands = (0, _element.useMemo)(() => {
45
- return (menuCommands !== null && menuCommands !== void 0 ? menuCommands : []).map(menuCommand => {
46
- const label = (0, _i18n.sprintf)(/* translators: %s: menu label */
47
- (0, _i18n.__)('Go to: %s'), menuCommand.label);
58
+ const commands = (0, import_element.useMemo)(() => {
59
+ return (menuCommands ?? []).map((menuCommand) => {
60
+ const label = (0, import_i18n.sprintf)(
61
+ /* translators: %s: menu label */
62
+ (0, import_i18n.__)("Go to: %s"),
63
+ menuCommand.label
64
+ );
48
65
  return {
49
66
  name: menuCommand.name,
50
67
  label,
51
68
  searchLabel: label,
52
- callback: ({
53
- close
54
- }) => {
69
+ callback: ({ close }) => {
55
70
  document.location = menuCommand.url;
56
71
  close();
57
72
  }
58
73
  };
59
74
  });
60
75
  }, [menuCommands]);
61
- (0, _commands.useCommands)(commands);
62
- (0, _commands.useCommandLoader)({
63
- name: 'core/view-site',
76
+ (0, import_commands.useCommands)(commands);
77
+ (0, import_commands.useCommandLoader)({
78
+ name: "core/view-site",
64
79
  hook: getViewSiteCommand()
65
80
  });
66
81
  }
67
- //# sourceMappingURL=admin-navigation-commands.js.map
82
+ // Annotate the CommonJS export names for ESM import in node:
83
+ 0 && (module.exports = {
84
+ useAdminNavigationCommands
85
+ });
86
+ //# sourceMappingURL=admin-navigation-commands.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_commands","require","_i18n","_icons","_element","_coreData","_data","getViewSiteCommand","useViewSiteCommand","homeUrl","useSelect","select","coreStore","getEntityRecord","home","commands","useMemo","name","label","__","icon","external","callback","close","window","open","isLoading","useAdminNavigationCommands","menuCommands","map","menuCommand","sprintf","searchLabel","document","location","url","useCommands","useCommandLoader","hook"],"sources":["@wordpress/core-commands/src/admin-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommandLoader, useCommands } from '@wordpress/commands';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nconst getViewSiteCommand = () =>\n\tfunction useViewSiteCommand() {\n\t\tconst homeUrl = useSelect( ( select ) => {\n\t\t\t// Site index.\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase'\n\t\t\t)?.home;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! homeUrl ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/view-site',\n\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\ticon: external,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\twindow.open( homeUrl, '_blank' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ homeUrl ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useAdminNavigationCommands( menuCommands ) {\n\tconst commands = useMemo( () => {\n\t\treturn ( menuCommands ?? [] ).map( ( menuCommand ) => {\n\t\t\tconst label = sprintf(\n\t\t\t\t/* translators: %s: menu label */\n\t\t\t\t__( 'Go to: %s' ),\n\t\t\t\tmenuCommand.label\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tname: menuCommand.name,\n\t\t\t\tlabel,\n\t\t\t\tsearchLabel: label,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tdocument.location = menuCommand.url;\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t};\n\t\t} );\n\t}, [ menuCommands ] );\n\tuseCommands( commands );\n\n\tuseCommandLoader( {\n\t\tname: 'core/view-site',\n\t\thook: getViewSiteCommand(),\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQA,MAAMM,kBAAkB,GAAGA,CAAA,KAC1B,SAASC,kBAAkBA,CAAA,EAAG;EAC7B,MAAMC,OAAO,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxC;IACA,OAAOA,MAAM,CAAEC,eAAU,CAAC,CAACC,eAAe,CACzC,MAAM,EACN,gBACD,CAAC,EAAEC,IAAI;EACR,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,QAAQ,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC/B,IAAK,CAAEP,OAAO,EAAG;MAChB,OAAO,EAAE;IACV;IAEA,OAAO,CACN;MACCQ,IAAI,EAAE,gBAAgB;MACtBC,KAAK,EAAE,IAAAC,QAAE,EAAE,WAAY,CAAC;MACxBC,IAAI,EAAEC,eAAQ;MACdC,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1BA,KAAK,CAAC,CAAC;QACPC,MAAM,CAACC,IAAI,CAAEhB,OAAO,EAAE,QAAS,CAAC;MACjC;IACD,CAAC,CACD;EACF,CAAC,EAAE,CAAEA,OAAO,CAAG,CAAC;EAEhB,OAAO;IACNiB,SAAS,EAAE,KAAK;IAChBX;EACD,CAAC;AACF,CAAC;AAEK,SAASY,0BAA0BA,CAAEC,YAAY,EAAG;EAC1D,MAAMb,QAAQ,GAAG,IAAAC,gBAAO,EAAE,MAAM;IAC/B,OAAO,CAAEY,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,EAAE,EAAGC,GAAG,CAAIC,WAAW,IAAM;MACrD,MAAMZ,KAAK,GAAG,IAAAa,aAAO,EACpB;MACA,IAAAZ,QAAE,EAAE,WAAY,CAAC,EACjBW,WAAW,CAACZ,KACb,CAAC;MACD,OAAO;QACND,IAAI,EAAEa,WAAW,CAACb,IAAI;QACtBC,KAAK;QACLc,WAAW,EAAEd,KAAK;QAClBI,QAAQ,EAAEA,CAAE;UAAEC;QAAM,CAAC,KAAM;UAC1BU,QAAQ,CAACC,QAAQ,GAAGJ,WAAW,CAACK,GAAG;UACnCZ,KAAK,CAAC,CAAC;QACR;MACD,CAAC;IACF,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEK,YAAY,CAAG,CAAC;EACrB,IAAAQ,qBAAW,EAAErB,QAAS,CAAC;EAEvB,IAAAsB,0BAAgB,EAAE;IACjBpB,IAAI,EAAE,gBAAgB;IACtBqB,IAAI,EAAE/B,kBAAkB,CAAC;EAC1B,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/admin-navigation-commands.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCommandLoader, useCommands } from '@wordpress/commands';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nconst getViewSiteCommand = () =>\n\tfunction useViewSiteCommand() {\n\t\tconst homeUrl = useSelect( ( select ) => {\n\t\t\t// Site index.\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase'\n\t\t\t)?.home;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! homeUrl ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/view-site',\n\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\ticon: external,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\twindow.open( homeUrl, '_blank' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ homeUrl ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useAdminNavigationCommands( menuCommands ) {\n\tconst commands = useMemo( () => {\n\t\treturn ( menuCommands ?? [] ).map( ( menuCommand ) => {\n\t\t\tconst label = sprintf(\n\t\t\t\t/* translators: %s: menu label */\n\t\t\t\t__( 'Go to: %s' ),\n\t\t\t\tmenuCommand.label\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tname: menuCommand.name,\n\t\t\t\tlabel,\n\t\t\t\tsearchLabel: label,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tdocument.location = menuCommand.url;\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t};\n\t\t} );\n\t}, [ menuCommands ] );\n\tuseCommands( commands );\n\n\tuseCommandLoader( {\n\t\tname: 'core/view-site',\n\t\thook: getViewSiteCommand(),\n\t} );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AC1B,CAAE;AACH;",
6
+ "names": ["coreStore"]
7
+ }
package/build/index.js CHANGED
@@ -1,62 +1,51 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.initializeCommandPalette = initializeCommandPalette;
7
- Object.defineProperty(exports, "privateApis", {
8
- enumerable: true,
9
- get: function () {
10
- return _privateApis.privateApis;
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 });
11
14
  }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var index_exports = {};
19
+ __export(index_exports, {
20
+ initializeCommandPalette: () => initializeCommandPalette,
21
+ privateApis: () => import_private_apis.privateApis
12
22
  });
13
- var _element = require("@wordpress/element");
14
- var _router = require("@wordpress/router");
15
- var _commands = require("@wordpress/commands");
16
- var _adminNavigationCommands = require("./admin-navigation-commands");
17
- var _siteEditorNavigationCommands = require("./site-editor-navigation-commands");
18
- var _lockUnlock = require("./lock-unlock");
19
- var _jsxRuntime = require("react/jsx-runtime");
20
- var _privateApis = require("./private-apis");
21
- /**
22
- * WordPress dependencies
23
- */
24
-
25
- /**
26
- * Internal dependencies
27
- */
28
-
29
- const {
30
- RouterProvider
31
- } = (0, _lockUnlock.unlock)(_router.privateApis);
32
-
33
- // Register core commands and render the Command Palette.
34
- function CommandPalette({
35
- settings
36
- }) {
37
- const {
38
- menu_commands: menuCommands
39
- } = settings;
40
- (0, _adminNavigationCommands.useAdminNavigationCommands)(menuCommands);
41
- (0, _siteEditorNavigationCommands.useSiteEditorNavigationCommands)();
42
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(RouterProvider, {
43
- pathArg: "p",
44
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_commands.CommandMenu, {})
45
- });
23
+ module.exports = __toCommonJS(index_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_element = require("@wordpress/element");
26
+ var import_router = require("@wordpress/router");
27
+ var import_commands = require("@wordpress/commands");
28
+ var import_admin_navigation_commands = require("./admin-navigation-commands");
29
+ var import_site_editor_navigation_commands = require("./site-editor-navigation-commands");
30
+ var import_lock_unlock = require("./lock-unlock");
31
+ var import_private_apis = require("./private-apis");
32
+ const { RouterProvider } = (0, import_lock_unlock.unlock)(import_router.privateApis);
33
+ function CommandPalette({ settings }) {
34
+ const { menu_commands: menuCommands } = settings;
35
+ (0, import_admin_navigation_commands.useAdminNavigationCommands)(menuCommands);
36
+ (0, import_site_editor_navigation_commands.useSiteEditorNavigationCommands)();
37
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouterProvider, { pathArg: "p", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_commands.CommandMenu, {}) });
46
38
  }
47
-
48
- /**
49
- * Initializes the Command Palette.
50
- *
51
- * @param {Object} settings Command palette settings.
52
- */
53
39
  function initializeCommandPalette(settings) {
54
- const root = document.createElement('div');
40
+ const root = document.createElement("div");
55
41
  document.body.appendChild(root);
56
- (0, _element.createRoot)(root).render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_element.StrictMode, {
57
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CommandPalette, {
58
- settings: settings
59
- })
60
- }));
42
+ (0, import_element.createRoot)(root).render(
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_element.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandPalette, { settings }) })
44
+ );
61
45
  }
62
- //# sourceMappingURL=index.js.map
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ initializeCommandPalette,
49
+ privateApis
50
+ });
51
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_element","require","_router","_commands","_adminNavigationCommands","_siteEditorNavigationCommands","_lockUnlock","_jsxRuntime","_privateApis","RouterProvider","unlock","routerPrivateApis","CommandPalette","settings","menu_commands","menuCommands","useAdminNavigationCommands","useSiteEditorNavigationCommands","jsx","pathArg","children","CommandMenu","initializeCommandPalette","root","document","createElement","body","appendChild","createRoot","render","StrictMode"],"sources":["@wordpress/core-commands/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { CommandMenu } from '@wordpress/commands';\n\n/**\n * Internal dependencies\n */\nimport { useAdminNavigationCommands } from './admin-navigation-commands';\nimport { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';\nimport { unlock } from './lock-unlock';\nexport { privateApis } from './private-apis';\n\nconst { RouterProvider } = unlock( routerPrivateApis );\n\n// Register core commands and render the Command Palette.\nfunction CommandPalette( { settings } ) {\n\tconst { menu_commands: menuCommands } = settings;\n\tuseAdminNavigationCommands( menuCommands );\n\tuseSiteEditorNavigationCommands();\n\treturn (\n\t\t<RouterProvider pathArg=\"p\">\n\t\t\t<CommandMenu />\n\t\t</RouterProvider>\n\t);\n}\n\n/**\n * Initializes the Command Palette.\n *\n * @param {Object} settings Command palette settings.\n */\nexport function initializeCommandPalette( settings ) {\n\tconst root = document.createElement( 'div' );\n\tdocument.body.appendChild( root );\n\tcreateRoot( root ).render(\n\t\t<StrictMode>\n\t\t\t<CommandPalette settings={ settings } />\n\t\t</StrictMode>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,QAAA,GAA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{ createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { CommandMenu } from '@wordpress/commands';\n\n/**\n * Internal dependencies\n */\nimport { useAdminNavigationCommands } from './admin-navigation-commands';\nimport { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';\nimport { unlock } from './lock-unlock';\nexport { privateApis } from './private-apis';\n\nconst { RouterProvider } = unlock( routerPrivateApis );\n\n// Register core commands and render the Command Palette.\nfunction CommandPalette( { settings } ) {\n\tconst { menu_commands: menuCommands } = settings;\n\tuseAdminNavigationCommands( menuCommands );\n\tuseSiteEditorNavigationCommands();\n\treturn (\n\t\t<RouterProvider pathArg=\"p\">\n\t\t\t<CommandMenu />\n\t\t</RouterProvider>\n\t);\n}\n\n/**\n * Initializes the Command Palette.\n *\n * @param {Object} settings Command palette settings.\n */\nexport function initializeCommandPalette( settings ) {\n\tconst root = document.createElement( 'div' );\n\tdocument.body.appendChild( root );\n\tcreateRoot( root ).render(\n\t\t<StrictMode>\n\t\t\t<CommandPalette settings={ settings } />\n\t\t</StrictMode>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBG;AArBH,qBAAuC;AACvC,oBAAiD;AACjD,sBAA4B;AAK5B,uCAA2C;AAC3C,6CAAgD;AAChD,yBAAuB;AACvB,0BAA4B;AAE5B,MAAM,EAAE,eAAe,QAAI,2BAAQ,cAAAA,WAAkB;AAGrD,SAAS,eAAgB,EAAE,SAAS,GAAI;AACvC,QAAM,EAAE,eAAe,aAAa,IAAI;AACxC,mEAA4B,YAAa;AACzC,8EAAgC;AAChC,SACC,4CAAC,kBAAe,SAAQ,KACvB,sDAAC,+BAAY,GACd;AAEF;AAOO,SAAS,yBAA0B,UAAW;AACpD,QAAM,OAAO,SAAS,cAAe,KAAM;AAC3C,WAAS,KAAK,YAAa,IAAK;AAChC,iCAAY,IAAK,EAAE;AAAA,IAClB,4CAAC,6BACA,sDAAC,kBAAe,UAAsB,GACvC;AAAA,EACD;AACD;",
6
+ "names": ["routerPrivateApis"]
7
+ }
@@ -1,18 +1,34 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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
- exports.unlock = exports.lock = void 0;
7
- var _privateApis = require("@wordpress/private-apis");
8
- /**
9
- * WordPress dependencies
10
- */
11
-
12
- const {
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/core-commands"
28
+ );
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
13
31
  lock,
14
32
  unlock
15
- } = (0, _privateApis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/core-commands');
16
- exports.unlock = unlock;
17
- exports.lock = lock;
18
- //# sourceMappingURL=lock-unlock.js.map
33
+ });
34
+ //# sourceMappingURL=lock-unlock.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/core-commands/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/core-commands'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,+HAA+H,EAC/H,0BACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/lock-unlock.js"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/core-commands'\n\t);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAiE;AAE1D,MAAM,EAAE,MAAM,OAAO,QAC3B;AAAA,EACC;AAAA,EACA;AACD;",
6
+ "names": []
7
+ }
@@ -1,22 +1,38 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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 private_apis_exports = {};
19
+ __export(private_apis_exports, {
20
+ privateApis: () => privateApis
5
21
  });
6
- exports.privateApis = void 0;
7
- var _adminNavigationCommands = require("./admin-navigation-commands");
8
- var _siteEditorNavigationCommands = require("./site-editor-navigation-commands");
9
- var _lockUnlock = require("./lock-unlock");
10
- /**
11
- * Internal dependencies
12
- */
13
-
22
+ module.exports = __toCommonJS(private_apis_exports);
23
+ var import_admin_navigation_commands = require("./admin-navigation-commands");
24
+ var import_site_editor_navigation_commands = require("./site-editor-navigation-commands");
25
+ var import_lock_unlock = require("./lock-unlock");
14
26
  function useCommands() {
15
- (0, _adminNavigationCommands.useAdminNavigationCommands)();
16
- (0, _siteEditorNavigationCommands.useSiteEditorNavigationCommands)();
27
+ (0, import_admin_navigation_commands.useAdminNavigationCommands)();
28
+ (0, import_site_editor_navigation_commands.useSiteEditorNavigationCommands)();
17
29
  }
18
- const privateApis = exports.privateApis = {};
19
- (0, _lockUnlock.lock)(privateApis, {
30
+ const privateApis = {};
31
+ (0, import_lock_unlock.lock)(privateApis, {
20
32
  useCommands
21
33
  });
22
- //# sourceMappingURL=private-apis.js.map
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ privateApis
37
+ });
38
+ //# sourceMappingURL=private-apis.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_adminNavigationCommands","require","_siteEditorNavigationCommands","_lockUnlock","useCommands","useAdminNavigationCommands","useSiteEditorNavigationCommands","privateApis","exports","lock"],"sources":["@wordpress/core-commands/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { useAdminNavigationCommands } from './admin-navigation-commands';\nimport { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';\nimport { lock } from './lock-unlock';\n\nfunction useCommands() {\n\tuseAdminNavigationCommands();\n\tuseSiteEditorNavigationCommands();\n}\n\nexport const privateApis = {};\nlock( privateApis, {\n\tuseCommands,\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,SAASG,WAAWA,CAAA,EAAG;EACtB,IAAAC,mDAA0B,EAAC,CAAC;EAC5B,IAAAC,6DAA+B,EAAC,CAAC;AAClC;AAEO,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,CAAC,CAAC;AAC7B,IAAAE,gBAAI,EAAEF,WAAW,EAAE;EAClBH;AACD,CAAE,CAAC","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/private-apis.js"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport { useAdminNavigationCommands } from './admin-navigation-commands';\nimport { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';\nimport { lock } from './lock-unlock';\n\nfunction useCommands() {\n\tuseAdminNavigationCommands();\n\tuseSiteEditorNavigationCommands();\n}\n\nexport const privateApis = {};\nlock( privateApis, {\n\tuseCommands,\n} );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uCAA2C;AAC3C,6CAAgD;AAChD,yBAAqB;AAErB,SAAS,cAAc;AACtB,mEAA2B;AAC3B,8EAAgC;AACjC;AAEO,MAAM,cAAc,CAAC;AAAA,IAC5B,yBAAM,aAAa;AAAA,EAClB;AACD,CAAE;",
6
+ "names": []
7
+ }