@dou-ui/flow 0.1.0-alpha.12 → 0.1.0-alpha.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.
- package/dist/collaboration/index.js +39 -2
- package/dist/collaboration/index.js.map +1 -1
- package/dist/components/default-node.js.map +1 -1
- package/dist/components/default-node.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/components/default-node.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/flow-port.js.map +1 -1
- package/dist/components/flow-port.vue_vue_type_script_setup_true_lang.js +7 -42
- package/dist/components/flow-port.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/node-view.js.map +1 -1
- package/dist/components/node-view.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/node-view.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/port-view.js +6 -0
- package/dist/components/port-view.js.map +1 -0
- package/dist/components/port-view.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/port-view.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/core/model.js.map +1 -1
- package/dist/core/node-types.js +6 -2
- package/dist/core/node-types.js.map +1 -1
- package/dist/flow-editor.js.map +1 -1
- package/dist/flow-editor.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/flow-editor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/flow-port.vue.d.ts +8 -2
- package/dist/types/components/port-view.vue.d.ts +10 -0
- package/dist/types/components/port.d.ts +2 -2
- package/dist/types/core/model.d.ts +9 -0
- package/dist/types/core/node-types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/whiteboard/board-node.js.map +1 -1
- package/dist/whiteboard/board-node.vue_vue_type_script_setup_true_lang.js +27 -11
- package/dist/whiteboard/board-node.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["FlowEditor","FlowControls","FlowMinimap"],"sources":["../src/index.ts"],"sourcesContent":["import { withInstall } from 'dou-ui'\nimport FlowEditor from './flow-editor.vue'\nimport FlowControls from './components/flow-controls.vue'\nimport FlowMinimap from './components/flow-minimap.vue'\nimport { DouFlowPort } from './components/port'\n\nexport const DouFlowEditor = withInstall(FlowEditor)\nexport const DouFlowControls = withInstall(FlowControls)\nexport const DouFlowMinimap = withInstall(FlowMinimap)\nexport { DouFlowPort }\nexport default DouFlowEditor\n\nexport { useFlowEditor } from './context'\nexport type {\n FlowCommentAnchor,\n FlowControlsProps,\n FlowEditorContext,\n FlowEditorEmits,\n FlowEditorExpose,\n FlowEditorProps,\n FlowInsertOptions,\n FlowMinimapProps,\n FlowNodePreview,\n FlowEditorSlots,\n FlowPanelPlacement,\n FlowSearchQuery,\n NodeMetrics,\n PortAnchor,\n PortState,\n} from './context'\nexport { flowLocales, useFlowMessages } from './locale'\nexport type { FlowMessages, FlowMessagesOverride } from './locale'\nexport { defaultNode } from './components/default-node'\nexport type { DefaultNodeData } from './components/default-node'\nexport { groupNode } from './components/group-node'\nexport type { GroupNodeData } from './components/group-node'\nexport { containerAt, FlowTree } from './core/groups'\nexport { defineNodeType, labelOf, portSide, portsOf, resizeOf, sidePorts } from './core/node-types'\nexport type { NodePaletteSpec, NodeResize, NodeTypeSpec, NodeViewProps } from './core/node-types'\nexport type { FlowMenuTarget, FlowToolbarItem } from './core/menu'\nexport { createId, emptyDocument, emptySelection } from './core/model'\nexport type {\n FlowData,\n FlowDocument,\n FlowEdge,\n FlowEndpoint,\n FlowNode,\n FlowPortSpec,\n FlowSelection,\n FlowViewport,\n Point,\n PortSide,\n Rect,\n} from './core/model'\nexport { checkDocument, migrateDocument } from './document'\nexport type { CheckDocumentOptions, DocumentProblem } from './document'\nexport { applyFlowSteps, compactFlowSteps, FlowTransaction } from './core/transaction'\nexport type { FlowStep, FlowTransactionMeta } from './core/transaction'\nexport { FlowHistory } from './core/history'\nexport { defineFlowExtension } from './core/extension'\nexport type {\n FlowExtension,\n FlowExtensionContext,\n FlowHistoryHandler,\n FlowKeyHandler,\n FlowPress,\n FlowPressHandler,\n} from './core/extension'\nexport { flowKit } from './kit'\nexport type { FlowKitOptions } from './kit'\nexport { moveLayer } from './layers'\nexport { drawCard } from './export/draw'\nexport { renderFlowPNG, renderFlowSVG } from './export/render'\nexport type { RenderFlowImageOptions, RenderFlowOptions } from './export/render'\nexport type { FlowExportOptions, FlowImageOptions } from './export/draw'\nexport type { FlowDrawContext, FlowDrawTextOptions } from './export/context'\nexport type { LayerMove } from './layers'\nexport { flowOrder } from './core/order'\nexport {\n canJoin,\n displacedEdges,\n joinRefusal,\n primaryType,\n reaches,\n typesMatch,\n} from './core/connect'\nexport type {\n ConnectOptions,\n FlowConnection,\n JoinRefusal,\n PortShape,\n PortTypes,\n PortTypeSpec,\n} from './core/connect'\nexport { boundsOf, intersects, rectFrom, snapBox, snapTo } from './core/geometry'\nexport { bezierEdge, bezierPath, defineEdgeType, stepEdge, straightEdge } from './core/edge-types'\nexport type { EdgeAnchor, EdgeRoute, EdgeTypeSpec } from './core/edge-types'\nexport type { Guide, SnapResult } from './core/geometry'\n\ndeclare module 'vue' {\n export interface GlobalComponents {\n DouFlowEditor: typeof DouFlowEditor\n DouFlowControls: typeof DouFlowControls\n DouFlowMinimap: typeof DouFlowMinimap\n DouFlowPort: typeof DouFlowPort\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,gBAAgB,YAAYA,mBAAU;AACnD,IAAa,kBAAkB,YAAYC,qBAAY;AACvD,IAAa,iBAAiB,YAAYC,oBAAW"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["FlowEditor","FlowControls","FlowMinimap"],"sources":["../src/index.ts"],"sourcesContent":["import { withInstall } from 'dou-ui'\nimport FlowEditor from './flow-editor.vue'\nimport FlowControls from './components/flow-controls.vue'\nimport FlowMinimap from './components/flow-minimap.vue'\nimport { DouFlowPort } from './components/port'\n\nexport const DouFlowEditor = withInstall(FlowEditor)\nexport const DouFlowControls = withInstall(FlowControls)\nexport const DouFlowMinimap = withInstall(FlowMinimap)\nexport { DouFlowPort }\nexport default DouFlowEditor\n\nexport { useFlowEditor } from './context'\nexport type {\n FlowCommentAnchor,\n FlowControlsProps,\n FlowEditorContext,\n FlowEditorEmits,\n FlowEditorExpose,\n FlowEditorProps,\n FlowInsertOptions,\n FlowMinimapProps,\n FlowNodePreview,\n FlowEditorSlots,\n FlowPanelPlacement,\n FlowSearchQuery,\n NodeMetrics,\n PortAnchor,\n PortState,\n} from './context'\nexport { flowLocales, useFlowMessages } from './locale'\nexport type { FlowMessages, FlowMessagesOverride } from './locale'\nexport { defaultNode } from './components/default-node'\nexport type { DefaultNodeData } from './components/default-node'\nexport { groupNode } from './components/group-node'\nexport type { GroupNodeData } from './components/group-node'\nexport { containerAt, FlowTree } from './core/groups'\nexport { defineNodeType, labelOf, portSide, portsOf, resizeOf, sidePorts } from './core/node-types'\nexport type { NodePaletteSpec, NodeResize, NodeTypeSpec, NodeViewProps } from './core/node-types'\nexport type { FlowMenuTarget, FlowToolbarItem } from './core/menu'\nexport { createId, emptyDocument, emptySelection } from './core/model'\nexport type {\n FlowData,\n FlowDocument,\n FlowEdge,\n FlowEndpoint,\n FlowNode,\n FlowPortSpec,\n FlowPortVisible,\n FlowSelection,\n FlowViewport,\n Point,\n PortSide,\n Rect,\n} from './core/model'\nexport { checkDocument, migrateDocument } from './document'\nexport type { CheckDocumentOptions, DocumentProblem } from './document'\nexport { applyFlowSteps, compactFlowSteps, FlowTransaction } from './core/transaction'\nexport type { FlowStep, FlowTransactionMeta } from './core/transaction'\nexport { FlowHistory } from './core/history'\nexport { defineFlowExtension } from './core/extension'\nexport type {\n FlowExtension,\n FlowExtensionContext,\n FlowHistoryHandler,\n FlowKeyHandler,\n FlowPress,\n FlowPressHandler,\n} from './core/extension'\nexport { flowKit } from './kit'\nexport type { FlowKitOptions } from './kit'\nexport { moveLayer } from './layers'\nexport { drawCard } from './export/draw'\nexport { renderFlowPNG, renderFlowSVG } from './export/render'\nexport type { RenderFlowImageOptions, RenderFlowOptions } from './export/render'\nexport type { FlowExportOptions, FlowImageOptions } from './export/draw'\nexport type { FlowDrawContext, FlowDrawTextOptions } from './export/context'\nexport type { LayerMove } from './layers'\nexport { flowOrder } from './core/order'\nexport {\n canJoin,\n displacedEdges,\n joinRefusal,\n primaryType,\n reaches,\n typesMatch,\n} from './core/connect'\nexport type {\n ConnectOptions,\n FlowConnection,\n JoinRefusal,\n PortShape,\n PortTypes,\n PortTypeSpec,\n} from './core/connect'\nexport { boundsOf, intersects, rectFrom, snapBox, snapTo } from './core/geometry'\nexport { bezierEdge, bezierPath, defineEdgeType, stepEdge, straightEdge } from './core/edge-types'\nexport type { EdgeAnchor, EdgeRoute, EdgeTypeSpec } from './core/edge-types'\nexport type { Guide, SnapResult } from './core/geometry'\n\ndeclare module 'vue' {\n export interface GlobalComponents {\n DouFlowEditor: typeof DouFlowEditor\n DouFlowControls: typeof DouFlowControls\n DouFlowMinimap: typeof DouFlowMinimap\n DouFlowPort: typeof DouFlowPort\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,IAAa,gBAAgB,YAAYA,mBAAU;AACnD,IAAa,kBAAkB,YAAYC,qBAAY;AACvD,IAAa,iBAAiB,YAAYC,oBAAW"}
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer dou.components{.dou-flow-editor{--dou-flow-editor-dot:color-mix(in oklab,var(--dou-color-text)16%,transparent);--dou-flow-editor-node-bg:var(--dou-color-bg-surface);--dou-flow-editor-node-border:var(--dou-color-border);--dou-flow-editor-node-border-hover:var(--dou-color-border-strong);--dou-flow-editor-node-radius:var(--dou-radius-container);--dou-flow-editor-edge:var(--dou-color-border-strong);--dou-flow-editor-edge-hover:var(--dou-color-text-tertiary);--dou-flow-editor-selected:var(--dou-color-primary);--dou-flow-editor-guide:var(--dou-color-primary);--dou-flow-editor-port:var(--dou-color-text-tertiary);--dou-flow-editor-status-pending:var(--dou-color-text-disabled);--dou-flow-editor-status-running:var(--dou-color-warning);--dou-flow-editor-status-done:var(--dou-color-success);--dou-flow-editor-status-error:var(--dou-color-danger);--dou-flow-editor-border:var(--dou-color-border);position:relative;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-flow-editor-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-canvas);background-image:radial-gradient(circle,var(--dou-flow-editor-dot)1px,transparent 1px);color:var(--dou-color-text);font-family:var(--dou-font-family);font-size:var(--dou-font-size-md);line-height:var(--dou-font-line-height);touch-action:none;user-select:none;-webkit-user-select:none;outline:none;cursor:default;width:100%;min-width:0;height:480px}.dou-flow-editor:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:2px}.dou-flow-editor:not(.is-bordered){border:0;border-radius:0}.dou-flow-editor:not(.is-bordered):focus-visible{outline-offset:-2px}.dou-flow-editor.is-space{cursor:grab}.dou-flow-editor.is-connecting{cursor:crosshair}.dou-flow-editor.is-connecting *{cursor:crosshair}.dou-flow-editor.is-refused{cursor:not-allowed}.dou-flow-editor.is-refused *{cursor:not-allowed}.dou-flow-editor.is-panning{cursor:grabbing}.dou-flow-editor.is-panning *{cursor:grabbing}.dou-flow-editor.is-dragging{cursor:grabbing}.dou-flow-editor.is-dragging *{cursor:grabbing}.dou-flow-editor__layer{position:absolute;transform-origin:0 0;top:0;left:0}.dou-flow-editor__edges,.dou-flow-editor__guides{position:absolute;overflow:visible;pointer-events:none;width:1px;height:1px;top:0;left:0}.dou-flow-editor__edge{fill:none;stroke:var(--dou-flow-editor-edge);stroke-width:var(--dou-flow-editor-edge-width,1px);vector-effect:non-scaling-stroke;transition:stroke var(--dou-motion-duration-fast)var(--dou-motion-easing)}.dou-flow-editor__edge.is-selected{stroke:var(--dou-flow-editor-selected);stroke-width:calc(var(--dou-flow-editor-edge-width,1px) + 1px)}.dou-flow-editor__edge.is-stale{stroke:var(--dou-color-danger);stroke-dasharray:4 3}.dou-flow-editor__edge.is-mark{animation:none;stroke-dasharray:none!important}.dou-flow-editor__edge.is-preview{stroke:var(--dou-flow-editor-selected);stroke-dasharray:4 4}.dou-flow-editor__edge-hit{fill:none;stroke:transparent;stroke-width:12px;vector-effect:non-scaling-stroke;pointer-events:stroke;cursor:pointer}.dou-flow-editor__edge-hit:hover~.dou-flow-editor__edge:not(.is-selected){stroke:var(--dou-flow-editor-edge-hover)}.dou-flow-editor__edge.is-animated:not(.is-stale){stroke-dasharray:6 4;animation:.48s linear infinite dou-flow-editor-flow}@media (prefers-reduced-motion:reduce){.dou-flow-editor__edge.is-animated:not(.is-stale){animation:none}}@keyframes dou-flow-editor-flow{0%{stroke-dashoffset:10}to{stroke-dashoffset:0}}.dou-flow-editor__label{position:absolute;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background:var(--dou-color-bg-surface);color:var(--dou-color-text-secondary);font-size:var(--dou-font-size-sm);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;max-width:200px;padding:0 6px;line-height:20px;top:0;left:0;translate:-50% -50%}.dou-flow-editor__label.is-selected{z-index:1;border-color:var(--dou-flow-editor-selected);color:var(--dou-color-text)}.dou-flow-editor__label.is-bend{cursor:ew-resize}.dou-flow-editor__label.is-bend.is-y{cursor:ns-resize}.dou-flow-editor__label.is-editing{z-index:2;display:inline-grid;overflow:visible;font-size:max(var(--dou-font-size-input-min,0px),var(--dou-font-size-sm));cursor:text;min-width:48px;max-width:none}.dou-flow-editor__label.is-editing:after{content:attr(data-value)" ";grid-area:1/1;visibility:hidden;white-space:pre}.dou-flow-editor__label-input{grid-area:1/1;outline:none;color:inherit;font:inherit;user-select:text;-webkit-user-select:text;background:0 0;border:none;width:100%;min-width:0;padding:0}.dou-flow-editor__simple{position:absolute;display:flex;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-flow-editor-node-border);border-radius:var(--dou-flow-editor-node-radius);background:var(--dou-flow-editor-node-bg);outline:none;align-items: center;padding:0 16px;top:0;left:0}.dou-flow-editor__simple.is-selected{border-color:var(--dou-flow-editor-selected);box-shadow:0 0 0 1px var(--dou-flow-editor-selected)}.dou-flow-editor.is-tiny .dou-flow-editor__simple:not(.is-selected){background:color-mix(in oklab,var(--dou-color-text)14%,transparent);border-color:#0000}.dou-flow-editor__simple-label{overflow:hidden;color:var(--dou-color-text-secondary);font-size:min(calc(12px/var(--dou-flow-editor-zoom,1)),40px);white-space:nowrap;text-overflow:ellipsis;line-height:1.2}.dou-flow-editor__bend{position:absolute;z-index:1;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);cursor:ew-resize;scale:calc(1/var(--dou-flow-editor-zoom,1));border-radius:3px;width:6px;height:16px;top:0;left:0}.dou-flow-editor__bend.is-y{cursor:ns-resize;width:16px;height:6px}.dou-flow-editor__bend:before{content:"";position:absolute;inset:-8px}.dou-flow-editor__guides line{stroke:var(--dou-flow-editor-guide);stroke-width:1px;vector-effect:non-scaling-stroke}.dou-flow-editor__node{position:absolute;box-sizing:border-box;border:1px solid var(--dou-flow-editor-node-border);border-radius:var(--dou-flow-editor-node-radius);background-color:var(--dou-flow-editor-node-bg);box-shadow:var(--dou-shadow-sm);outline:none;transition-property:border-color,box-shadow;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);top:0;left:0}.dou-flow-editor__node:hover{border-color:var(--dou-flow-editor-node-border-hover)}.dou-flow-editor__node:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:2px}.dou-flow-editor__node.is-selected{border-color:var(--dou-flow-editor-selected);box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent),var(--dou-shadow-sm)}.dou-flow-editor__node.is-dragging{z-index:1;box-shadow:var(--dou-shadow-md)}.dou-flow-editor__node.is-selected.is-dragging{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent),var(--dou-shadow-md)}.dou-flow-editor__node :-webkit-any(input,textarea,[contenteditable=true]){user-select:text;-webkit-user-select:text}.dou-flow-editor__node :-moz-any(input,textarea,[contenteditable=true]){user-select:text;-webkit-user-select:text}.dou-flow-editor__node :is(input,textarea,[contenteditable=true]){user-select:text;-webkit-user-select:text}.dou-flow-editor__node.is-bare{box-shadow:none;background:0 0;border-color:#0000}.dou-flow-editor__node.is-bare:hover{border-color:#0000}.dou-flow-editor__node.is-bare.is-selected{box-shadow:none;outline:calc(1px/var(--dou-flow-editor-zoom,1))solid var(--dou-flow-editor-selected);outline-offset:calc(4px/var(--dou-flow-editor-zoom,1));border-color:#0000}.dou-flow-editor__node.is-bare.is-selected.is-turned{outline:none}.dou-flow-editor__node.is-bare.is-selected.is-turned:after{--dou-flow-node-ring:calc(5px/var(--dou-flow-editor-zoom,1));content:"";position:absolute;inset:calc(var(--dou-flow-node-ring)*-1);box-sizing:border-box;border:calc(1px/var(--dou-flow-editor-zoom,1))solid var(--dou-flow-editor-selected);border-radius:calc(var(--dou-flow-editor-node-radius) + var(--dou-flow-node-ring));pointer-events:none;rotate:var(--dou-flow-node-rotation)}.dou-flow-editor__node.is-bare.is-dragging{box-shadow:none}.dou-flow-port{--dou-flow-port-color:var(--dou-flow-editor-port);position:absolute;z-index:1;box-sizing:border-box;border:1px solid var(--dou-flow-port-color);border-radius:var(--dou-radius-full);background-color:var(--dou-flow-editor-node-bg);cursor:crosshair;transition-property:opacity,scale,box-shadow;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);width:8px;height:8px}.dou-flow-port:before{position:absolute;border-radius:inherit;content:"";inset:-8px}@media (pointer:coarse){.dou-flow-port:before{inset:-12px}}.dou-flow-port.is-connected{background-color:var(--dou-flow-port-color)}.dou-flow-port.is-square{border-radius:2px}.dou-flow-port.is-diamond{border-radius:1px;width:8px;height:8px;rotate:45deg}.dou-flow-port.is-triangle{background:0 0;border:0;border-radius:0;width:10px;height:10px}.dou-flow-port.is-triangle svg{display:block;overflow:visible;fill:var(--dou-flow-editor-node-bg);stroke:var(--dou-flow-port-color);stroke-linejoin:round;stroke-width:1px;width:100%;height:100%}.dou-flow-port.is-triangle.is-connected svg{fill:var(--dou-flow-port-color)}.dou-flow-port.is-triangle.is-top svg{rotate:90deg}.dou-flow-port.is-triangle.is-bottom svg{rotate:90deg}.dou-flow-port.is-unavailable{opacity:.32}.dou-flow-port.is-valid{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)16%,transparent)}.dou-flow-port.is-active{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)16%,transparent)}.dou-flow-port.is-candidate{border-color:var(--dou-flow-editor-selected);background-color:var(--dou-flow-editor-selected);box-shadow:0 0 0 4px color-mix(in oklab,var(--dou-flow-editor-selected)20%,transparent);scale:1.25}.dou-flow-port.is-refused{opacity:1;border-color:var(--dou-color-danger);box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-color-danger)16%,transparent)}.dou-flow-port.is-triangle.is-candidate{box-shadow:none;background:0 0}.dou-flow-port.is-triangle.is-candidate svg{fill:var(--dou-flow-editor-selected);stroke:var(--dou-flow-editor-selected)}.dou-flow-port.is-left{top:50%;left:0;translate:calc(-50% - .5px) -50%}.dou-flow-port.is-right{top:50%;left:100%;translate:calc(.5px - 50%) -50%}.dou-flow-port.is-top{top:0;left:50%;translate:-50% calc(-50% - .5px)}.dou-flow-port.is-bottom{top:100%;left:50%;translate:-50% calc(.5px - 50%)}.dou-flow-editor__marquee{position:absolute;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background-color:color-mix(in oklab,var(--dou-flow-editor-selected)8%,transparent);pointer-events:none;border-radius:2px;top:0;left:0}.dou-flow-editor__panels{position:absolute;pointer-events:none;inset:0}.dou-flow-editor__panels>*{pointer-events:auto}.dou-flow-editor__panels>.dou-flow-editor__comments{position:absolute;overflow:hidden;pointer-events:none;inset:0}.dou-flow-editor__comment{position:absolute;display:inline-flex;box-sizing:border-box;border:1px solid var(--dou-color-border);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);color:var(--dou-color-text-secondary);font:inherit;font-size:var(--dou-font-size-sm);font-variant-numeric:tabular-nums;cursor:pointer;pointer-events:auto;transition-property:border-color,color;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);border-radius:12px;justify-content:center;align-items: center;gap:2px;min-width:24px;height:24px;margin:0;padding:0 4px;line-height:1;top:0;left:0;transform:translate(-50%,-50%)}.dou-flow-editor__comment>svg{flex:none;width:14px;height:14px}.dou-flow-editor__comment.is-node{z-index:1;transform:translate(6px,calc(-100% - 6px))}.dou-flow-editor__comment.is-pin{z-index:1;color:var(--dou-color-text);font-weight:var(--dou-font-weight-medium);border-radius:12px 12px 12px 2px;transform:translateY(-100%)}@media (hover:hover){.dou-flow-editor__comment:hover{border-color:var(--dou-color-border-strong);color:var(--dou-color-text)}}.dou-flow-editor__comment.is-active{border-color:var(--dou-color-border-strong);color:var(--dou-color-text)}.dou-flow-editor__comment:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:2px}@media (pointer:coarse){.dou-flow-editor__comment:after{position:absolute;content:"";inset:-8px}.dou-flow-editor__comment.is-lifted{transform:translate(-50%,calc(-50% - 8px))}}.dou-flow-editor__comment-card{box-sizing:border-box;max-height:min(var(--dou-floating-available,100vh),480px,calc(100vh - 32px));overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-container);background-color:color-mix(in oklab,var(--dou-color-text)calc(4%*var(--dou-scheme-dark)),var(--dou-color-bg-surface));box-shadow:var(--dou-shadow-md);width:min(340px,100vw - 32px);padding:12px}.dou-flow-editor__comment-card.is-away{visibility:hidden}.dou-flow-editor__comment-card>.dou-comment-thread+.dou-comment-thread{border-top:1px solid var(--dou-color-border-subtle);margin-top:12px;padding-top:12px}.dou-flow-editor__find{position:absolute;display:flex;container-type:inline-size;pointer-events:none;justify-content:flex-end;align-items: flex-start;top:12px;left:12px;right:12px}.dou-flow-editor__find>*{pointer-events:auto}.dou-flow-editor__found{position:absolute;box-sizing:border-box;border-radius:var(--dou-flow-editor-node-radius);outline:4px solid color-mix(in oklab,var(--dou-color-warning)35%,transparent);outline-offset:2px;pointer-events:none;top:0;left:0}.dou-flow-editor__found.is-current{outline-color:color-mix(in oklab,var(--dou-color-warning)70%,transparent)}.dou-flow-editor__notice{position:absolute;z-index:20;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);color:var(--dou-color-text);font-size:var(--dou-font-size-sm);pointer-events:none;width:max-content;max-width:calc(100% - 24px);padding:6px 12px;bottom:12px;left:50%;transform:translate(-50%)}.dou-flow-editor__end,.dou-flow-editor__live{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}.dou-flow-editor__node.is-container{background-color:color-mix(in oklab,var(--dou-color-text)3%,var(--dou-flow-editor-node-bg));box-shadow:none}.dou-flow-editor__node.is-container.is-selected{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent)}.dou-flow-editor__node.is-container.is-selected.is-dragging{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent)}.dou-flow-editor__node.is-container.is-dragging:not(.is-selected){box-shadow:var(--dou-shadow-sm)}.dou-flow-editor__node.is-drop-target,.dou-flow-editor__simple.is-drop-target{border-color:var(--dou-flow-editor-selected);background-color:color-mix(in oklab,var(--dou-flow-editor-selected)6%,var(--dou-flow-editor-node-bg))}.dou-flow-editor__resize{position:absolute;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);cursor:nwse-resize;translate:50% 50%;scale:calc(1/var(--dou-flow-editor-zoom,1));border-radius:3px;width:10px;height:10px;bottom:0;right:0}.dou-flow-editor__resize:before{content:"";position:absolute;inset:-8px}.dou-flow-peers{--dou-flow-peer-color:var(--dou-color-text-secondary);--dou-flow-peer-line:calc(1.5px/var(--dou-flow-editor-zoom,1))}.dou-flow-peer{position:absolute;box-sizing:border-box;border-radius:var(--dou-flow-editor-node-radius);outline:var(--dou-flow-peer-line)solid var(--dou-flow-peer-color);outline-offset:calc(3px/var(--dou-flow-editor-zoom,1));pointer-events:none;top:0;left:0}.dou-flow-peer.is-moving{outline-style:dashed;background-color:color-mix(in oklab,var(--dou-flow-peer-color)8%,transparent)}.dou-flow-peer__name{position:absolute;margin-bottom:calc(4px/var(--dou-flow-editor-zoom,1));background-color:var(--dou-flow-peer-color);color:oklch(from var(--dou-flow-peer-color)clamp(.2,(.66 - l)*100,.99)0 0);font-size:var(--dou-font-size-sm);white-space:nowrap;scale:calc(1/var(--dou-flow-editor-zoom,1));transform-origin:left bottom;border-radius:4px;padding:0 6px;line-height:18px;bottom:100%;left:0}.dou-flow-peer__lines{position:absolute;overflow:visible;pointer-events:none;width:1px;height:1px;top:0;left:0}.dou-flow-peer__lines path{fill:none;stroke:var(--dou-flow-peer-color);stroke-width:1.5px;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}.dou-flow-group-node{height:100%}.dou-flow-editor__node.is-collapsed>.dou-flow-group-node{height:auto}.dou-flow-group-node__head{display:flex;box-sizing:border-box;align-items: center;gap:4px;height:40px;padding:0 12px 0 8px}.dou-flow-group-node__toggle{display:inline-flex;color:var(--dou-color-text-tertiary);cursor:pointer;transition-property:background-color,color;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items: center;width:24px;height:24px;padding:0;font-size:16px}.dou-flow-group-node__toggle>svg{transition:rotate var(--dou-motion-duration-fast)var(--dou-motion-easing)}.dou-flow-group-node__toggle:hover:not(:disabled){background:color-mix(in oklab,var(--dou-color-text)6%,transparent);color:var(--dou-color-text)}.dou-flow-group-node__toggle:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-flow-group-node__toggle:disabled{cursor:default}.dou-flow-group-node.is-collapsed .dou-flow-group-node__toggle>svg{rotate:-90deg}.dou-flow-group-node__title{overflow:hidden;color:var(--dou-color-text-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px}.dou-flow-group-node__input{box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);outline:none;background:var(--dou-color-bg-surface);color:var(--dou-color-text);font:inherit;font-size:max(var(--dou-font-size-input-min,0px),13px);border-radius:6px;flex:1;min-width:0;height:24px;padding:0 6px}@media (prefers-reduced-motion:reduce){.dou-flow-group-node__toggle>svg{transition:none}}.dou-flow-default-node{width:208px}.dou-flow-editor__node.is-sized>.dou-flow-default-node{width:auto}.dou-flow-default-node__head{position:relative;display:flex;box-sizing:border-box;align-items: center;gap:8px;min-height:44px;padding:0 12px}.dou-flow-default-node__icon{display:inline-flex;border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-secondary);flex:none;justify-content:center;align-items: center;width:24px;height:24px}.dou-flow-default-node__icon svg{width:16px;height:16px}.dou-flow-default-node__title{overflow-x:clip;font-weight:var(--dou-font-weight-medium);text-overflow:ellipsis;white-space:nowrap;text-box:trim-both cap alphabetic;flex:1;min-width:0}.dou-flow-default-node__status{border-radius:var(--dou-radius-full);background-color:var(--dou-flow-editor-status-pending);flex:none;width:8px;height:8px}.dou-flow-default-node__status.is-running{background-color:var(--dou-flow-editor-status-running)}.dou-flow-default-node__status.is-done{background-color:var(--dou-flow-editor-status-done)}.dou-flow-default-node__status.is-error{background-color:var(--dou-flow-editor-status-error)}.dou-flow-default-node__description{color:var(--dou-color-text-secondary);font-size:var(--dou-font-size-sm);margin:-4px 0 0;padding:0 12px 12px;line-height:20px}.dou-flow-default-node__ports{border-top:1px solid var(--dou-color-border-subtle);padding:3px 0 4px}.dou-flow-default-node__row{position:relative;display:flex;box-sizing:border-box;color:var(--dou-color-text-secondary);font-size:var(--dou-font-size-sm);align-items: center;height:28px;padding:0 12px}.dou-flow-default-node__port{overflow-x:clip;text-overflow:ellipsis;white-space:nowrap;text-box:trim-both cap alphabetic;min-width:0}.dou-flow-default-node__port.is-output{text-align:right;margin-left:auto}.dou-flow-minimap{position:absolute;overflow:hidden;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);line-height:0}.dou-flow-minimap.is-top-left{top:12px;left:12px}.dou-flow-minimap.is-top-right{top:12px;right:12px}.dou-flow-minimap.is-bottom-left{bottom:12px;left:12px}.dou-flow-minimap.is-bottom-right{bottom:12px;right:12px}.dou-flow-minimap svg{display:block;cursor:pointer;touch-action:none}.dou-flow-minimap.is-dragging svg{cursor:grabbing}.dou-flow-minimap__node{fill:var(--dou-color-bg-muted);stroke:var(--dou-color-border-strong);stroke-width:1px;vector-effect:non-scaling-stroke}.dou-flow-minimap__node.is-selected{fill:color-mix(in oklab,var(--dou-flow-editor-selected)24%,var(--dou-color-bg-surface));stroke:var(--dou-flow-editor-selected)}.dou-flow-minimap__shade{fill:color-mix(in oklab,var(--dou-color-text)6%,transparent)}.dou-flow-minimap__view{fill:none;stroke:var(--dou-color-text-tertiary);stroke-width:1px;vector-effect:non-scaling-stroke}.dou-flow-controls{position:absolute;display:flex;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);align-items: center;gap:2px;padding:2px}.dou-flow-controls.is-top-left{top:12px;left:12px}.dou-flow-controls.is-top-right{top:12px;right:12px}.dou-flow-controls.is-bottom-left{bottom:12px;left:12px}.dou-flow-controls.is-bottom-right{bottom:12px;right:12px}.dou-flow-controls__button{display:inline-flex;box-sizing:border-box;border-radius:var(--dou-radius-control);color:var(--dou-color-text-secondary);font:inherit;font-size:var(--dou-font-size-sm);font-variant-numeric:tabular-nums;cursor:pointer;transition:background-color var(--dou-motion-duration-fast)var(--dou-motion-easing);background:0 0;border:0;justify-content:center;align-items: center;min-width:28px;height:28px;padding:0 6px}.dou-flow-controls__button svg{width:16px;height:16px}.dou-flow-controls__button:hover:not(:disabled){background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-flow-controls__button:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-flow-controls__button:disabled{color:var(--dou-color-text-disabled);cursor:default}.dou-flow-controls__zoom{min-width:48px}.dou-flow-controls__divider{background-color:var(--dou-color-border);width:1px;height:16px;margin:0 2px}.dou-flow-controls__button.is-active{background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-flow-toolbar{position:absolute;display:flex;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);align-items: center;gap:2px;padding:2px}@media (pointer:coarse){.dou-flow-toolbar .dou-flow-controls__button{min-width:40px;height:40px}}.dou-flow-editor__menu-anchor{position:absolute;overflow:hidden;width:0;height:0}.dou-flow-editor__ghost{position:fixed;z-index:2147480000;pointer-events:none;transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);top:0;left:0;translate:-50% -50%}.dou-flow-editor__ghost.is-outside{opacity:.56}.dou-flow-editor__ghost-card{display:flex;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);color:var(--dou-color-text);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:nowrap;align-items: center;gap:8px;height:36px;padding:0 12px 0 8px}.dou-flow-editor__ghost-icon,.dou-flow-quick-add__icon{display:inline-flex;border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-secondary);flex:none;justify-content:center;align-items: center;width:20px;height:20px}:is(.dou-flow-editor__ghost-icon,.dou-flow-quick-add__icon) svg{width:14px;height:14px}.dou-flow-quick-add{width:260px;padding:0}.dou-flow-quick-add.is-custom{width:auto}.dou-flow-quick-add .dou-command__search{height:40px;padding:0 12px}.dou-flow-quick-add .dou-command__item{gap:8px}.dou-flow-quick-add .dou-command__label{flex:none}}.dou-flow-editor.is-refused .dou-flow-editor__edge.is-preview{stroke:var(--dou-color-danger)}@layer dou.components{.dou-flow-editor{--dou-flow-whiteboard-ink:color-mix(in oklab,var(--dou-color-text)72%,transparent)}.dou-flow-editor[data-board-tool=hand]{cursor:grab}.dou-flow-editor[data-board-tool=hand] .dou-flow-editor__node{cursor:grab}.dou-flow-editor[data-board-panning]{cursor:grabbing}.dou-flow-editor[data-board-panning] .dou-flow-editor__node{cursor:grabbing}.dou-flow-editor[data-board-tool=rect]{cursor:crosshair}.dou-flow-editor[data-board-tool=rect] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=ellipse]{cursor:crosshair}.dou-flow-editor[data-board-tool=ellipse] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=diamond]{cursor:crosshair}.dou-flow-editor[data-board-tool=diamond] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=sticky]{cursor:crosshair}.dou-flow-editor[data-board-tool=sticky] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=text]{cursor:text}.dou-flow-editor[data-board-tool=text] .dou-flow-editor__node{cursor:text}.dou-flow-editor[data-board-tool=comment] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=pen]{cursor:crosshair}.dou-flow-editor[data-board-tool=pen] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=eraser]{cursor:crosshair}.dou-flow-editor[data-board-tool=eraser] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor__node:has(>.dou-whiteboard-node.is-ink){pointer-events:none}.dou-flow-editor__node:has(>.dou-whiteboard-node.is-ink) .dou-flow-editor__resize{pointer-events:auto}.dou-flow-editor__node:has(>.dou-whiteboard-node)>.dou-flow-editor__resize{display:none}.dou-whiteboard-node{--dou-whiteboard-tone:var(--dou-color-neutral);position:relative;display:grid;box-sizing:border-box;min-height:inherit;color:var(--dou-color-text);place-items: center;width:100%;height:100%}.dou-whiteboard-node.is-primary{--dou-whiteboard-tone:var(--dou-color-primary)}.dou-whiteboard-node.is-success{--dou-whiteboard-tone:var(--dou-color-success)}.dou-whiteboard-node.is-warning{--dou-whiteboard-tone:var(--dou-color-warning)}.dou-whiteboard-node.is-danger{--dou-whiteboard-tone:var(--dou-color-danger)}.dou-whiteboard-node.is-sticky{background-color:color-mix(in oklab,var(--dou-whiteboard-tone)20%,var(--dou-color-bg-surface));box-shadow:var(--dou-shadow-sm);border-radius:4px}.dou-whiteboard-node.is-text{place-items: start stretch}.dou-whiteboard-node.is-erasing{opacity:.3}.dou-whiteboard-node__ink{position:absolute;overflow:visible;fill:var(--dou-flow-whiteboard-ink);width:100%;height:100%;inset:0}.dou-whiteboard-node:not(.is-neutral)>.dou-whiteboard-node__ink{fill:var(--dou-whiteboard-tone)}.dou-whiteboard-node__ink path{pointer-events:visiblePainted}.dou-whiteboard-node__ink-hit{fill:none;stroke:transparent;stroke-width:12px;vector-effect:non-scaling-stroke;pointer-events:stroke}.dou-whiteboard-node__image{position:absolute;display:block;box-sizing:border-box;object-fit:contain;pointer-events:none;user-select:none;border-radius:4px;width:100%;height:100%;inset:0}.dou-whiteboard-node__image.is-broken{display:flex;background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-tertiary);justify-content:center;align-items: center}.dou-whiteboard-node__image.is-broken>svg{width:min(24px,40%);height:min(24px,40%)}.dou-whiteboard-handles,.dou-whiteboard-node__frame{position:absolute;pointer-events:none;top:0;left:0}.dou-whiteboard-node__frame{box-sizing:border-box}.dou-whiteboard-node__turn,.dou-whiteboard-node__corner{position:absolute;z-index:1;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);pointer-events:auto;touch-action:none;scale:calc(1/var(--dou-flow-editor-zoom,1));width:10px;height:10px}:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner):before{content:"";position:absolute;inset:-8px}@media (pointer:coarse){:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner):before{inset:-15px}}:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner)>.dou-whiteboard-node__target{content:"";position:absolute;inset:-8px}@media (pointer:coarse){:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner)>.dou-whiteboard-node__target{inset:-15px}}.dou-whiteboard-node__turn:before{content:none}.dou-whiteboard-node__turn{bottom:calc(-24px/var(--dou-flow-editor-zoom,1));cursor:grab;border-radius:50%;left:50%;translate:-50% 50%}@media (pointer:coarse){.dou-whiteboard-node__turn{bottom:calc(-40px/var(--dou-flow-editor-zoom,1))}}.dou-whiteboard-node__corner{border-radius:3px;translate:-50% -50%}.dou-whiteboard-node__side{position:absolute;pointer-events:auto;touch-action:none;translate:-50% -50%}.dou-whiteboard-node__side.is-x{width:calc(8px/var(--dou-flow-editor-zoom,1));height:calc(100% - 20px/var(--dou-flow-editor-zoom,1))}.dou-whiteboard-node__side.is-y{width:calc(100% - 20px/var(--dou-flow-editor-zoom,1));height:calc(8px/var(--dou-flow-editor-zoom,1))}@media (pointer:coarse){.dou-whiteboard-node__side.is-x{width:clamp(calc(16px/var(--dou-flow-editor-zoom,1)),50%,calc(40px/var(--dou-flow-editor-zoom,1)))}.dou-whiteboard-node__side.is-y{height:clamp(calc(16px/var(--dou-flow-editor-zoom,1)),50%,calc(40px/var(--dou-flow-editor-zoom,1)))}}.dou-whiteboard-node__shape{position:absolute;overflow:visible;fill:var(--dou-color-bg-surface);stroke:var(--dou-flow-whiteboard-ink);stroke-linejoin:round;stroke-width:1.5px;width:100%;height:100%;inset:0}.dou-whiteboard-node:not(.is-neutral)>.dou-whiteboard-node__shape{fill:color-mix(in oklab,var(--dou-whiteboard-tone)10%,var(--dou-color-bg-surface));stroke:var(--dou-whiteboard-tone)}.dou-whiteboard-node__text{position:relative;box-sizing:border-box;overflow:hidden;font:inherit;font-size:max(var(--dou-font-size-input-min,0px),var(--dou-font-size-md));overflow-wrap:anywhere;text-align:center;white-space:pre-wrap;max-width:100%;max-height:100%;padding:12px 16px;line-height:1.5}.is-sticky>.dou-whiteboard-node__text{padding:16px}.is-shape>.dou-whiteboard-node__text:not(.dou-whiteboard-node__field){display:-webkit-box;clip-path:inset(12px 0);-webkit-box-orient:vertical}.is-sticky>.dou-whiteboard-node__text:not(.dou-whiteboard-node__field){display:-webkit-box;clip-path:inset(12px 0);-webkit-box-orient:vertical}.is-sticky>.dou-whiteboard-node__text:not(.dou-whiteboard-node__field){clip-path:inset(16px 0)}.is-text>.dou-whiteboard-node__text{font-size:var(--dou-font-size-lg);text-align:start;padding:4px 8px}.dou-whiteboard-node__field{display:block;color:inherit;outline:none;resize:none;field-sizing:content;background:0 0;border:0;width:100%;min-height:1lh;margin:0}.dou-whiteboard-node.is-selected .dou-whiteboard-node__anchor:before{inset:-2px}@media (pointer:coarse){.dou-whiteboard-node.is-selected .dou-whiteboard-node__anchor:before{inset:-6px}}.dou-whiteboard-node__anchors{position:absolute;z-index:1;pointer-events:none;inset:0}.dou-whiteboard-node__anchors .dou-flow-port{opacity:0;pointer-events:none;scale:calc(1/var(--dou-flow-editor-zoom,1))}.dou-flow-editor[data-board-tool=select] .dou-flow-editor__node:hover .dou-whiteboard-node:not(.is-editing) .dou-flow-port.is-output{opacity:1;pointer-events:auto}.dou-flow-editor[data-board-tool=select] .dou-flow-editor__node.is-selected .dou-whiteboard-node:not(.is-editing) .dou-flow-port.is-output{opacity:1;pointer-events:auto}.dou-flow-editor.is-connecting .dou-whiteboard-node__anchors .dou-flow-port.is-input.is-valid{opacity:.6}.dou-flow-editor.is-connecting .dou-whiteboard-node__anchors .dou-flow-port.is-input.is-candidate{opacity:1}[data-edge-type=connector]>.dou-flow-editor__edge{stroke-linecap:round;stroke-linejoin:round}[data-edge-type=connector]>.dou-flow-editor__edge:not(.is-selected){stroke:var(--dou-flow-whiteboard-ink);stroke-width:1.5px}.dou-whiteboard-strokes{position:absolute;overflow:visible;pointer-events:none;width:1px;height:1px;top:0;left:0}.dou-whiteboard-strokes__ink{fill:var(--dou-flow-whiteboard-ink)}.dou-whiteboard-strokes__eraser{fill:color-mix(in oklab,var(--dou-color-text)6%,transparent);stroke:var(--dou-color-border-strong);stroke-width:calc(1px/var(--dou-flow-editor-zoom,1))}.dou-whiteboard-draft{position:absolute;box-sizing:border-box;border:calc(1px/var(--dou-flow-editor-zoom,1))dashed var(--dou-flow-editor-selected);background-color:color-mix(in oklab,var(--dou-flow-editor-selected)6%,transparent);pointer-events:none;border-radius:4px;top:0;left:0}.dou-whiteboard-draft.is-ellipse{border-radius:50%}.dou-whiteboard-toolbar{position:absolute;display:flex;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);width:max-content;max-width:calc(100% - 24px);padding:2px;top:12px;left:50%;translate:-50%}.dou-whiteboard-toolbar__scroll{display:flex;overflow-x:auto;border-radius:var(--dou-radius-control);overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x;align-items: center;gap:2px;min-width:0}.dou-whiteboard-toolbar__scroll::-webkit-scrollbar{display:none}.dou-whiteboard-toolbar__scroll.has-more-start{mask-image:linear-gradient(90deg,#0000,#000 32px)}.dou-whiteboard-toolbar__scroll.has-more-end{mask-image:linear-gradient(270deg,#0000,#000 32px)}.dou-whiteboard-toolbar__scroll.has-more-start.has-more-end{mask-image:linear-gradient(90deg,#0000,#000 32px calc(100% - 32px),#0000)}.dou-whiteboard-toolbar__button{position:relative;display:inline-flex;border-radius:var(--dou-radius-control);color:var(--dou-color-text-secondary);cursor:pointer;transition-property:background-color,color;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);background:0 0;border:0;flex:none;justify-content:center;align-items: center;width:32px;height:32px;padding:0}.dou-whiteboard-toolbar__button svg{width:16px;height:16px}.dou-whiteboard-toolbar__button:hover{background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-whiteboard-toolbar__button[aria-pressed=true]{background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-whiteboard-toolbar__button.is-locked:after{position:absolute;border-radius:var(--dou-radius-full);content:"";background-color:currentColor;width:4px;height:4px;bottom:3px;left:50%;translate:-50%}.dou-whiteboard-toolbar__button:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-whiteboard-toolbar__divider{background-color:var(--dou-color-border);flex:none;width:1px;height:16px;margin:0 2px}}
|
|
1
|
+
@layer dou.components{.dou-flow-editor{--dou-flow-editor-dot:color-mix(in oklab,var(--dou-color-text)16%,transparent);--dou-flow-editor-node-bg:var(--dou-color-bg-surface);--dou-flow-editor-node-border:var(--dou-color-border);--dou-flow-editor-node-border-hover:var(--dou-color-border-strong);--dou-flow-editor-node-radius:var(--dou-radius-container);--dou-flow-editor-edge:var(--dou-color-border-strong);--dou-flow-editor-edge-hover:var(--dou-color-text-tertiary);--dou-flow-editor-selected:var(--dou-color-primary);--dou-flow-editor-guide:var(--dou-color-primary);--dou-flow-editor-port:var(--dou-color-text-tertiary);--dou-flow-editor-status-pending:var(--dou-color-text-disabled);--dou-flow-editor-status-running:var(--dou-color-warning);--dou-flow-editor-status-done:var(--dou-color-success);--dou-flow-editor-status-error:var(--dou-color-danger);--dou-flow-editor-border:var(--dou-color-border);position:relative;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-flow-editor-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-canvas);background-image:radial-gradient(circle,var(--dou-flow-editor-dot)1px,transparent 1px);color:var(--dou-color-text);font-family:var(--dou-font-family);font-size:var(--dou-font-size-md);line-height:var(--dou-font-line-height);touch-action:none;user-select:none;-webkit-user-select:none;outline:none;cursor:default;width:100%;min-width:0;height:480px}.dou-flow-editor:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:2px}.dou-flow-editor:not(.is-bordered){border:0;border-radius:0}.dou-flow-editor:not(.is-bordered):focus-visible{outline-offset:-2px}.dou-flow-editor.is-space{cursor:grab}.dou-flow-editor.is-connecting{cursor:crosshair}.dou-flow-editor.is-connecting *{cursor:crosshair}.dou-flow-editor.is-refused{cursor:not-allowed}.dou-flow-editor.is-refused *{cursor:not-allowed}.dou-flow-editor.is-panning{cursor:grabbing}.dou-flow-editor.is-panning *{cursor:grabbing}.dou-flow-editor.is-dragging{cursor:grabbing}.dou-flow-editor.is-dragging *{cursor:grabbing}.dou-flow-editor__layer{position:absolute;transform-origin:0 0;top:0;left:0}.dou-flow-editor__edges,.dou-flow-editor__guides{position:absolute;overflow:visible;pointer-events:none;width:1px;height:1px;top:0;left:0}.dou-flow-editor__edge{fill:none;stroke:var(--dou-flow-editor-edge);stroke-width:var(--dou-flow-editor-edge-width,1px);vector-effect:non-scaling-stroke;transition:stroke var(--dou-motion-duration-fast)var(--dou-motion-easing)}.dou-flow-editor__edge.is-selected{stroke:var(--dou-flow-editor-selected);stroke-width:calc(var(--dou-flow-editor-edge-width,1px) + 1px)}.dou-flow-editor__edge.is-stale{stroke:var(--dou-color-danger);stroke-dasharray:4 3}.dou-flow-editor__edge.is-mark{animation:none;stroke-dasharray:none!important}.dou-flow-editor__edge.is-preview{stroke:var(--dou-flow-editor-selected);stroke-dasharray:4 4}.dou-flow-editor__edge-hit{fill:none;stroke:transparent;stroke-width:12px;vector-effect:non-scaling-stroke;pointer-events:stroke;cursor:pointer}.dou-flow-editor__edge-hit:hover~.dou-flow-editor__edge:not(.is-selected){stroke:var(--dou-flow-editor-edge-hover)}.dou-flow-editor__edge.is-animated:not(.is-stale){stroke-dasharray:6 4;animation:.48s linear infinite dou-flow-editor-flow}@media (prefers-reduced-motion:reduce){.dou-flow-editor__edge.is-animated:not(.is-stale){animation:none}}@keyframes dou-flow-editor-flow{0%{stroke-dashoffset:10}to{stroke-dashoffset:0}}.dou-flow-editor__label{position:absolute;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background:var(--dou-color-bg-surface);color:var(--dou-color-text-secondary);font-size:var(--dou-font-size-sm);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;max-width:200px;padding:0 6px;line-height:20px;top:0;left:0;translate:-50% -50%}.dou-flow-editor__label.is-selected{z-index:1;border-color:var(--dou-flow-editor-selected);color:var(--dou-color-text)}.dou-flow-editor__label.is-bend{cursor:ew-resize}.dou-flow-editor__label.is-bend.is-y{cursor:ns-resize}.dou-flow-editor__label.is-editing{z-index:2;display:inline-grid;overflow:visible;font-size:max(var(--dou-font-size-input-min,0px),var(--dou-font-size-sm));cursor:text;min-width:48px;max-width:none}.dou-flow-editor__label.is-editing:after{content:attr(data-value)" ";grid-area:1/1;visibility:hidden;white-space:pre}.dou-flow-editor__label-input{grid-area:1/1;outline:none;color:inherit;font:inherit;user-select:text;-webkit-user-select:text;background:0 0;border:none;width:100%;min-width:0;padding:0}.dou-flow-editor__simple{position:absolute;display:flex;box-sizing:border-box;overflow:hidden;border:1px solid var(--dou-flow-editor-node-border);border-radius:var(--dou-flow-editor-node-radius);background:var(--dou-flow-editor-node-bg);outline:none;align-items: center;padding:0 16px;top:0;left:0}.dou-flow-editor__simple.is-selected{border-color:var(--dou-flow-editor-selected);box-shadow:0 0 0 1px var(--dou-flow-editor-selected)}.dou-flow-editor.is-tiny .dou-flow-editor__simple:not(.is-selected){background:color-mix(in oklab,var(--dou-color-text)14%,transparent);border-color:#0000}.dou-flow-editor__simple-label{overflow:hidden;color:var(--dou-color-text-secondary);font-size:min(calc(12px/var(--dou-flow-editor-zoom,1)),40px);white-space:nowrap;text-overflow:ellipsis;line-height:1.2}.dou-flow-editor__bend{position:absolute;z-index:1;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);cursor:ew-resize;scale:calc(1/var(--dou-flow-editor-zoom,1));border-radius:3px;width:6px;height:16px;top:0;left:0}.dou-flow-editor__bend.is-y{cursor:ns-resize;width:16px;height:6px}.dou-flow-editor__bend:before{content:"";position:absolute;inset:-8px}.dou-flow-editor__guides line{stroke:var(--dou-flow-editor-guide);stroke-width:1px;vector-effect:non-scaling-stroke}.dou-flow-editor__node{position:absolute;box-sizing:border-box;border:1px solid var(--dou-flow-editor-node-border);border-radius:var(--dou-flow-editor-node-radius);background-color:var(--dou-flow-editor-node-bg);box-shadow:var(--dou-shadow-sm);outline:none;transition-property:border-color,box-shadow;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);top:0;left:0}.dou-flow-editor__node:hover{border-color:var(--dou-flow-editor-node-border-hover)}.dou-flow-editor__node:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:2px}.dou-flow-editor__node.is-selected{border-color:var(--dou-flow-editor-selected);box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent),var(--dou-shadow-sm)}.dou-flow-editor__node.is-dragging{z-index:1;box-shadow:var(--dou-shadow-md)}.dou-flow-editor__node.is-selected.is-dragging{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent),var(--dou-shadow-md)}.dou-flow-editor__node :-webkit-any(input,textarea,[contenteditable=true]){user-select:text;-webkit-user-select:text}.dou-flow-editor__node :-moz-any(input,textarea,[contenteditable=true]){user-select:text;-webkit-user-select:text}.dou-flow-editor__node :is(input,textarea,[contenteditable=true]){user-select:text;-webkit-user-select:text}.dou-flow-editor__node.is-bare{box-shadow:none;background:0 0;border-color:#0000}.dou-flow-editor__node.is-bare:hover{border-color:#0000}.dou-flow-editor__node.is-bare.is-selected{box-shadow:none;outline:calc(1px/var(--dou-flow-editor-zoom,1))solid var(--dou-flow-editor-selected);outline-offset:calc(4px/var(--dou-flow-editor-zoom,1));border-color:#0000}.dou-flow-editor__node.is-bare.is-selected.is-turned{outline:none}.dou-flow-editor__node.is-bare.is-selected.is-turned:after{--dou-flow-node-ring:calc(5px/var(--dou-flow-editor-zoom,1));content:"";position:absolute;inset:calc(var(--dou-flow-node-ring)*-1);box-sizing:border-box;border:calc(1px/var(--dou-flow-editor-zoom,1))solid var(--dou-flow-editor-selected);border-radius:calc(var(--dou-flow-editor-node-radius) + var(--dou-flow-node-ring));pointer-events:none;rotate:var(--dou-flow-node-rotation)}.dou-flow-editor__node.is-bare.is-dragging{box-shadow:none}.dou-flow-port{--dou-flow-port-color:var(--dou-flow-editor-port);position:absolute;z-index:1;box-sizing:border-box;border:1px solid var(--dou-flow-port-color);border-radius:var(--dou-radius-full);background-color:var(--dou-flow-editor-node-bg);cursor:crosshair;transition-property:opacity,scale,box-shadow;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);width:8px;height:8px}.dou-flow-port:before{position:absolute;border-radius:inherit;content:"";inset:-8px}@media (pointer:coarse){.dou-flow-port:before{inset:-12px}}.dou-flow-port.is-connected{background-color:var(--dou-flow-port-color)}.dou-flow-port.is-square{border-radius:2px}.dou-flow-port.is-diamond{border-radius:1px;width:8px;height:8px;rotate:45deg}.dou-flow-port.is-triangle{background:0 0;border:0;border-radius:0;width:10px;height:10px}.dou-flow-port.is-triangle svg{display:block;overflow:visible;fill:var(--dou-flow-editor-node-bg);stroke:var(--dou-flow-port-color);stroke-linejoin:round;stroke-width:1px;width:100%;height:100%}.dou-flow-port.is-triangle.is-connected svg{fill:var(--dou-flow-port-color)}.dou-flow-port.is-triangle.is-top svg{rotate:90deg}.dou-flow-port.is-triangle.is-bottom svg{rotate:90deg}.dou-flow-port.is-unavailable{opacity:.32}.dou-flow-port.is-valid{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)16%,transparent)}.dou-flow-port.is-active{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)16%,transparent)}.dou-flow-port.is-candidate{border-color:var(--dou-flow-editor-selected);background-color:var(--dou-flow-editor-selected);box-shadow:0 0 0 4px color-mix(in oklab,var(--dou-flow-editor-selected)20%,transparent);scale:1.25}.dou-flow-port.is-refused{opacity:1;border-color:var(--dou-color-danger);box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-color-danger)16%,transparent)}.dou-flow-port.is-triangle.is-candidate{box-shadow:none;background:0 0}.dou-flow-port.is-triangle.is-candidate svg{fill:var(--dou-flow-editor-selected);stroke:var(--dou-flow-editor-selected)}.dou-flow-port.is-left{top:50%;left:0;translate:calc(-50% - .5px) -50%}.dou-flow-port.is-right{top:50%;left:100%;translate:calc(.5px - 50%) -50%}.dou-flow-port.is-top{top:0;left:50%;translate:-50% calc(-50% - .5px)}.dou-flow-port.is-bottom{top:100%;left:50%;translate:-50% calc(.5px - 50%)}.dou-flow-port[data-visible]{opacity:0;pointer-events:none}.dou-flow-editor__node:-webkit-any(:hover,:has(:focus-visible),.is-selected) .dou-flow-port[data-visible=hover]{opacity:1;pointer-events:auto}.dou-flow-editor__node:-moz-any(:hover,:has(:focus-visible),.is-selected) .dou-flow-port[data-visible=hover]{opacity:1;pointer-events:auto}.dou-flow-editor__node:is(:hover,:has(:focus-visible),.is-selected) .dou-flow-port[data-visible=hover]{opacity:1;pointer-events:auto}.dou-flow-editor.is-connecting .dou-flow-port[data-visible].is-unavailable{opacity:0;pointer-events:none}.dou-flow-editor.is-connecting .dou-flow-port[data-visible].is-valid{opacity:.6}.dou-flow-editor.is-connecting .dou-flow-port[data-visible]:-webkit-any(.is-active,.is-candidate,.is-refused){opacity:1}.dou-flow-editor.is-connecting .dou-flow-port[data-visible]:-moz-any(.is-active,.is-candidate,.is-refused){opacity:1}.dou-flow-editor.is-connecting .dou-flow-port[data-visible]:is(.is-active,.is-candidate,.is-refused){opacity:1}.dou-flow-editor.is-readonly .dou-flow-editor__node .dou-flow-port[data-visible]{opacity:0;pointer-events:none}.dou-flow-editor__marquee{position:absolute;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background-color:color-mix(in oklab,var(--dou-flow-editor-selected)8%,transparent);pointer-events:none;border-radius:2px;top:0;left:0}.dou-flow-editor__panels{position:absolute;pointer-events:none;inset:0}.dou-flow-editor__panels>*{pointer-events:auto}.dou-flow-editor__panels>.dou-flow-editor__comments{position:absolute;overflow:hidden;pointer-events:none;inset:0}.dou-flow-editor__comment{position:absolute;display:inline-flex;box-sizing:border-box;border:1px solid var(--dou-color-border);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);color:var(--dou-color-text-secondary);font:inherit;font-size:var(--dou-font-size-sm);font-variant-numeric:tabular-nums;cursor:pointer;pointer-events:auto;transition-property:border-color,color;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);border-radius:12px;justify-content:center;align-items: center;gap:2px;min-width:24px;height:24px;margin:0;padding:0 4px;line-height:1;top:0;left:0;transform:translate(-50%,-50%)}.dou-flow-editor__comment>svg{flex:none;width:14px;height:14px}.dou-flow-editor__comment.is-node{z-index:1;transform:translate(6px,calc(-100% - 6px))}.dou-flow-editor__comment.is-pin{z-index:1;color:var(--dou-color-text);font-weight:var(--dou-font-weight-medium);border-radius:12px 12px 12px 2px;transform:translateY(-100%)}@media (hover:hover){.dou-flow-editor__comment:hover{border-color:var(--dou-color-border-strong);color:var(--dou-color-text)}}.dou-flow-editor__comment.is-active{border-color:var(--dou-color-border-strong);color:var(--dou-color-text)}.dou-flow-editor__comment:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:2px}@media (pointer:coarse){.dou-flow-editor__comment:after{position:absolute;content:"";inset:-8px}.dou-flow-editor__comment.is-lifted{transform:translate(-50%,calc(-50% - 8px))}}.dou-flow-editor__comment-card{box-sizing:border-box;max-height:min(var(--dou-floating-available,100vh),480px,calc(100vh - 32px));overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-container);background-color:color-mix(in oklab,var(--dou-color-text)calc(4%*var(--dou-scheme-dark)),var(--dou-color-bg-surface));box-shadow:var(--dou-shadow-md);width:min(340px,100vw - 32px);padding:12px}.dou-flow-editor__comment-card.is-away{visibility:hidden}.dou-flow-editor__comment-card>.dou-comment-thread+.dou-comment-thread{border-top:1px solid var(--dou-color-border-subtle);margin-top:12px;padding-top:12px}.dou-flow-editor__find{position:absolute;display:flex;container-type:inline-size;pointer-events:none;justify-content:flex-end;align-items: flex-start;top:12px;left:12px;right:12px}.dou-flow-editor__find>*{pointer-events:auto}.dou-flow-editor__found{position:absolute;box-sizing:border-box;border-radius:var(--dou-flow-editor-node-radius);outline:4px solid color-mix(in oklab,var(--dou-color-warning)35%,transparent);outline-offset:2px;pointer-events:none;top:0;left:0}.dou-flow-editor__found.is-current{outline-color:color-mix(in oklab,var(--dou-color-warning)70%,transparent)}.dou-flow-editor__notice{position:absolute;z-index:20;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);color:var(--dou-color-text);font-size:var(--dou-font-size-sm);pointer-events:none;width:max-content;max-width:calc(100% - 24px);padding:6px 12px;bottom:12px;left:50%;transform:translate(-50%)}.dou-flow-editor__end,.dou-flow-editor__live{position:absolute;overflow:hidden;clip-path:inset(50%);white-space:nowrap;width:1px;height:1px}.dou-flow-editor__node.is-container{background-color:color-mix(in oklab,var(--dou-color-text)3%,var(--dou-flow-editor-node-bg));box-shadow:none}.dou-flow-editor__node.is-container.is-selected{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent)}.dou-flow-editor__node.is-container.is-selected.is-dragging{box-shadow:0 0 0 3px color-mix(in oklab,var(--dou-flow-editor-selected)14%,transparent)}.dou-flow-editor__node.is-container.is-dragging:not(.is-selected){box-shadow:var(--dou-shadow-sm)}.dou-flow-editor__node.is-drop-target,.dou-flow-editor__simple.is-drop-target{border-color:var(--dou-flow-editor-selected);background-color:color-mix(in oklab,var(--dou-flow-editor-selected)6%,var(--dou-flow-editor-node-bg))}.dou-flow-editor__resize{position:absolute;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);cursor:nwse-resize;translate:50% 50%;scale:calc(1/var(--dou-flow-editor-zoom,1));border-radius:3px;width:10px;height:10px;bottom:0;right:0}.dou-flow-editor__resize:before{content:"";position:absolute;inset:-8px}.dou-flow-peers{--dou-flow-peer-color:var(--dou-color-text-secondary);--dou-flow-peer-line:calc(1.5px/var(--dou-flow-editor-zoom,1))}.dou-flow-peer{position:absolute;box-sizing:border-box;border-radius:var(--dou-flow-editor-node-radius);outline:var(--dou-flow-peer-line)solid var(--dou-flow-peer-color);outline-offset:calc(3px/var(--dou-flow-editor-zoom,1));pointer-events:none;top:0;left:0}.dou-flow-peer.is-moving{outline-style:dashed;background-color:color-mix(in oklab,var(--dou-flow-peer-color)8%,transparent)}.dou-flow-peer__name{position:absolute;margin-bottom:calc(4px/var(--dou-flow-editor-zoom,1));background-color:var(--dou-flow-peer-color);color:oklch(from var(--dou-flow-peer-color)clamp(.2,(.66 - l)*100,.99)0 0);font-size:var(--dou-font-size-sm);white-space:nowrap;scale:calc(1/var(--dou-flow-editor-zoom,1));transform-origin:left bottom;border-radius:4px;padding:0 6px;line-height:18px;bottom:100%;left:0}.dou-flow-peer__lines{position:absolute;overflow:visible;pointer-events:none;width:1px;height:1px;top:0;left:0}.dou-flow-peer__lines path{fill:none;stroke:var(--dou-flow-peer-color);stroke-width:1.5px;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}.dou-flow-group-node{height:100%}.dou-flow-editor__node.is-collapsed>.dou-flow-group-node{height:auto}.dou-flow-group-node__head{display:flex;box-sizing:border-box;align-items: center;gap:4px;height:40px;padding:0 12px 0 8px}.dou-flow-group-node__toggle{display:inline-flex;color:var(--dou-color-text-tertiary);cursor:pointer;transition-property:background-color,color;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items: center;width:24px;height:24px;padding:0;font-size:16px}.dou-flow-group-node__toggle>svg{transition:rotate var(--dou-motion-duration-fast)var(--dou-motion-easing)}.dou-flow-group-node__toggle:hover:not(:disabled){background:color-mix(in oklab,var(--dou-color-text)6%,transparent);color:var(--dou-color-text)}.dou-flow-group-node__toggle:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-flow-group-node__toggle:disabled{cursor:default}.dou-flow-group-node.is-collapsed .dou-flow-group-node__toggle>svg{rotate:-90deg}.dou-flow-group-node__title{overflow:hidden;color:var(--dou-color-text-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:500;line-height:20px}.dou-flow-group-node__input{box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);outline:none;background:var(--dou-color-bg-surface);color:var(--dou-color-text);font:inherit;font-size:max(var(--dou-font-size-input-min,0px),13px);border-radius:6px;flex:1;min-width:0;height:24px;padding:0 6px}@media (prefers-reduced-motion:reduce){.dou-flow-group-node__toggle>svg{transition:none}}.dou-flow-default-node{width:208px}.dou-flow-editor__node.is-sized>.dou-flow-default-node{width:auto}.dou-flow-default-node__head{position:relative;display:flex;box-sizing:border-box;align-items: center;gap:8px;min-height:44px;padding:0 12px}.dou-flow-default-node__icon{display:inline-flex;border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-secondary);flex:none;justify-content:center;align-items: center;width:24px;height:24px}.dou-flow-default-node__icon svg{width:16px;height:16px}.dou-flow-default-node__title{overflow-x:clip;font-weight:var(--dou-font-weight-medium);text-overflow:ellipsis;white-space:nowrap;text-box:trim-both cap alphabetic;flex:1;min-width:0}.dou-flow-default-node__status{border-radius:var(--dou-radius-full);background-color:var(--dou-flow-editor-status-pending);flex:none;width:8px;height:8px}.dou-flow-default-node__status.is-running{background-color:var(--dou-flow-editor-status-running)}.dou-flow-default-node__status.is-done{background-color:var(--dou-flow-editor-status-done)}.dou-flow-default-node__status.is-error{background-color:var(--dou-flow-editor-status-error)}.dou-flow-default-node__description{color:var(--dou-color-text-secondary);font-size:var(--dou-font-size-sm);margin:-4px 0 0;padding:0 12px 12px;line-height:20px}.dou-flow-default-node__ports{border-top:1px solid var(--dou-color-border-subtle);padding:3px 0 4px}.dou-flow-default-node__row{position:relative;display:flex;box-sizing:border-box;color:var(--dou-color-text-secondary);font-size:var(--dou-font-size-sm);align-items: center;height:28px;padding:0 12px}.dou-flow-default-node__port{overflow-x:clip;text-overflow:ellipsis;white-space:nowrap;text-box:trim-both cap alphabetic;min-width:0}.dou-flow-default-node__port.is-output{text-align:right;margin-left:auto}.dou-flow-minimap{position:absolute;overflow:hidden;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);line-height:0}.dou-flow-minimap.is-top-left{top:12px;left:12px}.dou-flow-minimap.is-top-right{top:12px;right:12px}.dou-flow-minimap.is-bottom-left{bottom:12px;left:12px}.dou-flow-minimap.is-bottom-right{bottom:12px;right:12px}.dou-flow-minimap svg{display:block;cursor:pointer;touch-action:none}.dou-flow-minimap.is-dragging svg{cursor:grabbing}.dou-flow-minimap__node{fill:var(--dou-color-bg-muted);stroke:var(--dou-color-border-strong);stroke-width:1px;vector-effect:non-scaling-stroke}.dou-flow-minimap__node.is-selected{fill:color-mix(in oklab,var(--dou-flow-editor-selected)24%,var(--dou-color-bg-surface));stroke:var(--dou-flow-editor-selected)}.dou-flow-minimap__shade{fill:color-mix(in oklab,var(--dou-color-text)6%,transparent)}.dou-flow-minimap__view{fill:none;stroke:var(--dou-color-text-tertiary);stroke-width:1px;vector-effect:non-scaling-stroke}.dou-flow-controls{position:absolute;display:flex;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);align-items: center;gap:2px;padding:2px}.dou-flow-controls.is-top-left{top:12px;left:12px}.dou-flow-controls.is-top-right{top:12px;right:12px}.dou-flow-controls.is-bottom-left{bottom:12px;left:12px}.dou-flow-controls.is-bottom-right{bottom:12px;right:12px}.dou-flow-controls__button{display:inline-flex;box-sizing:border-box;border-radius:var(--dou-radius-control);color:var(--dou-color-text-secondary);font:inherit;font-size:var(--dou-font-size-sm);font-variant-numeric:tabular-nums;cursor:pointer;transition:background-color var(--dou-motion-duration-fast)var(--dou-motion-easing);background:0 0;border:0;justify-content:center;align-items: center;min-width:28px;height:28px;padding:0 6px}.dou-flow-controls__button svg{width:16px;height:16px}.dou-flow-controls__button:hover:not(:disabled){background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-flow-controls__button:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-flow-controls__button:disabled{color:var(--dou-color-text-disabled);cursor:default}.dou-flow-controls__zoom{min-width:48px}.dou-flow-controls__divider{background-color:var(--dou-color-border);width:1px;height:16px;margin:0 2px}.dou-flow-controls__button.is-active{background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-flow-toolbar{position:absolute;display:flex;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);align-items: center;gap:2px;padding:2px}@media (pointer:coarse){.dou-flow-toolbar .dou-flow-controls__button{min-width:40px;height:40px}}.dou-flow-editor__menu-anchor{position:absolute;overflow:hidden;width:0;height:0}.dou-flow-editor__ghost{position:fixed;z-index:2147480000;pointer-events:none;transition:opacity var(--dou-motion-duration-fast)var(--dou-motion-easing);top:0;left:0;translate:-50% -50%}.dou-flow-editor__ghost.is-outside{opacity:.56}.dou-flow-editor__ghost-card{display:flex;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:var(--dou-radius-container);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-md);color:var(--dou-color-text);font-family:var(--dou-font-family);font-size:var(--dou-font-size-sm);white-space:nowrap;align-items: center;gap:8px;height:36px;padding:0 12px 0 8px}.dou-flow-editor__ghost-icon,.dou-flow-quick-add__icon{display:inline-flex;border-radius:var(--dou-radius-control);background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-secondary);flex:none;justify-content:center;align-items: center;width:20px;height:20px}:is(.dou-flow-editor__ghost-icon,.dou-flow-quick-add__icon) svg{width:14px;height:14px}.dou-flow-quick-add{width:260px;padding:0}.dou-flow-quick-add.is-custom{width:auto}.dou-flow-quick-add .dou-command__search{height:40px;padding:0 12px}.dou-flow-quick-add .dou-command__item{gap:8px}.dou-flow-quick-add .dou-command__label{flex:none}}.dou-flow-editor.is-refused .dou-flow-editor__edge.is-preview{stroke:var(--dou-color-danger)}@layer dou.components{.dou-flow-editor{--dou-flow-whiteboard-ink:color-mix(in oklab,var(--dou-color-text)72%,transparent)}.dou-flow-editor[data-board-tool=hand]{cursor:grab}.dou-flow-editor[data-board-tool=hand] .dou-flow-editor__node{cursor:grab}.dou-flow-editor[data-board-panning]{cursor:grabbing}.dou-flow-editor[data-board-panning] .dou-flow-editor__node{cursor:grabbing}.dou-flow-editor[data-board-tool=rect]{cursor:crosshair}.dou-flow-editor[data-board-tool=rect] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=ellipse]{cursor:crosshair}.dou-flow-editor[data-board-tool=ellipse] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=diamond]{cursor:crosshair}.dou-flow-editor[data-board-tool=diamond] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=sticky]{cursor:crosshair}.dou-flow-editor[data-board-tool=sticky] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=text]{cursor:text}.dou-flow-editor[data-board-tool=text] .dou-flow-editor__node{cursor:text}.dou-flow-editor[data-board-tool=comment] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=pen]{cursor:crosshair}.dou-flow-editor[data-board-tool=pen] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor[data-board-tool=eraser]{cursor:crosshair}.dou-flow-editor[data-board-tool=eraser] .dou-flow-editor__node{cursor:crosshair}.dou-flow-editor__node:has(>.dou-whiteboard-node.is-ink){pointer-events:none}.dou-flow-editor__node:has(>.dou-whiteboard-node.is-ink) .dou-flow-editor__resize{pointer-events:auto}.dou-flow-editor__node:has(>.dou-whiteboard-node)>.dou-flow-editor__resize{display:none}.dou-whiteboard-node{--dou-whiteboard-tone:var(--dou-color-neutral);position:relative;display:grid;box-sizing:border-box;min-height:inherit;color:var(--dou-color-text);place-items: center;width:100%;height:100%}.dou-whiteboard-node.is-primary{--dou-whiteboard-tone:var(--dou-color-primary)}.dou-whiteboard-node.is-success{--dou-whiteboard-tone:var(--dou-color-success)}.dou-whiteboard-node.is-warning{--dou-whiteboard-tone:var(--dou-color-warning)}.dou-whiteboard-node.is-danger{--dou-whiteboard-tone:var(--dou-color-danger)}.dou-whiteboard-node.is-sticky{background-color:color-mix(in oklab,var(--dou-whiteboard-tone)20%,var(--dou-color-bg-surface));box-shadow:var(--dou-shadow-sm);border-radius:4px}.dou-whiteboard-node.is-text{place-items: start stretch}.dou-whiteboard-node.is-erasing{opacity:.3}.dou-whiteboard-node__ink{position:absolute;overflow:visible;fill:var(--dou-flow-whiteboard-ink);width:100%;height:100%;inset:0}.dou-whiteboard-node:not(.is-neutral)>.dou-whiteboard-node__ink{fill:var(--dou-whiteboard-tone)}.dou-whiteboard-node__ink path{pointer-events:visiblePainted}.dou-whiteboard-node__ink-hit{fill:none;stroke:transparent;stroke-width:12px;vector-effect:non-scaling-stroke;pointer-events:stroke}.dou-whiteboard-node__image{position:absolute;display:block;box-sizing:border-box;object-fit:contain;pointer-events:none;user-select:none;border-radius:4px;width:100%;height:100%;inset:0}.dou-whiteboard-node__image.is-broken{display:flex;background-color:var(--dou-color-bg-muted);color:var(--dou-color-text-tertiary);justify-content:center;align-items: center}.dou-whiteboard-node__image.is-broken>svg{width:min(24px,40%);height:min(24px,40%)}.dou-whiteboard-handles,.dou-whiteboard-node__frame{position:absolute;pointer-events:none;top:0;left:0}.dou-whiteboard-node__frame{box-sizing:border-box}.dou-whiteboard-node__turn,.dou-whiteboard-node__corner{position:absolute;z-index:1;box-sizing:border-box;border:1px solid var(--dou-flow-editor-selected);background:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);pointer-events:auto;touch-action:none;scale:calc(1/var(--dou-flow-editor-zoom,1));width:10px;height:10px}:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner):before{content:"";position:absolute;inset:-8px}@media (pointer:coarse){:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner):before{inset:-15px}}:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner)>.dou-whiteboard-node__target{content:"";position:absolute;inset:-8px}@media (pointer:coarse){:is(.dou-whiteboard-node__turn,.dou-whiteboard-node__corner)>.dou-whiteboard-node__target{inset:-15px}}.dou-whiteboard-node__turn:before{content:none}.dou-whiteboard-node__turn{bottom:calc(-24px/var(--dou-flow-editor-zoom,1));cursor:grab;border-radius:50%;left:50%;translate:-50% 50%}@media (pointer:coarse){.dou-whiteboard-node__turn{bottom:calc(-40px/var(--dou-flow-editor-zoom,1))}}.dou-whiteboard-node__corner{--dou-whiteboard-corner-reach:8px;--dou-whiteboard-corner-reach-x:clamp(0px,var(--dou-whiteboard-half-width) - var(--dou-whiteboard-anchor-reach-x) - 5px,var(--dou-whiteboard-corner-reach));--dou-whiteboard-corner-reach-y:clamp(0px,var(--dou-whiteboard-half-height) - var(--dou-whiteboard-anchor-reach-y) - 5px,var(--dou-whiteboard-corner-reach));pointer-events:none;border-radius:3px;translate:-50% -50%}@media (pointer:coarse){.dou-whiteboard-node__corner{--dou-whiteboard-corner-reach:15px}}.dou-whiteboard-node__corner:before{inset:calc(-1*var(--dou-whiteboard-corner-reach));pointer-events:auto}.dou-whiteboard-node__corner.is-left:before{right:calc(-1*var(--dou-whiteboard-corner-reach-x))}.dou-whiteboard-node__corner.is-right:before{left:calc(-1*var(--dou-whiteboard-corner-reach-x))}.dou-whiteboard-node__corner.is-top:before{bottom:calc(-1*var(--dou-whiteboard-corner-reach-y))}.dou-whiteboard-node__corner.is-bottom:before{top:calc(-1*var(--dou-whiteboard-corner-reach-y))}.dou-whiteboard-node__side{position:absolute;pointer-events:auto;touch-action:none;translate:-50% -50%}.dou-whiteboard-node__side.is-x{width:calc(8px/var(--dou-flow-editor-zoom,1));height:calc(100% - 20px/var(--dou-flow-editor-zoom,1))}.dou-whiteboard-node__side.is-y{width:calc(100% - 20px/var(--dou-flow-editor-zoom,1));height:calc(8px/var(--dou-flow-editor-zoom,1))}@media (pointer:coarse){.dou-whiteboard-node__side.is-x{width:clamp(calc(16px/var(--dou-flow-editor-zoom,1)),50%,calc(40px/var(--dou-flow-editor-zoom,1)))}.dou-whiteboard-node__side.is-y{height:clamp(calc(16px/var(--dou-flow-editor-zoom,1)),50%,calc(40px/var(--dou-flow-editor-zoom,1)))}}.dou-whiteboard-node__shape{position:absolute;overflow:visible;fill:var(--dou-color-bg-surface);stroke:var(--dou-flow-whiteboard-ink);stroke-linejoin:round;stroke-width:1.5px;width:100%;height:100%;inset:0}.dou-whiteboard-node:not(.is-neutral)>.dou-whiteboard-node__shape{fill:color-mix(in oklab,var(--dou-whiteboard-tone)10%,var(--dou-color-bg-surface));stroke:var(--dou-whiteboard-tone)}.dou-whiteboard-node__text{position:relative;box-sizing:border-box;overflow:hidden;font:inherit;font-size:max(var(--dou-font-size-input-min,0px),var(--dou-font-size-md));overflow-wrap:anywhere;text-align:center;white-space:pre-wrap;max-width:100%;max-height:100%;padding:12px 16px;line-height:1.5}.is-sticky>.dou-whiteboard-node__text{padding:16px}.is-shape>.dou-whiteboard-node__text:not(.dou-whiteboard-node__field){display:-webkit-box;clip-path:inset(12px 0);-webkit-box-orient:vertical}.is-sticky>.dou-whiteboard-node__text:not(.dou-whiteboard-node__field){display:-webkit-box;clip-path:inset(12px 0);-webkit-box-orient:vertical}.is-sticky>.dou-whiteboard-node__text:not(.dou-whiteboard-node__field){clip-path:inset(16px 0)}.is-text>.dou-whiteboard-node__text{font-size:var(--dou-font-size-lg);text-align:start;padding:4px 8px}.dou-whiteboard-node__field{display:block;color:inherit;outline:none;resize:none;field-sizing:content;background:0 0;border:0;width:100%;min-height:1lh;margin:0}.dou-whiteboard-node,.dou-whiteboard-node__frame{--dou-whiteboard-anchor-reach:6px;--dou-whiteboard-half-width:calc(var(--dou-whiteboard-frame-width,100px)*var(--dou-flow-editor-zoom,1)/2);--dou-whiteboard-half-height:calc(var(--dou-whiteboard-frame-height,100px)*var(--dou-flow-editor-zoom,1)/2);--dou-whiteboard-anchor-reach-x:clamp(4px,var(--dou-whiteboard-half-width) - 5px,var(--dou-whiteboard-anchor-reach));--dou-whiteboard-anchor-reach-y:clamp(4px,var(--dou-whiteboard-half-height) - 5px,var(--dou-whiteboard-anchor-reach))}@media (pointer:coarse){:is(.dou-whiteboard-node,.dou-whiteboard-node__frame){--dou-whiteboard-anchor-reach:10px}}.dou-whiteboard-node.is-selected .dou-whiteboard-node__anchor.is-top:before{inset:calc(4px - var(--dou-whiteboard-anchor-reach-x))}.dou-whiteboard-node.is-selected .dou-whiteboard-node__anchor.is-bottom:before{inset:calc(4px - var(--dou-whiteboard-anchor-reach-x))}.dou-whiteboard-node.is-selected .dou-whiteboard-node__anchor.is-left:before{inset:calc(4px - var(--dou-whiteboard-anchor-reach-y))}.dou-whiteboard-node.is-selected .dou-whiteboard-node__anchor.is-right:before{inset:calc(4px - var(--dou-whiteboard-anchor-reach-y))}.dou-whiteboard-node__anchors{position:absolute;z-index:1;pointer-events:none;inset:0}.dou-flow-editor[data-board-tool] .dou-flow-port{scale:calc(1/var(--dou-flow-editor-zoom,1))}.dou-flow-editor[data-board-tool] .dou-flow-port.is-candidate{scale:calc(1.25/var(--dou-flow-editor-zoom,1))}.dou-flow-editor[data-board-tool]:not([data-board-tool=select]) .dou-flow-port[data-visible=hover]:not(.is-active),.dou-whiteboard-node.is-editing .dou-flow-port[data-visible]{opacity:0;pointer-events:none}[data-edge-type=connector]>.dou-flow-editor__edge{stroke-linecap:round;stroke-linejoin:round}[data-edge-type=connector]>.dou-flow-editor__edge:not(.is-selected){stroke:var(--dou-flow-whiteboard-ink);stroke-width:1.5px}.dou-whiteboard-strokes{position:absolute;overflow:visible;pointer-events:none;width:1px;height:1px;top:0;left:0}.dou-whiteboard-strokes__ink{fill:var(--dou-flow-whiteboard-ink)}.dou-whiteboard-strokes__eraser{fill:color-mix(in oklab,var(--dou-color-text)6%,transparent);stroke:var(--dou-color-border-strong);stroke-width:calc(1px/var(--dou-flow-editor-zoom,1))}.dou-whiteboard-draft{position:absolute;box-sizing:border-box;border:calc(1px/var(--dou-flow-editor-zoom,1))dashed var(--dou-flow-editor-selected);background-color:color-mix(in oklab,var(--dou-flow-editor-selected)6%,transparent);pointer-events:none;border-radius:4px;top:0;left:0}.dou-whiteboard-draft.is-ellipse{border-radius:50%}.dou-whiteboard-toolbar{position:absolute;display:flex;box-sizing:border-box;border:1px solid var(--dou-color-border);border-radius:calc(var(--dou-radius-control) + 2px);background-color:var(--dou-color-bg-surface);box-shadow:var(--dou-shadow-sm);width:max-content;max-width:calc(100% - 24px);padding:2px;top:12px;left:50%;translate:-50%}.dou-whiteboard-toolbar__scroll{display:flex;overflow-x:auto;border-radius:var(--dou-radius-control);overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x;align-items: center;gap:2px;min-width:0}.dou-whiteboard-toolbar__scroll::-webkit-scrollbar{display:none}.dou-whiteboard-toolbar__scroll.has-more-start{mask-image:linear-gradient(90deg,#0000,#000 32px)}.dou-whiteboard-toolbar__scroll.has-more-end{mask-image:linear-gradient(270deg,#0000,#000 32px)}.dou-whiteboard-toolbar__scroll.has-more-start.has-more-end{mask-image:linear-gradient(90deg,#0000,#000 32px calc(100% - 32px),#0000)}.dou-whiteboard-toolbar__button{position:relative;display:inline-flex;border-radius:var(--dou-radius-control);color:var(--dou-color-text-secondary);cursor:pointer;transition-property:background-color,color;transition-duration:var(--dou-motion-duration-fast);transition-timing-function:var(--dou-motion-easing);background:0 0;border:0;flex:none;justify-content:center;align-items: center;width:32px;height:32px;padding:0}.dou-whiteboard-toolbar__button svg{width:16px;height:16px}.dou-whiteboard-toolbar__button:hover{background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-whiteboard-toolbar__button[aria-pressed=true]{background-color:var(--dou-color-bg-muted);color:var(--dou-color-text)}.dou-whiteboard-toolbar__button.is-locked:after{position:absolute;border-radius:var(--dou-radius-full);content:"";background-color:currentColor;width:4px;height:4px;bottom:3px;left:50%;translate:-50%}.dou-whiteboard-toolbar__button:focus-visible{outline:2px solid var(--dou-color-focus);outline-offset:0}.dou-whiteboard-toolbar__divider{background-color:var(--dou-color-border);flex:none;width:1px;height:16px;margin:0 2px}}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { FlowPortVisible } from '../core/model';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** The id of one of the node's ports. */
|
|
3
4
|
id: string;
|
|
4
|
-
/**
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* When the port shows: `always`; `hover`, on a hovered or selected node,
|
|
7
|
+
* or one with the keyboard focus in it (a field being typed in);
|
|
8
|
+
* or `connecting`, only while an edge is drawn. Never shown in a
|
|
9
|
+
* readonly editor. Defaults to the port's own `visible`, else `always`.
|
|
10
|
+
*/
|
|
11
|
+
visible?: FlowPortVisible;
|
|
6
12
|
};
|
|
7
13
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
14
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FlowPortVisible } from '../core/model';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
visible?: FlowPortVisible;
|
|
5
|
+
/** placed by the editor, not by the node's component */
|
|
6
|
+
auto?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const DouFlowPort: import("dou-ui").WithInstall<import("vue").DefineComponent<{
|
|
2
2
|
id: string;
|
|
3
|
-
|
|
3
|
+
visible?: import("../index.js").FlowPortVisible;
|
|
4
4
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
5
5
|
id: string;
|
|
6
|
-
|
|
6
|
+
visible?: import("../index.js").FlowPortVisible;
|
|
7
7
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, import("vue").HTMLAttributes>;
|
|
@@ -79,7 +79,16 @@ export interface FlowPortSpec {
|
|
|
79
79
|
* number. A new edge on a full port replaces its oldest edge.
|
|
80
80
|
*/
|
|
81
81
|
max?: number;
|
|
82
|
+
/**
|
|
83
|
+
* When the port shows: `always`; `hover`, on a hovered or selected node,
|
|
84
|
+
* or one with the keyboard focus in it (a field being typed in);
|
|
85
|
+
* or `connecting`, only while an edge is drawn. A `<DouFlowPort visible>`
|
|
86
|
+
* overrides it. Defaults to `always`.
|
|
87
|
+
*/
|
|
88
|
+
visible?: FlowPortVisible;
|
|
82
89
|
}
|
|
90
|
+
/** When a port shows, see `FlowPortSpec.visible`. */
|
|
91
|
+
export type FlowPortVisible = 'always' | 'hover' | 'connecting';
|
|
83
92
|
/** Where the canvas is shown: `x` and `y` are the screen offset of the canvas origin. */
|
|
84
93
|
export interface FlowViewport {
|
|
85
94
|
x: number;
|
|
@@ -96,6 +96,8 @@ export declare const portSide: (port: FlowPortSpec) => PortSide;
|
|
|
96
96
|
/**
|
|
97
97
|
* The ports of `ports: 'sides'`: an output and an input in the middle of
|
|
98
98
|
* each side. Edges go from an output (`right`) to an input (`left-in`).
|
|
99
|
+
* Like a whiteboard shape's anchors, the outputs show on hover and the
|
|
100
|
+
* inputs only while an edge is drawn.
|
|
99
101
|
* `right` and `left-in` come first, so a node added after another joins it
|
|
100
102
|
* left to right.
|
|
101
103
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -195,7 +195,7 @@ export { defineNodeType, labelOf, portSide, portsOf, resizeOf, sidePorts } from
|
|
|
195
195
|
export type { NodePaletteSpec, NodeResize, NodeTypeSpec, NodeViewProps } from './core/node-types';
|
|
196
196
|
export type { FlowMenuTarget, FlowToolbarItem } from './core/menu';
|
|
197
197
|
export { createId, emptyDocument, emptySelection } from './core/model';
|
|
198
|
-
export type { FlowData, FlowDocument, FlowEdge, FlowEndpoint, FlowNode, FlowPortSpec, FlowSelection, FlowViewport, Point, PortSide, Rect, } from './core/model';
|
|
198
|
+
export type { FlowData, FlowDocument, FlowEdge, FlowEndpoint, FlowNode, FlowPortSpec, FlowPortVisible, FlowSelection, FlowViewport, Point, PortSide, Rect, } from './core/model';
|
|
199
199
|
export { checkDocument, migrateDocument } from './document';
|
|
200
200
|
export type { CheckDocumentOptions, DocumentProblem } from './document';
|
|
201
201
|
export { applyFlowSteps, compactFlowSteps, FlowTransaction } from './core/transaction';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-node.js","names":["_sfc_main"],"sources":["../../src/whiteboard/board-node.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ImageOffIcon } from '@dou-ui/icons'\nimport { computed, nextTick, ref, toRef, useTemplateRef, watch } from 'vue'\nimport { DouFlowPort } from '../components/port'\nimport { useFlowEditor } from '../context'\nimport type { NodeViewProps } from '../core/node-types'\nimport type { Tone } from 'dou-ui'\nimport { fitInk, inkOutline, INK_SIZE, unpack } from './ink'\nimport { anchorSides, type WhiteboardShape } from './model'\nimport { boardState } from './state'\nimport { RESIZE_HANDLES, useTransformHandles, type ResizeHandle } from './transform'\n\ntype BoardData = {\n [key: string]: unknown\n text?: string\n shape?: WhiteboardShape\n tone?: Tone\n rotation?: number\n points?: number[]\n box?: [number, number]\n size?: number\n src?: string\n alt?: string\n}\n\ntype Kind = 'shape' | 'sticky' | 'text' | 'ink' | 'image'\n\nconst props = defineProps<NodeViewProps<BoardData>>()\nconst ctx = useFlowEditor()\nconst state = boardState(ctx)\n\nconst KINDS: readonly Kind[] = ['sticky', 'text', 'ink', 'image']\n/** What the node is: one of the shapes, a note, text, a pen stroke or an image. */\nconst kind = computed<Kind>(() => KINDS.find((k) => k === props.node.type) ?? 'shape')\nconst shape = computed<WhiteboardShape>(() => props.data.shape ?? 'rect')\nconst tone = computed<Tone>(\n () => props.data.tone ?? (kind.value === 'sticky' ? 'warning' : 'neutral'),\n)\nconst writable = computed(() => ['shape', 'sticky', 'text'].includes(kind.value))\n\nconst MIN: Record<Kind, number> = { shape: 24, sticky: 64, text: 40, ink: 8, image: 24 }\nconst rotation = computed(() => props.data.rotation ?? 0)\nconst { turning, startTurn, startResize } = useTransformHandles(\n ctx,\n toRef(props, 'node'),\n rotation,\n { width: MIN[kind.value], height: MIN[kind.value] },\n)\n/*\n * A handle being dragged shows the node changed through the editor, so\n * `node` and `data` already are what it is dragged to: the node's own frame,\n * its ports and its edges follow along with it.\n */\nconst transform = computed(() => (rotation.value ? { rotate: `${rotation.value}deg` } : undefined))\n/**\n * The resize handles: an image keeps its proportions, from its corners; text\n * only widens, so it has no top or bottom side; the rest has every corner\n * and side.\n */\nconst resizeHandles = computed(() =>\n kind.value === 'image'\n ? RESIZE_HANDLES.filter((h) => h.x && h.y)\n : kind.value === 'text'\n ? RESIZE_HANDLES.filter((h) => h.x)\n : RESIZE_HANDLES,\n)\nconst sideHandles = computed(() => resizeHandles.value.filter((h) => !h.x || !h.y))\nconst cornerHandles = computed(() => resizeHandles.value.filter((h) => h.x && h.y))\n/** The node's box, turned with it, for the handles drawn above every node. */\nconst frameStyle = computed(() => {\n const rect = ctx.getNodeRect(props.node.id) ?? { ...props.node, width: 0, height: 0 }\n return {\n // `translate`, not `transform`: it applies before `rotate`, so the box\n // turns about its own centre and its offset is not turned with it\n translate: `${rect.x}px ${rect.y}px`,\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n rotate: rotation.value ? `${rotation.value}deg` : undefined,\n }\n})\nconst CURSORS = ['ew-resize', 'nwse-resize', 'ns-resize', 'nesw-resize'] as const\n/** The resize cursor along a handle's way out, turned with the node. */\nfunction cursorOf(handle: ResizeHandle) {\n // text only widens, from a corner too\n if (kind.value === 'text') handle = { x: handle.x, y: 0 }\n const degrees = (Math.atan2(handle.y, handle.x) * 180) / Math.PI + rotation.value\n return CURSORS[((Math.round(degrees / 45) % 4) + 4) % 4]\n}\nfunction onResize(event: PointerEvent, handle: ResizeHandle) {\n startResize(event, handle, {\n keepRatio: kind.value === 'image',\n widthOnly: kind.value === 'text',\n })\n}\n/** Where a handle sits on the box: `-1` is the start, `1` the end. */\nconst place = (v: -1 | 0 | 1) => `${(v + 1) * 50}%`\n\n/** Handles show on the one selected node, while the select tool is in hand. */\nconst handles = computed(\n () =>\n props.selected &&\n !props.readonly &&\n !editing.value &&\n state.tool.value === 'select' &&\n ctx.selection.value.nodes.length === 1,\n)\n\n/** The stroke fitted to the box shown, so stretching it keeps its thickness. */\nconst ink = computed(() => {\n const { points, box: inkBox } = props.data\n if (kind.value !== 'ink' || !points || !inkBox) return ''\n const size = props.data.size ?? INK_SIZE\n return inkOutline(fitInk(unpack(points), inkBox, shown.value.w, shown.value.h, size), size)\n})\nconst erasing = computed(() => state.erasing.value.has(props.node.id))\n\n// drawn in the node's own units, half the 1.5px stroke in from the edge\nconst shown = computed(() => ({ w: props.node.width ?? 160, h: props.node.height ?? 100 }))\nconst diamond = computed(() => {\n const { w, h } = shown.value\n const i = 1\n return `${w / 2},${i} ${w - i},${h / 2} ${w / 2},${h - i} ${i},${h / 2}`\n})\n\n// Whole lines that fit, the last one ending in an ellipsis, as an export draws them.\nconst textEl = useTemplateRef<HTMLElement>('textEl')\nconst textMetrics = ref<{ line: number; padding: number } | null>(null)\nwatch(\n textEl,\n (el) => {\n if (!el) return\n const s = getComputedStyle(el)\n const line = Number.parseFloat(s.lineHeight)\n if (!line) return\n const padding = Number.parseFloat(s.paddingTop) + Number.parseFloat(s.paddingBottom)\n textMetrics.value = { line, padding: padding || 0 }\n },\n { flush: 'post' },\n)\nconst textStyle = computed(() => {\n const m = textMetrics.value\n if (!m || kind.value === 'text') return undefined\n const height = shown.value.h\n return { '-webkit-line-clamp': Math.max(1, Math.floor((height - m.padding + 0.5) / m.line)) }\n})\n\n// An image that can't be loaded: a plain box with a sign, as an export draws it.\nconst broken = ref(false)\nwatch(\n () => props.data.src,\n () => (broken.value = false),\n)\n\nconst editing = computed(() => state.editing.value === props.node.id)\nconst draft = ref('')\nconst field = useTemplateRef<HTMLTextAreaElement>('field')\n\nwatch(\n editing,\n (on) => {\n if (!on) return\n draft.value = props.data.text ?? ''\n void nextTick(() => {\n fit()\n field.value?.focus()\n field.value?.select()\n })\n },\n { immediate: true },\n)\n\n// browsers without `field-sizing` grow the field by hand\nfunction fit() {\n const el = field.value\n if (!el || CSS.supports?.('field-sizing', 'content')) return\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n}\nwatch(draft, () => void nextTick(fit))\n\nfunction edit() {\n if (props.readonly || !writable.value) return\n state.editing.value = props.node.id\n}\n\nfunction finish() {\n if (!editing.value) return\n state.editing.value = null\n const text = draft.value.replace(/\\s+$/, '')\n // text with nothing written in it is nothing at all\n if (!text && kind.value === 'text') ctx.transact((tr) => tr.removeNode(props.node.id))\n else if (text !== (props.data.text ?? '')) props.updateData({ text: text || undefined })\n // back to the canvas, so the keys go on working\n ctx.root.value?.focus({ preventScroll: true })\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.isComposing) return\n // Escape, or mod+Enter, puts the text down; Enter is a new line\n if (event.key === 'Escape' || (event.key === 'Enter' && (event.metaKey || event.ctrlKey))) {\n event.preventDefault()\n event.stopPropagation()\n finish()\n }\n}\n</script>\n\n<template>\n <div\n class=\"dou-whiteboard-node\"\n :class=\"[\n `is-${kind}`,\n kind === 'shape' && `is-${shape}`,\n `is-${tone}`,\n {\n 'is-editing': editing,\n 'is-turned': !!rotation,\n 'is-turning': turning !== null,\n 'is-selected': selected,\n 'is-erasing': erasing,\n },\n ]\"\n :style=\"transform\"\n @dblclick.stop=\"edit\"\n >\n <svg\n v-if=\"kind === 'shape'\"\n class=\"dou-whiteboard-node__shape\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <rect\n v-if=\"shape === 'rect'\"\n x=\"0.75\"\n y=\"0.75\"\n :width=\"Math.max(0, shown.w - 1.5)\"\n :height=\"Math.max(0, shown.h - 1.5)\"\n rx=\"8\"\n />\n <ellipse\n v-else-if=\"shape === 'ellipse'\"\n :cx=\"shown.w / 2\"\n :cy=\"shown.h / 2\"\n :rx=\"Math.max(0, shown.w / 2 - 0.75)\"\n :ry=\"Math.max(0, shown.h / 2 - 0.75)\"\n />\n <polygon v-else :points=\"diamond\" />\n </svg>\n <svg\n v-else-if=\"kind === 'ink' && data.box\"\n class=\"dou-whiteboard-node__ink\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <path class=\"dou-whiteboard-node__ink-hit\" :d=\"ink\" />\n <path :d=\"ink\" />\n </svg>\n <div\n v-else-if=\"kind === 'image' && broken\"\n class=\"dou-whiteboard-node__image is-broken\"\n role=\"img\"\n :aria-label=\"data.alt || undefined\"\n >\n <ImageOffIcon />\n </div>\n <img\n v-else-if=\"kind === 'image'\"\n class=\"dou-whiteboard-node__image\"\n :src=\"data.src\"\n :alt=\"data.alt ?? ''\"\n draggable=\"false\"\n @error=\"broken = true\"\n />\n <textarea\n v-if=\"editing\"\n ref=\"field\"\n v-model=\"draft\"\n class=\"dou-whiteboard-node__text dou-whiteboard-node__field\"\n :aria-label=\"ctx.messages.value.board.editText\"\n @keydown=\"onKeydown\"\n @blur=\"finish\"\n @pointerdown.stop\n />\n <div\n v-else-if=\"writable\"\n ref=\"textEl\"\n class=\"dou-whiteboard-node__text\"\n :style=\"textStyle\"\n v-text=\"data.text\"\n />\n <div v-if=\"kind !== 'ink'\" class=\"dou-whiteboard-node__anchors\">\n <template v-for=\"side in anchorSides\" :key=\"side\">\n <DouFlowPort :id=\"`${side}-in`\" class=\"dou-whiteboard-node__anchor\" />\n <DouFlowPort :id=\"side\" class=\"dou-whiteboard-node__anchor\" />\n </template>\n </div>\n <template v-if=\"handles\">\n <!-- the sides stay on the node, under its anchors; the turn and the\n corners go above every node, so a neighbour never covers them -->\n <span\n v-for=\"handle in sideHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n :class=\"['dou-whiteboard-node__side', handle.x ? 'is-x' : 'is-y']\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-dou-nodrag\n aria-hidden=\"true\"\n @pointerdown=\"onResize($event, handle)\"\n />\n <Teleport :to=\"state.handles.value\" :disabled=\"!state.handles.value\">\n <div class=\"dou-whiteboard-node__frame\" :style=\"frameStyle\" aria-hidden=\"true\">\n <!-- data-flow-overlay on its target: the selection's toolbar keeps\n clear of where a finger can take it, when it floats below the\n node or the node is turned upside down -->\n <span class=\"dou-whiteboard-node__turn\" data-dou-nodrag @pointerdown=\"startTurn\">\n <span class=\"dou-whiteboard-node__target\" data-flow-overlay />\n </span>\n <span\n v-for=\"handle in cornerHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n class=\"dou-whiteboard-node__corner\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-dou-nodrag\n @pointerdown=\"onResize($event, handle)\"\n />\n </div>\n </Teleport>\n </template>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"board-node.js","names":["_sfc_main"],"sources":["../../src/whiteboard/board-node.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ImageOffIcon } from '@dou-ui/icons'\nimport { computed, nextTick, ref, toRef, useTemplateRef, watch } from 'vue'\nimport { DouFlowPort } from '../components/port'\nimport { useFlowEditor } from '../context'\nimport type { NodeViewProps } from '../core/node-types'\nimport type { Tone } from 'dou-ui'\nimport { fitInk, inkOutline, INK_SIZE, unpack } from './ink'\nimport { anchorSides, type WhiteboardShape } from './model'\nimport { boardState } from './state'\nimport { RESIZE_HANDLES, useTransformHandles, type ResizeHandle } from './transform'\n\ntype BoardData = {\n [key: string]: unknown\n text?: string\n shape?: WhiteboardShape\n tone?: Tone\n rotation?: number\n points?: number[]\n box?: [number, number]\n size?: number\n src?: string\n alt?: string\n}\n\ntype Kind = 'shape' | 'sticky' | 'text' | 'ink' | 'image'\n\nconst props = defineProps<NodeViewProps<BoardData>>()\nconst ctx = useFlowEditor()\nconst state = boardState(ctx)\n\nconst KINDS: readonly Kind[] = ['sticky', 'text', 'ink', 'image']\n/** What the node is: one of the shapes, a note, text, a pen stroke or an image. */\nconst kind = computed<Kind>(() => KINDS.find((k) => k === props.node.type) ?? 'shape')\nconst shape = computed<WhiteboardShape>(() => props.data.shape ?? 'rect')\nconst tone = computed<Tone>(\n () => props.data.tone ?? (kind.value === 'sticky' ? 'warning' : 'neutral'),\n)\nconst writable = computed(() => ['shape', 'sticky', 'text'].includes(kind.value))\n\nconst MIN: Record<Kind, number> = { shape: 24, sticky: 64, text: 40, ink: 8, image: 24 }\nconst rotation = computed(() => props.data.rotation ?? 0)\nconst { turning, startTurn, startResize } = useTransformHandles(\n ctx,\n toRef(props, 'node'),\n rotation,\n { width: MIN[kind.value], height: MIN[kind.value] },\n)\n/*\n * A handle being dragged shows the node changed through the editor, so\n * `node` and `data` already are what it is dragged to: the node's own frame,\n * its ports and its edges follow along with it.\n */\nconst transform = computed(() => (rotation.value ? { rotate: `${rotation.value}deg` } : undefined))\n/**\n * The resize handles: an image keeps its proportions, from its corners; text\n * only widens, so it has no top or bottom side; the rest has every corner\n * and side.\n */\nconst resizeHandles = computed(() =>\n kind.value === 'image'\n ? RESIZE_HANDLES.filter((h) => h.x && h.y)\n : kind.value === 'text'\n ? RESIZE_HANDLES.filter((h) => h.x)\n : RESIZE_HANDLES,\n)\nconst sideHandles = computed(() => resizeHandles.value.filter((h) => !h.x || !h.y))\nconst cornerHandles = computed(() => resizeHandles.value.filter((h) => h.x && h.y))\nconst rect = computed(\n () => ctx.getNodeRect(props.node.id) ?? { ...props.node, width: 0, height: 0 },\n)\n/**\n * The node's size, for the anchors and the corner handles to share the\n * corners of a small node: each keeps short of the other.\n */\nconst sizeStyle = computed(() => ({\n '--dou-whiteboard-frame-width': `${rect.value.width}px`,\n '--dou-whiteboard-frame-height': `${rect.value.height}px`,\n}))\n/** The node's box, turned with it, for the handles drawn above every node. */\nconst frameStyle = computed(() => {\n const box = rect.value\n return {\n // `translate`, not `transform`: it applies before `rotate`, so the box\n // turns about its own centre and its offset is not turned with it\n translate: `${box.x}px ${box.y}px`,\n width: `${box.width}px`,\n height: `${box.height}px`,\n ...sizeStyle.value,\n rotate: rotation.value ? `${rotation.value}deg` : undefined,\n }\n})\nconst CURSORS = ['ew-resize', 'nwse-resize', 'ns-resize', 'nesw-resize'] as const\n/** The resize cursor along a handle's way out, turned with the node. */\nfunction cursorOf(handle: ResizeHandle) {\n // text only widens, from a corner too\n if (kind.value === 'text') handle = { x: handle.x, y: 0 }\n const degrees = (Math.atan2(handle.y, handle.x) * 180) / Math.PI + rotation.value\n return CURSORS[((Math.round(degrees / 45) % 4) + 4) % 4]\n}\nfunction onResize(event: PointerEvent, handle: ResizeHandle) {\n startResize(event, handle, {\n keepRatio: kind.value === 'image',\n widthOnly: kind.value === 'text',\n })\n}\n/** Where a handle sits on the box: `-1` is the start, `1` the end. */\nconst place = (v: -1 | 0 | 1) => `${(v + 1) * 50}%`\n\n/** Handles show on the one selected node, while the select tool is in hand. */\nconst handles = computed(\n () =>\n props.selected &&\n !props.readonly &&\n !editing.value &&\n state.tool.value === 'select' &&\n ctx.selection.value.nodes.length === 1,\n)\n\n/** The stroke fitted to the box shown, so stretching it keeps its thickness. */\nconst ink = computed(() => {\n const { points, box: inkBox } = props.data\n if (kind.value !== 'ink' || !points || !inkBox) return ''\n const size = props.data.size ?? INK_SIZE\n return inkOutline(fitInk(unpack(points), inkBox, shown.value.w, shown.value.h, size), size)\n})\nconst erasing = computed(() => state.erasing.value.has(props.node.id))\n\n// drawn in the node's own units, half the 1.5px stroke in from the edge\nconst shown = computed(() => ({ w: props.node.width ?? 160, h: props.node.height ?? 100 }))\nconst diamond = computed(() => {\n const { w, h } = shown.value\n const i = 1\n return `${w / 2},${i} ${w - i},${h / 2} ${w / 2},${h - i} ${i},${h / 2}`\n})\n\n// Whole lines that fit, the last one ending in an ellipsis, as an export draws them.\nconst textEl = useTemplateRef<HTMLElement>('textEl')\nconst textMetrics = ref<{ line: number; padding: number } | null>(null)\nwatch(\n textEl,\n (el) => {\n if (!el) return\n const s = getComputedStyle(el)\n const line = Number.parseFloat(s.lineHeight)\n if (!line) return\n const padding = Number.parseFloat(s.paddingTop) + Number.parseFloat(s.paddingBottom)\n textMetrics.value = { line, padding: padding || 0 }\n },\n { flush: 'post' },\n)\nconst textStyle = computed(() => {\n const m = textMetrics.value\n if (!m || kind.value === 'text') return undefined\n const height = shown.value.h\n return { '-webkit-line-clamp': Math.max(1, Math.floor((height - m.padding + 0.5) / m.line)) }\n})\n\n// An image that can't be loaded: a plain box with a sign, as an export draws it.\nconst broken = ref(false)\nwatch(\n () => props.data.src,\n () => (broken.value = false),\n)\n\nconst editing = computed(() => state.editing.value === props.node.id)\nconst draft = ref('')\nconst field = useTemplateRef<HTMLTextAreaElement>('field')\n\nwatch(\n editing,\n (on) => {\n if (!on) return\n draft.value = props.data.text ?? ''\n void nextTick(() => {\n fit()\n field.value?.focus()\n field.value?.select()\n })\n },\n { immediate: true },\n)\n\n// browsers without `field-sizing` grow the field by hand\nfunction fit() {\n const el = field.value\n if (!el || CSS.supports?.('field-sizing', 'content')) return\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n}\nwatch(draft, () => void nextTick(fit))\n\nfunction edit() {\n if (props.readonly || !writable.value) return\n state.editing.value = props.node.id\n}\n\nfunction finish() {\n if (!editing.value) return\n state.editing.value = null\n const text = draft.value.replace(/\\s+$/, '')\n // text with nothing written in it is nothing at all\n if (!text && kind.value === 'text') ctx.transact((tr) => tr.removeNode(props.node.id))\n else if (text !== (props.data.text ?? '')) props.updateData({ text: text || undefined })\n // back to the canvas, so the keys go on working\n ctx.root.value?.focus({ preventScroll: true })\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.isComposing) return\n // Escape, or mod+Enter, puts the text down; Enter is a new line\n if (event.key === 'Escape' || (event.key === 'Enter' && (event.metaKey || event.ctrlKey))) {\n event.preventDefault()\n event.stopPropagation()\n finish()\n }\n}\n</script>\n\n<template>\n <div\n class=\"dou-whiteboard-node\"\n :class=\"[\n `is-${kind}`,\n kind === 'shape' && `is-${shape}`,\n `is-${tone}`,\n {\n 'is-editing': editing,\n 'is-turned': !!rotation,\n 'is-turning': turning !== null,\n 'is-selected': selected,\n 'is-erasing': erasing,\n },\n ]\"\n :style=\"[transform, sizeStyle]\"\n @dblclick.stop=\"edit\"\n >\n <svg\n v-if=\"kind === 'shape'\"\n class=\"dou-whiteboard-node__shape\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <rect\n v-if=\"shape === 'rect'\"\n x=\"0.75\"\n y=\"0.75\"\n :width=\"Math.max(0, shown.w - 1.5)\"\n :height=\"Math.max(0, shown.h - 1.5)\"\n rx=\"8\"\n />\n <ellipse\n v-else-if=\"shape === 'ellipse'\"\n :cx=\"shown.w / 2\"\n :cy=\"shown.h / 2\"\n :rx=\"Math.max(0, shown.w / 2 - 0.75)\"\n :ry=\"Math.max(0, shown.h / 2 - 0.75)\"\n />\n <polygon v-else :points=\"diamond\" />\n </svg>\n <svg\n v-else-if=\"kind === 'ink' && data.box\"\n class=\"dou-whiteboard-node__ink\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <path class=\"dou-whiteboard-node__ink-hit\" :d=\"ink\" />\n <path :d=\"ink\" />\n </svg>\n <div\n v-else-if=\"kind === 'image' && broken\"\n class=\"dou-whiteboard-node__image is-broken\"\n role=\"img\"\n :aria-label=\"data.alt || undefined\"\n >\n <ImageOffIcon />\n </div>\n <img\n v-else-if=\"kind === 'image'\"\n class=\"dou-whiteboard-node__image\"\n :src=\"data.src\"\n :alt=\"data.alt ?? ''\"\n draggable=\"false\"\n @error=\"broken = true\"\n />\n <textarea\n v-if=\"editing\"\n ref=\"field\"\n v-model=\"draft\"\n class=\"dou-whiteboard-node__text dou-whiteboard-node__field\"\n :aria-label=\"ctx.messages.value.board.editText\"\n @keydown=\"onKeydown\"\n @blur=\"finish\"\n @pointerdown.stop\n />\n <div\n v-else-if=\"writable\"\n ref=\"textEl\"\n class=\"dou-whiteboard-node__text\"\n :style=\"textStyle\"\n v-text=\"data.text\"\n />\n <div v-if=\"kind !== 'ink'\" class=\"dou-whiteboard-node__anchors\">\n <template v-for=\"side in anchorSides\" :key=\"side\">\n <DouFlowPort :id=\"`${side}-in`\" class=\"dou-whiteboard-node__anchor\" />\n <DouFlowPort :id=\"side\" class=\"dou-whiteboard-node__anchor\" />\n </template>\n </div>\n <template v-if=\"handles\">\n <!-- the sides stay on the node, under its anchors; the turn and the\n corners go above every node, so a neighbour never covers them -->\n <span\n v-for=\"handle in sideHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n :class=\"['dou-whiteboard-node__side', handle.x ? 'is-x' : 'is-y']\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-dou-nodrag\n aria-hidden=\"true\"\n @pointerdown=\"onResize($event, handle)\"\n />\n <Teleport :to=\"state.handles.value\" :disabled=\"!state.handles.value\">\n <div class=\"dou-whiteboard-node__frame\" :style=\"frameStyle\" aria-hidden=\"true\">\n <!-- data-flow-overlay on its target: the selection's toolbar keeps\n clear of where a finger can take it, when it floats below the\n node or the node is turned upside down -->\n <span\n class=\"dou-whiteboard-node__turn\"\n data-flow-handle\n data-dou-nodrag\n @pointerdown=\"startTurn\"\n >\n <span class=\"dou-whiteboard-node__target\" data-flow-overlay />\n </span>\n <span\n v-for=\"handle in cornerHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n :class=\"[\n 'dou-whiteboard-node__corner',\n handle.x < 0 ? 'is-left' : 'is-right',\n handle.y < 0 ? 'is-top' : 'is-bottom',\n ]\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-flow-handle\n data-dou-nodrag\n @pointerdown=\"onResize($event, handle)\"\n />\n </div>\n </Teleport>\n </template>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -79,17 +79,27 @@ var board_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
79
79
|
const resizeHandles = computed(() => kind.value === "image" ? RESIZE_HANDLES.filter((h) => h.x && h.y) : kind.value === "text" ? RESIZE_HANDLES.filter((h) => h.x) : RESIZE_HANDLES);
|
|
80
80
|
const sideHandles = computed(() => resizeHandles.value.filter((h) => !h.x || !h.y));
|
|
81
81
|
const cornerHandles = computed(() => resizeHandles.value.filter((h) => h.x && h.y));
|
|
82
|
+
const rect = computed(() => ctx.getNodeRect(props.node.id) ?? {
|
|
83
|
+
...props.node,
|
|
84
|
+
width: 0,
|
|
85
|
+
height: 0
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
88
|
+
* The node's size, for the anchors and the corner handles to share the
|
|
89
|
+
* corners of a small node: each keeps short of the other.
|
|
90
|
+
*/
|
|
91
|
+
const sizeStyle = computed(() => ({
|
|
92
|
+
"--dou-whiteboard-frame-width": `${rect.value.width}px`,
|
|
93
|
+
"--dou-whiteboard-frame-height": `${rect.value.height}px`
|
|
94
|
+
}));
|
|
82
95
|
/** The node's box, turned with it, for the handles drawn above every node. */
|
|
83
96
|
const frameStyle = computed(() => {
|
|
84
|
-
const
|
|
85
|
-
...props.node,
|
|
86
|
-
width: 0,
|
|
87
|
-
height: 0
|
|
88
|
-
};
|
|
97
|
+
const box = rect.value;
|
|
89
98
|
return {
|
|
90
|
-
translate: `${
|
|
91
|
-
width: `${
|
|
92
|
-
height: `${
|
|
99
|
+
translate: `${box.x}px ${box.y}px`,
|
|
100
|
+
width: `${box.width}px`,
|
|
101
|
+
height: `${box.height}px`,
|
|
102
|
+
...sizeStyle.value,
|
|
93
103
|
rotate: rotation.value ? `${rotation.value}deg` : void 0
|
|
94
104
|
};
|
|
95
105
|
});
|
|
@@ -209,7 +219,7 @@ var board_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
209
219
|
"is-erasing": erasing.value
|
|
210
220
|
}
|
|
211
221
|
]]),
|
|
212
|
-
style: normalizeStyle(transform.value),
|
|
222
|
+
style: normalizeStyle([transform.value, sizeStyle.value]),
|
|
213
223
|
onDblclick: withModifiers(edit, ["stop"])
|
|
214
224
|
}, [
|
|
215
225
|
kind.value === "shape" ? (openBlock(), createElementBlock("svg", {
|
|
@@ -304,6 +314,7 @@ var board_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
304
314
|
"aria-hidden": "true"
|
|
305
315
|
}, [createElementVNode("span", {
|
|
306
316
|
class: "dou-whiteboard-node__turn",
|
|
317
|
+
"data-flow-handle": "",
|
|
307
318
|
"data-dou-nodrag": "",
|
|
308
319
|
onPointerdown: _cache[3] || (_cache[3] = (...args) => unref(startTurn) && unref(startTurn)(...args))
|
|
309
320
|
}, [..._cache[4] || (_cache[4] = [createElementVNode("span", {
|
|
@@ -312,16 +323,21 @@ var board_node_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
312
323
|
}, null, -1)])], 32), (openBlock(true), createElementBlock(Fragment, null, renderList(cornerHandles.value, (handle) => {
|
|
313
324
|
return openBlock(), createElementBlock("span", {
|
|
314
325
|
key: `${handle.x},${handle.y}`,
|
|
315
|
-
class:
|
|
326
|
+
class: normalizeClass([
|
|
327
|
+
"dou-whiteboard-node__corner",
|
|
328
|
+
handle.x < 0 ? "is-left" : "is-right",
|
|
329
|
+
handle.y < 0 ? "is-top" : "is-bottom"
|
|
330
|
+
]),
|
|
316
331
|
style: normalizeStyle({
|
|
317
332
|
left: place(handle.x),
|
|
318
333
|
top: place(handle.y),
|
|
319
334
|
cursor: cursorOf(handle)
|
|
320
335
|
}),
|
|
321
336
|
"data-handle": `${handle.x},${handle.y}`,
|
|
337
|
+
"data-flow-handle": "",
|
|
322
338
|
"data-dou-nodrag": "",
|
|
323
339
|
onPointerdown: ($event) => onResize($event, handle)
|
|
324
|
-
}, null,
|
|
340
|
+
}, null, 46, _hoisted_14);
|
|
325
341
|
}), 128))], 4)], 8, ["to", "disabled"]))], 64)) : createCommentVNode("", true)
|
|
326
342
|
], 38);
|
|
327
343
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"board-node.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_normalizeStyle","_withModifiers","_createElementVNode","_createVNode","_createCommentVNode","_withDirectives","_vModelText","_toDisplayString","_Fragment","_renderList","_createBlock","_Teleport"],"sources":["../../src/whiteboard/board-node.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ImageOffIcon } from '@dou-ui/icons'\nimport { computed, nextTick, ref, toRef, useTemplateRef, watch } from 'vue'\nimport { DouFlowPort } from '../components/port'\nimport { useFlowEditor } from '../context'\nimport type { NodeViewProps } from '../core/node-types'\nimport type { Tone } from 'dou-ui'\nimport { fitInk, inkOutline, INK_SIZE, unpack } from './ink'\nimport { anchorSides, type WhiteboardShape } from './model'\nimport { boardState } from './state'\nimport { RESIZE_HANDLES, useTransformHandles, type ResizeHandle } from './transform'\n\ntype BoardData = {\n [key: string]: unknown\n text?: string\n shape?: WhiteboardShape\n tone?: Tone\n rotation?: number\n points?: number[]\n box?: [number, number]\n size?: number\n src?: string\n alt?: string\n}\n\ntype Kind = 'shape' | 'sticky' | 'text' | 'ink' | 'image'\n\nconst props = defineProps<NodeViewProps<BoardData>>()\nconst ctx = useFlowEditor()\nconst state = boardState(ctx)\n\nconst KINDS: readonly Kind[] = ['sticky', 'text', 'ink', 'image']\n/** What the node is: one of the shapes, a note, text, a pen stroke or an image. */\nconst kind = computed<Kind>(() => KINDS.find((k) => k === props.node.type) ?? 'shape')\nconst shape = computed<WhiteboardShape>(() => props.data.shape ?? 'rect')\nconst tone = computed<Tone>(\n () => props.data.tone ?? (kind.value === 'sticky' ? 'warning' : 'neutral'),\n)\nconst writable = computed(() => ['shape', 'sticky', 'text'].includes(kind.value))\n\nconst MIN: Record<Kind, number> = { shape: 24, sticky: 64, text: 40, ink: 8, image: 24 }\nconst rotation = computed(() => props.data.rotation ?? 0)\nconst { turning, startTurn, startResize } = useTransformHandles(\n ctx,\n toRef(props, 'node'),\n rotation,\n { width: MIN[kind.value], height: MIN[kind.value] },\n)\n/*\n * A handle being dragged shows the node changed through the editor, so\n * `node` and `data` already are what it is dragged to: the node's own frame,\n * its ports and its edges follow along with it.\n */\nconst transform = computed(() => (rotation.value ? { rotate: `${rotation.value}deg` } : undefined))\n/**\n * The resize handles: an image keeps its proportions, from its corners; text\n * only widens, so it has no top or bottom side; the rest has every corner\n * and side.\n */\nconst resizeHandles = computed(() =>\n kind.value === 'image'\n ? RESIZE_HANDLES.filter((h) => h.x && h.y)\n : kind.value === 'text'\n ? RESIZE_HANDLES.filter((h) => h.x)\n : RESIZE_HANDLES,\n)\nconst sideHandles = computed(() => resizeHandles.value.filter((h) => !h.x || !h.y))\nconst cornerHandles = computed(() => resizeHandles.value.filter((h) => h.x && h.y))\n/** The node's box, turned with it, for the handles drawn above every node. */\nconst frameStyle = computed(() => {\n const rect = ctx.getNodeRect(props.node.id) ?? { ...props.node, width: 0, height: 0 }\n return {\n // `translate`, not `transform`: it applies before `rotate`, so the box\n // turns about its own centre and its offset is not turned with it\n translate: `${rect.x}px ${rect.y}px`,\n width: `${rect.width}px`,\n height: `${rect.height}px`,\n rotate: rotation.value ? `${rotation.value}deg` : undefined,\n }\n})\nconst CURSORS = ['ew-resize', 'nwse-resize', 'ns-resize', 'nesw-resize'] as const\n/** The resize cursor along a handle's way out, turned with the node. */\nfunction cursorOf(handle: ResizeHandle) {\n // text only widens, from a corner too\n if (kind.value === 'text') handle = { x: handle.x, y: 0 }\n const degrees = (Math.atan2(handle.y, handle.x) * 180) / Math.PI + rotation.value\n return CURSORS[((Math.round(degrees / 45) % 4) + 4) % 4]\n}\nfunction onResize(event: PointerEvent, handle: ResizeHandle) {\n startResize(event, handle, {\n keepRatio: kind.value === 'image',\n widthOnly: kind.value === 'text',\n })\n}\n/** Where a handle sits on the box: `-1` is the start, `1` the end. */\nconst place = (v: -1 | 0 | 1) => `${(v + 1) * 50}%`\n\n/** Handles show on the one selected node, while the select tool is in hand. */\nconst handles = computed(\n () =>\n props.selected &&\n !props.readonly &&\n !editing.value &&\n state.tool.value === 'select' &&\n ctx.selection.value.nodes.length === 1,\n)\n\n/** The stroke fitted to the box shown, so stretching it keeps its thickness. */\nconst ink = computed(() => {\n const { points, box: inkBox } = props.data\n if (kind.value !== 'ink' || !points || !inkBox) return ''\n const size = props.data.size ?? INK_SIZE\n return inkOutline(fitInk(unpack(points), inkBox, shown.value.w, shown.value.h, size), size)\n})\nconst erasing = computed(() => state.erasing.value.has(props.node.id))\n\n// drawn in the node's own units, half the 1.5px stroke in from the edge\nconst shown = computed(() => ({ w: props.node.width ?? 160, h: props.node.height ?? 100 }))\nconst diamond = computed(() => {\n const { w, h } = shown.value\n const i = 1\n return `${w / 2},${i} ${w - i},${h / 2} ${w / 2},${h - i} ${i},${h / 2}`\n})\n\n// Whole lines that fit, the last one ending in an ellipsis, as an export draws them.\nconst textEl = useTemplateRef<HTMLElement>('textEl')\nconst textMetrics = ref<{ line: number; padding: number } | null>(null)\nwatch(\n textEl,\n (el) => {\n if (!el) return\n const s = getComputedStyle(el)\n const line = Number.parseFloat(s.lineHeight)\n if (!line) return\n const padding = Number.parseFloat(s.paddingTop) + Number.parseFloat(s.paddingBottom)\n textMetrics.value = { line, padding: padding || 0 }\n },\n { flush: 'post' },\n)\nconst textStyle = computed(() => {\n const m = textMetrics.value\n if (!m || kind.value === 'text') return undefined\n const height = shown.value.h\n return { '-webkit-line-clamp': Math.max(1, Math.floor((height - m.padding + 0.5) / m.line)) }\n})\n\n// An image that can't be loaded: a plain box with a sign, as an export draws it.\nconst broken = ref(false)\nwatch(\n () => props.data.src,\n () => (broken.value = false),\n)\n\nconst editing = computed(() => state.editing.value === props.node.id)\nconst draft = ref('')\nconst field = useTemplateRef<HTMLTextAreaElement>('field')\n\nwatch(\n editing,\n (on) => {\n if (!on) return\n draft.value = props.data.text ?? ''\n void nextTick(() => {\n fit()\n field.value?.focus()\n field.value?.select()\n })\n },\n { immediate: true },\n)\n\n// browsers without `field-sizing` grow the field by hand\nfunction fit() {\n const el = field.value\n if (!el || CSS.supports?.('field-sizing', 'content')) return\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n}\nwatch(draft, () => void nextTick(fit))\n\nfunction edit() {\n if (props.readonly || !writable.value) return\n state.editing.value = props.node.id\n}\n\nfunction finish() {\n if (!editing.value) return\n state.editing.value = null\n const text = draft.value.replace(/\\s+$/, '')\n // text with nothing written in it is nothing at all\n if (!text && kind.value === 'text') ctx.transact((tr) => tr.removeNode(props.node.id))\n else if (text !== (props.data.text ?? '')) props.updateData({ text: text || undefined })\n // back to the canvas, so the keys go on working\n ctx.root.value?.focus({ preventScroll: true })\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.isComposing) return\n // Escape, or mod+Enter, puts the text down; Enter is a new line\n if (event.key === 'Escape' || (event.key === 'Enter' && (event.metaKey || event.ctrlKey))) {\n event.preventDefault()\n event.stopPropagation()\n finish()\n }\n}\n</script>\n\n<template>\n <div\n class=\"dou-whiteboard-node\"\n :class=\"[\n `is-${kind}`,\n kind === 'shape' && `is-${shape}`,\n `is-${tone}`,\n {\n 'is-editing': editing,\n 'is-turned': !!rotation,\n 'is-turning': turning !== null,\n 'is-selected': selected,\n 'is-erasing': erasing,\n },\n ]\"\n :style=\"transform\"\n @dblclick.stop=\"edit\"\n >\n <svg\n v-if=\"kind === 'shape'\"\n class=\"dou-whiteboard-node__shape\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <rect\n v-if=\"shape === 'rect'\"\n x=\"0.75\"\n y=\"0.75\"\n :width=\"Math.max(0, shown.w - 1.5)\"\n :height=\"Math.max(0, shown.h - 1.5)\"\n rx=\"8\"\n />\n <ellipse\n v-else-if=\"shape === 'ellipse'\"\n :cx=\"shown.w / 2\"\n :cy=\"shown.h / 2\"\n :rx=\"Math.max(0, shown.w / 2 - 0.75)\"\n :ry=\"Math.max(0, shown.h / 2 - 0.75)\"\n />\n <polygon v-else :points=\"diamond\" />\n </svg>\n <svg\n v-else-if=\"kind === 'ink' && data.box\"\n class=\"dou-whiteboard-node__ink\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <path class=\"dou-whiteboard-node__ink-hit\" :d=\"ink\" />\n <path :d=\"ink\" />\n </svg>\n <div\n v-else-if=\"kind === 'image' && broken\"\n class=\"dou-whiteboard-node__image is-broken\"\n role=\"img\"\n :aria-label=\"data.alt || undefined\"\n >\n <ImageOffIcon />\n </div>\n <img\n v-else-if=\"kind === 'image'\"\n class=\"dou-whiteboard-node__image\"\n :src=\"data.src\"\n :alt=\"data.alt ?? ''\"\n draggable=\"false\"\n @error=\"broken = true\"\n />\n <textarea\n v-if=\"editing\"\n ref=\"field\"\n v-model=\"draft\"\n class=\"dou-whiteboard-node__text dou-whiteboard-node__field\"\n :aria-label=\"ctx.messages.value.board.editText\"\n @keydown=\"onKeydown\"\n @blur=\"finish\"\n @pointerdown.stop\n />\n <div\n v-else-if=\"writable\"\n ref=\"textEl\"\n class=\"dou-whiteboard-node__text\"\n :style=\"textStyle\"\n v-text=\"data.text\"\n />\n <div v-if=\"kind !== 'ink'\" class=\"dou-whiteboard-node__anchors\">\n <template v-for=\"side in anchorSides\" :key=\"side\">\n <DouFlowPort :id=\"`${side}-in`\" class=\"dou-whiteboard-node__anchor\" />\n <DouFlowPort :id=\"side\" class=\"dou-whiteboard-node__anchor\" />\n </template>\n </div>\n <template v-if=\"handles\">\n <!-- the sides stay on the node, under its anchors; the turn and the\n corners go above every node, so a neighbour never covers them -->\n <span\n v-for=\"handle in sideHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n :class=\"['dou-whiteboard-node__side', handle.x ? 'is-x' : 'is-y']\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-dou-nodrag\n aria-hidden=\"true\"\n @pointerdown=\"onResize($event, handle)\"\n />\n <Teleport :to=\"state.handles.value\" :disabled=\"!state.handles.value\">\n <div class=\"dou-whiteboard-node__frame\" :style=\"frameStyle\" aria-hidden=\"true\">\n <!-- data-flow-overlay on its target: the selection's toolbar keeps\n clear of where a finger can take it, when it floats below the\n node or the node is turned upside down -->\n <span class=\"dou-whiteboard-node__turn\" data-dou-nodrag @pointerdown=\"startTurn\">\n <span class=\"dou-whiteboard-node__target\" data-flow-overlay />\n </span>\n <span\n v-for=\"handle in cornerHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n class=\"dou-whiteboard-node__corner\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-dou-nodrag\n @pointerdown=\"onResize($event, handle)\"\n />\n </div>\n </Teleport>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EACd,MAAM,MAAM,cAAc;EAC1B,MAAM,QAAQ,WAAW,GAAG;EAE5B,MAAM,QAAyB;GAAC;GAAU;GAAQ;GAAO;EAAO;;EAEhE,MAAM,OAAO,eAAqB,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK,IAAI,KAAK,OAAO;EACrF,MAAM,QAAQ,eAAgC,MAAM,KAAK,SAAS,MAAM;EACxE,MAAM,OAAO,eACL,MAAM,KAAK,SAAS,KAAK,UAAU,WAAW,YAAY,UAClE;EACA,MAAM,WAAW,eAAe;GAAC;GAAS;GAAU;EAAM,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC;EAEhF,MAAM,MAA4B;GAAE,OAAO;GAAI,QAAQ;GAAI,MAAM;GAAI,KAAK;GAAG,OAAO;EAAG;EACvF,MAAM,WAAW,eAAe,MAAM,KAAK,YAAY,CAAC;EACxD,MAAM,EAAE,SAAS,WAAW,gBAAgB,oBAC1C,KACA,MAAM,OAAO,MAAM,GACnB,UACA;GAAE,OAAO,IAAI,KAAK;GAAQ,QAAQ,IAAI,KAAK;EAAO,CACpD;EAMA,MAAM,YAAY,eAAgB,SAAS,QAAQ,EAAE,QAAQ,GAAG,SAAS,MAAM,KAAK,IAAI,KAAA,CAAU;;;;;;EAMlG,MAAM,gBAAgB,eACpB,KAAK,UAAU,UACX,eAAe,QAAQ,MAAM,EAAE,KAAK,EAAE,CAAC,IACvC,KAAK,UAAU,SACb,eAAe,QAAQ,MAAM,EAAE,CAAC,IAChC,cACR;EACA,MAAM,cAAc,eAAe,cAAc,MAAM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,gBAAW,WAAE,SAAS,QAAQ,MAAM"}
|
|
1
|
+
{"version":3,"file":"board-node.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_normalizeClass","_unref","_normalizeStyle","_withModifiers","_createElementVNode","_createVNode","_createCommentVNode","_withDirectives","_vModelText","_toDisplayString","_Fragment","_renderList","_createBlock","_Teleport"],"sources":["../../src/whiteboard/board-node.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ImageOffIcon } from '@dou-ui/icons'\nimport { computed, nextTick, ref, toRef, useTemplateRef, watch } from 'vue'\nimport { DouFlowPort } from '../components/port'\nimport { useFlowEditor } from '../context'\nimport type { NodeViewProps } from '../core/node-types'\nimport type { Tone } from 'dou-ui'\nimport { fitInk, inkOutline, INK_SIZE, unpack } from './ink'\nimport { anchorSides, type WhiteboardShape } from './model'\nimport { boardState } from './state'\nimport { RESIZE_HANDLES, useTransformHandles, type ResizeHandle } from './transform'\n\ntype BoardData = {\n [key: string]: unknown\n text?: string\n shape?: WhiteboardShape\n tone?: Tone\n rotation?: number\n points?: number[]\n box?: [number, number]\n size?: number\n src?: string\n alt?: string\n}\n\ntype Kind = 'shape' | 'sticky' | 'text' | 'ink' | 'image'\n\nconst props = defineProps<NodeViewProps<BoardData>>()\nconst ctx = useFlowEditor()\nconst state = boardState(ctx)\n\nconst KINDS: readonly Kind[] = ['sticky', 'text', 'ink', 'image']\n/** What the node is: one of the shapes, a note, text, a pen stroke or an image. */\nconst kind = computed<Kind>(() => KINDS.find((k) => k === props.node.type) ?? 'shape')\nconst shape = computed<WhiteboardShape>(() => props.data.shape ?? 'rect')\nconst tone = computed<Tone>(\n () => props.data.tone ?? (kind.value === 'sticky' ? 'warning' : 'neutral'),\n)\nconst writable = computed(() => ['shape', 'sticky', 'text'].includes(kind.value))\n\nconst MIN: Record<Kind, number> = { shape: 24, sticky: 64, text: 40, ink: 8, image: 24 }\nconst rotation = computed(() => props.data.rotation ?? 0)\nconst { turning, startTurn, startResize } = useTransformHandles(\n ctx,\n toRef(props, 'node'),\n rotation,\n { width: MIN[kind.value], height: MIN[kind.value] },\n)\n/*\n * A handle being dragged shows the node changed through the editor, so\n * `node` and `data` already are what it is dragged to: the node's own frame,\n * its ports and its edges follow along with it.\n */\nconst transform = computed(() => (rotation.value ? { rotate: `${rotation.value}deg` } : undefined))\n/**\n * The resize handles: an image keeps its proportions, from its corners; text\n * only widens, so it has no top or bottom side; the rest has every corner\n * and side.\n */\nconst resizeHandles = computed(() =>\n kind.value === 'image'\n ? RESIZE_HANDLES.filter((h) => h.x && h.y)\n : kind.value === 'text'\n ? RESIZE_HANDLES.filter((h) => h.x)\n : RESIZE_HANDLES,\n)\nconst sideHandles = computed(() => resizeHandles.value.filter((h) => !h.x || !h.y))\nconst cornerHandles = computed(() => resizeHandles.value.filter((h) => h.x && h.y))\nconst rect = computed(\n () => ctx.getNodeRect(props.node.id) ?? { ...props.node, width: 0, height: 0 },\n)\n/**\n * The node's size, for the anchors and the corner handles to share the\n * corners of a small node: each keeps short of the other.\n */\nconst sizeStyle = computed(() => ({\n '--dou-whiteboard-frame-width': `${rect.value.width}px`,\n '--dou-whiteboard-frame-height': `${rect.value.height}px`,\n}))\n/** The node's box, turned with it, for the handles drawn above every node. */\nconst frameStyle = computed(() => {\n const box = rect.value\n return {\n // `translate`, not `transform`: it applies before `rotate`, so the box\n // turns about its own centre and its offset is not turned with it\n translate: `${box.x}px ${box.y}px`,\n width: `${box.width}px`,\n height: `${box.height}px`,\n ...sizeStyle.value,\n rotate: rotation.value ? `${rotation.value}deg` : undefined,\n }\n})\nconst CURSORS = ['ew-resize', 'nwse-resize', 'ns-resize', 'nesw-resize'] as const\n/** The resize cursor along a handle's way out, turned with the node. */\nfunction cursorOf(handle: ResizeHandle) {\n // text only widens, from a corner too\n if (kind.value === 'text') handle = { x: handle.x, y: 0 }\n const degrees = (Math.atan2(handle.y, handle.x) * 180) / Math.PI + rotation.value\n return CURSORS[((Math.round(degrees / 45) % 4) + 4) % 4]\n}\nfunction onResize(event: PointerEvent, handle: ResizeHandle) {\n startResize(event, handle, {\n keepRatio: kind.value === 'image',\n widthOnly: kind.value === 'text',\n })\n}\n/** Where a handle sits on the box: `-1` is the start, `1` the end. */\nconst place = (v: -1 | 0 | 1) => `${(v + 1) * 50}%`\n\n/** Handles show on the one selected node, while the select tool is in hand. */\nconst handles = computed(\n () =>\n props.selected &&\n !props.readonly &&\n !editing.value &&\n state.tool.value === 'select' &&\n ctx.selection.value.nodes.length === 1,\n)\n\n/** The stroke fitted to the box shown, so stretching it keeps its thickness. */\nconst ink = computed(() => {\n const { points, box: inkBox } = props.data\n if (kind.value !== 'ink' || !points || !inkBox) return ''\n const size = props.data.size ?? INK_SIZE\n return inkOutline(fitInk(unpack(points), inkBox, shown.value.w, shown.value.h, size), size)\n})\nconst erasing = computed(() => state.erasing.value.has(props.node.id))\n\n// drawn in the node's own units, half the 1.5px stroke in from the edge\nconst shown = computed(() => ({ w: props.node.width ?? 160, h: props.node.height ?? 100 }))\nconst diamond = computed(() => {\n const { w, h } = shown.value\n const i = 1\n return `${w / 2},${i} ${w - i},${h / 2} ${w / 2},${h - i} ${i},${h / 2}`\n})\n\n// Whole lines that fit, the last one ending in an ellipsis, as an export draws them.\nconst textEl = useTemplateRef<HTMLElement>('textEl')\nconst textMetrics = ref<{ line: number; padding: number } | null>(null)\nwatch(\n textEl,\n (el) => {\n if (!el) return\n const s = getComputedStyle(el)\n const line = Number.parseFloat(s.lineHeight)\n if (!line) return\n const padding = Number.parseFloat(s.paddingTop) + Number.parseFloat(s.paddingBottom)\n textMetrics.value = { line, padding: padding || 0 }\n },\n { flush: 'post' },\n)\nconst textStyle = computed(() => {\n const m = textMetrics.value\n if (!m || kind.value === 'text') return undefined\n const height = shown.value.h\n return { '-webkit-line-clamp': Math.max(1, Math.floor((height - m.padding + 0.5) / m.line)) }\n})\n\n// An image that can't be loaded: a plain box with a sign, as an export draws it.\nconst broken = ref(false)\nwatch(\n () => props.data.src,\n () => (broken.value = false),\n)\n\nconst editing = computed(() => state.editing.value === props.node.id)\nconst draft = ref('')\nconst field = useTemplateRef<HTMLTextAreaElement>('field')\n\nwatch(\n editing,\n (on) => {\n if (!on) return\n draft.value = props.data.text ?? ''\n void nextTick(() => {\n fit()\n field.value?.focus()\n field.value?.select()\n })\n },\n { immediate: true },\n)\n\n// browsers without `field-sizing` grow the field by hand\nfunction fit() {\n const el = field.value\n if (!el || CSS.supports?.('field-sizing', 'content')) return\n el.style.height = 'auto'\n el.style.height = `${el.scrollHeight}px`\n}\nwatch(draft, () => void nextTick(fit))\n\nfunction edit() {\n if (props.readonly || !writable.value) return\n state.editing.value = props.node.id\n}\n\nfunction finish() {\n if (!editing.value) return\n state.editing.value = null\n const text = draft.value.replace(/\\s+$/, '')\n // text with nothing written in it is nothing at all\n if (!text && kind.value === 'text') ctx.transact((tr) => tr.removeNode(props.node.id))\n else if (text !== (props.data.text ?? '')) props.updateData({ text: text || undefined })\n // back to the canvas, so the keys go on working\n ctx.root.value?.focus({ preventScroll: true })\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.isComposing) return\n // Escape, or mod+Enter, puts the text down; Enter is a new line\n if (event.key === 'Escape' || (event.key === 'Enter' && (event.metaKey || event.ctrlKey))) {\n event.preventDefault()\n event.stopPropagation()\n finish()\n }\n}\n</script>\n\n<template>\n <div\n class=\"dou-whiteboard-node\"\n :class=\"[\n `is-${kind}`,\n kind === 'shape' && `is-${shape}`,\n `is-${tone}`,\n {\n 'is-editing': editing,\n 'is-turned': !!rotation,\n 'is-turning': turning !== null,\n 'is-selected': selected,\n 'is-erasing': erasing,\n },\n ]\"\n :style=\"[transform, sizeStyle]\"\n @dblclick.stop=\"edit\"\n >\n <svg\n v-if=\"kind === 'shape'\"\n class=\"dou-whiteboard-node__shape\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <rect\n v-if=\"shape === 'rect'\"\n x=\"0.75\"\n y=\"0.75\"\n :width=\"Math.max(0, shown.w - 1.5)\"\n :height=\"Math.max(0, shown.h - 1.5)\"\n rx=\"8\"\n />\n <ellipse\n v-else-if=\"shape === 'ellipse'\"\n :cx=\"shown.w / 2\"\n :cy=\"shown.h / 2\"\n :rx=\"Math.max(0, shown.w / 2 - 0.75)\"\n :ry=\"Math.max(0, shown.h / 2 - 0.75)\"\n />\n <polygon v-else :points=\"diamond\" />\n </svg>\n <svg\n v-else-if=\"kind === 'ink' && data.box\"\n class=\"dou-whiteboard-node__ink\"\n :viewBox=\"`0 0 ${shown.w} ${shown.h}`\"\n aria-hidden=\"true\"\n >\n <path class=\"dou-whiteboard-node__ink-hit\" :d=\"ink\" />\n <path :d=\"ink\" />\n </svg>\n <div\n v-else-if=\"kind === 'image' && broken\"\n class=\"dou-whiteboard-node__image is-broken\"\n role=\"img\"\n :aria-label=\"data.alt || undefined\"\n >\n <ImageOffIcon />\n </div>\n <img\n v-else-if=\"kind === 'image'\"\n class=\"dou-whiteboard-node__image\"\n :src=\"data.src\"\n :alt=\"data.alt ?? ''\"\n draggable=\"false\"\n @error=\"broken = true\"\n />\n <textarea\n v-if=\"editing\"\n ref=\"field\"\n v-model=\"draft\"\n class=\"dou-whiteboard-node__text dou-whiteboard-node__field\"\n :aria-label=\"ctx.messages.value.board.editText\"\n @keydown=\"onKeydown\"\n @blur=\"finish\"\n @pointerdown.stop\n />\n <div\n v-else-if=\"writable\"\n ref=\"textEl\"\n class=\"dou-whiteboard-node__text\"\n :style=\"textStyle\"\n v-text=\"data.text\"\n />\n <div v-if=\"kind !== 'ink'\" class=\"dou-whiteboard-node__anchors\">\n <template v-for=\"side in anchorSides\" :key=\"side\">\n <DouFlowPort :id=\"`${side}-in`\" class=\"dou-whiteboard-node__anchor\" />\n <DouFlowPort :id=\"side\" class=\"dou-whiteboard-node__anchor\" />\n </template>\n </div>\n <template v-if=\"handles\">\n <!-- the sides stay on the node, under its anchors; the turn and the\n corners go above every node, so a neighbour never covers them -->\n <span\n v-for=\"handle in sideHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n :class=\"['dou-whiteboard-node__side', handle.x ? 'is-x' : 'is-y']\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-dou-nodrag\n aria-hidden=\"true\"\n @pointerdown=\"onResize($event, handle)\"\n />\n <Teleport :to=\"state.handles.value\" :disabled=\"!state.handles.value\">\n <div class=\"dou-whiteboard-node__frame\" :style=\"frameStyle\" aria-hidden=\"true\">\n <!-- data-flow-overlay on its target: the selection's toolbar keeps\n clear of where a finger can take it, when it floats below the\n node or the node is turned upside down -->\n <span\n class=\"dou-whiteboard-node__turn\"\n data-flow-handle\n data-dou-nodrag\n @pointerdown=\"startTurn\"\n >\n <span class=\"dou-whiteboard-node__target\" data-flow-overlay />\n </span>\n <span\n v-for=\"handle in cornerHandles\"\n :key=\"`${handle.x},${handle.y}`\"\n :class=\"[\n 'dou-whiteboard-node__corner',\n handle.x < 0 ? 'is-left' : 'is-right',\n handle.y < 0 ? 'is-top' : 'is-bottom',\n ]\"\n :style=\"{ left: place(handle.x), top: place(handle.y), cursor: cursorOf(handle) }\"\n :data-handle=\"`${handle.x},${handle.y}`\"\n data-flow-handle\n data-dou-nodrag\n @pointerdown=\"onResize($event, handle)\"\n />\n </div>\n </Teleport>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,QAAQ;EACd,MAAM,MAAM,cAAc;EAC1B,MAAM,QAAQ,WAAW,GAAG;EAE5B,MAAM,QAAyB;GAAC;GAAU;GAAQ;GAAO;EAAO;;EAEhE,MAAM,OAAO,eAAqB,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK,IAAI,KAAK,OAAO;EACrF,MAAM,QAAQ,eAAgC,MAAM,KAAK,SAAS,MAAM;EACxE,MAAM,OAAO,eACL,MAAM,KAAK,SAAS,KAAK,UAAU,WAAW,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O,EAAC,GAAI,OAAO;MACpC,mBAAA;MACA,eAAY;MACX,gBAAW,WAAE,SAAS,QAAQ,MAAM;;I,YAEvCJ,UAAA,GAAAc,YA4BWC,UAAA;KA5BA,IAAIZ,MAAA,KAAA,CAAK,CAAC,QAAQ;KAAQ,UAAQ,CAAGA,MAAA,KAAA,CAAK,CAAC,QAAQ;I,IAC5DG,mBA0BM,OAAA;KA1BD,OAAM;KAA8B,OAAKF,eAAE,WAAA,KAAU;KAAE,eAAY;I,IAItEE,mBAOO,QAAA;KANL,OAAM;KACN,oBAAA;KACA,mBAAA;KACC,eAAW,OAAA,OAAA,OAAA,MAAE,GAAA,SAAAH,MAAA,SAAA,KAAAA,MAAA,SAAA,CAAA,CAAA,GAAA,IAAA;I,kCAEdG,mBAA8D,QAAA;KAAxD,OAAM;KAA8B,qBAAA;I,uBAE5CN,UAAA,IAAA,GAAAC,mBAaEW,UAAA,MAAAC,WAZiB,cAAA,QAAV,WAAM;KADf,OAAAb,UAAA,GAAAC,mBAaE,QAAA;MAXC,KAAG,GAAK,OAAO,EAAC,GAAI,OAAO;MAC3B,OAAKC,eAAA;;OAA+D,OAAO,IAAC,IAAA,YAAA;OAA6C,OAAO,IAAC,IAAA,WAAA;;MAKjI,OAAKE,eAAA;OAAA,MAAU,MAAM,OAAO,CAAC;OAAA,KAAQ,MAAM,OAAO,CAAC;OAAA,QAAW,SAAS,MAAM;MAAA,CAAA;MAC7E,eAAW,GAAK,OAAO,EAAC,GAAI,OAAO;MACpC,oBAAA;MACA,mBAAA;MACC,gBAAW,WAAE,SAAS,QAAQ,MAAM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dou-ui/flow",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.13",
|
|
4
4
|
"description": "DouUI 的流程编辑器:在无限画布上拖动节点、连接端口",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"build": "vite build && vue-tsc -p tsconfig.build.json && bun scripts/build-style.ts"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"dou-ui": "0.1.0-alpha.
|
|
57
|
+
"dou-ui": "0.1.0-alpha.13",
|
|
58
58
|
"vue": "^3.5.0",
|
|
59
59
|
"yjs": "^13.6.0"
|
|
60
60
|
},
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@dou-ui/icons": "0.1.0-alpha.
|
|
67
|
+
"@dou-ui/icons": "0.1.0-alpha.13"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"y-protocols": "^1.0.7",
|