@surveystudio/node-registery 1.0.2 → 1.2.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/dist/runner.d.mts CHANGED
@@ -1,15 +1,52 @@
1
- export { C as CompleteRunnerRegistry, N as NodeRunner, a as NodeRunnerProps, Q as QuestionNodeDefinition, R as RunnerRegistry, d as defineQuestionNode, b as defineRunnerRegistry } from './types-BpvjaHAP.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-4zXsOMLb.mjs';
2
2
  import 'react';
3
- import './coreTypes-D-1hYIe5.mjs';
3
+ import './coreTypes-CyFAym5A.mjs';
4
4
 
5
5
  declare const plainTextRunner: {
6
6
  type: "plainText";
7
7
  };
8
8
 
9
+ declare const textInputRunner: {
10
+ type: "textInput";
11
+ };
12
+ declare const emailInputRunner: {
13
+ type: "emailInput";
14
+ };
15
+ declare const dateInputRunner: {
16
+ type: "dateInput";
17
+ };
18
+ declare const numberInputRunner: {
19
+ type: "numberInput";
20
+ };
21
+ declare const zipCodeInputRunner: {
22
+ type: "zipCodeInput";
23
+ };
24
+ declare const multiInputRunner: {
25
+ type: "multiInput";
26
+ };
27
+
9
28
  declare const runnerRegistry: {
29
+ readonly textInput: {
30
+ type: "textInput";
31
+ };
32
+ readonly numberInput: {
33
+ type: "numberInput";
34
+ };
35
+ readonly emailInput: {
36
+ type: "emailInput";
37
+ };
38
+ readonly dateInput: {
39
+ type: "dateInput";
40
+ };
41
+ readonly multiInput: {
42
+ type: "multiInput";
43
+ };
44
+ readonly zipCodeInput: {
45
+ type: "zipCodeInput";
46
+ };
10
47
  readonly plainText: {
11
48
  type: "plainText";
12
49
  };
13
50
  };
14
51
 
15
- export { plainTextRunner, runnerRegistry };
52
+ export { dateInputRunner, emailInputRunner, multiInputRunner, numberInputRunner, plainTextRunner, runnerRegistry, textInputRunner, zipCodeInputRunner };
package/dist/runner.mjs CHANGED
@@ -11,13 +11,33 @@ var plainTextRunner = {
11
11
  type: "plainText"
12
12
  };
13
13
 
14
+ // src/nodes/textLike/runner.ts
15
+ var textInputRunner = { type: "textInput" };
16
+ var emailInputRunner = { type: "emailInput" };
17
+ var dateInputRunner = { type: "dateInput" };
18
+ var numberInputRunner = { type: "numberInput" };
19
+ var zipCodeInputRunner = { type: "zipCodeInput" };
20
+ var multiInputRunner = { type: "multiInput" };
21
+
14
22
  // src/runner/index.ts
15
23
  var runnerRegistry = defineRunnerRegistry({
24
+ textInput: textInputRunner,
25
+ numberInput: numberInputRunner,
26
+ emailInput: emailInputRunner,
27
+ dateInput: dateInputRunner,
28
+ multiInput: multiInputRunner,
29
+ zipCodeInput: zipCodeInputRunner,
16
30
  plainText: plainTextRunner
17
31
  });
18
32
  export {
33
+ dateInputRunner,
19
34
  defineQuestionNode,
20
35
  defineRunnerRegistry,
36
+ emailInputRunner,
37
+ multiInputRunner,
38
+ numberInputRunner,
21
39
  plainTextRunner,
22
- runnerRegistry
40
+ runnerRegistry,
41
+ textInputRunner,
42
+ zipCodeInputRunner
23
43
  };
@@ -1,5 +1,5 @@
1
- import { ComponentType, ReactNode } from 'react';
2
- import { Q as QuestionNodeType, i as SurveyNodeType, h as NodeData, j as NodeValue, f as NodeManifest, N as NodeLogic } from './coreTypes-D-1hYIe5.mjs';
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';
3
3
 
4
4
  interface NodeRunnerProps<TData extends NodeData = NodeData, TValue extends NodeValue = NodeValue> {
5
5
  readonly data: Readonly<TData>;
@@ -48,4 +48,4 @@ declare function defineQuestionNode<const TType extends QuestionNodeType, TData
48
48
  declare function defineBuilderRegistry<const TRegistry extends Readonly<Partial<Record<SurveyNodeType, unknown>>>>(registry: TRegistry): TRegistry;
49
49
  declare function defineRunnerRegistry<const TRegistry extends Readonly<Partial<Record<SurveyNodeType, unknown>>>>(registry: TRegistry): TRegistry;
50
50
 
51
- export { type BuilderRegistry as B, type CompleteRunnerRegistry as C, type NodeRunner as N, type QuestionNodeDefinition as Q, type RunnerRegistry as R, type NodeRunnerProps as a, defineRunnerRegistry as b, type CompleteBuilderRegistry as c, defineQuestionNode as d, type NodeBuilder as e, type NodeBuilderProps as f, type NodeCanvasProps as g, defineBuilderRegistry as h };
51
+ export { type BuilderRegistry as B, type CompleteBuilderRegistry as C, type NodeBuilder as N, type QuestionNodeDefinition as Q, type RunnerRegistry as R, type NodeBuilderProps as a, type NodeCanvasProps as b, defineQuestionNode as c, defineBuilderRegistry as d, type CompleteRunnerRegistry as e, type NodeRunner as f, type NodeRunnerProps as g, defineRunnerRegistry as h };
@@ -0,0 +1,59 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surveystudio/node-registery",
3
- "version": "1.0.2",
3
+ "version": "1.2.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,18 +0,0 @@
1
- import { h as NodeData, J as JsonValue } from './coreTypes-D-1hYIe5.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
- export type { PlainTextData as P, PlainTextValue as a };