@mittwald/flow-remote-core 0.2.0-alpha.516 → 0.2.0-alpha.517
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/core/src/file.mjs.map +1 -1
- package/dist/js/remote-core/src/connection/connectHostRenderRoot.mjs.map +1 -1
- package/dist/js/remote-core/src/connection/connectRemoteIframe.mjs.map +1 -1
- package/dist/js/remote-core/src/connection/types.mjs.map +1 -1
- package/dist/js/remote-core/src/error.mjs.map +1 -1
- package/dist/js/remote-core/src/ext-bridge/implementation.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/FlowThreadSerialization.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/Serializer.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/dataTransferText.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/date.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/file.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/fileList.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/formData.mjs.map +1 -1
- package/dist/js/remote-core/src/serialization/serializers/passwordPolicy.mjs.map +1 -1
- package/dist/js/remote-core/src/shim.mjs.map +1 -1
- package/package.json +12 -12
|
@@ -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"],"names":[],"mappings":";;AAEA,MAAM,GAAM,
|
|
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"],"names":[],"mappings":";;AAEA,MAAM,GAAA,GAAM,4CAAA;AAML,SAAS,6BACd,IAAA,EACoC;AACpC,EAAA,OAAO,GAAA,IAAO,QAAQ,IAAA,CAAK,GAAG,aAAa,WAAA,IAAe,CAAC,IAAA,CAAK,GAAG,CAAA,CAAE,QAAA;AACvE;AAaO,MAAM,mBAAA,GAAsB,CACjC,IAAA,KACG;AACH,EAAA,SAAA;AAAA,IACE,6BAA6B,IAAI,CAAA;AAAA,IACjC;AAAA,GACF;AACA,EAAA,OAAO,KAAK,GAAG,CAAA;AACjB;;;;"}
|
|
@@ -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 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 import(\"@mittwald/remote-dom-core/elements\").then(\n ({ RemoteMutationObserver }) => {\n const observer = new RemoteMutationObserver(connection);\n observer.observe(root);\n },\n ),\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"],"names":["connection"],"mappings":";;;;;;AAgBA,MAAM,
|
|
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 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 import(\"@mittwald/remote-dom-core/elements\").then(\n ({ RemoteMutationObserver }) => {\n const observer = new RemoteMutationObserver(connection);\n observer.observe(root);\n },\n ),\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"],"names":["connection"],"mappings":";;;;;;AAgBA,MAAM,4BAAA,GAA+B,MACnC,IAAI,WAAA,CAAY,4CAA4C,CAAA;AAEvD,MAAM,qBAAA,GAAwB,OACnC,OAAA,KACoC;AACpC,EAAA,MAAM,EAAE,IAAA,EAAM,iBAAA,EAAkB,GAAI,OAAA;AAEpC,EAAA,MAAM,UAAA,GAAa,IAAI,kBAAA,CAA+C;AAAA,IACpE,aAAA,EAAe,IAAI,uBAAA,EAAwB;AAAA,IAC3C,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,CAACA,WAAAA,KACP,OAAO,oCAAoC,CAAA,CAAE,IAAA;AAAA,QAC3C,CAAC,EAAE,sBAAA,EAAuB,KAAM;AAC9B,UAAA,MAAM,QAAA,GAAW,IAAI,sBAAA,CAAuBA,WAAU,CAAA;AACtD,UAAA,QAAA,CAAS,QAAQ,IAAI,CAAA;AAAA,QACvB;AAAA,OACF;AAAA,MACF,WAAA,EAAa,OAAO,QAAA,KAAa;AAC/B,QAAA,iBAAA,GAAoB,QAAQ,CAAA;AAAA,MAC9B;AAAA;AACF,GACD,CAAA;AAED,EAAA,IAAI,UAAA,CAAW,WAAW,MAAA,EAAQ;AAChC,IAAA,MAAM,4BAAA,EAA6B;AAAA,EACrC;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,UAAA,CAAW,OAAA,CAAQ,UAAA,CAAW,OAAA,CAAQ,EAAE,CAAA;AAE9C,IAAA,IAAI,OAAO,gBAAgB,WAAA,EAAa;AACtC,MAAA,WAAA,CAAY,aAAa,UAAA,CAAW,OAAA;AACpC,MAAA,MAAM,WAAA,CAAY,UAAU,UAAA,EAAW;AAAA,IACzC;AAEA,IAAA,OAAO,UAAA;AAAA,EACT,SAAS,KAAA,EAAO;AACd,IAAA,IACE,iBAAiB,KAAA,IACjB,6CAAA,CAA8C,IAAA,CAAK,KAAA,CAAM,OAAO,CAAA,EAChE;AACA,MAAA,MAAM,4BAAA,EAA6B;AAAA,IACrC;AACA,IAAA,MAAM,KAAA;AAAA,EACR;AACF;AAEO,MAAM,wBAAA,GACX,CAAC,IAAA,KAAgC,CAAC,GAAA,KAA+B;AAC/D,EAAA,IAAI,QAAQ,IAAA,EAAM;AAChB,IAAA;AAAA,EACF;AACA,EAAA,IAAI,wBAAwB,GAAA,EAAK;AAC/B,IAAA,OAAO,IAAI,oBAAoB,CAAA;AAAA,EACjC;AAEA,EAAA,MAAM,aAAa,qBAAA,CAAsB;AAAA,IACvC,IAAA,EAAM,GAAA;AAAA,IACN,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAA,CAAO,MAAA,CAAO,GAAA,EAAK,EAAE,kBAAA,EAAoB,YAAY,CAAA;AACrD,EAAA,OAAO,UAAA;AACT;;;;"}
|
|
@@ -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"],"names":[],"mappings":";;;;;
|
|
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"],"names":[],"mappings":";;;;;AAuBO,MAAM,mBAAA,GAAsB,CAAC,IAAA,KAA0C;AAC5E,EAAA,MAAM;AAAA,IACJ,UAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA;AAAA,IACA,wBAAA;AAAA,IACA,uBAAA,GAA0B;AAAA,GAC5B,GAAI,IAAA;AAEJ,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,MAAA,EAAQ,IAAI,YAAA,CAAyC,MAAA,EAAQ;AAAA,MAC3D,aAAA,EAAe,IAAI,uBAAA,EAAwB;AAAA,MAC3C,OAAA,EAAS;AAAA,QACP,GAAG,uBAAA;AAAA,QACH,UAAA,EAAY,OAAO,OAAA,GAAU,CAAA,KAAM;AACjC,UAAA,MAAA,CAAO,OAAA,GAAU,OAAA;AACjB,UAAA,OAAA,GAAU,MAAM,CAAA;AAAA,QAClB,CAAA;AAAA,QACA,YAAA,EAAc,OAAO,SAAA,KAAuB;AAC1C,UAAA,gBAAA,GAAmB,SAAS,CAAA;AAAA,QAC9B,CAAA;AAAA,QACA,QAAA,EAAU,OAAO,KAAA,KAAkB;AACjC,UAAA,OAAA,GAAU,KAAK,CAAA;AAAA,QACjB,CAAA;AAAA,QACA,kBAAA,EAAoB,OAAO,KAAA,KAAU;AACnC,UAAA,wBAAA,GAA2B,KAAK,CAAA;AAAA,QAClC;AAAA;AACF,KACD,CAAA;AAAA,IACD,OAAA,EAAS,CAAA;AAAA,IACT,kBAAA,EAAoB,CAAC,YAAA,KAA0B;AAC7C,MAAA,IAAI,iBAAiB,MAAA,EAAW;AAC9B,QAAA;AAAA,MACF;AAEA,MAAA,IAAI,MAAA,CAAO,OAAA,IAAW,OAAA,CAAQ,EAAA,EAAI;AAChC,QAAA,MAAA,CAAO,MAAA,CAAO,OAAA,CAAQ,WAAA,CAAY,YAAY,CAAA;AAAA,MAChD;AAAA,IACF;AAAA,GACF;AAEA,EAAA,MAAA,CAAO,MAAA,CAAO,OAAA,CAAQ,MAAA,CAAO,UAAU,CAAA;AACvC,EAAA,OAAO,MAAA;AACT;AAEO,MAAM,sBAAA,GACX,CAAC,IAAA,KAAkC,CAAC,GAAA,KAAkC;AACpE,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,wBAAwB,GAAA,EAAK;AAC/B,IAAA,OAAO,IAAI,oBAAoB,CAAA;AAAA,EACjC;AAEA,EAAA,MAAM,aAAa,mBAAA,CAAoB;AAAA,IACrC,MAAA,EAAQ,GAAA;AAAA,IACR,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAA,CAAO,MAAA,CAAO,GAAA,EAAK,EAAE,kBAAA,EAAoB,YAAY,CAAA;AACrD,EAAA,OAAO,UAAA;AACT;;;;"}
|
|
@@ -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\";\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"],"names":["Version"],"mappings":"
|
|
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\";\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"],"names":["Version"],"mappings":"AAgCO,IAAK,OAAA,qBAAAA,QAAAA,KAAL;AACL,EAAAA,QAAAA,CAAAA,QAAAA,CAAA,cAAW,CAAA,CAAA,GAAX,UAAA;AACA,EAAAA,QAAAA,CAAAA,QAAAA,CAAA,QAAK,CAAA,CAAA,GAAL,IAAA;AACA,EAAAA,QAAAA,CAAAA,QAAAA,CAAA,QAAK,CAAA,CAAA,GAAL,IAAA;AACA,EAAAA,QAAAA,CAAAA,QAAAA,CAAA,QAAK,CAAA,CAAA,GAAL,IAAA;AAJU,EAAA,OAAAA,QAAAA;AAAA,CAAA,EAAA,OAAA,IAAA,EAAA;;;;"}
|
|
@@ -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"],"names":[],"mappings":"AAAO,MAAM,oBAAoB,
|
|
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"],"names":[],"mappings":"AAAO,MAAM,oBAAoB,KAAA,CAAM;AAAA,EACrC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AACF;AAEA,WAAA,CAAY,UAAU,IAAA,GAAO,aAAA;;;;"}
|
|
@@ -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"],"names":[],"mappings":";;AAGO,MAAM,sBAAsB,IAAI,KAAA;AAAA,EACrC,EAAC;AAAA,EACD;AAAA,IACE,GAAM
|
|
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"],"names":[],"mappings":";;AAGO,MAAM,sBAAsB,IAAI,KAAA;AAAA,EACrC,EAAC;AAAA,EACD;AAAA,IACE,GAAA,GAAM;AACJ,MAAA,MAAM,IAAI,YAAY,+CAA+C,CAAA;AAAA,IACvE;AAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlowThreadSerialization.mjs","sources":["../../../../../src/serialization/FlowThreadSerialization.ts"],"sourcesContent":["import {\n ThreadSerializationStructuredClone,\n type ThreadSerializationOptions,\n TRANSFERABLE,\n} from \"@quilted/threads\";\nimport * as serializerModules from \"./serializers\";\nimport { isObjectType } from \"remeda\";\nimport { Serializer } from \"@/serialization/Serializer\";\n\nconst serializers = Object.values(serializerModules).filter(\n (val) => val instanceof Serializer,\n);\n\nexport class FlowThreadSerialization extends ThreadSerializationStructuredClone {\n public constructor() {\n const options: ThreadSerializationOptions = {\n serialize: (val, serialize) => {\n try {\n if (this.isSerializableByBase(val)) {\n return;\n }\n if (this.omitSerialization(val)) {\n return null;\n }\n for (const serializer of serializers) {\n const serialization = serializer.serialize(val);\n if (serialization.applied) {\n return serialize(serialization.result);\n }\n }\n if (isObjectType(val)) {\n return serialize({ ...val });\n }\n } catch (error) {\n console.error(\"Error while serializing\", error);\n throw error;\n }\n },\n deserialize: (val, serialize) => {\n try {\n for (const serializer of serializers) {\n const deserialization = serializer.deserialize(val);\n if (deserialization.applied) {\n return deserialization.result.value;\n }\n }\n return serialize(val);\n } catch (error) {\n console.error(\"Error while deserializing\", error);\n throw error;\n }\n },\n };\n super(options);\n }\n\n private isSerializableByBase(val: unknown) {\n return (\n val instanceof Map ||\n val instanceof Set ||\n Array.isArray(val) ||\n typeof val === \"function\" ||\n (isObjectType(val) && TRANSFERABLE in val)\n );\n }\n\n private omitSerialization(val: unknown) {\n return val instanceof HTMLElement || val === window;\n }\n}\n"],"names":["serializerModules"],"mappings":";;;;;AASA,MAAM,
|
|
1
|
+
{"version":3,"file":"FlowThreadSerialization.mjs","sources":["../../../../../src/serialization/FlowThreadSerialization.ts"],"sourcesContent":["import {\n ThreadSerializationStructuredClone,\n type ThreadSerializationOptions,\n TRANSFERABLE,\n} from \"@quilted/threads\";\nimport * as serializerModules from \"./serializers\";\nimport { isObjectType } from \"remeda\";\nimport { Serializer } from \"@/serialization/Serializer\";\n\nconst serializers = Object.values(serializerModules).filter(\n (val) => val instanceof Serializer,\n);\n\nexport class FlowThreadSerialization extends ThreadSerializationStructuredClone {\n public constructor() {\n const options: ThreadSerializationOptions = {\n serialize: (val, serialize) => {\n try {\n if (this.isSerializableByBase(val)) {\n return;\n }\n if (this.omitSerialization(val)) {\n return null;\n }\n for (const serializer of serializers) {\n const serialization = serializer.serialize(val);\n if (serialization.applied) {\n return serialize(serialization.result);\n }\n }\n if (isObjectType(val)) {\n return serialize({ ...val });\n }\n } catch (error) {\n console.error(\"Error while serializing\", error);\n throw error;\n }\n },\n deserialize: (val, serialize) => {\n try {\n for (const serializer of serializers) {\n const deserialization = serializer.deserialize(val);\n if (deserialization.applied) {\n return deserialization.result.value;\n }\n }\n return serialize(val);\n } catch (error) {\n console.error(\"Error while deserializing\", error);\n throw error;\n }\n },\n };\n super(options);\n }\n\n private isSerializableByBase(val: unknown) {\n return (\n val instanceof Map ||\n val instanceof Set ||\n Array.isArray(val) ||\n typeof val === \"function\" ||\n (isObjectType(val) && TRANSFERABLE in val)\n );\n }\n\n private omitSerialization(val: unknown) {\n return val instanceof HTMLElement || val === window;\n }\n}\n"],"names":["serializerModules"],"mappings":";;;;;AASA,MAAM,WAAA,GAAc,MAAA,CAAO,MAAA,CAAOA,KAAiB,CAAA,CAAE,MAAA;AAAA,EACnD,CAAC,QAAQ,GAAA,YAAe;AAC1B,CAAA;AAEO,MAAM,gCAAgC,kCAAA,CAAmC;AAAA,EACvE,WAAA,GAAc;AACnB,IAAA,MAAM,OAAA,GAAsC;AAAA,MAC1C,SAAA,EAAW,CAAC,GAAA,EAAK,SAAA,KAAc;AAC7B,QAAA,IAAI;AACF,UAAA,IAAI,IAAA,CAAK,oBAAA,CAAqB,GAAG,CAAA,EAAG;AAClC,YAAA;AAAA,UACF;AACA,UAAA,IAAI,IAAA,CAAK,iBAAA,CAAkB,GAAG,CAAA,EAAG;AAC/B,YAAA,OAAO,IAAA;AAAA,UACT;AACA,UAAA,KAAA,MAAW,cAAc,WAAA,EAAa;AACpC,YAAA,MAAM,aAAA,GAAgB,UAAA,CAAW,SAAA,CAAU,GAAG,CAAA;AAC9C,YAAA,IAAI,cAAc,OAAA,EAAS;AACzB,cAAA,OAAO,SAAA,CAAU,cAAc,MAAM,CAAA;AAAA,YACvC;AAAA,UACF;AACA,UAAA,IAAI,YAAA,CAAa,GAAG,CAAA,EAAG;AACrB,YAAA,OAAO,SAAA,CAAU,EAAE,GAAG,GAAA,EAAK,CAAA;AAAA,UAC7B;AAAA,QACF,SAAS,KAAA,EAAO;AACd,UAAA,OAAA,CAAQ,KAAA,CAAM,2BAA2B,KAAK,CAAA;AAC9C,UAAA,MAAM,KAAA;AAAA,QACR;AAAA,MACF,CAAA;AAAA,MACA,WAAA,EAAa,CAAC,GAAA,EAAK,SAAA,KAAc;AAC/B,QAAA,IAAI;AACF,UAAA,KAAA,MAAW,cAAc,WAAA,EAAa;AACpC,YAAA,MAAM,eAAA,GAAkB,UAAA,CAAW,WAAA,CAAY,GAAG,CAAA;AAClD,YAAA,IAAI,gBAAgB,OAAA,EAAS;AAC3B,cAAA,OAAO,gBAAgB,MAAA,CAAO,KAAA;AAAA,YAChC;AAAA,UACF;AACA,UAAA,OAAO,UAAU,GAAG,CAAA;AAAA,QACtB,SAAS,KAAA,EAAO;AACd,UAAA,OAAA,CAAQ,KAAA,CAAM,6BAA6B,KAAK,CAAA;AAChD,UAAA,MAAM,KAAA;AAAA,QACR;AAAA,MACF;AAAA,KACF;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAAA,EACf;AAAA,EAEQ,qBAAqB,GAAA,EAAc;AACzC,IAAA,OACE,GAAA,YAAe,GAAA,IACf,GAAA,YAAe,GAAA,IACf,MAAM,OAAA,CAAQ,GAAG,CAAA,IACjB,OAAO,GAAA,KAAQ,UAAA,IACd,YAAA,CAAa,GAAG,KAAK,YAAA,IAAgB,GAAA;AAAA,EAE1C;AAAA,EAEQ,kBAAkB,GAAA,EAAc;AACtC,IAAA,OAAO,GAAA,YAAe,eAAe,GAAA,KAAQ,MAAA;AAAA,EAC/C;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Serializer.mjs","sources":["../../../../../src/serialization/Serializer.ts"],"sourcesContent":["interface SerializationStrategy<TIn, TOut> {\n isApplicable: (val: unknown) => val is TIn;\n apply: (val: TIn) => TOut;\n}\n\nconst Key = \"mittwald.flow-remote-core.serializer.name\";\n\nexport interface SuccessfulSerializationResult<T> {\n value: T;\n [Key]: string;\n}\n\nexport type SerializationResult<T> =\n | { applied: true; result: SuccessfulSerializationResult<T> }\n | { applied: false };\n\nexport class Serializer<TIn, TOut> {\n public constructor(\n private options: {\n name: string;\n serialize: SerializationStrategy<TIn, TOut>;\n deserialize: Pick<SerializationStrategy<TOut, TIn>, \"apply\">;\n },\n ) {}\n\n private apply<TIn, TOut>(\n val: unknown,\n strategy: SerializationStrategy<TIn, TOut>,\n ): SerializationResult<TOut> {\n if (strategy.isApplicable(val)) {\n return {\n applied: true,\n result: {\n [Key]: this.options.name,\n value: strategy.apply(val),\n },\n };\n }\n return {\n applied: false,\n };\n }\n\n public serialize(val: unknown): SerializationResult<TOut> {\n return this.apply<TIn, TOut>(val, this.options.serialize);\n }\n\n public deserialize(val: unknown): SerializationResult<TIn> {\n return this.apply(val, {\n apply: (serialization: SuccessfulSerializationResult<TOut>) => {\n return this.options.deserialize.apply(serialization.value);\n },\n isApplicable: (val): val is SuccessfulSerializationResult<TOut> => {\n return (\n !!val &&\n typeof val === \"object\" &&\n Key in val &&\n val[Key] === this.options.name\n );\n },\n });\n }\n}\n"],"names":["val"],"mappings":"AAKA,MAAM,GAAM,
|
|
1
|
+
{"version":3,"file":"Serializer.mjs","sources":["../../../../../src/serialization/Serializer.ts"],"sourcesContent":["interface SerializationStrategy<TIn, TOut> {\n isApplicable: (val: unknown) => val is TIn;\n apply: (val: TIn) => TOut;\n}\n\nconst Key = \"mittwald.flow-remote-core.serializer.name\";\n\nexport interface SuccessfulSerializationResult<T> {\n value: T;\n [Key]: string;\n}\n\nexport type SerializationResult<T> =\n | { applied: true; result: SuccessfulSerializationResult<T> }\n | { applied: false };\n\nexport class Serializer<TIn, TOut> {\n public constructor(\n private options: {\n name: string;\n serialize: SerializationStrategy<TIn, TOut>;\n deserialize: Pick<SerializationStrategy<TOut, TIn>, \"apply\">;\n },\n ) {}\n\n private apply<TIn, TOut>(\n val: unknown,\n strategy: SerializationStrategy<TIn, TOut>,\n ): SerializationResult<TOut> {\n if (strategy.isApplicable(val)) {\n return {\n applied: true,\n result: {\n [Key]: this.options.name,\n value: strategy.apply(val),\n },\n };\n }\n return {\n applied: false,\n };\n }\n\n public serialize(val: unknown): SerializationResult<TOut> {\n return this.apply<TIn, TOut>(val, this.options.serialize);\n }\n\n public deserialize(val: unknown): SerializationResult<TIn> {\n return this.apply(val, {\n apply: (serialization: SuccessfulSerializationResult<TOut>) => {\n return this.options.deserialize.apply(serialization.value);\n },\n isApplicable: (val): val is SuccessfulSerializationResult<TOut> => {\n return (\n !!val &&\n typeof val === \"object\" &&\n Key in val &&\n val[Key] === this.options.name\n );\n },\n });\n }\n}\n"],"names":["val"],"mappings":"AAKA,MAAM,GAAA,GAAM,2CAAA;AAWL,MAAM,UAAA,CAAsB;AAAA,EAC1B,YACG,OAAA,EAKR;AALQ,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA,EAKP;AAAA,EAEK,KAAA,CACN,KACA,QAAA,EAC2B;AAC3B,IAAA,IAAI,QAAA,CAAS,YAAA,CAAa,GAAG,CAAA,EAAG;AAC9B,MAAA,OAAO;AAAA,QACL,OAAA,EAAS,IAAA;AAAA,QACT,MAAA,EAAQ;AAAA,UACN,CAAC,GAAG,GAAG,IAAA,CAAK,OAAA,CAAQ,IAAA;AAAA,UACpB,KAAA,EAAO,QAAA,CAAS,KAAA,CAAM,GAAG;AAAA;AAC3B,OACF;AAAA,IACF;AACA,IAAA,OAAO;AAAA,MACL,OAAA,EAAS;AAAA,KACX;AAAA,EACF;AAAA,EAEO,UAAU,GAAA,EAAyC;AACxD,IAAA,OAAO,IAAA,CAAK,KAAA,CAAiB,GAAA,EAAK,IAAA,CAAK,QAAQ,SAAS,CAAA;AAAA,EAC1D;AAAA,EAEO,YAAY,GAAA,EAAwC;AACzD,IAAA,OAAO,IAAA,CAAK,MAAM,GAAA,EAAK;AAAA,MACrB,KAAA,EAAO,CAAC,aAAA,KAAuD;AAC7D,QAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,WAAA,CAAY,KAAA,CAAM,cAAc,KAAK,CAAA;AAAA,MAC3D,CAAA;AAAA,MACA,YAAA,EAAc,CAACA,IAAAA,KAAoD;AACjE,QAAA,OACE,CAAC,CAACA,IAAAA,IACF,OAAOA,IAAAA,KAAQ,QAAA,IACf,GAAA,IAAOA,IAAAA,IACPA,IAAAA,CAAI,GAAG,CAAA,KAAM,IAAA,CAAK,OAAA,CAAQ,IAAA;AAAA,MAE9B;AAAA,KACD,CAAA;AAAA,EACH;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataTransferText.mjs","sources":["../../../../../../src/serialization/serializers/dataTransferText.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\n\nexport const dataTransferTextSerializer = new Serializer<DataTransfer, string>({\n name: \"DataTransferText\",\n serialize: {\n isApplicable: (val): val is DataTransfer => {\n return (\n val instanceof DataTransfer &&\n val.types.every((type) => type === \"text/plain\")\n );\n },\n apply: (dataTransfer) => {\n return dataTransfer.getData(\"text\") || dataTransfer.getData(\"text/plain\");\n },\n },\n deserialize: {\n apply: (asString) => {\n const dataTransfer = new DataTransfer();\n dataTransfer.setData(\"text\", asString);\n return dataTransfer;\n },\n },\n});\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"dataTransferText.mjs","sources":["../../../../../../src/serialization/serializers/dataTransferText.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\n\nexport const dataTransferTextSerializer = new Serializer<DataTransfer, string>({\n name: \"DataTransferText\",\n serialize: {\n isApplicable: (val): val is DataTransfer => {\n return (\n val instanceof DataTransfer &&\n val.types.every((type) => type === \"text/plain\")\n );\n },\n apply: (dataTransfer) => {\n return dataTransfer.getData(\"text\") || dataTransfer.getData(\"text/plain\");\n },\n },\n deserialize: {\n apply: (asString) => {\n const dataTransfer = new DataTransfer();\n dataTransfer.setData(\"text\", asString);\n return dataTransfer;\n },\n },\n});\n"],"names":[],"mappings":";;AAEO,MAAM,0BAAA,GAA6B,IAAI,UAAA,CAAiC;AAAA,EAC7E,IAAA,EAAM,kBAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,YAAA,EAAc,CAAC,GAAA,KAA6B;AAC1C,MAAA,OACE,GAAA,YAAe,gBACf,GAAA,CAAI,KAAA,CAAM,MAAM,CAAC,IAAA,KAAS,SAAS,YAAY,CAAA;AAAA,IAEnD,CAAA;AAAA,IACA,KAAA,EAAO,CAAC,YAAA,KAAiB;AACvB,MAAA,OAAO,aAAa,OAAA,CAAQ,MAAM,CAAA,IAAK,YAAA,CAAa,QAAQ,YAAY,CAAA;AAAA,IAC1E;AAAA,GACF;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO,CAAC,QAAA,KAAa;AACnB,MAAA,MAAM,YAAA,GAAe,IAAI,YAAA,EAAa;AACtC,MAAA,YAAA,CAAa,OAAA,CAAQ,QAAQ,QAAQ,CAAA;AACrC,MAAA,OAAO,YAAA;AAAA,IACT;AAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.mjs","sources":["../../../../../../src/serialization/serializers/date.ts"],"sourcesContent":["import { CalendarDate } from \"@internationalized/date\";\nimport { parseDate } from \"@internationalized/date\";\nimport { Serializer } from \"@/serialization/Serializer\";\n\nexport const calendarDateSerializer = new Serializer<CalendarDate, string>({\n name: \"CalendarDate\",\n serialize: {\n isApplicable: (val) => val instanceof CalendarDate,\n apply: (date) => date.toString(),\n },\n deserialize: {\n apply: (asString) => parseDate(asString),\n },\n});\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"date.mjs","sources":["../../../../../../src/serialization/serializers/date.ts"],"sourcesContent":["import { CalendarDate } from \"@internationalized/date\";\nimport { parseDate } from \"@internationalized/date\";\nimport { Serializer } from \"@/serialization/Serializer\";\n\nexport const calendarDateSerializer = new Serializer<CalendarDate, string>({\n name: \"CalendarDate\",\n serialize: {\n isApplicable: (val) => val instanceof CalendarDate,\n apply: (date) => date.toString(),\n },\n deserialize: {\n apply: (asString) => parseDate(asString),\n },\n});\n"],"names":[],"mappings":";;;AAIO,MAAM,sBAAA,GAAyB,IAAI,UAAA,CAAiC;AAAA,EACzE,IAAA,EAAM,cAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,YAAA,EAAc,CAAC,GAAA,KAAQ,GAAA,YAAe,YAAA;AAAA,IACtC,KAAA,EAAO,CAAC,IAAA,KAAS,IAAA,CAAK,QAAA;AAAS,GACjC;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO,CAAC,QAAA,KAAa,SAAA,CAAU,QAAQ;AAAA;AAE3C,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.mjs","sources":["../../../../../../src/serialization/serializers/file.ts"],"sourcesContent":["import { markAsTransferable } from \"@quilted/threads\";\nimport { Serializer } from \"@/serialization/Serializer\";\nimport { getAwaitArrayBuffer } from \"@mittwald/flow-core\";\n\nexport interface SerializedFile {\n name: string;\n type: string;\n lastModified: number;\n content: ArrayBuffer;\n}\n\nexport const isSerializedFile = (value: unknown): value is SerializedFile => {\n return !!(\n value &&\n typeof value === \"object\" &&\n \"name\" in value &&\n \"type\" in value &&\n \"lastModified\" in value &&\n \"content\" in value\n );\n};\n\nexport const fileSerialize = (file: File): SerializedFile => {\n return {\n name: file.name,\n type: file.type,\n lastModified: file.lastModified,\n content: markAsTransferable(getAwaitArrayBuffer(file)),\n };\n};\n\nexport const fileDeSerialize = (file: SerializedFile) => {\n return new File([file.content], file.name, {\n lastModified: file.lastModified,\n type: file.type,\n });\n};\n\nexport const fileSerializer = new Serializer<File, SerializedFile>({\n name: \"File\",\n serialize: {\n isApplicable: (something) => something instanceof File,\n apply: fileSerialize,\n },\n deserialize: {\n apply: fileDeSerialize,\n },\n});\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"file.mjs","sources":["../../../../../../src/serialization/serializers/file.ts"],"sourcesContent":["import { markAsTransferable } from \"@quilted/threads\";\nimport { Serializer } from \"@/serialization/Serializer\";\nimport { getAwaitArrayBuffer } from \"@mittwald/flow-core\";\n\nexport interface SerializedFile {\n name: string;\n type: string;\n lastModified: number;\n content: ArrayBuffer;\n}\n\nexport const isSerializedFile = (value: unknown): value is SerializedFile => {\n return !!(\n value &&\n typeof value === \"object\" &&\n \"name\" in value &&\n \"type\" in value &&\n \"lastModified\" in value &&\n \"content\" in value\n );\n};\n\nexport const fileSerialize = (file: File): SerializedFile => {\n return {\n name: file.name,\n type: file.type,\n lastModified: file.lastModified,\n content: markAsTransferable(getAwaitArrayBuffer(file)),\n };\n};\n\nexport const fileDeSerialize = (file: SerializedFile) => {\n return new File([file.content], file.name, {\n lastModified: file.lastModified,\n type: file.type,\n });\n};\n\nexport const fileSerializer = new Serializer<File, SerializedFile>({\n name: \"File\",\n serialize: {\n isApplicable: (something) => something instanceof File,\n apply: fileSerialize,\n },\n deserialize: {\n apply: fileDeSerialize,\n },\n});\n"],"names":[],"mappings":";;;;AAWO,MAAM,gBAAA,GAAmB,CAAC,KAAA,KAA4C;AAC3E,EAAA,OAAO,CAAC,EACN,KAAA,IACA,OAAO,KAAA,KAAU,QAAA,IACjB,MAAA,IAAU,KAAA,IACV,MAAA,IAAU,KAAA,IACV,cAAA,IAAkB,KAAA,IAClB,SAAA,IAAa,KAAA,CAAA;AAEjB;AAEO,MAAM,aAAA,GAAgB,CAAC,IAAA,KAA+B;AAC3D,EAAA,OAAO;AAAA,IACL,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,cAAc,IAAA,CAAK,YAAA;AAAA,IACnB,OAAA,EAAS,kBAAA,CAAmB,mBAAA,CAAoB,IAAI,CAAC;AAAA,GACvD;AACF;AAEO,MAAM,eAAA,GAAkB,CAAC,IAAA,KAAyB;AACvD,EAAA,OAAO,IAAI,IAAA,CAAK,CAAC,KAAK,OAAO,CAAA,EAAG,KAAK,IAAA,EAAM;AAAA,IACzC,cAAc,IAAA,CAAK,YAAA;AAAA,IACnB,MAAM,IAAA,CAAK;AAAA,GACZ,CAAA;AACH;AAEO,MAAM,cAAA,GAAiB,IAAI,UAAA,CAAiC;AAAA,EACjE,IAAA,EAAM,MAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,YAAA,EAAc,CAAC,SAAA,KAAc,SAAA,YAAqB,IAAA;AAAA,IAClD,KAAA,EAAO;AAAA,GACT;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO;AAAA;AAEX,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileList.mjs","sources":["../../../../../../src/serialization/serializers/fileList.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n fileDeSerialize,\n fileSerialize,\n type SerializedFile,\n} from \"@/serialization/serializers\";\n\nexport const fileListSerializer = new Serializer<FileList, SerializedFile[]>({\n name: \"FileList\",\n serialize: {\n isApplicable: (something) => {\n return something instanceof FileList;\n },\n apply: (fileList) => Array.from(fileList).map(fileSerialize),\n },\n deserialize: {\n apply: (arrayFiles) => {\n const dataTransfer = new DataTransfer();\n arrayFiles.forEach((f) => dataTransfer.items.add(fileDeSerialize(f)));\n return dataTransfer.files;\n },\n },\n});\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"fileList.mjs","sources":["../../../../../../src/serialization/serializers/fileList.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n fileDeSerialize,\n fileSerialize,\n type SerializedFile,\n} from \"@/serialization/serializers\";\n\nexport const fileListSerializer = new Serializer<FileList, SerializedFile[]>({\n name: \"FileList\",\n serialize: {\n isApplicable: (something) => {\n return something instanceof FileList;\n },\n apply: (fileList) => Array.from(fileList).map(fileSerialize),\n },\n deserialize: {\n apply: (arrayFiles) => {\n const dataTransfer = new DataTransfer();\n arrayFiles.forEach((f) => dataTransfer.items.add(fileDeSerialize(f)));\n return dataTransfer.files;\n },\n },\n});\n"],"names":[],"mappings":";;;;;AAOO,MAAM,kBAAA,GAAqB,IAAI,UAAA,CAAuC;AAAA,EAC3E,IAAA,EAAM,UAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,YAAA,EAAc,CAAC,SAAA,KAAc;AAC3B,MAAA,OAAO,SAAA,YAAqB,QAAA;AAAA,IAC9B,CAAA;AAAA,IACA,KAAA,EAAO,CAAC,QAAA,KAAa,KAAA,CAAM,KAAK,QAAQ,CAAA,CAAE,IAAI,aAAa;AAAA,GAC7D;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO,CAAC,UAAA,KAAe;AACrB,MAAA,MAAM,YAAA,GAAe,IAAI,YAAA,EAAa;AACtC,MAAA,UAAA,CAAW,OAAA,CAAQ,CAAC,CAAA,KAAM,YAAA,CAAa,MAAM,GAAA,CAAI,eAAA,CAAgB,CAAC,CAAC,CAAC,CAAA;AACpE,MAAA,OAAO,YAAA,CAAa,KAAA;AAAA,IACtB;AAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formData.mjs","sources":["../../../../../../src/serialization/serializers/formData.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n fileDeSerialize,\n fileSerialize,\n isSerializedFile,\n} from \"@/serialization/serializers\";\n\nexport const formDataSerializer = new Serializer<\n FormData,\n [string, FormDataEntryValue][]\n>({\n name: \"FormData\",\n serialize: {\n isApplicable: (val) => val instanceof FormData,\n apply: (formData) => {\n return formData\n .entries()\n .toArray()\n .map(([fieldName, fieldValue]) => {\n if (fieldValue instanceof File) {\n return [fieldName, fileSerialize(fieldValue)];\n }\n\n return [fieldName, fieldValue];\n }) as [string, FormDataEntryValue][];\n },\n },\n deserialize: {\n apply: (array) => {\n const formData = new FormData();\n for (const [name, value] of array) {\n const deserializedValue = isSerializedFile(value)\n ? fileDeSerialize(value)\n : value;\n\n if (!formData.has(name)) {\n formData.set(name, deserializedValue);\n } else {\n formData.append(name, deserializedValue);\n }\n }\n return formData;\n },\n },\n});\n"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"formData.mjs","sources":["../../../../../../src/serialization/serializers/formData.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n fileDeSerialize,\n fileSerialize,\n isSerializedFile,\n} from \"@/serialization/serializers\";\n\nexport const formDataSerializer = new Serializer<\n FormData,\n [string, FormDataEntryValue][]\n>({\n name: \"FormData\",\n serialize: {\n isApplicable: (val) => val instanceof FormData,\n apply: (formData) => {\n return formData\n .entries()\n .toArray()\n .map(([fieldName, fieldValue]) => {\n if (fieldValue instanceof File) {\n return [fieldName, fileSerialize(fieldValue)];\n }\n\n return [fieldName, fieldValue];\n }) as [string, FormDataEntryValue][];\n },\n },\n deserialize: {\n apply: (array) => {\n const formData = new FormData();\n for (const [name, value] of array) {\n const deserializedValue = isSerializedFile(value)\n ? fileDeSerialize(value)\n : value;\n\n if (!formData.has(name)) {\n formData.set(name, deserializedValue);\n } else {\n formData.append(name, deserializedValue);\n }\n }\n return formData;\n },\n },\n});\n"],"names":[],"mappings":";;;;;AAOO,MAAM,kBAAA,GAAqB,IAAI,UAAA,CAGpC;AAAA,EACA,IAAA,EAAM,UAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,YAAA,EAAc,CAAC,GAAA,KAAQ,GAAA,YAAe,QAAA;AAAA,IACtC,KAAA,EAAO,CAAC,QAAA,KAAa;AACnB,MAAA,OAAO,QAAA,CACJ,OAAA,EAAQ,CACR,OAAA,EAAQ,CACR,IAAI,CAAC,CAAC,SAAA,EAAW,UAAU,CAAA,KAAM;AAChC,QAAA,IAAI,sBAAsB,IAAA,EAAM;AAC9B,UAAA,OAAO,CAAC,SAAA,EAAW,aAAA,CAAc,UAAU,CAAC,CAAA;AAAA,QAC9C;AAEA,QAAA,OAAO,CAAC,WAAW,UAAU,CAAA;AAAA,MAC/B,CAAC,CAAA;AAAA,IACL;AAAA,GACF;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO,CAAC,KAAA,KAAU;AAChB,MAAA,MAAM,QAAA,GAAW,IAAI,QAAA,EAAS;AAC9B,MAAA,KAAA,MAAW,CAAC,IAAA,EAAM,KAAK,CAAA,IAAK,KAAA,EAAO;AACjC,QAAA,MAAM,oBAAoB,gBAAA,CAAiB,KAAK,CAAA,GAC5C,eAAA,CAAgB,KAAK,CAAA,GACrB,KAAA;AAEJ,QAAA,IAAI,CAAC,QAAA,CAAS,GAAA,CAAI,IAAI,CAAA,EAAG;AACvB,UAAA,QAAA,CAAS,GAAA,CAAI,MAAM,iBAAiB,CAAA;AAAA,QACtC,CAAA,MAAO;AACL,UAAA,QAAA,CAAS,MAAA,CAAO,MAAM,iBAAiB,CAAA;AAAA,QACzC;AAAA,MACF;AACA,MAAA,OAAO,QAAA;AAAA,IACT;AAAA;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passwordPolicy.mjs","sources":["../../../../../../src/serialization/serializers/passwordPolicy.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n Policy,\n type PolicyDeclaration,\n} from \"@mittwald/flow-react-components/mittwald-password-tools-js\";\n\nexport const passwordPolicySerializer = new Serializer<\n Policy,\n PolicyDeclaration\n>({\n name: \"PasswordPolicy\",\n serialize: {\n isApplicable: (val) => Policy.isPolicy(val),\n apply: (policy) => policy.toDeclaration(),\n },\n deserialize: {\n apply: (policyDeclaration) => Policy.fromDeclaration(policyDeclaration),\n },\n});\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"passwordPolicy.mjs","sources":["../../../../../../src/serialization/serializers/passwordPolicy.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n Policy,\n type PolicyDeclaration,\n} from \"@mittwald/flow-react-components/mittwald-password-tools-js\";\n\nexport const passwordPolicySerializer = new Serializer<\n Policy,\n PolicyDeclaration\n>({\n name: \"PasswordPolicy\",\n serialize: {\n isApplicable: (val) => Policy.isPolicy(val),\n apply: (policy) => policy.toDeclaration(),\n },\n deserialize: {\n apply: (policyDeclaration) => Policy.fromDeclaration(policyDeclaration),\n },\n});\n"],"names":[],"mappings":";;;AAMO,MAAM,wBAAA,GAA2B,IAAI,UAAA,CAG1C;AAAA,EACA,IAAA,EAAM,gBAAA;AAAA,EACN,SAAA,EAAW;AAAA,IACT,YAAA,EAAc,CAAC,GAAA,KAAQ,MAAA,CAAO,SAAS,GAAG,CAAA;AAAA,IAC1C,KAAA,EAAO,CAAC,MAAA,KAAW,MAAA,CAAO,aAAA;AAAc,GAC1C;AAAA,EACA,WAAA,EAAa;AAAA,IACX,KAAA,EAAO,CAAC,iBAAA,KAAsB,MAAA,CAAO,gBAAgB,iBAAiB;AAAA;AAE1E,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.mjs","sources":["../../../../src/shim.ts"],"sourcesContent":["import { HTMLElement, customElements } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement = HTMLElement;\nglobalThis.customElements = customElements;\nglobalThis.MutationObserver = class MutationObserver {\n public constructor() {\n // mocked\n }\n public disconnect() {\n // mocked\n }\n public observe() {\n // mocked\n }\n public takeRecords() {\n return [];\n }\n};\n"],"names":[],"mappings":";;AAEA,UAAA,CAAW,
|
|
1
|
+
{"version":3,"file":"shim.mjs","sources":["../../../../src/shim.ts"],"sourcesContent":["import { HTMLElement, customElements } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement = HTMLElement;\nglobalThis.customElements = customElements;\nglobalThis.MutationObserver = class MutationObserver {\n public constructor() {\n // mocked\n }\n public disconnect() {\n // mocked\n }\n public observe() {\n // mocked\n }\n public takeRecords() {\n return [];\n }\n};\n"],"names":[],"mappings":";;AAEA,UAAA,CAAW,WAAA,GAAc,WAAA;AACzB,UAAA,CAAW,cAAA,GAAiB,cAAA;AAC5B,UAAA,CAAW,gBAAA,GAAmB,MAAM,gBAAA,CAAiB;AAAA,EAC5C,WAAA,GAAc;AAAA,EAErB;AAAA,EACO,UAAA,GAAa;AAAA,EAEpB;AAAA,EACO,OAAA,GAAU;AAAA,EAEjB;AAAA,EACO,WAAA,GAAc;AACnB,IAAA,OAAO,EAAC;AAAA,EACV;AACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-core",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.517",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core functionality to setup a remote/host environment",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -35,30 +35,30 @@
|
|
|
35
35
|
"remeda": "^2.32.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@mittwald/ext-bridge": "0.2.0-alpha.
|
|
38
|
+
"@mittwald/ext-bridge": "0.2.0-alpha.517",
|
|
39
39
|
"@mittwald/flow-core": "",
|
|
40
|
-
"@mittwald/flow-react-components": "0.2.0-alpha.
|
|
40
|
+
"@mittwald/flow-react-components": "0.2.0-alpha.517",
|
|
41
41
|
"@mittwald/typescript-config": "",
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"nx": "^
|
|
42
|
+
"@types/node": "^24.7.2",
|
|
43
|
+
"nx": "^21.6.4",
|
|
44
44
|
"prettier": "^3.6.2",
|
|
45
45
|
"rimraf": "^6.0.1",
|
|
46
46
|
"rollup-preserve-directives": "^1.1.3",
|
|
47
|
-
"typescript": "^5.9.
|
|
48
|
-
"vite": "^
|
|
49
|
-
"vite-plugin-checker": "^0.
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"vite": "^7.1.10",
|
|
49
|
+
"vite-plugin-checker": "^0.11.0",
|
|
50
50
|
"vite-plugin-dts": "^4.5.4",
|
|
51
|
-
"vite-plugin-externalize-deps": "^0.
|
|
51
|
+
"vite-plugin-externalize-deps": "^0.10.0",
|
|
52
52
|
"vitest": "^3.2.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@mittwald/ext-bridge": "
|
|
56
|
-
"@mittwald/flow-react-components": "
|
|
55
|
+
"@mittwald/ext-bridge": "0.2.0-alpha.516",
|
|
56
|
+
"@mittwald/flow-react-components": "0.2.0-alpha.516"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@mittwald/ext-bridge": {
|
|
60
60
|
"optional": true
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "761ba9a36c7238153866514f7ec0a6c28f887c8f"
|
|
64
64
|
}
|