@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.
- package/dist/js/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/js/index-node.mjs +21 -17
- package/dist/js/index-node.mjs.map +1 -1
- package/dist/js/index.mjs +24 -16
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs +33 -36
- package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs.map +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs +51 -61
- package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs +73 -101
- package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/connection/index.mjs +4 -0
- package/dist/js/packages/remote-core/src/connection/types.mjs +13 -11
- package/dist/js/packages/remote-core/src/connection/types.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/error.mjs +10 -8
- package/dist/js/packages/remote-core/src/error.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/events/remoteEvents.mjs +14 -16
- package/dist/js/packages/remote-core/src/events/remoteEvents.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs +10 -8
- package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs +8 -12
- package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs +49 -61
- package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/Serializer.mjs +31 -31
- package/dist/js/packages/remote-core/src/serialization/Serializer.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/index.mjs +10 -0
- package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs +20 -21
- package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs +13 -14
- package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs +27 -28
- package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs +18 -22
- package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs +27 -34
- package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs +23 -7
- package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs +13 -14
- package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/shim.mjs +32 -15
- package/dist/js/packages/remote-core/src/shim.mjs.map +1 -1
- package/dist/types/index-node.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shim.d.ts +13 -1
- package/dist/types/shim.d.ts.map +1 -1
- package/package.json +9 -11
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
1
|
+
//#region src/serialization/Serializer.ts
|
|
2
|
+
var Key = "mittwald.flow-remote-core.serializer.name";
|
|
3
|
+
var Serializer = class {
|
|
4
|
+
options;
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
}
|
|
8
|
+
async apply(val, strategy) {
|
|
9
|
+
if (!strategy.isApplicable(val)) return { applied: false };
|
|
10
|
+
const resolved = await strategy.apply(val);
|
|
11
|
+
return {
|
|
12
|
+
applied: true,
|
|
13
|
+
result: {
|
|
14
|
+
[Key]: this.options.name,
|
|
15
|
+
value: resolved
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async serialize(val) {
|
|
20
|
+
return this.apply(val, this.options.serialize);
|
|
21
|
+
}
|
|
22
|
+
async deserialize(val) {
|
|
23
|
+
return this.apply(val, {
|
|
24
|
+
isApplicable: (candidate) => !!candidate && typeof candidate === "object" && Key in candidate && candidate[Key] === this.options.name,
|
|
25
|
+
apply: (serialization) => this.options.deserialize.apply(serialization.value)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
31
30
|
export { Serializer };
|
|
32
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=Serializer.mjs.map
|
|
@@ -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 | Promise<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 async apply<TIn, TOut>(\n val: unknown,\n strategy: SerializationStrategy<TIn, TOut>,\n ): Promise<SerializationResult<TOut>> {\n if (!strategy.isApplicable(val)) {\n return { applied: false };\n }\n\n const resolved = await strategy.apply(val);\n\n return {\n applied: true,\n result: {\n [Key]: this.options.name,\n value: resolved,\n },\n };\n }\n\n public async serialize(val: unknown): Promise<SerializationResult<TOut>> {\n return this.apply<TIn, TOut>(val, this.options.serialize);\n }\n\n public async deserialize(val: unknown): Promise<SerializationResult<TIn>> {\n return this.apply(val, {\n isApplicable: (\n candidate,\n ): candidate is SuccessfulSerializationResult<TOut> =>\n !!candidate &&\n typeof candidate === \"object\" &&\n Key in candidate &&\n (candidate as never)[Key] === this.options.name,\n apply: (serialization) =>\n this.options.deserialize.apply(serialization.value),\n });\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"Serializer.mjs","names":[],"sources":["../../../../../../src/serialization/Serializer.ts"],"sourcesContent":["interface SerializationStrategy<TIn, TOut> {\n isApplicable: (val: unknown) => val is TIn;\n apply: (val: TIn) => TOut | Promise<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 async apply<TIn, TOut>(\n val: unknown,\n strategy: SerializationStrategy<TIn, TOut>,\n ): Promise<SerializationResult<TOut>> {\n if (!strategy.isApplicable(val)) {\n return { applied: false };\n }\n\n const resolved = await strategy.apply(val);\n\n return {\n applied: true,\n result: {\n [Key]: this.options.name,\n value: resolved,\n },\n };\n }\n\n public async serialize(val: unknown): Promise<SerializationResult<TOut>> {\n return this.apply<TIn, TOut>(val, this.options.serialize);\n }\n\n public async deserialize(val: unknown): Promise<SerializationResult<TIn>> {\n return this.apply(val, {\n isApplicable: (\n candidate,\n ): candidate is SuccessfulSerializationResult<TOut> =>\n !!candidate &&\n typeof candidate === \"object\" &&\n Key in candidate &&\n (candidate as never)[Key] === this.options.name,\n apply: (serialization) =>\n this.options.deserialize.apply(serialization.value),\n });\n }\n}\n"],"mappings":";AAKA,IAAM,MAAM;AAWZ,IAAa,aAAb,MAAmC;CAEvB;CADV,YACE,SAKA;EALQ,KAAA,UAAA;CAKP;CAEH,MAAc,MACZ,KACA,UACoC;EACpC,IAAI,CAAC,SAAS,aAAa,GAAG,GAC5B,OAAO,EAAE,SAAS,MAAM;EAG1B,MAAM,WAAW,MAAM,SAAS,MAAM,GAAG;EAEzC,OAAO;GACL,SAAS;GACT,QAAQ;KACL,MAAM,KAAK,QAAQ;IACpB,OAAO;GACT;EACF;CACF;CAEA,MAAa,UAAU,KAAkD;EACvE,OAAO,KAAK,MAAiB,KAAK,KAAK,QAAQ,SAAS;CAC1D;CAEA,MAAa,YAAY,KAAiD;EACxE,OAAO,KAAK,MAAM,KAAK;GACrB,eACE,cAEA,CAAC,CAAC,aACF,OAAO,cAAc,YACrB,OAAO,aACN,UAAoB,SAAS,KAAK,QAAQ;GAC7C,QAAQ,kBACN,KAAK,QAAQ,YAAY,MAAM,cAAc,KAAK;EACtD,CAAC;CACH;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Serializer } from "./Serializer.mjs";
|
|
2
|
+
import { calendarDateSerializer } from "./serializers/date.mjs";
|
|
3
|
+
import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./serializers/file.mjs";
|
|
4
|
+
import { fileListSerializer } from "./serializers/fileList.mjs";
|
|
5
|
+
import { dataTransferTextSerializer } from "./serializers/dataTransferText.mjs";
|
|
6
|
+
import { formDataSerializer } from "./serializers/formData.mjs";
|
|
7
|
+
import { passwordPolicySerializer } from "./serializers/passwordPolicy.mjs";
|
|
8
|
+
import "./serializers/index.mjs";
|
|
9
|
+
import { FlowThreadSerialization } from "./FlowThreadSerialization.mjs";
|
|
10
|
+
export { FlowThreadSerialization, Serializer, calendarDateSerializer, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, passwordPolicySerializer };
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { Serializer } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
import { Serializer } from "../Serializer.mjs";
|
|
2
|
+
//#region src/serialization/serializers/dataTransferText.ts
|
|
3
|
+
var dataTransferTextSerializer = new Serializer({
|
|
4
|
+
name: "DataTransferText",
|
|
5
|
+
serialize: {
|
|
6
|
+
isApplicable: (val) => {
|
|
7
|
+
return val instanceof DataTransfer && val.types.every((type) => type === "text/plain");
|
|
8
|
+
},
|
|
9
|
+
apply: (dataTransfer) => {
|
|
10
|
+
return dataTransfer.getData("text") || dataTransfer.getData("text/plain");
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
deserialize: { apply: (asString) => {
|
|
14
|
+
const dataTransfer = new DataTransfer();
|
|
15
|
+
dataTransfer.setData("text", asString);
|
|
16
|
+
return dataTransfer;
|
|
17
|
+
} }
|
|
20
18
|
});
|
|
21
|
-
|
|
19
|
+
//#endregion
|
|
22
20
|
export { dataTransferTextSerializer };
|
|
23
|
-
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=dataTransferText.mjs.map
|
|
@@ -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"],"
|
|
1
|
+
{"version":3,"file":"dataTransferText.mjs","names":[],"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"],"mappings":";;AAEA,IAAa,6BAA6B,IAAI,WAAiC;CAC7E,MAAM;CACN,WAAW;EACT,eAAe,QAA6B;GAC1C,OACE,eAAe,gBACf,IAAI,MAAM,OAAO,SAAS,SAAS,YAAY;EAEnD;EACA,QAAQ,iBAAiB;GACvB,OAAO,aAAa,QAAQ,MAAM,KAAK,aAAa,QAAQ,YAAY;EAC1E;CACF;CACA,aAAa,EACX,QAAQ,aAAa;EACnB,MAAM,eAAe,IAAI,aAAa;EACtC,aAAa,QAAQ,QAAQ,QAAQ;EACrC,OAAO;CACT,EACF;AACF,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
apply: (asString) => parseDate(asString)
|
|
12
|
-
}
|
|
1
|
+
import { Serializer } from "../Serializer.mjs";
|
|
2
|
+
import { CalendarDate, parseDate } from "@internationalized/date";
|
|
3
|
+
//#region src/serialization/serializers/date.ts
|
|
4
|
+
var calendarDateSerializer = new Serializer({
|
|
5
|
+
name: "CalendarDate",
|
|
6
|
+
serialize: {
|
|
7
|
+
isApplicable: (val) => val instanceof CalendarDate,
|
|
8
|
+
apply: (date) => date.toString()
|
|
9
|
+
},
|
|
10
|
+
deserialize: { apply: (asString) => parseDate(asString) }
|
|
13
11
|
});
|
|
14
|
-
|
|
12
|
+
//#endregion
|
|
15
13
|
export { calendarDateSerializer };
|
|
16
|
-
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=date.mjs.map
|
|
@@ -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"],"
|
|
1
|
+
{"version":3,"file":"date.mjs","names":[],"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"],"mappings":";;;AAIA,IAAa,yBAAyB,IAAI,WAAiC;CACzE,MAAM;CACN,WAAW;EACT,eAAe,QAAQ,eAAe;EACtC,QAAQ,SAAS,KAAK,SAAS;CACjC;CACA,aAAa,EACX,QAAQ,aAAa,UAAU,QAAQ,EACzC;AACF,CAAC"}
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { Serializer } from
|
|
2
|
-
import { markAsTransferable } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Serializer } from "../Serializer.mjs";
|
|
2
|
+
import { markAsTransferable } from "../../../../../node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs";
|
|
3
|
+
//#region src/serialization/serializers/file.ts
|
|
4
|
+
var isSerializedFile = (value) => {
|
|
5
|
+
return !!(value && typeof value === "object" && "name" in value && "type" in value && "lastModified" in value && "content" in value);
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
var fileSerialize = async (file) => {
|
|
8
|
+
return {
|
|
9
|
+
name: file.name,
|
|
10
|
+
type: file.type,
|
|
11
|
+
lastModified: file.lastModified,
|
|
12
|
+
content: markAsTransferable(await file.arrayBuffer())
|
|
13
|
+
};
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
var fileDeSerialize = (file) => {
|
|
16
|
+
return new File([file.content], file.name, {
|
|
17
|
+
lastModified: file.lastModified,
|
|
18
|
+
type: file.type
|
|
19
|
+
});
|
|
20
20
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
apply: fileDeSerialize
|
|
29
|
-
}
|
|
21
|
+
var fileSerializer = new Serializer({
|
|
22
|
+
name: "File",
|
|
23
|
+
serialize: {
|
|
24
|
+
isApplicable: (something) => something instanceof File,
|
|
25
|
+
apply: fileSerialize
|
|
26
|
+
},
|
|
27
|
+
deserialize: { apply: fileDeSerialize }
|
|
30
28
|
});
|
|
31
|
-
|
|
29
|
+
//#endregion
|
|
32
30
|
export { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile };
|
|
33
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=file.mjs.map
|
|
@@ -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\";\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 = async (file: File): Promise<SerializedFile> => {\n return {\n name: file.name,\n type: file.type,\n lastModified: file.lastModified,\n content: markAsTransferable(await file.arrayBuffer()),\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"],"
|
|
1
|
+
{"version":3,"file":"file.mjs","names":[],"sources":["../../../../../../../src/serialization/serializers/file.ts"],"sourcesContent":["import { markAsTransferable } from \"@quilted/threads\";\nimport { Serializer } from \"@/serialization/Serializer\";\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 = async (file: File): Promise<SerializedFile> => {\n return {\n name: file.name,\n type: file.type,\n lastModified: file.lastModified,\n content: markAsTransferable(await file.arrayBuffer()),\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"],"mappings":";;;AAUA,IAAa,oBAAoB,UAA4C;CAC3E,OAAO,CAAC,EACN,SACA,OAAO,UAAU,YACjB,UAAU,SACV,UAAU,SACV,kBAAkB,SAClB,aAAa;AAEjB;AAEA,IAAa,gBAAgB,OAAO,SAAwC;CAC1E,OAAO;EACL,MAAM,KAAK;EACX,MAAM,KAAK;EACX,cAAc,KAAK;EACnB,SAAS,mBAAmB,MAAM,KAAK,YAAY,CAAC;CACtD;AACF;AAEA,IAAa,mBAAmB,SAAyB;CACvD,OAAO,IAAI,KAAK,CAAC,KAAK,OAAO,GAAG,KAAK,MAAM;EACzC,cAAc,KAAK;EACnB,MAAM,KAAK;CACb,CAAC;AACH;AAEA,IAAa,iBAAiB,IAAI,WAAiC;CACjE,MAAM;CACN,WAAW;EACT,eAAe,cAAc,qBAAqB;EAClD,OAAO;CACT;CACA,aAAa,EACX,OAAO,gBACT;AACF,CAAC"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import { Serializer } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
dataTransfer.items.add(fileDeSerialize(file));
|
|
17
|
-
}
|
|
18
|
-
return dataTransfer.files;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
import { Serializer } from "../Serializer.mjs";
|
|
2
|
+
import { fileDeSerialize, fileSerialize } from "./file.mjs";
|
|
3
|
+
import "./index.mjs";
|
|
4
|
+
//#region src/serialization/serializers/fileList.ts
|
|
5
|
+
var fileListSerializer = new Serializer({
|
|
6
|
+
name: "FileList",
|
|
7
|
+
serialize: {
|
|
8
|
+
isApplicable: (something) => something instanceof FileList,
|
|
9
|
+
apply: async (fileList) => await Promise.all(Array.from(fileList, fileSerialize))
|
|
10
|
+
},
|
|
11
|
+
deserialize: { apply: (arrayFiles) => {
|
|
12
|
+
const dataTransfer = new DataTransfer();
|
|
13
|
+
for (const file of arrayFiles) dataTransfer.items.add(fileDeSerialize(file));
|
|
14
|
+
return dataTransfer.files;
|
|
15
|
+
} }
|
|
21
16
|
});
|
|
22
|
-
|
|
17
|
+
//#endregion
|
|
23
18
|
export { fileListSerializer };
|
|
24
|
-
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=fileList.mjs.map
|
|
@@ -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): something is FileList =>\n something instanceof FileList,\n apply: async (fileList) =>\n await Promise.all(Array.from(fileList, fileSerialize)),\n },\n deserialize: {\n apply: (arrayFiles) => {\n const dataTransfer = new DataTransfer();\n for (const file of arrayFiles) {\n dataTransfer.items.add(fileDeSerialize(file));\n }\n return dataTransfer.files;\n },\n },\n});\n"],"
|
|
1
|
+
{"version":3,"file":"fileList.mjs","names":[],"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): something is FileList =>\n something instanceof FileList,\n apply: async (fileList) =>\n await Promise.all(Array.from(fileList, fileSerialize)),\n },\n deserialize: {\n apply: (arrayFiles) => {\n const dataTransfer = new DataTransfer();\n for (const file of arrayFiles) {\n dataTransfer.items.add(fileDeSerialize(file));\n }\n return dataTransfer.files;\n },\n },\n});\n"],"mappings":";;;;AAOA,IAAa,qBAAqB,IAAI,WAAuC;CAC3E,MAAM;CACN,WAAW;EACT,eAAe,cACb,qBAAqB;EACvB,OAAO,OAAO,aACZ,MAAM,QAAQ,IAAI,MAAM,KAAK,UAAU,aAAa,CAAC;CACzD;CACA,aAAa,EACX,QAAQ,eAAe;EACrB,MAAM,eAAe,IAAI,aAAa;EACtC,KAAK,MAAM,QAAQ,YACjB,aAAa,MAAM,IAAI,gBAAgB,IAAI,CAAC;EAE9C,OAAO,aAAa;CACtB,EACF;AACF,CAAC"}
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
-
import { Serializer } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const formData = new FormData();
|
|
26
|
-
for (const [name, value] of array) {
|
|
27
|
-
const deserializedValue = isSerializedFile(value) ? fileDeSerialize(value) : value;
|
|
28
|
-
formData.append(name, deserializedValue);
|
|
29
|
-
}
|
|
30
|
-
return formData;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
import { Serializer } from "../Serializer.mjs";
|
|
2
|
+
import { fileDeSerialize, fileSerialize, isSerializedFile } from "./file.mjs";
|
|
3
|
+
import "./index.mjs";
|
|
4
|
+
//#region src/serialization/serializers/formData.ts
|
|
5
|
+
var formDataSerializer = new Serializer({
|
|
6
|
+
name: "FormData",
|
|
7
|
+
serialize: {
|
|
8
|
+
isApplicable: (val) => {
|
|
9
|
+
return val instanceof FormData;
|
|
10
|
+
},
|
|
11
|
+
apply: async (formData) => {
|
|
12
|
+
const out = [];
|
|
13
|
+
for (const [fieldName, fieldValue] of formData.entries()) out.push([fieldName, fieldValue instanceof File ? await fileSerialize(fieldValue) : fieldValue]);
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
deserialize: { apply: (array) => {
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
for (const [name, value] of array) {
|
|
20
|
+
const deserializedValue = isSerializedFile(value) ? fileDeSerialize(value) : value;
|
|
21
|
+
formData.append(name, deserializedValue);
|
|
22
|
+
}
|
|
23
|
+
return formData;
|
|
24
|
+
} }
|
|
33
25
|
});
|
|
34
|
-
|
|
26
|
+
//#endregion
|
|
35
27
|
export { formDataSerializer };
|
|
36
|
-
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=formData.mjs.map
|
|
@@ -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\ntype SerializedFormDataValue =\n | FormDataEntryValue\n | Awaited<ReturnType<typeof fileSerialize>>;\ntype SerializedFormDataEntries = [string, SerializedFormDataValue][];\n\nexport const formDataSerializer = new Serializer<\n FormData,\n SerializedFormDataEntries\n>({\n name: \"FormData\",\n serialize: {\n isApplicable: (val) => {\n return val instanceof FormData;\n },\n apply: async (formData) => {\n const out: SerializedFormDataEntries = [];\n\n for (const [fieldName, fieldValue] of formData.entries()) {\n out.push([\n fieldName,\n fieldValue instanceof File\n ? await fileSerialize(fieldValue)\n : fieldValue,\n ]);\n }\n\n return out;\n },\n },\n deserialize: {\n apply: (array) => {\n const formData = new FormData();\n\n for (const [name, value] of array) {\n const deserializedValue = isSerializedFile(value)\n ? fileDeSerialize(value)\n : value;\n\n formData.append(name, deserializedValue);\n }\n\n return formData;\n },\n },\n});\n"],"
|
|
1
|
+
{"version":3,"file":"formData.mjs","names":[],"sources":["../../../../../../../src/serialization/serializers/formData.ts"],"sourcesContent":["import { Serializer } from \"@/serialization/Serializer\";\nimport {\n fileDeSerialize,\n fileSerialize,\n isSerializedFile,\n} from \"@/serialization/serializers\";\n\ntype SerializedFormDataValue =\n | FormDataEntryValue\n | Awaited<ReturnType<typeof fileSerialize>>;\ntype SerializedFormDataEntries = [string, SerializedFormDataValue][];\n\nexport const formDataSerializer = new Serializer<\n FormData,\n SerializedFormDataEntries\n>({\n name: \"FormData\",\n serialize: {\n isApplicable: (val) => {\n return val instanceof FormData;\n },\n apply: async (formData) => {\n const out: SerializedFormDataEntries = [];\n\n for (const [fieldName, fieldValue] of formData.entries()) {\n out.push([\n fieldName,\n fieldValue instanceof File\n ? await fileSerialize(fieldValue)\n : fieldValue,\n ]);\n }\n\n return out;\n },\n },\n deserialize: {\n apply: (array) => {\n const formData = new FormData();\n\n for (const [name, value] of array) {\n const deserializedValue = isSerializedFile(value)\n ? fileDeSerialize(value)\n : value;\n\n formData.append(name, deserializedValue);\n }\n\n return formData;\n },\n },\n});\n"],"mappings":";;;;AAYA,IAAa,qBAAqB,IAAI,WAGpC;CACA,MAAM;CACN,WAAW;EACT,eAAe,QAAQ;GACrB,OAAO,eAAe;EACxB;EACA,OAAO,OAAO,aAAa;GACzB,MAAM,MAAiC,CAAC;GAExC,KAAK,MAAM,CAAC,WAAW,eAAe,SAAS,QAAQ,GACrD,IAAI,KAAK,CACP,WACA,sBAAsB,OAClB,MAAM,cAAc,UAAU,IAC9B,UACN,CAAC;GAGH,OAAO;EACT;CACF;CACA,aAAa,EACX,QAAQ,UAAU;EAChB,MAAM,WAAW,IAAI,SAAS;EAE9B,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO;GACjC,MAAM,oBAAoB,iBAAiB,KAAK,IAC5C,gBAAgB,KAAK,IACrB;GAEJ,SAAS,OAAO,MAAM,iBAAiB;EACzC;EAEA,OAAO;CACT,EACF;AACF,CAAC"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { __exportAll } from "../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { calendarDateSerializer } from "./date.mjs";
|
|
3
|
+
import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./file.mjs";
|
|
4
|
+
import { fileListSerializer } from "./fileList.mjs";
|
|
5
|
+
import { dataTransferTextSerializer } from "./dataTransferText.mjs";
|
|
6
|
+
import { formDataSerializer } from "./formData.mjs";
|
|
7
|
+
import { passwordPolicySerializer } from "./passwordPolicy.mjs";
|
|
8
|
+
//#region src/serialization/serializers/index.ts
|
|
9
|
+
var serializers_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
calendarDateSerializer: () => calendarDateSerializer,
|
|
11
|
+
dataTransferTextSerializer: () => dataTransferTextSerializer,
|
|
12
|
+
fileDeSerialize: () => fileDeSerialize,
|
|
13
|
+
fileListSerializer: () => fileListSerializer,
|
|
14
|
+
fileSerialize: () => fileSerialize,
|
|
15
|
+
fileSerializer: () => fileSerializer,
|
|
16
|
+
formDataSerializer: () => formDataSerializer,
|
|
17
|
+
isSerializedFile: () => isSerializedFile,
|
|
18
|
+
passwordPolicySerializer: () => passwordPolicySerializer
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { calendarDateSerializer, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, passwordPolicySerializer, serializers_exports };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../../src/serialization/serializers/index.ts"],"sourcesContent":["export * from \"./date\";\nexport * from \"./file\";\nexport * from \"./fileList\";\nexport * from \"./dataTransferText\";\nexport * from \"./formData\";\nexport * from \"./passwordPolicy\";\n"],"mappings":""}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Serializer } from
|
|
2
|
-
import { Policy } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
apply: (policyDeclaration) => Policy.fromDeclaration(policyDeclaration)
|
|
12
|
-
}
|
|
1
|
+
import { Serializer } from "../Serializer.mjs";
|
|
2
|
+
import { Policy } from "@mittwald/flow-react-components/mittwald-password-tools-js";
|
|
3
|
+
//#region src/serialization/serializers/passwordPolicy.ts
|
|
4
|
+
var passwordPolicySerializer = new Serializer({
|
|
5
|
+
name: "PasswordPolicy",
|
|
6
|
+
serialize: {
|
|
7
|
+
isApplicable: (val) => Policy.isPolicy(val),
|
|
8
|
+
apply: (policy) => policy.toDeclaration()
|
|
9
|
+
},
|
|
10
|
+
deserialize: { apply: (policyDeclaration) => Policy.fromDeclaration(policyDeclaration) }
|
|
13
11
|
});
|
|
14
|
-
|
|
12
|
+
//#endregion
|
|
15
13
|
export { passwordPolicySerializer };
|
|
16
|
-
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=passwordPolicy.mjs.map
|
|
@@ -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"],"
|
|
1
|
+
{"version":3,"file":"passwordPolicy.mjs","names":[],"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"],"mappings":";;;AAMA,IAAa,2BAA2B,IAAI,WAG1C;CACA,MAAM;CACN,WAAW;EACT,eAAe,QAAQ,OAAO,SAAS,GAAG;EAC1C,QAAQ,WAAW,OAAO,cAAc;CAC1C;CACA,aAAa,EACX,QAAQ,sBAAsB,OAAO,gBAAgB,iBAAiB,EACxE;AACF,CAAC"}
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
import { HTMLElement, customElements } from
|
|
1
|
+
import { HTMLElement, customElements } from "@lit-labs/ssr-dom-shim";
|
|
2
|
+
//#region src/shim.ts
|
|
3
|
+
/**
|
|
4
|
+
* Installs a minimal DOM shim so modules that subclass `HTMLElement` — the
|
|
5
|
+
* remote custom elements, via the remote-dom fork's `RemoteElement` — can be
|
|
6
|
+
* evaluated in a Node/SSR context (e.g. Next.js server-rendering a client
|
|
7
|
+
* component). Guarded on a missing DOM, so it is a no-op in a real browser and
|
|
8
|
+
* can safely live on the browser entry without clobbering the native DOM.
|
|
9
|
+
*
|
|
10
|
+
* Exported as a _used binding_ rather than imported as a bare `import
|
|
11
|
+
* "./shim"`: Vite 8's Rollup reorders bare side-effect imports after binding
|
|
12
|
+
* imports, which would let `HTMLElement` be subclassed before the shim runs. A
|
|
13
|
+
* binding keeps this import in source order — first.
|
|
14
|
+
*/
|
|
15
|
+
var domShimApplied = (() => {
|
|
16
|
+
if (typeof globalThis.HTMLElement === "undefined") {
|
|
17
|
+
globalThis.HTMLElement = HTMLElement;
|
|
18
|
+
globalThis.customElements = customElements;
|
|
19
|
+
globalThis.MutationObserver = class MutationObserver {
|
|
20
|
+
constructor() {}
|
|
21
|
+
disconnect() {}
|
|
22
|
+
observe() {}
|
|
23
|
+
takeRecords() {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
})();
|
|
30
|
+
//#endregion
|
|
31
|
+
export { domShimApplied };
|
|
2
32
|
|
|
3
|
-
|
|
4
|
-
globalThis.customElements = customElements;
|
|
5
|
-
globalThis.MutationObserver = class MutationObserver {
|
|
6
|
-
constructor() {
|
|
7
|
-
}
|
|
8
|
-
disconnect() {
|
|
9
|
-
}
|
|
10
|
-
observe() {
|
|
11
|
-
}
|
|
12
|
-
takeRecords() {
|
|
13
|
-
return [];
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=shim.mjs.map
|
|
33
|
+
//# sourceMappingURL=shim.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.mjs","sources":["../../../../../src/shim.ts"],"sourcesContent":["import { HTMLElement, customElements } from \"@lit-labs/ssr-dom-shim\";\n\
|
|
1
|
+
{"version":3,"file":"shim.mjs","names":[],"sources":["../../../../../src/shim.ts"],"sourcesContent":["import { HTMLElement, customElements } from \"@lit-labs/ssr-dom-shim\";\n\n/**\n * Installs a minimal DOM shim so modules that subclass `HTMLElement` — the\n * remote custom elements, via the remote-dom fork's `RemoteElement` — can be\n * evaluated in a Node/SSR context (e.g. Next.js server-rendering a client\n * component). Guarded on a missing DOM, so it is a no-op in a real browser and\n * can safely live on the browser entry without clobbering the native DOM.\n *\n * Exported as a _used binding_ rather than imported as a bare `import\n * \"./shim\"`: Vite 8's Rollup reorders bare side-effect imports after binding\n * imports, which would let `HTMLElement` be subclassed before the shim runs. A\n * binding keeps this import in source order — first.\n */\nexport const domShimApplied = (() => {\n if (typeof globalThis.HTMLElement === \"undefined\") {\n globalThis.HTMLElement = HTMLElement;\n globalThis.customElements = customElements;\n globalThis.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 }\n\n return true;\n})();\n"],"mappings":";;;;;;;;;;;;;;AAcA,IAAa,wBAAwB;CACnC,IAAI,OAAO,WAAW,gBAAgB,aAAa;EACjD,WAAW,cAAc;EACzB,WAAW,iBAAiB;EAC5B,WAAW,mBAAmB,MAAM,iBAAiB;GACnD,cAAqB,CAErB;GACA,aAAoB,CAEpB;GACA,UAAiB,CAEjB;GACA,cAAqB;IACnB,OAAO,CAAC;GACV;EACF;CACF;CAEA,OAAO;AACT,EAAA,CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAUA,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,wBAAwB,GAC9B,MAAM,oCAAoC,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC"}
|
package/dist/types/shim.d.ts
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Installs a minimal DOM shim so modules that subclass `HTMLElement` — the
|
|
3
|
+
* remote custom elements, via the remote-dom fork's `RemoteElement` — can be
|
|
4
|
+
* evaluated in a Node/SSR context (e.g. Next.js server-rendering a client
|
|
5
|
+
* component). Guarded on a missing DOM, so it is a no-op in a real browser and
|
|
6
|
+
* can safely live on the browser entry without clobbering the native DOM.
|
|
7
|
+
*
|
|
8
|
+
* Exported as a _used binding_ rather than imported as a bare `import
|
|
9
|
+
* "./shim"`: Vite 8's Rollup reorders bare side-effect imports after binding
|
|
10
|
+
* imports, which would let `HTMLElement` be subclassed before the shim runs. A
|
|
11
|
+
* binding keeps this import in source order — first.
|
|
12
|
+
*/
|
|
13
|
+
export declare const domShimApplied: boolean;
|
|
2
14
|
//# sourceMappingURL=shim.d.ts.map
|
package/dist/types/shim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../../src/shim.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../../src/shim.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,SAqBvB,CAAC"}
|