@mittwald/flow-remote-core 0.2.0-alpha.1032 → 0.2.0-alpha.1034

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 (74) hide show
  1. package/dist/js/_virtual/_rolldown/runtime.mjs +13 -0
  2. package/dist/js/index-node.mjs +21 -17
  3. package/dist/js/index-node.mjs.map +1 -1
  4. package/dist/js/index.mjs +24 -16
  5. package/dist/js/index.mjs.map +1 -1
  6. package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs +33 -36
  7. package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs.map +1 -1
  8. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs +167 -225
  9. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs.map +1 -1
  10. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs +6 -9
  11. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs.map +1 -1
  12. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs +9 -7
  13. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs.map +1 -1
  14. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs +68 -67
  15. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs.map +1 -1
  16. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs +8 -8
  17. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs.map +1 -1
  18. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs +130 -210
  19. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs.map +1 -1
  20. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs +8 -6
  21. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs.map +1 -1
  22. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs +152 -159
  23. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs.map +1 -1
  24. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs +76 -84
  25. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs.map +1 -1
  26. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadNestedWindow.mjs +117 -137
  27. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadNestedWindow.mjs.map +1 -1
  28. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadWindow.mjs +189 -208
  29. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadWindow.mjs.map +1 -1
  30. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/shared.mjs +6 -4
  31. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/shared.mjs.map +1 -1
  32. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs +12 -13
  33. package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs.map +1 -1
  34. package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs +51 -61
  35. package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs.map +1 -1
  36. package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs +73 -101
  37. package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs.map +1 -1
  38. package/dist/js/packages/remote-core/src/connection/index.mjs +4 -0
  39. package/dist/js/packages/remote-core/src/connection/types.mjs +13 -11
  40. package/dist/js/packages/remote-core/src/connection/types.mjs.map +1 -1
  41. package/dist/js/packages/remote-core/src/error.mjs +10 -8
  42. package/dist/js/packages/remote-core/src/error.mjs.map +1 -1
  43. package/dist/js/packages/remote-core/src/events/remoteEvents.mjs +14 -16
  44. package/dist/js/packages/remote-core/src/events/remoteEvents.mjs.map +1 -1
  45. package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs +10 -8
  46. package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs.map +1 -1
  47. package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs +8 -12
  48. package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs.map +1 -1
  49. package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs +49 -61
  50. package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs.map +1 -1
  51. package/dist/js/packages/remote-core/src/serialization/Serializer.mjs +31 -31
  52. package/dist/js/packages/remote-core/src/serialization/Serializer.mjs.map +1 -1
  53. package/dist/js/packages/remote-core/src/serialization/index.mjs +10 -0
  54. package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs +20 -21
  55. package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs.map +1 -1
  56. package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs +13 -14
  57. package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs.map +1 -1
  58. package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs +27 -28
  59. package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs.map +1 -1
  60. package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs +18 -22
  61. package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs.map +1 -1
  62. package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs +27 -34
  63. package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs.map +1 -1
  64. package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs +23 -7
  65. package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs.map +1 -1
  66. package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs +13 -14
  67. package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs.map +1 -1
  68. package/dist/js/packages/remote-core/src/shim.mjs +32 -15
  69. package/dist/js/packages/remote-core/src/shim.mjs.map +1 -1
  70. package/dist/types/index-node.d.ts.map +1 -1
  71. package/dist/types/index.d.ts.map +1 -1
  72. package/dist/types/shim.d.ts +13 -1
  73. package/dist/types/shim.d.ts.map +1 -1
  74. package/package.json +9 -11
@@ -1,161 +1,154 @@
1
- import { Thread } from '../Thread.mjs';
2
- import { windowToThreadTarget } from './window/ThreadWindow.mjs';
3
- import { ThreadNestedIframe } from './ThreadNestedIframe.mjs';
4
-
1
+ import { Thread } from "../Thread.mjs";
2
+ import { windowToThreadTarget } from "./window/ThreadWindow.mjs";
3
+ import { ThreadNestedIframe } from "./ThreadNestedIframe.mjs";
4
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs
5
5
  /**
6
- * Creates a thread from an iframe element.
7
- *
8
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
9
- *
10
- * @example
11
- * import {ThreadIframe} from '@quilted/threads';
12
- *
13
- * const iframe = document.querySelector('iframe#thread-iframe');
14
- * const thread = new ThreadIframe(iframe);
15
- * await thread.imports.sendMessage('Hello world!');
16
- */
17
- class ThreadIframe extends Thread {
18
- /**
19
- * Creates a thread from an iframe element.
20
- *
21
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
22
- *
23
- * @example
24
- * import {ThreadIframe} from '@quilted/threads';
25
- *
26
- * const iframe = document.querySelector('iframe#thread-iframe');
27
- * const thread = ThreadIframe.from(iframe);
28
- * await thread.imports.sendMessage('Hello world!');
29
- */
30
- static from(iframe, options) {
31
- return new ThreadIframe(iframe, options);
32
- }
33
-
34
- /**
35
- * Starts a thread wrapped around an iframe element, and returns the imports
36
- * of the thread.
37
- *
38
- * @example
39
- * ```ts
40
- * import {ThreadIframe} from '@quilted/threads';
41
- *
42
- * const {getMessage} = ThreadIframe.import(iframe);
43
- * const message = await getMessage(); // 'Hello, world!'
44
- *
45
- * // In the nested window:
46
- *
47
- * import {ThreadIframe} from '@quilted/threads';
48
- *
49
- * ThreadIframe.parent.export({
50
- * async getMessage() {
51
- * return 'Hello, world!';
52
- * },
53
- * });
54
- * ```
55
- */
56
- static import(iframe, options) {
57
- return new ThreadIframe(iframe, options).imports;
58
- }
59
-
60
- /**
61
- * Starts a thread wrapped around an iframe element, providing the second
62
- * argument as the exports of the thread.
63
- *
64
- * @example
65
- * ```ts
66
- * import {ThreadIframe} from '@quilted/threads';
67
- *
68
- * ThreadIframe.export(iframe, {
69
- * async getMessage() {
70
- * return 'Hello, world!';
71
- * },
72
- * });
73
- *
74
- * // In the nested iframe:
75
- *
76
- * import {ThreadIframe} from '@quilted/threads';
77
- *
78
- * const {getMessage} = ThreadIframe.parent.import();
79
- * const message = await getMessage(); // 'Hello, world!'
80
- * ```
81
- */
82
- static export(iframe, exports, options) {
83
- new ThreadIframe(iframe, {
84
- ...options,
85
- exports
86
- });
87
- }
88
-
89
- /**
90
- * Creates a thread from a `window.parent`, a reference to the parent window when rendering
91
- * in a nested iframe.
92
- *
93
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
94
- *
95
- * @example
96
- * import {ThreadIframe} from '@quilted/threads';
97
- *
98
- * const thread = ThreadIframe.parent();
99
- * await thread.imports.sendMessage('Hello world!');
100
- */
101
- static parent = (() => Object.assign(options => new ThreadNestedIframe(options), {
102
- /**
103
- * Starts a thread wrapped around a parent window, and returns the imports
104
- * of the thread.
105
- *
106
- * @example
107
- * ```ts
108
- * import {ThreadIframe} from '@quilted/threads';
109
- *
110
- * const {getMessage} = ThreadIframe.parent.import();
111
- * const message = await getMessage(); // 'Hello, world!'
112
- *
113
- * // In the parent window:
114
- *
115
- * import {ThreadIframe} from '@quilted/threads';
116
- *
117
- * ThreadIframe.export(iframe, {
118
- * async getMessage() {
119
- * return 'Hello, world!';
120
- * },
121
- * });
122
- * ```
123
- */
124
- import: options => ThreadNestedIframe.import(options),
125
- /**
126
- * Starts a thread wrapped around a parent window, providing the second
127
- * argument as the exports of the thread.
128
- *
129
- * @example
130
- * ```ts
131
- * import {ThreadIframe} from '@quilted/threads';
132
- *
133
- * ThreadIframe.parent.export({
134
- * async getMessage() {
135
- * return 'Hello, world!';
136
- * },
137
- * });
138
- *
139
- * // In the parent window:
140
- *
141
- * import {ThreadIframe} from '@quilted/threads';
142
- *
143
- * const {getMessage} = ThreadIframe.import(iframe);
144
- * const message = await getMessage(); // 'Hello, world!'
145
- * ```
146
- */
147
- export: (exports, options) => ThreadNestedIframe.export(exports, options)
148
- }))();
149
- constructor(iframe, {
150
- targetOrigin = '*',
151
- ...options
152
- } = {}) {
153
- super(windowToThreadTarget(iframe.contentWindow, {
154
- targetOrigin
155
- }), options);
156
- this.iframe = iframe;
157
- }
158
- }
159
-
6
+ * Creates a thread from an iframe element.
7
+ *
8
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
9
+ *
10
+ * @example
11
+ * import {ThreadIframe} from '@quilted/threads';
12
+ *
13
+ * const iframe = document.querySelector('iframe#thread-iframe');
14
+ * const thread = new ThreadIframe(iframe);
15
+ * await thread.imports.sendMessage('Hello world!');
16
+ */
17
+ var ThreadIframe = class ThreadIframe extends Thread {
18
+ /**
19
+ * Creates a thread from an iframe element.
20
+ *
21
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
22
+ *
23
+ * @example
24
+ * import {ThreadIframe} from '@quilted/threads';
25
+ *
26
+ * const iframe = document.querySelector('iframe#thread-iframe');
27
+ * const thread = ThreadIframe.from(iframe);
28
+ * await thread.imports.sendMessage('Hello world!');
29
+ */
30
+ static from(iframe, options) {
31
+ return new ThreadIframe(iframe, options);
32
+ }
33
+ /**
34
+ * Starts a thread wrapped around an iframe element, and returns the imports
35
+ * of the thread.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import {ThreadIframe} from '@quilted/threads';
40
+ *
41
+ * const {getMessage} = ThreadIframe.import(iframe);
42
+ * const message = await getMessage(); // 'Hello, world!'
43
+ *
44
+ * // In the nested window:
45
+ *
46
+ * import {ThreadIframe} from '@quilted/threads';
47
+ *
48
+ * ThreadIframe.parent.export({
49
+ * async getMessage() {
50
+ * return 'Hello, world!';
51
+ * },
52
+ * });
53
+ * ```
54
+ */
55
+ static import(iframe, options) {
56
+ return new ThreadIframe(iframe, options).imports;
57
+ }
58
+ /**
59
+ * Starts a thread wrapped around an iframe element, providing the second
60
+ * argument as the exports of the thread.
61
+ *
62
+ * @example
63
+ * ```ts
64
+ * import {ThreadIframe} from '@quilted/threads';
65
+ *
66
+ * ThreadIframe.export(iframe, {
67
+ * async getMessage() {
68
+ * return 'Hello, world!';
69
+ * },
70
+ * });
71
+ *
72
+ * // In the nested iframe:
73
+ *
74
+ * import {ThreadIframe} from '@quilted/threads';
75
+ *
76
+ * const {getMessage} = ThreadIframe.parent.import();
77
+ * const message = await getMessage(); // 'Hello, world!'
78
+ * ```
79
+ */
80
+ static export(iframe, exports, options) {
81
+ new ThreadIframe(iframe, {
82
+ ...options,
83
+ exports
84
+ });
85
+ }
86
+ /**
87
+ * Creates a thread from a `window.parent`, a reference to the parent window when rendering
88
+ * in a nested iframe.
89
+ *
90
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
91
+ *
92
+ * @example
93
+ * import {ThreadIframe} from '@quilted/threads';
94
+ *
95
+ * const thread = ThreadIframe.parent();
96
+ * await thread.imports.sendMessage('Hello world!');
97
+ */
98
+ static parent = (() => Object.assign((options) => new ThreadNestedIframe(options), {
99
+ /**
100
+ * Starts a thread wrapped around a parent window, and returns the imports
101
+ * of the thread.
102
+ *
103
+ * @example
104
+ * ```ts
105
+ * import {ThreadIframe} from '@quilted/threads';
106
+ *
107
+ * const {getMessage} = ThreadIframe.parent.import();
108
+ * const message = await getMessage(); // 'Hello, world!'
109
+ *
110
+ * // In the parent window:
111
+ *
112
+ * import {ThreadIframe} from '@quilted/threads';
113
+ *
114
+ * ThreadIframe.export(iframe, {
115
+ * async getMessage() {
116
+ * return 'Hello, world!';
117
+ * },
118
+ * });
119
+ * ```
120
+ */
121
+ import: (options) => ThreadNestedIframe.import(options),
122
+ /**
123
+ * Starts a thread wrapped around a parent window, providing the second
124
+ * argument as the exports of the thread.
125
+ *
126
+ * @example
127
+ * ```ts
128
+ * import {ThreadIframe} from '@quilted/threads';
129
+ *
130
+ * ThreadIframe.parent.export({
131
+ * async getMessage() {
132
+ * return 'Hello, world!';
133
+ * },
134
+ * });
135
+ *
136
+ * // In the parent window:
137
+ *
138
+ * import {ThreadIframe} from '@quilted/threads';
139
+ *
140
+ * const {getMessage} = ThreadIframe.import(iframe);
141
+ * const message = await getMessage(); // 'Hello, world!'
142
+ * ```
143
+ */
144
+ export: (exports, options) => ThreadNestedIframe.export(exports, options)
145
+ }))();
146
+ constructor(iframe, { targetOrigin = "*", ...options } = {}) {
147
+ super(windowToThreadTarget(iframe.contentWindow, { targetOrigin }), options);
148
+ this.iframe = iframe;
149
+ }
150
+ };
151
+ //#endregion
160
152
  export { ThreadIframe };
161
- //# sourceMappingURL=ThreadIframe.mjs.map
153
+
154
+ //# sourceMappingURL=ThreadIframe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadIframe.mjs","sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs"],"sourcesContent":["import { Thread } from '../Thread.mjs';\nimport { windowToThreadTarget } from './window/ThreadWindow.mjs';\nimport { ThreadNestedIframe } from './ThreadNestedIframe.mjs';\n\n/**\n * Creates a thread from an iframe element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n *\n * @example\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const iframe = document.querySelector('iframe#thread-iframe');\n * const thread = new ThreadIframe(iframe);\n * await thread.imports.sendMessage('Hello world!');\n */\nclass ThreadIframe extends Thread {\n /**\n * Creates a thread from an iframe element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n *\n * @example\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const iframe = document.querySelector('iframe#thread-iframe');\n * const thread = ThreadIframe.from(iframe);\n * await thread.imports.sendMessage('Hello world!');\n */\n static from(iframe, options) {\n return new ThreadIframe(iframe, options);\n }\n\n /**\n * Starts a thread wrapped around an iframe element, and returns the imports\n * of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.import(iframe);\n * const message = await getMessage(); // 'Hello, world!'\n *\n * // In the nested window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.parent.export({\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n * ```\n */\n static import(iframe, options) {\n return new ThreadIframe(iframe, options).imports;\n }\n\n /**\n * Starts a thread wrapped around an iframe element, providing the second\n * argument as the exports of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.export(iframe, {\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n *\n * // In the nested iframe:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.parent.import();\n * const message = await getMessage(); // 'Hello, world!'\n * ```\n */\n static export(iframe, exports, options) {\n new ThreadIframe(iframe, {\n ...options,\n exports\n });\n }\n\n /**\n * Creates a thread from a `window.parent`, a reference to the parent window when rendering\n * in a nested iframe.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/parent\n *\n * @example\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const thread = ThreadIframe.parent();\n * await thread.imports.sendMessage('Hello world!');\n */\n static parent = (() => Object.assign(options => new ThreadNestedIframe(options), {\n /**\n * Starts a thread wrapped around a parent window, and returns the imports\n * of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.parent.import();\n * const message = await getMessage(); // 'Hello, world!'\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.export(iframe, {\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n * ```\n */\n import: options => ThreadNestedIframe.import(options),\n /**\n * Starts a thread wrapped around a parent window, providing the second\n * argument as the exports of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.parent.export({\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.import(iframe);\n * const message = await getMessage(); // 'Hello, world!'\n * ```\n */\n export: (exports, options) => ThreadNestedIframe.export(exports, options)\n }))();\n constructor(iframe, {\n targetOrigin = '*',\n ...options\n } = {}) {\n super(windowToThreadTarget(iframe.contentWindow, {\n targetOrigin\n }), options);\n this.iframe = iframe;\n }\n}\n\nexport { ThreadIframe };\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,SAAS,MAAM,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/B,IAAI,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC;AAC5C,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE;AACjC,IAAI,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,OAAO;AACpD,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE;AAC1C,IAAI,IAAI,YAAY,CAAC,MAAM,EAAE;AAC7B,MAAM,GAAG,OAAO;AAChB,MAAM;AACN,KAAK,CAAC;AACN,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,EAAE,OAAO,IAAI,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO;AAC5E,GAAG,CAAC,GAAG;AACP,EAAE,WAAW,CAAC,MAAM,EAAE;AACtB,IAAI,YAAY,GAAG,GAAG;AACtB,IAAI,GAAG;AACP,GAAG,GAAG,EAAE,EAAE;AACV,IAAI,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,aAAa,EAAE;AACrD,MAAM;AACN,KAAK,CAAC,EAAE,OAAO,CAAC;AAChB,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM;AACxB,EAAE;AACF;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ThreadIframe.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs"],"sourcesContent":["import { Thread } from '../Thread.mjs';\nimport { windowToThreadTarget } from './window/ThreadWindow.mjs';\nimport { ThreadNestedIframe } from './ThreadNestedIframe.mjs';\n\n/**\n * Creates a thread from an iframe element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n *\n * @example\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const iframe = document.querySelector('iframe#thread-iframe');\n * const thread = new ThreadIframe(iframe);\n * await thread.imports.sendMessage('Hello world!');\n */\nclass ThreadIframe extends Thread {\n /**\n * Creates a thread from an iframe element.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n *\n * @example\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const iframe = document.querySelector('iframe#thread-iframe');\n * const thread = ThreadIframe.from(iframe);\n * await thread.imports.sendMessage('Hello world!');\n */\n static from(iframe, options) {\n return new ThreadIframe(iframe, options);\n }\n\n /**\n * Starts a thread wrapped around an iframe element, and returns the imports\n * of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.import(iframe);\n * const message = await getMessage(); // 'Hello, world!'\n *\n * // In the nested window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.parent.export({\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n * ```\n */\n static import(iframe, options) {\n return new ThreadIframe(iframe, options).imports;\n }\n\n /**\n * Starts a thread wrapped around an iframe element, providing the second\n * argument as the exports of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.export(iframe, {\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n *\n * // In the nested iframe:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.parent.import();\n * const message = await getMessage(); // 'Hello, world!'\n * ```\n */\n static export(iframe, exports, options) {\n new ThreadIframe(iframe, {\n ...options,\n exports\n });\n }\n\n /**\n * Creates a thread from a `window.parent`, a reference to the parent window when rendering\n * in a nested iframe.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/parent\n *\n * @example\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const thread = ThreadIframe.parent();\n * await thread.imports.sendMessage('Hello world!');\n */\n static parent = (() => Object.assign(options => new ThreadNestedIframe(options), {\n /**\n * Starts a thread wrapped around a parent window, and returns the imports\n * of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.parent.import();\n * const message = await getMessage(); // 'Hello, world!'\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.export(iframe, {\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n * ```\n */\n import: options => ThreadNestedIframe.import(options),\n /**\n * Starts a thread wrapped around a parent window, providing the second\n * argument as the exports of the thread.\n *\n * @example\n * ```ts\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.parent.export({\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.import(iframe);\n * const message = await getMessage(); // 'Hello, world!'\n * ```\n */\n export: (exports, options) => ThreadNestedIframe.export(exports, options)\n }))();\n constructor(iframe, {\n targetOrigin = '*',\n ...options\n } = {}) {\n super(windowToThreadTarget(iframe.contentWindow, {\n targetOrigin\n }), options);\n this.iframe = iframe;\n }\n}\n\nexport { ThreadIframe };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAM,eAAN,MAAM,qBAAqB,OAAO;;;;;;;;;;;;;CAahC,OAAO,KAAK,QAAQ,SAAS;EAC3B,OAAO,IAAI,aAAa,QAAQ,OAAO;CACzC;;;;;;;;;;;;;;;;;;;;;;;CAwBA,OAAO,OAAO,QAAQ,SAAS;EAC7B,OAAO,IAAI,aAAa,QAAQ,OAAO,CAAC,CAAC;CAC3C;;;;;;;;;;;;;;;;;;;;;;;CAwBA,OAAO,OAAO,QAAQ,SAAS,SAAS;EACtC,IAAI,aAAa,QAAQ;GACvB,GAAG;GACH;EACF,CAAC;CACH;;;;;;;;;;;;;CAcA,OAAO,gBAAgB,OAAO,QAAO,YAAW,IAAI,mBAAmB,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;EAuB/E,SAAQ,YAAW,mBAAmB,OAAO,OAAO;;;;;;;;;;;;;;;;;;;;;;;EAuBpD,SAAS,SAAS,YAAY,mBAAmB,OAAO,SAAS,OAAO;CAC1E,CAAC,EAAA,CAAG;CACJ,YAAY,QAAQ,EAClB,eAAe,KACf,GAAG,YACD,CAAC,GAAG;EACN,MAAM,qBAAqB,OAAO,eAAe,EAC/C,aACF,CAAC,GAAG,OAAO;EACX,KAAK,SAAS;CAChB;AACF"}
@@ -1,86 +1,78 @@
1
- import { Thread } from '../Thread.mjs';
2
- import { nestedWindowToThreadTarget } from './window/ThreadNestedWindow.mjs';
3
-
1
+ import { Thread } from "../Thread.mjs";
2
+ import { nestedWindowToThreadTarget } from "./window/ThreadNestedWindow.mjs";
3
+ //#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs
4
4
  /**
5
- * Creates a thread from within an iframe nested in a top-level document.
6
- *
7
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
8
- *
9
- * @example
10
- * import {ThreadNestedIframe} from '@quilted/threads';
11
- *
12
- * const thread = new ThreadNestedIframe();
13
- * await thread.imports.sendMessage('Hello world!');
14
- */
15
- class ThreadNestedIframe extends Thread {
16
- /**
17
- * Starts a thread wrapped around a parent window, and returns the imports
18
- * of the thread.
19
- *
20
- * @example
21
- * ```ts
22
- * import {ThreadNestedIframe} from '@quilted/threads';
23
- *
24
- * const {getMessage} = ThreadNestedIframe.import();
25
- * const message = await getMessage(); // 'Hello, world!'
26
- *
27
- * // In the parent window:
28
- *
29
- * import {ThreadIframe} from '@quilted/threads';
30
- *
31
- * ThreadIframe.export(iframe, {
32
- * async getMessage() {
33
- * return 'Hello, world!';
34
- * },
35
- * });
36
- * ```
37
- */
38
- static import(options) {
39
- return new ThreadNestedIframe(options).imports;
40
- }
41
-
42
- /**
43
- * Starts a thread wrapped around a parent window, providing the second
44
- * argument as the exports of the thread.
45
- *
46
- * @example
47
- * ```ts
48
- * import {ThreadNestedIframe} from '@quilted/threads';
49
- *
50
- * ThreadNestedIframe.export({
51
- * async getMessage() {
52
- * return 'Hello, world!';
53
- * },
54
- * });
55
- *
56
- * // In the parent window:
57
- *
58
- * import {ThreadIframe} from '@quilted/threads';
59
- *
60
- * const {getMessage} = ThreadIframe.import(iframe);
61
- * const message = await getMessage(); // 'Hello, world!'
62
- * ```
63
- */
64
- static export(exports, options) {
65
- new ThreadNestedIframe({
66
- ...options,
67
- exports
68
- });
69
- }
70
- constructor({
71
- parent = globalThis.parent,
72
- targetOrigin = '*',
73
- ...options
74
- } = {}) {
75
- if (typeof self === 'undefined' || parent == null) {
76
- throw new Error('You are not inside an iframe, because there is no parent window.');
77
- }
78
- super(nestedWindowToThreadTarget(parent, {
79
- targetOrigin
80
- }), options);
81
- this.parent = parent;
82
- }
83
- }
84
-
5
+ * Creates a thread from within an iframe nested in a top-level document.
6
+ *
7
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
8
+ *
9
+ * @example
10
+ * import {ThreadNestedIframe} from '@quilted/threads';
11
+ *
12
+ * const thread = new ThreadNestedIframe();
13
+ * await thread.imports.sendMessage('Hello world!');
14
+ */
15
+ var ThreadNestedIframe = class ThreadNestedIframe extends Thread {
16
+ /**
17
+ * Starts a thread wrapped around a parent window, and returns the imports
18
+ * of the thread.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import {ThreadNestedIframe} from '@quilted/threads';
23
+ *
24
+ * const {getMessage} = ThreadNestedIframe.import();
25
+ * const message = await getMessage(); // 'Hello, world!'
26
+ *
27
+ * // In the parent window:
28
+ *
29
+ * import {ThreadIframe} from '@quilted/threads';
30
+ *
31
+ * ThreadIframe.export(iframe, {
32
+ * async getMessage() {
33
+ * return 'Hello, world!';
34
+ * },
35
+ * });
36
+ * ```
37
+ */
38
+ static import(options) {
39
+ return new ThreadNestedIframe(options).imports;
40
+ }
41
+ /**
42
+ * Starts a thread wrapped around a parent window, providing the second
43
+ * argument as the exports of the thread.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * import {ThreadNestedIframe} from '@quilted/threads';
48
+ *
49
+ * ThreadNestedIframe.export({
50
+ * async getMessage() {
51
+ * return 'Hello, world!';
52
+ * },
53
+ * });
54
+ *
55
+ * // In the parent window:
56
+ *
57
+ * import {ThreadIframe} from '@quilted/threads';
58
+ *
59
+ * const {getMessage} = ThreadIframe.import(iframe);
60
+ * const message = await getMessage(); // 'Hello, world!'
61
+ * ```
62
+ */
63
+ static export(exports, options) {
64
+ new ThreadNestedIframe({
65
+ ...options,
66
+ exports
67
+ });
68
+ }
69
+ constructor({ parent = globalThis.parent, targetOrigin = "*", ...options } = {}) {
70
+ if (typeof self === "undefined" || parent == null) throw new Error("You are not inside an iframe, because there is no parent window.");
71
+ super(nestedWindowToThreadTarget(parent, { targetOrigin }), options);
72
+ this.parent = parent;
73
+ }
74
+ };
75
+ //#endregion
85
76
  export { ThreadNestedIframe };
86
- //# sourceMappingURL=ThreadNestedIframe.mjs.map
77
+
78
+ //# sourceMappingURL=ThreadNestedIframe.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThreadNestedIframe.mjs","sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs"],"sourcesContent":["import { Thread } from '../Thread.mjs';\nimport { nestedWindowToThreadTarget } from './window/ThreadNestedWindow.mjs';\n\n/**\n * Creates a thread from within an iframe nested in a top-level document.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n *\n * @example\n * import {ThreadNestedIframe} from '@quilted/threads';\n *\n * const thread = new ThreadNestedIframe();\n * await thread.imports.sendMessage('Hello world!');\n */\nclass ThreadNestedIframe extends Thread {\n /**\n * Starts a thread wrapped around a parent window, and returns the imports\n * of the thread.\n *\n * @example\n * ```ts\n * import {ThreadNestedIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadNestedIframe.import();\n * const message = await getMessage(); // 'Hello, world!'\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.export(iframe, {\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n * ```\n */\n static import(options) {\n return new ThreadNestedIframe(options).imports;\n }\n\n /**\n * Starts a thread wrapped around a parent window, providing the second\n * argument as the exports of the thread.\n *\n * @example\n * ```ts\n * import {ThreadNestedIframe} from '@quilted/threads';\n *\n * ThreadNestedIframe.export({\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.import(iframe);\n * const message = await getMessage(); // 'Hello, world!'\n * ```\n */\n static export(exports, options) {\n new ThreadNestedIframe({\n ...options,\n exports\n });\n }\n constructor({\n parent = globalThis.parent,\n targetOrigin = '*',\n ...options\n } = {}) {\n if (typeof self === 'undefined' || parent == null) {\n throw new Error('You are not inside an iframe, because there is no parent window.');\n }\n super(nestedWindowToThreadTarget(parent, {\n targetOrigin\n }), options);\n this.parent = parent;\n }\n}\n\nexport { ThreadNestedIframe };\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,SAAS,MAAM,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,CAAC,OAAO,EAAE;AACzB,IAAI,OAAO,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC,OAAO;AAClD,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE;AAClC,IAAI,IAAI,kBAAkB,CAAC;AAC3B,MAAM,GAAG,OAAO;AAChB,MAAM;AACN,KAAK,CAAC;AACN,EAAE;AACF,EAAE,WAAW,CAAC;AACd,IAAI,MAAM,GAAG,UAAU,CAAC,MAAM;AAC9B,IAAI,YAAY,GAAG,GAAG;AACtB,IAAI,GAAG;AACP,GAAG,GAAG,EAAE,EAAE;AACV,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,MAAM,IAAI,IAAI,EAAE;AACvD,MAAM,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC;AACzF,IAAI;AACJ,IAAI,KAAK,CAAC,0BAA0B,CAAC,MAAM,EAAE;AAC7C,MAAM;AACN,KAAK,CAAC,EAAE,OAAO,CAAC;AAChB,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM;AACxB,EAAE;AACF;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ThreadNestedIframe.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs"],"sourcesContent":["import { Thread } from '../Thread.mjs';\nimport { nestedWindowToThreadTarget } from './window/ThreadNestedWindow.mjs';\n\n/**\n * Creates a thread from within an iframe nested in a top-level document.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe\n *\n * @example\n * import {ThreadNestedIframe} from '@quilted/threads';\n *\n * const thread = new ThreadNestedIframe();\n * await thread.imports.sendMessage('Hello world!');\n */\nclass ThreadNestedIframe extends Thread {\n /**\n * Starts a thread wrapped around a parent window, and returns the imports\n * of the thread.\n *\n * @example\n * ```ts\n * import {ThreadNestedIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadNestedIframe.import();\n * const message = await getMessage(); // 'Hello, world!'\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * ThreadIframe.export(iframe, {\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n * ```\n */\n static import(options) {\n return new ThreadNestedIframe(options).imports;\n }\n\n /**\n * Starts a thread wrapped around a parent window, providing the second\n * argument as the exports of the thread.\n *\n * @example\n * ```ts\n * import {ThreadNestedIframe} from '@quilted/threads';\n *\n * ThreadNestedIframe.export({\n * async getMessage() {\n * return 'Hello, world!';\n * },\n * });\n *\n * // In the parent window:\n *\n * import {ThreadIframe} from '@quilted/threads';\n *\n * const {getMessage} = ThreadIframe.import(iframe);\n * const message = await getMessage(); // 'Hello, world!'\n * ```\n */\n static export(exports, options) {\n new ThreadNestedIframe({\n ...options,\n exports\n });\n }\n constructor({\n parent = globalThis.parent,\n targetOrigin = '*',\n ...options\n } = {}) {\n if (typeof self === 'undefined' || parent == null) {\n throw new Error('You are not inside an iframe, because there is no parent window.');\n }\n super(nestedWindowToThreadTarget(parent, {\n targetOrigin\n }), options);\n this.parent = parent;\n }\n}\n\nexport { ThreadNestedIframe };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;AAcA,IAAM,qBAAN,MAAM,2BAA2B,OAAO;;;;;;;;;;;;;;;;;;;;;;;CAuBtC,OAAO,OAAO,SAAS;EACrB,OAAO,IAAI,mBAAmB,OAAO,CAAC,CAAC;CACzC;;;;;;;;;;;;;;;;;;;;;;;CAwBA,OAAO,OAAO,SAAS,SAAS;EAC9B,IAAI,mBAAmB;GACrB,GAAG;GACH;EACF,CAAC;CACH;CACA,YAAY,EACV,SAAS,WAAW,QACpB,eAAe,KACf,GAAG,YACD,CAAC,GAAG;EACN,IAAI,OAAO,SAAS,eAAe,UAAU,MAC3C,MAAM,IAAI,MAAM,kEAAkE;EAEpF,MAAM,2BAA2B,QAAQ,EACvC,aACF,CAAC,GAAG,OAAO;EACX,KAAK,SAAS;CAChB;AACF"}