@surveystudio/node-registery 1.2.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:
@@ -44,6 +46,7 @@ Migrated nodes:
44
46
  - `ranking` logic
45
47
  - `rating` logic
46
48
  - `slider` logic
49
+ - `consent` logic
47
50
  - `plainText`
48
51
 
49
52
  The registry contract test intentionally fails until all planned question nodes are migrated.
@@ -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 };