@leviosa-ai/detail-page-editor 0.13.1 → 0.13.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.
@@ -229,11 +229,28 @@ export function LeviosaCanvasWorkspace({
229
229
  store.selectPage(id);
230
230
  }, [store]);
231
231
 
232
+ /**
233
+ * 고른 요소가 있으면 «보고 있는 벌»은 손이 가 있는 곳이지 화면 가운데가 아니다.
234
+ *
235
+ * 이게 없으면 4번 벌의 요소를 집는 순간 그 선택이 활성 페이지를 옮기고, 그 때문에
236
+ * 화면이 스르륵 움직이고, 그 스크롤이 가운데에 있는 2번 벌을 다시 활성으로 만든다 —
237
+ * 집은 것은 4번인데 «대표로 지정»은 2번 위에 뜬다.
238
+ */
239
+ const holding = store.selectedElementsIds.length > 0;
240
+ /** 고른 요소가 놓인 페이지. 활성 화면이 여기로 온 것이면 손으로 누른 것이다. */
241
+ const heldPageId =
242
+ store.pageOfElement(store.selectedElementsIds[0] ?? "")?.id ?? null;
243
+
232
244
  const scrollRaf = useRef<number | null>(null);
245
+ const holdingRef = useRef(holding);
246
+ holdingRef.current = holding;
247
+ const heldPageIdRef = useRef(heldPageId);
248
+ heldPageIdRef.current = heldPageId;
233
249
  const onScroll = useCallback(() => {
234
250
  if (scrollRaf.current != null) return;
235
251
  scrollRaf.current = requestAnimationFrame(() => {
236
252
  scrollRaf.current = null;
253
+ if (holdingRef.current) return;
237
254
  recomputeActive();
238
255
  });
239
256
  }, [recomputeActive]);
@@ -243,6 +260,13 @@ export function LeviosaCanvasWorkspace({
243
260
  useEffect(() => {
244
261
  const inner = innerRef.current;
245
262
  if (!inner || !activeId || activeId === scrollSetId.current) return;
263
+ // 캔버스에서 요소를 집어 활성 화면이 바뀐 것이면 옮기지 않는다. 방금 손으로
264
+ // 누른 것이라 이미 보고 있고, 여기서 화면을 움직이면 누를 때마다 밑이 흔들린다.
265
+ // 목록에서 고른 때만 데려간다.
266
+ if (activeId === heldPageIdRef.current) {
267
+ scrollSetId.current = activeId;
268
+ return;
269
+ }
246
270
  scrollSetId.current = activeId;
247
271
  const node = inner.querySelector<HTMLElement>(
248
272
  `[data-lc-page="${CSS.escape(activeId)}"]`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leviosa-ai/detail-page-editor",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Leviosa detail-page editor shell. Source-only: consumers compile it through Next transpilePackages. Every app coupling (sourcing server, brand store, cache keys, toast) arrives through the DetailPageHost interface, and every URL it fetches comes from configureDetailPageEditor.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -67,7 +67,7 @@
67
67
  "woff2-encoder": "2.0.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@leviosa-ai/canvas": "0.6.1",
70
+ "@leviosa-ai/canvas": "0.6.2",
71
71
  "@tanstack/react-query": "^5.100.3",
72
72
  "konva": "^10.0.0",
73
73
  "lucide-react": "^0.563.0 || ^1.0.0",