docblocks-react-ui 0.32.0 → 0.32.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# docblocks-react-ui
|
|
2
2
|
|
|
3
|
+
## 0.32.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d8988db: The shape's text double-click stands over the connector's label entry: the
|
|
8
|
+
double-click's target resolution reads the point's element stack (the line's
|
|
9
|
+
hit path stands DOM-top over a shape it paints over, so the single element's
|
|
10
|
+
hit test resolved the line and never the shape's target) — the double-click
|
|
11
|
+
over the shape's box under the line enters the shape's text edit, and the
|
|
12
|
+
line's label edit stands over the line's own reach.
|
|
13
|
+
|
|
3
14
|
## 0.32.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -36341,6 +36341,29 @@ const TITLE_CHIP_SELECTOR = "[data-slot='docblocks/group-title'], [data-slot='do
|
|
|
36341
36341
|
function pointElementOf(event) {
|
|
36342
36342
|
return (typeof document.elementFromPoint === "function" ? document.elementFromPoint(event.clientX, event.clientY) : null) ?? (event.target instanceof Element ? event.target : null);
|
|
36343
36343
|
}
|
|
36344
|
+
/** The shape's text target under the point (the dblclick's shape's text
|
|
36345
|
+
* entry's resolution — the connector's label's entry's guard's shared
|
|
36346
|
+
* read): the event's target's closest first (the retargeted event's stand),
|
|
36347
|
+
* the point's element STACK (the line's hit path — the wide transparent
|
|
36348
|
+
* stroke, the pointer-events' stand — is DOM-top over a shape it paints
|
|
36349
|
+
* over, so the single element's hit test resolves the line's element and
|
|
36350
|
+
* never the shape's target), the single elementFromPoint's fallback (the
|
|
36351
|
+
* jsdom's stack's absence). */
|
|
36352
|
+
function shapeTextTargetAt(event) {
|
|
36353
|
+
if (event.target instanceof Element) {
|
|
36354
|
+
const fromTarget = event.target.closest("[data-slot='docblocks/shape-text-target']");
|
|
36355
|
+
if (fromTarget !== null) return fromTarget;
|
|
36356
|
+
}
|
|
36357
|
+
if (typeof document.elementsFromPoint === "function") {
|
|
36358
|
+
for (const element of document.elementsFromPoint(event.clientX, event.clientY)) {
|
|
36359
|
+
const target = element.closest("[data-slot='docblocks/shape-text-target']");
|
|
36360
|
+
if (target !== null) return target;
|
|
36361
|
+
}
|
|
36362
|
+
return null;
|
|
36363
|
+
}
|
|
36364
|
+
const element = typeof document.elementFromPoint === "function" ? document.elementFromPoint(event.clientX, event.clientY) : null;
|
|
36365
|
+
return element instanceof Element ? element.closest("[data-slot='docblocks/shape-text-target']") ?? null : null;
|
|
36366
|
+
}
|
|
36344
36367
|
/** The title chip's double-click: the title's inline edit (the chip's own
|
|
36345
36368
|
* target — the chip stands in the screen layer outside the box, so the
|
|
36346
36369
|
* container's double-click handler never sees it). Only the chip itself
|
|
@@ -36418,9 +36441,10 @@ function createContentDoubleClick(ctx) {
|
|
|
36418
36441
|
if (inner !== null) focusCaretInElement(inner, offset);
|
|
36419
36442
|
return;
|
|
36420
36443
|
}
|
|
36444
|
+
const shapeTextTarget = shapeTextTargetAt(event);
|
|
36421
36445
|
const labelWorld = screenToCanvas(ctx.centerRelativePoint(event), ctx.viewport.zoom, ctx.viewport.pan);
|
|
36422
36446
|
const labelCandidate = pressHitAt(ctx.doc, labelWorld, ctx.viewport.zoom);
|
|
36423
|
-
if (labelCandidate !== null && labelCandidate.type === "connector") {
|
|
36447
|
+
if (labelCandidate !== null && labelCandidate.type === "connector" && shapeTextTarget === null) {
|
|
36424
36448
|
ctx.viewport.setConnectorLabelEditing(labelCandidate.id);
|
|
36425
36449
|
return;
|
|
36426
36450
|
}
|
|
@@ -36441,9 +36465,7 @@ function createContentDoubleClick(ctx) {
|
|
|
36441
36465
|
return;
|
|
36442
36466
|
}
|
|
36443
36467
|
}
|
|
36444
|
-
const
|
|
36445
|
-
const element = fromTarget !== null ? fromTarget : document.elementFromPoint(event.clientX, event.clientY);
|
|
36446
|
-
const target = element instanceof Element ? element.closest("[data-slot='docblocks/shape-text-target']") : null;
|
|
36468
|
+
const target = shapeTextTarget;
|
|
36447
36469
|
if (target === null) return;
|
|
36448
36470
|
const id = target.closest("[data-slot='docblocks/canvas-item']")?.getAttribute("data-block-id") ?? null;
|
|
36449
36471
|
if (id !== null) ctx.viewport.setShapeTextEditing(id);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DropdownMenuShortcut, $t as useText, A as Select, At as columnAnnotation, B as Label, Bt as CardDescription, C as cellValueEqual, Ct as isBridgeErrorCode, D as filterIsComplete, Dt as conditionMatches, E as emptyFilter, Et as ENUM_OPTION_NAME_COLUMN, F as SelectScrollDownButton, Ft as BookOpen, G as DropdownMenuContent, Gt as badgeVariants, H as Input, Ht as CardHeader, I as SelectScrollUpButton, It as Skeleton, J as DropdownMenuLabel, Jt as useMeta, K as DropdownMenuGroup, Kt as useBlock, L as SelectSeparator, Lt as Card, M as SelectGroup, Mt as Pen, N as SelectItem, Nt as Eye, O as SegmentSelector, Ot as parseCellValue, P as SelectLabel, Q as DropdownMenuSeparator, Qt as useSelectionView, R as SelectTrigger, Rt as CardAction, S as useDatabaseTable, St as isBridgeError, T as FilterBuilder, Tt as ENUM_OPTION_COLOR_COLUMN, U as DropdownMenu, Ut as CardTitle, V as InlineEditInput, Vt as CardFooter, W as DropdownMenuCheckboxItem, Wt as Badge, X as DropdownMenuRadioGroup, Xt as usePresenceSharing, Y as DropdownMenuPortal, Yt as usePresence, Z as DropdownMenuRadioItem, Zt as useSelection, _ as mapFrontmatter, _t as PROTOCOL_VERSION, a as DEFAULT_EMBED_SANDBOX, at as Popover, b as renderRuns, bt as BRIDGE_ERROR_CODES, c as SHAPE_FONT_OPTIONS, ct as PopoverDescription, d as FORMAT_PALETTE, dt as PopoverTrigger, en as DocblocksI18nProvider, et as DropdownMenuSub, ft as Checkbox, g as parseFrontmatter, gt as BASELINE_CAPABILITIES, h as mdToBlocks, ht as AlertTitle, i as useEditorContext, in as buttonVariants, it as Separator, j as SelectContent, k as ScrollArea, kt as TEXT_TYPES, l as SHAPE_FONT_STACKS, lt as PopoverHeader, m as insertNative, mt as AlertDescription, n as useCoverAverageColor, nn as EditorErrorBoundary, nt as DropdownMenuSubTrigger, ot as PopoverAnchor, p as htmlToBlocks, pt as Alert, q as DropdownMenuItem, qt as useDoc, r as EditorProvider, rn as Button, rt as DropdownMenuTrigger, st as PopoverContent, t as Editor, tn as createMemoryBlobStore, tt as DropdownMenuSubContent, ut as PopoverTitle, v as markToggleAction, vt as isDatabaseBridge, w as newMutationContext, wt as toBridgeError, x as GridBody, xt as BridgeError, yt as validateProtocolDescriptor, z as SelectValue, zt as CardContent } from "./Editor-
|
|
1
|
+
import { $ as DropdownMenuShortcut, $t as useText, A as Select, At as columnAnnotation, B as Label, Bt as CardDescription, C as cellValueEqual, Ct as isBridgeErrorCode, D as filterIsComplete, Dt as conditionMatches, E as emptyFilter, Et as ENUM_OPTION_NAME_COLUMN, F as SelectScrollDownButton, Ft as BookOpen, G as DropdownMenuContent, Gt as badgeVariants, H as Input, Ht as CardHeader, I as SelectScrollUpButton, It as Skeleton, J as DropdownMenuLabel, Jt as useMeta, K as DropdownMenuGroup, Kt as useBlock, L as SelectSeparator, Lt as Card, M as SelectGroup, Mt as Pen, N as SelectItem, Nt as Eye, O as SegmentSelector, Ot as parseCellValue, P as SelectLabel, Q as DropdownMenuSeparator, Qt as useSelectionView, R as SelectTrigger, Rt as CardAction, S as useDatabaseTable, St as isBridgeError, T as FilterBuilder, Tt as ENUM_OPTION_COLOR_COLUMN, U as DropdownMenu, Ut as CardTitle, V as InlineEditInput, Vt as CardFooter, W as DropdownMenuCheckboxItem, Wt as Badge, X as DropdownMenuRadioGroup, Xt as usePresenceSharing, Y as DropdownMenuPortal, Yt as usePresence, Z as DropdownMenuRadioItem, Zt as useSelection, _ as mapFrontmatter, _t as PROTOCOL_VERSION, a as DEFAULT_EMBED_SANDBOX, at as Popover, b as renderRuns, bt as BRIDGE_ERROR_CODES, c as SHAPE_FONT_OPTIONS, ct as PopoverDescription, d as FORMAT_PALETTE, dt as PopoverTrigger, en as DocblocksI18nProvider, et as DropdownMenuSub, ft as Checkbox, g as parseFrontmatter, gt as BASELINE_CAPABILITIES, h as mdToBlocks, ht as AlertTitle, i as useEditorContext, in as buttonVariants, it as Separator, j as SelectContent, k as ScrollArea, kt as TEXT_TYPES, l as SHAPE_FONT_STACKS, lt as PopoverHeader, m as insertNative, mt as AlertDescription, n as useCoverAverageColor, nn as EditorErrorBoundary, nt as DropdownMenuSubTrigger, ot as PopoverAnchor, p as htmlToBlocks, pt as Alert, q as DropdownMenuItem, qt as useDoc, r as EditorProvider, rn as Button, rt as DropdownMenuTrigger, st as PopoverContent, t as Editor, tn as createMemoryBlobStore, tt as DropdownMenuSubContent, ut as PopoverTitle, v as markToggleAction, vt as isDatabaseBridge, w as newMutationContext, wt as toBridgeError, x as GridBody, xt as BridgeError, yt as validateProtocolDescriptor, z as SelectValue, zt as CardContent } from "./Editor-GTU07ClJ.mjs";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { C as UnknownSlashCommandError, S as UnhandledValueError, _ as CanvasPasteError, b as HookMisuseError, g as BlobNotFoundError, s as preventDefault, v as DocBlocksUiError, w as cn, x as PdfFetchError, y as EditorProviderError } from "./constants-CBPODzZc.mjs";
|
package/dist/mermaid/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { It as Skeleton, Nt as Eye, O as SegmentSelector, Pt as CodeXml, f as textOf, ht as AlertTitle, i as useEditorContext, jt as RotateCcw, mt as AlertDescription, o as childrenSlot, pt as Alert, rn as Button, s as CodeHeader, u as TextBlock, y as INLINE_CODE_CLASS } from "../Editor-
|
|
1
|
+
import { It as Skeleton, Nt as Eye, O as SegmentSelector, Pt as CodeXml, f as textOf, ht as AlertTitle, i as useEditorContext, jt as RotateCcw, mt as AlertDescription, o as childrenSlot, pt as Alert, rn as Button, s as CodeHeader, u as TextBlock, y as INLINE_CODE_CLASS } from "../Editor-GTU07ClJ.mjs";
|
|
2
2
|
import mermaid from "mermaid";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
package/package.json
CHANGED