@prismicio/types-internal 4.6.0 → 4.7.0-canary.af0f4e3
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 +9 -6
- 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 +7 -8
- 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/group.ts +1 -1
- 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;
|
|
@@ -270,7 +269,7 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
270
269
|
label?: string | null | undefined;
|
|
271
270
|
useAsTitle?: boolean | undefined;
|
|
272
271
|
placeholder?: string | undefined;
|
|
273
|
-
select?: "
|
|
272
|
+
select?: "document" | "media" | "web" | null | undefined;
|
|
274
273
|
customtypes?: (string | {
|
|
275
274
|
id: string;
|
|
276
275
|
fields: (string | {
|
|
@@ -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;
|
|
@@ -452,7 +451,7 @@ declare const GroupModelSchema: z.ZodMiniObject<{
|
|
|
452
451
|
label?: string | null | undefined;
|
|
453
452
|
useAsTitle?: boolean | undefined;
|
|
454
453
|
placeholder?: string | undefined;
|
|
455
|
-
select?: "
|
|
454
|
+
select?: "document" | "media" | "web" | null | undefined;
|
|
456
455
|
customtypes?: (string | {
|
|
457
456
|
id: string;
|
|
458
457
|
fields: (string | {
|
|
@@ -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 LinkConfigCustomtypesSchema: 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 LinkConfigCustomtypes = z.infer<typeof LinkConfigCustomtypesSchema>;
|
|
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 { LinkConfigCustomtypes, LinkConfigCustomtypesSchema, 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,6BAA2B,EAAA,aAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;KA6B5B,wBAAwB,EAAE,aAAa;cA8BtC,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 LinkConfigCustomtypesSchema = 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(LinkConfigCustomtypesSchema),
|
|
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 { LinkConfigCustomtypesSchema, LinkModelSchema };
|
|
93
93
|
|
|
94
94
|
//# sourceMappingURL=link.js.map
|
package/dist/model/link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","names":[],"sources":["../../src/model/link.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n// Accepts string | string[], normalizes string to [string]\nconst MasksArrayStringSchema = z.pipe(\n\tz.union([z.array(z.string()), z.string()]),\n\tz.transform((val): string[] => (typeof val === \"string\" ? [val] : val)),\n)\n\n// --- CustomTypes hierarchy (field selection in content relationship fields) ---\n\n// Level 2\n\nconst noDuplicateStrings = z.refine(\n\t(arr) => new Set(arr as string[]).size === (arr as string[]).length,\n\t\"Fields have duplicates.\",\n)\n\nconst CustomTypeLevel2FieldGroupFieldsSchema = z.array(z.string()).check(noDuplicateStrings)\n\nconst CustomTypeLevel2FieldSchema = z.union([\n\tz.object({ id: z.string(), fields: CustomTypeLevel2FieldGroupFieldsSchema }),\n\tz.string(),\n])\n\nconst noDuplicateIds = (items: unknown) => {\n\tconst arr = items as { id: string }[] | string[]\n\tconst ids = new Set(arr.map((item) => (typeof item === \"string\" ? item : item.id)))\n\treturn ids.size === arr.length\n}\n\nconst CustomTypeLevel2FieldsSchema = z\n\t.array(CustomTypeLevel2FieldSchema)\n\t.check(z.refine(noDuplicateIds, \"Fields have duplicates.\"))\n\nconst CustomTypeLevel2Schema = z.union([\n\tz.string(),\n\tz.object({ id: z.string(), fields: CustomTypeLevel2FieldsSchema }),\n])\n\nconst CustomTypesLevel2Schema = z\n\t.array(CustomTypeLevel2Schema)\n\t.check(z.refine(noDuplicateIds, \"Custom types have duplicates.\"))\n\n// Level 1\n\nconst CustomTypeLevel1FieldCustomTypesSchema = z.object({\n\tid: z.string(),\n\tcustomtypes: CustomTypesLevel2Schema,\n})\n\nconst CustomTypeLevel1FieldGroupFieldSchema = z.union([\n\tCustomTypeLevel1FieldCustomTypesSchema,\n\tz.string(),\n])\n\nconst CustomTypeLevel1FieldGroupFieldsSchema = z\n\t.array(CustomTypeLevel1FieldGroupFieldSchema)\n\t.check(z.refine(noDuplicateIds, \"Fields have duplicates.\"))\n\nconst CustomTypeLevel1FieldSchema = z.union([\n\tz.object({\n\t\tid: z.string(),\n\t\tfields: CustomTypeLevel1FieldGroupFieldsSchema,\n\t}),\n\tCustomTypeLevel1FieldCustomTypesSchema,\n\tz.string(),\n])\n\nconst CustomTypeLevel1FieldsSchema = z\n\t.array(CustomTypeLevel1FieldSchema)\n\t.check(z.refine(noDuplicateIds, \"Fields have duplicates.\"))\n\nconst CustomTypeLevel1Schema = z.union([\n\tz.string(),\n\tz.object({ id: z.string(), fields: CustomTypeLevel1FieldsSchema }),\n])\n\
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../src/model/link.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\n// Accepts string | string[], normalizes string to [string]\nconst MasksArrayStringSchema = z.pipe(\n\tz.union([z.array(z.string()), z.string()]),\n\tz.transform((val): string[] => (typeof val === \"string\" ? [val] : val)),\n)\n\n// --- CustomTypes hierarchy (field selection in content relationship fields) ---\n\n// Level 2\n\nconst noDuplicateStrings = z.refine(\n\t(arr) => new Set(arr as string[]).size === (arr as string[]).length,\n\t\"Fields have duplicates.\",\n)\n\nconst CustomTypeLevel2FieldGroupFieldsSchema = z.array(z.string()).check(noDuplicateStrings)\n\nconst CustomTypeLevel2FieldSchema = z.union([\n\tz.object({ id: z.string(), fields: CustomTypeLevel2FieldGroupFieldsSchema }),\n\tz.string(),\n])\n\nconst noDuplicateIds = (items: unknown) => {\n\tconst arr = items as { id: string }[] | string[]\n\tconst ids = new Set(arr.map((item) => (typeof item === \"string\" ? item : item.id)))\n\treturn ids.size === arr.length\n}\n\nconst CustomTypeLevel2FieldsSchema = z\n\t.array(CustomTypeLevel2FieldSchema)\n\t.check(z.refine(noDuplicateIds, \"Fields have duplicates.\"))\n\nconst CustomTypeLevel2Schema = z.union([\n\tz.string(),\n\tz.object({ id: z.string(), fields: CustomTypeLevel2FieldsSchema }),\n])\n\nconst CustomTypesLevel2Schema = z\n\t.array(CustomTypeLevel2Schema)\n\t.check(z.refine(noDuplicateIds, \"Custom types have duplicates.\"))\n\n// Level 1\n\nconst CustomTypeLevel1FieldCustomTypesSchema = z.object({\n\tid: z.string(),\n\tcustomtypes: CustomTypesLevel2Schema,\n})\n\nconst CustomTypeLevel1FieldGroupFieldSchema = z.union([\n\tCustomTypeLevel1FieldCustomTypesSchema,\n\tz.string(),\n])\n\nconst CustomTypeLevel1FieldGroupFieldsSchema = z\n\t.array(CustomTypeLevel1FieldGroupFieldSchema)\n\t.check(z.refine(noDuplicateIds, \"Fields have duplicates.\"))\n\nconst CustomTypeLevel1FieldSchema = z.union([\n\tz.object({\n\t\tid: z.string(),\n\t\tfields: CustomTypeLevel1FieldGroupFieldsSchema,\n\t}),\n\tCustomTypeLevel1FieldCustomTypesSchema,\n\tz.string(),\n])\n\nconst CustomTypeLevel1FieldsSchema = z\n\t.array(CustomTypeLevel1FieldSchema)\n\t.check(z.refine(noDuplicateIds, \"Fields have duplicates.\"))\n\nconst CustomTypeLevel1Schema = z.union([\n\tz.string(),\n\tz.object({ id: z.string(), fields: CustomTypeLevel1FieldsSchema }),\n])\n\nexport const LinkConfigCustomtypesSchema = z.array(CustomTypeLevel1Schema).check(({ value, issues }) => {\n\tconst cts = value as ({ id: string } | string)[]\n\tconst push = (message: string) => issues.push({ code: \"custom\", input: value, message })\n\tconst strings = new Set<string>()\n\tconst objects = new Set<string>()\n\tfor (const ct of cts) {\n\t\tlet failed = false\n\t\tif (typeof ct === \"string\") {\n\t\t\tfailed = objects.has(ct)\n\t\t\tstrings.add(ct)\n\t\t} else {\n\t\t\tconst { id } = ct\n\t\t\tfailed = strings.has(id) || objects.has(id)\n\t\t\tobjects.add(id)\n\t\t}\n\t\tif (failed) {\n\t\t\tpush(\"Custom types have duplicates.\")\n\t\t\treturn\n\t\t}\n\t}\n\tif (objects.size > 1) {\n\t\tpush(\"Cannot have multiple custom types with fields selection.\")\n\t\treturn\n\t}\n\tif (strings.size > 0 && objects.size > 0) {\n\t\tpush(\"Cannot mix custom types as strings and objects with fields.\")\n\t}\n})\n\nexport type LinkConfigCustomtypes = z.infer<typeof LinkConfigCustomtypesSchema>\n\n// --- Select with fallback to null ---\n\nconst SelectWithFallbackSchema = z.pipe(\n\tz.unknown(),\n\tz.transform((val): \"media\" | \"document\" | \"web\" | null => {\n\t\tif (val === \"media\" || val === \"document\" || val === \"web\" || val === null) {\n\t\t\treturn val\n\t\t}\n\t\treturn null\n\t}),\n)\n\n// --- LinkConfig and Link ---\n\nconst LinkConfigSchema = z.object({\n\tlabel: z.nullish(z.string()),\n\tuseAsTitle: z.optional(z.boolean()),\n\tplaceholder: z.optional(z.string()),\n\tselect: z.optional(SelectWithFallbackSchema),\n\tcustomtypes: z.optional(LinkConfigCustomtypesSchema),\n\tmasks: z.optional(MasksArrayStringSchema),\n\ttags: z.optional(MasksArrayStringSchema),\n\tallowTargetBlank: z.optional(z.boolean()),\n\tallowText: z.optional(z.boolean()),\n\trepeat: z.optional(z.boolean()),\n\tvariants: z.optional(z.array(z.string())),\n})\n\nexport const LinkModelSchema = z.object({\n\ttype: z.literal(\"Link\"),\n\tfieldset: z.nullish(z.string()),\n\tconfig: z.optional(LinkConfigSchema),\n})\n\nexport type LinkModel = z.infer<typeof LinkModelSchema>\n"],"mappings":";;AAGA,MAAM,yBAAyB,EAAE,KAChC,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,GACzC,EAAE,WAAW,QAAmB,OAAO,QAAQ,WAAW,CAAC,GAAG,IAAI,GAAI,CACvE;AAMA,MAAM,qBAAqB,EAAE,QAC3B,QAAQ,IAAI,IAAI,GAAe,CAAC,CAAC,SAAU,IAAiB,QAC7D,yBACD;AAEA,MAAM,yCAAyC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,kBAAkB;AAE3F,MAAM,8BAA8B,EAAE,MAAM,CAC3C,EAAE,OAAO;CAAE,IAAI,EAAE,OAAO;CAAG,QAAQ;AAAuC,CAAC,GAC3E,EAAE,OAAO,CACV,CAAC;AAED,MAAM,kBAAkB,UAAmB;CAC1C,MAAM,MAAM;CAEZ,OAAO,IADS,IAAI,IAAI,KAAK,SAAU,OAAO,SAAS,WAAW,OAAO,KAAK,EAAG,CACxE,CAAC,CAAC,SAAS,IAAI;AACzB;AAEA,MAAM,+BAA+B,EACnC,MAAM,2BAA2B,CAAC,CAClC,MAAM,EAAE,OAAO,gBAAgB,yBAAyB,CAAC;AAE3D,MAAM,yBAAyB,EAAE,MAAM,CACtC,EAAE,OAAO,GACT,EAAE,OAAO;CAAE,IAAI,EAAE,OAAO;CAAG,QAAQ;AAA6B,CAAC,CAClE,CAAC;AAED,MAAM,0BAA0B,EAC9B,MAAM,sBAAsB,CAAC,CAC7B,MAAM,EAAE,OAAO,gBAAgB,+BAA+B,CAAC;AAIjE,MAAM,yCAAyC,EAAE,OAAO;CACvD,IAAI,EAAE,OAAO;CACb,aAAa;AACd,CAAC;AAED,MAAM,wCAAwC,EAAE,MAAM,CACrD,wCACA,EAAE,OAAO,CACV,CAAC;AAED,MAAM,yCAAyC,EAC7C,MAAM,qCAAqC,CAAC,CAC5C,MAAM,EAAE,OAAO,gBAAgB,yBAAyB,CAAC;AAE3D,MAAM,8BAA8B,EAAE,MAAM;CAC3C,EAAE,OAAO;EACR,IAAI,EAAE,OAAO;EACb,QAAQ;CACT,CAAC;CACD;CACA,EAAE,OAAO;AACV,CAAC;AAED,MAAM,+BAA+B,EACnC,MAAM,2BAA2B,CAAC,CAClC,MAAM,EAAE,OAAO,gBAAgB,yBAAyB,CAAC;AAE3D,MAAM,yBAAyB,EAAE,MAAM,CACtC,EAAE,OAAO,GACT,EAAE,OAAO;CAAE,IAAI,EAAE,OAAO;CAAG,QAAQ;AAA6B,CAAC,CAClE,CAAC;AAED,MAAa,8BAA8B,EAAE,MAAM,sBAAsB,CAAC,CAAC,OAAO,EAAE,OAAO,aAAa;CACvG,MAAM,MAAM;CACZ,MAAM,QAAQ,YAAoB,OAAO,KAAK;EAAE,MAAM;EAAU,OAAO;EAAO;CAAQ,CAAC;CACvF,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,0BAAU,IAAI,IAAY;CAChC,KAAK,MAAM,MAAM,KAAK;EACrB,IAAI,SAAS;EACb,IAAI,OAAO,OAAO,UAAU;GAC3B,SAAS,QAAQ,IAAI,EAAE;GACvB,QAAQ,IAAI,EAAE;EACf,OAAO;GACN,MAAM,EAAE,OAAO;GACf,SAAS,QAAQ,IAAI,EAAE,KAAK,QAAQ,IAAI,EAAE;GAC1C,QAAQ,IAAI,EAAE;EACf;EACA,IAAI,QAAQ;GACX,KAAK,+BAA+B;GACpC;EACD;CACD;CACA,IAAI,QAAQ,OAAO,GAAG;EACrB,KAAK,0DAA0D;EAC/D;CACD;CACA,IAAI,QAAQ,OAAO,KAAK,QAAQ,OAAO,GACtC,KAAK,6DAA6D;AAEpE,CAAC;AAMD,MAAM,2BAA2B,EAAE,KAClC,EAAE,QAAQ,GACV,EAAE,WAAW,QAA6C;CACzD,IAAI,QAAQ,WAAW,QAAQ,cAAc,QAAQ,SAAS,QAAQ,MACrE,OAAO;CAER,OAAO;AACR,CAAC,CACF;AAIA,MAAM,mBAAmB,EAAE,OAAO;CACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC3B,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC;CAClC,aAAa,EAAE,SAAS,EAAE,OAAO,CAAC;CAClC,QAAQ,EAAE,SAAS,wBAAwB;CAC3C,aAAa,EAAE,SAAS,2BAA2B;CACnD,OAAO,EAAE,SAAS,sBAAsB;CACxC,MAAM,EAAE,SAAS,sBAAsB;CACvC,kBAAkB,EAAE,SAAS,EAAE,QAAQ,CAAC;CACxC,WAAW,EAAE,SAAS,EAAE,QAAQ,CAAC;CACjC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC9B,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAa,kBAAkB,EAAE,OAAO;CACvC,MAAM,EAAE,QAAQ,MAAM;CACtB,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;CAC9B,QAAQ,EAAE,SAAS,gBAAgB;AACpC,CAAC"}
|
package/dist/model/nestable.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ import { TableModel } from "./table.js";
|
|
|
15
15
|
import { TextModel } from "./text.js";
|
|
16
16
|
import { TimestampModel } from "./timestamp.js";
|
|
17
17
|
import { z } from "zod/mini";
|
|
18
|
-
|
|
19
18
|
//#region src/model/nestable.d.ts
|
|
20
19
|
type NestableModel = BooleanModel | ColorModel | DateModel | EmbedModel | GeoPointModel | ImageModel | IntegrationFieldModel | LinkModel | NumberModel | RangeModel | RichTextModel | SelectModel | SeparatorModel | TableModel | TextModel | TimestampModel;
|
|
21
20
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestable.d.ts","names":[],"sources":["../../src/model/nestable.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nestable.d.ts","names":[],"sources":["../../src/model/nestable.ts"],"mappings":";;;;;;;;;;;;;;;;;;KAsDY,gBACT,eACA,aACA,YACA,aACA,gBACA,aACA,wBACA,YACA,cACA,aACA,gBACA,cACA,iBACA,aACA,YACA"}
|
package/dist/model/nestable.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ImageModelSchema } from "./image.js";
|
|
2
|
-
import { RichTextModelSchema } from "./richText.js";
|
|
3
|
-
import { TableModelSchema } from "./table.js";
|
|
4
1
|
import { BooleanModelSchema } from "./boolean.js";
|
|
5
2
|
import { ColorModelSchema } from "./color.js";
|
|
6
3
|
import { DateModelSchema } from "./date.js";
|
|
7
4
|
import { EmbedModelSchema } from "./embed.js";
|
|
8
5
|
import { GeoPointModelSchema } from "./geopoint.js";
|
|
6
|
+
import { ImageModelSchema } from "./image.js";
|
|
9
7
|
import { IntegrationFieldModelSchema } from "./integrationField.js";
|
|
10
8
|
import { LinkModelSchema } from "./link.js";
|
|
11
9
|
import { NumberModelSchema } from "./number.js";
|
|
12
10
|
import { RangeModelSchema } from "./range.js";
|
|
11
|
+
import { RichTextModelSchema } from "./richText.js";
|
|
13
12
|
import { SelectModelSchema } from "./select.js";
|
|
14
13
|
import { SeparatorModelSchema } from "./separator.js";
|
|
14
|
+
import { TableModelSchema } from "./table.js";
|
|
15
15
|
import { TextModelSchema } from "./text.js";
|
|
16
16
|
import { TimestampModelSchema } from "./timestamp.js";
|
|
17
17
|
import { z } from "zod/mini";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestable.js","names":[],"sources":["../../src/model/nestable.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport type { BooleanModel } from \"./boolean\"\nimport { BooleanModelSchema } from \"./boolean\"\nimport type { ColorModel } from \"./color\"\nimport { ColorModelSchema } from \"./color\"\nimport type { DateModel } from \"./date\"\nimport { DateModelSchema } from \"./date\"\nimport type { EmbedModel } from \"./embed\"\nimport { EmbedModelSchema } from \"./embed\"\nimport type { GeoPointModel } from \"./geopoint\"\nimport { GeoPointModelSchema } from \"./geopoint\"\nimport type { ImageModel } from \"./image\"\nimport { ImageModelSchema } from \"./image\"\nimport type { IntegrationFieldModel } from \"./integrationField\"\nimport { IntegrationFieldModelSchema } from \"./integrationField\"\nimport type { LinkModel } from \"./link\"\nimport { LinkModelSchema } from \"./link\"\nimport type { NumberModel } from \"./number\"\nimport { NumberModelSchema } from \"./number\"\nimport type { RangeModel } from \"./range\"\nimport { RangeModelSchema } from \"./range\"\nimport type { RichTextModel } from \"./richText\"\nimport { RichTextModelSchema } from \"./richText\"\nimport type { SelectModel } from \"./select\"\nimport { SelectModelSchema } from \"./select\"\nimport type { SeparatorModel } from \"./separator\"\nimport { SeparatorModelSchema } from \"./separator\"\nimport type { TableModel } from \"./table\"\nimport { TableModelSchema } from \"./table\"\nimport type { TextModel } from \"./text\"\nimport { TextModelSchema } from \"./text\"\nimport type { TimestampModel } from \"./timestamp\"\nimport { TimestampModelSchema } from \"./timestamp\"\n\nexport const NestableModelSchema = z.discriminatedUnion(\"type\", [\n\tBooleanModelSchema,\n\tColorModelSchema,\n\tDateModelSchema,\n\tEmbedModelSchema,\n\tGeoPointModelSchema,\n\tImageModelSchema,\n\tIntegrationFieldModelSchema,\n\tLinkModelSchema,\n\tNumberModelSchema,\n\tRangeModelSchema,\n\tRichTextModelSchema,\n\tSelectModelSchema,\n\tSeparatorModelSchema,\n\tTableModelSchema,\n\tTextModelSchema,\n\tTimestampModelSchema,\n])\n\nexport type NestableModel =\n\t| BooleanModel\n\t| ColorModel\n\t| DateModel\n\t| EmbedModel\n\t| GeoPointModel\n\t| ImageModel\n\t| IntegrationFieldModel\n\t| LinkModel\n\t| NumberModel\n\t| RangeModel\n\t| RichTextModel\n\t| SelectModel\n\t| SeparatorModel\n\t| TableModel\n\t| TextModel\n\t| TimestampModel\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,MAAa,sBAAsB,EAAE,mBAAmB,QAAQ;CAC/D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"nestable.js","names":[],"sources":["../../src/model/nestable.ts"],"sourcesContent":["import { z } from \"zod/mini\"\n\nimport type { BooleanModel } from \"./boolean\"\nimport { BooleanModelSchema } from \"./boolean\"\nimport type { ColorModel } from \"./color\"\nimport { ColorModelSchema } from \"./color\"\nimport type { DateModel } from \"./date\"\nimport { DateModelSchema } from \"./date\"\nimport type { EmbedModel } from \"./embed\"\nimport { EmbedModelSchema } from \"./embed\"\nimport type { GeoPointModel } from \"./geopoint\"\nimport { GeoPointModelSchema } from \"./geopoint\"\nimport type { ImageModel } from \"./image\"\nimport { ImageModelSchema } from \"./image\"\nimport type { IntegrationFieldModel } from \"./integrationField\"\nimport { IntegrationFieldModelSchema } from \"./integrationField\"\nimport type { LinkModel } from \"./link\"\nimport { LinkModelSchema } from \"./link\"\nimport type { NumberModel } from \"./number\"\nimport { NumberModelSchema } from \"./number\"\nimport type { RangeModel } from \"./range\"\nimport { RangeModelSchema } from \"./range\"\nimport type { RichTextModel } from \"./richText\"\nimport { RichTextModelSchema } from \"./richText\"\nimport type { SelectModel } from \"./select\"\nimport { SelectModelSchema } from \"./select\"\nimport type { SeparatorModel } from \"./separator\"\nimport { SeparatorModelSchema } from \"./separator\"\nimport type { TableModel } from \"./table\"\nimport { TableModelSchema } from \"./table\"\nimport type { TextModel } from \"./text\"\nimport { TextModelSchema } from \"./text\"\nimport type { TimestampModel } from \"./timestamp\"\nimport { TimestampModelSchema } from \"./timestamp\"\n\nexport const NestableModelSchema = z.discriminatedUnion(\"type\", [\n\tBooleanModelSchema,\n\tColorModelSchema,\n\tDateModelSchema,\n\tEmbedModelSchema,\n\tGeoPointModelSchema,\n\tImageModelSchema,\n\tIntegrationFieldModelSchema,\n\tLinkModelSchema,\n\tNumberModelSchema,\n\tRangeModelSchema,\n\tRichTextModelSchema,\n\tSelectModelSchema,\n\tSeparatorModelSchema,\n\tTableModelSchema,\n\tTextModelSchema,\n\tTimestampModelSchema,\n])\n\nexport type NestableModel =\n\t| BooleanModel\n\t| ColorModel\n\t| DateModel\n\t| EmbedModel\n\t| GeoPointModel\n\t| ImageModel\n\t| IntegrationFieldModel\n\t| LinkModel\n\t| NumberModel\n\t| RangeModel\n\t| RichTextModel\n\t| SelectModel\n\t| SeparatorModel\n\t| TableModel\n\t| TextModel\n\t| TimestampModel\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,MAAa,sBAAsB,EAAE,mBAAmB,QAAQ;CAC/D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC"}
|
package/dist/model/number.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod/mini";
|
|
2
|
-
|
|
3
2
|
//#region src/model/number.d.ts
|
|
4
3
|
declare const NumberModelSchema: z.ZodMiniObject<{
|
|
5
4
|
type: z.ZodMiniLiteral<"Number">;
|
|
@@ -14,5 +13,5 @@ declare const NumberModelSchema: z.ZodMiniObject<{
|
|
|
14
13
|
}, z.core.$strip>;
|
|
15
14
|
type NumberModel = z.infer<typeof NumberModelSchema>;
|
|
16
15
|
//#endregion
|
|
17
|
-
export { NumberModel };
|
|
16
|
+
export { NumberModel, NumberModelSchema };
|
|
18
17
|
//# sourceMappingURL=number.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.d.ts","names":[],"sources":["../../src/model/number.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"number.d.ts","names":[],"sources":["../../src/model/number.ts"],"mappings":";;cAmBa,mBAAiB,EAAA;;;;;;;;;;;KAMlB,cAAc,EAAE,aAAa"}
|