@metapages/metapage 1.10.5 → 1.10.6

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/README.md CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  renderMetapage,
37
37
  Metapage,
38
38
  Metaframe,
39
- } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
39
+ } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
40
40
  ```
41
41
 
42
42
  ## Quick Start
@@ -82,7 +82,7 @@ The `renderMetapage` function the `react-grid-layout` layout in `metapage.json`:
82
82
  If you're building a component to use in a metapage:
83
83
 
84
84
  ```javascript
85
- import { Metaframe } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
85
+ import { Metaframe } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
86
86
 
87
87
  const metaframe = new Metaframe();
88
88
 
@@ -223,7 +223,7 @@ metaframe.onInput("file", (file) => {
223
223
  <div id="metapage-container"></div>
224
224
 
225
225
  <script type="module">
226
- import { renderMetapage } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
226
+ import { renderMetapage } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
227
227
 
228
228
  const definition = await fetch(
229
229
  "https://metapage.io/m/87ae11673508447e883b598bf7da9c5d/metapage.json",
@@ -258,7 +258,7 @@ metaframe.onInput("file", (file) => {
258
258
  ### Building a Metaframe Component
259
259
 
260
260
  ```javascript
261
- import { Metaframe } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
261
+ import { Metaframe } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
262
262
 
263
263
  const metaframe = new Metaframe();
264
264
 
@@ -335,7 +335,7 @@ Metaframes can read and write to their URL hash parameters:
335
335
  import {
336
336
  getHashParamValueJsonFromWindow,
337
337
  setHashParamValueJsonInWindow,
338
- } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
338
+ } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
339
339
 
340
340
  // Read from URL hash
341
341
  const config = getHashParamValueJsonFromWindow("config");
@@ -621,7 +621,7 @@ Example minimal metaframe:
621
621
  </head>
622
622
  <body>
623
623
  <script type="module">
624
- import { Metaframe } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
624
+ import { Metaframe } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
625
625
 
626
626
  const metaframe = new Metaframe();
627
627
 
@@ -645,7 +645,7 @@ import {
645
645
  MetapageDefinition,
646
646
  MetaframeInputMap,
647
647
  MetapageInstanceInputs,
648
- } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.5";
648
+ } from "https://cdn.jsdelivr.net/npm/@metapages/metapage@1.10.6";
649
649
 
650
650
  const definition: MetapageDefinition = {
651
651
  metaframes: {
package/dist/index.js CHANGED
@@ -3742,7 +3742,7 @@ class zr extends os.EventEmitter {
3742
3742
  s = s.substring(1);
3743
3743
  s = window.location.protocol + "//" + window.location.hostname + (window.location.port && window.location.port != "" ? ":" + window.location.port : "") + "/" + s;
3744
3744
  }
3745
- if (this.url = s, this._metapage = e, this._debug = r, r) {
3745
+ if (this.url = s, this._metapage = e, this._debug = r, r && !s.startsWith("data:")) {
3746
3746
  var a = new URL(this.url);
3747
3747
  a.searchParams.set(Gt.mp_debug, "true"), this.url = a.href;
3748
3748
  }
@@ -4002,6 +4002,8 @@ class nt extends rr {
4002
4002
  this.log(`Warning: Cannot inject secrets for unknown metaframe: ${s}`);
4003
4003
  return;
4004
4004
  }
4005
+ if (i.url.startsWith("data:"))
4006
+ return;
4005
4007
  this._injectedSecrets[s] || (this._injectedSecrets[s] = {}), this._injectedQuerySecrets[s] || (this._injectedQuerySecrets[s] = {}), this._originalSecretHashParams[s] || (this._originalSecretHashParams[s] = {}), this._originalSecretQueryParams[s] || (this._originalSecretQueryParams[s] = {});
4006
4008
  const o = new URL(i.url);
4007
4009
  n.hashParams && Object.entries(n.hashParams).forEach(([c, l]) => {
@@ -4038,7 +4040,7 @@ class nt extends rr {
4038
4040
  if (!((l = e.metaframes) != null && l[n]))
4039
4041
  return;
4040
4042
  const i = this._metaframes[n];
4041
- if (!i)
4043
+ if (!i || i.url.startsWith("data:"))
4042
4044
  return;
4043
4045
  let o = i.url;
4044
4046
  const r = this._injectedSecrets[n] || {}, a = this._originalSecretHashParams[n] || {};
@@ -4097,7 +4099,7 @@ class nt extends rr {
4097
4099
  var p, g, m, _, v;
4098
4100
  if (this._metaframes[f]) {
4099
4101
  const M = i[f] || {}, w = o[f] || {}, E = this._metaframes[f], P = (m = (g = (p = this._definition) == null ? void 0 : p.metaframes) == null ? void 0 : g[f]) == null ? void 0 : m.url;
4100
- if (!P)
4102
+ if (!P || P.startsWith("data:"))
4101
4103
  return;
4102
4104
  let O = new URL(P);
4103
4105
  if (Object.keys(M).length > 0) {
@@ -4415,6 +4417,8 @@ class nt extends rr {
4415
4417
  break;
4416
4418
  case q.HashParamsUpdate:
4417
4419
  if (i) {
4420
+ if (i.url.startsWith("data:"))
4421
+ break;
4418
4422
  const c = e.params, l = c.metaframe;
4419
4423
  let f = new URL(i.url);
4420
4424
  f.hash = c.hash, this._injectedSecrets[l] && Object.entries(this._injectedSecrets[l]).forEach(([m, _]) => {