@waypointjs/builder 0.1.4 → 0.1.6

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/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { WaypointSchema, StepDefinition, FieldDefinition, ConditionGroup, ExternalVariable, CustomTypeDefinition, PersistenceMode } from '@waypointjs/core';
2
+ import { WaypointSchema, CustomTypeDefinition, ExternalEnum, StepDefinition, FieldDefinition, ConditionGroup, ExternalVariable, PersistenceMode } from '@waypointjs/core';
3
3
  import * as zustand from 'zustand';
4
4
 
5
5
  /**
@@ -115,8 +115,14 @@ interface WaypointBuilderProps {
115
115
  className?: string;
116
116
  /** Inline style applied to the root element */
117
117
  style?: React.CSSProperties;
118
+ /** Disable all editing — view-only mode */
119
+ readOnly?: boolean;
120
+ /** Custom field types provided by the host app — appear in the field type dropdown */
121
+ appCustomTypes?: CustomTypeDefinition[];
122
+ /** External enum lists — select/multiselect/radio fields can reference them by id */
123
+ externalEnums?: ExternalEnum[];
118
124
  }
119
- declare function WaypointBuilder({ defaultValue, onChange, onSave, theme, className, style, }: WaypointBuilderProps): react_jsx_runtime.JSX.Element;
125
+ declare function WaypointBuilder({ defaultValue, onChange, onSave, theme, className, style, readOnly, appCustomTypes, externalEnums, }: WaypointBuilderProps): react_jsx_runtime.JSX.Element;
120
126
 
121
127
  interface BuilderState {
122
128
  /** The schema being edited */
@@ -134,11 +140,13 @@ interface BuilderActions {
134
140
  addStep: (step?: Partial<Omit<StepDefinition, "id">>) => string;
135
141
  updateStep: (stepId: string, updates: Partial<Omit<StepDefinition, "id">>) => void;
136
142
  removeStep: (stepId: string) => void;
143
+ duplicateStep: (stepId: string) => void;
137
144
  reorderSteps: (fromIndex: number, toIndex: number) => void;
138
145
  selectStep: (stepId: string | null) => void;
139
146
  addField: (stepId: string, field?: Partial<Omit<FieldDefinition, "id">>) => string;
140
147
  updateField: (stepId: string, fieldId: string, updates: Partial<Omit<FieldDefinition, "id">>) => void;
141
148
  removeField: (stepId: string, fieldId: string) => void;
149
+ duplicateField: (stepId: string, fieldId: string) => void;
142
150
  reorderFields: (stepId: string, fromIndex: number, toIndex: number) => void;
143
151
  selectField: (fieldId: string | null) => void;
144
152
  setStepCondition: (stepId: string, condition: ConditionGroup | undefined) => void;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { WaypointSchema, StepDefinition, FieldDefinition, ConditionGroup, ExternalVariable, CustomTypeDefinition, PersistenceMode } from '@waypointjs/core';
2
+ import { WaypointSchema, CustomTypeDefinition, ExternalEnum, StepDefinition, FieldDefinition, ConditionGroup, ExternalVariable, PersistenceMode } from '@waypointjs/core';
3
3
  import * as zustand from 'zustand';
4
4
 
5
5
  /**
@@ -115,8 +115,14 @@ interface WaypointBuilderProps {
115
115
  className?: string;
116
116
  /** Inline style applied to the root element */
117
117
  style?: React.CSSProperties;
118
+ /** Disable all editing — view-only mode */
119
+ readOnly?: boolean;
120
+ /** Custom field types provided by the host app — appear in the field type dropdown */
121
+ appCustomTypes?: CustomTypeDefinition[];
122
+ /** External enum lists — select/multiselect/radio fields can reference them by id */
123
+ externalEnums?: ExternalEnum[];
118
124
  }
119
- declare function WaypointBuilder({ defaultValue, onChange, onSave, theme, className, style, }: WaypointBuilderProps): react_jsx_runtime.JSX.Element;
125
+ declare function WaypointBuilder({ defaultValue, onChange, onSave, theme, className, style, readOnly, appCustomTypes, externalEnums, }: WaypointBuilderProps): react_jsx_runtime.JSX.Element;
120
126
 
121
127
  interface BuilderState {
122
128
  /** The schema being edited */
@@ -134,11 +140,13 @@ interface BuilderActions {
134
140
  addStep: (step?: Partial<Omit<StepDefinition, "id">>) => string;
135
141
  updateStep: (stepId: string, updates: Partial<Omit<StepDefinition, "id">>) => void;
136
142
  removeStep: (stepId: string) => void;
143
+ duplicateStep: (stepId: string) => void;
137
144
  reorderSteps: (fromIndex: number, toIndex: number) => void;
138
145
  selectStep: (stepId: string | null) => void;
139
146
  addField: (stepId: string, field?: Partial<Omit<FieldDefinition, "id">>) => string;
140
147
  updateField: (stepId: string, fieldId: string, updates: Partial<Omit<FieldDefinition, "id">>) => void;
141
148
  removeField: (stepId: string, fieldId: string) => void;
149
+ duplicateField: (stepId: string, fieldId: string) => void;
142
150
  reorderFields: (stepId: string, fromIndex: number, toIndex: number) => void;
143
151
  selectField: (fieldId: string | null) => void;
144
152
  setStepCondition: (stepId: string, condition: ConditionGroup | undefined) => void;