docblocks-react-ui 0.14.0 → 0.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # docblocks-react-ui
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a8559ae: The inline meta editors (the header's title, the attributes panel's rows,
8
+ the key's rename) follow the incoming value while the field stands: a
9
+ pristine field reseeds over a value change from the reader (the document's
10
+ write, a peer's edit, the consumer's own state) with the caret kept in
11
+ place, and a typed draft stands over it — the user's text is never
12
+ clobbered mid-edit. The commit and the Escape's cancel are unchanged.
13
+ - fb2eef9: The diagram preview's load-time view is the FIT: over the settled geometry
14
+ (the svg's async render, the page's post-mount layout) a diagram without a
15
+ persisted view stands whole in the frame, centered, scaled down only —
16
+ never up. The persisted zoom / pan is the explicit gesture's state only:
17
+ it is restored on reload and written back to the document on the wheel,
18
+ the drag-pan, the toolbar's zoom / fit / reset presses, and it is never
19
+ written by the load default, the peer's adopt, or the geometry's
20
+ re-computation. A wrapper resize re-fits the diagram while no explicit
21
+ view stands (and re-clamps the pan once it does).
22
+
23
+ ### Patch Changes
24
+
25
+ - 5020597: Grouping the selected canvas figures leaves their earlier containers: the
26
+ engine used to add the members to the new group while the old group kept
27
+ them, so a figure stood in two containers and both markers moved it. The
28
+ new group's creation and the leave are one transaction (one undo step, one
29
+ wire update); an earlier group left without members stands in place (the
30
+ empty container is a legal marker).
31
+ - fb02998: The cover tint's border stands the plain border until the cover's average
32
+ color resolves: the tint variable lands only once the blob's read and the
33
+ image's decode settle, and an undefined variable inside the color mix
34
+ invalidated the whole border-color — the dark theme flashed its near-white
35
+ text color as the frame's border over that window.
36
+ - 6d5ab1c: A press over a non-editable island inside the text (the mention chip, an
37
+ image figure, the table's chrome) starts no cross-drag caret session: the
38
+ session used to seat the selection on the island's line and focus the
39
+ editable with it, which pulled the scroll port to the chip and left the
40
+ caret away from the pressed point. A self-contained editable inside the
41
+ island (a table cell's inner, the empty cell's activation layer) keeps its
42
+ session.
43
+
3
44
  ## 0.14.0
4
45
 
5
46
  ### Minor Changes
@@ -7430,10 +7430,23 @@ function Input({ className, size, variant, type, ...props }) {
7430
7430
  * seated at the end (no select-all) on mount, the commit on the blur /
7431
7431
  * the Enter (one write), the Escape cancels without a write (the guard
7432
7432
  * stops the blur's commit over the unmount).
7433
+ *
7434
+ * The seed's reseed over an open edit: the incoming value may change
7435
+ * while the field stands (the built-in document path — a peer's write, a
7436
+ * command — or the consumer's own read, e.g. the description's). A
7437
+ * PRISTINE field (the user has not typed away from the seed) follows the
7438
+ * incoming value, the caret kept in place; a typed draft stands (the
7439
+ * user's text is never clobbered mid-edit — the input wins until the
7440
+ * commit or the cancel).
7433
7441
  */
7434
7442
  function InlineEditInput({ initial, ariaLabel, slot, className, placeholder, invalid, variant, selectOnMount, onCommit, onCancel }) {
7435
7443
  const inputRef = useRef(null);
7436
7444
  const committedRef = useRef(false);
7445
+ const [value, setValue] = useState(initial);
7446
+ const valueRef = useRef(value);
7447
+ valueRef.current = value;
7448
+ const seedRef = useRef(initial);
7449
+ const caretRef = useRef(null);
7437
7450
  const selectRef = useRef(selectOnMount);
7438
7451
  useEffect(() => {
7439
7452
  const input = inputRef.current;
@@ -7445,6 +7458,23 @@ function InlineEditInput({ initial, ariaLabel, slot, className, placeholder, inv
7445
7458
  }
7446
7459
  input.setSelectionRange(input.value.length, input.value.length);
7447
7460
  }, []);
7461
+ useEffect(() => {
7462
+ if (initial === seedRef.current) return;
7463
+ const previous = seedRef.current;
7464
+ seedRef.current = initial;
7465
+ if (valueRef.current !== previous) return;
7466
+ const input = inputRef.current;
7467
+ caretRef.current = input !== null && document.activeElement === input ? input.selectionStart : null;
7468
+ setValue(initial);
7469
+ }, [initial]);
7470
+ useLayoutEffect(() => {
7471
+ const caret = caretRef.current;
7472
+ caretRef.current = null;
7473
+ const input = inputRef.current;
7474
+ if (caret === null || input === null) return;
7475
+ const offset = Math.min(caret, input.value.length);
7476
+ input.setSelectionRange(offset, offset);
7477
+ }, [value]);
7448
7478
  const commit = (value) => {
7449
7479
  if (committedRef.current) return;
7450
7480
  committedRef.current = true;
@@ -7470,9 +7500,12 @@ function InlineEditInput({ initial, ariaLabel, slot, className, placeholder, inv
7470
7500
  "aria-invalid": invalid ? true : void 0,
7471
7501
  variant,
7472
7502
  placeholder,
7473
- defaultValue: initial,
7503
+ value,
7474
7504
  className,
7475
- onChange: rearm,
7505
+ onChange: (event) => {
7506
+ setValue(event.target.value);
7507
+ rearm();
7508
+ },
7476
7509
  onBlur: onInputBlur,
7477
7510
  onKeyDown: onInputKeyDown
7478
7511
  });
@@ -15429,12 +15462,16 @@ function findParentSurface(doc, id) {
15429
15462
  return null;
15430
15463
  }
15431
15464
  /**
15432
- * The group creation: the selected canvas
15433
- * items stand the new group's members in ONE transact (one undo step, one
15434
- * wire update). Returns the new group id, or null for the ineligible
15435
- * selection (one member, a connector / a group in the set, a page block,
15436
- * or the members across surfaces — the group is a flat marker over its
15437
- * siblings, never a container). No throw: the hotkey's no-op posture.
15465
+ * The group creation: the selected canvas items stand the new group's
15466
+ * members in ONE transact (one undo step, one wire update), and the
15467
+ * members leave every earlier owner — a figure stands in one container
15468
+ * at a time (the automatic membership's parity for the explicit
15469
+ * grouping; without the leave the figure would stay a member of its old
15470
+ * group too, and the two markers would both move it). Returns the new
15471
+ * group id, or null for the ineligible selection (one member, a
15472
+ * connector / a group in the set, a page block, or the members across
15473
+ * surfaces — the group is a flat marker over its siblings, never a
15474
+ * container). No throw: the hotkey's no-op posture.
15438
15475
  */
15439
15476
  function makeGroup(doc, ids) {
15440
15477
  if (ids.length < 2) return null;
@@ -15447,8 +15484,15 @@ function makeGroup(doc, ids) {
15447
15484
  if (surface === null) surface = owner;
15448
15485
  else if (owner !== surface) return null;
15449
15486
  }
15487
+ const members = new Set(ids);
15450
15488
  let created = null;
15451
15489
  doc.transact(() => {
15490
+ for (const siblingId of doc.getChildren(surface)) {
15491
+ const sibling = doc.getBlock(siblingId);
15492
+ if (sibling === null || sibling.type !== "group") continue;
15493
+ const kept = sibling.attrs.members.filter((memberId) => !members.has(memberId));
15494
+ if (kept.length !== sibling.attrs.members.length) doc.updateBlock(siblingId, { members: kept });
15495
+ }
15452
15496
  created = doc.insertBlock("group", { members: [...ids] }, { parent: surface });
15453
15497
  });
15454
15498
  return created;
@@ -35296,6 +35340,9 @@ function useCrossDrag(rootRef, doc, readOnly = false) {
35296
35340
  const target = event.target instanceof Element ? event.target : null;
35297
35341
  if (target?.closest("[data-slot=\"docblocks/editor\"]") !== root) return;
35298
35342
  if (target.closest("[data-slot=\"docblocks/page-card\"]") !== null) return;
35343
+ const island = target.closest("[contenteditable=\"false\"]");
35344
+ const editable = target.closest("[contenteditable=\"true\"]");
35345
+ if (island !== null && (editable === null || !island.contains(editable))) return;
35299
35346
  if (target.closest("[data-slot=\"docblocks/block-content\"]") === null) return;
35300
35347
  const anchor = positionAtPoint(doc, root, event.clientX, event.clientY);
35301
35348
  if (anchor === null) return;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as DropdownMenuSubContent, $t as Eye, A as SelectGroup, At as Skeleton, B as Input, Bt as useBlock, C as FilterBuilder, Ct as isBridgeError, D as ScrollArea, Dt as parseCellValue, E as SegmentSelector, Et as conditionMatches, F as SelectSeparator, Ft as CardFooter, G as DropdownMenuItem, Gt as useSelection, H as DropdownMenuCheckboxItem, Ht as useMeta, I as SelectTrigger, It as CardHeader, J as DropdownMenuRadioGroup, Jt as DocblocksI18nProvider, K as DropdownMenuLabel, Kt as useSelectionView, L as SelectValue, Lt as CardTitle, M as SelectLabel, Mt as CardAction, N as SelectScrollDownButton, Nt as CardContent, O as Select, Ot as TEXT_TYPES, P as SelectScrollUpButton, Pt as CardDescription, Q as DropdownMenuSub, Qt as Pen, R as Label, Rt as Badge, S as newMutationContext, St as BridgeError, T as filterIsComplete, Tt as toBridgeError, U as DropdownMenuContent, Ut as usePresence, V as DropdownMenu, Vt as useDoc, W as DropdownMenuGroup, Wt as usePresenceSharing, X as DropdownMenuSeparator, Xt as renderRuns, Y as DropdownMenuRadioItem, Z as DropdownMenuShortcut, _ as mapFrontmatter, _t as BASELINE_CAPABILITIES, a as DEFAULT_EMBED_SANDBOX, at as PopoverContent, b as useDatabaseTable, bt as validateProtocolDescriptor, c as SHAPE_FONT_OPTIONS, ct as PopoverTitle, d as FORMAT_PALETTE, dt as Button, et as DropdownMenuSubTrigger, ft as buttonVariants, g as mdToBlocks, gt as AlertTitle, h as insertNative, ht as AlertDescription, i as useEditorContext, it as PopoverAnchor, j as SelectItem, jt as Card, k as SelectContent, kt as columnAnnotation, l as SHAPE_FONT_STACKS, lt as PopoverTrigger, m as htmlToBlocks, mt as Alert, n as useCoverAverageColor, nn as createMemoryBlobStore, nt as Separator, ot as PopoverDescription, p as markToggleAction, pt as BareSelect, q as DropdownMenuPortal, qt as useText, r as EditorProvider, rt as Popover, st as PopoverHeader, t as Editor, tn as BookOpen, tt as DropdownMenuTrigger, ut as Checkbox, v as parseFrontmatter, vt as PROTOCOL_VERSION, w as emptyFilter, wt as isBridgeErrorCode, x as cellValueEqual, xt as BRIDGE_ERROR_CODES, y as GridBody, yt as isDatabaseBridge, z as InlineEditInput, zt as badgeVariants } from "./Editor-DZk9LV9W.mjs";
1
+ import { $ as DropdownMenuSubContent, $t as Eye, A as SelectGroup, At as Skeleton, B as Input, Bt as useBlock, C as FilterBuilder, Ct as isBridgeError, D as ScrollArea, Dt as parseCellValue, E as SegmentSelector, Et as conditionMatches, F as SelectSeparator, Ft as CardFooter, G as DropdownMenuItem, Gt as useSelection, H as DropdownMenuCheckboxItem, Ht as useMeta, I as SelectTrigger, It as CardHeader, J as DropdownMenuRadioGroup, Jt as DocblocksI18nProvider, K as DropdownMenuLabel, Kt as useSelectionView, L as SelectValue, Lt as CardTitle, M as SelectLabel, Mt as CardAction, N as SelectScrollDownButton, Nt as CardContent, O as Select, Ot as TEXT_TYPES, P as SelectScrollUpButton, Pt as CardDescription, Q as DropdownMenuSub, Qt as Pen, R as Label, Rt as Badge, S as newMutationContext, St as BridgeError, T as filterIsComplete, Tt as toBridgeError, U as DropdownMenuContent, Ut as usePresence, V as DropdownMenu, Vt as useDoc, W as DropdownMenuGroup, Wt as usePresenceSharing, X as DropdownMenuSeparator, Xt as renderRuns, Y as DropdownMenuRadioItem, Z as DropdownMenuShortcut, _ as mapFrontmatter, _t as BASELINE_CAPABILITIES, a as DEFAULT_EMBED_SANDBOX, at as PopoverContent, b as useDatabaseTable, bt as validateProtocolDescriptor, c as SHAPE_FONT_OPTIONS, ct as PopoverTitle, d as FORMAT_PALETTE, dt as Button, et as DropdownMenuSubTrigger, ft as buttonVariants, g as mdToBlocks, gt as AlertTitle, h as insertNative, ht as AlertDescription, i as useEditorContext, it as PopoverAnchor, j as SelectItem, jt as Card, k as SelectContent, kt as columnAnnotation, l as SHAPE_FONT_STACKS, lt as PopoverTrigger, m as htmlToBlocks, mt as Alert, n as useCoverAverageColor, nn as createMemoryBlobStore, nt as Separator, ot as PopoverDescription, p as markToggleAction, pt as BareSelect, q as DropdownMenuPortal, qt as useText, r as EditorProvider, rt as Popover, st as PopoverHeader, t as Editor, tn as BookOpen, tt as DropdownMenuTrigger, ut as Checkbox, v as parseFrontmatter, vt as PROTOCOL_VERSION, w as emptyFilter, wt as isBridgeErrorCode, x as cellValueEqual, xt as BRIDGE_ERROR_CODES, y as GridBody, yt as isDatabaseBridge, z as InlineEditInput, zt as badgeVariants } from "./Editor-BF7wBMcp.mjs";
2
2
  import { a as preventDefault, s as cn } from "./constants-D8PSgkwi.mjs";
3
3
  import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { useTranslation } from "react-i18next";
@@ -1,4 +1,4 @@
1
- import { $t as Eye, At as Skeleton, E as SegmentSelector, Yt as INLINE_CODE_CLASS, Zt as RotateCcw, dt as Button, en as CodeXml, f as textOf, gt as AlertTitle, ht as AlertDescription, i as useEditorContext, mt as Alert, o as childrenSlot, s as CodeHeader, u as TextBlock } from "../Editor-DZk9LV9W.mjs";
1
+ import { $t as Eye, At as Skeleton, E as SegmentSelector, Yt as INLINE_CODE_CLASS, Zt as RotateCcw, dt as Button, en as CodeXml, f as textOf, gt as AlertTitle, ht as AlertDescription, i as useEditorContext, mt as Alert, o as childrenSlot, s as CodeHeader, u as TextBlock } from "../Editor-BF7wBMcp.mjs";
2
2
  import { a as preventDefault, d as Minus, f as LoaderCircle, l as TriangleAlert, r as clamp, u as Plus } from "../constants-D8PSgkwi.mjs";
3
3
  import { t as Maximize } from "../Maximize-BBHnCDWL.mjs";
4
4
  import { useEffect, useRef, useState } from "react";
@@ -266,11 +266,30 @@ function MermaidViewport({ id, block, children }) {
266
266
  const [view, setView] = useState(() => viewOfAttrs(block.attrs?.zoom, block.attrs?.panX, block.attrs?.panY));
267
267
  const viewRef = useRef(view);
268
268
  viewRef.current = view;
269
+ const explicitViewRef = useRef(block.attrs?.zoom != null || block.attrs?.panX != null || block.attrs?.panY != null);
270
+ const persistGateRef = useRef(false);
271
+ /** The explicit gesture's stand: the view is the user's (the load-time fit stops re-applying) and the write-back opens. */
272
+ const markExplicit = () => {
273
+ explicitViewRef.current = true;
274
+ persistGateRef.current = true;
275
+ };
269
276
  const [height, setHeight] = useState(block.attrs?.height ?? null);
270
277
  const heightRef = useRef(height);
271
278
  heightRef.current = height;
272
279
  const panSession = useRef(null);
273
280
  const resizeSession = useRef(null);
281
+ /** The fit's view over the measured's boxes (the scale's min, the no-upscale's cap, the centering). */
282
+ const fitViewOf = () => {
283
+ const rect = wrapperRef.current?.getBoundingClientRect();
284
+ const content = measureContent(layerRef.current);
285
+ if (rect === void 0 || rect.width <= 0 || rect.height <= 0 || content.w <= 0 || content.h <= 0) return null;
286
+ const scale = clamp(Math.min(rect.width / content.w, rect.height / content.h, 1), VIEWPORT_MIN_SCALE, VIEWPORT_MAX_SCALE);
287
+ return {
288
+ scale,
289
+ x: (rect.width - content.w * scale) / 2,
290
+ y: (rect.height - content.h * scale) / 2
291
+ };
292
+ };
274
293
  /** The clamped view over the measured's boxes (the gesture's helper). */
275
294
  const clampView = (next) => {
276
295
  const rect = wrapperRef.current?.getBoundingClientRect();
@@ -281,29 +300,33 @@ function MermaidViewport({ id, block, children }) {
281
300
  };
282
301
  };
283
302
  /**
284
- * The geometry's re-clamp: the mount's wrapper / layer boxes are not
285
- * final (the page's layout settles post-mount) and the diagram's svg
286
- * lands AFTER the mount (mermaid renders async) — the mount's adopt /
287
- * persist stand over the loading skeleton's box, so without this stand
288
- * a diagram that fits the settled box keeps the unclamped view (its
289
- * left edge at the wrapper's left edge — the large diagram's
290
- * top-left-corner stand). The observer re-clamps over the settled
291
- * boxes whenever they change (the svg's appearance, the consumer's
292
- * re-layout); the canonical's persist's no-op keeps the re-clamp off
293
- * the wire (the centered stand IS the identity's canonical).
303
+ * The geometry's stand: the mount's wrapper / layer boxes are not final
304
+ * (the page's layout settles post-mount) and the diagram's svg lands
305
+ * AFTER the mount (mermaid renders async), so the mount-time measure
306
+ * reads the loading skeleton's box. Over the settled boxes:
307
+ * - no explicit view yet (nothing persisted, no gesture): the load-time
308
+ * default stands — the FIT (the whole diagram in the frame, centered,
309
+ * capped at 100%);
310
+ * - an explicit view stands (the reload's restore, a gesture, a peer's
311
+ * write): the pan re-clamps into the box (the view never lands
312
+ * unclamped).
313
+ * The observer stands both when the boxes change (the svg's appearance,
314
+ * the consumer's re-layout) and on its initial observe; none of it
315
+ * touches the wire (see the persist gate).
294
316
  */
295
317
  useEffect(() => {
296
318
  const wrapper = wrapperRef.current;
297
319
  const layer = layerRef.current;
298
320
  if (wrapper === null || layer === null) return;
299
321
  if (typeof ResizeObserver === "undefined") return;
300
- const reClamp = () => {
322
+ const settle = () => {
301
323
  const current = viewRef.current;
302
- const clamped = clampView(current);
303
- if (clamped.scale === current.scale && clamped.x === current.x && clamped.y === current.y) return;
304
- setView(clamped);
324
+ const next = explicitViewRef.current ? clampView(current) : fitViewOf();
325
+ if (next === null) return;
326
+ if (next.scale === current.scale && next.x === current.x && next.y === current.y) return;
327
+ setView(next);
305
328
  };
306
- const observer = new ResizeObserver(reClamp);
329
+ const observer = new ResizeObserver(settle);
307
330
  observer.observe(wrapper);
308
331
  observer.observe(layer);
309
332
  return () => observer.disconnect();
@@ -333,6 +356,7 @@ function MermaidViewport({ id, block, children }) {
333
356
  }
334
357
  if (next === null) return;
335
358
  event.preventDefault();
359
+ markExplicit();
336
360
  setView(next);
337
361
  };
338
362
  wrapper.addEventListener("wheel", onWheel, { passive: false });
@@ -344,6 +368,7 @@ function MermaidViewport({ id, block, children }) {
344
368
  if (wrapper === null) return;
345
369
  const rect = wrapper.getBoundingClientRect();
346
370
  const content = measureContent(layerRef.current);
371
+ markExplicit();
347
372
  setView((v) => {
348
373
  const nextScale = clamp(v.scale * step, VIEWPORT_MIN_SCALE, VIEWPORT_MAX_SCALE);
349
374
  if (nextScale === v.scale) return v;
@@ -356,7 +381,10 @@ function MermaidViewport({ id, block, children }) {
356
381
  };
357
382
  const zoomIn = () => zoomBy(VIEWPORT_ZOOM_STEP);
358
383
  const zoomOut = () => zoomBy(1 / VIEWPORT_ZOOM_STEP);
359
- const resetView = () => setView(clampView(VIEWPORT_IDENTITY));
384
+ const resetView = () => {
385
+ markExplicit();
386
+ setView(clampView(VIEWPORT_IDENTITY));
387
+ };
360
388
  const atIdentity = (() => {
361
389
  const rect = wrapperRef.current?.getBoundingClientRect();
362
390
  const content = measureContent(layerRef.current);
@@ -364,24 +392,19 @@ function MermaidViewport({ id, block, children }) {
364
392
  return view.scale === VIEWPORT_IDENTITY.scale && view.x === clamped.x && view.y === clamped.y;
365
393
  })();
366
394
  /**
367
- * The fit's stand (the default's restore for the large diagram): the
368
- * scale's min over the width / height's ratio, capped at 1 (the small
369
- * diagram's stand the natural's size — no upscaling), centered over the
370
- * visible viewport's box (the clipped stand included). The no-content's
371
- * stand (the error / loading's states): the no-op.
395
+ * The fit's stand (the load-time default and the toolbar's restore for
396
+ * the large diagram): the scale's min over the width / height's ratio,
397
+ * capped at 1 (the small diagram's stand the natural's size — no
398
+ * upscaling), centered over the visible viewport's box (the clipped
399
+ * stand included). The no-content's stand (the error / loading's
400
+ * states): the no-op. The button's press stands the explicit view (the
401
+ * persisted write follows).
372
402
  */
373
403
  const fitView = () => {
374
- const wrapper = wrapperRef.current;
375
- if (wrapper === null) return;
376
- const rect = wrapper.getBoundingClientRect();
377
- const content = measureContent(layerRef.current);
378
- if (rect.width <= 0 || rect.height <= 0 || content.w <= 0 || content.h <= 0) return;
379
- const scale = clamp(Math.min(rect.width / content.w, rect.height / content.h, 1), VIEWPORT_MIN_SCALE, VIEWPORT_MAX_SCALE);
380
- setView({
381
- scale,
382
- x: (rect.width - content.w * scale) / 2,
383
- y: (rect.height - content.h * scale) / 2
384
- });
404
+ const next = fitViewOf();
405
+ if (next === null) return;
406
+ markExplicit();
407
+ setView(next);
385
408
  };
386
409
  /**
387
410
  * The persisted view's write (the debounce over the gesture's bursts):
@@ -397,6 +420,8 @@ function MermaidViewport({ id, block, children }) {
397
420
  * no wire update).
398
421
  */
399
422
  useEffect(() => {
423
+ if (!persistGateRef.current) return;
424
+ persistGateRef.current = false;
400
425
  const clamped = clampView(view);
401
426
  const zoom = roundViewValue(clamped.scale, 2);
402
427
  const x = roundViewValue(clamped.x, 1);
@@ -439,9 +464,11 @@ function MermaidViewport({ id, block, children }) {
439
464
  x: block.attrs?.panX ?? 0,
440
465
  y: block.attrs?.panY ?? 0
441
466
  };
467
+ const persisted = block.attrs?.zoom != null || block.attrs?.panX != null || block.attrs?.panY != null;
442
468
  const clamped = clampView(target);
443
469
  const v = viewRef.current;
444
470
  if (clamped.scale === v.scale && clamped.x === v.x && clamped.y === v.y) return;
471
+ if (persisted) explicitViewRef.current = true;
445
472
  setView(clamped);
446
473
  }, [block.attrs]);
447
474
  /** The remote's stand over the height (the panes' shared stand over the
@@ -470,6 +497,7 @@ function MermaidViewport({ id, block, children }) {
470
497
  const dy = event.clientY - session.lastY;
471
498
  session.lastX = event.clientX;
472
499
  session.lastY = event.clientY;
500
+ markExplicit();
473
501
  setView((v) => clampView({
474
502
  scale: v.scale,
475
503
  x: v.x + dx,
package/dist/styles.css CHANGED
@@ -4233,7 +4233,12 @@
4233
4233
  * so the theme's flip re-mixes over the same value without a re-read.
4234
4234
  */
4235
4235
  [data-slot="card"][data-cover-tint] {
4236
- border-color: color-mix(in srgb, var(--docblocks-cover-tint-color) 25%, var(--border));
4236
+ /* The tint variable lands only once the cover's average color resolves
4237
+ (the blob's read + the image's decode): until then the fallback
4238
+ resolves to the plain border — an undefined variable inside the mix
4239
+ would make the whole border-color invalid and fall back to the text
4240
+ color (a near-white flash over the dark theme). */
4241
+ border-color: color-mix(in srgb, var(--docblocks-cover-tint-color, var(--border)) 25%, var(--border));
4237
4242
  }
4238
4243
 
4239
4244
  /* 5. The shape-text's self-hosted fonts (the woff2 in dist/fonts/; the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docblocks-react-ui",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "React rendering + editing layer for docblocks: hooks, block renderers, caret/selection, keyboard, clipboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",