@mittwald/flow-remote-core 0.2.0-alpha.781 → 0.2.0-alpha.782
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/dist/js/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/js/core/src/file.mjs +10 -12
- package/dist/js/core/src/file.mjs.map +1 -1
- package/dist/js/core/src/index.mjs +1 -0
- package/dist/js/index-node.mjs +15 -16
- package/dist/js/index.mjs +17 -15
- package/dist/js/remote-core/src/connection/connectHostRenderRoot.mjs +45 -55
- package/dist/js/remote-core/src/connection/connectHostRenderRoot.mjs.map +1 -1
- package/dist/js/remote-core/src/connection/connectRemoteIframe.mjs +47 -62
- package/dist/js/remote-core/src/connection/connectRemoteIframe.mjs.map +1 -1
- package/dist/js/remote-core/src/connection/index.mjs +3 -0
- package/dist/js/remote-core/src/connection/types.mjs +11 -9
- package/dist/js/remote-core/src/connection/types.mjs.map +1 -1
- package/dist/js/remote-core/src/error.mjs +10 -8
- package/dist/js/remote-core/src/error.mjs.map +1 -1
- package/dist/js/remote-core/src/ext-bridge/implementation.mjs +8 -12
- package/dist/js/remote-core/src/ext-bridge/implementation.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/FlowThreadSerialization.mjs +47 -59
- package/dist/js/remote-core/src/serialization/FlowThreadSerialization.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/Serializer.mjs +33 -35
- package/dist/js/remote-core/src/serialization/Serializer.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/index.mjs +9 -0
- package/dist/js/remote-core/src/serialization/serializers/dataTransferText.mjs +20 -21
- package/dist/js/remote-core/src/serialization/serializers/dataTransferText.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/date.mjs +13 -14
- package/dist/js/remote-core/src/serialization/serializers/date.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/file.mjs +29 -29
- package/dist/js/remote-core/src/serialization/serializers/file.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/fileList.mjs +20 -22
- package/dist/js/remote-core/src/serialization/serializers/fileList.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/formData.mjs +27 -34
- package/dist/js/remote-core/src/serialization/serializers/formData.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/index.mjs +23 -7
- package/dist/js/remote-core/src/serialization/serializers/index.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/passwordPolicy.mjs +13 -14
- package/dist/js/remote-core/src/serialization/serializers/passwordPolicy.mjs.map +1 -1
- package/dist/js/remote-core/src/shim.mjs +11 -12
- package/dist/js/remote-core/src/shim.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/js/index-node.mjs.map +0 -1
- package/dist/js/index.mjs.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import invariant from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import invariant from "invariant";
|
|
2
|
+
//#region ../core/src/file.ts
|
|
3
|
+
var Key = "mittwald.flow-core.file.awaitedArrayBuffer";
|
|
4
4
|
function isFileWithAwaitedArrayBuffer(file) {
|
|
5
|
-
|
|
5
|
+
return Key in file && file[Key] instanceof ArrayBuffer && !file[Key].detached;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"Could not get awaited ArrayBuffer from file"
|
|
11
|
-
);
|
|
12
|
-
return file[Key];
|
|
7
|
+
var getAwaitArrayBuffer = (file) => {
|
|
8
|
+
invariant(isFileWithAwaitedArrayBuffer(file), "Could not get awaited ArrayBuffer from file");
|
|
9
|
+
return file[Key];
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
//#endregion
|
|
15
12
|
export { getAwaitArrayBuffer, isFileWithAwaitedArrayBuffer };
|
|
16
|
-
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=file.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.mjs","sources":["../../../../../core/src/file.ts"],"sourcesContent":["import invariant from \"invariant\";\n\nconst Key = \"mittwald.flow-core.file.awaitedArrayBuffer\";\n\nexport type FileWithAwaitedArrayBuffer = File & {\n [Key]: ArrayBuffer;\n};\n\nexport function isFileWithAwaitedArrayBuffer(\n file: File | FileWithAwaitedArrayBuffer,\n): file is FileWithAwaitedArrayBuffer {\n return Key in file && file[Key] instanceof ArrayBuffer && !file[Key].detached;\n}\n\nexport const addAwaitedArrayBuffer = async (file: File) => {\n if (isFileWithAwaitedArrayBuffer(file)) {\n return file;\n }\n\n const arrayBuffer = await file.arrayBuffer();\n Object.assign(file, { [Key]: arrayBuffer });\n\n return file;\n};\n\nexport const getAwaitArrayBuffer = (\n file: File | FileWithAwaitedArrayBuffer,\n) => {\n invariant(\n isFileWithAwaitedArrayBuffer(file),\n \"Could not get awaited ArrayBuffer from file\",\n );\n return file[Key];\n};\n"],"
|
|
1
|
+
{"version":3,"file":"file.mjs","names":[],"sources":["../../../../../core/src/file.ts"],"sourcesContent":["import invariant from \"invariant\";\n\nconst Key = \"mittwald.flow-core.file.awaitedArrayBuffer\";\n\nexport type FileWithAwaitedArrayBuffer = File & {\n [Key]: ArrayBuffer;\n};\n\nexport function isFileWithAwaitedArrayBuffer(\n file: File | FileWithAwaitedArrayBuffer,\n): file is FileWithAwaitedArrayBuffer {\n return Key in file && file[Key] instanceof ArrayBuffer && !file[Key].detached;\n}\n\nexport const addAwaitedArrayBuffer = async (file: File) => {\n if (isFileWithAwaitedArrayBuffer(file)) {\n return file;\n }\n\n const arrayBuffer = await file.arrayBuffer();\n Object.assign(file, { [Key]: arrayBuffer });\n\n return file;\n};\n\nexport const getAwaitArrayBuffer = (\n file: File | FileWithAwaitedArrayBuffer,\n) => {\n invariant(\n isFileWithAwaitedArrayBuffer(file),\n \"Could not get awaited ArrayBuffer from file\",\n );\n return file[Key];\n};\n"],"mappings":";;AAEA,IAAM,MAAM;AAMZ,SAAgB,6BACd,MACoC;AACpC,QAAO,OAAO,QAAQ,KAAK,gBAAgB,eAAe,CAAC,KAAK,KAAK;;AAcvE,IAAa,uBACX,SACG;AACH,WACE,6BAA6B,KAAK,EAClC,8CACD;AACD,QAAO,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./file.mjs";
|
package/dist/js/index-node.mjs
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export { RemoteError
|
|
16
|
-
//# sourceMappingURL=index-node.mjs.map
|
|
1
|
+
import { Serializer } from "./remote-core/src/serialization/Serializer.mjs";
|
|
2
|
+
import { calendarDateSerializer } from "./remote-core/src/serialization/serializers/date.mjs";
|
|
3
|
+
import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./remote-core/src/serialization/serializers/file.mjs";
|
|
4
|
+
import { fileListSerializer } from "./remote-core/src/serialization/serializers/fileList.mjs";
|
|
5
|
+
import { dataTransferTextSerializer } from "./remote-core/src/serialization/serializers/dataTransferText.mjs";
|
|
6
|
+
import { formDataSerializer } from "./remote-core/src/serialization/serializers/formData.mjs";
|
|
7
|
+
import { passwordPolicySerializer } from "./remote-core/src/serialization/serializers/passwordPolicy.mjs";
|
|
8
|
+
import { FlowThreadSerialization } from "./remote-core/src/serialization/FlowThreadSerialization.mjs";
|
|
9
|
+
import { Version } from "./remote-core/src/connection/types.mjs";
|
|
10
|
+
import { RemoteError } from "./remote-core/src/error.mjs";
|
|
11
|
+
import { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver } from "./remote-core/src/connection/connectHostRenderRoot.mjs";
|
|
12
|
+
import { connectRemoteIframe, connectRemoteIframeRef } from "./remote-core/src/connection/connectRemoteIframe.mjs";
|
|
13
|
+
import { RemoteElement, RemoteEvent, RemoteReceiver } from "./index.mjs";
|
|
14
|
+
import "./remote-core/src/shim.mjs";
|
|
15
|
+
export { FlowThreadSerialization, RemoteElement, RemoteError, RemoteEvent, RemoteReceiver, Serializer, Version, calendarDateSerializer, connectHostRenderRoot, connectHostRenderRootRef, connectRemoteIframe, connectRemoteIframeRef, connectRemoteReceiver, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, passwordPolicySerializer };
|
package/dist/js/index.mjs
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { Serializer } from "./remote-core/src/serialization/Serializer.mjs";
|
|
2
|
+
import { calendarDateSerializer } from "./remote-core/src/serialization/serializers/date.mjs";
|
|
3
|
+
import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./remote-core/src/serialization/serializers/file.mjs";
|
|
4
|
+
import { fileListSerializer } from "./remote-core/src/serialization/serializers/fileList.mjs";
|
|
5
|
+
import { dataTransferTextSerializer } from "./remote-core/src/serialization/serializers/dataTransferText.mjs";
|
|
6
|
+
import { formDataSerializer } from "./remote-core/src/serialization/serializers/formData.mjs";
|
|
7
|
+
import { passwordPolicySerializer } from "./remote-core/src/serialization/serializers/passwordPolicy.mjs";
|
|
8
|
+
import { FlowThreadSerialization } from "./remote-core/src/serialization/FlowThreadSerialization.mjs";
|
|
9
|
+
import "./remote-core/src/serialization/index.mjs";
|
|
10
|
+
import { Version } from "./remote-core/src/connection/types.mjs";
|
|
11
|
+
import { RemoteError } from "./remote-core/src/error.mjs";
|
|
12
|
+
import { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver } from "./remote-core/src/connection/connectHostRenderRoot.mjs";
|
|
13
|
+
import { connectRemoteIframe, connectRemoteIframeRef } from "./remote-core/src/connection/connectRemoteIframe.mjs";
|
|
14
|
+
import "./remote-core/src/connection/index.mjs";
|
|
15
|
+
import { RemoteReceiver } from "@mittwald/remote-dom-core/receivers";
|
|
16
|
+
import { RemoteElement, RemoteEvent } from "@mittwald/remote-dom-core/elements";
|
|
17
|
+
export { FlowThreadSerialization, RemoteElement, RemoteError, RemoteEvent, RemoteReceiver, Serializer, Version, calendarDateSerializer, connectHostRenderRoot, connectHostRenderRootRef, connectRemoteIframe, connectRemoteIframeRef, connectRemoteReceiver, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, passwordPolicySerializer };
|
|
@@ -1,58 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { ThreadNestedIframe } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return connection;
|
|
35
|
-
} catch (error) {
|
|
36
|
-
if (error instanceof Error && /No '.*' method is exported from this thread/.test(error.message)) {
|
|
37
|
-
throw incompatibleParentFrameError();
|
|
38
|
-
}
|
|
39
|
-
throw error;
|
|
40
|
-
}
|
|
1
|
+
import { FlowThreadSerialization } from "../serialization/FlowThreadSerialization.mjs";
|
|
2
|
+
import { Version } from "./types.mjs";
|
|
3
|
+
import { RemoteError } from "../error.mjs";
|
|
4
|
+
import "@mittwald/remote-dom-core/elements";
|
|
5
|
+
import { ThreadNestedIframe } from "@quilted/threads";
|
|
6
|
+
//#region src/connection/connectHostRenderRoot.ts
|
|
7
|
+
var incompatibleParentFrameError = () => new RemoteError("Could not find any compatible parent frame");
|
|
8
|
+
var connectRemoteReceiver = (root, receiverConnection) => import("@mittwald/remote-dom-core/elements").then(({ RemoteMutationObserver }) => {
|
|
9
|
+
new RemoteMutationObserver(receiverConnection).observe(root);
|
|
10
|
+
});
|
|
11
|
+
var connectHostRenderRoot = async (options) => {
|
|
12
|
+
const { root, onPathnameChanged } = options;
|
|
13
|
+
const connection = new ThreadNestedIframe({
|
|
14
|
+
serialization: new FlowThreadSerialization(),
|
|
15
|
+
exports: {
|
|
16
|
+
render: (connection) => connectRemoteReceiver(root, connection),
|
|
17
|
+
setPathname: async (pathname) => {
|
|
18
|
+
onPathnameChanged?.(pathname);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
if (connection.parent === window) throw incompatibleParentFrameError();
|
|
23
|
+
try {
|
|
24
|
+
await connection.imports.setIsReady(Version.v3);
|
|
25
|
+
if (typeof mwExtBridge !== "undefined") {
|
|
26
|
+
mwExtBridge.connection = connection.imports;
|
|
27
|
+
await mwExtBridge.readiness.setIsReady();
|
|
28
|
+
}
|
|
29
|
+
return connection;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error instanceof Error && /No '.*' method is exported from this thread/.test(error.message)) throw incompatibleParentFrameError();
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
41
34
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
...opts
|
|
52
|
-
});
|
|
53
|
-
Object.assign(ref, { __remoteConnection: connection });
|
|
54
|
-
return connection;
|
|
35
|
+
var connectHostRenderRootRef = (opts) => (ref) => {
|
|
36
|
+
if (ref === null) return;
|
|
37
|
+
if ("__remoteConnection" in ref) return ref["__remoteConnection"];
|
|
38
|
+
const connection = connectHostRenderRoot({
|
|
39
|
+
root: ref,
|
|
40
|
+
...opts
|
|
41
|
+
});
|
|
42
|
+
Object.assign(ref, { __remoteConnection: connection });
|
|
43
|
+
return connection;
|
|
55
44
|
};
|
|
56
|
-
|
|
45
|
+
//#endregion
|
|
57
46
|
export { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver };
|
|
58
|
-
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=connectHostRenderRoot.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectHostRenderRoot.mjs","sources":["../../../../../src/connection/connectHostRenderRoot.ts"],"sourcesContent":["import {\n Version,\n type HostExports,\n type RemoteExports,\n type RemoteToHostConnection,\n} from \"@/connection/types\";\nimport { RemoteError } from \"@/error\";\nimport { FlowThreadSerialization } from \"@/serialization/FlowThreadSerialization\";\nimport { type RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadNestedIframe } from \"@quilted/threads\";\n\ninterface Options {\n root: HTMLDivElement;\n onPathnameChanged?: (pathname: string) => void;\n}\n\nconst incompatibleParentFrameError = () =>\n new RemoteError(\"Could not find any compatible parent frame\");\n\nexport const connectRemoteReceiver = (\n root: HTMLDivElement,\n receiverConnection: RemoteConnection,\n) =>\n import(\"@mittwald/remote-dom-core/elements\").then(\n ({ RemoteMutationObserver }) => {\n const observer = new RemoteMutationObserver(receiverConnection);\n observer.observe(root);\n },\n );\n\nexport const connectHostRenderRoot = async (\n options: Options,\n): Promise<RemoteToHostConnection> => {\n const { root, onPathnameChanged } = options;\n\n const connection = new ThreadNestedIframe<HostExports, RemoteExports>({\n serialization: new FlowThreadSerialization(),\n exports: {\n render: (connection: RemoteConnection) =>\n connectRemoteReceiver(root, connection),\n setPathname: async (pathname) => {\n onPathnameChanged?.(pathname);\n },\n },\n });\n\n if (connection.parent === window) {\n throw incompatibleParentFrameError();\n }\n\n try {\n await connection.imports.setIsReady(Version.v3);\n\n if (typeof mwExtBridge !== \"undefined\") {\n mwExtBridge.connection = connection.imports;\n await mwExtBridge.readiness.setIsReady();\n }\n\n return connection;\n } catch (error) {\n if (\n error instanceof Error &&\n /No '.*' method is exported from this thread/.test(error.message)\n ) {\n throw incompatibleParentFrameError();\n }\n throw error;\n }\n};\n\nexport const connectHostRenderRootRef =\n (opts: Omit<Options, \"root\">) => (ref: HTMLDivElement | null) => {\n if (ref === null) {\n return;\n }\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as Promise<RemoteToHostConnection>;\n }\n\n const connection = connectHostRenderRoot({\n root: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"
|
|
1
|
+
{"version":3,"file":"connectHostRenderRoot.mjs","names":[],"sources":["../../../../../src/connection/connectHostRenderRoot.ts"],"sourcesContent":["import {\n Version,\n type HostExports,\n type RemoteExports,\n type RemoteToHostConnection,\n} from \"@/connection/types\";\nimport { RemoteError } from \"@/error\";\nimport { FlowThreadSerialization } from \"@/serialization/FlowThreadSerialization\";\nimport { type RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadNestedIframe } from \"@quilted/threads\";\n\ninterface Options {\n root: HTMLDivElement;\n onPathnameChanged?: (pathname: string) => void;\n}\n\nconst incompatibleParentFrameError = () =>\n new RemoteError(\"Could not find any compatible parent frame\");\n\nexport const connectRemoteReceiver = (\n root: HTMLDivElement,\n receiverConnection: RemoteConnection,\n) =>\n import(\"@mittwald/remote-dom-core/elements\").then(\n ({ RemoteMutationObserver }) => {\n const observer = new RemoteMutationObserver(receiverConnection);\n observer.observe(root);\n },\n );\n\nexport const connectHostRenderRoot = async (\n options: Options,\n): Promise<RemoteToHostConnection> => {\n const { root, onPathnameChanged } = options;\n\n const connection = new ThreadNestedIframe<HostExports, RemoteExports>({\n serialization: new FlowThreadSerialization(),\n exports: {\n render: (connection: RemoteConnection) =>\n connectRemoteReceiver(root, connection),\n setPathname: async (pathname) => {\n onPathnameChanged?.(pathname);\n },\n },\n });\n\n if (connection.parent === window) {\n throw incompatibleParentFrameError();\n }\n\n try {\n await connection.imports.setIsReady(Version.v3);\n\n if (typeof mwExtBridge !== \"undefined\") {\n mwExtBridge.connection = connection.imports;\n await mwExtBridge.readiness.setIsReady();\n }\n\n return connection;\n } catch (error) {\n if (\n error instanceof Error &&\n /No '.*' method is exported from this thread/.test(error.message)\n ) {\n throw incompatibleParentFrameError();\n }\n throw error;\n }\n};\n\nexport const connectHostRenderRootRef =\n (opts: Omit<Options, \"root\">) => (ref: HTMLDivElement | null) => {\n if (ref === null) {\n return;\n }\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as Promise<RemoteToHostConnection>;\n }\n\n const connection = connectHostRenderRoot({\n root: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"mappings":";;;;;;AAgBA,IAAM,qCACJ,IAAI,YAAY,6CAA6C;AAE/D,IAAa,yBACX,MACA,uBAEA,OAAO,sCAAsC,MAC1C,EAAE,6BAA6B;AACb,KAAI,uBAAuB,mBAAmB,CACtD,QAAQ,KAAK;EAEzB;AAEH,IAAa,wBAAwB,OACnC,YACoC;CACpC,MAAM,EAAE,MAAM,sBAAsB;CAEpC,MAAM,aAAa,IAAI,mBAA+C;EACpE,eAAe,IAAI,yBAAyB;EAC5C,SAAS;GACP,SAAS,eACP,sBAAsB,MAAM,WAAW;GACzC,aAAa,OAAO,aAAa;AAC/B,wBAAoB,SAAS;;GAEhC;EACF,CAAC;AAEF,KAAI,WAAW,WAAW,OACxB,OAAM,8BAA8B;AAGtC,KAAI;AACF,QAAM,WAAW,QAAQ,WAAW,QAAQ,GAAG;AAE/C,MAAI,OAAO,gBAAgB,aAAa;AACtC,eAAY,aAAa,WAAW;AACpC,SAAM,YAAY,UAAU,YAAY;;AAG1C,SAAO;UACA,OAAO;AACd,MACE,iBAAiB,SACjB,8CAA8C,KAAK,MAAM,QAAQ,CAEjE,OAAM,8BAA8B;AAEtC,QAAM;;;AAIV,IAAa,4BACV,UAAiC,QAA+B;AAC/D,KAAI,QAAQ,KACV;AAEF,KAAI,wBAAwB,IAC1B,QAAO,IAAI;CAGb,MAAM,aAAa,sBAAsB;EACvC,MAAM;EACN,GAAG;EACJ,CAAC;AACF,QAAO,OAAO,KAAK,EAAE,oBAAoB,YAAY,CAAC;AACtD,QAAO"}
|
|
@@ -1,65 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ThreadIframe } from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
version: 0,
|
|
37
|
-
updateHostPathname: (hostPathname) => {
|
|
38
|
-
if (hostPathname === void 0) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (result.version >= Version.v2) {
|
|
42
|
-
result.thread.imports.setPathname(hostPathname);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
result.thread.imports.render(connection);
|
|
47
|
-
return result;
|
|
1
|
+
import { FlowThreadSerialization } from "../serialization/FlowThreadSerialization.mjs";
|
|
2
|
+
import { Version } from "./types.mjs";
|
|
3
|
+
import { emptyImplementation } from "../ext-bridge/implementation.mjs";
|
|
4
|
+
import { ThreadIframe } from "@quilted/threads";
|
|
5
|
+
//#region src/connection/connectRemoteIframe.ts
|
|
6
|
+
var connectRemoteIframe = (opts) => {
|
|
7
|
+
const { connection, iframe, onReady, onLoadingChanged, onError, onNavigationStateChanged, extBridgeImplementation = emptyImplementation } = opts;
|
|
8
|
+
const result = {
|
|
9
|
+
thread: new ThreadIframe(iframe, {
|
|
10
|
+
serialization: new FlowThreadSerialization(),
|
|
11
|
+
exports: {
|
|
12
|
+
...extBridgeImplementation,
|
|
13
|
+
setIsReady: async (version = 1) => {
|
|
14
|
+
result.version = version;
|
|
15
|
+
onReady?.(result);
|
|
16
|
+
},
|
|
17
|
+
setIsLoading: async (isLoading) => {
|
|
18
|
+
onLoadingChanged?.(isLoading);
|
|
19
|
+
},
|
|
20
|
+
setError: async (error) => {
|
|
21
|
+
onError?.(error);
|
|
22
|
+
},
|
|
23
|
+
setNavigationState: async (state) => {
|
|
24
|
+
onNavigationStateChanged?.(state);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
version: 0,
|
|
29
|
+
updateHostPathname: (hostPathname) => {
|
|
30
|
+
if (hostPathname === void 0) return;
|
|
31
|
+
if (result.version >= Version.v2) result.thread.imports.setPathname(hostPathname);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
result.thread.imports.render(connection);
|
|
35
|
+
return result;
|
|
48
36
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...opts
|
|
59
|
-
});
|
|
60
|
-
Object.assign(ref, { __remoteConnection: connection });
|
|
61
|
-
return connection;
|
|
37
|
+
var connectRemoteIframeRef = (opts) => (ref) => {
|
|
38
|
+
if (!ref) return;
|
|
39
|
+
if ("__remoteConnection" in ref) return ref["__remoteConnection"];
|
|
40
|
+
const connection = connectRemoteIframe({
|
|
41
|
+
iframe: ref,
|
|
42
|
+
...opts
|
|
43
|
+
});
|
|
44
|
+
Object.assign(ref, { __remoteConnection: connection });
|
|
45
|
+
return connection;
|
|
62
46
|
};
|
|
63
|
-
|
|
47
|
+
//#endregion
|
|
64
48
|
export { connectRemoteIframe, connectRemoteIframeRef };
|
|
65
|
-
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=connectRemoteIframe.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connectRemoteIframe.mjs","sources":["../../../../../src/connection/connectRemoteIframe.ts"],"sourcesContent":["import {\n type HostExports,\n type HostToRemoteConnection,\n type NavigationState,\n type RemoteExports,\n Version,\n} from \"@/connection/types\";\nimport { emptyImplementation } from \"@/ext-bridge/implementation\";\nimport { FlowThreadSerialization } from \"@/serialization/FlowThreadSerialization\";\nimport type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\nimport type { RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadIframe } from \"@quilted/threads\";\n\ninterface Options {\n connection: RemoteConnection;\n iframe: HTMLIFrameElement;\n onReady?: (connection: HostToRemoteConnection) => void;\n onLoadingChanged?: (isLoading: boolean) => void;\n onError?: (error: string) => void;\n onNavigationStateChanged?: (state: NavigationState) => void;\n extBridgeImplementation?: ExtBridgeConnectionApi;\n}\n\nexport const connectRemoteIframe = (opts: Options): HostToRemoteConnection => {\n const {\n connection,\n iframe,\n onReady,\n onLoadingChanged,\n onError,\n onNavigationStateChanged,\n extBridgeImplementation = emptyImplementation,\n } = opts;\n\n const result = {\n thread: new ThreadIframe<RemoteExports, HostExports>(iframe, {\n serialization: new FlowThreadSerialization(),\n exports: {\n ...extBridgeImplementation,\n setIsReady: async (version = 1) => {\n result.version = version;\n onReady?.(result);\n },\n setIsLoading: async (isLoading: boolean) => {\n onLoadingChanged?.(isLoading);\n },\n setError: async (error: string) => {\n onError?.(error);\n },\n setNavigationState: async (state) => {\n onNavigationStateChanged?.(state);\n },\n },\n }),\n version: 0,\n updateHostPathname: (hostPathname?: string) => {\n if (hostPathname === undefined) {\n return;\n }\n\n if (result.version >= Version.v2) {\n result.thread.imports.setPathname(hostPathname);\n }\n },\n };\n\n result.thread.imports.render(connection);\n return result;\n};\n\nexport const connectRemoteIframeRef =\n (opts: Omit<Options, \"iframe\">) => (ref: HTMLIFrameElement | null) => {\n if (!ref) {\n return;\n }\n\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as HostToRemoteConnection;\n }\n\n const connection = connectRemoteIframe({\n iframe: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"
|
|
1
|
+
{"version":3,"file":"connectRemoteIframe.mjs","names":[],"sources":["../../../../../src/connection/connectRemoteIframe.ts"],"sourcesContent":["import {\n type HostExports,\n type HostToRemoteConnection,\n type NavigationState,\n type RemoteExports,\n Version,\n} from \"@/connection/types\";\nimport { emptyImplementation } from \"@/ext-bridge/implementation\";\nimport { FlowThreadSerialization } from \"@/serialization/FlowThreadSerialization\";\nimport type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\nimport type { RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadIframe } from \"@quilted/threads\";\n\ninterface Options {\n connection: RemoteConnection;\n iframe: HTMLIFrameElement;\n onReady?: (connection: HostToRemoteConnection) => void;\n onLoadingChanged?: (isLoading: boolean) => void;\n onError?: (error: string) => void;\n onNavigationStateChanged?: (state: NavigationState) => void;\n extBridgeImplementation?: ExtBridgeConnectionApi;\n}\n\nexport const connectRemoteIframe = (opts: Options): HostToRemoteConnection => {\n const {\n connection,\n iframe,\n onReady,\n onLoadingChanged,\n onError,\n onNavigationStateChanged,\n extBridgeImplementation = emptyImplementation,\n } = opts;\n\n const result = {\n thread: new ThreadIframe<RemoteExports, HostExports>(iframe, {\n serialization: new FlowThreadSerialization(),\n exports: {\n ...extBridgeImplementation,\n setIsReady: async (version = 1) => {\n result.version = version;\n onReady?.(result);\n },\n setIsLoading: async (isLoading: boolean) => {\n onLoadingChanged?.(isLoading);\n },\n setError: async (error: string) => {\n onError?.(error);\n },\n setNavigationState: async (state) => {\n onNavigationStateChanged?.(state);\n },\n },\n }),\n version: 0,\n updateHostPathname: (hostPathname?: string) => {\n if (hostPathname === undefined) {\n return;\n }\n\n if (result.version >= Version.v2) {\n result.thread.imports.setPathname(hostPathname);\n }\n },\n };\n\n result.thread.imports.render(connection);\n return result;\n};\n\nexport const connectRemoteIframeRef =\n (opts: Omit<Options, \"iframe\">) => (ref: HTMLIFrameElement | null) => {\n if (!ref) {\n return;\n }\n\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as HostToRemoteConnection;\n }\n\n const connection = connectRemoteIframe({\n iframe: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"mappings":";;;;;AAuBA,IAAa,uBAAuB,SAA0C;CAC5E,MAAM,EACJ,YACA,QACA,SACA,kBACA,SACA,0BACA,0BAA0B,wBACxB;CAEJ,MAAM,SAAS;EACb,QAAQ,IAAI,aAAyC,QAAQ;GAC3D,eAAe,IAAI,yBAAyB;GAC5C,SAAS;IACP,GAAG;IACH,YAAY,OAAO,UAAU,MAAM;AACjC,YAAO,UAAU;AACjB,eAAU,OAAO;;IAEnB,cAAc,OAAO,cAAuB;AAC1C,wBAAmB,UAAU;;IAE/B,UAAU,OAAO,UAAkB;AACjC,eAAU,MAAM;;IAElB,oBAAoB,OAAO,UAAU;AACnC,gCAA2B,MAAM;;IAEpC;GACF,CAAC;EACF,SAAS;EACT,qBAAqB,iBAA0B;AAC7C,OAAI,iBAAiB,KAAA,EACnB;AAGF,OAAI,OAAO,WAAW,QAAQ,GAC5B,QAAO,OAAO,QAAQ,YAAY,aAAa;;EAGpD;AAED,QAAO,OAAO,QAAQ,OAAO,WAAW;AACxC,QAAO;;AAGT,IAAa,0BACV,UAAmC,QAAkC;AACpE,KAAI,CAAC,IACH;AAGF,KAAI,wBAAwB,IAC1B,QAAO,IAAI;CAGb,MAAM,aAAa,oBAAoB;EACrC,QAAQ;EACR,GAAG;EACJ,CAAC;AACF,QAAO,OAAO,KAAK,EAAE,oBAAoB,YAAY,CAAC;AACtD,QAAO"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
//#region src/connection/types.ts
|
|
2
|
+
var Version = /* @__PURE__ */ function(Version) {
|
|
3
|
+
Version[Version["vUnknown"] = 0] = "vUnknown";
|
|
4
|
+
Version[Version["v1"] = 1] = "v1";
|
|
5
|
+
Version[Version["v2"] = 2] = "v2";
|
|
6
|
+
Version[Version["v3"] = 3] = "v3";
|
|
7
|
+
return Version;
|
|
8
|
+
}({});
|
|
9
|
+
//#endregion
|
|
9
10
|
export { Version };
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../../../src/connection/types.ts"],"sourcesContent":["import type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\nimport type { RemoteConnection } from \"@mittwald/remote-dom-core\";\nimport type { ThreadIframe, ThreadNestedIframe } from \"@quilted/threads\";\nexport type { RemoteConnection } from \"@mittwald/remote-dom-core\";\n\nexport interface NavigationState {\n pathname: string;\n isPending: boolean;\n}\n\nexport interface HostExports extends ExtBridgeConnectionApi {\n setIsReady: (version?: Version) => Promise<void>;\n setIsLoading: (isLoading: boolean) => Promise<void>;\n setError: (error: string) => Promise<void>;\n setNavigationState: (state: NavigationState) => Promise<void>;\n}\n\nexport interface RemoteExports {\n render: (connection: RemoteConnection) => Promise<void>;\n setPathname: (pathname: string) => Promise<void>;\n}\n\nexport type RemoteToHostConnection = ThreadNestedIframe<\n HostExports,\n RemoteExports\n>;\n\nexport interface HostToRemoteConnection {\n version: Version;\n thread: ThreadIframe<RemoteExports, HostExports>;\n updateHostPathname: (hostPathname?: string) => void;\n}\n\nexport enum Version {\n vUnknown = 0,\n v1 = 1,\n v2 = 2,\n v3 = 3,\n}\n"],"
|
|
1
|
+
{"version":3,"file":"types.mjs","names":[],"sources":["../../../../../src/connection/types.ts"],"sourcesContent":["import type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\nimport type { RemoteConnection } from \"@mittwald/remote-dom-core\";\nimport type { ThreadIframe, ThreadNestedIframe } from \"@quilted/threads\";\nexport type { RemoteConnection } from \"@mittwald/remote-dom-core\";\n\nexport interface NavigationState {\n pathname: string;\n isPending: boolean;\n}\n\nexport interface HostExports extends ExtBridgeConnectionApi {\n setIsReady: (version?: Version) => Promise<void>;\n setIsLoading: (isLoading: boolean) => Promise<void>;\n setError: (error: string) => Promise<void>;\n setNavigationState: (state: NavigationState) => Promise<void>;\n}\n\nexport interface RemoteExports {\n render: (connection: RemoteConnection) => Promise<void>;\n setPathname: (pathname: string) => Promise<void>;\n}\n\nexport type RemoteToHostConnection = ThreadNestedIframe<\n HostExports,\n RemoteExports\n>;\n\nexport interface HostToRemoteConnection {\n version: Version;\n thread: ThreadIframe<RemoteExports, HostExports>;\n updateHostPathname: (hostPathname?: string) => void;\n}\n\nexport enum Version {\n vUnknown = 0,\n v1 = 1,\n v2 = 2,\n v3 = 3,\n}\n"],"mappings":";AAiCA,IAAY,UAAL,yBAAA,SAAA;AACL,SAAA,QAAA,cAAA,KAAA;AACA,SAAA,QAAA,QAAA,KAAA;AACA,SAAA,QAAA,QAAA,KAAA;AACA,SAAA,QAAA,QAAA,KAAA;;KACD"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
//#region src/error.ts
|
|
2
|
+
var RemoteError = class extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.message = message;
|
|
6
|
+
}
|
|
7
|
+
};
|
|
7
8
|
RemoteError.prototype.name = "RemoteError";
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
9
10
|
export { RemoteError };
|
|
10
|
-
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=error.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.mjs","sources":["../../../../src/error.ts"],"sourcesContent":["export class RemoteError extends Error {\n constructor(message: string) {\n super(message);\n this.message = message;\n }\n}\n\nRemoteError.prototype.name = \"RemoteError\";\n"],"
|
|
1
|
+
{"version":3,"file":"error.mjs","names":[],"sources":["../../../../src/error.ts"],"sourcesContent":["export class RemoteError extends Error {\n constructor(message: string) {\n super(message);\n this.message = message;\n }\n}\n\nRemoteError.prototype.name = \"RemoteError\";\n"],"mappings":";AAAA,IAAa,cAAb,cAAiC,MAAM;CACrC,YAAY,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,UAAU;;;AAInB,YAAY,UAAU,OAAO"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { RemoteError } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
throw new RemoteError("Missing implementation for mittwald.extBridge");
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
);
|
|
11
|
-
|
|
1
|
+
import { RemoteError } from "../error.mjs";
|
|
2
|
+
//#region src/ext-bridge/implementation.ts
|
|
3
|
+
var emptyImplementation = new Proxy({}, { get() {
|
|
4
|
+
throw new RemoteError("Missing implementation for mittwald.extBridge");
|
|
5
|
+
} });
|
|
6
|
+
//#endregion
|
|
12
7
|
export { emptyImplementation };
|
|
13
|
-
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=implementation.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.mjs","sources":["../../../../../src/ext-bridge/implementation.ts"],"sourcesContent":["import { RemoteError } from \"@/error\";\nimport type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\n\nexport const emptyImplementation = new Proxy(\n {},\n {\n get() {\n throw new RemoteError(\"Missing implementation for mittwald.extBridge\");\n },\n },\n) as ExtBridgeConnectionApi;\n"],"
|
|
1
|
+
{"version":3,"file":"implementation.mjs","names":[],"sources":["../../../../../src/ext-bridge/implementation.ts"],"sourcesContent":["import { RemoteError } from \"@/error\";\nimport type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\n\nexport const emptyImplementation = new Proxy(\n {},\n {\n get() {\n throw new RemoteError(\"Missing implementation for mittwald.extBridge\");\n },\n },\n) as ExtBridgeConnectionApi;\n"],"mappings":";;AAGA,IAAa,sBAAsB,IAAI,MACrC,EAAE,EACF,EACE,MAAM;AACJ,OAAM,IAAI,YAAY,gDAAgD;GAEzE,CACF"}
|
|
@@ -1,60 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
super(options);
|
|
50
|
-
}
|
|
51
|
-
isSerializableByBase(val) {
|
|
52
|
-
return val instanceof Map || val instanceof Set || Array.isArray(val) || typeof val === "function" || isObjectType(val) && TRANSFERABLE in val;
|
|
53
|
-
}
|
|
54
|
-
omitSerialization(val) {
|
|
55
|
-
return val instanceof HTMLElement || val === window;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
1
|
+
import { Serializer } from "./Serializer.mjs";
|
|
2
|
+
import { serializers_exports } from "./serializers/index.mjs";
|
|
3
|
+
import { TRANSFERABLE, ThreadSerializationStructuredClone } from "@quilted/threads";
|
|
4
|
+
import { isObjectType } from "remeda";
|
|
5
|
+
//#region src/serialization/FlowThreadSerialization.ts
|
|
6
|
+
var serializers = Object.values(serializers_exports).filter((val) => val instanceof Serializer);
|
|
7
|
+
var FlowThreadSerialization = class extends ThreadSerializationStructuredClone {
|
|
8
|
+
constructor() {
|
|
9
|
+
super({
|
|
10
|
+
serialize: (val, serialize) => {
|
|
11
|
+
try {
|
|
12
|
+
if (this.isSerializableByBase(val)) return;
|
|
13
|
+
if (this.omitSerialization(val)) return null;
|
|
14
|
+
for (const serializer of serializers) {
|
|
15
|
+
const serialization = serializer.serialize(val);
|
|
16
|
+
if (serialization.applied) return serialize(serialization.result);
|
|
17
|
+
}
|
|
18
|
+
if (isObjectType(val)) return serialize({ ...val });
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error("Error while serializing", error);
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
deserialize: (val, serialize) => {
|
|
25
|
+
try {
|
|
26
|
+
for (const serializer of serializers) {
|
|
27
|
+
const deserialization = serializer.deserialize(val);
|
|
28
|
+
if (deserialization.applied) return deserialization.result.value;
|
|
29
|
+
}
|
|
30
|
+
return serialize(val);
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error("Error while deserializing", error);
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
isSerializableByBase(val) {
|
|
39
|
+
return val instanceof Map || val instanceof Set || Array.isArray(val) || typeof val === "function" || isObjectType(val) && TRANSFERABLE in val;
|
|
40
|
+
}
|
|
41
|
+
omitSerialization(val) {
|
|
42
|
+
return val instanceof HTMLElement || val === window;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
59
46
|
export { FlowThreadSerialization };
|
|
60
|
-
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=FlowThreadSerialization.mjs.map
|