@pixerate/editor-svelte 0.42.0 → 0.42.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.
@@ -64,6 +64,8 @@
64
64
  return () => observer.disconnect();
65
65
  });
66
66
  let drag: ChartPointDrag | null = null;
67
+ // Frozen while a point is dragged so the value axis does not rescale under the pointer.
68
+ let valueDomain = $state<ChartPointDrag['valueDomain'] | null>(null);
67
69
 
68
70
  const sceneWidth = $derived((responsive && measured) || width);
69
71
  const fullTheme = $derived({ ...CSS_VARIABLE_CHART_THEME, ...theme });
@@ -74,7 +76,8 @@
74
76
  theme: fullTheme,
75
77
  selection: editable ? view.current.selection : null,
76
78
  measureText,
77
- emptyMessage
79
+ emptyMessage,
80
+ valueDomain
78
81
  })
79
82
  );
80
83
  const byKey = $derived(new Map(scene.marks.map((m) => [m.key, m])));
@@ -92,7 +95,10 @@
92
95
  const target = key ? byKey.get(key)?.target : undefined;
93
96
  controller.select(target ?? null);
94
97
  drag = startChartPointDrag(controller, scene, target, scenePoint(e));
95
- if (drag) svg?.setPointerCapture?.(e.pointerId);
98
+ if (drag) {
99
+ valueDomain = drag.valueDomain;
100
+ svg?.setPointerCapture?.(e.pointerId);
101
+ }
96
102
  }
97
103
  function pointermove(e: PointerEvent) {
98
104
  drag?.move(scenePoint(e));
@@ -100,6 +106,7 @@
100
106
  function endDrag() {
101
107
  drag?.end();
102
108
  drag = null;
109
+ valueDomain = null;
103
110
  }
104
111
  function keydown(e: KeyboardEvent) {
105
112
  if (editable && handleChartKey(controller, scene, e)) e.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"ChartCanvas.svelte.d.ts","sourceRoot":"","sources":["../../src/chart/ChartCanvas.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EASH,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAIhC,UAAU,KAAK;IACb,UAAU,EAAE,eAAe,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1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-svelte",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -115,14 +115,14 @@
115
115
  "@tiptap/extension-bubble-menu": "^2.11.5",
116
116
  "@tiptap/extension-placeholder": "^2.11.5",
117
117
  "@tiptap/starter-kit": "^2.11.5",
118
- "@pixerate/editor": "0.46.0"
118
+ "@pixerate/editor": "0.46.1"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "@dagrejs/dagre": "^1.1.4",
122
122
  "@tiptap/core": "^2.11.5",
123
123
  "@tiptap/pm": "^2.11.5",
124
124
  "@xyflow/svelte": "^1.6.0",
125
- "svelte": "^5.0.0"
125
+ "svelte": "^5.57.2"
126
126
  },
127
127
  "peerDependenciesMeta": {
128
128
  "@dagrejs/dagre": {
@@ -139,8 +139,8 @@
139
139
  "@tiptap/core": "^2.11.5",
140
140
  "@tiptap/pm": "^2.11.5",
141
141
  "@types/dagre": "^0.7.52",
142
- "@xyflow/svelte": "^1.6.6",
143
- "svelte": "^5.0.0",
142
+ "@xyflow/svelte": "^1.7.0",
143
+ "svelte": "^5.57.2",
144
144
  "svelte-check": "^4.7.6",
145
145
  "typescript": "^5.7.3",
146
146
  "vitest": "^4.1.11"