@isardsat/editorial-common 6.18.1 → 6.18.2
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/CHANGELOG.md +6 -0
- package/dist/data-utils.d.ts +2 -2
- package/dist/data-utils.js +4 -4
- package/dist/schemas.d.ts +9 -9
- package/dist/schemas.js +3 -3
- package/package.json +1 -1
- package/src/data-utils.ts +5 -5
- package/src/schemas.ts +3 -3
package/CHANGELOG.md
CHANGED
package/dist/data-utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Checks if the
|
|
2
|
+
* Checks if the choicesFixed value is a reference to another field.
|
|
3
3
|
* References are in the format $key_field
|
|
4
4
|
*/
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function getChoicesReference(choices: string[] | undefined): string | null;
|
package/dist/data-utils.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Checks if the
|
|
2
|
+
* Checks if the choicesFixed value is a reference to another field.
|
|
3
3
|
* References are in the format $key_field
|
|
4
4
|
*/
|
|
5
|
-
export function
|
|
6
|
-
if (!
|
|
5
|
+
export function getChoicesReference(choices) {
|
|
6
|
+
if (!choices || choices.length !== 1)
|
|
7
7
|
return null;
|
|
8
|
-
const match =
|
|
8
|
+
const match = choices[0].match(/^\$(.+)$/);
|
|
9
9
|
return match ? match[1] : null;
|
|
10
10
|
}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -71,9 +71,9 @@ export declare const EditorialSchemaItemFieldSchema: z.ZodObject<{
|
|
|
71
71
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
72
72
|
optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
73
73
|
showInSummary: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
choicesFixed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
maxSelectedChoices: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
minSelectedChoices: z.ZodOptional<z.ZodNumber>;
|
|
77
77
|
isUploadedFile: z.ZodOptional<z.ZodBoolean>;
|
|
78
78
|
}, z.core.$loose>;
|
|
79
79
|
export declare const EditorialSchemaItemSchema: z.ZodObject<{
|
|
@@ -98,9 +98,9 @@ export declare const EditorialSchemaItemSchema: z.ZodObject<{
|
|
|
98
98
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
99
99
|
optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
100
100
|
showInSummary: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
choicesFixed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
maxSelectedChoices: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
minSelectedChoices: z.ZodOptional<z.ZodNumber>;
|
|
104
104
|
isUploadedFile: z.ZodOptional<z.ZodBoolean>;
|
|
105
105
|
}, z.core.$loose>>;
|
|
106
106
|
}, z.core.$strip>;
|
|
@@ -126,9 +126,9 @@ export declare const EditorialSchemaSchema: z.ZodRecord<z.ZodString, z.ZodObject
|
|
|
126
126
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
127
127
|
optional: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
128
128
|
showInSummary: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
choicesFixed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
130
|
+
maxSelectedChoices: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
minSelectedChoices: z.ZodOptional<z.ZodNumber>;
|
|
132
132
|
isUploadedFile: z.ZodOptional<z.ZodBoolean>;
|
|
133
133
|
}, z.core.$loose>>;
|
|
134
134
|
}, z.core.$strip>>;
|
package/dist/schemas.js
CHANGED
|
@@ -67,9 +67,9 @@ export const EditorialSchemaItemFieldSchema = z.looseObject({
|
|
|
67
67
|
placeholder: z.string().optional(),
|
|
68
68
|
optional: z.boolean().optional().default(false),
|
|
69
69
|
showInSummary: z.boolean().optional(),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
choicesFixed: z.array(z.string()).optional(),
|
|
71
|
+
maxSelectedChoices: z.number().optional(),
|
|
72
|
+
minSelectedChoices: z.number().optional(),
|
|
73
73
|
isUploadedFile: z.boolean().optional(),
|
|
74
74
|
});
|
|
75
75
|
export const EditorialSchemaItemSchema = z.object({
|
package/package.json
CHANGED
package/src/data-utils.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Checks if the
|
|
2
|
+
* Checks if the choicesFixed value is a reference to another field.
|
|
3
3
|
* References are in the format $key_field
|
|
4
4
|
*/
|
|
5
|
-
export function
|
|
6
|
-
|
|
5
|
+
export function getChoicesReference(
|
|
6
|
+
choices: string[] | undefined,
|
|
7
7
|
): string | null {
|
|
8
|
-
if (!
|
|
8
|
+
if (!choices || choices.length !== 1) return null;
|
|
9
9
|
|
|
10
|
-
const match =
|
|
10
|
+
const match = choices[0].match(/^\$(.+)$/);
|
|
11
11
|
return match ? match[1] : null;
|
|
12
12
|
}
|
package/src/schemas.ts
CHANGED
|
@@ -87,9 +87,9 @@ export const EditorialSchemaItemFieldSchema = z.looseObject({
|
|
|
87
87
|
placeholder: z.string().optional(),
|
|
88
88
|
optional: z.boolean().optional().default(false),
|
|
89
89
|
showInSummary: z.boolean().optional(),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
choicesFixed: z.array(z.string()).optional(),
|
|
91
|
+
maxSelectedChoices: z.number().optional(),
|
|
92
|
+
minSelectedChoices: z.number().optional(),
|
|
93
93
|
isUploadedFile: z.boolean().optional(),
|
|
94
94
|
});
|
|
95
95
|
|