@process.co/ui 0.0.12 → 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 +29 -0
- package/dist/components/fields/index.cjs +20 -1
- package/dist/components/fields/index.cjs.map +1 -1
- package/dist/components/fields/index.d.cts +1 -1
- package/dist/components/fields/index.d.ts +1 -1
- package/dist/components/fields/index.js +19 -2
- package/dist/components/fields/index.js.map +1 -1
- package/dist/{index-ep9HbrZE.d.cts → index-pApzdjfp.d.cts} +37 -3
- package/dist/{index-ep9HbrZE.d.ts → index-pApzdjfp.d.ts} +37 -3
- package/dist/index.cjs +24 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
@@ -5031,7 +5031,7 @@ function useResolvedExpectedType2(expectedType, devCtx) {
|
|
|
5031
5031
|
]);
|
|
5032
5032
|
}
|
|
5033
5033
|
function Select2(param) {
|
|
5034
|
-
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;
|
|
5034
|
+
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;
|
|
5035
5035
|
var devCtx = React4.useContext(DevContext);
|
|
5036
5036
|
var resolvedExpectedType = useResolvedExpectedType2(expectedType, devCtx);
|
|
5037
5037
|
var _React4__namespace_useState = _sliced_to_array(React4__namespace.useState(false), 2), isExpressionMode = _React4__namespace_useState[0], setIsExpressionMode = _React4__namespace_useState[1];
|
|
@@ -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;
|