@prismicio/types-internal 4.6.0 → 4.7.0-pr.36.885e913
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/common/asset.d.ts +1 -2
- package/dist/common/asset.d.ts.map +1 -1
- package/dist/common/asset.js.map +1 -1
- package/dist/common/embed.d.ts +1 -2
- package/dist/common/embed.d.ts.map +1 -1
- package/dist/common/embed.js.map +1 -1
- package/dist/common/hexaColorCode.d.ts +1 -2
- package/dist/common/hexaColorCode.d.ts.map +1 -1
- package/dist/common/hexaColorCode.js.map +1 -1
- package/dist/common/nonEmptyString.d.ts +1 -2
- package/dist/common/nonEmptyString.d.ts.map +1 -1
- package/dist/common/nonEmptyString.js.map +1 -1
- package/dist/common/widgetKey.d.ts +1 -2
- package/dist/common/widgetKey.d.ts.map +1 -1
- package/dist/common/widgetKey.js.map +1 -1
- package/dist/content/boolean.d.ts +1 -2
- package/dist/content/boolean.d.ts.map +1 -1
- package/dist/content/boolean.js.map +1 -1
- package/dist/content/codec/boolean.js.map +1 -1
- package/dist/content/codec/document.js.map +1 -1
- package/dist/content/codec/embed.js.map +1 -1
- package/dist/content/codec/empty.js.map +1 -1
- package/dist/content/codec/field.js.map +1 -1
- package/dist/content/codec/geopoint.js.map +1 -1
- package/dist/content/codec/group.js +6 -4
- package/dist/content/codec/group.js.map +1 -1
- package/dist/content/codec/image.js.map +1 -1
- package/dist/content/codec/integrationField.js.map +1 -1
- package/dist/content/codec/legacyContentCtx.d.ts +2 -15
- package/dist/content/codec/legacyContentCtx.d.ts.map +1 -1
- package/dist/content/codec/legacyContentCtx.js +5 -1
- package/dist/content/codec/legacyContentCtx.js.map +1 -1
- package/dist/content/codec/link.js.map +1 -1
- package/dist/content/codec/nestable.js.map +1 -1
- package/dist/content/codec/repeatable.js.map +1 -1
- package/dist/content/codec/richText.js.map +1 -1
- package/dist/content/codec/separator.js.map +1 -1
- package/dist/content/codec/slice.js.map +1 -1
- package/dist/content/codec/slices.js.map +1 -1
- package/dist/content/codec/table.js.map +1 -1
- package/dist/content/codec/uid.js.map +1 -1
- package/dist/content/codec/widget.js.map +1 -1
- package/dist/content/document.d.ts +1 -2
- package/dist/content/document.d.ts.map +1 -1
- package/dist/content/document.js.map +1 -1
- package/dist/content/embed.d.ts +1 -2
- package/dist/content/embed.d.ts.map +1 -1
- package/dist/content/embed.js.map +1 -1
- package/dist/content/empty.d.ts +1 -2
- package/dist/content/empty.d.ts.map +1 -1
- package/dist/content/empty.js.map +1 -1
- package/dist/content/field.d.ts +1 -2
- package/dist/content/field.d.ts.map +1 -1
- package/dist/content/field.js.map +1 -1
- package/dist/content/geopoint.d.ts +1 -2
- package/dist/content/geopoint.d.ts.map +1 -1
- package/dist/content/geopoint.js.map +1 -1
- package/dist/content/group.d.ts +3 -2
- package/dist/content/group.d.ts.map +1 -1
- package/dist/content/group.js.map +1 -1
- package/dist/content/image.d.ts +1 -2
- package/dist/content/image.d.ts.map +1 -1
- package/dist/content/image.js.map +1 -1
- package/dist/content/integrationField.d.ts +1 -2
- package/dist/content/integrationField.d.ts.map +1 -1
- package/dist/content/integrationField.js.map +1 -1
- package/dist/content/legacy/boolean.js.map +1 -1
- package/dist/content/legacy/document.d.ts +1 -2
- package/dist/content/legacy/document.d.ts.map +1 -1
- package/dist/content/legacy/document.js.map +1 -1
- package/dist/content/legacy/embed.js.map +1 -1
- package/dist/content/legacy/empty.js.map +1 -1
- package/dist/content/legacy/field.js.map +1 -1
- package/dist/content/legacy/geopoint.js.map +1 -1
- package/dist/content/legacy/group.d.ts +2 -2
- package/dist/content/legacy/group.d.ts.map +1 -1
- package/dist/content/legacy/group.js.map +1 -1
- package/dist/content/legacy/image.d.ts +0 -1
- package/dist/content/legacy/image.d.ts.map +1 -1
- package/dist/content/legacy/image.js.map +1 -1
- package/dist/content/legacy/integrationField.js.map +1 -1
- package/dist/content/legacy/link.d.ts +1 -2
- package/dist/content/legacy/link.d.ts.map +1 -1
- package/dist/content/legacy/link.js.map +1 -1
- package/dist/content/legacy/nestable.d.ts +12 -0
- package/dist/content/legacy/nestable.js.map +1 -1
- package/dist/content/legacy/repeatable.js.map +1 -1
- package/dist/content/legacy/richText.d.ts +5 -2
- package/dist/content/legacy/richText.d.ts.map +1 -1
- package/dist/content/legacy/richText.js.map +1 -1
- package/dist/content/legacy/separator.js.map +1 -1
- package/dist/content/legacy/slice.js +1 -1
- package/dist/content/legacy/slice.js.map +1 -1
- package/dist/content/legacy/slices.js.map +1 -1
- package/dist/content/legacy/table.d.ts +2 -0
- package/dist/content/legacy/table.js.map +1 -1
- package/dist/content/legacy/uid.js.map +1 -1
- package/dist/content/link.d.ts +7 -8
- package/dist/content/link.d.ts.map +1 -1
- package/dist/content/link.js.map +1 -1
- package/dist/content/nestable.d.ts +0 -1
- package/dist/content/nestable.d.ts.map +1 -1
- package/dist/content/nestable.js.map +1 -1
- package/dist/content/repeatable.d.ts +3 -4
- package/dist/content/repeatable.d.ts.map +1 -1
- package/dist/content/repeatable.js.map +1 -1
- package/dist/content/richText.d.ts +2 -3
- package/dist/content/richText.d.ts.map +1 -1
- package/dist/content/richText.js +2 -2
- package/dist/content/richText.js.map +1 -1
- package/dist/content/separator.d.ts +1 -2
- package/dist/content/separator.d.ts.map +1 -1
- package/dist/content/separator.js.map +1 -1
- package/dist/content/slice.d.ts +13 -14
- package/dist/content/slice.d.ts.map +1 -1
- package/dist/content/slice.js.map +1 -1
- package/dist/content/slices.d.ts +13 -14
- package/dist/content/slices.d.ts.map +1 -1
- package/dist/content/slices.js.map +1 -1
- package/dist/content/table.d.ts +1 -2
- package/dist/content/table.d.ts.map +1 -1
- package/dist/content/table.js.map +1 -1
- package/dist/content/uid.d.ts +1 -2
- package/dist/content/uid.d.ts.map +1 -1
- package/dist/content/uid.js.map +1 -1
- package/dist/content/widget.d.ts +0 -1
- package/dist/content/widget.d.ts.map +1 -1
- package/dist/content/widget.js.map +1 -1
- package/dist/helpers/contentPath.d.ts +1 -1
- package/dist/helpers/contentPath.d.ts.map +1 -1
- package/dist/helpers/contentPath.js +1 -1
- package/dist/helpers/contentPath.js.map +1 -1
- package/dist/helpers/customTypeModel.d.ts +3 -5
- package/dist/helpers/customTypeModel.d.ts.map +1 -1
- package/dist/helpers/customTypeModel.js +2 -2
- package/dist/helpers/customTypeModel.js.map +1 -1
- package/dist/helpers/documentContent.d.ts +4 -5
- package/dist/helpers/documentContent.d.ts.map +1 -1
- package/dist/helpers/documentContent.js +12 -15
- package/dist/helpers/documentContent.js.map +1 -1
- package/dist/helpers/fieldModel.d.ts +1 -1
- package/dist/helpers/fieldModel.d.ts.map +1 -1
- package/dist/helpers/fieldModel.js +1 -1
- package/dist/helpers/fieldModel.js.map +1 -1
- package/dist/helpers/imageContent.d.ts +2 -6
- package/dist/helpers/imageContent.d.ts.map +1 -1
- package/dist/helpers/imageContent.js +1 -1
- package/dist/helpers/imageContent.js.map +1 -1
- package/dist/helpers/repository.d.ts +1 -1
- package/dist/helpers/repository.d.ts.map +1 -1
- package/dist/helpers/repository.js +1 -1
- package/dist/helpers/repository.js.map +1 -1
- package/dist/helpers/sliceContent.d.ts +4 -4
- package/dist/helpers/sliceContent.d.ts.map +1 -1
- package/dist/helpers/sliceContent.js +11 -2
- package/dist/helpers/sliceContent.js.map +1 -1
- package/dist/helpers/sliceModel.d.ts +1 -1
- package/dist/helpers/sliceModel.d.ts.map +1 -1
- package/dist/helpers/sliceModel.js +1 -1
- package/dist/helpers/sliceModel.js.map +1 -1
- package/dist/helpers/traverseContent.d.ts +2 -3
- package/dist/helpers/traverseContent.d.ts.map +1 -1
- package/dist/helpers/traverseContent.js +6 -3
- package/dist/helpers/traverseContent.js.map +1 -1
- package/dist/helpers/traverseContentWithModel.d.ts +0 -1
- package/dist/helpers/traverseContentWithModel.d.ts.map +1 -1
- package/dist/helpers/traverseContentWithModel.js.map +1 -1
- package/dist/helpers/withDefaultContent.d.ts +1 -3
- package/dist/helpers/withDefaultContent.d.ts.map +1 -1
- package/dist/helpers/withDefaultContent.js +1 -1
- package/dist/helpers/withDefaultContent.js.map +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/index.js +5 -2
- package/dist/io-ts.d.ts +349 -305
- package/dist/io-ts.d.ts.map +1 -1
- package/dist/io-ts.js +20 -18
- package/dist/io-ts.js.map +1 -1
- package/dist/model/boolean.d.ts +1 -2
- package/dist/model/boolean.d.ts.map +1 -1
- package/dist/model/boolean.js.map +1 -1
- package/dist/model/color.d.ts +1 -2
- package/dist/model/color.d.ts.map +1 -1
- package/dist/model/color.js.map +1 -1
- package/dist/model/customType.d.ts +7 -4
- package/dist/model/customType.d.ts.map +1 -1
- package/dist/model/customType.js +1 -1
- package/dist/model/customType.js.map +1 -1
- package/dist/model/date.d.ts +1 -2
- package/dist/model/date.d.ts.map +1 -1
- package/dist/model/date.js.map +1 -1
- package/dist/model/diff/changes.d.ts +21 -0
- package/dist/model/diff/changes.d.ts.map +1 -0
- package/dist/model/diff/changes.js +11 -0
- package/dist/model/diff/changes.js.map +1 -0
- package/dist/model/diff/sharedSlice.d.ts +14 -0
- package/dist/model/diff/sharedSlice.d.ts.map +1 -0
- package/dist/model/diff/sharedSlice.js +45 -0
- package/dist/model/diff/sharedSlice.js.map +1 -0
- package/dist/model/diff/utils.js +40 -0
- package/dist/model/diff/utils.js.map +1 -0
- package/dist/model/diff/variation.d.ts +15 -0
- package/dist/model/diff/variation.d.ts.map +1 -0
- package/dist/model/diff/variation.js +92 -0
- package/dist/model/diff/variation.js.map +1 -0
- package/dist/model/diff/widgets.d.ts +15 -0
- package/dist/model/diff/widgets.d.ts.map +1 -0
- package/dist/model/embed.d.ts +1 -2
- package/dist/model/embed.d.ts.map +1 -1
- package/dist/model/embed.js.map +1 -1
- package/dist/model/geopoint.d.ts +1 -2
- package/dist/model/geopoint.d.ts.map +1 -1
- package/dist/model/geopoint.js.map +1 -1
- package/dist/model/group.d.ts +39 -40
- package/dist/model/group.d.ts.map +1 -1
- package/dist/model/group.js +1 -1
- package/dist/model/group.js.map +1 -1
- package/dist/model/image.d.ts +1 -2
- package/dist/model/image.d.ts.map +1 -1
- package/dist/model/image.js +1 -1
- package/dist/model/image.js.map +1 -1
- package/dist/model/integrationField.d.ts +1 -2
- package/dist/model/integrationField.d.ts.map +1 -1
- package/dist/model/integrationField.js.map +1 -1
- package/dist/model/link.d.ts +28 -3
- package/dist/model/link.d.ts.map +1 -1
- package/dist/model/link.js +3 -3
- package/dist/model/link.js.map +1 -1
- package/dist/model/nestable.d.ts +0 -1
- package/dist/model/nestable.d.ts.map +1 -1
- package/dist/model/nestable.js +3 -3
- package/dist/model/nestable.js.map +1 -1
- package/dist/model/number.d.ts +1 -2
- package/dist/model/number.d.ts.map +1 -1
- package/dist/model/number.js.map +1 -1
- package/dist/model/range.d.ts +1 -2
- package/dist/model/range.d.ts.map +1 -1
- package/dist/model/range.js.map +1 -1
- package/dist/model/richText.d.ts +1 -2
- package/dist/model/richText.d.ts.map +1 -1
- package/dist/model/richText.js +1 -1
- package/dist/model/richText.js.map +1 -1
- package/dist/model/select.d.ts +1 -2
- package/dist/model/select.d.ts.map +1 -1
- package/dist/model/select.js.map +1 -1
- package/dist/model/separator.d.ts +1 -2
- package/dist/model/separator.d.ts.map +1 -1
- package/dist/model/separator.js.map +1 -1
- package/dist/model/slice.d.ts +44 -45
- package/dist/model/slice.d.ts.map +1 -1
- package/dist/model/slice.js +1 -1
- package/dist/model/slice.js.map +1 -1
- package/dist/model/slices.d.ts +1 -2
- package/dist/model/slices.d.ts.map +1 -1
- package/dist/model/slices.js +1 -1
- package/dist/model/slices.js.map +1 -1
- package/dist/model/table.d.ts +4 -3
- package/dist/model/table.d.ts.map +1 -1
- package/dist/model/table.js.map +1 -1
- package/dist/model/text.d.ts +1 -2
- package/dist/model/text.d.ts.map +1 -1
- package/dist/model/text.js.map +1 -1
- package/dist/model/timestamp.d.ts +1 -2
- package/dist/model/timestamp.d.ts.map +1 -1
- package/dist/model/timestamp.js.map +1 -1
- package/dist/model/uid.d.ts +1 -2
- package/dist/model/uid.d.ts.map +1 -1
- package/dist/model/uid.js.map +1 -1
- package/dist/model/widget.d.ts +23 -24
- package/dist/model/widget.d.ts.map +1 -1
- package/dist/model/widget.js +1 -1
- package/dist/model/widget.js.map +1 -1
- package/dist/zod4.d.ts +3399 -3354
- package/dist/zod4.d.ts.map +1 -1
- package/dist/zod4.js +20 -18
- package/dist/zod4.js.map +1 -1
- package/package.json +15 -13
- package/src/content/codec/legacyContentCtx.ts +7 -1
- package/src/helpers/customTypeModel.ts +6 -3
- package/src/helpers/documentContent.ts +21 -28
- package/src/helpers/sliceContent.ts +16 -0
- package/src/helpers/traverseContent.ts +8 -5
- package/src/index.ts +21 -3
- package/src/io-ts.ts +7 -1
- package/src/model/customType.ts +5 -0
- package/src/model/diff/changes.ts +4 -4
- package/src/model/diff/sharedSlice.ts +8 -8
- package/src/model/diff/variation.ts +6 -6
- package/src/model/diff/widgets.ts +3 -3
- package/src/model/image.ts +4 -1
- package/src/model/link.ts +4 -2
- package/src/zod4.ts +7 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/model/diff/utils.ts
|
|
2
|
+
/**
|
|
3
|
+
* Zips two objects together by their keys, creating an object with
|
|
4
|
+
* both left and right values for each key.
|
|
5
|
+
*/
|
|
6
|
+
function zipObjects(objLeft, objRight) {
|
|
7
|
+
return [...new Set(Object.keys(objLeft || {}).concat(Object.keys(objRight || {})))].reduce((acc, key) => {
|
|
8
|
+
const left = objLeft?.[key];
|
|
9
|
+
const right = objRight?.[key];
|
|
10
|
+
return {
|
|
11
|
+
...acc,
|
|
12
|
+
[key]: {
|
|
13
|
+
left,
|
|
14
|
+
right
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}, {});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns true if the object has at least one key.
|
|
21
|
+
*/
|
|
22
|
+
function isNotEmpty(obj) {
|
|
23
|
+
return Boolean(Object.keys(obj).length);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Converts an array to a record using the provided key function.
|
|
27
|
+
*/
|
|
28
|
+
function toRecord(arr, key) {
|
|
29
|
+
return arr.reduce((acc, entry) => {
|
|
30
|
+
const k = key(entry);
|
|
31
|
+
return {
|
|
32
|
+
...acc,
|
|
33
|
+
[k]: entry
|
|
34
|
+
};
|
|
35
|
+
}, {});
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { isNotEmpty, toRecord, zipObjects };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/model/diff/utils.ts"],"sourcesContent":["/**\n * Zips two objects together by their keys, creating an object with\n * both left and right values for each key.\n */\nexport function zipObjects<A, B = A>(\n\tobjLeft?: Partial<Record<string, A>> | undefined,\n\tobjRight?: Partial<Record<string, B>> | undefined,\n): Partial<Record<string, { left?: A | undefined; right?: B | undefined }>> {\n\tconst allKeys = [...new Set(Object.keys(objLeft || {}).concat(Object.keys(objRight || {})))]\n\n\treturn allKeys.reduce<Record<string, { left?: A | undefined; right?: B | undefined }>>(\n\t\t(acc, key) => {\n\t\t\tconst left = objLeft?.[key]\n\t\t\tconst right = objRight?.[key]\n\t\t\treturn {\n\t\t\t\t...acc,\n\t\t\t\t[key]: { left, right },\n\t\t\t}\n\t\t},\n\t\t{},\n\t)\n}\n\n/**\n * Returns true if the object has at least one key.\n */\nexport function isNotEmpty<A extends object>(obj: A): boolean {\n\treturn Boolean(Object.keys(obj).length)\n}\n\n/**\n * Converts an array to a record using the provided key function.\n */\nexport function toRecord<A extends object>(\n\tarr: ReadonlyArray<A>,\n\tkey: (obj: A) => string,\n): Record<string, A> {\n\treturn arr.reduce<Record<string, A>>((acc, entry) => {\n\t\tconst k = key(entry)\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[k]: entry,\n\t\t}\n\t}, {})\n}\n"],"mappings":";;;;;AAIA,SAAgB,WACf,SACA,UAC2E;CAG3E,OAAO,CAFU,GAAG,IAAI,IAAI,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,OAAO,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAE7E,CAAC,CAAC,QACb,KAAK,QAAQ;EACb,MAAM,OAAO,UAAU;EACvB,MAAM,QAAQ,WAAW;EACzB,OAAO;GACN,GAAG;IACF,MAAM;IAAE;IAAM;GAAM;EACtB;CACD,GACA,CAAC,CACF;AACD;;;;AAKA,SAAgB,WAA6B,KAAiB;CAC7D,OAAO,QAAQ,OAAO,KAAK,GAAG,CAAC,CAAC,MAAM;AACvC;;;;AAKA,SAAgB,SACf,KACA,KACoB;CACpB,OAAO,IAAI,QAA2B,KAAK,UAAU;EACpD,MAAM,IAAI,IAAI,KAAK;EACnB,OAAO;GACN,GAAG;IACF,IAAI;EACN;CACD,GAAG,CAAC,CAAC;AACN"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SharedSliceModelVariation } from "../slice.js";
|
|
2
|
+
import { Diff } from "./changes.js";
|
|
3
|
+
import { NestableWidgetDiff, SlicePrimaryWidgetDiff } from "./widgets.js";
|
|
4
|
+
//#region src/model/diff/variation.d.ts
|
|
5
|
+
type VariationDiffMetadata = Omit<SharedSliceModelVariation, "primary" | "items">;
|
|
6
|
+
type VariationDiff = Diff<SharedSliceModelVariation, Partial<VariationDiffMetadata> & {
|
|
7
|
+
primary?: Record<string, SlicePrimaryWidgetDiff>;
|
|
8
|
+
items?: Record<string, NestableWidgetDiff>;
|
|
9
|
+
}>;
|
|
10
|
+
declare const VariationDiffComparator: {
|
|
11
|
+
compare(variationA?: SharedSliceModelVariation, variationB?: SharedSliceModelVariation): VariationDiff | undefined;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { VariationDiff, VariationDiffComparator, VariationDiffMetadata };
|
|
15
|
+
//# sourceMappingURL=variation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variation.d.ts","names":[],"sources":["../../../src/model/diff/variation.ts"],"mappings":";;;;KAYY,wBAAwB,KAAK;KAC7B,gBAAgB,KAC3B,2BACA,QAAQ;EACP,UAAU,eAAe;EACzB,QAAQ,eAAe;;cAsGZ;EACZ,QAAO,aACO,2BAAyB,aACzB,4BACX"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import "./changes.js";
|
|
2
|
+
import { isNotEmpty, zipObjects } from "./utils.js";
|
|
3
|
+
import "../group.js";
|
|
4
|
+
//#region src/model/diff/variation.ts
|
|
5
|
+
function compareVariationMeta(variationA, variationB) {
|
|
6
|
+
const zippedVariations = zipObjects(variationA, variationB);
|
|
7
|
+
return Object.entries(zippedVariations).reduce((acc, [key, value]) => {
|
|
8
|
+
if (key === "primary" || key === "items") return acc;
|
|
9
|
+
if (value?.left === value?.right) return acc;
|
|
10
|
+
return {
|
|
11
|
+
...acc,
|
|
12
|
+
[key]: value?.right
|
|
13
|
+
};
|
|
14
|
+
}, {});
|
|
15
|
+
}
|
|
16
|
+
function compareWidgets(widgetsA, widgetsB) {
|
|
17
|
+
const zippedWidgets = zipObjects(widgetsA, widgetsB);
|
|
18
|
+
const diffWidgets = Object.entries(zippedWidgets).reduce((acc, [widgetKey, widgetValue]) => {
|
|
19
|
+
if (JSON.stringify(widgetValue?.left) === JSON.stringify(widgetValue?.right)) return acc;
|
|
20
|
+
const changes = (() => {
|
|
21
|
+
if (!widgetValue?.left && !widgetValue?.right) return;
|
|
22
|
+
if (widgetValue?.left && !widgetValue.right) return { op: "removed" };
|
|
23
|
+
if (!widgetValue?.left && widgetValue?.right) {
|
|
24
|
+
if (widgetValue.right?.type === "Group") {
|
|
25
|
+
const group = {
|
|
26
|
+
...widgetValue.right,
|
|
27
|
+
config: {
|
|
28
|
+
...widgetValue.right.config,
|
|
29
|
+
fields: {}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
group.config.fields = compareWidgets(void 0, widgetValue.right.config?.fields) || {};
|
|
33
|
+
return {
|
|
34
|
+
op: "added",
|
|
35
|
+
value: group
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
op: "added",
|
|
40
|
+
value: widgetValue.right
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (widgetValue.right?.type === "Group") {
|
|
44
|
+
const group = {
|
|
45
|
+
...widgetValue.right,
|
|
46
|
+
config: {
|
|
47
|
+
...widgetValue.right.config,
|
|
48
|
+
fields: {}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
group.config.fields = compareWidgets(widgetValue.left?.type === "Group" ? widgetValue.left?.config?.fields : void 0, widgetValue.right.config?.fields) || {};
|
|
52
|
+
return {
|
|
53
|
+
op: "updated",
|
|
54
|
+
value: group
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
op: "updated",
|
|
59
|
+
value: widgetValue.right
|
|
60
|
+
};
|
|
61
|
+
})();
|
|
62
|
+
if (!changes) return acc;
|
|
63
|
+
return {
|
|
64
|
+
...acc,
|
|
65
|
+
[widgetKey]: changes
|
|
66
|
+
};
|
|
67
|
+
}, {});
|
|
68
|
+
return isNotEmpty(diffWidgets) ? diffWidgets : void 0;
|
|
69
|
+
}
|
|
70
|
+
const VariationDiffComparator = { compare(variationA, variationB) {
|
|
71
|
+
if (variationA && !variationB) return { op: "removed" };
|
|
72
|
+
if (!variationA && variationB) return {
|
|
73
|
+
op: "added",
|
|
74
|
+
value: variationB
|
|
75
|
+
};
|
|
76
|
+
const diffMeta = compareVariationMeta(variationA, variationB);
|
|
77
|
+
const diffPrimary = compareWidgets(variationA?.primary, variationB?.primary);
|
|
78
|
+
const diffItems = compareWidgets(variationA?.items, variationB?.items);
|
|
79
|
+
const diffVariation = {
|
|
80
|
+
...diffMeta,
|
|
81
|
+
...diffPrimary ? { primary: diffPrimary } : {},
|
|
82
|
+
...diffItems ? { items: diffItems } : {}
|
|
83
|
+
};
|
|
84
|
+
if (isNotEmpty(diffVariation)) return {
|
|
85
|
+
op: "updated",
|
|
86
|
+
value: diffVariation
|
|
87
|
+
};
|
|
88
|
+
} };
|
|
89
|
+
//#endregion
|
|
90
|
+
export { VariationDiffComparator };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=variation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variation.js","names":[],"sources":["../../../src/model/diff/variation.ts"],"sourcesContent":["import type { GroupModel } from \"../group\"\nimport { GroupFieldType } from \"../group\"\nimport type { NestableModel } from \"../nestable\"\nimport type { SharedSliceModelVariation } from \"../slice\"\nimport { type Diff, DiffOperation } from \"./changes\"\nimport { isNotEmpty, zipObjects } from \"./utils\"\nimport type {\n\tGroupWidgetWithFieldsDiff,\n\tNestableWidgetDiff,\n\tSlicePrimaryWidgetDiff,\n} from \"./widgets\"\n\nexport type VariationDiffMetadata = Omit<SharedSliceModelVariation, \"primary\" | \"items\">\nexport type VariationDiff = Diff<\n\tSharedSliceModelVariation,\n\tPartial<VariationDiffMetadata> & {\n\t\tprimary?: Record<string, SlicePrimaryWidgetDiff>\n\t\titems?: Record<string, NestableWidgetDiff>\n\t}\n>\n\nfunction compareVariationMeta(\n\tvariationA?: SharedSliceModelVariation,\n\tvariationB?: SharedSliceModelVariation,\n): Partial<VariationDiffMetadata> {\n\tconst zippedVariations = zipObjects(variationA, variationB)\n\n\treturn Object.entries(zippedVariations).reduce((acc, [key, value]) => {\n\t\tif (key === \"primary\" || key === \"items\") return acc\n\n\t\tif (value?.left === value?.right) return acc\n\t\treturn { ...acc, [key]: value?.right }\n\t}, {})\n}\n\nfunction compareWidgets<TWidget extends NestableModel | GroupModel>(\n\twidgetsA?: { [key: string]: TWidget },\n\twidgetsB?: { [key: string]: TWidget },\n):\n\t| Record<string, TWidget extends GroupModel ? SlicePrimaryWidgetDiff : NestableWidgetDiff>\n\t| undefined {\n\tconst zippedWidgets = zipObjects(widgetsA, widgetsB)\n\n\tconst diffWidgets = Object.entries(zippedWidgets).reduce((acc, [widgetKey, widgetValue]) => {\n\t\tif (JSON.stringify(widgetValue?.left) === JSON.stringify(widgetValue?.right)) return acc\n\n\t\tconst changes = (() => {\n\t\t\tif (!widgetValue?.left && !widgetValue?.right) return\n\n\t\t\tif (widgetValue?.left && !widgetValue.right) {\n\t\t\t\treturn {\n\t\t\t\t\top: DiffOperation.Removed,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!widgetValue?.left && widgetValue?.right) {\n\t\t\t\tif (widgetValue.right?.type === GroupFieldType) {\n\t\t\t\t\tconst group: GroupWidgetWithFieldsDiff = {\n\t\t\t\t\t\t...widgetValue.right,\n\t\t\t\t\t\tconfig: {\n\t\t\t\t\t\t\t...widgetValue.right.config,\n\t\t\t\t\t\t\tfields: {},\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t\t// On added groups, this basically marks all fields in the group as added\n\t\t\t\t\tgroup.config.fields = compareWidgets(undefined, widgetValue.right.config?.fields) || {}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\top: DiffOperation.Added,\n\t\t\t\t\t\tvalue: group,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\top: DiffOperation.Added,\n\t\t\t\t\tvalue: widgetValue.right,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (widgetValue.right?.type === GroupFieldType) {\n\t\t\t\tconst group: GroupWidgetWithFieldsDiff = {\n\t\t\t\t\t...widgetValue.right,\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\t...widgetValue.right.config,\n\t\t\t\t\t\tfields: {},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\t// On updated groups, this also compares the fields inside the group\n\t\t\t\tgroup.config.fields =\n\t\t\t\t\tcompareWidgets(\n\t\t\t\t\t\twidgetValue.left?.type === GroupFieldType\n\t\t\t\t\t\t\t? widgetValue.left?.config?.fields\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\twidgetValue.right.config?.fields,\n\t\t\t\t\t) || {}\n\n\t\t\t\treturn {\n\t\t\t\t\top: DiffOperation.Updated,\n\t\t\t\t\tvalue: group,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\top: DiffOperation.Updated,\n\t\t\t\tvalue: widgetValue.right,\n\t\t\t}\n\t\t})()\n\n\t\tif (!changes) return acc\n\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[widgetKey]: changes,\n\t\t}\n\t}, {})\n\n\treturn isNotEmpty(diffWidgets) ? diffWidgets : undefined\n}\n\nexport const VariationDiffComparator = {\n\tcompare(\n\t\tvariationA?: SharedSliceModelVariation,\n\t\tvariationB?: SharedSliceModelVariation,\n\t): VariationDiff | undefined {\n\t\tif (variationA && !variationB)\n\t\t\treturn {\n\t\t\t\top: DiffOperation.Removed,\n\t\t\t}\n\t\tif (!variationA && variationB) {\n\t\t\treturn {\n\t\t\t\top: DiffOperation.Added,\n\t\t\t\tvalue: variationB,\n\t\t\t}\n\t\t}\n\n\t\tconst diffMeta = compareVariationMeta(variationA, variationB)\n\n\t\tconst diffPrimary = compareWidgets(variationA?.primary, variationB?.primary)\n\t\tconst diffItems = compareWidgets(variationA?.items, variationB?.items)\n\n\t\tconst diffVariation = {\n\t\t\t...diffMeta,\n\t\t\t...(diffPrimary ? { primary: diffPrimary } : {}),\n\t\t\t...(diffItems ? { items: diffItems } : {}),\n\t\t}\n\n\t\tif (isNotEmpty(diffVariation)) {\n\t\t\treturn {\n\t\t\t\top: DiffOperation.Updated,\n\t\t\t\tvalue: diffVariation,\n\t\t\t}\n\t\t}\n\t\treturn undefined\n\t},\n}\n"],"mappings":";;;;AAqBA,SAAS,qBACR,YACA,YACiC;CACjC,MAAM,mBAAmB,WAAW,YAAY,UAAU;CAE1D,OAAO,OAAO,QAAQ,gBAAgB,CAAC,CAAC,QAAQ,KAAK,CAAC,KAAK,WAAW;EACrE,IAAI,QAAQ,aAAa,QAAQ,SAAS,OAAO;EAEjD,IAAI,OAAO,SAAS,OAAO,OAAO,OAAO;EACzC,OAAO;GAAE,GAAG;IAAM,MAAM,OAAO;EAAM;CACtC,GAAG,CAAC,CAAC;AACN;AAEA,SAAS,eACR,UACA,UAGY;CACZ,MAAM,gBAAgB,WAAW,UAAU,QAAQ;CAEnD,MAAM,cAAc,OAAO,QAAQ,aAAa,CAAC,CAAC,QAAQ,KAAK,CAAC,WAAW,iBAAiB;EAC3F,IAAI,KAAK,UAAU,aAAa,IAAI,MAAM,KAAK,UAAU,aAAa,KAAK,GAAG,OAAO;EAErF,MAAM,iBAAiB;GACtB,IAAI,CAAC,aAAa,QAAQ,CAAC,aAAa,OAAO;GAE/C,IAAI,aAAa,QAAQ,CAAC,YAAY,OACrC,OAAO,EACN,IAAA,UACD;GAGD,IAAI,CAAC,aAAa,QAAQ,aAAa,OAAO;IAC7C,IAAI,YAAY,OAAO,SAAA,SAAyB;KAC/C,MAAM,QAAmC;MACxC,GAAG,YAAY;MACf,QAAQ;OACP,GAAG,YAAY,MAAM;OACrB,QAAQ,CAAC;MACV;KACD;KAEA,MAAM,OAAO,SAAS,eAAe,KAAA,GAAW,YAAY,MAAM,QAAQ,MAAM,KAAK,CAAC;KAEtF,OAAO;MACN,IAAA;MACA,OAAO;KACR;IACD;IAEA,OAAO;KACN,IAAA;KACA,OAAO,YAAY;IACpB;GACD;GAEA,IAAI,YAAY,OAAO,SAAA,SAAyB;IAC/C,MAAM,QAAmC;KACxC,GAAG,YAAY;KACf,QAAQ;MACP,GAAG,YAAY,MAAM;MACrB,QAAQ,CAAC;KACV;IACD;IAEA,MAAM,OAAO,SACZ,eACC,YAAY,MAAM,SAAA,UACf,YAAY,MAAM,QAAQ,SAC1B,KAAA,GACH,YAAY,MAAM,QAAQ,MAC3B,KAAK,CAAC;IAEP,OAAO;KACN,IAAA;KACA,OAAO;IACR;GACD;GAEA,OAAO;IACN,IAAA;IACA,OAAO,YAAY;GACpB;EACD,EAAA,CAAG;EAEH,IAAI,CAAC,SAAS,OAAO;EAErB,OAAO;GACN,GAAG;IACF,YAAY;EACd;CACD,GAAG,CAAC,CAAC;CAEL,OAAO,WAAW,WAAW,IAAI,cAAc,KAAA;AAChD;AAEA,MAAa,0BAA0B,EACtC,QACC,YACA,YAC4B;CAC5B,IAAI,cAAc,CAAC,YAClB,OAAO,EACN,IAAA,UACD;CACD,IAAI,CAAC,cAAc,YAClB,OAAO;EACN,IAAA;EACA,OAAO;CACR;CAGD,MAAM,WAAW,qBAAqB,YAAY,UAAU;CAE5D,MAAM,cAAc,eAAe,YAAY,SAAS,YAAY,OAAO;CAC3E,MAAM,YAAY,eAAe,YAAY,OAAO,YAAY,KAAK;CAErE,MAAM,gBAAgB;EACrB,GAAG;EACH,GAAI,cAAc,EAAE,SAAS,YAAY,IAAI,CAAC;EAC9C,GAAI,YAAY,EAAE,OAAO,UAAU,IAAI,CAAC;CACzC;CAEA,IAAI,WAAW,aAAa,GAC3B,OAAO;EACN,IAAA;EACA,OAAO;CACR;AAGF,EACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NestableModel } from "../nestable.js";
|
|
2
|
+
import { GroupModel } from "../group.js";
|
|
3
|
+
import { Diff } from "./changes.js";
|
|
4
|
+
//#region src/model/diff/widgets.d.ts
|
|
5
|
+
type NestableWidgetDiff = Diff<NestableModel, NestableModel>;
|
|
6
|
+
type GroupWidgetWithFieldsDiff = Omit<GroupModel, "config"> & {
|
|
7
|
+
config: Omit<NonNullable<GroupModel["config"]>, "fields"> & {
|
|
8
|
+
fields?: Record<string, GroupWidgetDiff | NestableWidgetDiff>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type GroupWidgetDiff = Diff<GroupWidgetWithFieldsDiff, GroupWidgetWithFieldsDiff>;
|
|
12
|
+
type SlicePrimaryWidgetDiff = NestableWidgetDiff | GroupWidgetDiff;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { GroupWidgetDiff, GroupWidgetWithFieldsDiff, NestableWidgetDiff, SlicePrimaryWidgetDiff };
|
|
15
|
+
//# sourceMappingURL=widgets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgets.d.ts","names":[],"sources":["../../../src/model/diff/widgets.ts"],"mappings":";;;;KAIY,qBAAqB,KAAK,eAAe;KAEzC,4BAA4B,KAAK;EAC5C,QAAQ,KAAK,YAAY;IACxB,SAAS,eAAe,kBAAkB;;;KAIhC,kBAAkB,KAAK,2BAA2B;KAElD,yBAAyB,qBAAqB"}
|
package/dist/model/embed.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/model/embed.d.ts
|
|
4
3
|
declare const EmbedModelSchema: z.ZodMiniObject<{
|
|
5
4
|
type: z.ZodMiniLiteral<"Embed">;
|
|
@@ -12,5 +11,5 @@ declare const EmbedModelSchema: z.ZodMiniObject<{
|
|
|
12
11
|
}, z.core.$strip>;
|
|
13
12
|
type EmbedModel = z.infer<typeof EmbedModelSchema>;
|
|
14
13
|
//#endregion
|
|
15
|
-
export { EmbedModel };
|
|
14
|
+
export { EmbedModel, EmbedModelSchema };
|
|
16
15
|
//# sourceMappingURL=embed.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.d.ts","names":[],"sources":["../../src/model/embed.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"embed.d.ts","names":[],"sources":["../../src/model/embed.ts"],"mappings":";;cAQa,kBAAgB,EAAA;;;;;;;;;KAMjB,aAAa,EAAE,aAAa"}
|
package/dist/model/embed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","names":[],"sources":["../../src/model/embed.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst EmbedConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tuseAsTitle: z.optional(z.boolean()),\n})\n\nexport const EmbedModelSchema = z.object({\n\ttype: z.literal(\"Embed\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(EmbedConfigSchema),\n})\n\nexport type EmbedModel = z.infer<typeof EmbedModelSchema>\n"],"mappings":";;AAEA,MAAM,oBAAoB,EAAE,OAAO;CAClC,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"embed.js","names":[],"sources":["../../src/model/embed.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst EmbedConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tuseAsTitle: z.optional(z.boolean()),\n})\n\nexport const EmbedModelSchema = z.object({\n\ttype: z.literal(\"Embed\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(EmbedConfigSchema),\n})\n\nexport type EmbedModel = z.infer<typeof EmbedModelSchema>\n"],"mappings":";;AAEA,MAAM,oBAAoB,EAAE,OAAO;CAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC3B,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC;CAClC,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC;AACnC,CAAC;AAED,MAAa,mBAAmB,EAAE,OAAO;CACxC,MAAM,EAAE,QAAQ,OAAO;CACvB,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC9B,QAAQ,EAAE,SAAS,iBAAiB;AACrC,CAAC"}
|
package/dist/model/geopoint.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/model/geopoint.d.ts
|
|
4
3
|
declare const GeoPointModelSchema: z.ZodMiniObject<{
|
|
5
4
|
type: z.ZodMiniLiteral<"GeoPoint">;
|
|
@@ -10,5 +9,5 @@ declare const GeoPointModelSchema: z.ZodMiniObject<{
|
|
|
10
9
|
}, z.core.$strip>;
|
|
11
10
|
type GeoPointModel = z.infer<typeof GeoPointModelSchema>;
|
|
12
11
|
//#endregion
|
|
13
|
-
export { GeoPointModel };
|
|
12
|
+
export { GeoPointModel, GeoPointModelSchema };
|
|
14
13
|
//# sourceMappingURL=geopoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geopoint.d.ts","names":[],"sources":["../../src/model/geopoint.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"geopoint.d.ts","names":[],"sources":["../../src/model/geopoint.ts"],"mappings":";;cAMa,qBAAmB,EAAA;;;;;;;KAMpB,gBAAgB,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geopoint.js","names":[],"sources":["../../src/model/geopoint.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst GeoPointConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n})\n\nexport const GeoPointModelSchema = z.object({\n\ttype: z.literal(\"GeoPoint\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(GeoPointConfigSchema),\n})\n\nexport type GeoPointModel = z.infer<typeof GeoPointModelSchema>\n"],"mappings":";;AAEA,MAAM,uBAAuB,EAAE,OAAO,EACrC,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"geopoint.js","names":[],"sources":["../../src/model/geopoint.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst GeoPointConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n})\n\nexport const GeoPointModelSchema = z.object({\n\ttype: z.literal(\"GeoPoint\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(GeoPointConfigSchema),\n})\n\nexport type GeoPointModel = z.infer<typeof GeoPointModelSchema>\n"],"mappings":";;AAEA,MAAM,uBAAuB,EAAE,OAAO,EACrC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC5B,CAAC;AAED,MAAa,sBAAsB,EAAE,OAAO;CAC3C,MAAM,EAAE,QAAQ,UAAU;CAC1B,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC9B,QAAQ,EAAE,SAAS,oBAAoB;AACxC,CAAC"}
|
package/dist/model/group.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { NestableModel } from "./nestable.js";
|
|
2
2
|
import { z } from "zod/mini";
|
|
3
|
-
|
|
4
3
|
//#region src/model/group.d.ts
|
|
5
4
|
declare const NestedGroupModelSchema: z.ZodMiniObject<{
|
|
6
5
|
type: z.ZodMiniLiteral<"Group">;
|
|
@@ -78,7 +77,7 @@ declare const NestedGroupModelSchema: z.ZodMiniObject<{
|
|
|
78
77
|
label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
79
78
|
useAsTitle: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
80
79
|
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
81
|
-
select: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnknown, z.ZodMiniTransform<"
|
|
80
|
+
select: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnknown, z.ZodMiniTransform<"document" | "media" | "web" | null, unknown>>>;
|
|
82
81
|
customtypes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
83
82
|
id: z.ZodMiniString<string>;
|
|
84
83
|
fields: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
@@ -194,7 +193,7 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
194
193
|
config: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
195
194
|
label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
196
195
|
repeat: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
197
|
-
fields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<
|
|
196
|
+
fields: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniType<{
|
|
198
197
|
type: "Group";
|
|
199
198
|
fieldset?: string | null | undefined;
|
|
200
199
|
icon?: string | undefined;
|
|
@@ -203,6 +202,22 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
203
202
|
label?: string | null | undefined;
|
|
204
203
|
repeat?: boolean | undefined;
|
|
205
204
|
fields?: Record<string, {
|
|
205
|
+
type: "StructuredText";
|
|
206
|
+
fieldset?: string | null | undefined;
|
|
207
|
+
config?: {
|
|
208
|
+
label?: string | null | undefined;
|
|
209
|
+
placeholder?: string | undefined;
|
|
210
|
+
useAsTitle?: boolean | undefined;
|
|
211
|
+
single?: string | undefined;
|
|
212
|
+
multi?: string | undefined;
|
|
213
|
+
imageConstraint?: {
|
|
214
|
+
width?: number | null | undefined;
|
|
215
|
+
height?: number | null | undefined;
|
|
216
|
+
} | undefined;
|
|
217
|
+
labels?: string[] | undefined;
|
|
218
|
+
allowTargetBlank?: boolean | undefined;
|
|
219
|
+
} | undefined;
|
|
220
|
+
} | {
|
|
206
221
|
type: "Boolean";
|
|
207
222
|
config?: {
|
|
208
223
|
label?: string | null | undefined;
|
|
@@ -270,7 +285,7 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
270
285
|
label?: string | null | undefined;
|
|
271
286
|
useAsTitle?: boolean | undefined;
|
|
272
287
|
placeholder?: string | undefined;
|
|
273
|
-
select?: "
|
|
288
|
+
select?: "document" | "media" | "web" | null | undefined;
|
|
274
289
|
customtypes?: (string | {
|
|
275
290
|
id: string;
|
|
276
291
|
fields: (string | {
|
|
@@ -323,22 +338,6 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
323
338
|
max?: number | undefined;
|
|
324
339
|
step?: number | undefined;
|
|
325
340
|
} | undefined;
|
|
326
|
-
} | {
|
|
327
|
-
type: "StructuredText";
|
|
328
|
-
fieldset?: string | null | undefined;
|
|
329
|
-
config?: {
|
|
330
|
-
label?: string | null | undefined;
|
|
331
|
-
placeholder?: string | undefined;
|
|
332
|
-
useAsTitle?: boolean | undefined;
|
|
333
|
-
single?: string | undefined;
|
|
334
|
-
multi?: string | undefined;
|
|
335
|
-
imageConstraint?: {
|
|
336
|
-
width?: number | null | undefined;
|
|
337
|
-
height?: number | null | undefined;
|
|
338
|
-
} | undefined;
|
|
339
|
-
labels?: string[] | undefined;
|
|
340
|
-
allowTargetBlank?: boolean | undefined;
|
|
341
|
-
} | undefined;
|
|
342
341
|
} | {
|
|
343
342
|
type: "Select";
|
|
344
343
|
fieldset?: string | null | undefined;
|
|
@@ -376,7 +375,7 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
376
375
|
} | undefined;
|
|
377
376
|
}> | undefined;
|
|
378
377
|
} | undefined;
|
|
379
|
-
}, unknown, z.core.$ZodTypeInternals<
|
|
378
|
+
} | NestableModel, unknown, z.core.$ZodTypeInternals<{
|
|
380
379
|
type: "Group";
|
|
381
380
|
fieldset?: string | null | undefined;
|
|
382
381
|
icon?: string | undefined;
|
|
@@ -385,6 +384,22 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
385
384
|
label?: string | null | undefined;
|
|
386
385
|
repeat?: boolean | undefined;
|
|
387
386
|
fields?: Record<string, {
|
|
387
|
+
type: "StructuredText";
|
|
388
|
+
fieldset?: string | null | undefined;
|
|
389
|
+
config?: {
|
|
390
|
+
label?: string | null | undefined;
|
|
391
|
+
placeholder?: string | undefined;
|
|
392
|
+
useAsTitle?: boolean | undefined;
|
|
393
|
+
single?: string | undefined;
|
|
394
|
+
multi?: string | undefined;
|
|
395
|
+
imageConstraint?: {
|
|
396
|
+
width?: number | null | undefined;
|
|
397
|
+
height?: number | null | undefined;
|
|
398
|
+
} | undefined;
|
|
399
|
+
labels?: string[] | undefined;
|
|
400
|
+
allowTargetBlank?: boolean | undefined;
|
|
401
|
+
} | undefined;
|
|
402
|
+
} | {
|
|
388
403
|
type: "Boolean";
|
|
389
404
|
config?: {
|
|
390
405
|
label?: string | null | undefined;
|
|
@@ -452,7 +467,7 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
452
467
|
label?: string | null | undefined;
|
|
453
468
|
useAsTitle?: boolean | undefined;
|
|
454
469
|
placeholder?: string | undefined;
|
|
455
|
-
select?: "
|
|
470
|
+
select?: "document" | "media" | "web" | null | undefined;
|
|
456
471
|
customtypes?: (string | {
|
|
457
472
|
id: string;
|
|
458
473
|
fields: (string | {
|
|
@@ -505,22 +520,6 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
505
520
|
max?: number | undefined;
|
|
506
521
|
step?: number | undefined;
|
|
507
522
|
} | undefined;
|
|
508
|
-
} | {
|
|
509
|
-
type: "StructuredText";
|
|
510
|
-
fieldset?: string | null | undefined;
|
|
511
|
-
config?: {
|
|
512
|
-
label?: string | null | undefined;
|
|
513
|
-
placeholder?: string | undefined;
|
|
514
|
-
useAsTitle?: boolean | undefined;
|
|
515
|
-
single?: string | undefined;
|
|
516
|
-
multi?: string | undefined;
|
|
517
|
-
imageConstraint?: {
|
|
518
|
-
width?: number | null | undefined;
|
|
519
|
-
height?: number | null | undefined;
|
|
520
|
-
} | undefined;
|
|
521
|
-
labels?: string[] | undefined;
|
|
522
|
-
allowTargetBlank?: boolean | undefined;
|
|
523
|
-
} | undefined;
|
|
524
523
|
} | {
|
|
525
524
|
type: "Select";
|
|
526
525
|
fieldset?: string | null | undefined;
|
|
@@ -558,10 +557,10 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
558
557
|
} | undefined;
|
|
559
558
|
}> | undefined;
|
|
560
559
|
} | undefined;
|
|
561
|
-
}, unknown>>>>;
|
|
560
|
+
} | NestableModel, unknown>>>>;
|
|
562
561
|
}, z.core.$strip>>;
|
|
563
562
|
}, z.core.$strip>;
|
|
564
563
|
type GroupModel = z.infer<typeof GroupModelSchema>;
|
|
565
564
|
//#endregion
|
|
566
|
-
export { GroupModel, NestedGroupModel };
|
|
565
|
+
export { GroupModel, GroupModelSchema, NestedGroupModel, NestedGroupModelSchema };
|
|
567
566
|
//# sourceMappingURL=group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.ts","names":[],"sources":["../../src/model/group.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"group.d.ts","names":[],"sources":["../../src/model/group.ts"],"mappings":";;;cA2Ba,wBAAsB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEvB,mBAAmB,EAAE,aAAa;cAGjC,kBAAgB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMjB,aAAa,EAAE,aAAa"}
|
package/dist/model/group.js
CHANGED
|
@@ -18,6 +18,6 @@ const createGroupSchema = (widgets) => z.object({
|
|
|
18
18
|
const NestedGroupModelSchema = createGroupSchema(NestableModelSchema);
|
|
19
19
|
const GroupModelSchema = createGroupSchema(z.discriminatedUnion("type", [NestableModelSchema, NestedGroupModelSchema]));
|
|
20
20
|
//#endregion
|
|
21
|
-
export { GroupModelSchema, NestedGroupModelSchema };
|
|
21
|
+
export { GroupFieldType, GroupModelSchema, NestedGroupModelSchema };
|
|
22
22
|
|
|
23
23
|
//# sourceMappingURL=group.js.map
|
package/dist/model/group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","names":[],"sources":["../../src/model/group.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { WidgetKeySchema } from \"../common/widgetKey\"\nimport type { NestableModel } from \"./nestable\"\nimport { NestableModelSchema } from \"./nestable\"\n\nexport const GroupFieldType = \"Group\"\n\n// Factory to create group config schema with configurable widget types\nconst createGroupConfigSchema = <TWidgets extends z.ZodMiniType>(widgets: TWidgets) =>\n\tz.object({\n\t\tlabel: z.nullish(z.string()),\n\t\trepeat: z.optional(z.boolean()),\n\t\tfields: z.optional(z.record(WidgetKeySchema, widgets)),\n\t})\n\n// Factory to create group schema with configurable widget types\nconst createGroupSchema = <TWidgets extends z.ZodMiniType>(widgets: TWidgets) =>\n\tz.object({\n\t\ttype: z.literal(GroupFieldType),\n\t\tfieldset: z.nullish(z.string()),\n\t\ticon: z.optional(z.string()),\n\t\tdescription: z.optional(z.string()),\n\t\tconfig: z.optional(createGroupConfigSchema(widgets)),\n\t})\n\n// NestedGroup - only allows Nestable in fields (no further nesting)\nexport const NestedGroupModelSchema = createGroupSchema(NestableModelSchema)\n\nexport type NestedGroupModel = z.infer<typeof NestedGroupModelSchema>\n\n// Group - allows Nestable | NestedGroup in fields (max 2 levels of nesting)\nexport const GroupModelSchema = createGroupSchema(\n\tz.discriminatedUnion(\"type\", [NestableModelSchema, NestedGroupModelSchema]) as z.ZodMiniType<\n\t\tNestableModel | NestedGroupModel\n\t>,\n)\n\nexport type GroupModel = z.infer<typeof GroupModelSchema>\n"],"mappings":";;;;AAMA,MAAa,iBAAiB;AAG9B,MAAM,2BAA2D,YAChE,EAAE,OAAO;CACR,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"group.js","names":[],"sources":["../../src/model/group.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport { WidgetKeySchema } from \"../common/widgetKey\"\nimport type { NestableModel } from \"./nestable\"\nimport { NestableModelSchema } from \"./nestable\"\n\nexport const GroupFieldType = \"Group\"\n\n// Factory to create group config schema with configurable widget types\nconst createGroupConfigSchema = <TWidgets extends z.ZodMiniType>(widgets: TWidgets) =>\n\tz.object({\n\t\tlabel: z.nullish(z.string()),\n\t\trepeat: z.optional(z.boolean()),\n\t\tfields: z.optional(z.record(WidgetKeySchema, widgets)),\n\t})\n\n// Factory to create group schema with configurable widget types\nconst createGroupSchema = <TWidgets extends z.ZodMiniType>(widgets: TWidgets) =>\n\tz.object({\n\t\ttype: z.literal(GroupFieldType),\n\t\tfieldset: z.nullish(z.string()),\n\t\ticon: z.optional(z.string()),\n\t\tdescription: z.optional(z.string()),\n\t\tconfig: z.optional(createGroupConfigSchema(widgets)),\n\t})\n\n// NestedGroup - only allows Nestable in fields (no further nesting)\nexport const NestedGroupModelSchema = createGroupSchema(NestableModelSchema)\n\nexport type NestedGroupModel = z.infer<typeof NestedGroupModelSchema>\n\n// Group - allows Nestable | NestedGroup in fields (max 2 levels of nesting)\nexport const GroupModelSchema = createGroupSchema(\n\tz.discriminatedUnion(\"type\", [NestableModelSchema, NestedGroupModelSchema]) as z.ZodMiniType<\n\t\tNestableModel | NestedGroupModel\n\t>,\n)\n\nexport type GroupModel = z.infer<typeof GroupModelSchema>\n"],"mappings":";;;;AAMA,MAAa,iBAAiB;AAG9B,MAAM,2BAA2D,YAChE,EAAE,OAAO;CACR,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC3B,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC9B,QAAQ,EAAE,SAAS,EAAE,OAAO,iBAAiB,OAAO,CAAC;AACtD,CAAC;AAGF,MAAM,qBAAqD,YAC1D,EAAE,OAAO;CACR,MAAM,EAAE,QAAQ,cAAc;CAC9B,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC9B,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;CAC3B,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC;CAClC,QAAQ,EAAE,SAAS,wBAAwB,OAAO,CAAC;AACpD,CAAC;AAGF,MAAa,yBAAyB,kBAAkB,mBAAmB;AAK3E,MAAa,mBAAmB,kBAC/B,EAAE,mBAAmB,QAAQ,CAAC,qBAAqB,sBAAsB,CAAC,CAG3E"}
|
package/dist/model/image.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/model/image.d.ts
|
|
4
3
|
declare const ImageModelSchema: z.ZodMiniObject<{
|
|
5
4
|
type: z.ZodMiniLiteral<"Image">;
|
|
@@ -20,5 +19,5 @@ declare const ImageModelSchema: z.ZodMiniObject<{
|
|
|
20
19
|
}, z.core.$strip>;
|
|
21
20
|
type ImageModel = z.infer<typeof ImageModelSchema>;
|
|
22
21
|
//#endregion
|
|
23
|
-
export { ImageModel };
|
|
22
|
+
export { ImageModel, ImageModelSchema };
|
|
24
23
|
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","names":[],"sources":["../../src/model/image.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.d.ts","names":[],"sources":["../../src/model/image.ts"],"mappings":";;cAkDa,kBAAgB,EAAA;;;;;;;;;;;;;;;;;KAMjB,aAAa,EAAE,aAAa"}
|
package/dist/model/image.js
CHANGED
|
@@ -36,6 +36,6 @@ const ImageModelSchema = z.object({
|
|
|
36
36
|
config: z.optional(ImageConfigSchema)
|
|
37
37
|
});
|
|
38
38
|
//#endregion
|
|
39
|
-
export { ImageConstraintSchema, ImageModelSchema };
|
|
39
|
+
export { ImageConstraintSchema, ImageModelSchema, SideConstraintSchema };
|
|
40
40
|
|
|
41
41
|
//# sourceMappingURL=image.js.map
|
package/dist/model/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","names":[],"sources":["../../src/model/image.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n/**\n * SideConstraint accepts multiple input formats and normalizes to number | null:\n * - Integer values\n * - String integers (e.g., \"100\")\n * - Pixel strings (e.g., \"100px\")\n * - \"auto\" or \"\" → null\n * - null\n */\nexport const SideConstraintSchema: z.ZodMiniType<number | null> = z.union([\n\tz.pipe(\n\t\tz.literal(\"auto\"),\n\t\tz.transform(() => null),\n\t),\n\tz.pipe(\n\t\tz.literal(\"\"),\n\t\tz.transform(() => null),\n\t),\n\tz.null(),\n\tz.pipe(
|
|
1
|
+
{"version":3,"file":"image.js","names":[],"sources":["../../src/model/image.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n/**\n * SideConstraint accepts multiple input formats and normalizes to number | null:\n * - Integer values\n * - String integers (e.g., \"100\")\n * - Pixel strings (e.g., \"100px\")\n * - \"auto\" or \"\" → null\n * - null\n */\nexport const SideConstraintSchema: z.ZodMiniType<number | null> = z.union([\n\tz.pipe(\n\t\tz.literal(\"auto\"),\n\t\tz.transform(() => null),\n\t),\n\tz.pipe(\n\t\tz.literal(\"\"),\n\t\tz.transform(() => null),\n\t),\n\tz.null(),\n\tz.pipe(\n\t\tz.number(),\n\t\tz.transform((n) => Math.round(n)),\n\t),\n\tz.pipe(\n\t\tz.string(),\n\t\tz.transform((s: string) => parseInt(s.replace(\"px\", \"\"), 10)),\n\t),\n])\n\nexport const ImageConstraintSchema = z.object({\n\twidth: z.optional(SideConstraintSchema),\n\theight: z.optional(SideConstraintSchema),\n})\n\nexport type ImageConstraint = z.infer<typeof ImageConstraintSchema>\n\nconst ThumbnailSchema = z.object({\n\tname: z.string(),\n\twidth: z.optional(SideConstraintSchema),\n\theight: z.optional(SideConstraintSchema),\n})\n\nconst ImageConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tconstraint: z.optional(ImageConstraintSchema),\n\tthumbnails: z.optional(z.array(ThumbnailSchema)),\n})\n\nexport const ImageModelSchema = z.object({\n\ttype: z.literal(\"Image\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(ImageConfigSchema),\n})\n\nexport type ImageModel = z.infer<typeof ImageModelSchema>\n"],"mappings":";;;;;;;;;;AAUA,MAAa,uBAAqD,EAAE,MAAM;CACzE,EAAE,KACD,EAAE,QAAQ,MAAM,GAChB,EAAE,gBAAgB,IAAI,CACvB;CACA,EAAE,KACD,EAAE,QAAQ,EAAE,GACZ,EAAE,gBAAgB,IAAI,CACvB;CACA,EAAE,KAAK;CACP,EAAE,KACD,EAAE,OAAO,GACT,EAAE,WAAW,MAAM,KAAK,MAAM,CAAC,CAAC,CACjC;CACA,EAAE,KACD,EAAE,OAAO,GACT,EAAE,WAAW,MAAc,SAAS,EAAE,QAAQ,MAAM,EAAE,GAAG,EAAE,CAAC,CAC7D;AACD,CAAC;AAED,MAAa,wBAAwB,EAAE,OAAO;CAC7C,OAAO,EAAE,SAAS,oBAAoB;CACtC,QAAQ,EAAE,SAAS,oBAAoB;AACxC,CAAC;AAID,MAAM,kBAAkB,EAAE,OAAO;CAChC,MAAM,EAAE,OAAO;CACf,OAAO,EAAE,SAAS,oBAAoB;CACtC,QAAQ,EAAE,SAAS,oBAAoB;AACxC,CAAC;AAED,MAAM,oBAAoB,EAAE,OAAO;CAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC3B,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC;CAClC,YAAY,EAAE,SAAS,qBAAqB;CAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChD,CAAC;AAED,MAAa,mBAAmB,EAAE,OAAO;CACxC,MAAM,EAAE,QAAQ,OAAO;CACvB,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC9B,QAAQ,EAAE,SAAS,iBAAiB;AACrC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/model/integrationField.d.ts
|
|
4
3
|
declare const IntegrationFieldModelSchema: z.ZodMiniObject<{
|
|
5
4
|
type: z.ZodMiniLiteral<"IntegrationFields">;
|
|
@@ -12,5 +11,5 @@ declare const IntegrationFieldModelSchema: z.ZodMiniObject<{
|
|
|
12
11
|
}, z.core.$strip>;
|
|
13
12
|
type IntegrationFieldModel = z.infer<typeof IntegrationFieldModelSchema>;
|
|
14
13
|
//#endregion
|
|
15
|
-
export { IntegrationFieldModel };
|
|
14
|
+
export { IntegrationFieldModel, IntegrationFieldModelSchema };
|
|
16
15
|
//# sourceMappingURL=integrationField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrationField.d.ts","names":[],"sources":["../../src/model/integrationField.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"integrationField.d.ts","names":[],"sources":["../../src/model/integrationField.ts"],"mappings":";;cAQa,6BAA2B,EAAA;;;;;;;;;KAM5B,wBAAwB,EAAE,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrationField.js","names":[],"sources":["../../src/model/integrationField.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst IntegrationFieldConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tcatalog: z.optional(z.string()),\n})\n\nexport const IntegrationFieldModelSchema = z.object({\n\ttype: z.literal(\"IntegrationFields\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(IntegrationFieldConfigSchema),\n})\n\nexport type IntegrationFieldModel = z.infer<typeof IntegrationFieldModelSchema>\n"],"mappings":";;AAEA,MAAM,+BAA+B,EAAE,OAAO;CAC7C,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"integrationField.js","names":[],"sources":["../../src/model/integrationField.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nconst IntegrationFieldConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tplaceholder: z.optional(z.string()),\n\tcatalog: z.optional(z.string()),\n})\n\nexport const IntegrationFieldModelSchema = z.object({\n\ttype: z.literal(\"IntegrationFields\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(IntegrationFieldConfigSchema),\n})\n\nexport type IntegrationFieldModel = z.infer<typeof IntegrationFieldModelSchema>\n"],"mappings":";;AAEA,MAAM,+BAA+B,EAAE,OAAO;CAC7C,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC3B,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC;CAClC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;AAC/B,CAAC;AAED,MAAa,8BAA8B,EAAE,OAAO;CACnD,MAAM,EAAE,QAAQ,mBAAmB;CACnC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC9B,QAAQ,EAAE,SAAS,4BAA4B;AAChD,CAAC"}
|
package/dist/model/link.d.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/model/link.d.ts
|
|
3
|
+
declare const CustomTypesModelSchema: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
4
|
+
id: z.ZodMiniString<string>;
|
|
5
|
+
fields: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
6
|
+
id: z.ZodMiniString<string>;
|
|
7
|
+
fields: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
8
|
+
id: z.ZodMiniString<string>;
|
|
9
|
+
customtypes: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
10
|
+
id: z.ZodMiniString<string>;
|
|
11
|
+
fields: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
12
|
+
id: z.ZodMiniString<string>;
|
|
13
|
+
fields: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
14
|
+
}, z.core.$strip>, z.ZodMiniString<string>]>>;
|
|
15
|
+
}, z.core.$strip>]>>;
|
|
16
|
+
}, z.core.$strip>, z.ZodMiniString<string>]>>;
|
|
17
|
+
}, z.core.$strip>, z.ZodMiniObject<{
|
|
18
|
+
id: z.ZodMiniString<string>;
|
|
19
|
+
customtypes: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
20
|
+
id: z.ZodMiniString<string>;
|
|
21
|
+
fields: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
22
|
+
id: z.ZodMiniString<string>;
|
|
23
|
+
fields: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
24
|
+
}, z.core.$strip>, z.ZodMiniString<string>]>>;
|
|
25
|
+
}, z.core.$strip>]>>;
|
|
26
|
+
}, z.core.$strip>, z.ZodMiniString<string>]>>;
|
|
27
|
+
}, z.core.$strip>]>>;
|
|
28
|
+
type CustomTypesModel = z.infer<typeof CustomTypesModelSchema>;
|
|
4
29
|
declare const LinkModelSchema: z.ZodMiniObject<{
|
|
5
30
|
type: z.ZodMiniLiteral<"Link">;
|
|
6
31
|
fieldset: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
@@ -8,7 +33,7 @@ declare const LinkModelSchema: z.ZodMiniObject<{
|
|
|
8
33
|
label: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
9
34
|
useAsTitle: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
10
35
|
placeholder: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
11
|
-
select: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnknown, z.ZodMiniTransform<"
|
|
36
|
+
select: z.ZodMiniOptional<z.ZodMiniPipe<z.ZodMiniUnknown, z.ZodMiniTransform<"document" | "media" | "web" | null, unknown>>>;
|
|
12
37
|
customtypes: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
13
38
|
id: z.ZodMiniString<string>;
|
|
14
39
|
fields: z.ZodMiniArray<z.ZodMiniUnion<readonly [z.ZodMiniObject<{
|
|
@@ -44,5 +69,5 @@ declare const LinkModelSchema: z.ZodMiniObject<{
|
|
|
44
69
|
}, z.core.$strip>;
|
|
45
70
|
type LinkModel = z.infer<typeof LinkModelSchema>;
|
|
46
71
|
//#endregion
|
|
47
|
-
export { LinkModel };
|
|
72
|
+
export { CustomTypesModel, CustomTypesModelSchema, LinkModel, LinkModelSchema };
|
|
48
73
|
//# sourceMappingURL=link.d.ts.map
|
package/dist/model/link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","names":[],"sources":["../../src/model/link.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.d.ts","names":[],"sources":["../../src/model/link.ts"],"mappings":";;cA6Ea,wBAAsB,EAAA,aAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;KA6BvB,mBAAmB,EAAE,aAAa;cA8BjC,iBAAe,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMhB,YAAY,EAAE,aAAa"}
|
package/dist/model/link.js
CHANGED
|
@@ -36,7 +36,7 @@ const CustomTypeLevel1Schema = z.union([z.string(), z.object({
|
|
|
36
36
|
id: z.string(),
|
|
37
37
|
fields: CustomTypeLevel1FieldsSchema
|
|
38
38
|
})]);
|
|
39
|
-
const
|
|
39
|
+
const CustomTypesModelSchema = z.array(CustomTypeLevel1Schema).check(({ value, issues }) => {
|
|
40
40
|
const cts = value;
|
|
41
41
|
const push = (message) => issues.push({
|
|
42
42
|
code: "custom",
|
|
@@ -75,7 +75,7 @@ const LinkConfigSchema = z.object({
|
|
|
75
75
|
useAsTitle: z.optional(z.boolean()),
|
|
76
76
|
placeholder: z.optional(z.string()),
|
|
77
77
|
select: z.optional(SelectWithFallbackSchema),
|
|
78
|
-
customtypes: z.optional(
|
|
78
|
+
customtypes: z.optional(CustomTypesModelSchema),
|
|
79
79
|
masks: z.optional(MasksArrayStringSchema),
|
|
80
80
|
tags: z.optional(MasksArrayStringSchema),
|
|
81
81
|
allowTargetBlank: z.optional(z.boolean()),
|
|
@@ -89,6 +89,6 @@ const LinkModelSchema = z.object({
|
|
|
89
89
|
config: z.optional(LinkConfigSchema)
|
|
90
90
|
});
|
|
91
91
|
//#endregion
|
|
92
|
-
export { LinkModelSchema };
|
|
92
|
+
export { CustomTypesModelSchema, LinkModelSchema };
|
|
93
93
|
|
|
94
94
|
//# sourceMappingURL=link.js.map
|