@surveystudio/node-registery 1.3.0 → 1.4.0

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/README.md CHANGED
@@ -16,6 +16,8 @@ Use `/logic` for Worker, export, and server runtimes. It is intentionally React-
16
16
 
17
17
  Use `/runner` and `/builder` only in React runtimes. React is a peer dependency and is not bundled.
18
18
 
19
+ Builder manifests/adapters are available for the migrated input, choice, scale, consent, and plain text nodes.
20
+
19
21
  ## Logic Pipeline
20
22
 
21
23
  Every node logic module should expose the same pure, Worker-safe pipeline:
@@ -1,7 +1,7 @@
1
- export { B as BuilderRegistry, C as CompleteBuilderRegistry, N as NodeBuilder, a as NodeBuilderProps, b as NodeCanvasProps, Q as QuestionNodeDefinition, d as defineBuilderRegistry, c as defineQuestionNode } from './types-4zXsOMLb.mjs';
2
- import { J as JsonValue } from './coreTypes-CyFAym5A.mjs';
3
- export { N as NodeManifest, P as PropertyField, a as PropertyFieldType, S as SelectOption } from './coreTypes-CyFAym5A.mjs';
4
- import { P as PlainTextData, B as BaseTextData, M as MultiInputData, N as NumberInputData, T as TextInputData, Z as ZipCodeInputData } from './types-BMnck1ag.mjs';
1
+ export { B as BuilderRegistry, C as CompleteBuilderRegistry, N as NodeBuilder, a as NodeBuilderProps, b as NodeCanvasProps, Q as QuestionNodeDefinition, d as defineBuilderRegistry, c as defineQuestionNode } from './types-CgiAR_DF.mjs';
2
+ import { J as JsonValue } from './coreTypes-YSpR0Oyh.mjs';
3
+ export { N as NodeManifest, P as PropertyField, a as PropertyFieldType, S as SelectOption } from './coreTypes-YSpR0Oyh.mjs';
4
+ import { P as PlainTextData, C as ConsentData, D as DropdownData, M as MultipleChoiceData, R as RankingData, S as SingleChoiceData, a as RatingData, b as SliderData, B as BaseTextData, c as MultiInputData, N as NumberInputData, T as TextInputData, Z as ZipCodeInputData } from './types-CR3fIHCT.mjs';
5
5
  import 'react';
6
6
 
7
7
  declare const plainTextBuilder: {
@@ -9,6 +9,37 @@ declare const plainTextBuilder: {
9
9
  label: string;
10
10
  };
11
11
 
12
+ declare const consentBuilder: {
13
+ type: "consent";
14
+ label: string;
15
+ };
16
+
17
+ declare const singleChoiceBuilder: {
18
+ type: "singleChoice";
19
+ label: string;
20
+ };
21
+ declare const multipleChoiceBuilder: {
22
+ type: "multipleChoice";
23
+ label: string;
24
+ };
25
+ declare const dropdownBuilder: {
26
+ type: "dropdown";
27
+ label: string;
28
+ };
29
+ declare const rankingBuilder: {
30
+ type: "ranking";
31
+ label: string;
32
+ };
33
+
34
+ declare const ratingBuilder: {
35
+ type: "rating";
36
+ label: string;
37
+ };
38
+ declare const sliderBuilder: {
39
+ type: "slider";
40
+ label: string;
41
+ };
42
+
12
43
  declare const plainTextManifest: {
13
44
  type: "plainText";
14
45
  label: string;
@@ -48,6 +79,431 @@ declare const plainTextManifest: {
48
79
  })[];
49
80
  };
50
81
 
82
+ declare const consentManifest: {
83
+ type: "consent";
84
+ label: string;
85
+ description: string;
86
+ category: "choice";
87
+ dataType: "boolean";
88
+ defaultData: ConsentData;
89
+ properties: ({
90
+ name: string;
91
+ label: string;
92
+ type: "text";
93
+ placeholder: string;
94
+ defaultValue?: never;
95
+ } | {
96
+ name: string;
97
+ label: string;
98
+ type: "textarea";
99
+ placeholder: string;
100
+ defaultValue?: never;
101
+ } | {
102
+ name: string;
103
+ label: string;
104
+ type: "condition";
105
+ defaultValue: {
106
+ id: string;
107
+ type: "group";
108
+ logicType: "AND";
109
+ children: never[];
110
+ };
111
+ placeholder?: never;
112
+ })[];
113
+ };
114
+
115
+ declare const singleChoiceManifest: {
116
+ type: "singleChoice";
117
+ label: string;
118
+ description: string;
119
+ category: "choice";
120
+ dataType: "option";
121
+ defaultData: SingleChoiceData;
122
+ properties: ({
123
+ name: string;
124
+ label: string;
125
+ type: "text";
126
+ defaultValue?: never;
127
+ placeholder?: never;
128
+ helperText?: never;
129
+ } | {
130
+ name: string;
131
+ label: string;
132
+ type: "textarea";
133
+ defaultValue?: never;
134
+ placeholder?: never;
135
+ helperText?: never;
136
+ } | {
137
+ name: string;
138
+ label: string;
139
+ type: "condition";
140
+ defaultValue: {
141
+ id: string;
142
+ type: "group";
143
+ logicType: "AND";
144
+ children: never[];
145
+ };
146
+ placeholder?: never;
147
+ helperText?: never;
148
+ } | {
149
+ name: string;
150
+ label: string;
151
+ type: "options";
152
+ defaultValue: never[];
153
+ placeholder?: never;
154
+ helperText?: never;
155
+ } | {
156
+ name: string;
157
+ label: string;
158
+ type: "textarea";
159
+ placeholder: string;
160
+ helperText: string;
161
+ defaultValue?: never;
162
+ } | {
163
+ name: string;
164
+ label: string;
165
+ type: "switch";
166
+ defaultValue: false;
167
+ placeholder?: never;
168
+ helperText?: never;
169
+ visible?: never;
170
+ } | {
171
+ name: string;
172
+ label: string;
173
+ type: "text";
174
+ placeholder: string;
175
+ helperText: string;
176
+ defaultValue?: never;
177
+ visible?: never;
178
+ } | {
179
+ name: string;
180
+ label: string;
181
+ type: "text";
182
+ placeholder: string;
183
+ visible: (data: SingleChoiceData) => boolean;
184
+ defaultValue?: never;
185
+ helperText?: never;
186
+ })[];
187
+ };
188
+ declare const dropdownManifest: {
189
+ type: "dropdown";
190
+ label: string;
191
+ description: string;
192
+ category: "choice";
193
+ dataType: "option";
194
+ defaultData: DropdownData;
195
+ properties: ({
196
+ name: string;
197
+ label: string;
198
+ type: "text";
199
+ defaultValue?: never;
200
+ placeholder?: never;
201
+ helperText?: never;
202
+ } | {
203
+ name: string;
204
+ label: string;
205
+ type: "textarea";
206
+ defaultValue?: never;
207
+ placeholder?: never;
208
+ helperText?: never;
209
+ } | {
210
+ name: string;
211
+ label: string;
212
+ type: "condition";
213
+ defaultValue: {
214
+ id: string;
215
+ type: "group";
216
+ logicType: "AND";
217
+ children: never[];
218
+ };
219
+ placeholder?: never;
220
+ helperText?: never;
221
+ } | {
222
+ name: string;
223
+ label: string;
224
+ type: "options";
225
+ defaultValue: never[];
226
+ placeholder?: never;
227
+ helperText?: never;
228
+ } | {
229
+ name: string;
230
+ label: string;
231
+ type: "textarea";
232
+ placeholder: string;
233
+ helperText: string;
234
+ defaultValue?: never;
235
+ } | {
236
+ name: string;
237
+ label: string;
238
+ type: "text";
239
+ placeholder: string;
240
+ defaultValue?: never;
241
+ } | {
242
+ name: string;
243
+ label: string;
244
+ type: "switch";
245
+ defaultValue: true;
246
+ placeholder?: never;
247
+ })[];
248
+ };
249
+ declare const multipleChoiceManifest: {
250
+ type: "multipleChoice";
251
+ label: string;
252
+ description: string;
253
+ category: "choice";
254
+ dataType: "array";
255
+ defaultData: MultipleChoiceData;
256
+ properties: ({
257
+ name: string;
258
+ label: string;
259
+ type: "text";
260
+ defaultValue?: never;
261
+ placeholder?: never;
262
+ helperText?: never;
263
+ } | {
264
+ name: string;
265
+ label: string;
266
+ type: "textarea";
267
+ defaultValue?: never;
268
+ placeholder?: never;
269
+ helperText?: never;
270
+ } | {
271
+ name: string;
272
+ label: string;
273
+ type: "condition";
274
+ defaultValue: {
275
+ id: string;
276
+ type: "group";
277
+ logicType: "AND";
278
+ children: never[];
279
+ };
280
+ placeholder?: never;
281
+ helperText?: never;
282
+ } | {
283
+ name: string;
284
+ label: string;
285
+ type: "options";
286
+ defaultValue: never[];
287
+ placeholder?: never;
288
+ helperText?: never;
289
+ } | {
290
+ name: string;
291
+ label: string;
292
+ type: "textarea";
293
+ placeholder: string;
294
+ helperText: string;
295
+ defaultValue?: never;
296
+ } | {
297
+ name: string;
298
+ label: string;
299
+ type: "number";
300
+ helperText: string;
301
+ defaultValue: number;
302
+ placeholder?: never;
303
+ visible?: never;
304
+ } | {
305
+ name: string;
306
+ label: string;
307
+ type: "switch";
308
+ defaultValue: false;
309
+ helperText?: never;
310
+ placeholder?: never;
311
+ visible?: never;
312
+ } | {
313
+ name: string;
314
+ label: string;
315
+ type: "text";
316
+ placeholder: string;
317
+ helperText?: never;
318
+ defaultValue?: never;
319
+ visible?: never;
320
+ } | {
321
+ name: string;
322
+ label: string;
323
+ type: "text";
324
+ placeholder: string;
325
+ visible: (data: MultipleChoiceData) => boolean;
326
+ helperText?: never;
327
+ defaultValue?: never;
328
+ } | {
329
+ name: string;
330
+ label: string;
331
+ type: "switch";
332
+ defaultValue: false;
333
+ helperText: string;
334
+ placeholder?: never;
335
+ visible?: never;
336
+ })[];
337
+ };
338
+ declare const rankingManifest: {
339
+ type: "ranking";
340
+ label: string;
341
+ description: string;
342
+ category: "choice";
343
+ dataType: "array";
344
+ defaultData: RankingData;
345
+ properties: ({
346
+ name: string;
347
+ label: string;
348
+ type: "text";
349
+ defaultValue?: never;
350
+ placeholder?: never;
351
+ helperText?: never;
352
+ } | {
353
+ name: string;
354
+ label: string;
355
+ type: "textarea";
356
+ defaultValue?: never;
357
+ placeholder?: never;
358
+ helperText?: never;
359
+ } | {
360
+ name: string;
361
+ label: string;
362
+ type: "condition";
363
+ defaultValue: {
364
+ id: string;
365
+ type: "group";
366
+ logicType: "AND";
367
+ children: never[];
368
+ };
369
+ placeholder?: never;
370
+ helperText?: never;
371
+ } | {
372
+ name: string;
373
+ label: string;
374
+ type: "options";
375
+ defaultValue: never[];
376
+ placeholder?: never;
377
+ helperText?: never;
378
+ } | {
379
+ name: string;
380
+ label: string;
381
+ type: "textarea";
382
+ placeholder: string;
383
+ helperText: string;
384
+ defaultValue?: never;
385
+ } | {
386
+ name: string;
387
+ label: string;
388
+ type: "select";
389
+ defaultValue: string;
390
+ options: {
391
+ label: string;
392
+ value: string;
393
+ }[];
394
+ })[];
395
+ };
396
+
397
+ declare const ratingManifest: {
398
+ type: "rating";
399
+ label: string;
400
+ description: string;
401
+ category: "choice";
402
+ dataType: "number";
403
+ defaultData: RatingData;
404
+ properties: ({
405
+ name: string;
406
+ label: string;
407
+ type: "select";
408
+ defaultValue: string;
409
+ options: {
410
+ label: string;
411
+ value: string;
412
+ }[];
413
+ } | {
414
+ name: string;
415
+ label: string;
416
+ type: "text";
417
+ defaultValue?: never;
418
+ } | {
419
+ name: string;
420
+ label: string;
421
+ type: "textarea";
422
+ defaultValue?: never;
423
+ } | {
424
+ name: string;
425
+ label: string;
426
+ type: "condition";
427
+ defaultValue: {
428
+ id: string;
429
+ type: "group";
430
+ logicType: "AND";
431
+ children: never[];
432
+ };
433
+ } | {
434
+ name: string;
435
+ label: string;
436
+ type: "options";
437
+ defaultValue: never[];
438
+ visible: (data: RatingData) => boolean;
439
+ } | {
440
+ name: string;
441
+ label: string;
442
+ type: "number";
443
+ defaultValue: number;
444
+ visible?: never;
445
+ })[];
446
+ };
447
+ declare const sliderManifest: {
448
+ type: "slider";
449
+ label: string;
450
+ description: string;
451
+ category: "choice";
452
+ dataType: "number";
453
+ defaultData: SliderData;
454
+ properties: ({
455
+ name: string;
456
+ label: string;
457
+ type: "select";
458
+ defaultValue: string;
459
+ options: {
460
+ label: string;
461
+ value: string;
462
+ }[];
463
+ } | {
464
+ name: string;
465
+ label: string;
466
+ type: "text";
467
+ defaultValue?: never;
468
+ } | {
469
+ name: string;
470
+ label: string;
471
+ type: "textarea";
472
+ defaultValue?: never;
473
+ } | {
474
+ name: string;
475
+ label: string;
476
+ type: "condition";
477
+ defaultValue: {
478
+ id: string;
479
+ type: "group";
480
+ logicType: "AND";
481
+ children: never[];
482
+ };
483
+ } | {
484
+ name: string;
485
+ label: string;
486
+ type: "options";
487
+ defaultValue: never[];
488
+ visible: (data: SliderData) => boolean;
489
+ min?: never;
490
+ } | {
491
+ name: string;
492
+ label: string;
493
+ type: "number";
494
+ defaultValue: number;
495
+ visible?: never;
496
+ min?: never;
497
+ } | {
498
+ name: string;
499
+ label: string;
500
+ type: "number";
501
+ defaultValue: number;
502
+ min: number;
503
+ visible?: never;
504
+ })[];
505
+ };
506
+
51
507
  declare const textInputBuilder: {
52
508
  type: "textInput";
53
509
  label: string;
@@ -313,10 +769,38 @@ declare const builderRegistry: {
313
769
  type: "zipCodeInput";
314
770
  label: string;
315
771
  };
772
+ readonly singleChoice: {
773
+ type: "singleChoice";
774
+ label: string;
775
+ };
776
+ readonly multipleChoice: {
777
+ type: "multipleChoice";
778
+ label: string;
779
+ };
780
+ readonly dropdown: {
781
+ type: "dropdown";
782
+ label: string;
783
+ };
784
+ readonly ranking: {
785
+ type: "ranking";
786
+ label: string;
787
+ };
788
+ readonly rating: {
789
+ type: "rating";
790
+ label: string;
791
+ };
792
+ readonly slider: {
793
+ type: "slider";
794
+ label: string;
795
+ };
796
+ readonly consent: {
797
+ type: "consent";
798
+ label: string;
799
+ };
316
800
  readonly plainText: {
317
801
  type: "plainText";
318
802
  label: string;
319
803
  };
320
804
  };
321
805
 
322
- export { builderRegistry, dateInputBuilder, dateInputManifest, emailInputBuilder, emailInputManifest, multiInputBuilder, multiInputManifest, numberInputBuilder, numberInputManifest, plainTextBuilder, plainTextManifest, textInputBuilder, textInputManifest, zipCodeInputBuilder, zipCodeInputManifest };
806
+ export { builderRegistry, consentBuilder, consentManifest, dateInputBuilder, dateInputManifest, dropdownBuilder, dropdownManifest, emailInputBuilder, emailInputManifest, multiInputBuilder, multiInputManifest, multipleChoiceBuilder, multipleChoiceManifest, numberInputBuilder, numberInputManifest, plainTextBuilder, plainTextManifest, rankingBuilder, rankingManifest, ratingBuilder, ratingManifest, singleChoiceBuilder, singleChoiceManifest, sliderBuilder, sliderManifest, textInputBuilder, textInputManifest, zipCodeInputBuilder, zipCodeInputManifest };
package/dist/builder.mjs CHANGED
@@ -12,6 +12,19 @@ var plainTextBuilder = {
12
12
  label: "Info / Text"
13
13
  };
14
14
 
15
+ // src/nodes/consent/builder.ts
16
+ var consentBuilder = { type: "consent", label: "Consent" };
17
+
18
+ // src/nodes/choice/builder.ts
19
+ var singleChoiceBuilder = { type: "singleChoice", label: "Single Choice" };
20
+ var multipleChoiceBuilder = { type: "multipleChoice", label: "Multiple Choice" };
21
+ var dropdownBuilder = { type: "dropdown", label: "Dropdown Select" };
22
+ var rankingBuilder = { type: "ranking", label: "Ranking" };
23
+
24
+ // src/nodes/scale/builder.ts
25
+ var ratingBuilder = { type: "rating", label: "Rating" };
26
+ var sliderBuilder = { type: "slider", label: "Slider / Scale" };
27
+
15
28
  // src/nodes/textLike/builder.ts
16
29
  var textInputBuilder = { type: "textInput", label: "Text Answer" };
17
30
  var emailInputBuilder = { type: "emailInput", label: "Email" };
@@ -58,30 +71,267 @@ var plainTextManifest = {
58
71
  ]
59
72
  };
60
73
 
61
- // src/nodes/textLike/manifest.ts
74
+ // src/nodes/consent/manifest.ts
62
75
  var defaultCondition = {
63
76
  id: "root",
64
77
  type: "group",
65
78
  logicType: "AND",
66
79
  children: []
67
80
  };
81
+ var consentDefaultData = {
82
+ label: "Consent",
83
+ description: "I agree to the terms and conditions.",
84
+ condition: defaultCondition,
85
+ checkboxLabel: "I agree",
86
+ disagreeLabel: "I do not agree to the terms"
87
+ };
88
+ var consentManifest = {
89
+ type: "consent",
90
+ label: "Consent",
91
+ description: "Terms and agreement checkbox",
92
+ category: "choice",
93
+ dataType: "boolean",
94
+ defaultData: consentDefaultData,
95
+ properties: [
96
+ { name: "label", label: "Title", type: "text", placeholder: "Terms of Service" },
97
+ { name: "description", label: "Terms Text", type: "textarea", placeholder: "I agree to the terms and conditions..." },
98
+ { name: "checkboxLabel", label: "Checkbox Label", type: "text", placeholder: "I agree" },
99
+ { name: "disagreeLabel", label: "Disagree Label", type: "text", placeholder: "I do not agree to the terms" },
100
+ {
101
+ name: "condition",
102
+ label: "Logic Rule",
103
+ type: "condition",
104
+ defaultValue: defaultCondition
105
+ }
106
+ ]
107
+ };
108
+
109
+ // src/nodes/choice/manifest.ts
110
+ var defaultCondition2 = {
111
+ id: "root",
112
+ type: "group",
113
+ logicType: "AND",
114
+ children: []
115
+ };
116
+ var baseChoiceData = {
117
+ label: "",
118
+ description: "",
119
+ condition: defaultCondition2,
120
+ options: [],
121
+ randomizeOptions: false
122
+ };
123
+ var commonProperties = [
124
+ { name: "label", label: "Question Label", type: "text" },
125
+ { name: "description", label: "Description", type: "textarea" },
126
+ {
127
+ name: "condition",
128
+ label: "Logic Rule",
129
+ type: "condition",
130
+ defaultValue: defaultCondition2
131
+ },
132
+ { name: "options", label: "Options", type: "options", defaultValue: [] },
133
+ { name: "bulkOptions", label: "Bulk Add (one per line)", type: "textarea", placeholder: "Option A\nOption B\nOption C...", helperText: "Paste a list to replace all options above" }
134
+ ];
135
+ var singleChoiceDefaultData = {
136
+ ...baseChoiceData,
137
+ label: "Single Choice",
138
+ allowOther: false,
139
+ otherLabel: "Other (Please specify)",
140
+ allowNone: false,
141
+ noneLabel: "None of these"
142
+ };
143
+ var dropdownDefaultData = {
144
+ ...baseChoiceData,
145
+ label: "Dropdown Select",
146
+ placeholder: "Select an option...",
147
+ searchable: true
148
+ };
149
+ var multipleChoiceDefaultData = {
150
+ ...baseChoiceData,
151
+ label: "Multiple Choice",
152
+ minChoices: 0,
153
+ maxChoices: 0,
154
+ allowOther: false,
155
+ otherLabel: "Other (Please specify)",
156
+ allowNone: false,
157
+ noneLabel: "None of these"
158
+ };
159
+ var rankingDefaultData = {
160
+ ...baseChoiceData,
161
+ label: "Ranking",
162
+ maxRank: 0,
163
+ displayMode: "drag"
164
+ };
165
+ var singleChoiceManifest = {
166
+ type: "singleChoice",
167
+ label: "Single Choice",
168
+ description: "Select one option from a list",
169
+ category: "choice",
170
+ dataType: "option",
171
+ defaultData: singleChoiceDefaultData,
172
+ properties: [
173
+ ...commonProperties,
174
+ { name: "allowOther", label: 'Allow "Other" Option', type: "switch", defaultValue: false },
175
+ { name: "otherLabel", label: '"Other" Placeholder', type: "text", placeholder: "Other (Please specify)", helperText: "Label for the open-ended option" },
176
+ { name: "allowNone", label: 'Allow "None of these"', type: "switch", defaultValue: false },
177
+ { name: "noneLabel", label: '"None" Label', type: "text", placeholder: "None of these", visible: (data) => Boolean(data.allowNone) },
178
+ { name: "randomizeOptions", label: "Randomize Options", type: "switch", defaultValue: false }
179
+ ]
180
+ };
181
+ var dropdownManifest = {
182
+ type: "dropdown",
183
+ label: "Dropdown Select",
184
+ description: "Select from a dropdown menu",
185
+ category: "choice",
186
+ dataType: "option",
187
+ defaultData: dropdownDefaultData,
188
+ properties: [
189
+ ...commonProperties,
190
+ { name: "placeholder", label: "Placeholder Text", type: "text", placeholder: "Select an option..." },
191
+ { name: "searchable", label: "Searchable", type: "switch", defaultValue: true }
192
+ ]
193
+ };
194
+ var multipleChoiceManifest = {
195
+ type: "multipleChoice",
196
+ label: "Multiple Choice",
197
+ description: "Select multiple options",
198
+ category: "choice",
199
+ dataType: "array",
200
+ defaultData: multipleChoiceDefaultData,
201
+ properties: [
202
+ ...commonProperties,
203
+ { name: "maxChoices", label: "Maximum Choices", type: "number", helperText: "Limit how many options a user can select. Leave empty for no limit.", defaultValue: 0 },
204
+ { name: "allowOther", label: 'Allow "Other" Option', type: "switch", defaultValue: false },
205
+ { name: "otherLabel", label: '"Other" Placeholder', type: "text", placeholder: "Other (Please specify)" },
206
+ { name: "allowNone", label: 'Allow "None of these"', type: "switch", defaultValue: false },
207
+ { name: "noneLabel", label: '"None" Label', type: "text", placeholder: "None of these", visible: (data) => Boolean(data.allowNone) },
208
+ { name: "randomizeOptions", label: "Randomize Options", type: "switch", defaultValue: false, helperText: "Shuffle options for every viewer" }
209
+ ]
210
+ };
211
+ var rankingManifest = {
212
+ type: "ranking",
213
+ label: "Ranking",
214
+ description: "Rank options in order",
215
+ category: "choice",
216
+ dataType: "array",
217
+ defaultData: rankingDefaultData,
218
+ properties: [
219
+ ...commonProperties,
220
+ {
221
+ name: "displayMode",
222
+ label: "Display Mode",
223
+ type: "select",
224
+ defaultValue: "drag",
225
+ options: [
226
+ { label: "Drag and Drop", value: "drag" },
227
+ { label: "Select Rank", value: "select" }
228
+ ]
229
+ }
230
+ ]
231
+ };
232
+
233
+ // src/nodes/scale/manifest.ts
234
+ var defaultCondition3 = {
235
+ id: "root",
236
+ type: "group",
237
+ logicType: "AND",
238
+ children: []
239
+ };
240
+ var baseScaleData = {
241
+ label: "",
242
+ description: "",
243
+ condition: defaultCondition3,
244
+ responseMode: "single",
245
+ items: []
246
+ };
247
+ var responseModeProperty = {
248
+ name: "responseMode",
249
+ label: "Response Mode",
250
+ type: "select",
251
+ defaultValue: "single",
252
+ options: [
253
+ { label: "Single Question", value: "single" },
254
+ { label: "Multiple Items", value: "multi" }
255
+ ]
256
+ };
257
+ var commonProperties2 = [
258
+ responseModeProperty,
259
+ { name: "label", label: "Question Label", type: "text" },
260
+ { name: "description", label: "Description", type: "textarea" },
261
+ {
262
+ name: "condition",
263
+ label: "Logic Rule",
264
+ type: "condition",
265
+ defaultValue: defaultCondition3
266
+ }
267
+ ];
268
+ var ratingDefaultData = {
269
+ ...baseScaleData,
270
+ label: "Rating",
271
+ maxRating: 5
272
+ };
273
+ var sliderDefaultData = {
274
+ ...baseScaleData,
275
+ label: "Slider / Scale",
276
+ min: 0,
277
+ max: 10,
278
+ step: 1,
279
+ startValue: 5
280
+ };
281
+ var ratingManifest = {
282
+ type: "rating",
283
+ label: "Rating",
284
+ description: "Star rating scale",
285
+ category: "choice",
286
+ dataType: "number",
287
+ defaultData: ratingDefaultData,
288
+ properties: [
289
+ ...commonProperties2,
290
+ { name: "items", label: "Questions/Items", type: "options", defaultValue: [], visible: (data) => data.responseMode === "multi" },
291
+ { name: "maxRating", label: "Max Stars", type: "number", defaultValue: 5 }
292
+ ]
293
+ };
294
+ var sliderManifest = {
295
+ type: "slider",
296
+ label: "Slider / Scale",
297
+ description: "Single or multi-item scale",
298
+ category: "choice",
299
+ dataType: "number",
300
+ defaultData: sliderDefaultData,
301
+ properties: [
302
+ ...commonProperties2,
303
+ { name: "items", label: "Items to Rate", type: "options", defaultValue: [], visible: (data) => data.responseMode === "multi" },
304
+ { name: "min", label: "Minimum", type: "number", defaultValue: 0 },
305
+ { name: "max", label: "Maximum", type: "number", defaultValue: 10 },
306
+ { name: "step", label: "Step", type: "number", defaultValue: 1, min: 0 },
307
+ { name: "startValue", label: "Start Value", type: "number", defaultValue: 5 }
308
+ ]
309
+ };
310
+
311
+ // src/nodes/textLike/manifest.ts
312
+ var defaultCondition4 = {
313
+ id: "root",
314
+ type: "group",
315
+ logicType: "AND",
316
+ children: []
317
+ };
68
318
  var baseTextData = {
69
319
  label: "",
70
320
  description: "",
71
- condition: defaultCondition,
321
+ condition: defaultCondition4,
72
322
  minChars: 0,
73
323
  maxChars: 0,
74
324
  minWords: 0,
75
325
  maxWords: 0
76
326
  };
77
- var commonProperties = [
327
+ var commonProperties3 = [
78
328
  { name: "label", label: "Field Label", type: "text" },
79
329
  { name: "description", label: "Description", type: "textarea" },
80
330
  {
81
331
  name: "condition",
82
332
  label: "Logic Rule",
83
333
  type: "condition",
84
- defaultValue: defaultCondition
334
+ defaultValue: defaultCondition4
85
335
  }
86
336
  ];
87
337
  var textLimitProperties = [
@@ -120,7 +370,7 @@ var textInputManifest = {
120
370
  dataType: "text",
121
371
  defaultData: textInputDefaultData,
122
372
  properties: [
123
- ...commonProperties,
373
+ ...commonProperties3,
124
374
  { name: "placeholder", label: "Placeholder", type: "text", placeholder: "e.g., Type here...", defaultValue: "" },
125
375
  { name: "longAnswer", label: "Long Answer (Multi-line)", type: "switch", defaultValue: false },
126
376
  ...textLimitProperties
@@ -133,7 +383,7 @@ var emailInputManifest = {
133
383
  category: "input",
134
384
  dataType: "text",
135
385
  defaultData: emailInputDefaultData,
136
- properties: commonProperties
386
+ properties: commonProperties3
137
387
  };
138
388
  var dateInputManifest = {
139
389
  type: "dateInput",
@@ -142,7 +392,7 @@ var dateInputManifest = {
142
392
  category: "input",
143
393
  dataType: "text",
144
394
  defaultData: dateInputDefaultData,
145
- properties: commonProperties
395
+ properties: commonProperties3
146
396
  };
147
397
  var numberInputManifest = {
148
398
  type: "numberInput",
@@ -152,7 +402,7 @@ var numberInputManifest = {
152
402
  dataType: "number",
153
403
  defaultData: numberInputDefaultData,
154
404
  properties: [
155
- ...commonProperties,
405
+ ...commonProperties3,
156
406
  { name: "min", label: "Minimum Value", type: "number" },
157
407
  { name: "max", label: "Maximum Value", type: "number" }
158
408
  ]
@@ -165,7 +415,7 @@ var zipCodeInputManifest = {
165
415
  dataType: "text",
166
416
  defaultData: zipCodeInputDefaultData,
167
417
  properties: [
168
- ...commonProperties,
418
+ ...commonProperties3,
169
419
  { name: "allowedZips", label: "Allowed Zip Codes", type: "fileTextarea", placeholder: "10001, 10002, 90210... (Leave empty to allow all)", helperText: "Validation: Only users entering these zip codes can proceed. Others will be blocked." }
170
420
  ]
171
421
  };
@@ -177,7 +427,7 @@ var multiInputManifest = {
177
427
  dataType: "object",
178
428
  defaultData: multiInputDefaultData,
179
429
  properties: [
180
- ...commonProperties,
430
+ ...commonProperties3,
181
431
  { name: "fields", label: "Input Fields", type: "options", defaultValue: [], helperText: "Value column represents input type (text, number, email)" },
182
432
  ...textLimitProperties
183
433
  ]
@@ -191,22 +441,43 @@ var builderRegistry = defineBuilderRegistry({
191
441
  dateInput: dateInputBuilder,
192
442
  multiInput: multiInputBuilder,
193
443
  zipCodeInput: zipCodeInputBuilder,
444
+ singleChoice: singleChoiceBuilder,
445
+ multipleChoice: multipleChoiceBuilder,
446
+ dropdown: dropdownBuilder,
447
+ ranking: rankingBuilder,
448
+ rating: ratingBuilder,
449
+ slider: sliderBuilder,
450
+ consent: consentBuilder,
194
451
  plainText: plainTextBuilder
195
452
  });
196
453
  export {
197
454
  builderRegistry,
455
+ consentBuilder,
456
+ consentManifest,
198
457
  dateInputBuilder,
199
458
  dateInputManifest,
200
459
  defineBuilderRegistry,
201
460
  defineQuestionNode,
461
+ dropdownBuilder,
462
+ dropdownManifest,
202
463
  emailInputBuilder,
203
464
  emailInputManifest,
204
465
  multiInputBuilder,
205
466
  multiInputManifest,
467
+ multipleChoiceBuilder,
468
+ multipleChoiceManifest,
206
469
  numberInputBuilder,
207
470
  numberInputManifest,
208
471
  plainTextBuilder,
209
472
  plainTextManifest,
473
+ rankingBuilder,
474
+ rankingManifest,
475
+ ratingBuilder,
476
+ ratingManifest,
477
+ singleChoiceBuilder,
478
+ singleChoiceManifest,
479
+ sliderBuilder,
480
+ sliderManifest,
210
481
  textInputBuilder,
211
482
  textInputManifest,
212
483
  zipCodeInputBuilder,
@@ -82,4 +82,4 @@ type RegistryKeySet = Readonly<Partial<Record<SurveyNodeType, unknown>>>;
82
82
  declare function defineLogicRegistry<const TRegistry extends RegistryKeySet>(registry: TRegistry): TRegistry;
83
83
  declare function createInitialData<TData extends NodeData>(manifest: NodeManifest<SurveyNodeType, TData>): TData;
84
84
 
85
- export { type CompleteLogicRegistry as C, type DataType as D, type ExtractedValue as E, type JsonValue as J, type LogicRegistry as L, type NodeManifest as N, type PropertyField as P, type QuestionNodeType as Q, type SelectOption as S, type ValidationContext as V, type PropertyFieldType as a, type NodeData as b, type NodeLogic as c, type ExtractionContext as d, type NodeLogicContext as e, type ValidationResult as f, createInitialData as g, defineLogicRegistry as h, type SurveyNodeType as i, type NodeValue as j };
85
+ export { type CompleteLogicRegistry as C, type DataType as D, type ExtractedValue as E, type JsonValue as J, type LogicRegistry as L, type NodeManifest as N, type PropertyField as P, type QuestionNodeType as Q, type SelectOption as S, type ValidationContext as V, type PropertyFieldType as a, type NodeLogic as b, type ExtractionContext as c, type NodeLogicContext as d, type ValidationResult as e, createInitialData as f, defineLogicRegistry as g, type NodeData as h, type SurveyNodeType as i, type NodeValue as j };
package/dist/logic.d.mts CHANGED
@@ -1,91 +1,6 @@
1
- import { P as PlainTextData, a as PlainTextValue, D as DateInputData, b as TextValue, E as EmailInputData, M as MultiInputData, c as MultiInputValue, N as NumberInputData, T as TextInputData, Z as ZipCodeInputData, B as BaseTextData } from './types-BMnck1ag.mjs';
2
- import { b as NodeData, J as JsonValue, c as NodeLogic } from './coreTypes-CyFAym5A.mjs';
3
- export { C as CompleteLogicRegistry, D as DataType, E as ExtractedValue, d as ExtractionContext, L as LogicRegistry, e as NodeLogicContext, V as ValidationContext, f as ValidationResult, g as createInitialData, h as defineLogicRegistry } from './coreTypes-CyFAym5A.mjs';
4
-
5
- type ConditionData$2 = {
6
- id: string;
7
- type: "group";
8
- logicType: "AND" | "OR";
9
- children: JsonValue[];
10
- };
11
- type ConsentData = NodeData & {
12
- label: string;
13
- description: string;
14
- condition: ConditionData$2;
15
- checkboxLabel: string;
16
- disagreeLabel?: string;
17
- };
18
- type ConsentValue = boolean;
19
-
20
- type ConditionData$1 = {
21
- id: string;
22
- type: "group";
23
- logicType: "AND" | "OR";
24
- children: JsonValue[];
25
- };
26
- type ScaleItem = NodeData & {
27
- id?: string;
28
- exportId?: string;
29
- technicalId?: string;
30
- label?: string;
31
- value?: string;
32
- };
33
- type ScaleResponseMode = "single" | "multi";
34
- type BaseScaleData = NodeData & {
35
- label: string;
36
- description: string;
37
- condition: ConditionData$1;
38
- responseMode?: ScaleResponseMode;
39
- items: ScaleItem[];
40
- };
41
- type RatingData = BaseScaleData & {
42
- maxRating: number;
43
- };
44
- type SliderData = BaseScaleData & {
45
- min: number;
46
- max: number;
47
- step: number;
48
- startValue: number;
49
- };
50
- type ScaleValue = number | Record<string, number>;
51
-
52
- type ConditionData = {
53
- id: string;
54
- type: "group";
55
- logicType: "AND" | "OR";
56
- children: JsonValue[];
57
- };
58
- type ChoiceOption = NodeData & {
59
- id?: string;
60
- label: string;
61
- value: string;
62
- imageUrl?: string;
63
- };
64
- type BaseChoiceData = NodeData & {
65
- label: string;
66
- description: string;
67
- condition: ConditionData;
68
- options: ChoiceOption[];
69
- randomizeOptions?: boolean;
70
- };
71
- type SingleChoiceData = BaseChoiceData & {
72
- allowOther?: boolean;
73
- otherLabel?: string;
74
- };
75
- type DropdownData = BaseChoiceData & {
76
- searchable?: boolean;
77
- };
78
- type MultipleChoiceData = BaseChoiceData & {
79
- minChoices?: number;
80
- maxChoices?: number;
81
- };
82
- type RankingData = BaseChoiceData & {
83
- maxRank?: number;
84
- displayMode?: "drag" | "select";
85
- };
86
- type SingleChoiceValue = string;
87
- type MultipleChoiceValue = string[];
88
- type RankingValue = string[];
1
+ import { P as PlainTextData, d as PlainTextValue, C as ConsentData, e as ConsentValue, a as RatingData, f as ScaleValue, b as SliderData, D as DropdownData, g as SingleChoiceValue, M as MultipleChoiceData, h as MultipleChoiceValue, R as RankingData, i as RankingValue, S as SingleChoiceData, j as DateInputData, k as TextValue, E as EmailInputData, c as MultiInputData, l as MultiInputValue, N as NumberInputData, T as TextInputData, Z as ZipCodeInputData, B as BaseTextData } from './types-CR3fIHCT.mjs';
2
+ import { b as NodeLogic } from './coreTypes-YSpR0Oyh.mjs';
3
+ export { C as CompleteLogicRegistry, D as DataType, E as ExtractedValue, c as ExtractionContext, L as LogicRegistry, d as NodeLogicContext, V as ValidationContext, e as ValidationResult, f as createInitialData, g as defineLogicRegistry } from './coreTypes-YSpR0Oyh.mjs';
89
4
 
90
5
  declare const plainTextLogic: NodeLogic<"plainText", PlainTextData, PlainTextValue>;
91
6
 
package/dist/logic.mjs CHANGED
@@ -141,8 +141,7 @@ var commonProperties = [
141
141
  label: "Logic Rule",
142
142
  type: "condition",
143
143
  defaultValue: defaultCondition2
144
- },
145
- { name: "items", label: "Items", type: "options", defaultValue: [] }
144
+ }
146
145
  ];
147
146
  var ratingDefaultData = {
148
147
  ...baseScaleData,
@@ -166,6 +165,7 @@ var ratingManifest = {
166
165
  defaultData: ratingDefaultData,
167
166
  properties: [
168
167
  ...commonProperties,
168
+ { name: "items", label: "Questions/Items", type: "options", defaultValue: [], visible: (data) => data.responseMode === "multi" },
169
169
  { name: "maxRating", label: "Max Stars", type: "number", defaultValue: 5 }
170
170
  ]
171
171
  };
@@ -178,6 +178,7 @@ var sliderManifest = {
178
178
  defaultData: sliderDefaultData,
179
179
  properties: [
180
180
  ...commonProperties,
181
+ { name: "items", label: "Items to Rate", type: "options", defaultValue: [], visible: (data) => data.responseMode === "multi" },
181
182
  { name: "min", label: "Minimum", type: "number", defaultValue: 0 },
182
183
  { name: "max", label: "Maximum", type: "number", defaultValue: 10 },
183
184
  { name: "step", label: "Step", type: "number", defaultValue: 1, min: 0 },
@@ -299,24 +300,31 @@ var commonProperties2 = [
299
300
  defaultValue: defaultCondition3
300
301
  },
301
302
  { name: "options", label: "Options", type: "options", defaultValue: [] },
302
- { name: "bulkOptions", label: "Bulk Add (one per line)", type: "textarea", placeholder: "Option A\nOption B\nOption C..." }
303
+ { name: "bulkOptions", label: "Bulk Add (one per line)", type: "textarea", placeholder: "Option A\nOption B\nOption C...", helperText: "Paste a list to replace all options above" }
303
304
  ];
304
305
  var singleChoiceDefaultData = {
305
306
  ...baseChoiceData,
306
307
  label: "Single Choice",
307
308
  allowOther: false,
308
- otherLabel: "Other"
309
+ otherLabel: "Other (Please specify)",
310
+ allowNone: false,
311
+ noneLabel: "None of these"
309
312
  };
310
313
  var dropdownDefaultData = {
311
314
  ...baseChoiceData,
312
- label: "Dropdown",
315
+ label: "Dropdown Select",
316
+ placeholder: "Select an option...",
313
317
  searchable: true
314
318
  };
315
319
  var multipleChoiceDefaultData = {
316
320
  ...baseChoiceData,
317
321
  label: "Multiple Choice",
318
322
  minChoices: 0,
319
- maxChoices: 0
323
+ maxChoices: 0,
324
+ allowOther: false,
325
+ otherLabel: "Other (Please specify)",
326
+ allowNone: false,
327
+ noneLabel: "None of these"
320
328
  };
321
329
  var rankingDefaultData = {
322
330
  ...baseChoiceData,
@@ -327,26 +335,29 @@ var rankingDefaultData = {
327
335
  var singleChoiceManifest = {
328
336
  type: "singleChoice",
329
337
  label: "Single Choice",
330
- description: "Select one option",
338
+ description: "Select one option from a list",
331
339
  category: "choice",
332
340
  dataType: "option",
333
341
  defaultData: singleChoiceDefaultData,
334
342
  properties: [
335
343
  ...commonProperties2,
336
- { name: "allowOther", label: "Allow Other", type: "switch", defaultValue: false },
337
- { name: "otherLabel", label: "Other Label", type: "text", defaultValue: "Other" },
344
+ { name: "allowOther", label: 'Allow "Other" Option', type: "switch", defaultValue: false },
345
+ { name: "otherLabel", label: '"Other" Placeholder', type: "text", placeholder: "Other (Please specify)", helperText: "Label for the open-ended option" },
346
+ { name: "allowNone", label: 'Allow "None of these"', type: "switch", defaultValue: false },
347
+ { name: "noneLabel", label: '"None" Label', type: "text", placeholder: "None of these", visible: (data) => Boolean(data.allowNone) },
338
348
  { name: "randomizeOptions", label: "Randomize Options", type: "switch", defaultValue: false }
339
349
  ]
340
350
  };
341
351
  var dropdownManifest = {
342
352
  type: "dropdown",
343
- label: "Dropdown",
353
+ label: "Dropdown Select",
344
354
  description: "Select from a dropdown menu",
345
355
  category: "choice",
346
356
  dataType: "option",
347
357
  defaultData: dropdownDefaultData,
348
358
  properties: [
349
359
  ...commonProperties2,
360
+ { name: "placeholder", label: "Placeholder Text", type: "text", placeholder: "Select an option..." },
350
361
  { name: "searchable", label: "Searchable", type: "switch", defaultValue: true }
351
362
  ]
352
363
  };
@@ -359,9 +370,12 @@ var multipleChoiceManifest = {
359
370
  defaultData: multipleChoiceDefaultData,
360
371
  properties: [
361
372
  ...commonProperties2,
362
- { name: "minChoices", label: "Minimum Choices", type: "number", defaultValue: 0 },
363
- { name: "maxChoices", label: "Maximum Choices", type: "number", defaultValue: 0 },
364
- { name: "randomizeOptions", label: "Randomize Options", type: "switch", defaultValue: false }
373
+ { name: "maxChoices", label: "Maximum Choices", type: "number", helperText: "Limit how many options a user can select. Leave empty for no limit.", defaultValue: 0 },
374
+ { name: "allowOther", label: 'Allow "Other" Option', type: "switch", defaultValue: false },
375
+ { name: "otherLabel", label: '"Other" Placeholder', type: "text", placeholder: "Other (Please specify)" },
376
+ { name: "allowNone", label: 'Allow "None of these"', type: "switch", defaultValue: false },
377
+ { name: "noneLabel", label: '"None" Label', type: "text", placeholder: "None of these", visible: (data) => Boolean(data.allowNone) },
378
+ { name: "randomizeOptions", label: "Randomize Options", type: "switch", defaultValue: false, helperText: "Shuffle options for every viewer" }
365
379
  ]
366
380
  };
367
381
  var rankingManifest = {
@@ -373,7 +387,6 @@ var rankingManifest = {
373
387
  defaultData: rankingDefaultData,
374
388
  properties: [
375
389
  ...commonProperties2,
376
- { name: "maxRank", label: "Maximum Rank", type: "number", defaultValue: 0 },
377
390
  {
378
391
  name: "displayMode",
379
392
  label: "Display Mode",
@@ -381,7 +394,7 @@ var rankingManifest = {
381
394
  defaultValue: "drag",
382
395
  options: [
383
396
  { label: "Drag and Drop", value: "drag" },
384
- { label: "Dropdown Selection", value: "select" }
397
+ { label: "Select Rank", value: "select" }
385
398
  ]
386
399
  }
387
400
  ]
package/dist/runner.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- export { e as CompleteRunnerRegistry, f as NodeRunner, g as NodeRunnerProps, Q as QuestionNodeDefinition, R as RunnerRegistry, c as defineQuestionNode, h as defineRunnerRegistry } from './types-4zXsOMLb.mjs';
1
+ export { e as CompleteRunnerRegistry, f as NodeRunner, g as NodeRunnerProps, Q as QuestionNodeDefinition, R as RunnerRegistry, c as defineQuestionNode, h as defineRunnerRegistry } from './types-CgiAR_DF.mjs';
2
2
  import 'react';
3
- import './coreTypes-CyFAym5A.mjs';
3
+ import './coreTypes-YSpR0Oyh.mjs';
4
4
 
5
5
  declare const plainTextRunner: {
6
6
  type: "plainText";
@@ -0,0 +1,151 @@
1
+ import { h as NodeData, J as JsonValue } from './coreTypes-YSpR0Oyh.mjs';
2
+
3
+ type PlainTextData = NodeData & {
4
+ label: string;
5
+ description: string;
6
+ buttonLabel: string;
7
+ condition: {
8
+ id: string;
9
+ type: "group";
10
+ logicType: "AND" | "OR";
11
+ children: JsonValue[];
12
+ };
13
+ };
14
+ type PlainTextValue = {
15
+ viewed: boolean;
16
+ };
17
+
18
+ type ConditionData$3 = {
19
+ id: string;
20
+ type: "group";
21
+ logicType: "AND" | "OR";
22
+ children: JsonValue[];
23
+ };
24
+ type ConsentData = NodeData & {
25
+ label: string;
26
+ description: string;
27
+ condition: ConditionData$3;
28
+ checkboxLabel: string;
29
+ disagreeLabel?: string;
30
+ };
31
+ type ConsentValue = boolean;
32
+
33
+ type ConditionData$2 = {
34
+ id: string;
35
+ type: "group";
36
+ logicType: "AND" | "OR";
37
+ children: JsonValue[];
38
+ };
39
+ type ChoiceOption = NodeData & {
40
+ id?: string;
41
+ label: string;
42
+ value: string;
43
+ imageUrl?: string;
44
+ };
45
+ type BaseChoiceData = NodeData & {
46
+ label: string;
47
+ description: string;
48
+ condition: ConditionData$2;
49
+ options: ChoiceOption[];
50
+ randomizeOptions?: boolean;
51
+ };
52
+ type SingleChoiceData = BaseChoiceData & {
53
+ allowOther?: boolean;
54
+ otherLabel?: string;
55
+ allowNone?: boolean;
56
+ noneLabel?: string;
57
+ };
58
+ type DropdownData = BaseChoiceData & {
59
+ placeholder?: string;
60
+ searchable?: boolean;
61
+ };
62
+ type MultipleChoiceData = BaseChoiceData & {
63
+ minChoices?: number;
64
+ maxChoices?: number;
65
+ allowOther?: boolean;
66
+ otherLabel?: string;
67
+ allowNone?: boolean;
68
+ noneLabel?: string;
69
+ };
70
+ type RankingData = BaseChoiceData & {
71
+ maxRank?: number;
72
+ displayMode?: "drag" | "select";
73
+ };
74
+ type SingleChoiceValue = string;
75
+ type MultipleChoiceValue = string[];
76
+ type RankingValue = string[];
77
+
78
+ type ConditionData$1 = {
79
+ id: string;
80
+ type: "group";
81
+ logicType: "AND" | "OR";
82
+ children: JsonValue[];
83
+ };
84
+ type ScaleItem = NodeData & {
85
+ id?: string;
86
+ exportId?: string;
87
+ technicalId?: string;
88
+ label?: string;
89
+ value?: string;
90
+ };
91
+ type ScaleResponseMode = "single" | "multi";
92
+ type BaseScaleData = NodeData & {
93
+ label: string;
94
+ description: string;
95
+ condition: ConditionData$1;
96
+ responseMode?: ScaleResponseMode;
97
+ items: ScaleItem[];
98
+ };
99
+ type RatingData = BaseScaleData & {
100
+ maxRating: number;
101
+ };
102
+ type SliderData = BaseScaleData & {
103
+ min: number;
104
+ max: number;
105
+ step: number;
106
+ startValue: number;
107
+ };
108
+ type ScaleValue = number | Record<string, number>;
109
+
110
+ type ConditionData = {
111
+ id: string;
112
+ type: "group";
113
+ logicType: "AND" | "OR";
114
+ children: JsonValue[];
115
+ };
116
+ type TextLimitData = NodeData & {
117
+ minChars?: number;
118
+ maxChars?: number;
119
+ minWords?: number;
120
+ maxWords?: number;
121
+ };
122
+ type BaseTextData = TextLimitData & {
123
+ label: string;
124
+ description: string;
125
+ condition: ConditionData;
126
+ };
127
+ type TextInputData = BaseTextData & {
128
+ placeholder: string;
129
+ longAnswer: boolean;
130
+ };
131
+ type EmailInputData = BaseTextData;
132
+ type DateInputData = BaseTextData;
133
+ type NumberInputData = BaseTextData & {
134
+ min?: number;
135
+ max?: number;
136
+ };
137
+ type ZipCodeInputData = BaseTextData & {
138
+ allowedZips: string;
139
+ };
140
+ type MultiInputField = {
141
+ id: string;
142
+ label?: string;
143
+ value?: string;
144
+ };
145
+ type MultiInputData = BaseTextData & {
146
+ fields: MultiInputField[];
147
+ };
148
+ type TextValue = string;
149
+ type MultiInputValue = Record<string, string>;
150
+
151
+ export type { BaseTextData as B, ConsentData as C, DropdownData as D, EmailInputData as E, MultipleChoiceData as M, NumberInputData as N, PlainTextData as P, RankingData as R, SingleChoiceData as S, TextInputData as T, ZipCodeInputData as Z, RatingData as a, SliderData as b, MultiInputData as c, PlainTextValue as d, ConsentValue as e, ScaleValue as f, SingleChoiceValue as g, MultipleChoiceValue as h, RankingValue as i, DateInputData as j, TextValue as k, MultiInputValue as l };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode, ComponentType } from 'react';
2
- import { i as SurveyNodeType, b as NodeData, Q as QuestionNodeType, j as NodeValue, N as NodeManifest, c as NodeLogic } from './coreTypes-CyFAym5A.mjs';
2
+ import { i as SurveyNodeType, h as NodeData, Q as QuestionNodeType, j as NodeValue, N as NodeManifest, b as NodeLogic } from './coreTypes-YSpR0Oyh.mjs';
3
3
 
4
4
  interface NodeRunnerProps<TData extends NodeData = NodeData, TValue extends NodeValue = NodeValue> {
5
5
  readonly data: Readonly<TData>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surveystudio/node-registery",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Typed survey question node registry with split builder, runner, and logic entrypoints.",
5
5
  "main": "./dist/logic.mjs",
6
6
  "types": "./dist/logic.d.mts",
@@ -1,59 +0,0 @@
1
- import { b as NodeData, J as JsonValue } from './coreTypes-CyFAym5A.mjs';
2
-
3
- type PlainTextData = NodeData & {
4
- label: string;
5
- description: string;
6
- buttonLabel: string;
7
- condition: {
8
- id: string;
9
- type: "group";
10
- logicType: "AND" | "OR";
11
- children: JsonValue[];
12
- };
13
- };
14
- type PlainTextValue = {
15
- viewed: boolean;
16
- };
17
-
18
- type ConditionData = {
19
- id: string;
20
- type: "group";
21
- logicType: "AND" | "OR";
22
- children: JsonValue[];
23
- };
24
- type TextLimitData = NodeData & {
25
- minChars?: number;
26
- maxChars?: number;
27
- minWords?: number;
28
- maxWords?: number;
29
- };
30
- type BaseTextData = TextLimitData & {
31
- label: string;
32
- description: string;
33
- condition: ConditionData;
34
- };
35
- type TextInputData = BaseTextData & {
36
- placeholder: string;
37
- longAnswer: boolean;
38
- };
39
- type EmailInputData = BaseTextData;
40
- type DateInputData = BaseTextData;
41
- type NumberInputData = BaseTextData & {
42
- min?: number;
43
- max?: number;
44
- };
45
- type ZipCodeInputData = BaseTextData & {
46
- allowedZips: string;
47
- };
48
- type MultiInputField = {
49
- id: string;
50
- label?: string;
51
- value?: string;
52
- };
53
- type MultiInputData = BaseTextData & {
54
- fields: MultiInputField[];
55
- };
56
- type TextValue = string;
57
- type MultiInputValue = Record<string, string>;
58
-
59
- export type { BaseTextData as B, DateInputData as D, EmailInputData as E, MultiInputData as M, NumberInputData as N, PlainTextData as P, TextInputData as T, ZipCodeInputData as Z, PlainTextValue as a, TextValue as b, MultiInputValue as c };