@lace-cloud/canvas 0.15.0 → 0.16.0

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/index.d.mts CHANGED
@@ -553,6 +553,15 @@ type AppProps = {
553
553
  registryBaseUrl?: string;
554
554
  /** API token for registry access. */
555
555
  apiToken?: string;
556
+ /**
557
+ * True when the canvas is mounted INSIDE a host panel rather than owning
558
+ * the window: the native zoom Controls dock top-left instead of
559
+ * bottom-right, since ActionBar (save/undo/minimap-toggle/settings) is
560
+ * hard-docked top-right and stays mounted even in read-only embedded
561
+ * panels. Sizing is a separate concern — an embedded consumer passes
562
+ * `height="100%"`.
563
+ */
564
+ embedded?: boolean;
556
565
  /**
557
566
  * Initial CanvasArrangement (node positions, group collapse/label) —
558
567
  * consumer-owned view state that never travels over the wire. Read once
@@ -568,7 +577,7 @@ type AppProps = {
568
577
  */
569
578
  onArrangementChange?: (arrangement: CanvasArrangement) => void;
570
579
  };
571
- declare function App({ engine, hostBridge, height, readOnly, registryBaseUrl, apiToken, arrangement: initialArrangement, onArrangementChange, }: AppProps): react_jsx_runtime.JSX.Element;
580
+ declare function App({ engine, hostBridge, height, readOnly, registryBaseUrl, apiToken, embedded, arrangement: initialArrangement, onArrangementChange, }: AppProps): react_jsx_runtime.JSX.Element;
572
581
 
573
582
  type Props$a = {
574
583
  title: string;
package/dist/index.d.ts CHANGED
@@ -553,6 +553,15 @@ type AppProps = {
553
553
  registryBaseUrl?: string;
554
554
  /** API token for registry access. */
555
555
  apiToken?: string;
556
+ /**
557
+ * True when the canvas is mounted INSIDE a host panel rather than owning
558
+ * the window: the native zoom Controls dock top-left instead of
559
+ * bottom-right, since ActionBar (save/undo/minimap-toggle/settings) is
560
+ * hard-docked top-right and stays mounted even in read-only embedded
561
+ * panels. Sizing is a separate concern — an embedded consumer passes
562
+ * `height="100%"`.
563
+ */
564
+ embedded?: boolean;
556
565
  /**
557
566
  * Initial CanvasArrangement (node positions, group collapse/label) —
558
567
  * consumer-owned view state that never travels over the wire. Read once
@@ -568,7 +577,7 @@ type AppProps = {
568
577
  */
569
578
  onArrangementChange?: (arrangement: CanvasArrangement) => void;
570
579
  };
571
- declare function App({ engine, hostBridge, height, readOnly, registryBaseUrl, apiToken, arrangement: initialArrangement, onArrangementChange, }: AppProps): react_jsx_runtime.JSX.Element;
580
+ declare function App({ engine, hostBridge, height, readOnly, registryBaseUrl, apiToken, embedded, arrangement: initialArrangement, onArrangementChange, }: AppProps): react_jsx_runtime.JSX.Element;
572
581
 
573
582
  type Props$a = {
574
583
  title: string;
package/dist/index.mjs CHANGED
@@ -4294,6 +4294,7 @@ var FIT_VIEW_OPTIONS = { padding: 0.2, duration: 300 };
4294
4294
  function CompositeEditor({
4295
4295
  view,
4296
4296
  readOnly,
4297
+ embedded = false,
4297
4298
  isGenerating,
4298
4299
  erroredNodeIds,
4299
4300
  newNodeIds,
@@ -4528,10 +4529,10 @@ function CompositeEditor({
4528
4529
  /* @__PURE__ */ jsx21(
4529
4530
  Controls,
4530
4531
  {
4531
- position: "bottom-right",
4532
+ position: embedded ? "top-left" : "bottom-right",
4532
4533
  showInteractive: false,
4533
4534
  fitViewOptions: FIT_VIEW_OPTIONS,
4534
- style: { bottom: 20, right: 20 }
4535
+ style: embedded ? { top: 8, left: 8 } : { bottom: 20, right: 20 }
4535
4536
  }
4536
4537
  ),
4537
4538
  /* @__PURE__ */ jsx21(
@@ -4560,7 +4561,7 @@ function CompositeEditor({
4560
4561
  }
4561
4562
  );
4562
4563
  }
4563
- function Canvas({ height, registryBaseUrl, apiToken }) {
4564
+ function Canvas({ height, registryBaseUrl, apiToken, embedded }) {
4564
4565
  const { state, readOnly, arrangement, updateArrangement } = useCanvas();
4565
4566
  const engine = useEngine();
4566
4567
  const viewRef = useRef8(state.view);
@@ -4859,6 +4860,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
4859
4860
  {
4860
4861
  view,
4861
4862
  readOnly,
4863
+ embedded,
4862
4864
  isGenerating: generating,
4863
4865
  erroredNodeIds,
4864
4866
  newNodeIds,
@@ -4961,6 +4963,7 @@ function App({
4961
4963
  readOnly = false,
4962
4964
  registryBaseUrl,
4963
4965
  apiToken,
4966
+ embedded,
4964
4967
  arrangement: initialArrangement,
4965
4968
  onArrangementChange
4966
4969
  }) {
@@ -5041,7 +5044,15 @@ function App({
5041
5044
  arrangement,
5042
5045
  updateArrangement
5043
5046
  },
5044
- children: /* @__PURE__ */ jsx22(ReactFlowProvider, { children: /* @__PURE__ */ jsx22(Canvas, { height, registryBaseUrl, apiToken }) })
5047
+ children: /* @__PURE__ */ jsx22(ReactFlowProvider, { children: /* @__PURE__ */ jsx22(
5048
+ Canvas,
5049
+ {
5050
+ height,
5051
+ registryBaseUrl,
5052
+ apiToken,
5053
+ embedded
5054
+ }
5055
+ ) })
5045
5056
  }
5046
5057
  ) });
5047
5058
  }