@process.co/ui 0.0.13 → 0.0.14

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
@@ -303,6 +303,35 @@ function MyControl({ fieldName }) {
303
303
 
304
304
  ---
305
305
 
306
+ ## Flow Editor Actions
307
+
308
+ Custom controls can trigger flow-level side effects using a unified hook:
309
+
310
+ ```tsx
311
+ import { useFlowEditorActions } from '@process.co/ui/fields';
312
+
313
+ function SwitchEditor({ fieldName }) {
314
+ const { triggerLayoutUpdate, triggerValidation, clearValidationErrorsByPrefix } =
315
+ useFlowEditorActions();
316
+
317
+ const handleRemoveCase = (caseId: string) => {
318
+ clearValidationErrorsByPrefix(caseId);
319
+ triggerLayoutUpdate();
320
+ triggerValidation();
321
+ };
322
+ }
323
+ ```
324
+
325
+ ### Actions
326
+
327
+ | Action | Description |
328
+ |--------|-------------|
329
+ | `triggerLayoutUpdate()` | Recalculate node layout after structural changes |
330
+ | `triggerValidation()` | Run unified flow validation |
331
+ | `clearValidationErrorsByPrefix(prefix)` | Remove expression errors matching a field prefix |
332
+
333
+ ---
334
+
306
335
  ## Building Custom Controls
307
336
 
308
337
  Custom controls integrate with Process.co's collaborative editing system through the `useNodeProperty` hook.
@@ -5649,6 +5649,23 @@ function useClearAllInferredTypes() {
5649
5649
  devContext
5650
5650
  ]);
5651
5651
  }
5652
+ function useClearValidationErrorsByPrefix() {
5653
+ return React4.useCallback(function(fieldPrefix) {
5654
+ console.log('[useClearValidationErrorsByPrefix] Dev mode - clearing errors with prefix "'.concat(fieldPrefix, '" is a no-op'));
5655
+ }, []);
5656
+ }
5657
+ function useFlowEditorActions() {
5658
+ var clearValidationErrorsByPrefix = useClearValidationErrorsByPrefix();
5659
+ return {
5660
+ triggerLayoutUpdate: function() {
5661
+ console.log("[useFlowEditorActions] Dev mode - triggerLayoutUpdate is a no-op");
5662
+ },
5663
+ triggerValidation: function() {
5664
+ console.log("[useFlowEditorActions] Dev mode - triggerValidation is a no-op");
5665
+ },
5666
+ clearValidationErrorsByPrefix: clearValidationErrorsByPrefix
5667
+ };
5668
+ }
5652
5669
  function useAllInferredTypes() {
5653
5670
  var devContext = React4.useContext(DevContext);
5654
5671
  var _React4_useState = _sliced_to_array(React4.useState(function() {
@@ -5739,8 +5756,10 @@ exports.parseInferredTypes = parseInferredTypes;
5739
5756
  exports.useAllInferredTypes = useAllInferredTypes;
5740
5757
  exports.useClearAllInferredTypes = useClearAllInferredTypes;
5741
5758
  exports.useClearInferredType = useClearInferredType;
5759
+ exports.useClearValidationErrorsByPrefix = useClearValidationErrorsByPrefix;
5742
5760
  exports.useFieldPath = useFieldPath;
5743
5761
  exports.useFieldValidation = useFieldValidation;
5762
+ exports.useFlowEditorActions = useFlowEditorActions;
5744
5763
  exports.useInferredType = useInferredType;
5745
5764
  exports.useInferredTypes = useInferredTypes;
5746
5765
  exports.useIsInNodePropertyProvider = useIsInNodePropertyProvider;