@wordpress/interactivity-router 2.32.0 → 2.32.1-next.b8c8708f3.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/assets/dynamic-importmap/fetch.js +32 -43
  3. package/build/assets/dynamic-importmap/fetch.js.map +7 -1
  4. package/build/assets/dynamic-importmap/index.js +43 -73
  5. package/build/assets/dynamic-importmap/index.js.map +7 -1
  6. package/build/assets/dynamic-importmap/loader.js +139 -172
  7. package/build/assets/dynamic-importmap/loader.js.map +7 -1
  8. package/build/assets/dynamic-importmap/resolver.js +99 -112
  9. package/build/assets/dynamic-importmap/resolver.js.map +7 -1
  10. package/build/assets/script-modules.js +46 -58
  11. package/build/assets/script-modules.js.map +7 -1
  12. package/build/assets/scs.js +30 -39
  13. package/build/assets/scs.js.map +7 -1
  14. package/build/assets/styles.js +81 -171
  15. package/build/assets/styles.js.map +7 -1
  16. package/build/full-page.js +43 -36
  17. package/build/full-page.js.map +7 -1
  18. package/build/index.js +139 -265
  19. package/build/index.js.map +7 -1
  20. package/build-module/assets/dynamic-importmap/fetch.js +11 -39
  21. package/build-module/assets/dynamic-importmap/fetch.js.map +7 -1
  22. package/build-module/assets/dynamic-importmap/index.js +18 -52
  23. package/build-module/assets/dynamic-importmap/index.js.map +7 -1
  24. package/build-module/assets/dynamic-importmap/loader.js +101 -165
  25. package/build-module/assets/dynamic-importmap/loader.js.map +7 -1
  26. package/build-module/assets/dynamic-importmap/resolver.js +78 -108
  27. package/build-module/assets/dynamic-importmap/resolver.js.map +7 -1
  28. package/build-module/assets/script-modules.js +25 -49
  29. package/build-module/assets/script-modules.js.map +7 -1
  30. package/build-module/assets/scs.js +9 -35
  31. package/build-module/assets/scs.js.map +7 -1
  32. package/build-module/assets/styles.js +58 -163
  33. package/build-module/assets/styles.js.map +7 -1
  34. package/build-module/full-page.js +21 -32
  35. package/build-module/full-page.js.map +7 -1
  36. package/build-module/index.js +108 -257
  37. package/build-module/index.js.map +7 -1
  38. package/build-types/index.d.ts.map +1 -1
  39. package/package.json +12 -4
  40. package/src/index.ts +2 -3
  41. package/tsconfig.main.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## 2.32.0 (2025-10-01)
6
6
 
7
+ - Update router regions inside elements with `data-wp-interactive`. ([#71635](https://github.com/WordPress/gutenberg/pull/71635))
8
+
7
9
  ## 2.31.0 (2025-09-17)
8
10
 
9
11
  ## 2.30.0 (2025-09-03)
@@ -1,43 +1,29 @@
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 fetch_exports = {};
19
+ __export(fetch_exports, {
20
+ fetchModule: () => fetchModule
5
21
  });
6
- exports.fetchModule = fetchModule;
7
- /**
8
- * This code is derived from the following projects:
9
- *
10
- * 1. dynamic-importmap (https://github.com/keller-mark/dynamic-importmap)
11
- * 2. es-module-shims (https://github.com/guybedford/es-module-shims)
12
- *
13
- * The original implementation was created by Guy Bedford in es-module-shims,
14
- * then adapted by Mark Keller in dynamic-importmap, and further modified
15
- * for use in this project.
16
- *
17
- * Both projects are licensed under the MIT license.
18
- *
19
- * MIT License: https://opensource.org/licenses/MIT
20
- */
21
-
22
- /**
23
- * Internal dependencies
24
- */
25
-
22
+ module.exports = __toCommonJS(fetch_exports);
26
23
  const fetching = (url, parent) => {
27
- return ` fetching ${url}${parent ? ` from ${parent}` : ''}`;
24
+ return ` fetching ${url}${parent ? ` from ${parent}` : ""}`;
28
25
  };
29
26
  const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
30
-
31
- /**
32
- * Fetches the passed module URL and return the corresponding `ModuleLoad`
33
- * instance. If the passed URL does not point to a JS file, the function
34
- * throws and error.
35
- *
36
- * @param url Module URL.
37
- * @param fetchOpts Fetch init options.
38
- * @param parent Parent module URL referencing this URL (if any).
39
- * @return Promise with a `ModuleLoad` instance.
40
- */
41
27
  async function fetchModule(url, fetchOpts, parent) {
42
28
  let res;
43
29
  try {
@@ -48,13 +34,16 @@ async function fetchModule(url, fetchOpts, parent) {
48
34
  if (!res.ok) {
49
35
  throw Error(`Error ${res.status}${fetching(url, parent)}.`);
50
36
  }
51
- const contentType = res.headers.get('content-type');
37
+ const contentType = res.headers.get("content-type");
52
38
  if (!jsContentType.test(contentType)) {
53
- throw Error(`Bad Content-Type "${contentType}"${fetching(url, parent)}.`);
39
+ throw Error(
40
+ `Bad Content-Type "${contentType}"${fetching(url, parent)}.`
41
+ );
54
42
  }
55
- return {
56
- responseUrl: res.url,
57
- source: await res.text()
58
- };
43
+ return { responseUrl: res.url, source: await res.text() };
59
44
  }
60
- //# sourceMappingURL=fetch.js.map
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ fetchModule
48
+ });
49
+ //# sourceMappingURL=fetch.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["fetching","url","parent","jsContentType","fetchModule","fetchOpts","res","fetch","e","Error","ok","status","contentType","headers","get","test","responseUrl","source","text"],"sources":["@wordpress/interactivity-router/src/assets/dynamic-importmap/fetch.ts"],"sourcesContent":["/**\n * This code is derived from the following projects:\n *\n * 1. dynamic-importmap (https://github.com/keller-mark/dynamic-importmap)\n * 2. es-module-shims (https://github.com/guybedford/es-module-shims)\n *\n * The original implementation was created by Guy Bedford in es-module-shims,\n * then adapted by Mark Keller in dynamic-importmap, and further modified\n * for use in this project.\n *\n * Both projects are licensed under the MIT license.\n *\n * MIT License: https://opensource.org/licenses/MIT\n */\n\n/**\n * Internal dependencies\n */\nimport { type ModuleLoad } from './loader';\n\nconst fetching = ( url: string, parent?: string ) => {\n\treturn ` fetching ${ url }${ parent ? ` from ${ parent }` : '' }`;\n};\n\nconst jsContentType = /^(text|application)\\/(x-)?javascript(;|$)/;\n\n/**\n * Fetches the passed module URL and return the corresponding `ModuleLoad`\n * instance. If the passed URL does not point to a JS file, the function\n * throws and error.\n *\n * @param url Module URL.\n * @param fetchOpts Fetch init options.\n * @param parent Parent module URL referencing this URL (if any).\n * @return Promise with a `ModuleLoad` instance.\n */\nexport async function fetchModule(\n\turl: string,\n\tfetchOpts: RequestInit,\n\tparent: string\n): Promise< ModuleLoad > {\n\tlet res: Response;\n\ttry {\n\t\tres = await fetch( url, fetchOpts );\n\t} catch ( e ) {\n\t\tthrow Error( `Network error${ fetching( url, parent ) }.` );\n\t}\n\tif ( ! res.ok ) {\n\t\tthrow Error( `Error ${ res.status }${ fetching( url, parent ) }.` );\n\t}\n\tconst contentType = res.headers.get( 'content-type' );\n\tif ( ! jsContentType.test( contentType ) ) {\n\t\tthrow Error(\n\t\t\t`Bad Content-Type \"${ contentType }\"${ fetching( url, parent ) }.`\n\t\t);\n\t}\n\treturn { responseUrl: res.url, source: await res.text() };\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA,MAAMA,QAAQ,GAAGA,CAAEC,GAAW,EAAEC,MAAe,KAAM;EACpD,OAAO,aAAcD,GAAG,GAAKC,MAAM,GAAG,SAAUA,MAAM,EAAG,GAAG,EAAE,EAAG;AAClE,CAAC;AAED,MAAMC,aAAa,GAAG,2CAA2C;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,WAAWA,CAChCH,GAAW,EACXI,SAAsB,EACtBH,MAAc,EACU;EACxB,IAAII,GAAa;EACjB,IAAI;IACHA,GAAG,GAAG,MAAMC,KAAK,CAAEN,GAAG,EAAEI,SAAU,CAAC;EACpC,CAAC,CAAC,OAAQG,CAAC,EAAG;IACb,MAAMC,KAAK,CAAE,gBAAiBT,QAAQ,CAAEC,GAAG,EAAEC,MAAO,CAAC,GAAK,CAAC;EAC5D;EACA,IAAK,CAAEI,GAAG,CAACI,EAAE,EAAG;IACf,MAAMD,KAAK,CAAE,SAAUH,GAAG,CAACK,MAAM,GAAKX,QAAQ,CAAEC,GAAG,EAAEC,MAAO,CAAC,GAAK,CAAC;EACpE;EACA,MAAMU,WAAW,GAAGN,GAAG,CAACO,OAAO,CAACC,GAAG,CAAE,cAAe,CAAC;EACrD,IAAK,CAAEX,aAAa,CAACY,IAAI,CAAEH,WAAY,CAAC,EAAG;IAC1C,MAAMH,KAAK,CACV,qBAAsBG,WAAW,IAAMZ,QAAQ,CAAEC,GAAG,EAAEC,MAAO,CAAC,GAC/D,CAAC;EACF;EACA,OAAO;IAAEc,WAAW,EAAEV,GAAG,CAACL,GAAG;IAAEgB,MAAM,EAAE,MAAMX,GAAG,CAACY,IAAI,CAAC;EAAE,CAAC;AAC1D","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/assets/dynamic-importmap/fetch.ts"],
4
+ "sourcesContent": ["/**\n * This code is derived from the following projects:\n *\n * 1. dynamic-importmap (https://github.com/keller-mark/dynamic-importmap)\n * 2. es-module-shims (https://github.com/guybedford/es-module-shims)\n *\n * The original implementation was created by Guy Bedford in es-module-shims,\n * then adapted by Mark Keller in dynamic-importmap, and further modified\n * for use in this project.\n *\n * Both projects are licensed under the MIT license.\n *\n * MIT License: https://opensource.org/licenses/MIT\n */\n\n/**\n * Internal dependencies\n */\nimport { type ModuleLoad } from './loader';\n\nconst fetching = ( url: string, parent?: string ) => {\n\treturn ` fetching ${ url }${ parent ? ` from ${ parent }` : '' }`;\n};\n\nconst jsContentType = /^(text|application)\\/(x-)?javascript(;|$)/;\n\n/**\n * Fetches the passed module URL and return the corresponding `ModuleLoad`\n * instance. If the passed URL does not point to a JS file, the function\n * throws and error.\n *\n * @param url Module URL.\n * @param fetchOpts Fetch init options.\n * @param parent Parent module URL referencing this URL (if any).\n * @return Promise with a `ModuleLoad` instance.\n */\nexport async function fetchModule(\n\turl: string,\n\tfetchOpts: RequestInit,\n\tparent: string\n): Promise< ModuleLoad > {\n\tlet res: Response;\n\ttry {\n\t\tres = await fetch( url, fetchOpts );\n\t} catch ( e ) {\n\t\tthrow Error( `Network error${ fetching( url, parent ) }.` );\n\t}\n\tif ( ! res.ok ) {\n\t\tthrow Error( `Error ${ res.status }${ fetching( url, parent ) }.` );\n\t}\n\tconst contentType = res.headers.get( 'content-type' );\n\tif ( ! jsContentType.test( contentType ) ) {\n\t\tthrow Error(\n\t\t\t`Bad Content-Type \"${ contentType }\"${ fetching( url, parent ) }.`\n\t\t);\n\t}\n\treturn { responseUrl: res.url, source: await res.text() };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA,MAAM,WAAW,CAAE,KAAa,WAAqB;AACpD,SAAO,aAAc,GAAI,GAAI,SAAS,SAAU,MAAO,KAAK,EAAG;AAChE;AAEA,MAAM,gBAAgB;AAYtB,eAAsB,YACrB,KACA,WACA,QACwB;AACxB,MAAI;AACJ,MAAI;AACH,UAAM,MAAM,MAAO,KAAK,SAAU;AAAA,EACnC,SAAU,GAAI;AACb,UAAM,MAAO,gBAAiB,SAAU,KAAK,MAAO,CAAE,GAAI;AAAA,EAC3D;AACA,MAAK,CAAE,IAAI,IAAK;AACf,UAAM,MAAO,SAAU,IAAI,MAAO,GAAI,SAAU,KAAK,MAAO,CAAE,GAAI;AAAA,EACnE;AACA,QAAM,cAAc,IAAI,QAAQ,IAAK,cAAe;AACpD,MAAK,CAAE,cAAc,KAAM,WAAY,GAAI;AAC1C,UAAM;AAAA,MACL,qBAAsB,WAAY,IAAK,SAAU,KAAK,MAAO,CAAE;AAAA,IAChE;AAAA,EACD;AACA,SAAO,EAAE,aAAa,IAAI,KAAK,QAAQ,MAAM,IAAI,KAAK,EAAE;AACzD;",
6
+ "names": []
7
+ }
@@ -1,91 +1,61 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "importPreloadedModule", {
7
- enumerable: true,
8
- get: function () {
9
- return _loader.importPreloadedModule;
10
- }
11
- });
12
- exports.importWithMap = importWithMap;
13
- Object.defineProperty(exports, "initialImportMap", {
14
- enumerable: true,
15
- get: function () {
16
- return _loader.initialImportMap;
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 });
17
14
  }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var dynamic_importmap_exports = {};
19
+ __export(dynamic_importmap_exports, {
20
+ importPreloadedModule: () => import_loader2.importPreloadedModule,
21
+ importWithMap: () => importWithMap,
22
+ initialImportMap: () => import_loader2.initialImportMap,
23
+ preloadWithMap: () => preloadWithMap
18
24
  });
19
- exports.preloadWithMap = preloadWithMap;
20
- var _resolver = require("./resolver");
21
- var _loader = require("./loader");
22
- /**
23
- * This code is derived from the following projects:
24
- *
25
- * 1. dynamic-importmap (https://github.com/keller-mark/dynamic-importmap)
26
- * 2. es-module-shims (https://github.com/guybedford/es-module-shims)
27
- *
28
- * The original implementation was created by Guy Bedford in es-module-shims,
29
- * then adapted by Mark Keller in dynamic-importmap, and further modified
30
- * for use in this project.
31
- *
32
- * Both projects are licensed under the MIT license.
33
- *
34
- * MIT License: https://opensource.org/licenses/MIT
35
- */
36
-
37
- /**
38
- * Internal dependencies
39
- */
40
-
41
- // TODO: check if this baseURI should change per document, and so
42
- // it need to be passed as a parameter to methods like `importWithMap`
43
- // and `preloadWithMap`.
25
+ module.exports = __toCommonJS(dynamic_importmap_exports);
26
+ var import_resolver = require("./resolver");
27
+ var import_loader = require("./loader");
28
+ var import_loader2 = require("./loader");
44
29
  const baseUrl = document.baseURI;
45
30
  const pageBaseUrl = baseUrl;
46
- Object.defineProperty(self, 'wpInteractivityRouterImport', {
31
+ Object.defineProperty(self, "wpInteractivityRouterImport", {
47
32
  value: importShim,
48
33
  writable: false,
49
34
  enumerable: false,
50
35
  configurable: false
51
36
  });
52
37
  async function importShim(id) {
53
- await _loader.initPromise;
54
- return (0, _loader.topLevelLoad)((0, _resolver.resolve)(id, pageBaseUrl), {
55
- credentials: 'same-origin'
38
+ await import_loader.initPromise;
39
+ return (0, import_loader.topLevelLoad)((0, import_resolver.resolve)(id, pageBaseUrl), {
40
+ credentials: "same-origin"
56
41
  });
57
42
  }
58
-
59
- /**
60
- * Imports the module with the passed ID.
61
- *
62
- * The module is resolved against the internal dynamic import map,
63
- * extended with the passed import map.
64
- *
65
- * @param id Module ID.
66
- * @param importMapIn Import map.
67
- * @return Resolved module.
68
- */
69
43
  async function importWithMap(id, importMapIn) {
70
- (0, _resolver.addImportMap)(importMapIn);
44
+ (0, import_resolver.addImportMap)(importMapIn);
71
45
  return importShim(id);
72
46
  }
73
-
74
- /**
75
- * Preloads the module with the passed ID along with its dependencies.
76
- *
77
- * The module is resolved against the internal dynamic import map,
78
- * extended with the passed import map.
79
- *
80
- * @param id Module ID.
81
- * @param importMapIn Import map.
82
- * @return Resolved `ModuleLoad` instance.
83
- */
84
47
  async function preloadWithMap(id, importMapIn) {
85
- (0, _resolver.addImportMap)(importMapIn);
86
- await _loader.initPromise;
87
- return (0, _loader.preloadModule)((0, _resolver.resolve)(id, pageBaseUrl), {
88
- credentials: 'same-origin'
48
+ (0, import_resolver.addImportMap)(importMapIn);
49
+ await import_loader.initPromise;
50
+ return (0, import_loader.preloadModule)((0, import_resolver.resolve)(id, pageBaseUrl), {
51
+ credentials: "same-origin"
89
52
  });
90
53
  }
91
- //# sourceMappingURL=index.js.map
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ importPreloadedModule,
57
+ importWithMap,
58
+ initialImportMap,
59
+ preloadWithMap
60
+ });
61
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_resolver","require","_loader","baseUrl","document","baseURI","pageBaseUrl","Object","defineProperty","self","value","importShim","writable","enumerable","configurable","id","initPromise","topLevelLoad","resolve","credentials","importWithMap","importMapIn","addImportMap","preloadWithMap","preloadModule"],"sources":["@wordpress/interactivity-router/src/assets/dynamic-importmap/index.ts"],"sourcesContent":["/**\n * This code is derived from the following projects:\n *\n * 1. dynamic-importmap (https://github.com/keller-mark/dynamic-importmap)\n * 2. es-module-shims (https://github.com/guybedford/es-module-shims)\n *\n * The original implementation was created by Guy Bedford in es-module-shims,\n * then adapted by Mark Keller in dynamic-importmap, and further modified\n * for use in this project.\n *\n * Both projects are licensed under the MIT license.\n *\n * MIT License: https://opensource.org/licenses/MIT\n */\n\n/**\n * Internal dependencies\n */\nimport { addImportMap, resolve } from './resolver';\nimport { initPromise, topLevelLoad, preloadModule } from './loader';\n\ntype ImportMap = {\n\timports?: Record< string, string >;\n\tscopes?: Record< string, Record< string, string > >;\n};\n\n// TODO: check if this baseURI should change per document, and so\n// it need to be passed as a parameter to methods like `importWithMap`\n// and `preloadWithMap`.\nconst baseUrl = document.baseURI;\nconst pageBaseUrl = baseUrl;\n\nObject.defineProperty( self, 'wpInteractivityRouterImport', {\n\tvalue: importShim,\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: false,\n} );\n\nasync function importShim< Module = unknown >( id: string ) {\n\tawait initPromise;\n\treturn topLevelLoad< Module >( resolve( id, pageBaseUrl ), {\n\t\tcredentials: 'same-origin',\n\t} );\n}\n\n/**\n * Imports the module with the passed ID.\n *\n * The module is resolved against the internal dynamic import map,\n * extended with the passed import map.\n *\n * @param id Module ID.\n * @param importMapIn Import map.\n * @return Resolved module.\n */\nexport async function importWithMap< Module = unknown >(\n\tid: string,\n\timportMapIn: ImportMap\n) {\n\taddImportMap( importMapIn );\n\treturn importShim< Module >( id );\n}\n\n/**\n * Preloads the module with the passed ID along with its dependencies.\n *\n * The module is resolved against the internal dynamic import map,\n * extended with the passed import map.\n *\n * @param id Module ID.\n * @param importMapIn Import map.\n * @return Resolved `ModuleLoad` instance.\n */\nexport async function preloadWithMap( id: string, importMapIn: ImportMap ) {\n\taddImportMap( importMapIn );\n\tawait initPromise;\n\treturn preloadModule( resolve( id, pageBaseUrl ), {\n\t\tcredentials: 'same-origin',\n\t} );\n}\n\nexport {\n\tinitialImportMap,\n\timportPreloadedModule,\n\ttype ModuleLoad,\n} from './loader';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AASA;AACA;AACA;AACA,MAAME,OAAO,GAAGC,QAAQ,CAACC,OAAO;AAChC,MAAMC,WAAW,GAAGH,OAAO;AAE3BI,MAAM,CAACC,cAAc,CAAEC,IAAI,EAAE,6BAA6B,EAAE;EAC3DC,KAAK,EAAEC,UAAU;EACjBC,QAAQ,EAAE,KAAK;EACfC,UAAU,EAAE,KAAK;EACjBC,YAAY,EAAE;AACf,CAAE,CAAC;AAEH,eAAeH,UAAUA,CAAsBI,EAAU,EAAG;EAC3D,MAAMC,mBAAW;EACjB,OAAO,IAAAC,oBAAY,EAAY,IAAAC,iBAAO,EAAEH,EAAE,EAAET,WAAY,CAAC,EAAE;IAC1Da,WAAW,EAAE;EACd,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,aAAaA,CAClCL,EAAU,EACVM,WAAsB,EACrB;EACD,IAAAC,sBAAY,EAAED,WAAY,CAAC;EAC3B,OAAOV,UAAU,CAAYI,EAAG,CAAC;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeQ,cAAcA,CAAER,EAAU,EAAEM,WAAsB,EAAG;EAC1E,IAAAC,sBAAY,EAAED,WAAY,CAAC;EAC3B,MAAML,mBAAW;EACjB,OAAO,IAAAQ,qBAAa,EAAE,IAAAN,iBAAO,EAAEH,EAAE,EAAET,WAAY,CAAC,EAAE;IACjDa,WAAW,EAAE;EACd,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/assets/dynamic-importmap/index.ts"],
4
+ "sourcesContent": ["/**\n * This code is derived from the following projects:\n *\n * 1. dynamic-importmap (https://github.com/keller-mark/dynamic-importmap)\n * 2. es-module-shims (https://github.com/guybedford/es-module-shims)\n *\n * The original implementation was created by Guy Bedford in es-module-shims,\n * then adapted by Mark Keller in dynamic-importmap, and further modified\n * for use in this project.\n *\n * Both projects are licensed under the MIT license.\n *\n * MIT License: https://opensource.org/licenses/MIT\n */\n\n/**\n * Internal dependencies\n */\nimport { addImportMap, resolve } from './resolver';\nimport { initPromise, topLevelLoad, preloadModule } from './loader';\n\ntype ImportMap = {\n\timports?: Record< string, string >;\n\tscopes?: Record< string, Record< string, string > >;\n};\n\n// TODO: check if this baseURI should change per document, and so\n// it need to be passed as a parameter to methods like `importWithMap`\n// and `preloadWithMap`.\nconst baseUrl = document.baseURI;\nconst pageBaseUrl = baseUrl;\n\nObject.defineProperty( self, 'wpInteractivityRouterImport', {\n\tvalue: importShim,\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: false,\n} );\n\nasync function importShim< Module = unknown >( id: string ) {\n\tawait initPromise;\n\treturn topLevelLoad< Module >( resolve( id, pageBaseUrl ), {\n\t\tcredentials: 'same-origin',\n\t} );\n}\n\n/**\n * Imports the module with the passed ID.\n *\n * The module is resolved against the internal dynamic import map,\n * extended with the passed import map.\n *\n * @param id Module ID.\n * @param importMapIn Import map.\n * @return Resolved module.\n */\nexport async function importWithMap< Module = unknown >(\n\tid: string,\n\timportMapIn: ImportMap\n) {\n\taddImportMap( importMapIn );\n\treturn importShim< Module >( id );\n}\n\n/**\n * Preloads the module with the passed ID along with its dependencies.\n *\n * The module is resolved against the internal dynamic import map,\n * extended with the passed import map.\n *\n * @param id Module ID.\n * @param importMapIn Import map.\n * @return Resolved `ModuleLoad` instance.\n */\nexport async function preloadWithMap( id: string, importMapIn: ImportMap ) {\n\taddImportMap( importMapIn );\n\tawait initPromise;\n\treturn preloadModule( resolve( id, pageBaseUrl ), {\n\t\tcredentials: 'same-origin',\n\t} );\n}\n\nexport {\n\tinitialImportMap,\n\timportPreloadedModule,\n\ttype ModuleLoad,\n} from './loader';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBA,sBAAsC;AACtC,oBAAyD;AA+DzD,IAAAA,iBAIO;AAzDP,MAAM,UAAU,SAAS;AACzB,MAAM,cAAc;AAEpB,OAAO,eAAgB,MAAM,+BAA+B;AAAA,EAC3D,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,cAAc;AACf,CAAE;AAEF,eAAe,WAAgC,IAAa;AAC3D,QAAM;AACN,aAAO,gCAAwB,yBAAS,IAAI,WAAY,GAAG;AAAA,IAC1D,aAAa;AAAA,EACd,CAAE;AACH;AAYA,eAAsB,cACrB,IACA,aACC;AACD,oCAAc,WAAY;AAC1B,SAAO,WAAsB,EAAG;AACjC;AAYA,eAAsB,eAAgB,IAAY,aAAyB;AAC1E,oCAAc,WAAY;AAC1B,QAAM;AACN,aAAO,iCAAe,yBAAS,IAAI,WAAY,GAAG;AAAA,IACjD,aAAa;AAAA,EACd,CAAE;AACH;",
6
+ "names": ["import_loader"]
7
+ }