@cloudcannon/configuration-types 0.0.52 → 0.0.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcannon/configuration-types",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "type": "module",
5
5
  "description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
6
6
  "author": "CloudCannon <support@cloudcannon.com>",
@@ -45,12 +45,12 @@
45
45
  "dist/**/*"
46
46
  ],
47
47
  "dependencies": {
48
- "zod": "^4.1.13"
48
+ "zod": "^4.3.6"
49
49
  },
50
50
  "devDependencies": {
51
- "@biomejs/biome": "2.3.8",
51
+ "@biomejs/biome": "2.4.6",
52
52
  "@types/js-yaml": "^4.0.9",
53
- "@types/node": "^24.10.1",
53
+ "@types/node": "^25.4.0",
54
54
  "http-server": "^14.1.1",
55
55
  "js-yaml": "^4.1.1",
56
56
  "tsx": "^4.21.0",
package/src/inputs.ts CHANGED
@@ -90,6 +90,51 @@ const TextValidationSchema = z.object({
90
90
  description:
91
91
  'This key defines the message that explains which minimum string length an Input will accept. This key requires you to define `options.min_length`.',
92
92
  }),
93
+ max_words: z.number().optional().meta({
94
+ id: 'type._inputs.*.options.max_words',
95
+ description:
96
+ 'This key defines the maximum string length, in words, that CloudCannon will allow in an Input. When configured, CloudCannon will warn you when an Input value is too long. If the Input already contains a longer value, CloudCannon will require you to remove characters until the Input contains a valid string to save your changes, or discard your unsaved changes.',
97
+ }),
98
+ max_words_message: z.string().optional().meta({
99
+ id: 'type._inputs.*.options.max_words_message',
100
+ description:
101
+ 'This key defines the message that explains which maximum string length an Input will accept. This key requires you to define `options.max_words.',
102
+ }),
103
+ min_words: z.number().optional().meta({
104
+ id: 'type._inputs.*.options.min_words',
105
+ description:
106
+ 'This key defines the minimum string length, in words, that CloudCannon will allow in an Input. When configured, CloudCannon will warn you when an Input value is too short. If the Input already contains a shorter value, CloudCannon will require you to add characters until the Input contains a valid string to save your changes, or discard your unsaved changes.',
107
+ }),
108
+ min_words_message: z.string().optional().meta({
109
+ id: 'type._inputs.*.options.min_words_message',
110
+ description:
111
+ 'This key defines the message that explains which minimum string length an Input will accept. This key requires you to define `options.min_words`.',
112
+ }),
113
+ max_graphemes: z.number().optional().meta({
114
+ id: 'type._inputs.*.options.max_graphemes',
115
+ description:
116
+ 'This key defines the maximum string length, in graphemes, that CloudCannon will allow in an Input. When configured, CloudCannon will warn you when an Input value is too long. If the Input already contains a longer value, CloudCannon will require you to remove characters until the Input contains a valid string to save your changes, or discard your unsaved changes.',
117
+ }),
118
+ max_graphemes_message: z.string().optional().meta({
119
+ id: 'type._inputs.*.options.max_graphemes_message',
120
+ description:
121
+ 'This key defines the message that explains which maximum string length an Input will accept. This key requires you to define `options.max_graphemes.',
122
+ }),
123
+ min_graphemes: z.number().optional().meta({
124
+ id: 'type._inputs.*.options.min_graphemes',
125
+ description:
126
+ 'This key defines the minimum string length, in graphemes, that CloudCannon will allow in an Input. When configured, CloudCannon will warn you when an Input value is too short. If the Input already contains a shorter value, CloudCannon will require you to add characters until the Input contains a valid string to save your changes, or discard your unsaved changes.',
127
+ }),
128
+ min_graphemes_message: z.string().optional().meta({
129
+ id: 'type._inputs.*.options.min_graphemes_message',
130
+ description:
131
+ 'This key defines the message that explains which minimum string length an Input will accept. This key requires you to define `options.min_graphemes`.',
132
+ }),
133
+ locale: z.string().optional().meta({
134
+ id: 'type._inputs.*.options.locale',
135
+ description:
136
+ 'This key defines the locale that CloudCannon uses to determine the number of words or graphemes in this Input, if you have `max_words`, `min_words`, `max_graphemes`, or `min_graphemes` configured.',
137
+ }),
93
138
  pattern: z.string().optional().meta({
94
139
  id: 'type._inputs.*.options.pattern',
95
140
  description:
@@ -493,8 +538,9 @@ export const RichTextInputOptionsSchema = z
493
538
  ...TextValidationSchema.shape,
494
539
  ...RequiredValidationSchema.shape,
495
540
  empty_type: EmptyTypeTextSchema.optional(),
496
- allow_resize: z.boolean().default(false).optional().meta({
497
- description: 'Shows or hides the resize handler to vertically resize the input.',
541
+ allow_resize: z.boolean().optional().meta({ deprecated: true }),
542
+ prevent_resize: z.boolean().default(false).optional().meta({
543
+ description: 'Hides the resize handler to vertically resize the input.',
498
544
  }),
499
545
  initial_height: z.number().optional().meta({
500
546
  description: 'Defines the initial height of this input in pixels (px).',
@@ -694,8 +740,9 @@ export const SharedSelectInputOptionsSchema = z.object({
694
740
  id: 'type._inputs.*.options.allow_create',
695
741
  description: 'Allows new text values to be created at edit time.',
696
742
  }),
697
- allow_empty: z.boolean().default(true).optional().meta({
743
+ allow_empty: z.boolean().optional().meta({
698
744
  id: 'type._inputs.*.options.allow_empty',
745
+ deprecated: true,
699
746
  description: 'Provides an empty option alongside the options provided by values.',
700
747
  }),
701
748
  values: z