@pixerate/editor-svelte 0.85.1 → 0.85.2

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.
@@ -55,7 +55,10 @@
55
55
 
56
56
  const store = vectorStateOf(() => controller);
57
57
  const view = $derived(store.current);
58
- const scene = $derived(getVectorSceneRenderData(view, { idPrefix }));
58
+ // The canvas size, so the scene leaves out what is off screen and simplifies what is tiny.
59
+ let size: { width: number; height: number } | null = $state(null);
60
+ const scene = $derived(getVectorSceneRenderData(view, { idPrefix, ...(size ? { viewportSize: size } : {}) }));
61
+
59
62
  const overlay = $derived(getVectorOverlayRenderData(view));
60
63
  // Isolation mode: the rest of the document, dimmed behind the symbol's art.
61
64
  const host = $derived(getVectorSymbolEditBackground(view, { idPrefix: `${idPrefix}host-` }));
@@ -67,6 +70,19 @@
67
70
  const as = THEME.anchorSize;
68
71
 
69
72
  let svg: SVGSVGElement | undefined = $state();
73
+ $effect(() => {
74
+ const el = svg;
75
+ if (!el || typeof ResizeObserver === 'undefined') return;
76
+ const measure = () => {
77
+ const r = el.getBoundingClientRect();
78
+ const now = untrack(() => size);
79
+ if (r.width > 0 && r.height > 0 && (!now || now.width !== r.width || now.height !== r.height)) size = { width: r.width, height: r.height };
80
+ };
81
+ measure();
82
+ const observer = new ResizeObserver(measure);
83
+ observer.observe(el);
84
+ return () => observer.disconnect();
85
+ });
70
86
  let textInput: HTMLTextAreaElement | undefined = $state();
71
87
  const editingText = $derived(view.textEdit?.nodeId ?? null);
72
88
 
@@ -1 +1 @@
1
- {"version":3,"file":"VectorCanvas.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorCanvas.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,EASH,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AASjC,UAAU,KAAK;IACb,UAAU,EAAE,sBAAsB,CAAC;IACnC,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA2aH,QAAA,MAAM,YAAY,2CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"VectorCanvas.svelte.d.ts","sourceRoot":"","sources":["../../src/vector/VectorCanvas.svelte.ts"],"names":[],"mappings":"AAQA,OAAO,EASH,KAAK,sBAAsB,EAC5B,MAAM,yBAAyB,CAAC;AASjC,UAAU,KAAK;IACb,UAAU,EAAE,sBAAsB,CAAC;IACnC,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA2bH,QAAA,MAAM,YAAY,2CAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-svelte",
3
- "version": "0.85.1",
3
+ "version": "0.85.2",
4
4
  "description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -139,7 +139,7 @@
139
139
  "@tiptap/extension-bubble-menu": "^2.11.5",
140
140
  "@tiptap/extension-placeholder": "^2.11.5",
141
141
  "@tiptap/starter-kit": "^2.11.5",
142
- "@pixerate/editor": "0.117.0"
142
+ "@pixerate/editor": "0.118.0"
143
143
  },
144
144
  "peerDependencies": {
145
145
  "@dagrejs/dagre": "^1.1.4",