@lace-cloud/canvas 0.15.1 → 0.16.1

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.cjs CHANGED
@@ -4350,6 +4350,7 @@ var FIT_VIEW_OPTIONS = { padding: 0.2, duration: 300 };
4350
4350
  function CompositeEditor({
4351
4351
  view,
4352
4352
  readOnly,
4353
+ embedded = false,
4353
4354
  isGenerating,
4354
4355
  erroredNodeIds,
4355
4356
  newNodeIds,
@@ -4584,10 +4585,10 @@ function CompositeEditor({
4584
4585
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4585
4586
  import_react31.Controls,
4586
4587
  {
4587
- position: "bottom-right",
4588
+ position: embedded ? "top-left" : "bottom-right",
4588
4589
  showInteractive: false,
4589
4590
  fitViewOptions: FIT_VIEW_OPTIONS,
4590
- style: { bottom: 20, right: 20 }
4591
+ style: embedded ? { top: 8, left: 8 } : { bottom: 20, right: 20 }
4591
4592
  }
4592
4593
  ),
4593
4594
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -4616,7 +4617,7 @@ function CompositeEditor({
4616
4617
  }
4617
4618
  );
4618
4619
  }
4619
- function Canvas({ height, registryBaseUrl, apiToken }) {
4620
+ function Canvas({ height, registryBaseUrl, apiToken, embedded }) {
4620
4621
  const { state, readOnly, arrangement, updateArrangement } = useCanvas();
4621
4622
  const engine = useEngine();
4622
4623
  const viewRef = (0, import_react32.useRef)(state.view);
@@ -4915,6 +4916,7 @@ function Canvas({ height, registryBaseUrl, apiToken }) {
4915
4916
  {
4916
4917
  view,
4917
4918
  readOnly,
4919
+ embedded,
4918
4920
  isGenerating: generating,
4919
4921
  erroredNodeIds,
4920
4922
  newNodeIds,
@@ -5017,6 +5019,7 @@ function App({
5017
5019
  readOnly = false,
5018
5020
  registryBaseUrl,
5019
5021
  apiToken,
5022
+ embedded,
5020
5023
  arrangement: initialArrangement,
5021
5024
  onArrangementChange
5022
5025
  }) {
@@ -5097,7 +5100,15 @@ function App({
5097
5100
  arrangement,
5098
5101
  updateArrangement
5099
5102
  },
5100
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react34.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Canvas, { height, registryBaseUrl, apiToken }) })
5103
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react34.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
5104
+ Canvas,
5105
+ {
5106
+ height,
5107
+ registryBaseUrl,
5108
+ apiToken,
5109
+ embedded
5110
+ }
5111
+ ) })
5101
5112
  }
5102
5113
  ) });
5103
5114
  }