@process.co/ui 0.0.11 → 0.0.13

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.
@@ -90,6 +90,8 @@ interface SelectProps {
90
90
  placeholder?: string;
91
91
  /** Expected return type for validation */
92
92
  expectedType?: string;
93
+ /** Whether to hide the type badge */
94
+ hideTypeBadge?: boolean;
93
95
  /** Whether this is a required field */
94
96
  required?: boolean;
95
97
  /** Whether this field has a required property error (missing value) */
@@ -147,7 +149,7 @@ interface SelectRenderProps {
147
149
  * />
148
150
  * ```
149
151
  */
150
- declare function Select({ fieldName, label, value, onChange, options: rawOptions, disabled, placeholder, expectedType, required, hasRequiredError, className, children, }: SelectProps): React.JSX.Element;
152
+ declare function Select({ fieldName, label, value, onChange, options: rawOptions, disabled, placeholder, expectedType, hideTypeBadge, required, hasRequiredError, className, children, }: SelectProps): React.JSX.Element;
151
153
 
152
154
  /**
153
155
  * Shared Operator Type Definitions and Utilities
@@ -667,6 +669,29 @@ declare function useAllInferredTypes(): Record<string, string>;
667
669
  * Returns a no-op when not inside any provider.
668
670
  */
669
671
  declare function useSetProperty(): <T = any>(key: string, value: T, metadata?: any) => void;
672
+ /**
673
+ * Hook to trigger a layout update from within a custom control.
674
+ *
675
+ * Call this after structural changes that affect the node's visual layout,
676
+ * such as reordering items or toggling features that change the node's height.
677
+ *
678
+ * In development mode (DevProvider), this is a no-op.
679
+ * In production, this triggers regenerateRfState() to recalculate the flow layout.
680
+ *
681
+ * @example
682
+ * ```tsx
683
+ * function CaseEditor() {
684
+ * const triggerLayoutUpdate = useTriggerLayoutUpdate();
685
+ *
686
+ * const handleReorderCases = (newCases) => {
687
+ * setValue({ ...value, cases: newCases });
688
+ * // Trigger layout recalculation after reordering
689
+ * triggerLayoutUpdate();
690
+ * };
691
+ * }
692
+ * ```
693
+ */
694
+ declare function useTriggerLayoutUpdate(): () => void;
670
695
  /**
671
696
  * Validation rule for a field.
672
697
  */
@@ -743,8 +768,9 @@ declare const index_useNodeProperty: typeof useNodeProperty;
743
768
  declare const index_useSetInferredType: typeof useSetInferredType;
744
769
  declare const index_useSetProperty: typeof useSetProperty;
745
770
  declare const index_useTemplateFieldContext: typeof useTemplateFieldContext;
771
+ declare const index_useTriggerLayoutUpdate: typeof useTriggerLayoutUpdate;
746
772
  declare namespace index {
747
- export { type index_BaseOperatorType as BaseOperatorType, type index_FieldValidationRule as FieldValidationRule, type index_InferConfig as InferConfig, index_InferredTypesContext as InferredTypesContext, type index_InferredTypesContextValue as InferredTypesContextValue, index_InferredTypesProvider as InferredTypesProvider, type index_InferredTypesProviderProps as InferredTypesProviderProps, index_Input as Input, type index_InputProps as InputProps, index_NestedFieldProvider as NestedFieldProvider, type index_NestedFieldProviderProps as NestedFieldProviderProps, index_NodePropertyProvider as NodePropertyProvider, type index_NodePropertyProviderProps as NodePropertyProviderProps, index_OPERATORS_BY_TYPE as OPERATORS_BY_TYPE, type index_OperatorDef as OperatorDef, type index_ParsedTypes as ParsedTypes, index_Select as Select, type index_SelectOption as SelectOption, type index_SelectProps as SelectProps, type index_SelectRenderProps as SelectRenderProps, type index_TemplateFieldChangeEvent as TemplateFieldChangeEvent, type index_TemplateFieldContextValue as TemplateFieldContextValue, type index_TemplateFieldFocusContext as TemplateFieldFocusContext, index_TemplateFieldProvider as TemplateFieldProvider, type index_TemplateFieldProviderProps as TemplateFieldProviderProps, type index_TemplateFieldValidationError as TemplateFieldValidationError, index_computeExtendedType as computeExtendedType, index_filterOperatorsByType as filterOperatorsByType, index_getNumberConstants as getNumberConstants, index_getOperatorsForType as getOperatorsForType, index_getStringConstants as getStringConstants, index_intersectTypes as intersectTypes, index_parseInferSyntax as parseInferSyntax, index_parseInferredTypes as parseInferredTypes, index_useAllInferredTypes as useAllInferredTypes, index_useClearAllInferredTypes as useClearAllInferredTypes, index_useClearInferredType as useClearInferredType, index_useFieldPath as useFieldPath, index_useFieldValidation as useFieldValidation, index_useInferredType as useInferredType, index_useInferredTypes as useInferredTypes, index_useIsInNodePropertyProvider as useIsInNodePropertyProvider, index_useIsInTemplateFieldProvider as useIsInTemplateFieldProvider, index_useNodeProperties as useNodeProperties, index_useNodeProperty as useNodeProperty, index_useSetInferredType as useSetInferredType, index_useSetProperty as useSetProperty, index_useTemplateFieldContext as useTemplateFieldContext };
773
+ export { type index_BaseOperatorType as BaseOperatorType, type index_FieldValidationRule as FieldValidationRule, type index_InferConfig as InferConfig, index_InferredTypesContext as InferredTypesContext, type index_InferredTypesContextValue as InferredTypesContextValue, index_InferredTypesProvider as InferredTypesProvider, type index_InferredTypesProviderProps as InferredTypesProviderProps, index_Input as Input, type index_InputProps as InputProps, index_NestedFieldProvider as NestedFieldProvider, type index_NestedFieldProviderProps as NestedFieldProviderProps, index_NodePropertyProvider as NodePropertyProvider, type index_NodePropertyProviderProps as NodePropertyProviderProps, index_OPERATORS_BY_TYPE as OPERATORS_BY_TYPE, type index_OperatorDef as OperatorDef, type index_ParsedTypes as ParsedTypes, index_Select as Select, type index_SelectOption as SelectOption, type index_SelectProps as SelectProps, type index_SelectRenderProps as SelectRenderProps, type index_TemplateFieldChangeEvent as TemplateFieldChangeEvent, type index_TemplateFieldContextValue as TemplateFieldContextValue, type index_TemplateFieldFocusContext as TemplateFieldFocusContext, index_TemplateFieldProvider as TemplateFieldProvider, type index_TemplateFieldProviderProps as TemplateFieldProviderProps, type index_TemplateFieldValidationError as TemplateFieldValidationError, index_computeExtendedType as computeExtendedType, index_filterOperatorsByType as filterOperatorsByType, index_getNumberConstants as getNumberConstants, index_getOperatorsForType as getOperatorsForType, index_getStringConstants as getStringConstants, index_intersectTypes as intersectTypes, index_parseInferSyntax as parseInferSyntax, index_parseInferredTypes as parseInferredTypes, index_useAllInferredTypes as useAllInferredTypes, index_useClearAllInferredTypes as useClearAllInferredTypes, index_useClearInferredType as useClearInferredType, index_useFieldPath as useFieldPath, index_useFieldValidation as useFieldValidation, index_useInferredType as useInferredType, index_useInferredTypes as useInferredTypes, index_useIsInNodePropertyProvider as useIsInNodePropertyProvider, index_useIsInTemplateFieldProvider as useIsInTemplateFieldProvider, index_useNodeProperties as useNodeProperties, index_useNodeProperty as useNodeProperty, index_useSetInferredType as useSetInferredType, index_useSetProperty as useSetProperty, index_useTemplateFieldContext as useTemplateFieldContext, index_useTriggerLayoutUpdate as useTriggerLayoutUpdate };
748
774
  }
749
775
 
750
- export { useClearAllInferredTypes as A, useAllInferredTypes as B, useSetProperty as C, useFieldValidation as D, Input as E, type FieldValidationRule as F, type InputProps as G, type SelectProps as H, type InferredTypesContextValue as I, type SelectOption as J, type SelectRenderProps as K, parseInferredTypes as L, computeExtendedType as M, NestedFieldProvider as N, OPERATORS_BY_TYPE as O, filterOperatorsByType as P, getStringConstants as Q, getNumberConstants as R, Select as S, type TemplateFieldContextValue as T, type BaseOperatorType as U, type OperatorDef as V, type ParsedTypes as W, useIsInTemplateFieldProvider as a, useFieldPath as b, TemplateFieldProvider as c, type TemplateFieldProviderProps as d, type NestedFieldProviderProps as e, type TemplateFieldValidationError as f, type TemplateFieldFocusContext as g, type TemplateFieldChangeEvent as h, index as i, InferredTypesContext as j, useInferredTypes as k, type InferredTypesProviderProps as l, InferredTypesProvider as m, intersectTypes as n, type InferConfig as o, parseInferSyntax as p, getOperatorsForType as q, type NodePropertyProviderProps as r, NodePropertyProvider as s, useIsInNodePropertyProvider as t, useTemplateFieldContext as u, useNodeProperty as v, useNodeProperties as w, useInferredType as x, useSetInferredType as y, useClearInferredType as z };
776
+ export { useClearAllInferredTypes as A, useAllInferredTypes as B, useSetProperty as C, useTriggerLayoutUpdate as D, useFieldValidation as E, type FieldValidationRule as F, Input as G, type InputProps as H, type InferredTypesContextValue as I, type SelectProps as J, type SelectOption as K, type SelectRenderProps as L, parseInferredTypes as M, NestedFieldProvider as N, OPERATORS_BY_TYPE as O, computeExtendedType as P, filterOperatorsByType as Q, getStringConstants as R, Select as S, type TemplateFieldContextValue as T, getNumberConstants as U, type BaseOperatorType as V, type OperatorDef as W, type ParsedTypes as X, useIsInTemplateFieldProvider as a, useFieldPath as b, TemplateFieldProvider as c, type TemplateFieldProviderProps as d, type NestedFieldProviderProps as e, type TemplateFieldValidationError as f, type TemplateFieldFocusContext as g, type TemplateFieldChangeEvent as h, index as i, InferredTypesContext as j, useInferredTypes as k, type InferredTypesProviderProps as l, InferredTypesProvider as m, intersectTypes as n, type InferConfig as o, parseInferSyntax as p, getOperatorsForType as q, type NodePropertyProviderProps as r, NodePropertyProvider as s, useIsInNodePropertyProvider as t, useTemplateFieldContext as u, useNodeProperty as v, useNodeProperties as w, useInferredType as x, useSetInferredType as y, useClearInferredType as z };
@@ -90,6 +90,8 @@ interface SelectProps {
90
90
  placeholder?: string;
91
91
  /** Expected return type for validation */
92
92
  expectedType?: string;
93
+ /** Whether to hide the type badge */
94
+ hideTypeBadge?: boolean;
93
95
  /** Whether this is a required field */
94
96
  required?: boolean;
95
97
  /** Whether this field has a required property error (missing value) */
@@ -147,7 +149,7 @@ interface SelectRenderProps {
147
149
  * />
148
150
  * ```
149
151
  */
150
- declare function Select({ fieldName, label, value, onChange, options: rawOptions, disabled, placeholder, expectedType, required, hasRequiredError, className, children, }: SelectProps): React.JSX.Element;
152
+ declare function Select({ fieldName, label, value, onChange, options: rawOptions, disabled, placeholder, expectedType, hideTypeBadge, required, hasRequiredError, className, children, }: SelectProps): React.JSX.Element;
151
153
 
152
154
  /**
153
155
  * Shared Operator Type Definitions and Utilities
@@ -667,6 +669,29 @@ declare function useAllInferredTypes(): Record<string, string>;
667
669
  * Returns a no-op when not inside any provider.
668
670
  */
669
671
  declare function useSetProperty(): <T = any>(key: string, value: T, metadata?: any) => void;
672
+ /**
673
+ * Hook to trigger a layout update from within a custom control.
674
+ *
675
+ * Call this after structural changes that affect the node's visual layout,
676
+ * such as reordering items or toggling features that change the node's height.
677
+ *
678
+ * In development mode (DevProvider), this is a no-op.
679
+ * In production, this triggers regenerateRfState() to recalculate the flow layout.
680
+ *
681
+ * @example
682
+ * ```tsx
683
+ * function CaseEditor() {
684
+ * const triggerLayoutUpdate = useTriggerLayoutUpdate();
685
+ *
686
+ * const handleReorderCases = (newCases) => {
687
+ * setValue({ ...value, cases: newCases });
688
+ * // Trigger layout recalculation after reordering
689
+ * triggerLayoutUpdate();
690
+ * };
691
+ * }
692
+ * ```
693
+ */
694
+ declare function useTriggerLayoutUpdate(): () => void;
670
695
  /**
671
696
  * Validation rule for a field.
672
697
  */
@@ -743,8 +768,9 @@ declare const index_useNodeProperty: typeof useNodeProperty;
743
768
  declare const index_useSetInferredType: typeof useSetInferredType;
744
769
  declare const index_useSetProperty: typeof useSetProperty;
745
770
  declare const index_useTemplateFieldContext: typeof useTemplateFieldContext;
771
+ declare const index_useTriggerLayoutUpdate: typeof useTriggerLayoutUpdate;
746
772
  declare namespace index {
747
- export { type index_BaseOperatorType as BaseOperatorType, type index_FieldValidationRule as FieldValidationRule, type index_InferConfig as InferConfig, index_InferredTypesContext as InferredTypesContext, type index_InferredTypesContextValue as InferredTypesContextValue, index_InferredTypesProvider as InferredTypesProvider, type index_InferredTypesProviderProps as InferredTypesProviderProps, index_Input as Input, type index_InputProps as InputProps, index_NestedFieldProvider as NestedFieldProvider, type index_NestedFieldProviderProps as NestedFieldProviderProps, index_NodePropertyProvider as NodePropertyProvider, type index_NodePropertyProviderProps as NodePropertyProviderProps, index_OPERATORS_BY_TYPE as OPERATORS_BY_TYPE, type index_OperatorDef as OperatorDef, type index_ParsedTypes as ParsedTypes, index_Select as Select, type index_SelectOption as SelectOption, type index_SelectProps as SelectProps, type index_SelectRenderProps as SelectRenderProps, type index_TemplateFieldChangeEvent as TemplateFieldChangeEvent, type index_TemplateFieldContextValue as TemplateFieldContextValue, type index_TemplateFieldFocusContext as TemplateFieldFocusContext, index_TemplateFieldProvider as TemplateFieldProvider, type index_TemplateFieldProviderProps as TemplateFieldProviderProps, type index_TemplateFieldValidationError as TemplateFieldValidationError, index_computeExtendedType as computeExtendedType, index_filterOperatorsByType as filterOperatorsByType, index_getNumberConstants as getNumberConstants, index_getOperatorsForType as getOperatorsForType, index_getStringConstants as getStringConstants, index_intersectTypes as intersectTypes, index_parseInferSyntax as parseInferSyntax, index_parseInferredTypes as parseInferredTypes, index_useAllInferredTypes as useAllInferredTypes, index_useClearAllInferredTypes as useClearAllInferredTypes, index_useClearInferredType as useClearInferredType, index_useFieldPath as useFieldPath, index_useFieldValidation as useFieldValidation, index_useInferredType as useInferredType, index_useInferredTypes as useInferredTypes, index_useIsInNodePropertyProvider as useIsInNodePropertyProvider, index_useIsInTemplateFieldProvider as useIsInTemplateFieldProvider, index_useNodeProperties as useNodeProperties, index_useNodeProperty as useNodeProperty, index_useSetInferredType as useSetInferredType, index_useSetProperty as useSetProperty, index_useTemplateFieldContext as useTemplateFieldContext };
773
+ export { type index_BaseOperatorType as BaseOperatorType, type index_FieldValidationRule as FieldValidationRule, type index_InferConfig as InferConfig, index_InferredTypesContext as InferredTypesContext, type index_InferredTypesContextValue as InferredTypesContextValue, index_InferredTypesProvider as InferredTypesProvider, type index_InferredTypesProviderProps as InferredTypesProviderProps, index_Input as Input, type index_InputProps as InputProps, index_NestedFieldProvider as NestedFieldProvider, type index_NestedFieldProviderProps as NestedFieldProviderProps, index_NodePropertyProvider as NodePropertyProvider, type index_NodePropertyProviderProps as NodePropertyProviderProps, index_OPERATORS_BY_TYPE as OPERATORS_BY_TYPE, type index_OperatorDef as OperatorDef, type index_ParsedTypes as ParsedTypes, index_Select as Select, type index_SelectOption as SelectOption, type index_SelectProps as SelectProps, type index_SelectRenderProps as SelectRenderProps, type index_TemplateFieldChangeEvent as TemplateFieldChangeEvent, type index_TemplateFieldContextValue as TemplateFieldContextValue, type index_TemplateFieldFocusContext as TemplateFieldFocusContext, index_TemplateFieldProvider as TemplateFieldProvider, type index_TemplateFieldProviderProps as TemplateFieldProviderProps, type index_TemplateFieldValidationError as TemplateFieldValidationError, index_computeExtendedType as computeExtendedType, index_filterOperatorsByType as filterOperatorsByType, index_getNumberConstants as getNumberConstants, index_getOperatorsForType as getOperatorsForType, index_getStringConstants as getStringConstants, index_intersectTypes as intersectTypes, index_parseInferSyntax as parseInferSyntax, index_parseInferredTypes as parseInferredTypes, index_useAllInferredTypes as useAllInferredTypes, index_useClearAllInferredTypes as useClearAllInferredTypes, index_useClearInferredType as useClearInferredType, index_useFieldPath as useFieldPath, index_useFieldValidation as useFieldValidation, index_useInferredType as useInferredType, index_useInferredTypes as useInferredTypes, index_useIsInNodePropertyProvider as useIsInNodePropertyProvider, index_useIsInTemplateFieldProvider as useIsInTemplateFieldProvider, index_useNodeProperties as useNodeProperties, index_useNodeProperty as useNodeProperty, index_useSetInferredType as useSetInferredType, index_useSetProperty as useSetProperty, index_useTemplateFieldContext as useTemplateFieldContext, index_useTriggerLayoutUpdate as useTriggerLayoutUpdate };
748
774
  }
749
775
 
750
- export { useClearAllInferredTypes as A, useAllInferredTypes as B, useSetProperty as C, useFieldValidation as D, Input as E, type FieldValidationRule as F, type InputProps as G, type SelectProps as H, type InferredTypesContextValue as I, type SelectOption as J, type SelectRenderProps as K, parseInferredTypes as L, computeExtendedType as M, NestedFieldProvider as N, OPERATORS_BY_TYPE as O, filterOperatorsByType as P, getStringConstants as Q, getNumberConstants as R, Select as S, type TemplateFieldContextValue as T, type BaseOperatorType as U, type OperatorDef as V, type ParsedTypes as W, useIsInTemplateFieldProvider as a, useFieldPath as b, TemplateFieldProvider as c, type TemplateFieldProviderProps as d, type NestedFieldProviderProps as e, type TemplateFieldValidationError as f, type TemplateFieldFocusContext as g, type TemplateFieldChangeEvent as h, index as i, InferredTypesContext as j, useInferredTypes as k, type InferredTypesProviderProps as l, InferredTypesProvider as m, intersectTypes as n, type InferConfig as o, parseInferSyntax as p, getOperatorsForType as q, type NodePropertyProviderProps as r, NodePropertyProvider as s, useIsInNodePropertyProvider as t, useTemplateFieldContext as u, useNodeProperty as v, useNodeProperties as w, useInferredType as x, useSetInferredType as y, useClearInferredType as z };
776
+ export { useClearAllInferredTypes as A, useAllInferredTypes as B, useSetProperty as C, useTriggerLayoutUpdate as D, useFieldValidation as E, type FieldValidationRule as F, Input as G, type InputProps as H, type InferredTypesContextValue as I, type SelectProps as J, type SelectOption as K, type SelectRenderProps as L, parseInferredTypes as M, NestedFieldProvider as N, OPERATORS_BY_TYPE as O, computeExtendedType as P, filterOperatorsByType as Q, getStringConstants as R, Select as S, type TemplateFieldContextValue as T, getNumberConstants as U, type BaseOperatorType as V, type OperatorDef as W, type ParsedTypes as X, useIsInTemplateFieldProvider as a, useFieldPath as b, TemplateFieldProvider as c, type TemplateFieldProviderProps as d, type NestedFieldProviderProps as e, type TemplateFieldValidationError as f, type TemplateFieldFocusContext as g, type TemplateFieldChangeEvent as h, index as i, InferredTypesContext as j, useInferredTypes as k, type InferredTypesProviderProps as l, InferredTypesProvider as m, intersectTypes as n, type InferConfig as o, parseInferSyntax as p, getOperatorsForType as q, type NodePropertyProviderProps as r, NodePropertyProvider as s, useIsInNodePropertyProvider as t, useTemplateFieldContext as u, useNodeProperty as v, useNodeProperties as w, useInferredType as x, useSetInferredType as y, useClearInferredType as z };
package/dist/index.cjs CHANGED
@@ -5189,6 +5189,9 @@ __export(fields_exports, {
5189
5189
  },
5190
5190
  useTemplateFieldContext: function() {
5191
5191
  return useTemplateFieldContext;
5192
+ },
5193
+ useTriggerLayoutUpdate: function() {
5194
+ return useTriggerLayoutUpdate;
5192
5195
  }
5193
5196
  });
5194
5197
  var DevContext = React2.createContext(null);
@@ -5416,7 +5419,7 @@ function useResolvedExpectedType2(expectedType, devCtx) {
5416
5419
  ]);
5417
5420
  }
5418
5421
  function Select2(param) {
5419
- var fieldName = param.fieldName, label = param.label, value = param.value, onChange = param.onChange, rawOptions = param.options, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, placeholder = param.placeholder, _param_expectedType = param.expectedType, expectedType = _param_expectedType === void 0 ? "string" : _param_expectedType, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_hasRequiredError = param.hasRequiredError, hasRequiredError = _param_hasRequiredError === void 0 ? false : _param_hasRequiredError, className = param.className, children = param.children;
5422
+ var fieldName = param.fieldName, label = param.label, value = param.value, onChange = param.onChange, rawOptions = param.options, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled, placeholder = param.placeholder, _param_expectedType = param.expectedType, expectedType = _param_expectedType === void 0 ? "string" : _param_expectedType, _param_hideTypeBadge = param.hideTypeBadge, hideTypeBadge = _param_hideTypeBadge === void 0 ? false : _param_hideTypeBadge, _param_required = param.required, required = _param_required === void 0 ? false : _param_required, _param_hasRequiredError = param.hasRequiredError, hasRequiredError = _param_hasRequiredError === void 0 ? false : _param_hasRequiredError, className = param.className, children = param.children;
5420
5423
  var devCtx = React2.useContext(DevContext);
5421
5424
  var resolvedExpectedType = useResolvedExpectedType2(expectedType, devCtx);
5422
5425
  var _React2__namespace_useState = _sliced_to_array(React2__namespace.useState(false), 2), isExpressionMode = _React2__namespace_useState[0], setIsExpressionMode = _React2__namespace_useState[1];
@@ -6065,6 +6068,18 @@ function useSetProperty() {
6065
6068
  devContext
6066
6069
  ]);
6067
6070
  }
6071
+ function useTriggerLayoutUpdate() {
6072
+ var devContext = React2.useContext(DevContext);
6073
+ return React2.useCallback(function() {
6074
+ if (devContext) {
6075
+ console.log("[useTriggerLayoutUpdate] Dev mode - layout update is a no-op");
6076
+ } else {
6077
+ console.warn("[useTriggerLayoutUpdate] No provider - layout update ignored");
6078
+ }
6079
+ }, [
6080
+ devContext
6081
+ ]);
6082
+ }
6068
6083
  function useFieldValidation() {
6069
6084
  var setFieldRequired = React2.useCallback(function(fieldName, required) {
6070
6085
  console.warn('[useFieldValidation] Mock mode - cannot set required for "'.concat(fieldName, '"'));