@industry-theme/principal-view-panels 0.12.62 → 0.12.64

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,EAA+C,MAAM,mCAAmC,CAAC;AAC9L,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAKxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAiCrE;;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,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;OAIG;I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;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAEvC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6iD9D,CAAC"}
@@ -88539,11 +88539,12 @@ const GraphRendererInner = ({ configuration, nodes: propNodes, edges: propEdges,
88539
88539
  }, 150);
88540
88540
  return () => clearTimeout(timeoutId);
88541
88541
  }, [fitViewToNodeIdsKey, fitViewToNodeIds, fitViewPadding, fitView2, fitViewDuration, getNodes, fitBounds]);
88542
+ const hasInitialViewport = !!initialViewport;
88542
88543
  return jsxs(GraphEditProvider, { value: graphEditContextValue, children: [jsxs(index$2, { nodes: xyflowNodes, edges: xyflowEdges, nodeTypes, edgeTypes, minZoom: 0.1, maxZoom: 4, defaultViewport: initialViewport, defaultEdgeOptions: { type: "custom" }, onEdgeClick, onNodeClick, onNodeDoubleClick, onNodeDrag: handleNodeDrag, onNodeDragStop: handleNodeDragStop, proOptions: { hideAttribution: true }, nodesDraggable: editable || draggableNodeIds && draggableNodeIds.size > 0, elementsSelectable: editable, selectNodesOnDrag: false, nodesConnectable: editable, edgesReconnectable: editable, reconnectRadius: 25, elevateEdgesOnSelect: true, onNodesChange: handleNodesChange, onEdgesChange: handleEdgesChange, onConnect: handleConnect, onReconnectStart: handleReconnectStart, onReconnect: handleReconnect, onReconnectEnd: handleReconnectEnd, onPaneClick, onSelectionChange: handleSelectionChange, panOnDrag: !editable, panOnScroll: true, zoomOnScroll: false, zoomOnPinch: true, zoomOnDoubleClick: false, selectionOnDrag: false, selectionKeyCode: null, multiSelectionKeyCode: "Shift", children: [showBackground && jsx(Background, { color: backgroundVariant === "dots" ? theme2.colors.border : theme2.colors.textMuted, gap: backgroundGap ?? (backgroundVariant === "dots" ? 16 : 50), size: backgroundVariant === "dots" ? 1 : 0.5, variant: backgroundVariant === "dots" ? BackgroundVariant.Dots : backgroundVariant === "lines" ? BackgroundVariant.Lines : BackgroundVariant.Cross }), showControls && jsx(Controls, { showZoom: true, showFitView: true, showInteractive: true }), showMinimap && jsx(MiniMap, { nodeColor: (node2) => {
88543
88544
  var _a;
88544
88545
  const nodeData = node2.data;
88545
88546
  return ((_a = nodeData == null ? void 0 : nodeData.typeDefinition) == null ? void 0 : _a.color) || theme2.colors.secondary;
88546
- }, nodeBorderRadius: 2, pannable: true, zoomable: true }), showCenterIndicator && jsx(CenterIndicator, { color: theme2.colors.textMuted }), editable && alignmentGuides.length > 0 && jsx(AlignmentGuidesOverlay, { guides: alignmentGuides, color: theme2.colors.primary })] }, `${baseNodesKey}-${baseEdgesKey}`), pendingConnection && jsxs("div", { style: {
88547
+ }, nodeBorderRadius: 2, pannable: true, zoomable: true }), showCenterIndicator && jsx(CenterIndicator, { color: theme2.colors.textMuted }), editable && alignmentGuides.length > 0 && jsx(AlignmentGuidesOverlay, { guides: alignmentGuides, color: theme2.colors.primary })] }, `${baseNodesKey}-${baseEdgesKey}-${hasInitialViewport ? "iv" : "no-iv"}`), pendingConnection && jsxs("div", { style: {
88547
88548
  position: "absolute",
88548
88549
  top: "50%",
88549
88550
  left: "50%",
@@ -95122,18 +95123,6 @@ const CanvasEditorPanel = ({
95122
95123
  const graphRef = useRef(null);
95123
95124
  const canvasContainerRef = useRef(null);
95124
95125
  const [containerDimensions, setContainerDimensions] = useState(null);
95125
- useEffect(() => {
95126
- const container = canvasContainerRef.current;
95127
- if (!container) return;
95128
- const observer = new ResizeObserver(([entry]) => {
95129
- const { width, height } = entry.contentRect;
95130
- if (width > 0 && height > 0) {
95131
- setContainerDimensions({ width, height });
95132
- }
95133
- });
95134
- observer.observe(container);
95135
- return () => observer.disconnect();
95136
- }, []);
95137
95126
  const [state, setState] = useState({
95138
95127
  canvas: null,
95139
95128
  library: null,
@@ -95156,6 +95145,18 @@ const CanvasEditorPanel = ({
95156
95145
  isSearchOpen: false,
95157
95146
  searchQuery: ""
95158
95147
  });
95148
+ useEffect(() => {
95149
+ const container = canvasContainerRef.current;
95150
+ if (!container) return;
95151
+ const observer = new ResizeObserver(([entry]) => {
95152
+ const { width, height } = entry.contentRect;
95153
+ if (width > 0 && height > 0) {
95154
+ setContainerDimensions({ width, height });
95155
+ }
95156
+ });
95157
+ observer.observe(container);
95158
+ return () => observer.disconnect();
95159
+ }, [state.loading]);
95159
95160
  const [shouldFitToNodes, setShouldFitToNodes] = useState(false);
95160
95161
  const [fitCounter, setFitCounter] = useState(0);
95161
95162
  const [isCarouselExpanded, setIsCarouselExpanded] = useState(false);