@industry-theme/principal-view-panels 0.12.1 → 0.12.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CanvasEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,OAAO,KAAK,EAAyE,gBAAgB,EAAoC,MAAM,mCAAmC,CAAC;AAKnL,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AA6BrE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,2BAA2B;IACzE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAioC9D,CAAC"}
1
+ {"version":3,"file":"CanvasEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,OAAO,KAAK,EAAyE,gBAAgB,EAAoC,MAAM,mCAAmC,CAAC;AAKnL,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AA6BrE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,2BAA2B;IACzE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAs7B9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"StoryboardListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/StoryboardListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAqE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAy4BvE,CAAC"}
1
+ {"version":3,"file":"StoryboardListPanel.d.ts","sourceRoot":"","sources":["../../src/panels/StoryboardListPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAqE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CA+5BvE,CAAC"}
@@ -88086,6 +88086,90 @@ const GraphRenderer = forwardRef((props2, ref) => {
88086
88086
  return jsx("div", { className, style: { width, height, position: "relative" }, children: jsx(ReactFlowProvider, { children: jsx(GraphRendererInner, { configuration, nodes, edges, violations, configName, showMinimap, showControls, showBackground, backgroundVariant, backgroundGap, showCenterIndicator, showTooltips, fitViewDuration, highlightedNodeId, activeNodeIds, events, onEventProcessed, editable, onPendingChangesChange, editStateRef, onNodeClick, fitViewToNodeIds, fitViewPadding }) }) });
88087
88087
  });
88088
88088
  GraphRenderer.displayName = "GraphRenderer";
88089
+ const DEFAULT_NODE_WIDTH = 200;
88090
+ const DEFAULT_NODE_HEIGHT = 100;
88091
+ const GROUP_PADDING = 40;
88092
+ function prefixNodeId(canvasId, nodeId) {
88093
+ return `${canvasId}:${nodeId}`;
88094
+ }
88095
+ function calculateCanvasBounds(canvas) {
88096
+ if (!canvas.nodes || canvas.nodes.length === 0) {
88097
+ return { minX: 0, minY: 0, maxX: DEFAULT_NODE_WIDTH, maxY: DEFAULT_NODE_HEIGHT };
88098
+ }
88099
+ let minX = Infinity;
88100
+ let minY = Infinity;
88101
+ let maxX = -Infinity;
88102
+ let maxY = -Infinity;
88103
+ for (const node2 of canvas.nodes) {
88104
+ const x = node2.x ?? 0;
88105
+ const y = node2.y ?? 0;
88106
+ const width = node2.width ?? DEFAULT_NODE_WIDTH;
88107
+ const height = node2.height ?? DEFAULT_NODE_HEIGHT;
88108
+ minX = Math.min(minX, x);
88109
+ minY = Math.min(minY, y);
88110
+ maxX = Math.max(maxX, x + width);
88111
+ maxY = Math.max(maxY, y + height);
88112
+ }
88113
+ return { minX, minY, maxX, maxY };
88114
+ }
88115
+ function mergeCanvases(placements, options = {}) {
88116
+ var _a;
88117
+ const { showGroups = true } = options;
88118
+ const groupNodes = [];
88119
+ const mergedNodes = [];
88120
+ const mergedEdges = [];
88121
+ for (const placement of placements) {
88122
+ const { canvasId, canvas, position: position2, label } = placement;
88123
+ if (showGroups && canvas.nodes && canvas.nodes.length > 0) {
88124
+ const bounds = calculateCanvasBounds(canvas);
88125
+ const groupNode = {
88126
+ id: `${canvasId}:__group__`,
88127
+ type: "group",
88128
+ label: label ?? ((_a = canvas.pv) == null ? void 0 : _a.name) ?? canvasId,
88129
+ x: position2.x + bounds.minX - GROUP_PADDING,
88130
+ y: position2.y + bounds.minY - GROUP_PADDING,
88131
+ width: bounds.maxX - bounds.minX + GROUP_PADDING * 2,
88132
+ height: bounds.maxY - bounds.minY + GROUP_PADDING * 2
88133
+ };
88134
+ groupNodes.push(groupNode);
88135
+ }
88136
+ if (canvas.nodes) {
88137
+ for (const node2 of canvas.nodes) {
88138
+ const mergedNode = {
88139
+ ...node2,
88140
+ id: prefixNodeId(canvasId, node2.id),
88141
+ x: (node2.x ?? 0) + position2.x,
88142
+ y: (node2.y ?? 0) + position2.y
88143
+ };
88144
+ mergedNodes.push(mergedNode);
88145
+ }
88146
+ }
88147
+ if (canvas.edges) {
88148
+ for (const edge of canvas.edges) {
88149
+ const mergedEdge = {
88150
+ ...edge,
88151
+ id: prefixNodeId(canvasId, edge.id),
88152
+ fromNode: prefixNodeId(canvasId, edge.fromNode),
88153
+ toNode: prefixNodeId(canvasId, edge.toNode)
88154
+ };
88155
+ mergedEdges.push(mergedEdge);
88156
+ }
88157
+ }
88158
+ }
88159
+ const mergedCanvas = {
88160
+ nodes: [...groupNodes, ...mergedNodes],
88161
+ edges: mergedEdges,
88162
+ pv: {
88163
+ version: "1.0.0",
88164
+ name: "Multi-Canvas View"
88165
+ }
88166
+ };
88167
+ return mergedCanvas;
88168
+ }
88169
+ forwardRef(function MultiCanvasRenderer({ layout, onLayoutChange: _onLayoutChange, showGroups = true, ...graphRendererProps }, ref) {
88170
+ const mergedCanvas = useMemo(() => mergeCanvases(layout.placements, { showGroups }), [layout.placements, showGroups]);
88171
+ return jsx(GraphRenderer, { ref, canvas: mergedCanvas, editable: false, ...graphRendererProps });
88172
+ });
88089
88173
  /*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
88090
88174
  function isNothing(subject) {
88091
88175
  return typeof subject === "undefined" || subject === null;
@@ -94246,11 +94330,9 @@ const CanvasEditorPanel = ({
94246
94330
  workflowFileInfo: _workflowFileInfo,
94247
94331
  traceMatchInfo
94248
94332
  }) => {
94249
- var _a, _b, _c, _d, _e2;
94333
+ var _a, _b, _c;
94250
94334
  const { theme: theme2 } = useTheme();
94251
94335
  const graphRef = useRef(null);
94252
- const [dimensions, setDimensions] = useState({ width: 800, height: 600 });
94253
- const resizeObserverRef = useRef(null);
94254
94336
  const [state, setState] = useState({
94255
94337
  canvas: null,
94256
94338
  library: null,
@@ -94270,6 +94352,7 @@ const CanvasEditorPanel = ({
94270
94352
  highlightedNodeId: null
94271
94353
  });
94272
94354
  const [shouldFitToNodes, setShouldFitToNodes] = useState(false);
94355
+ const [fitCounter, setFitCounter] = useState(0);
94273
94356
  const [isCarouselExpanded, setIsCarouselExpanded] = useState(false);
94274
94357
  const contextRef = useRef(context2);
94275
94358
  const actionsRef = useRef(actions);
@@ -94285,32 +94368,6 @@ const CanvasEditorPanel = ({
94285
94368
  return ((_a2 = slice == null ? void 0 : slice.data) == null ? void 0 : _a2.sha) || null;
94286
94369
  }, [context2]);
94287
94370
  const [pathCopied, setPathCopied] = useState(false);
94288
- const containerRef = useCallback((container) => {
94289
- if (resizeObserverRef.current) {
94290
- resizeObserverRef.current.disconnect();
94291
- resizeObserverRef.current = null;
94292
- }
94293
- if (!container) {
94294
- return;
94295
- }
94296
- const updateDimensions = () => {
94297
- const { width, height } = container.getBoundingClientRect();
94298
- setDimensions((prev) => {
94299
- const newWidth = Math.round(width);
94300
- const newHeight = Math.round(height);
94301
- if (prev.width === newWidth && prev.height === newHeight) {
94302
- return prev;
94303
- }
94304
- return { width: newWidth, height: newHeight };
94305
- });
94306
- };
94307
- updateDimensions();
94308
- const resizeObserver = new ResizeObserver(() => {
94309
- requestAnimationFrame(updateDimensions);
94310
- });
94311
- resizeObserver.observe(container);
94312
- resizeObserverRef.current = resizeObserver;
94313
- }, []);
94314
94371
  const loadConfiguration = useCallback(async () => {
94315
94372
  if (!canvasPath) {
94316
94373
  setState((prev) => ({ ...prev, canvas: null, library: null, loading: false, error: null }));
@@ -94409,6 +94466,7 @@ const CanvasEditorPanel = ({
94409
94466
  hoveredScenarioEventNames: eventNames
94410
94467
  }));
94411
94468
  if (eventNames && eventNames.length > 0) {
94469
+ setFitCounter((c2) => c2 + 1);
94412
94470
  setShouldFitToNodes(true);
94413
94471
  }
94414
94472
  }, []);
@@ -94421,6 +94479,7 @@ const CanvasEditorPanel = ({
94421
94479
  highlightedNodeId: null
94422
94480
  }));
94423
94481
  setIsCarouselExpanded(true);
94482
+ setFitCounter((c2) => c2 + 1);
94424
94483
  setShouldFitToNodes(true);
94425
94484
  }, []);
94426
94485
  const handleNarrativeEventClick = useCallback((event, eventIndex) => {
@@ -94432,6 +94491,7 @@ const CanvasEditorPanel = ({
94432
94491
  currentEventIndex: eventIndex
94433
94492
  };
94434
94493
  });
94494
+ setFitCounter((c2) => c2 + 1);
94435
94495
  setShouldFitToNodes(true);
94436
94496
  }, []);
94437
94497
  const handleEventCarouselDismiss = useCallback(() => {
@@ -94519,20 +94579,37 @@ const CanvasEditorPanel = ({
94519
94579
  return [state.highlightedNodeId];
94520
94580
  }
94521
94581
  if (activeNodeIds && activeNodeIds.length > 0) {
94522
- return activeNodeIds;
94582
+ return [...activeNodeIds];
94523
94583
  }
94524
94584
  if (((_a2 = state.canvas) == null ? void 0 : _a2.nodes) && state.canvas.nodes.length > 0) {
94525
94585
  return state.canvas.nodes.map((n) => n.id);
94526
94586
  }
94527
94587
  }
94528
94588
  return void 0;
94529
- }, [shouldFitToNodes, activeNodeIds, (_a = state.canvas) == null ? void 0 : _a.nodes, state.highlightedNodeId]);
94589
+ }, [shouldFitToNodes, activeNodeIds, (_a = state.canvas) == null ? void 0 : _a.nodes, state.highlightedNodeId, fitCounter]);
94530
94590
  useEffect(() => {
94531
94591
  if (shouldFitToNodes) {
94532
- const timer2 = setTimeout(() => setShouldFitToNodes(false), 100);
94592
+ const timer2 = setTimeout(() => setShouldFitToNodes(false), 300);
94533
94593
  return () => clearTimeout(timer2);
94534
94594
  }
94535
94595
  }, [shouldFitToNodes]);
94596
+ const prevWorkflowTemplateRef = useRef(workflowTemplate);
94597
+ useEffect(() => {
94598
+ const hadWorkflow = !!prevWorkflowTemplateRef.current;
94599
+ const hasWorkflow = !!workflowTemplate;
94600
+ prevWorkflowTemplateRef.current = workflowTemplate;
94601
+ if (hadWorkflow !== hasWorkflow) {
94602
+ setState((prev) => ({
94603
+ ...prev,
94604
+ selectedScenarioId: null,
94605
+ selectedScenario: null,
94606
+ hoveredScenarioEventNames: null,
94607
+ highlightedNodeId: null,
94608
+ currentEventIndex: 0
94609
+ }));
94610
+ setIsCarouselExpanded(false);
94611
+ }
94612
+ }, [workflowTemplate]);
94536
94613
  useEffect(() => {
94537
94614
  loadConfiguration();
94538
94615
  }, [canvasPath, loadConfiguration]);
@@ -94761,11 +94838,13 @@ const CanvasEditorPanel = ({
94761
94838
  }
94762
94839
  )
94763
94840
  ] }),
94764
- /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "hidden" }, children: workflowTemplate ? /* @__PURE__ */ jsx(
94841
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ jsx(
94765
94842
  AnimatedResizableLayout,
94766
94843
  {
94767
94844
  theme: theme2,
94768
- leftPanel: /* @__PURE__ */ jsx("div", { style: { height: "100%", overflow: "hidden", background: theme2.colors.background }, children: /* @__PURE__ */ jsx(
94845
+ collapsed: !workflowTemplate,
94846
+ showCollapseButton: !!workflowTemplate,
94847
+ leftPanel: workflowTemplate ? /* @__PURE__ */ jsx("div", { style: { height: "100%", overflow: "hidden", background: theme2.colors.background }, children: /* @__PURE__ */ jsx(
94769
94848
  ScenariosList,
94770
94849
  {
94771
94850
  workflowTemplate,
@@ -94774,7 +94853,7 @@ const CanvasEditorPanel = ({
94774
94853
  selectedScenarioId: state.selectedScenarioId ?? void 0,
94775
94854
  traceMatchInfo
94776
94855
  }
94777
- ) }),
94856
+ ) }) : /* @__PURE__ */ jsx("div", {}),
94778
94857
  rightPanel: /* @__PURE__ */ jsxs("div", { style: { height: "100%", display: "flex", flexDirection: "column", background: theme2.colors.background, position: "relative" }, children: [
94779
94858
  /* @__PURE__ */ jsxs("div", { style: { flex: 1, position: "relative", minHeight: 0 }, children: [
94780
94859
  /* @__PURE__ */ jsx(
@@ -95010,189 +95089,6 @@ const CanvasEditorPanel = ({
95010
95089
  )
95011
95090
  ] })
95012
95091
  }
95013
- ) : (
95014
- /* Original editor layout when no workflow is present */
95015
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", position: "relative", height: "100%", overflow: "hidden" }, children: [
95016
- /* @__PURE__ */ jsx("div", { ref: containerRef, style: { flex: 1, position: "relative" }, children: /* @__PURE__ */ jsx(
95017
- GraphRenderer,
95018
- {
95019
- ref: graphRef,
95020
- canvas: state.canvas,
95021
- library: state.library ?? void 0,
95022
- width: dimensions.width,
95023
- height: dimensions.height,
95024
- editable: state.isEditMode,
95025
- onPendingChangesChange: (hasChanges) => {
95026
- setState((prev) => ({ ...prev, hasUnsavedChanges: hasChanges }));
95027
- },
95028
- showBackground: state.showGridLines,
95029
- backgroundVariant: "lines",
95030
- highlightedNodeId: state.highlightedNodeId,
95031
- activeNodeIds,
95032
- fitViewToNodeIds,
95033
- fitViewPadding: 0.15
95034
- }
95035
- ) }),
95036
- state.isEditMode && state.hasUnsavedChanges && /* @__PURE__ */ jsxs("div", { style: {
95037
- position: "absolute",
95038
- top: 0,
95039
- right: 0,
95040
- height: 40,
95041
- display: "flex",
95042
- alignItems: "stretch",
95043
- backgroundColor: theme2.colors.background,
95044
- border: `1px solid ${theme2.colors.border}`,
95045
- borderRadius: 0,
95046
- boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)",
95047
- zIndex: 40
95048
- }, children: [
95049
- /* @__PURE__ */ jsx("div", { style: {
95050
- display: "flex",
95051
- alignItems: "center",
95052
- padding: theme2.space[3],
95053
- fontSize: theme2.fontSizes[1],
95054
- color: theme2.colors.warning || "#f59e0b",
95055
- fontStyle: "italic",
95056
- fontWeight: theme2.fontWeights.medium
95057
- }, children: "Unsaved changes" }),
95058
- /* @__PURE__ */ jsxs(
95059
- "button",
95060
- {
95061
- onClick: saveAllChanges,
95062
- disabled: state.isSaving,
95063
- style: {
95064
- display: "flex",
95065
- alignItems: "center",
95066
- justifyContent: "center",
95067
- gap: theme2.space[1],
95068
- padding: `0 ${theme2.space[3]}`,
95069
- fontSize: theme2.fontSizes[1],
95070
- fontFamily: theme2.fonts.body,
95071
- color: "white",
95072
- backgroundColor: theme2.colors.primary,
95073
- border: "none",
95074
- borderRadius: 0,
95075
- cursor: state.isSaving ? "wait" : "pointer",
95076
- opacity: state.isSaving ? 0.7 : 1,
95077
- transition: "all 0.2s",
95078
- minWidth: 80
95079
- },
95080
- children: [
95081
- state.isSaving ? /* @__PURE__ */ jsx(Loader, { size: 14, style: { animation: "spin 1s linear infinite" } }) : /* @__PURE__ */ jsx(Save, { size: 14 }),
95082
- /* @__PURE__ */ jsx("span", { children: "Save" })
95083
- ]
95084
- }
95085
- ),
95086
- /* @__PURE__ */ jsxs(
95087
- "button",
95088
- {
95089
- onClick: discardChanges,
95090
- disabled: state.isSaving,
95091
- style: {
95092
- display: "flex",
95093
- alignItems: "center",
95094
- justifyContent: "center",
95095
- gap: theme2.space[1],
95096
- padding: `0 ${theme2.space[3]}`,
95097
- fontSize: theme2.fontSizes[1],
95098
- fontFamily: theme2.fonts.body,
95099
- color: theme2.colors.text,
95100
- backgroundColor: theme2.colors.backgroundSecondary,
95101
- border: "none",
95102
- borderLeft: `1px solid ${theme2.colors.border}`,
95103
- borderRadius: 0,
95104
- cursor: state.isSaving ? "wait" : "pointer",
95105
- opacity: state.isSaving ? 0.7 : 1,
95106
- transition: "all 0.2s",
95107
- minWidth: 80
95108
- },
95109
- children: [
95110
- /* @__PURE__ */ jsx(X, { size: 14 }),
95111
- /* @__PURE__ */ jsx("span", { children: "Discard" })
95112
- ]
95113
- }
95114
- )
95115
- ] }),
95116
- state.showLegend && /* @__PURE__ */ jsxs("div", { style: {
95117
- position: "absolute",
95118
- top: 0,
95119
- left: 0,
95120
- right: 0,
95121
- height: 40,
95122
- backgroundColor: theme2.colors.background,
95123
- borderBottom: `1px solid ${theme2.colors.border}`,
95124
- padding: `0 ${theme2.space[3]}`,
95125
- display: "flex",
95126
- alignItems: "center",
95127
- gap: theme2.space[4],
95128
- overflowX: "auto",
95129
- zIndex: 50,
95130
- boxSizing: "border-box"
95131
- }, children: [
95132
- /* @__PURE__ */ jsx("span", { style: {
95133
- fontSize: theme2.fontSizes[1],
95134
- fontWeight: theme2.fontWeights.medium,
95135
- color: theme2.colors.textMuted,
95136
- flexShrink: 0
95137
- }, children: "Edges:" }),
95138
- ((_e2 = (_d = state.canvas) == null ? void 0 : _d.pv) == null ? void 0 : _e2.edgeTypes) && Object.keys(state.canvas.pv.edgeTypes).length > 0 ? /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: theme2.space[4], flexWrap: "wrap" }, children: Object.entries(state.canvas.pv.edgeTypes).map(([typeName, edgeType]) => /* @__PURE__ */ jsxs(
95139
- "div",
95140
- {
95141
- style: {
95142
- display: "flex",
95143
- alignItems: "center",
95144
- gap: theme2.space[2]
95145
- },
95146
- children: [
95147
- /* @__PURE__ */ jsxs("svg", { width: "40", height: "12", style: { flexShrink: 0 }, children: [
95148
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
95149
- "marker",
95150
- {
95151
- id: `legend-arrow-${typeName}`,
95152
- markerWidth: "8",
95153
- markerHeight: "6",
95154
- refX: "7",
95155
- refY: "3",
95156
- orient: "auto",
95157
- children: /* @__PURE__ */ jsx(
95158
- "polygon",
95159
- {
95160
- points: "0 0, 8 3, 0 6",
95161
- fill: edgeType.color || "#64748b"
95162
- }
95163
- )
95164
- }
95165
- ) }),
95166
- /* @__PURE__ */ jsx(
95167
- "line",
95168
- {
95169
- x1: "2",
95170
- y1: "6",
95171
- x2: "32",
95172
- y2: "6",
95173
- stroke: edgeType.color || "#64748b",
95174
- strokeWidth: Math.min(edgeType.width || 2, 3),
95175
- strokeDasharray: edgeType.style === "dashed" ? "4,2" : edgeType.style === "dotted" ? "2,2" : void 0,
95176
- markerEnd: edgeType.directed ? `url(#legend-arrow-${typeName})` : void 0
95177
- }
95178
- )
95179
- ] }),
95180
- /* @__PURE__ */ jsx("span", { style: {
95181
- fontSize: theme2.fontSizes[1],
95182
- color: theme2.colors.text,
95183
- textTransform: "capitalize",
95184
- whiteSpace: "nowrap"
95185
- }, children: typeName.replace(/-/g, " ") })
95186
- ]
95187
- },
95188
- typeName
95189
- )) }) : /* @__PURE__ */ jsx("span", { style: {
95190
- fontSize: theme2.fontSizes[1],
95191
- color: theme2.colors.textMuted,
95192
- fontStyle: "italic"
95193
- }, children: "No edge types defined" })
95194
- ] })
95195
- ] })
95196
95092
  ) })
95197
95093
  ] });
95198
95094
  };
@@ -98900,18 +98796,36 @@ const StoryboardListPanel = ({
98900
98796
  "button",
98901
98797
  {
98902
98798
  onClick: toggleHelp,
98799
+ draggable: true,
98800
+ onDragStart: (e) => {
98801
+ const cliCommand = storyboards.length > 0 ? "npx @principal-ai/principal-view-cli@latest --help" : "npx @principal-ai/principal-view-cli@latest init";
98802
+ const dragData = {
98803
+ dataType: "cli-command",
98804
+ primaryData: cliCommand,
98805
+ metadata: {
98806
+ description: "Principal View CLI command",
98807
+ action: storyboards.length > 0 ? "help" : "init"
98808
+ },
98809
+ suggestedActions: ["paste", "execute"],
98810
+ sourcePanel: "storyboard-list",
98811
+ dragPreview: cliCommand
98812
+ };
98813
+ e.dataTransfer.setData("application/x-panel-data", JSON.stringify(dragData));
98814
+ e.dataTransfer.setData("text/plain", cliCommand);
98815
+ e.dataTransfer.effectAllowed = "copy";
98816
+ },
98903
98817
  style: {
98904
98818
  background: showHelp ? theme2.colors.primary : theme2.colors.backgroundSecondary,
98905
98819
  border: `1px solid ${theme2.colors.border}`,
98906
98820
  borderRadius: theme2.radii[1],
98907
98821
  padding: "6px",
98908
- cursor: "pointer",
98822
+ cursor: "grab",
98909
98823
  display: "flex",
98910
98824
  alignItems: "center",
98911
98825
  justifyContent: "center",
98912
98826
  transition: "all 0.2s ease"
98913
98827
  },
98914
- title: "Help & Getting Started",
98828
+ title: "Help & Getting Started (drag to copy CLI command)",
98915
98829
  children: /* @__PURE__ */ jsx(
98916
98830
  CircleQuestionMark,
98917
98831
  {