@squeed/flow-sdk 2.0.34 → 2.0.36
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 +88 -0
- package/dist/{contentPreviewDocument-C2D0H-Lr.js → contentPreviewDocument-Bhsc4K4s.js} +283 -270
- package/dist/{contentPreviewDocument-C2D0H-Lr.js.map → contentPreviewDocument-Bhsc4K4s.js.map} +1 -1
- package/dist/contentPreviewDocument-i1zWN5gw.cjs +23 -0
- package/dist/{contentPreviewDocument-BsKd0dD4.cjs.map → contentPreviewDocument-i1zWN5gw.cjs.map} +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -9
- package/dist/index.d.ts +30 -9
- package/dist/index.js +10938 -10306
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/contentPreviewDocument-BsKd0dD4.cjs +0 -10
package/README.md
CHANGED
|
@@ -479,6 +479,59 @@ other default object views, and reopen parents. Dots use
|
|
|
479
479
|
the same per-node actions and remain interactive; there is no global view lock.
|
|
480
480
|
`allNodesIconLabel` reflects the current node modes.
|
|
481
481
|
|
|
482
|
+
For non-parent Object nodes with Markdown, HTML, or JSX `$content`, the expanded
|
|
483
|
+
header dot reuses `setNodeViewMode(id, "icon-label")`. It does not switch to an
|
|
484
|
+
empty properties header. Reopening reuses `restoreNodeView` and the existing
|
|
485
|
+
header/content rendering; the content source and parent-collapse behavior are
|
|
486
|
+
unchanged.
|
|
487
|
+
|
|
488
|
+
An explicit `$label: ""` on HTML/JSX content omits the expanded content header
|
|
489
|
+
and its dot. The node sizes to the preview's intrinsic width, capped at the
|
|
490
|
+
viewport width minus 40px, and grows or shrinks with the content height instead
|
|
491
|
+
of using the property-table minimum and fixed 360px preview height.
|
|
492
|
+
Explicit custom widths remain supported; Fill and fullscreen use their allocated
|
|
493
|
+
dimensions. HTML auto-height uses a nonce-protected measurement script and accepts
|
|
494
|
+
size messages only from that preview's iframe. Content scripts remain sanitized
|
|
495
|
+
out, and same-origin access remains disabled.
|
|
496
|
+
Internal HTML/JSX styling remains authoritative. Missing labels, named content,
|
|
497
|
+
Markdown and properties views retain their headers and sizing. Use
|
|
498
|
+
`$borderRadius: 0` independently for square corners. Existing content source and
|
|
499
|
+
fullscreen controls remain available.
|
|
500
|
+
|
|
501
|
+
### Live JSX Content References
|
|
502
|
+
|
|
503
|
+
Inside JSX `$content`, a value can reference another node's JSX content:
|
|
504
|
+
|
|
505
|
+
```json
|
|
506
|
+
{
|
|
507
|
+
"type": "text",
|
|
508
|
+
"text": {
|
|
509
|
+
"$contentRef": "root.navigation",
|
|
510
|
+
"path": [0, "children", 1, "text"]
|
|
511
|
+
},
|
|
512
|
+
"rawStyle": { "fontSize": "28px" }
|
|
513
|
+
}
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
`path` is relative to the source node's `$content` array. Omitting it references
|
|
517
|
+
the whole array, for example `"children": { "$contentRef": "root.header" }`.
|
|
518
|
+
Referenced values retain their types; arrays are not implicitly flattened.
|
|
519
|
+
Optional literal `prefix` and `suffix` strings format string values, such as
|
|
520
|
+
keeping an image gradient before a referenced CSS image URL. No code executes.
|
|
521
|
+
|
|
522
|
+
References resolve within the current document at compilation. Updating the
|
|
523
|
+
source updates the rendered consumer; source JSON and the consumer's other
|
|
524
|
+
styles remain unchanged. The source editor preserves reference JSON rather than
|
|
525
|
+
saving the resolved copy. To detach a value intentionally, replace its reference
|
|
526
|
+
with a literal. Ordinary `$target` edges remain connections, not content bindings.
|
|
527
|
+
Index paths refer to positions: update them when restructuring source components,
|
|
528
|
+
or reference a whole children array when its membership should follow the source.
|
|
529
|
+
|
|
530
|
+
Only JSX sources are supported. Missing paths, cycles, unsafe property names,
|
|
531
|
+
and expansion beyond 100 levels or 100,000 visits produce an error in the affected
|
|
532
|
+
preview rather than aborting the graph. References do not fetch external data or
|
|
533
|
+
cross document ownership boundaries.
|
|
534
|
+
|
|
482
535
|
In `FlowDiagram`, enabling the bulk action also suspends `forms.structured`:
|
|
483
536
|
generated detail nodes and structured form lists disappear without changing the
|
|
484
537
|
workflow data. Disabling it restores the configured `forms.structured` setting
|
|
@@ -635,6 +688,13 @@ center-and-fit; exiting the mode
|
|
|
635
688
|
centers and fits the restored graph. `arrangeNodesInGrid` returns target `sizes`
|
|
636
689
|
and `bounds` when filling. These overrides never change the saved document.
|
|
637
690
|
|
|
691
|
+
On initial Fill load, the canvas measures the visible destination and uses the
|
|
692
|
+
existing Fill calculation to allocate cells before mounting node content. This
|
|
693
|
+
skips the preliminary natural-view mount and initial layout debounce. Hidden
|
|
694
|
+
destinations wait until measurable; weighted rows, spacing, nested loading,
|
|
695
|
+
saved viewports, subsequent resizing and natural sizing on exit are preserved.
|
|
696
|
+
Document preparation still uses its existing two-frame loading gate.
|
|
697
|
+
|
|
638
698
|
### Animated Viewport Actions
|
|
639
699
|
|
|
640
700
|
Capture `FlowEngine` through `callbacks.onInit`. Set `config.animateViewport`
|
|
@@ -654,6 +714,12 @@ Pass `true` as the fourth argument to `focusBranch`, `focusNode`, or
|
|
|
654
714
|
`focusConnections` after a view toggle to fit the new geometry together with
|
|
655
715
|
the layout animation. Existing three-argument calls keep their behavior.
|
|
656
716
|
|
|
717
|
+
For a closing preview in an ordinary document canvas, use
|
|
718
|
+
`engine.restoreView(true, savedViewport, true)` alongside the view change.
|
|
719
|
+
The optional third argument restores the saved viewport in the same transition
|
|
720
|
+
as the closing layout. It does not change Grid/Fill or isolation restoration;
|
|
721
|
+
existing one- and two-argument calls retain their behavior.
|
|
722
|
+
|
|
657
723
|
Animation defaults to false. Explicit false overrides the config default.
|
|
658
724
|
Transitions interpolate pan and zoom over 300ms; center preserves zoom.
|
|
659
725
|
Reduced-motion preferences disable animation. New viewport commands cancel
|
|
@@ -831,6 +897,14 @@ import {
|
|
|
831
897
|
| Composition | `FlowDiagramProvider`, `FlowView`, `useFlowDiagramContext`, `useFlowData`, `FlowDiagramContextValue` |
|
|
832
898
|
| Feedback | `ErrorToast` |
|
|
833
899
|
|
|
900
|
+
`ToolbarSelect` accepts optional `pinned` (default `false`), `open`, and
|
|
901
|
+
`onOpenChange` props. Pinning disables native outside-click dismissal and keeps
|
|
902
|
+
standard option selections open, preserving the existing DOM, position, scroll,
|
|
903
|
+
and focus. The trigger and Escape still close it explicitly. Custom
|
|
904
|
+
`popupContent` owns its selection-close behavior. With `popupContent` and
|
|
905
|
+
`footer`, the footer stays outside the scrolling content. Omit the new props
|
|
906
|
+
to retain the existing uncontrolled dropdown behavior.
|
|
907
|
+
|
|
834
908
|
Use `useFlowDiagramContext()` inside a child component for mode setters,
|
|
835
909
|
selection, bound edit callbacks and `engineRef`; `useFlowData()` supplies node
|
|
836
910
|
and edge lookups. Its maps are read-only by convention: do not mutate them.
|
|
@@ -1086,6 +1160,20 @@ the host; this does not enable executable JSX or create a per-chunk MCP command.
|
|
|
1086
1160
|
|
|
1087
1161
|
With `config.editable: true`, click the content body to edit the original Markdown source. In Collision mode, including filled and embedded Grids, hold Shift when clicking; ordinary clicks retain their selection behavior. Shift is only required to enter the editor. Enter inserts a new line; Ctrl/Cmd+Enter or clicking away saves, and Escape cancels. Read-only mode still prevents editing. Internal JSON refreshes preserve focused editors and unsaved drafts; initial loading and explicit host loading still block interaction. Source whitespace is preserved. The node grows vertically as text is added; label editors grow horizontally within their width limit. Both keep their starting size as a minimum and omit input focus outlines. Clearing the body keeps an empty, editable content view; use `setNodeProp(json, address, "$content", undefined)` to remove the content property. Content nodes use the same minimum width as their object-property rows, and the right-aligned table/article button switches views without changing the document.
|
|
1088
1162
|
|
|
1163
|
+
With one node selected, Enter activates its own visible dot or collapse control.
|
|
1164
|
+
Further presses follow that control's existing open/back sequence. Text inputs,
|
|
1165
|
+
focused controls, dialogs, modifier shortcuts and read-only mode keep their
|
|
1166
|
+
existing behavior; holding Enter does not repeatedly toggle the view.
|
|
1167
|
+
|
|
1168
|
+
An expanded Text node exposes the existing **Show icon** dot on hover or selection;
|
|
1169
|
+
**Show text** restores the Text view without rewriting source metadata. Double-click
|
|
1170
|
+
an editable Text node without an explicit form to open the existing form popup with
|
|
1171
|
+
only the Content text editor. It edits the label, not `$content`, and provides no
|
|
1172
|
+
property fields or format selector. Enter inserts a newline, Ctrl/Cmd+Enter or blur
|
|
1173
|
+
saves, and Escape cancels. Explicit forms and read-only permissions remain in force.
|
|
1174
|
+
In a host's Fill-specific body (`fillBody`), Markdown/plain text also supports
|
|
1175
|
+
direct click and focused Enter editing; other Collision views still require Shift.
|
|
1176
|
+
|
|
1089
1177
|
The node animation toggle supports single and multiple selections. The SVG stroke follows the measured node border without changing layout or intercepting input. Text, array, object/content, and compound nodes support it, including outlined or transparent nodes. It uses the explicit border color or theme accent. Reduced-motion preferences pause the movement; graphs over 200 nodes suppress the trace in performance mode. `readOnly` prevents editing/toggling but still renders configured animation; `selectionToolbar.hide: ["animation"]` hides the toggle.
|
|
1090
1178
|
|
|
1091
1179
|
When animation is enabled, an **Animation** selector appears immediately to
|