@industry-theme/principal-view-panels 0.12.21 → 0.12.22
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;AA8BrE;;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;IAEH;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
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;AA8BrE;;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;IAEH;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAslC9D,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -94629,6 +94629,53 @@ const CanvasEditorPanel = ({
|
|
|
94629
94629
|
setTimeout(() => setPathCopied(false), 2e3);
|
|
94630
94630
|
});
|
|
94631
94631
|
}, [canvasPath]);
|
|
94632
|
+
const handleCopyNodes = useCallback((selectedNodeIds) => {
|
|
94633
|
+
var _a2;
|
|
94634
|
+
if (!state.canvas || selectedNodeIds.length === 0) return;
|
|
94635
|
+
const selectedSet = new Set(selectedNodeIds);
|
|
94636
|
+
const nodes = selectedNodeIds.map((nodeId) => {
|
|
94637
|
+
var _a3, _b2;
|
|
94638
|
+
const node2 = (_a3 = state.canvas.nodes) == null ? void 0 : _a3.find((n) => n.id === nodeId);
|
|
94639
|
+
if (!node2) return null;
|
|
94640
|
+
const pv = node2.pv;
|
|
94641
|
+
let label = (pv == null ? void 0 : pv.name) || nodeId;
|
|
94642
|
+
if ("text" in node2 && node2.text && !(pv == null ? void 0 : pv.name)) {
|
|
94643
|
+
label = node2.text.split("\n")[0].trim() || nodeId;
|
|
94644
|
+
}
|
|
94645
|
+
return {
|
|
94646
|
+
id: node2.id,
|
|
94647
|
+
type: node2.type,
|
|
94648
|
+
label,
|
|
94649
|
+
...(pv == null ? void 0 : pv.nodeType) && { nodeType: pv.nodeType },
|
|
94650
|
+
...(pv == null ? void 0 : pv.description) && { description: pv.description },
|
|
94651
|
+
...(pv == null ? void 0 : pv.icon) && { icon: pv.icon },
|
|
94652
|
+
...(pv == null ? void 0 : pv.eventRef) && { eventRef: pv.eventRef },
|
|
94653
|
+
...((_b2 = pv == null ? void 0 : pv.event) == null ? void 0 : _b2.name) && { eventName: pv.event.name },
|
|
94654
|
+
...(pv == null ? void 0 : pv.sources) && pv.sources.length > 0 && { sources: pv.sources }
|
|
94655
|
+
};
|
|
94656
|
+
}).filter(Boolean);
|
|
94657
|
+
const edges = (state.canvas.edges || []).filter((edge) => selectedSet.has(edge.fromNode) && selectedSet.has(edge.toNode)).map((edge) => {
|
|
94658
|
+
var _a3;
|
|
94659
|
+
return {
|
|
94660
|
+
from: edge.fromNode,
|
|
94661
|
+
to: edge.toNode,
|
|
94662
|
+
...((_a3 = edge.pv) == null ? void 0 : _a3.edgeType) && { type: edge.pv.edgeType }
|
|
94663
|
+
};
|
|
94664
|
+
});
|
|
94665
|
+
const copyContext = {
|
|
94666
|
+
canvas: {
|
|
94667
|
+
path: canvasPath || "unknown",
|
|
94668
|
+
name: canvasName || ((_a2 = state.canvas.pv) == null ? void 0 : _a2.name) || "Untitled"
|
|
94669
|
+
},
|
|
94670
|
+
nodes,
|
|
94671
|
+
...edges.length > 0 && { edges }
|
|
94672
|
+
};
|
|
94673
|
+
navigator.clipboard.writeText(JSON.stringify(copyContext, null, 2)).then(() => {
|
|
94674
|
+
console.log(`[CanvasEditorPanel] Copied ${nodes.length} node(s) to clipboard`);
|
|
94675
|
+
}).catch((err) => {
|
|
94676
|
+
console.error("[CanvasEditorPanel] Failed to copy nodes:", err);
|
|
94677
|
+
});
|
|
94678
|
+
}, [state.canvas, canvasPath, canvasName]);
|
|
94632
94679
|
const toggleEditMode = useCallback(() => {
|
|
94633
94680
|
setState((prev) => {
|
|
94634
94681
|
if (prev.isEditMode && prev.hasUnsavedChanges) {
|
|
@@ -95124,6 +95171,7 @@ const CanvasEditorPanel = ({
|
|
|
95124
95171
|
onPendingChangesChange: (hasChanges) => {
|
|
95125
95172
|
setState((prev) => ({ ...prev, hasUnsavedChanges: hasChanges }));
|
|
95126
95173
|
},
|
|
95174
|
+
onCopy: handleCopyNodes,
|
|
95127
95175
|
showBackground: state.showGridLines,
|
|
95128
95176
|
backgroundVariant: "lines",
|
|
95129
95177
|
showControls: true,
|