treege 3.0.0-beta.79 → 3.0.0-beta.80
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/editor/utils/cleanEmptyData.d.ts +18 -0
- package/dist/editor/utils/cleanNodeConfig.d.ts +3 -3
- package/dist/{editor-CqWlTe-N.js → editor-Dw_ODEe1.js} +374 -337
- package/dist/editor.js +1 -1
- package/dist/main.js +3 -3
- package/dist/{renderer-DOEjomS9.js → renderer-CN83AtIp.js} +1 -1
- package/dist/renderer-native.js +1 -1
- package/dist/renderer.js +2 -2
- package/dist/{useRenderNode-DJ0mFozt.js → useRenderNode-BZ7fZJxT.js} +29 -39
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Flow } from '../../shared/types/node';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a copy of `data` keeping only the entries that carry information:
|
|
4
|
+
* everything that is neither empty (see `isEmptyValue`) nor a redundant field
|
|
5
|
+
* default (see `DEFAULT_DATA_VALUES`). Meaningful falsy values like `false` and
|
|
6
|
+
* `0` are kept. Used before persisting an input node's form so toggling a single
|
|
7
|
+
* field doesn't flood the node — and the exported JSON — with empty defaults.
|
|
8
|
+
*/
|
|
9
|
+
export declare const cleanEmptyData: (data: Record<string, unknown>) => Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns a copy of the flow trimmed for export: every node's `data` is cleaned
|
|
12
|
+
* of empty values and field defaults (see `cleanEmptyData`), and transient
|
|
13
|
+
* editor UI state is dropped — nodes lose `selected`/`dragging`/`measured` and
|
|
14
|
+
* edges lose `selected`, all of which xyflow recomputes on mount. The input flow
|
|
15
|
+
* is never mutated, so the live editor canvas keeps its values — only the
|
|
16
|
+
* exported/saved artifact is trimmed, mirroring `stripSensitiveHeadersFromFlow`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const cleanFlowData: (flow: Flow) => Flow;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Returns a copy of `data`
|
|
3
|
-
*
|
|
2
|
+
* Returns a copy of `data` keeping only the config blocks that belong to
|
|
3
|
+
* `subType` (non-config keys are always kept).
|
|
4
4
|
*/
|
|
5
|
-
export declare const cleanConfigForSubType:
|
|
5
|
+
export declare const cleanConfigForSubType: (data: Record<string, unknown>, subType: string) => Record<string, unknown>;
|