sanity-plugin-iframe-pane 2.6.0 → 2.6.2-canary.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/README.md CHANGED
@@ -87,21 +87,24 @@ url: (doc) => resolveProductionUrl(doc),
87
87
  // OR a string
88
88
  url: `https://sanity.io`,
89
89
 
90
+ // OR a configuration for usage with `@sanity/preview-url-secret` and Next.js Draft Mode
91
+ url: {
92
+ origin: 'https://sanity.io' // or 'same-origin' if the app and studio are on the same origin
93
+ preview: (document) => document?.slug?.current ? `/posts/${document.slug.current}` : new Error('Missing slug'),
94
+ draftMode: '/api/draft' // the route you enable draft mode, see: https://github.com/sanity-io/visual-editing/tree/main/packages/preview-url-secret#sanitypreview-url-secret
95
+ },
96
+
90
97
  // Optional: Display the Url in the pane
91
98
  showDisplayUrl: true // boolean. default `true`.
92
99
 
93
100
  // Optional: Set the default size
94
101
  defaultSize: `mobile`, // default `desktop`
95
102
 
96
- // Optional: Add a reload button, or reload on new document revisions
103
+ // Optional: Add a reload button
97
104
  reload: {
98
105
  button: true, // default `undefined`
99
- revision: true, // boolean | number. default `undefined`. If a number is provided, add a delay (in ms) before the automatic reload on document revision. If `true` then a curated delay is used. Use `0` to have zero delay.`
100
106
  },
101
107
 
102
- // Optional: Display a spinner while the iframe is loading
103
- loader: true // boolean | string. default `'Loading…'`. If a string is provided, it will be display below the spinner (e.g. Loading…)
104
-
105
108
  // Optional: Pass attributes to the underlying `iframe` element:
106
109
  // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
107
110
  attributes: {
package/lib/index.cjs CHANGED
@@ -3,86 +3,25 @@
3
3
  Object.defineProperty(exports, '__esModule', {
4
4
  value: true
5
5
  });
6
- var utils = require('./_chunks/utils-HbzA_NjI.cjs');
7
6
  var jsxRuntime = require('react/jsx-runtime');
8
7
  var icons = require('@sanity/icons');
8
+ var createSecret = require('@sanity/preview-url-secret/create-secret');
9
+ var definePreviewUrl = require('@sanity/preview-url-secret/define-preview-url');
9
10
  var ui = require('@sanity/ui');
10
11
  var framerMotion = require('framer-motion');
11
12
  var react = require('react');
12
13
  var sanity = require('sanity');
13
- var isValidSecret = require('./_chunks/is-valid-secret-VKMJU99B.cjs');
14
+ var suspendReact = require('suspend-react');
14
15
  var usehooksTs = require('usehooks-ts');
15
- function GetUrlSecret(props) {
16
- const {
17
- urlSecretId,
18
- setUrlSecret,
19
- urlSecret,
20
- setError
21
- } = props;
22
- const client = sanity.useClient({
23
- apiVersion: isValidSecret.apiVersion
24
- });
25
- const [secretExpiresAt, setSecretExpiresAt] = react.useState(null);
26
- if (!urlSecretId.includes(".")) {
27
- throw new TypeError("`urlSecretId` must have a dot prefix, `".concat(urlSecretId, "` is not secure, add a prefix, for example `preview.").concat(urlSecretId, "` "));
28
- }
29
- react.useEffect(() => {
30
- if (urlSecret) return;
31
- async function getSecret(signal) {
32
- const data = await client.fetch(isValidSecret.fetchSecretQuery, {
33
- id: urlSecretId
34
- }, {
35
- signal,
36
- tag: isValidSecret.tag
37
- });
38
- if (signal.aborted) return;
39
- if (!(data == null ? void 0 : data.secret) || !(data == null ? void 0 : data._updatedAt)) {
40
- try {
41
- const newUpdatedAt = /* @__PURE__ */new Date();
42
- const newSecret = await utils.patchUrlSecret(client, urlSecretId, signal);
43
- if (signal.aborted) return;
44
- setUrlSecret(newSecret);
45
- setSecretExpiresAt(utils.getExpiresAt(newUpdatedAt));
46
- } catch (err) {
47
- console.error("Failed to create a new preview secret. Ensure the `client` has a `token` specified that has `write` permissions.", err);
48
- }
49
- return;
50
- }
51
- if ((data == null ? void 0 : data.secret) !== urlSecret) {
52
- setUrlSecret(data == null ? void 0 : data.secret);
53
- setSecretExpiresAt(utils.getExpiresAt(new Date(data == null ? void 0 : data._updatedAt)));
54
- }
55
- }
56
- const abort = new AbortController();
57
- getSecret(abort.signal).catch(error => error.name !== "AbortError" && setError(error));
58
- return () => abort.abort();
59
- }, [client, setError, setUrlSecret, urlSecret, urlSecretId]);
60
- react.useEffect(() => {
61
- if (!secretExpiresAt) return;
62
- const timeout = setTimeout(() => {
63
- setUrlSecret(null);
64
- setSecretExpiresAt(null);
65
- }, Math.max(0, secretExpiresAt.getTime() - /* @__PURE__ */new Date().getTime()));
66
- return () => clearTimeout(timeout);
67
- }, [secretExpiresAt, setUrlSecret]);
68
- return null;
69
- }
70
- function DisplayUrl(_ref) {
71
- let {
72
- displayUrl
73
- } = _ref;
16
+ var getRedirectTo = require('@sanity/preview-url-secret/get-redirect-to');
17
+ function DisplayUrl(props) {
74
18
  const truncatedUrl = react.useMemo(() => {
75
- const url = new URL(displayUrl);
76
- if (url.searchParams.has("secret")) {
77
- url.searchParams.delete("secret");
78
- url.searchParams.append("secret", "***");
79
- }
19
+ const url = getRedirectTo.getRedirectTo(props.url);
80
20
  return "".concat(url.origin === location.origin ? "" : url.origin).concat(url.pathname).concat(url.search);
81
- }, [displayUrl]);
21
+ }, [props.url]);
82
22
  return /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
83
23
  size: 0,
84
24
  textOverflow: "ellipsis",
85
- title: displayUrl,
86
25
  children: truncatedUrl
87
26
  });
88
27
  }
@@ -99,14 +38,15 @@ const sizes = {
99
38
  const DEFAULT_SIZE = "desktop";
100
39
  function Toolbar(props) {
101
40
  const {
102
- displayUrl,
41
+ url,
103
42
  iframeSize,
104
43
  setIframeSize,
105
44
  reloading,
106
- showDisplayUrl,
45
+ showUrl,
107
46
  reloadButton,
108
47
  handleReload
109
48
  } = props;
49
+ const validUrl = url instanceof URL;
110
50
  const input = react.useRef(null);
111
51
  const {
112
52
  push: pushToast
@@ -120,7 +60,7 @@ function Toolbar(props) {
120
60
  opacity: 0
121
61
  },
122
62
  ref: input,
123
- value: displayUrl,
63
+ value: validUrl ? url.toString() : "",
124
64
  readOnly: true,
125
65
  tabIndex: -1
126
66
  }), /* @__PURE__ */jsxRuntime.jsx(ui.Card, {
@@ -143,7 +83,7 @@ function Toolbar(props) {
143
83
  padding: 2,
144
84
  placement: "bottom-start",
145
85
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Button, {
146
- disabled: !displayUrl,
86
+ disabled: !validUrl,
147
87
  fontSize: [1],
148
88
  padding: 2,
149
89
  mode: iframeSize === "mobile" ? "default" : "ghost",
@@ -153,8 +93,8 @@ function Toolbar(props) {
153
93
  })
154
94
  }), /* @__PURE__ */jsxRuntime.jsx(ui.Box, {
155
95
  flex: 1,
156
- children: showDisplayUrl && displayUrl && /* @__PURE__ */jsxRuntime.jsx(DisplayUrl, {
157
- displayUrl
96
+ children: showUrl && validUrl && /* @__PURE__ */jsxRuntime.jsx(DisplayUrl, {
97
+ url
158
98
  })
159
99
  }), /* @__PURE__ */jsxRuntime.jsxs(ui.Flex, {
160
100
  align: "center",
@@ -169,7 +109,7 @@ function Toolbar(props) {
169
109
  }),
170
110
  padding: 2,
171
111
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Button, {
172
- disabled: !displayUrl,
112
+ disabled: !validUrl,
173
113
  mode: "bleed",
174
114
  fontSize: [1],
175
115
  padding: 2,
@@ -189,7 +129,7 @@ function Toolbar(props) {
189
129
  padding: 2,
190
130
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Button, {
191
131
  mode: "bleed",
192
- disabled: !displayUrl,
132
+ disabled: !validUrl,
193
133
  fontSize: [1],
194
134
  icon: icons.CopyIcon,
195
135
  padding: [2],
@@ -216,14 +156,14 @@ function Toolbar(props) {
216
156
  padding: 2,
217
157
  placement: "bottom-end",
218
158
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Button, {
219
- disabled: !displayUrl,
159
+ disabled: !validUrl,
220
160
  fontSize: [1],
221
161
  icon: icons.LaunchIcon,
222
162
  mode: "ghost",
223
163
  paddingY: [2],
224
164
  text: "Open",
225
165
  "aria-label": "Open URL in a new tab",
226
- onClick: () => window.open(displayUrl)
166
+ onClick: validUrl ? () => window.open(url.toString()) : void 0
227
167
  })
228
168
  })]
229
169
  })]
@@ -233,38 +173,126 @@ function Toolbar(props) {
233
173
  }
234
174
  const MotionFlex = framerMotion.motion(ui.Flex);
235
175
  function Iframe(props) {
236
- var _a;
237
- const [error, setError] = react.useState(null);
238
- if (error) {
239
- throw error;
240
- }
241
176
  const {
242
- document: sanityDocument,
177
+ document: {
178
+ published,
179
+ draft = published
180
+ },
243
181
  options
244
182
  } = props;
245
183
  const {
246
- url,
247
- urlSecretId,
248
184
  defaultSize = DEFAULT_SIZE,
249
185
  reload,
250
- loader = "Loading\u2026",
251
- attributes = {},
186
+ attributes,
252
187
  showDisplayUrl = true
253
188
  } = options;
254
- const [iframeSize, setIframeSize] = react.useState(((_a = sizes) == null ? void 0 : _a[defaultSize]) ? defaultSize : DEFAULT_SIZE);
255
- const [workaroundEmptyDocument, setWorkaroundEmptyDocument] = react.useState(true);
189
+ const urlRef = react.useRef(options.url);
190
+ const [draftSnapshot, setDraftSnapshot] = react.useState(() => draft);
256
191
  react.useEffect(() => {
257
- const timeout = setTimeout(() => setWorkaroundEmptyDocument(false), 1e3);
258
- return () => clearTimeout(timeout);
259
- }, []);
192
+ urlRef.current = options.url;
193
+ }, [options.url]);
194
+ react.useEffect(() => {
195
+ if (JSON.stringify(draft) !== JSON.stringify(draftSnapshot)) {
196
+ startTransition(() => setDraftSnapshot(draft));
197
+ }
198
+ }, [draft, draftSnapshot]);
199
+ const currentUser = sanity.useCurrentUser();
200
+ const client = sanity.useClient({
201
+ apiVersion: "2023-10-16"
202
+ });
203
+ const [expiresAt, setExpiresAt] = react.useState();
204
+ const previewSecretRef = react.useRef();
205
+ const [isResolvingUrl, startTransition] = react.useTransition();
206
+ const url = react.useCallback(
207
+ // eslint-disable-next-line @typescript-eslint/no-shadow
208
+ async draft2 => {
209
+ if (typeof location === "undefined") {
210
+ return void 0;
211
+ }
212
+ const urlProp = urlRef.current;
213
+ if (typeof urlProp === "string") {
214
+ return new URL(urlProp, location.origin);
215
+ }
216
+ if (typeof urlProp === "function") {
217
+ const url2 = await urlProp(draft2);
218
+ return typeof url2 === "string" ? new URL(url2, location.origin) : url2;
219
+ }
220
+ if (typeof urlProp === "object") {
221
+ const preview = typeof urlProp.preview === "function" ? await urlProp.preview(draft2) : urlProp.preview;
222
+ if (typeof preview !== "string") {
223
+ return preview;
224
+ }
225
+ if (!previewSecretRef.current) {
226
+ const {
227
+ secret,
228
+ expiresAt: expiresAt2
229
+ } = await createSecret.createPreviewSecret(client, "sanity-plugin-iframe-pane", location.href, currentUser == null ? void 0 : currentUser.id);
230
+ previewSecretRef.current = secret;
231
+ startTransition(() => setExpiresAt(expiresAt2.getTime()));
232
+ }
233
+ const resolvePreviewUrl = definePreviewUrl.definePreviewUrl({
234
+ origin: urlProp.origin === "same-origin" ? location.origin : urlProp.origin,
235
+ preview,
236
+ draftMode: {
237
+ enable: urlProp.draftMode
238
+ }
239
+ });
240
+ const url2 = await resolvePreviewUrl({
241
+ client,
242
+ previewUrlSecret: previewSecretRef.current,
243
+ previewSearchParam: null
244
+ });
245
+ return new URL(url2, location.origin);
246
+ }
247
+ return void 0;
248
+ }, [client, currentUser == null ? void 0 : currentUser.id]);
249
+ react.useEffect(() => {
250
+ if (expiresAt) {
251
+ const timeout = setTimeout(() => {
252
+ startTransition(() => setExpiresAt(void 0));
253
+ previewSecretRef.current = void 0;
254
+ }, Math.max(0, expiresAt - Date.now()));
255
+ return () => clearTimeout(timeout);
256
+ }
257
+ return void 0;
258
+ }, [expiresAt]);
259
+ return /* @__PURE__ */jsxRuntime.jsx(react.Suspense, {
260
+ fallback: /* @__PURE__ */jsxRuntime.jsx(Loading, {
261
+ iframeSize: "desktop"
262
+ }),
263
+ children: /* @__PURE__ */jsxRuntime.jsx(IframeInner, {
264
+ draftSnapshot,
265
+ url,
266
+ isResolvingUrl,
267
+ attributes,
268
+ defaultSize,
269
+ reload,
270
+ showDisplayUrl,
271
+ userId: currentUser == null ? void 0 : currentUser.id
272
+ })
273
+ });
274
+ }
275
+ const IframeInner = react.memo(function IframeInner2(props) {
276
+ var _a;
277
+ const {
278
+ isResolvingUrl,
279
+ defaultSize = DEFAULT_SIZE,
280
+ reload,
281
+ attributes = {},
282
+ showDisplayUrl = true,
283
+ draftSnapshot,
284
+ userId,
285
+ expiresAt
286
+ } = props;
287
+ const [iframeSize, setIframeSize] = react.useState(((_a = sizes) == null ? void 0 : _a[defaultSize]) ? defaultSize : DEFAULT_SIZE);
260
288
  const prefersReducedMotion = ui.usePrefersReducedMotion();
261
- const [urlState, setUrlState] = react.useState(() => typeof url === "function" ? "" : url);
289
+ const url = suspendReact.suspend(() => props.url(draftSnapshot), [
290
+ // Cache based on a few specific conditions
291
+ "sanity-plugin-iframe-pane", draftSnapshot, userId, expiresAt, resolveUUID]);
262
292
  const [loading, setLoading] = react.useState(true);
263
- const [reloading, setReloading] = react.useState(false);
293
+ const [_reloading, setReloading] = react.useState(false);
294
+ const reloading = _reloading || isResolvingUrl;
264
295
  const iframe = react.useRef(null);
265
- const {
266
- displayed
267
- } = sanityDocument;
268
296
  const handleReload = react.useCallback(() => {
269
297
  if (!(iframe == null ? void 0 : iframe.current)) {
270
298
  return;
@@ -272,8 +300,6 @@ function Iframe(props) {
272
300
  iframe.current.src = iframe.current.src;
273
301
  setReloading(true);
274
302
  }, []);
275
- const deferredRevision = react.useDeferredValue(displayed._rev);
276
- const displayUrl = typeof urlState === "string" ? urlState : "";
277
303
  return /* @__PURE__ */jsxRuntime.jsx(framerMotion.MotionConfig, {
278
304
  transition: prefersReducedMotion ? {
279
305
  duration: 0
@@ -284,52 +310,42 @@ function Iframe(props) {
284
310
  height: "100%"
285
311
  },
286
312
  children: [/* @__PURE__ */jsxRuntime.jsx(Toolbar, {
287
- displayUrl,
313
+ url,
288
314
  iframeSize,
289
315
  reloading,
290
316
  setIframeSize,
291
- showDisplayUrl,
317
+ showUrl: showDisplayUrl,
292
318
  reloadButton: !!(reload == null ? void 0 : reload.button),
293
319
  handleReload
294
- }), urlState === utils.MissingSlug && !workaroundEmptyDocument ? /* @__PURE__ */jsxRuntime.jsx(MissingSlugScreen, {}) : /* @__PURE__ */jsxRuntime.jsx(ui.Card, {
320
+ }), url instanceof Error ? /* @__PURE__ */jsxRuntime.jsx(ErrorCard, {
321
+ error: url
322
+ }) : /* @__PURE__ */jsxRuntime.jsx(ui.Card, {
295
323
  tone: "transparent",
296
324
  style: {
297
325
  height: "100%"
298
326
  },
299
327
  children: /* @__PURE__ */jsxRuntime.jsx(Frame, {
300
328
  ref: iframe,
301
- loader,
302
329
  loading,
303
330
  reloading,
304
331
  iframeSize,
305
332
  setReloading,
306
333
  setLoading,
307
- displayUrl,
334
+ url,
308
335
  attributes
309
336
  })
310
- }), typeof url === "function" && /* @__PURE__ */jsxRuntime.jsx(AsyncUrl, {
311
- url,
312
- displayed,
313
- urlSecretId,
314
- setDisplayUrl: setUrlState,
315
- setError
316
- }, deferredRevision), displayUrl && ((reload == null ? void 0 : reload.revision) || (reload == null ? void 0 : reload.revision) === 0) && /* @__PURE__ */jsxRuntime.jsx(ReloadOnRevision, {
317
- revision: reload.revision,
318
- _rev: deferredRevision,
319
- handleReload
320
337
  })]
321
338
  })
322
339
  });
323
- }
340
+ });
324
341
  const Frame = react.forwardRef(function Frame2(props, iframe) {
325
342
  const {
326
- loader,
327
343
  loading,
328
344
  setLoading,
329
345
  iframeSize,
330
346
  attributes,
331
347
  reloading,
332
- displayUrl,
348
+ url,
333
349
  setReloading
334
350
  } = props;
335
351
  function handleIframeLoad() {
@@ -347,7 +363,7 @@ const Frame = react.forwardRef(function Frame2(props, iframe) {
347
363
  position: "relative"
348
364
  },
349
365
  children: [/* @__PURE__ */jsxRuntime.jsx(framerMotion.AnimatePresence, {
350
- children: loader && loading && /* @__PURE__ */jsxRuntime.jsx(MotionFlex, {
366
+ children: !url || loading && /* @__PURE__ */jsxRuntime.jsx(MotionFlex, {
351
367
  initial: "initial",
352
368
  animate: "animate",
353
369
  exit: "exit",
@@ -358,34 +374,21 @@ const Frame = react.forwardRef(function Frame2(props, iframe) {
358
374
  inset: "0",
359
375
  position: "absolute"
360
376
  },
361
- children: /* @__PURE__ */jsxRuntime.jsxs(ui.Flex, {
362
- style: {
363
- ...sizes[iframeSize]
364
- },
365
- justify: "center",
366
- align: "center",
367
- direction: "column",
368
- gap: 4,
369
- children: [/* @__PURE__ */jsxRuntime.jsx(ui.Spinner, {
370
- muted: true
371
- }), loader && typeof loader === "string" && /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
372
- muted: true,
373
- size: 1,
374
- children: loader
375
- })]
377
+ children: /* @__PURE__ */jsxRuntime.jsx(Loading, {
378
+ iframeSize
376
379
  })
377
380
  })
378
- }), /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.iframe, {
381
+ }), url && /* @__PURE__ */jsxRuntime.jsx(framerMotion.motion.iframe, {
379
382
  ref: iframe,
380
383
  title: "preview",
381
384
  frameBorder: "0",
382
385
  style: {
383
386
  maxHeight: "100%"
384
387
  },
385
- src: displayUrl,
388
+ src: url.toString(),
386
389
  initial: ["background", iframeSize],
387
390
  variants: iframeVariants,
388
- animate: [loader && loading ? "background" : "active", reloading ? "reloading" : "idle", iframeSize],
391
+ animate: [loading ? "background" : "active", reloading ? "reloading" : "idle", iframeSize],
389
392
  ...attributes,
390
393
  onLoad: handleIframeLoad
391
394
  })]
@@ -427,53 +430,31 @@ const iframeVariants = {
427
430
  scale: 1
428
431
  }
429
432
  };
430
- function ReloadOnRevision(props) {
431
- const {
432
- revision,
433
- handleReload,
434
- _rev
435
- } = props;
436
- const [initialRev] = react.useState(_rev);
437
- react.useEffect(() => {
438
- if (_rev !== initialRev) {
439
- const timeout = setTimeout(handleReload, Number(revision === true ? 300 : revision));
440
- return () => clearTimeout(timeout);
441
- }
442
- }, [_rev, revision, handleReload, initialRev]);
443
- return null;
444
- }
445
- function AsyncUrl(props) {
446
- const {
447
- urlSecretId,
448
- setDisplayUrl,
449
- setError
450
- } = props;
451
- const [displayed] = react.useState(props.displayed);
452
- const [url] = react.useState(() => props.url);
453
- const [urlSecret, setUrlSecret] = react.useState(null);
454
- react.useEffect(() => {
455
- if (urlSecretId && !urlSecret) return;
456
- const getUrl = async signal => {
457
- const resolveUrl = await url(displayed, urlSecret, abort.signal);
458
- if (!signal.aborted && resolveUrl) {
459
- setDisplayUrl(resolveUrl);
460
- }
461
- };
462
- const abort = new AbortController();
463
- getUrl(abort.signal).catch(error => error.name !== "AbortError" && setError(error));
464
- return () => abort.abort();
465
- }, [displayed, setDisplayUrl, setError, url, urlSecret, urlSecretId]);
466
- if (urlSecretId) {
467
- return /* @__PURE__ */jsxRuntime.jsx(GetUrlSecret, {
468
- urlSecretId,
469
- urlSecret,
470
- setUrlSecret,
471
- setError
472
- });
473
- }
474
- return null;
433
+ function Loading(_ref) {
434
+ let {
435
+ iframeSize
436
+ } = _ref;
437
+ return /* @__PURE__ */jsxRuntime.jsxs(ui.Flex, {
438
+ style: {
439
+ ...sizes[iframeSize]
440
+ },
441
+ justify: "center",
442
+ align: "center",
443
+ direction: "column",
444
+ gap: 4,
445
+ children: [/* @__PURE__ */jsxRuntime.jsx(ui.Spinner, {
446
+ muted: true
447
+ }), /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
448
+ muted: true,
449
+ size: 1,
450
+ children: "Loading\u2026"
451
+ })]
452
+ });
475
453
  }
476
- function MissingSlugScreen() {
454
+ function ErrorCard(_ref2) {
455
+ let {
456
+ error
457
+ } = _ref2;
477
458
  return /* @__PURE__ */jsxRuntime.jsx(ui.Card, {
478
459
  height: "fill",
479
460
  children: /* @__PURE__ */jsxRuntime.jsx(ui.Flex, {
@@ -503,12 +484,12 @@ function MissingSlugScreen() {
503
484
  as: "h1",
504
485
  size: 1,
505
486
  weight: "bold",
506
- children: "Missing slug"
487
+ children: error.name
507
488
  }), /* @__PURE__ */jsxRuntime.jsx(ui.Text, {
508
489
  as: "p",
509
490
  muted: true,
510
491
  size: 1,
511
- children: "Add a slug to see the preview."
492
+ children: error.message
512
493
  })]
513
494
  })]
514
495
  })
@@ -517,7 +498,6 @@ function MissingSlugScreen() {
517
498
  })
518
499
  });
519
500
  }
520
- exports.defineUrlResolver = utils.defineUrlResolver;
501
+ const resolveUUID = Symbol();
521
502
  exports.Iframe = Iframe;
522
- exports.default = Iframe;
523
503
  //# sourceMappingURL=index.cjs.map
package/lib/index.cjs.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import cjs from './index.cjs';
2
2
 
3
- export const defineUrlResolver = cjs.defineUrlResolver;
4
3
  export const Iframe = cjs.Iframe;
5
4
 
6
- export default cjs.default;