docblocks-react-ui 0.18.0 → 0.18.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,71 @@
1
1
  # docblocks-react-ui
2
2
 
3
+ ## 0.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2d9c34a: The database grid's data-keyed cell writes now build their cell maps over
8
+ the null-prototype's map everywhere the keys stand the bridge's column ids
9
+ (the enum column form's option cells, the multi-cell paste, the keyboard's
10
+ clear, the write's inverse / clean / batch restore): a hostile column id
11
+ (`__proto__`) stands the inert own entry, not the prototype's write —
12
+ the cell keeps its value over the write instead of standing silently
13
+ dropped.
14
+ - c71c306: The download-href gate stands the core's shared `normalizeHrefInput`
15
+ (the duplicated WHATWG normalization regexes stand removed — the link
16
+ href's parity). The data-keyed writes (the enum option's cell maps over
17
+ the bridge column ids, the persisted viewport's map over the doc id)
18
+ stand the null-prototype's maps (a hostile id stands the inert own entry,
19
+ not the prototype's write). The table stream's at-least-once dedup set
20
+ stands bounded (the stale check — the seq at or below the head's drop —
21
+ protects the pruned seqs; the long session's growth is bounded).
22
+ - 28b8f34: The download-href gate over the consumer's `BlobStore` url now normalizes the
23
+ browser's WHATWG control handling (the mid-string U+0009/U+000A/U+000D strip +
24
+ the leading / trailing C0 / space trim) before the scheme check, in parity with
25
+ the link-href's classifier — a `downloadUrl` carrying a control-split
26
+ `javascript:` scheme no longer stands an anchor.
27
+ - d32aeee: The slash Frame picker's ref-cached list now tracks the root's child blocks' refs alongside the frame blocks' refs: a frame added (or reordered) into an existing surface invalidates the cache — the list re-renders over the live change while the picker stands open.
28
+ - 461e4fc: The provider hooks' misuse now throws the typed `HookMisuseError` (the
29
+ `DocBlocksUiError` family, exported over the entry point) instead of a
30
+ raw `Error`: an editor hook rendered outside the `EditorProvider`, or a
31
+ block hook outside its block context, is catchable by class. The
32
+ `./motion` subpath's references in the shipped comments stand replaced
33
+ over the current stand (the base entry's row layer — framer-motion the
34
+ required peer).
35
+ - 46e525a: The imperative mention chip's renderer now falls back to the `doc`'s icon
36
+ geometry over an out-of-enum `mention` kind (the lenient reader keeps the
37
+ wire's value as-is; the kind's mark data is stored over the write's
38
+ validation, so a peer-written kind outside the enum stands the data). The
39
+ block no longer crashes to its error placeholder over such a run — the
40
+ chip renders with its label, the React's path's parity.
41
+ - 89004ef: The `./mermaid` subpath's entry now stands in the package's `sideEffects`
42
+ list (as the `./pdf`'s entry does): the entry runs the module-scope
43
+ mermaid's configuration, and a tree-shaking bundler over the absent
44
+ entry could drop its side effects.
45
+ - 6c49e41: The ref-table data provider (`useRefTables`) now coalesces its live
46
+ refreshes per entry: a bridge envelope that arrives over a running full
47
+ page-set load marks the entry pending instead of firing a parallel load,
48
+ and the pending re-run stands over the running load's write — a burst of
49
+ envelopes runs the running load plus one trailing load, and overlapping
50
+ loads never interleave their states.
51
+ - d751449: The page sequence's structural stamp (`seqStamp`) now sources a block's
52
+ `type` change over the entry sequence: a `changeBlockType` of a root
53
+ block (the `surface`'s filter input over the page children's derivation)
54
+ stands the stamp's bump, so the sequence re-derives its membership
55
+ instead of standing the stale row set until the next structural change.
56
+ - 691c46c: The `sideEffects` field now covers the base entry's top-level chunks
57
+ (`dist/*.mjs`): the module-scope initialization (the package's own i18next
58
+ instance + the legacy `<html lang>`'s runtime observer) stands declared
59
+ over the tree-shaking's bundlers instead of standing reachable only over
60
+ the subpath entries.
61
+ - Updated dependencies [2cd7f10]
62
+ - Updated dependencies [772a8a0]
63
+ - Updated dependencies [1a77fa3]
64
+ - Updated dependencies [a7610aa]
65
+ - Updated dependencies [ebe7313]
66
+ - Updated dependencies [f1f3679]
67
+ - docblocks-core@0.8.1
68
+
3
69
  ## 0.18.0
4
70
 
5
71
  ### Minor Changes
package/README.md CHANGED
@@ -97,25 +97,25 @@ slash command is hidden without a bridge; the `sync-embed` block stands
97
97
  its broken state without a resolver; the `@` stays plain text without a
98
98
  mention catalog). The full props list:
99
99
 
100
- | Prop | Contract |
101
- | ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102
- | `doc` | The core `Doc` to render. Must not change after mount (a throw on change is the contract). Required for the `editor` stand; over the `viewer`'s level the doc IS the published snapshot (the security model — the reader's browser never receives the live document), and an absent stand renders the "not published yet" placeholder. |
103
- | `provider?` | A core `SyncProvider` for the wire + presence. Without it the editor is a single-client document (local edits stand, nothing syncs). |
104
- | `blockRenderers?` | Per-type renderer overrides (see below). |
105
- | `blobStore?` | The blob bridge for image / pdf / file blocks and the document-attributes' cover (see below). |
106
- | `coverPresets?` | The cover's upload modal's preset gallery: the consumer's ready-made cover's file ids (the consumer's blob store's ids) per placement mode — the `tile` / the `center`'s set. A pick commits the id over the mode without an upload (see Blobs below). |
107
- | `databaseBridge?` | The table operations behind external-form database blocks (see below). |
108
- | `syncEmbedResolver?` | `(ref) => Doc \| null` — resolves a `sync-embed` block's ref to the master doc (see below). |
109
- | `embedSandbox?` | `(src) => string \| null` — the embed iframe's `sandbox` policy. The default grants the same-origin (the embedded app's own storage / cookies stand, so the real apps boot); `null` stands no sandbox (a fully trusted embed). The opaque-origin restriction stands over this policy. |
110
- | `pdfPreview?` | A first-page preview component for PDF file blocks (and legacy PDF image blocks). |
111
- | `mentionProvider?` | The `@` mention picker's search catalog (see below). |
112
- | `mentionInteractions?` | The mention chip's hover card + the click's delivery (see below). Without the prop the chip stands inert (no card, the click is the browser's stand). |
113
- | `rootBlockId?` | Render the entry list of this block instead of the document root (the subtree view). Must not change after mount. |
114
- | `commandPalettePlaceholder?` | The empty-block hint override; the default is localized (en/ru). |
115
- | `accessLevel?` | The consumer's user access level (default `editor`): `viewer` forces the `published` mode (the current state is never rendered to a reader). |
116
- | `mode?` | The document mode (default `edit`): `view` is a read-only live document; `published` renders the `publishedDoc` snapshot read-only. |
117
- | `publishedDoc?` | The published snapshot (a hydrated core `Doc`; must not change after mount — remount over `key` for a new snapshot). The consumer owns the publish action and the snapshot storage. |
118
- | `presence?` | The local user's presence identity + the selection-sharing cipher (see Presence sharing below). Without the prop the editor keeps the legacy stand (the anonymous plaintext selection, always shared over the room). |
100
+ | Prop | Contract |
101
+ | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102
+ | `doc` | The core `Doc` to render. Must not change after mount (a throw on change is the contract). Required for the `editor` stand; over the `viewer`'s level the doc IS the published snapshot (the security model — the reader's browser never receives the live document), and an absent stand renders the "not published yet" placeholder. |
103
+ | `provider?` | A core `SyncProvider` for the wire + presence. Without it the editor is a single-client document (local edits stand, nothing syncs). |
104
+ | `blockRenderers?` | Per-type renderer overrides (see below). |
105
+ | `blobStore?` | The blob bridge for image / pdf / file blocks and the document-attributes' cover (see below). |
106
+ | `coverPresets?` | The cover's upload modal's preset gallery: the consumer's ready-made cover's file ids (the consumer's blob store's ids) per placement mode — the `tile` / the `center`'s set. A pick commits the id over the mode without an upload (see Blobs below). |
107
+ | `databaseBridge?` | The table operations behind external-form database blocks (see below). |
108
+ | `syncEmbedResolver?` | `(ref) => Doc \| null` — resolves a `sync-embed` block's ref to the master doc (see below). |
109
+ | `embedSandbox?` | `(src) => string \| null` — the embed iframe's `sandbox` policy. The default grants the same-origin (the embedded app's own storage / cookies stand, so the real apps boot); `null` stands no sandbox (a fully trusted embed). Over an untrusted URL stand the `""`'s return (the opaque origin, no scripts); the opaque-origin's restriction stands over this policy. |
110
+ | `pdfPreview?` | A first-page preview component for PDF file blocks (and legacy PDF image blocks). |
111
+ | `mentionProvider?` | The `@` mention picker's search catalog (see below). |
112
+ | `mentionInteractions?` | The mention chip's hover card + the click's delivery (see below). Without the prop the chip stands inert (no card, the click is the browser's stand). |
113
+ | `rootBlockId?` | Render the entry list of this block instead of the document root (the subtree view). Must not change after mount. |
114
+ | `commandPalettePlaceholder?` | The empty-block hint override; the default is localized (en/ru). |
115
+ | `accessLevel?` | The consumer's user access level (default `editor`): `viewer` forces the `published` mode (the current state is never rendered to a reader). |
116
+ | `mode?` | The document mode (default `edit`): `view` is a read-only live document; `published` renders the `publishedDoc` snapshot read-only. |
117
+ | `publishedDoc?` | The published snapshot (a hydrated core `Doc`; must not change after mount — remount over `key` for a new snapshot). The consumer owns the publish action and the snapshot storage. |
118
+ | `presence?` | The local user's presence identity + the selection-sharing cipher (see Presence sharing below). Without the prop the editor keeps the legacy stand (the anonymous plaintext selection, always shared over the room). |
119
119
 
120
120
  Two rules for the optional props:
121
121
 
@@ -226,6 +226,87 @@ document data, never on the wire):
226
226
  its `doc` (the viewer's switcher stays off — the `accessLevel` stands no
227
227
  `mode` stand over the `viewer` level).
228
228
 
229
+ ### Document attributes
230
+
231
+ The `DocMeta.attributes` record is consumer-owned document metadata (the
232
+ markdown frontmatter's stand): arbitrary keys, typed values
233
+ (`string | number | boolean | string[] | MentionRef` — the id-only
234
+ `{ kind, id }` reference — `| { type, value }` over the
235
+ `ATTRIBUTE_TYPES` enum), a display order (`attributesOrder` — an
236
+ optional permutation of the keys; its absence stands the record's order),
237
+ and the core's commands `setAttribute` / `removeAttribute` /
238
+ `renameAttribute` / `reorderAttributes` (one transaction each). The panel
239
+ renders over the page column as a collapsible section: the system rows
240
+ (`id`, `created`, the live `last updated` — date-only, locale-formatted),
241
+ the preset rows (`description`, `tags`, `createdBy`, `cover` — including
242
+ the `coverMode` `tile`/`center` placement and the `coverTint` frame
243
+ accent, `status`, `publishedAt`), and the custom rows (added at the
244
+ list's tail over the type picker + the name's draft; a typed row's
245
+ initial form stands over the picked type). The custom rows are
246
+ drag-reorderable (the commit — one `reorderAttributes` command, one
247
+ undo step). The read-only modes render the rows display-only.
248
+
249
+ The panel is consumer-decoupled over the `EditorProvider` props:
250
+
251
+ ```tsx
252
+ <EditorProvider
253
+ doc={doc}
254
+ // Hide the listed keys (the system, the preset or any custom key)
255
+ // from the panel over every mode (edit, view, and published).
256
+ hiddenAttributes={["cover"]}
257
+ // The tags' consumer contract (the document never stores tags).
258
+ docTags={{ tags: docTags, onTagAdd, onTagRemove, onTagClick }}
259
+ // The description's consumer contract (the document never stores it;
260
+ // without the prop the built-in stand reads `attributes.description`).
261
+ docDescription={{ value: description, onEdit: commitDescription }}
262
+ // The consumer's value-zone renderer over a key (null / absent = the
263
+ // built-in editors).
264
+ renderAttribute={({ key, value, onChange, onRemove, readOnly }) =>
265
+ key === "owner" ? <OwnerPicker value={value} onCommit={onChange} /> : null
266
+ }
267
+ // The consumer's type-picker UI over the add popover (absent = the
268
+ // built-in picker).
269
+ attributeTypePicker={({ value, onChange }) => <MyTypePicker value={value} onChange={onChange} />}
270
+ // The consumer's cover preset gallery (the file ids per placement mode;
271
+ // a pick commits the id without an upload; absent = no grid).
272
+ coverPresets={{ tile: ["cover-1", "cover-2"], center: ["cover-3"] }}
273
+ ></EditorProvider>
274
+ ```
275
+
276
+ Every customization value is read per render into the provider context:
277
+ pass a stable reference; a nested provider that supplies none inherits
278
+ the enclosing one.
279
+
280
+ ### Document import
281
+
282
+ `importDocument` fills a FRESH document (the empty root) from a markdown
283
+ or HTML payload — the consumer's pre-attach write (the content stands in
284
+ the first full-state bootstrap the sync attach sends, so the first wire
285
+ sync persists it):
286
+
287
+ ```ts
288
+ import { importDocument } from "docblocks-react-ui";
289
+
290
+ import { attach, createDoc } from "docblocks-core";
291
+
292
+ const doc = createDoc({ id: "new-doc-id" });
293
+ importDocument(doc, rawMarkdown, "markdown"); // one transaction: one undo step, one wire update
294
+ attach(doc, provider);
295
+ ```
296
+
297
+ - `kind: "markdown" | "html"` — the paste parsers' shared materialization
298
+ (the same typed block / table / runs writes the paste pipeline uses);
299
+ - an empty or whitespace-only payload is a no-op (no transaction);
300
+ - a non-fresh document (the root has children) throws the typed
301
+ `ImportDocumentError` — the import fills the root, it never appends;
302
+ - the markdown's YAML frontmatter (a leading `--- … ---` fence, a hand-
303
+ rolled subset) is stripped before the blocks' parse and mapped to the
304
+ meta over the fresh document: `title` → the doc's title, the known
305
+ keys → the attribute's presets (`author` / `created_by` →
306
+ `createdBy`, …), the unknown keys → the custom attribute keys; a
307
+ frontmatter without a body is a meta-only import. The reserved
308
+ `__proto__` key is dropped (the entries live in plain objects).
309
+
229
310
  ### Sync and presence
230
311
 
231
312
  The transport is a core concern: create the doc, build a provider, attach
@@ -263,9 +344,13 @@ function App() {
263
344
  unmount.
264
345
  - `WsSyncProvider` speaks standard y-protocols over WebSocket (the
265
346
  y-websocket wire, wire-compatible with a standard y-websocket server);
266
- `options: { token?, webSocketImpl? }`. Any object implementing the core
267
- `SyncProvider` interface (connect / disconnect / sendUpdate / onUpdate /
268
- getLocalStateVector / setAwareness / onAwareness) works in its place.
347
+ `options: { token?, webSocketImpl?, maxPendingBytes?, maxFrameBytes? }`
348
+ (the client-side backpressure ceilings — the buffered local updates
349
+ over the not-open socket, the one incoming frame; the defaults are
350
+ 4 MiB each, and the overflow flag is reported through `getPendingStats`). Any object
351
+ implementing the core `SyncProvider` interface (connect / disconnect /
352
+ sendUpdate / onUpdate / getLocalStateVector / setAwareness / onAwareness)
353
+ works in its place.
269
354
  - Presence rides the provider's awareness channel: the editor publishes its
270
355
  own selection automatically (debounced) and renders the remote peers'
271
356
  carets. `usePresence()` reads the per-peer state (peer id, selection,
@@ -450,7 +535,11 @@ package root: `BridgeError` (the structured error type) with
450
535
  (the client-issued `operationId` per op), `PROTOCOL_VERSION` /
451
536
  `BASELINE_CAPABILITIES` / `validateProtocolDescriptor` (the negotiation),
452
537
  `isDatabaseBridge`, and `useDatabaseTable(bridge, tableId, filter?)` — the
453
- grid controller for a consumer-owned grid over the bridge.
538
+ grid controller for a consumer-owned grid over the bridge. The filter's
539
+ utilities are exported as well: `emptyFilter`, `filterIsComplete`,
540
+ `conditionMatches` (the filter's evaluation over a row), `parseCellValue` /
541
+ `cellValueEqual` (the cell's typed comparison), and `columnAnnotation`
542
+ (the column's type annotation over the filter's value editor).
454
543
 
455
544
  The grid's **Columns** control lists every column, restores hidden columns,
456
545
  and reorders them by dragging their grips or pressing ArrowUp/ArrowDown on a
@@ -606,18 +695,25 @@ catalog and returns `{ id, label }` entries:
606
695
  const mentionProvider = {
607
696
  searchUsers: async (query: string) => [{ id: "u1", label: "Ada Lovelace" }],
608
697
  searchDocs: async (query: string) => [{ id: "d1", label: "API Reference" }],
698
+ // The chip's live label over the target's id (the synchronous read —
699
+ // the consumer's cache over the catalog / the doc's meta); absent or
700
+ // null stand the insertion-time label.
701
+ resolveLabel: (kind, id) => labelFromCache(kind, id),
609
702
  };
610
703
  ```
611
704
 
612
705
  A pick replaces the `@query` phrase with the label and stands the `mention`
613
- mark (the `kind` `"user"` or `"doc"`, the `id`, and the `label` snapshot) in
614
- one transaction — one undo step. The mention renders as an atomic,
615
- non-editable chip: the kind's inline icon (the `user`'s person, the `doc`'s
616
- exit arrow) over the semibold, underlined label — an inline run of the text
617
- line, no pill of its own. The chip carries the target id
618
- (`data-mention-kind` + `data-mention-id`), so the consumer can stand a live
619
- label or a "removed" state by id (the `label` stays the stable display
620
- snapshot — a renamed / removed target does not change the document).
706
+ mark (the `kind` `"user"` or `"doc"` and the stable `id` — the id-only
707
+ stand; the legacy `label` snapshot is tolerated over the lenient read,
708
+ never written) in one transaction — one undo step. The mention renders as
709
+ an atomic, non-editable chip: the kind's inline icon (the `user`'s person,
710
+ the `doc`'s exit arrow) over the semibold, underlined label — an inline
711
+ run of the text line, no pill of its own. The chip carries the target id
712
+ (`data-mention-kind` + `data-mention-id`), so the consumer can stand a
713
+ "removed" state by id. The chip's text stands the consumer's
714
+ `resolveLabel(kind, id)` live resolution where it resolves (the rename's
715
+ live stand) and the insertion-time label (the run's text) otherwise — a
716
+ renamed / removed target never changes the document.
621
717
  Copying a mention stands the `@label` plain text. Without the prop the `@`
622
718
  is plain text (no picker). The mark is non-exclusive (it composes with the
623
719
  other marks).
@@ -646,10 +742,11 @@ const mentionInteractions: MentionInteractions = {
646
742
  ```
647
743
 
648
744
  The target stands the document's `mention` mark (the core's `MentionMark`
649
- — the `kind`, the stable `id`, and the `label` snapshot): resolve the
650
- current data over the `id` (the catalog, the URL) and stand the live label
651
- or the removed state yourself — the `label` is the display snapshot. The
652
- value is read per render into the provider context: pass a stable reference.
745
+ — the `kind` and the stable `id` — the id-only stand; the legacy `label`
746
+ snapshot is tolerated over the lenient read): resolve the current data
747
+ over the `id` (the catalog, the URL) and stand the removed state
748
+ yourself — the document stores the identity only. The value is read per
749
+ render into the provider context: pass a stable reference.
653
750
  A nested provider that supplies none inherits the enclosing one.
654
751
 
655
752
  ### Links
@@ -792,6 +889,58 @@ value actually changes (the store's reference-stability contract):
792
889
  | `view` | `"page"` (default) or `"canvas"` — the rendering the consumer switches |
793
890
  | `formatPalette` | The format toolbar's color swatches (default `FORMAT_PALETTE`, exported) |
794
891
 
892
+ ### Render failure containment
893
+
894
+ Two error boundaries keep a render failure contained:
895
+
896
+ - the per-block `BlockErrorBoundary` (internal) — a failed block's render
897
+ stands its placeholder; the rest of the document keeps working;
898
+ - the `EditorErrorBoundary` (exported) — the editor's content boundary for
899
+ a failure outside a block's renderer (the chrome, the row layer): the
900
+ failure note plus a retry, so the throw never unmounts the consumer's
901
+ application:
902
+
903
+ ```tsx
904
+ import { EditorErrorBoundary } from "docblocks-react-ui";
905
+
906
+ <EditorErrorBoundary
907
+ fallback={({ error, retry }) => <MyErrorState error={error} onRetry={retry} />}
908
+ resetKey={retryKey} // change the key to force a clean remount
909
+ >
910
+ <Editor view={view} />
911
+ </EditorErrorBoundary>;
912
+ ```
913
+
914
+ ### Errors
915
+
916
+ The package's typed errors mirror `docblocks-core`'s typed command
917
+ errors: a failed prop contract, a failed blob-store lookup, or a failed
918
+ fetch throws a named class (never a raw `Error`), so a consumer can catch
919
+ by class and the error's identity survives the React boundary:
920
+
921
+ | Class | Meaning |
922
+ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
923
+ | `DocBlocksUiError` | The base class for all docblocks-react-ui errors. |
924
+ | `EditorProviderError` | The `EditorProvider`'s prop contract was violated (a mount-immutable prop changed, or a required prop is absent). |
925
+ | `BlobNotFoundError` | The blob store has no stored object for the file id. |
926
+ | `PdfFetchError` | The PDF bytes could not be fetched (a non-ok HTTP response). |
927
+ | `CanvasPasteError` | The canvas paste's internal invariant was violated. |
928
+ | `UnknownSlashCommandError` | The slash command's block type is outside the known registry set. |
929
+ | `UnhandledValueError` | The exhaustiveness backstop: a value escaped a closed union's types. |
930
+ | `HookMisuseError` | A docblocks hook ran outside its provider (the editor's context / the block's context is absent — the mount shape's broken stand). |
931
+
932
+ ```ts
933
+ import { BlobNotFoundError } from "docblocks-react-ui";
934
+
935
+ try {
936
+ await store.get(fileId);
937
+ } catch (error) {
938
+ if (error instanceof BlobNotFoundError) {
939
+ /* the file was deleted on the consumer's side */
940
+ }
941
+ }
942
+ ```
943
+
795
944
  The page view renders the flat page sequence — every page block is its
796
945
  own row (the drag-reorder's pure framer `Reorder`, the insert/remove's
797
946
  layout animation, the rendered list marker per row) — over the required
@@ -1,4 +1,4 @@
1
- import { C as cn, S as UnknownSlashCommandError, _ as CanvasPasteError, a as clamp, c as stopPropagation, d as Plus, f as Minus, g as BlobNotFoundError, h as ChevronLeft, i as assertNever, l as X, m as ChevronRight, o as isSafeDownloadHref, p as LoaderCircle, r as isEmbeddablePdfUrl, s as preventDefault, u as TriangleAlert, y as EditorProviderError } from "./constants-DWJbJpt5.mjs";
1
+ import { C as UnknownSlashCommandError, _ as CanvasPasteError, a as clamp, b as HookMisuseError, c as stopPropagation, d as Plus, f as Minus, g as BlobNotFoundError, h as ChevronLeft, i as assertNever, l as X, m as ChevronRight, o as isSafeDownloadHref, p as LoaderCircle, r as isEmbeddablePdfUrl, s as preventDefault, u as TriangleAlert, w as cn, y as EditorProviderError } from "./constants-D_3p65rk.mjs";
2
2
  import { createStore, useStore } from "zustand";
3
3
  import * as React from "react";
4
4
  import { Component, Fragment, createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
@@ -6058,6 +6058,29 @@ function Textarea({ className, ...props }) {
6058
6058
  ...props
6059
6059
  });
6060
6060
  }
6061
+ //#endregion
6062
+ //#region src/database/grid/use-ref-tables.ts
6063
+ /**
6064
+ * The ref-table data provider for the grid: one page of the ref table's
6065
+ * rows + the row displays (`resolveRowDisplay` — the join stands in the
6066
+ * consumer backend) + the option colors (the ref table's `color` column —
6067
+ * the enum's option's chip color; the absent column / value stands none).
6068
+ * The enum columns read the option labels from it (the option's row id
6069
+ * stands the value, the display stands the label), the row-link columns
6070
+ * read the display text over the row ids (the column's declared
6071
+ * `refDisplayColumn`, else the bridge's default resolution). The data
6072
+ * refreshes on the ref table's live events (the subscription opens over
6073
+ * the snapshot's R — an envelope stands the refresh; a reset signal stands
6074
+ * the re-snapshot + the re-subscription) — per-entry coalesced: an event
6075
+ * over a running load stands the pending re-run, not a parallel load. A
6076
+ * broken ref table (the unknown id) stands the empty data (the lenient
6077
+ * read).
6078
+ */
6079
+ /** The page size the ref table loads (the dict options / the picker's
6080
+ * rows): the cursor's continuation runs over every page (the catalog
6081
+ * stands complete — the truncated option list / the picker's rows are
6082
+ * not a stand). */
6083
+ const REF_PAGE_SIZE = 200;
6061
6084
  /** The cursor's continuation's retry bound (the `cursor_expired` over
6062
6085
  * the concurrent commit stands the fresh snapshot; the bound stands the
6063
6086
  * churn's livelock — over it the partial page set stands the lenient
@@ -6076,7 +6099,7 @@ async function loadFullPages(bridge, tableId) {
6076
6099
  columns: []
6077
6100
  };
6078
6101
  for (let attempt = 0; attempt < REF_LOAD_ATTEMPTS; attempt += 1) {
6079
- const snapshot = await bridge.snapshotTable(tableId, { limit: 200 });
6102
+ const snapshot = await bridge.snapshotTable(tableId, { limit: REF_PAGE_SIZE });
6080
6103
  const rows = [...snapshot.page.rows];
6081
6104
  const columns = snapshot.columns;
6082
6105
  let cursor = snapshot.page.nextCursor;
@@ -6129,21 +6152,22 @@ function useRefTables(bridge, entries) {
6129
6152
  let live = true;
6130
6153
  const entryKeys = key.split("");
6131
6154
  const loaded = /* @__PURE__ */ new Map();
6132
- const refreshEntry = async (entryKey) => {
6155
+ const inFlight = /* @__PURE__ */ new Set();
6156
+ const pending = /* @__PURE__ */ new Set();
6157
+ const runEntry = async (entryKey) => {
6133
6158
  const [tableId, displayColumn] = entryKey.split("\0");
6134
6159
  try {
6135
6160
  const pageSet = await loadFullPages(bridge, tableId);
6136
- if (pageSet === null) return;
6137
6161
  const rows = pageSet.rows;
6138
6162
  const rowIds = rows.map((row) => row.id);
6139
6163
  const rawDisplays = await bridge.resolveRowDisplay(tableId, {
6140
6164
  rowIds,
6141
6165
  ...displayColumn === "" || displayColumn === void 0 ? {} : { displayColumn }
6142
6166
  });
6143
- const displays = {};
6167
+ const displays = Object.create(null);
6144
6168
  for (const [rowId, display] of Object.entries(rawDisplays)) if (display !== null) displays[rowId] = display;
6145
6169
  const colorColumnId = pageSet.columns.find((column) => column.name === ENUM_OPTION_COLOR_COLUMN)?.id;
6146
- const colors = {};
6170
+ const colors = Object.create(null);
6147
6171
  for (const row of rows) {
6148
6172
  const color = colorColumnId !== void 0 ? row.cells[colorColumnId] : void 0;
6149
6173
  if (typeof color === "string" && color !== "") colors[row.id] = color;
@@ -6164,20 +6188,31 @@ function useRefTables(bridge, entries) {
6164
6188
  if (live) setData(Object.fromEntries(loaded));
6165
6189
  }
6166
6190
  };
6167
- const refreshAll = async () => {
6168
- for (const entryKey of entryKeys) await refreshEntry(entryKey);
6191
+ const refreshEntry = (entryKey) => {
6192
+ if (inFlight.has(entryKey)) {
6193
+ pending.add(entryKey);
6194
+ return;
6195
+ }
6196
+ inFlight.add(entryKey);
6197
+ runEntry(entryKey).finally(() => {
6198
+ inFlight.delete(entryKey);
6199
+ if (pending.delete(entryKey)) refreshEntry(entryKey);
6200
+ });
6201
+ };
6202
+ const refreshAll = () => {
6203
+ for (const entryKey of entryKeys) refreshEntry(entryKey);
6169
6204
  };
6170
6205
  refreshAll();
6171
6206
  const handles = [];
6172
6207
  const open = async (entryKey) => {
6173
6208
  const tableId = entryKey.split("\0")[0];
6174
6209
  try {
6175
- const snapshot = await bridge.snapshotTable(tableId, { limit: 200 });
6210
+ const snapshot = await bridge.snapshotTable(tableId, { limit: REF_PAGE_SIZE });
6176
6211
  if (!live) return;
6177
6212
  let handle = null;
6178
6213
  handle = bridge.subscribeTable(tableId, { afterSeq: snapshot.page.asOfSeq }, {
6179
6214
  ready: () => void 0,
6180
- event: () => void refreshEntry(entryKey),
6215
+ event: () => refreshEntry(entryKey),
6181
6216
  status: () => void 0,
6182
6217
  error: () => void 0,
6183
6218
  reset: () => {
@@ -7298,7 +7333,7 @@ function createRowWriteOps(ctx) {
7298
7333
  }] }, newMutationContext());
7299
7334
  },
7300
7335
  inverse: async () => {
7301
- const restore = {};
7336
+ const restore = Object.create(null);
7302
7337
  for (const key of Object.keys(cleaned)) restore[key] = oldCells[key] === void 0 ? null : oldCells[key];
7303
7338
  await bridge.batchRows(tableId, { ops: [{
7304
7339
  op: "update",
@@ -7327,7 +7362,7 @@ function createRowWriteOps(ctx) {
7327
7362
  /** The clean cells patch: the `undefined` values stand no write (the
7328
7363
  * merge keeps the current cell). */
7329
7364
  function cleanCells(cells) {
7330
- const patch = {};
7365
+ const patch = Object.create(null);
7331
7366
  for (const [key, value] of Object.entries(cells)) if (value !== void 0) patch[key] = value;
7332
7367
  return patch;
7333
7368
  }
@@ -7527,7 +7562,7 @@ function restorePatchesOf(before, cleaned) {
7527
7562
  return cleaned.flatMap(({ rowId, cells }) => {
7528
7563
  const oldCells = before.get(rowId);
7529
7564
  if (oldCells === void 0) return [];
7530
- const patch = {};
7565
+ const patch = Object.create(null);
7531
7566
  for (const key of Object.keys(cells)) patch[key] = oldCells[key] === void 0 ? null : oldCells[key];
7532
7567
  if (Object.keys(patch).length === 0) return [];
7533
7568
  return [{
@@ -7749,6 +7784,7 @@ function useTableStream(ctx) {
7749
7784
  }
7750
7785
  lastSeenSeq = envelope.seq;
7751
7786
  seenSeqs.add(envelope.seq);
7787
+ if (seenSeqs.size >= 1024) seenSeqs.clear();
7752
7788
  refetch();
7753
7789
  },
7754
7790
  status: () => void 0,
@@ -10421,7 +10457,8 @@ function commitColumnFormCreate(ctx, draft) {
10421
10457
  } }, newMutationContext())).result.id;
10422
10458
  for (const option of draft.enumOptions ?? []) {
10423
10459
  if (option.name.trim() === "") continue;
10424
- const cells = { [nameColumnId]: option.name.trim() };
10460
+ const cells = Object.create(null);
10461
+ cells[nameColumnId] = option.name.trim();
10425
10462
  if (option.color !== null) cells[colorColumnId] = option.color;
10426
10463
  await bridge.batchRows(enumTableId, { ops: [{
10427
10464
  op: "create",
@@ -10480,7 +10517,7 @@ function commitColumnFormEdit(ctx, draft) {
10480
10517
  const draftOptions = (draft.enumOptions ?? []).filter((option) => option.name.trim() !== "");
10481
10518
  const keptRowIds = /* @__PURE__ */ new Set();
10482
10519
  const cellOf = (option) => {
10483
- const cells = {};
10520
+ const cells = Object.create(null);
10484
10521
  if (nameColumnId !== void 0) cells[nameColumnId] = option.name.trim();
10485
10522
  if (option.color !== null && colorColumnId !== void 0) cells[colorColumnId] = option.color;
10486
10523
  return cells;
@@ -10500,7 +10537,7 @@ function commitColumnFormEdit(ctx, draft) {
10500
10537
  keptRowIds.add(option.rowId);
10501
10538
  const before = current.find((entry) => entry.rowId === option.rowId);
10502
10539
  if (before === void 0) continue;
10503
- const cells = {};
10540
+ const cells = Object.create(null);
10504
10541
  if (before.name !== option.name.trim() && nameColumnId !== void 0) cells[nameColumnId] = option.name.trim();
10505
10542
  if (before.color !== (option.color ?? null) && colorColumnId !== void 0) cells[colorColumnId] = option.color;
10506
10543
  if (Object.keys(cells).length > 0) ops.push({
@@ -10529,7 +10566,7 @@ function commitColumnFormEdit(ctx, draft) {
10529
10566
  keptRowIds.add(option.rowId);
10530
10567
  const before = current.find((entry) => entry.rowId === option.rowId);
10531
10568
  if (before === void 0) continue;
10532
- const cells = {};
10569
+ const cells = Object.create(null);
10533
10570
  if (before.name !== option.name.trim() && nameColumnId !== void 0) cells[nameColumnId] = option.name.trim();
10534
10571
  if (before.color !== (option.color ?? null) && colorColumnId !== void 0) cells[colorColumnId] = option.color;
10535
10572
  if (Object.keys(cells).length > 0) await bridge.batchRows(refTableId, { ops: [{
@@ -10742,10 +10779,9 @@ function useColumnForm({ bridge, tableId, data, refTableData, readColumnOrder, o
10742
10779
  //#endregion
10743
10780
  //#region src/database/grid/use-enum-options-motion.ts
10744
10781
  /** The enum's options editor's motion's slot: the framer-wired editor
10745
- * (the `./motion`'s Reorder's rows) provides the motion's variant here;
10746
- * the base's renderer stands the plain editor (the slot stands the null's
10747
- * stand). The base stands the context only — the framer's import stands
10748
- * the motion's subpath (the subpath's boundary's contract). */
10782
+ * (the Reorder's rows) provides the motion's variant here; the renderer
10783
+ * without the slot stands the plain editor. framer-motion stands the
10784
+ * required peer (the base entry's row layer — the import is the base's). */
10749
10785
  const EnumOptionsMotionSlot = createContext(null);
10750
10786
  function useEnumOptionsMotion() {
10751
10787
  return useContext(EnumOptionsMotionSlot);
@@ -10842,7 +10878,7 @@ function handleGridCellKeyDown(event, ctx) {
10842
10878
  const byRow = /* @__PURE__ */ new Map();
10843
10879
  selectedCells.forEach((key) => {
10844
10880
  const [rowId, colId] = key.split("\0");
10845
- const cells = byRow.get(rowId) ?? {};
10881
+ const cells = byRow.get(rowId) ?? Object.create(null);
10846
10882
  cells[colId] = null;
10847
10883
  byRow.set(rowId, cells);
10848
10884
  });
@@ -10872,7 +10908,7 @@ function handleGridCellPaste(event, ctx) {
10872
10908
  for (let i = 0; i < grid.length; i += 1) {
10873
10909
  const line = grid[i];
10874
10910
  if (line === void 0) continue;
10875
- const cells = {};
10911
+ const cells = Object.create(null);
10876
10912
  for (let j = 0; j < line.length; j += 1) {
10877
10913
  const column = columns[c0 + j];
10878
10914
  if (column === void 0) continue;
@@ -14962,18 +14998,23 @@ function storage() {
14962
14998
  return null;
14963
14999
  }
14964
15000
  }
14965
- /** The storage's map (the missing / the corrupted entry stands empty). */
15001
+ /** The storage's map (the missing / the corrupted entry stands empty; the
15002
+ * null-prototype's map — a hostile stored id (`__proto__`) stands the
15003
+ * inert own entry, not the prototype's write). */
14966
15004
  function readMap() {
15005
+ const empty = () => Object.create(null);
14967
15006
  const store = storage();
14968
- if (store === null) return {};
15007
+ if (store === null) return empty();
14969
15008
  try {
14970
15009
  const raw = store.getItem(STORAGE_KEY);
14971
- if (raw === null) return {};
15010
+ if (raw === null) return empty();
14972
15011
  const parsed = JSON.parse(raw);
14973
- if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return {};
14974
- return parsed;
15012
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return empty();
15013
+ const map = Object.create(null);
15014
+ for (const [key, value] of Object.entries(parsed)) map[key] = value;
15015
+ return map;
14975
15016
  } catch {
14976
- return {};
15017
+ return empty();
14977
15018
  }
14978
15019
  }
14979
15020
  function writeMap(map) {
@@ -15531,7 +15572,7 @@ function useBlockContextValue(parentId, siblings, parentType) {
15531
15572
  /** Read the block context; throws outside a block context provider. */
15532
15573
  function useBlockContext() {
15533
15574
  const context = useContext(BlockContext);
15534
- if (context === null) throw new Error("useBlockContext must be used inside a block context provider.");
15575
+ if (context === null) throw new HookMisuseError("useBlockContext must be used inside a block context provider.");
15535
15576
  return context;
15536
15577
  }
15537
15578
  //#endregion
@@ -16152,7 +16193,7 @@ function createMentionKindIcon(kind) {
16152
16193
  svg.setAttribute("stroke-linejoin", "round");
16153
16194
  svg.setAttribute("aria-hidden", "true");
16154
16195
  svg.setAttribute("focusable", "false");
16155
- for (const shape of ICON_SHAPES[kind]) {
16196
+ for (const shape of ICON_SHAPES[kind] ?? ICON_SHAPES.doc) {
16156
16197
  const el = document.createElementNS(SVG_NS, shape.tag);
16157
16198
  if (shape.tag === "path") el.setAttribute("d", shape.d);
16158
16199
  else {
@@ -18682,9 +18723,10 @@ function DatabaseSlashPicker({ onCommit, onCancel }) {
18682
18723
  * stands open over the phrase while the picker stands;
18683
18724
  * the pick commits the phrase strip + the `insertBlock('frame', { frameId
18684
18725
  * })` (the page-frame block's weak reference) in the caller's transact.
18685
- * The frames stand live over the doc's changes (the digest's subscription
18686
- * re-renders the list — the frame's add / remove / rename stands the
18687
- * list's own stand). The cancel keeps the command list on the phrase (no
18726
+ * The frames stand live over the doc's changes (the ref-cached
18727
+ * subscription re-renders the list over the frame's add / remove / rename
18728
+ * and the z-order's reorder — the unchanged frames' stand bails over the
18729
+ * cached list). The cancel keeps the command list on the phrase (no
18688
18730
  * write). The no-gate stand (unlike the database's bridge gate): the
18689
18731
  * frames are the doc's own canvas data — the picker stands always (the
18690
18732
  * empty stand is the "no frames yet" line).
@@ -18714,8 +18756,22 @@ function canvasFrames(rootChildren, blocks) {
18714
18756
  function FrameSlashPicker({ onCommit, onCancel }) {
18715
18757
  const { t } = useTranslation("slash");
18716
18758
  const { store } = useEditorContext();
18717
- const digest = useStore(store, (state) => JSON.stringify(canvasFrames(state.rootChildren, state.blocks)));
18718
- const frames = useMemo(() => canvasFrames(store.getState().rootChildren, store.getState().blocks), [digest, store]);
18759
+ const framesCacheRef = useRef(null);
18760
+ const frames = useStore(store, (state) => {
18761
+ const cached = framesCacheRef.current;
18762
+ if (cached !== null && cached.rootRef === state.rootChildren && cached.childRefs.length === state.rootChildren.length && state.rootChildren.every((childId, i) => cached.childRefs[i] === state.blocks[childId]) && cached.blockRefs.every((ref, i) => {
18763
+ const frame = cached.frames[i];
18764
+ return frame !== void 0 && ref === state.blocks[frame.id];
18765
+ })) return cached.frames;
18766
+ const next = canvasFrames(state.rootChildren, state.blocks);
18767
+ framesCacheRef.current = {
18768
+ rootRef: state.rootChildren,
18769
+ childRefs: state.rootChildren.map((childId) => state.blocks[childId]),
18770
+ frames: next,
18771
+ blockRefs: next.map((frame) => state.blocks[frame.id])
18772
+ };
18773
+ return next;
18774
+ });
18719
18775
  const [query, setQuery] = useState("");
18720
18776
  const searchRef = useRef(null);
18721
18777
  const nameOf = (frame) => frame.name !== "" ? frame.name : t("frame.fallback");
@@ -34189,7 +34245,7 @@ function createEditorStore(doc, rootId) {
34189
34245
  if (prev !== void 0 && fresh !== null && state.rootChildren.includes(id)) {
34190
34246
  const prevAttrs = "attrs" in prev ? prev.attrs : void 0;
34191
34247
  const freshAttrs = "attrs" in fresh ? fresh.attrs : void 0;
34192
- if (prevAttrs?.indent !== freshAttrs?.indent || prevAttrs?.list !== freshAttrs?.list) seqStructureAffected = true;
34248
+ if (prev.type !== fresh.type || prevAttrs?.indent !== freshAttrs?.indent || prevAttrs?.list !== freshAttrs?.list) seqStructureAffected = true;
34193
34249
  }
34194
34250
  }
34195
34251
  if (blocksChanged) patch.blocks = blocks;
@@ -34302,7 +34358,7 @@ const EditorContext = createContext(null);
34302
34358
  /** Read the per-instance editor context; throws outside an EditorProvider. */
34303
34359
  function useEditorContext() {
34304
34360
  const context = useContext(EditorContext);
34305
- if (context === null) throw new Error("Editor hooks must be used inside an EditorProvider.");
34361
+ if (context === null) throw new HookMisuseError("Editor hooks must be used inside an EditorProvider.");
34306
34362
  return context;
34307
34363
  }
34308
34364
  //#endregion
@@ -38096,9 +38152,8 @@ const RowItem = memo(function RowItem({ node, layoutSlide, isDragged, animated,
38096
38152
  * text-only change re-renders nothing here (the rows' props stand), so
38097
38153
  * the framer fibers and the rows' context consumers stand as well.
38098
38154
  *
38099
- * The Editor's page view IS this row layer (the former `MotionEditor`'s
38100
- * merge — the `./motion` subpath and the `MotionEditor` export stand
38101
- * removed; framer-motion is a required peer). The page view renders the
38155
+ * The Editor's page view IS this row layer (framer-motion — the required
38156
+ * peer; the base entry's row layer). The page view renders the
38102
38157
  * FLAT page sequence: every page block is its own row (a framer
38103
38158
  * `Reorder.Item`), the nesting is the block's `indent` attr (the row's
38104
38159
  * left padding steps per level; a list item's marker is a rendered label
@@ -1,6 +1,7 @@
1
1
  import { clsx } from "clsx";
2
2
  import { twMerge } from "tailwind-merge";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { normalizeHrefInput } from "docblocks-core";
4
5
  //#region src/shared/ui/cn.ts
5
6
  function cn(...inputs) {
6
7
  return twMerge(clsx(inputs));
@@ -68,6 +69,14 @@ var UnhandledValueError = class extends DocBlocksUiError {
68
69
  this.name = "UnhandledValueError";
69
70
  }
70
71
  };
72
+ /** A docblocks hook ran outside its provider (the editor context / the
73
+ * block context is absent — the consumer's mount shape is broken). */
74
+ var HookMisuseError = class extends DocBlocksUiError {
75
+ constructor(message) {
76
+ super(message);
77
+ this.name = "HookMisuseError";
78
+ }
79
+ };
71
80
  //#endregion
72
81
  //#region src/shared/ui/icons/ChevronLeft.tsx
73
82
  function ChevronLeft(props) {
@@ -212,11 +221,13 @@ const UNSAFE_DOWNLOAD_SCHEME = /^[\u0000-\u0020]*(javascript|vbscript)\s*:/i;
212
221
  * The download href gate (the defense in depth over the consumer's BlobStore
213
222
  * url): the executable schemes stand no anchor; the `data:` / the `blob:` / the
214
223
  * http(s) urls stand (the default store's data urls, the consumer's CDN).
215
- * The browser's leading-control trim is undone before the scheme check (the
216
- * link href's stand).
224
+ * The browser's WHATWG normalization stands the core's `normalizeHrefInput`
225
+ * (the link href's parity — the mid-string strip + the C0 / space trim),
226
+ * undone before the scheme check.
217
227
  */
218
228
  function isSafeDownloadHref(url) {
219
- return typeof url === "string" && !UNSAFE_DOWNLOAD_SCHEME.test(url);
229
+ if (typeof url !== "string") return false;
230
+ return !UNSAFE_DOWNLOAD_SCHEME.test(normalizeHrefInput(url));
220
231
  }
221
232
  /**
222
233
  * The exhaustiveness check for a `switch` over a closed union: `value` is
@@ -247,4 +258,4 @@ function isEmbeddablePdfUrl(url) {
247
258
  }
248
259
  }
249
260
  //#endregion
250
- export { cn as C, UnknownSlashCommandError as S, CanvasPasteError as _, clamp as a, PdfFetchError as b, stopPropagation as c, Plus as d, Minus as f, BlobNotFoundError as g, ChevronLeft as h, assertNever as i, X as l, ChevronRight as m, ZOOM_STEP as n, isSafeDownloadHref as o, LoaderCircle as p, isEmbeddablePdfUrl as r, preventDefault as s, ZOOM_MIN as t, TriangleAlert as u, DocBlocksUiError as v, UnhandledValueError as x, EditorProviderError as y };
261
+ export { UnknownSlashCommandError as C, UnhandledValueError as S, CanvasPasteError as _, clamp as a, HookMisuseError as b, stopPropagation as c, Plus as d, Minus as f, BlobNotFoundError as g, ChevronLeft as h, assertNever as i, X as l, ChevronRight as m, ZOOM_STEP as n, isSafeDownloadHref as o, LoaderCircle as p, isEmbeddablePdfUrl as r, preventDefault as s, ZOOM_MIN as t, TriangleAlert as u, DocBlocksUiError as v, cn as w, PdfFetchError as x, EditorProviderError as y };
@@ -1354,9 +1354,12 @@ interface EditorProviderCustomizationProps {
1354
1354
  /**
1355
1355
  * Optional embed sandbox policy: the iframe's `sandbox` value for a given
1356
1356
  * embed src; `null` stands no sandbox (a fully trusted embed). Without it
1357
- * the safe default applies (`DEFAULT_EMBED_SANDBOX` — interactive but no
1358
- * `allow-same-origin`, so the embedded content cannot read the parent's DOM
1359
- * / state). Grant `allow-same-origin` only for trusted origins.
1357
+ * the default applies (`DEFAULT_EMBED_SANDBOX` — interactive with
1358
+ * `allow-same-origin`: a real app's own storage / cookies stand, so the
1359
+ * app boots like in a plain tab). The posture consequence: a same-origin
1360
+ * URL reaches the parent over `window.parent` — restrict the untrusted
1361
+ * embeds over this policy (the opaque-origin stand — no
1362
+ * `allow-same-origin`).
1360
1363
  *
1361
1364
  * Like `pdfPreview`, the value is read per render into the provider
1362
1365
  * context: pass a stable reference. A nested provider that supplies none
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as PresenceCrypto, c as PresenceSharing, l as PresenceSharingMode, n as BlockRendererMap, o as PresenceIdentity, r as BlockRendererProps, s as PresencePeer, t as BlockRenderer } from "./index-G44JW36p.mjs";
2
- import { $ as Column, A as emptyFilter, B as DomainEvent, C as DatabaseTableProps, Ct as BlobStore, D as DatabaseTablePhase, Dt as RenderAttribute, E as useDatabaseTable, Et as AttributeTypePickerProps, F as BridgeColumn, G as ProtocolDescriptor, H as MutationReceipt, I as BridgeColumnAnnotation, J as SubscriptionObserver, K as ProtocolLimits, L as BridgeTableDescription, M as FilterBuilder, N as BatchOp, O as DatabaseTableRow, Ot as RenderAttributeProps, P as DatabaseBridge, Q as CellMap, R as BridgeValueInput, S as DatabaseTable, St as BlobRef, T as UseTableList, Tt as AttributeTypePicker, U as OperationStatus, V as MutationContext, W as ProtocolCapability, X as TableEnvelopeBase, Y as SubscriptionStatus, Z as TableEvent, _ as EditorMode, _t as BridgeErrorCode, a as EditorContextValue, at as PageSnapshot, b as MentionProvider, bt as toBridgeError, c as SelectionRef, ct as Revision, d as PdfPreviewProps, dt as SortInput, et as FilterConditionInput, f as CoverPresetSets, ft as TableDescription, g as AccessLevel, gt as BridgeError, h as DocTags, ht as BRIDGE_ERROR_CODES, i as EditorProviderProps, it as PageQuery, j as filterIsComplete, k as UseDatabaseTable, l as PresenceConfig, lt as RowPage, m as DocTag, mt as TableSnapshot, n as DEFAULT_EMBED_SANDBOX, nt as Id, o as EmbedSandboxPolicy, ot as QueryOperator, p as DocDescription, pt as TableRef, q as SubscriptionHandle, r as EditorProvider, rt as IsoInstant, s as SyncEmbedResolver, st as QuerySemantics, t as useEditorContext, tt as FilterInput, u as PdfPreview, ut as RowWire, v as MentionEntry, vt as isBridgeError, w as DatabaseTableView, wt as createMemoryBlobStore, x as useTableList, xt as BlobMeta, y as MentionInteractions, yt as isBridgeErrorCode, z as CellValueParse } from "./index-DLLPjOP5.mjs";
2
+ import { $ as Column, A as emptyFilter, B as DomainEvent, C as DatabaseTableProps, Ct as BlobStore, D as DatabaseTablePhase, Dt as RenderAttribute, E as useDatabaseTable, Et as AttributeTypePickerProps, F as BridgeColumn, G as ProtocolDescriptor, H as MutationReceipt, I as BridgeColumnAnnotation, J as SubscriptionObserver, K as ProtocolLimits, L as BridgeTableDescription, M as FilterBuilder, N as BatchOp, O as DatabaseTableRow, Ot as RenderAttributeProps, P as DatabaseBridge, Q as CellMap, R as BridgeValueInput, S as DatabaseTable, St as BlobRef, T as UseTableList, Tt as AttributeTypePicker, U as OperationStatus, V as MutationContext, W as ProtocolCapability, X as TableEnvelopeBase, Y as SubscriptionStatus, Z as TableEvent, _ as EditorMode, _t as BridgeErrorCode, a as EditorContextValue, at as PageSnapshot, b as MentionProvider, bt as toBridgeError, c as SelectionRef, ct as Revision, d as PdfPreviewProps, dt as SortInput, et as FilterConditionInput, f as CoverPresetSets, ft as TableDescription, g as AccessLevel, gt as BridgeError, h as DocTags, ht as BRIDGE_ERROR_CODES, i as EditorProviderProps, it as PageQuery, j as filterIsComplete, k as UseDatabaseTable, l as PresenceConfig, lt as RowPage, m as DocTag, mt as TableSnapshot, n as DEFAULT_EMBED_SANDBOX, nt as Id, o as EmbedSandboxPolicy, ot as QueryOperator, p as DocDescription, pt as TableRef, q as SubscriptionHandle, r as EditorProvider, rt as IsoInstant, s as SyncEmbedResolver, st as QuerySemantics, t as useEditorContext, tt as FilterInput, u as PdfPreview, ut as RowWire, v as MentionEntry, vt as isBridgeError, w as DatabaseTableView, wt as createMemoryBlobStore, x as useTableList, xt as BlobMeta, y as MentionInteractions, yt as isBridgeErrorCode, z as CellValueParse } from "./index-sNhMaFHp.mjs";
3
3
  import * as React$1 from "react";
4
4
  import { Component, ComponentType, ErrorInfo, ReactNode } from "react";
5
5
  import { VariantProps } from "class-variance-authority";
@@ -280,6 +280,11 @@ declare class UnknownSlashCommandError extends DocBlocksUiError {
280
280
  declare class UnhandledValueError extends DocBlocksUiError {
281
281
  constructor(message: string);
282
282
  }
283
+ /** A docblocks hook ran outside its provider (the editor context / the
284
+ * block context is absent — the consumer's mount shape is broken). */
285
+ declare class HookMisuseError extends DocBlocksUiError {
286
+ constructor(message: string);
287
+ }
283
288
  //#endregion
284
289
  //#region src/hooks.d.ts
285
290
  /** The headless document owned by the nearest EditorProvider. */
@@ -436,7 +441,7 @@ declare function AlertDescription({ className, ...props }: React$1.ComponentProp
436
441
  //#endregion
437
442
  //#region src/shared/ui/Badge.d.ts
438
443
  declare const badgeVariants: (props?: ({
439
- variant?: "default" | "custom" | "secondary" | "destructive" | "outline" | null | undefined;
444
+ variant?: "default" | "destructive" | "outline" | "secondary" | "custom" | null | undefined;
440
445
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
441
446
  declare function Badge({ className, variant, asChild, ...props }: React$1.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
442
447
  asChild?: boolean;
@@ -447,7 +452,7 @@ declare function BareSelect({ className, children, ...props }: React$1.Component
447
452
  //#endregion
448
453
  //#region src/shared/ui/Button.d.ts
449
454
  declare const buttonVariants: (props?: ({
450
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
455
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
451
456
  size?: "default" | "icon" | "sm" | "lg" | "xl" | null | undefined;
452
457
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
453
458
  declare function Button({ className, variant, size, asChild, type, ...props }: React$1.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
@@ -583,4 +588,4 @@ declare function TooltipContent({ className, sideOffset, children, ...props }: R
583
588
  //#region src/shared/ui/cn.d.ts
584
589
  declare function cn(...inputs: ClassValue[]): string;
585
590
  //#endregion
586
- export { type AccessLevel, Alert, AlertDescription, AlertTitle, type AttributeType, type AttributeTypePicker, type AttributeTypePickerProps, BASELINE_CAPABILITIES, BRIDGE_ERROR_CODES, Badge, BareSelect, type BatchOp, type BlobMeta, BlobNotFoundError, type BlobRef, type BlobStore, type BlockRenderer, type BlockRendererMap, type BlockRendererProps, type BridgeColumn, type BridgeColumnAnnotation, BridgeError, type BridgeErrorCode, type BridgeTableDescription, type BridgeValueInput, Button, CanvasPasteError, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CellMap, type CellValueParse, Checkbox, type Column, type CoverPresetSets, DEFAULT_EMBED_SANDBOX, type DatabaseBridge, DatabaseTable, type DatabaseTablePhase, type DatabaseTableProps, type DatabaseTableRow, type DatabaseTableView, DocBlocksUiError, type DocDescription, DocHeader, type DocHeaderAvatarContentContext, type DocTag, type DocTags, DocblocksI18nProvider, type DocblocksI18nProviderProps, type DomainEvent, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Editor, type EditorContextValue, EditorErrorBoundary, type EditorErrorBoundaryProps, type EditorMode, EditorProvider, EditorProviderError, type EditorProviderProps, type EditorView, type EmbedSandboxPolicy, FORMAT_PALETTE, FilterBuilder, type FilterConditionInput, type FilterInput, type FormatMark, type Id, ImportDocumentError, Input, type IsoInstant, Label, MONO_FONT_STACK, type MentionEntry, type MentionInteractions, type MentionMark, type MentionProvider, type MutationContext, type MutationReceipt, type OperationStatus, PROTOCOL_VERSION, type PageQuery, type PageSnapshot, PdfFetchError, type PdfPreview, type PdfPreviewProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, type PresenceConfig, type PresenceCrypto, type PresenceIdentity, type PresencePeer, type PresenceSharing, type PresenceSharingMode, type ProtocolCapability, type ProtocolDescriptor, type ProtocolLimits, type QueryOperator, type QuerySemantics, type RenderAttribute, type RenderAttributeProps, type Revision, type RowPage, type RowWire, SHAPE_FONT_OPTIONS, SHAPE_FONT_STACKS, ScrollArea, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SelectionRef, Separator, Skeleton, type SortInput, type SubscriptionHandle, type SubscriptionObserver, type SubscriptionStatus, type SyncEmbedRef, type SyncEmbedResolver, TEXT_TYPES, type TableDescription, type TableEnvelopeBase, type TableEvent, type TableRef, type TableSnapshot, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TypedAttributeValue, UI_FONT_ID, UI_FONT_STACK, UnhandledValueError, UnknownSlashCommandError, type UseDatabaseTable, type UseTableList, badgeVariants, buttonVariants, cellValueEqual, cn, columnAnnotation, conditionMatches, createMemoryBlobStore, emptyFilter, filterIsComplete, importDocument, isBridgeError, isBridgeErrorCode, isDatabaseBridge, markToggleAction, newMutationContext, parseCellValue, renderRuns, toBridgeError, useBlock, useCoverAverageColor, useDatabaseTable, useDoc, useEditorContext, useMeta, usePresence, usePresenceSharing, useSelection, useSelectionView, useTableList, useText, validateProtocolDescriptor };
591
+ export { type AccessLevel, Alert, AlertDescription, AlertTitle, type AttributeType, type AttributeTypePicker, type AttributeTypePickerProps, BASELINE_CAPABILITIES, BRIDGE_ERROR_CODES, Badge, BareSelect, type BatchOp, type BlobMeta, BlobNotFoundError, type BlobRef, type BlobStore, type BlockRenderer, type BlockRendererMap, type BlockRendererProps, type BridgeColumn, type BridgeColumnAnnotation, BridgeError, type BridgeErrorCode, type BridgeTableDescription, type BridgeValueInput, Button, CanvasPasteError, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CellMap, type CellValueParse, Checkbox, type Column, type CoverPresetSets, DEFAULT_EMBED_SANDBOX, type DatabaseBridge, DatabaseTable, type DatabaseTablePhase, type DatabaseTableProps, type DatabaseTableRow, type DatabaseTableView, DocBlocksUiError, type DocDescription, DocHeader, type DocHeaderAvatarContentContext, type DocTag, type DocTags, DocblocksI18nProvider, type DocblocksI18nProviderProps, type DomainEvent, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Editor, type EditorContextValue, EditorErrorBoundary, type EditorErrorBoundaryProps, type EditorMode, EditorProvider, EditorProviderError, type EditorProviderProps, type EditorView, type EmbedSandboxPolicy, FORMAT_PALETTE, FilterBuilder, type FilterConditionInput, type FilterInput, type FormatMark, HookMisuseError, type Id, ImportDocumentError, Input, type IsoInstant, Label, MONO_FONT_STACK, type MentionEntry, type MentionInteractions, type MentionMark, type MentionProvider, type MutationContext, type MutationReceipt, type OperationStatus, PROTOCOL_VERSION, type PageQuery, type PageSnapshot, PdfFetchError, type PdfPreview, type PdfPreviewProps, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, type PresenceConfig, type PresenceCrypto, type PresenceIdentity, type PresencePeer, type PresenceSharing, type PresenceSharingMode, type ProtocolCapability, type ProtocolDescriptor, type ProtocolLimits, type QueryOperator, type QuerySemantics, type RenderAttribute, type RenderAttributeProps, type Revision, type RowPage, type RowWire, SHAPE_FONT_OPTIONS, SHAPE_FONT_STACKS, ScrollArea, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, type SelectionRef, Separator, Skeleton, type SortInput, type SubscriptionHandle, type SubscriptionObserver, type SubscriptionStatus, type SyncEmbedRef, type SyncEmbedResolver, TEXT_TYPES, type TableDescription, type TableEnvelopeBase, type TableEvent, type TableRef, type TableSnapshot, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type TypedAttributeValue, UI_FONT_ID, UI_FONT_STACK, UnhandledValueError, UnknownSlashCommandError, type UseDatabaseTable, type UseTableList, badgeVariants, buttonVariants, cellValueEqual, cn, columnAnnotation, conditionMatches, createMemoryBlobStore, emptyFilter, filterIsComplete, importDocument, isBridgeError, isBridgeErrorCode, isDatabaseBridge, markToggleAction, newMutationContext, parseCellValue, renderRuns, toBridgeError, useBlock, useCoverAverageColor, useDatabaseTable, useDoc, useEditorContext, useMeta, usePresence, usePresenceSharing, useSelection, useSelectionView, useTableList, useText, validateProtocolDescriptor };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { C as cn, S as UnknownSlashCommandError, _ as CanvasPasteError, b as PdfFetchError, g as BlobNotFoundError, s as preventDefault, v as DocBlocksUiError, x as UnhandledValueError, y as EditorProviderError } from "./constants-DWJbJpt5.mjs";
2
- import { $ as DropdownMenuShortcut, $t as DocblocksI18nProvider, A as Select, B as Label, Bt as CardFooter, C as cellValueEqual, Ct as isBridgeError, D as filterIsComplete, Dt as parseCellValue, E as emptyFilter, Et as conditionMatches, F as SelectScrollDownButton, Ft as Skeleton, G as DropdownMenuContent, Gt as useBlock, H as Input, Ht as CardTitle, I as SelectScrollUpButton, It as Card, J as DropdownMenuLabel, Jt as usePresence, K as DropdownMenuGroup, Kt as useDoc, L as SelectSeparator, Lt as CardAction, M as SelectGroup, Mt as Eye, N as SelectItem, O as SegmentSelector, Ot as TEXT_TYPES, P as SelectLabel, Pt as BookOpen, Q as DropdownMenuSeparator, Qt as useText, R as SelectTrigger, Rt as CardContent, S as useDatabaseTable, St as BridgeError, T as FilterBuilder, Tt as toBridgeError, U as DropdownMenu, Ut as Badge, V as InlineEditInput, Vt as CardHeader, W as DropdownMenuCheckboxItem, Wt as badgeVariants, X as DropdownMenuRadioGroup, Xt as useSelection, Y as DropdownMenuPortal, Yt as usePresenceSharing, Z as DropdownMenuRadioItem, Zt as useSelectionView, _ as mapFrontmatter, _t as BASELINE_CAPABILITIES, a as DEFAULT_EMBED_SANDBOX, at as Popover, b as renderRuns, bt as validateProtocolDescriptor, c as SHAPE_FONT_OPTIONS, ct as PopoverDescription, d as FORMAT_PALETTE, dt as PopoverTrigger, en as createMemoryBlobStore, et as DropdownMenuSub, ft as Checkbox, g as parseFrontmatter, gt as AlertTitle, h as mdToBlocks, ht as AlertDescription, i as useEditorContext, it as Separator, j as SelectContent, jt as Pen, k as ScrollArea, kt as columnAnnotation, l as SHAPE_FONT_STACKS, lt as PopoverHeader, m as insertNative, mt as Alert, n as useCoverAverageColor, nn as Button, nt as DropdownMenuSubTrigger, ot as PopoverAnchor, p as htmlToBlocks, pt as BareSelect, q as DropdownMenuItem, qt as useMeta, r as EditorProvider, rn as buttonVariants, rt as DropdownMenuTrigger, st as PopoverContent, t as Editor, tn as EditorErrorBoundary, tt as DropdownMenuSubContent, ut as PopoverTitle, v as markToggleAction, vt as PROTOCOL_VERSION, w as newMutationContext, wt as isBridgeErrorCode, x as GridBody, xt as BRIDGE_ERROR_CODES, yt as isDatabaseBridge, z as SelectValue, zt as CardDescription } from "./Editor-DQg2tfne.mjs";
1
+ 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-D_3p65rk.mjs";
2
+ import { $ as DropdownMenuShortcut, $t as DocblocksI18nProvider, A as Select, B as Label, Bt as CardFooter, C as cellValueEqual, Ct as isBridgeError, D as filterIsComplete, Dt as parseCellValue, E as emptyFilter, Et as conditionMatches, F as SelectScrollDownButton, Ft as Skeleton, G as DropdownMenuContent, Gt as useBlock, H as Input, Ht as CardTitle, I as SelectScrollUpButton, It as Card, J as DropdownMenuLabel, Jt as usePresence, K as DropdownMenuGroup, Kt as useDoc, L as SelectSeparator, Lt as CardAction, M as SelectGroup, Mt as Eye, N as SelectItem, O as SegmentSelector, Ot as TEXT_TYPES, P as SelectLabel, Pt as BookOpen, Q as DropdownMenuSeparator, Qt as useText, R as SelectTrigger, Rt as CardContent, S as useDatabaseTable, St as BridgeError, T as FilterBuilder, Tt as toBridgeError, U as DropdownMenu, Ut as Badge, V as InlineEditInput, Vt as CardHeader, W as DropdownMenuCheckboxItem, Wt as badgeVariants, X as DropdownMenuRadioGroup, Xt as useSelection, Y as DropdownMenuPortal, Yt as usePresenceSharing, Z as DropdownMenuRadioItem, Zt as useSelectionView, _ as mapFrontmatter, _t as BASELINE_CAPABILITIES, a as DEFAULT_EMBED_SANDBOX, at as Popover, b as renderRuns, bt as validateProtocolDescriptor, c as SHAPE_FONT_OPTIONS, ct as PopoverDescription, d as FORMAT_PALETTE, dt as PopoverTrigger, en as createMemoryBlobStore, et as DropdownMenuSub, ft as Checkbox, g as parseFrontmatter, gt as AlertTitle, h as mdToBlocks, ht as AlertDescription, i as useEditorContext, it as Separator, j as SelectContent, jt as Pen, k as ScrollArea, kt as columnAnnotation, l as SHAPE_FONT_STACKS, lt as PopoverHeader, m as insertNative, mt as Alert, n as useCoverAverageColor, nn as Button, nt as DropdownMenuSubTrigger, ot as PopoverAnchor, p as htmlToBlocks, pt as BareSelect, q as DropdownMenuItem, qt as useMeta, r as EditorProvider, rn as buttonVariants, rt as DropdownMenuTrigger, st as PopoverContent, t as Editor, tn as EditorErrorBoundary, tt as DropdownMenuSubContent, ut as PopoverTitle, v as markToggleAction, vt as PROTOCOL_VERSION, w as newMutationContext, wt as isBridgeErrorCode, x as GridBody, xt as BRIDGE_ERROR_CODES, yt as isDatabaseBridge, z as SelectValue, zt as CardDescription } from "./Editor-DCzrR1FJ.mjs";
3
3
  import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { useTranslation } from "react-i18next";
5
5
  import { cva } from "class-variance-authority";
@@ -822,4 +822,4 @@ const UI_FONT_STACK = "'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif
822
822
  */
823
823
  const MONO_FONT_STACK = "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
824
824
  //#endregion
825
- export { Alert, AlertDescription, AlertTitle, BASELINE_CAPABILITIES, BRIDGE_ERROR_CODES, Badge, BareSelect, BlobNotFoundError, BridgeError, Button, CanvasPasteError, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DEFAULT_EMBED_SANDBOX, DatabaseTable, DocBlocksUiError, DocHeader, DocblocksI18nProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Editor, EditorErrorBoundary, EditorProvider, EditorProviderError, FORMAT_PALETTE, FilterBuilder, ImportDocumentError, Input, Label, MONO_FONT_STACK, PROTOCOL_VERSION, PdfFetchError, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, SHAPE_FONT_OPTIONS, SHAPE_FONT_STACKS, ScrollArea, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, TEXT_TYPES, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UI_FONT_ID, UI_FONT_STACK, UnhandledValueError, UnknownSlashCommandError, badgeVariants, buttonVariants, cellValueEqual, cn, columnAnnotation, conditionMatches, createMemoryBlobStore, emptyFilter, filterIsComplete, importDocument, isBridgeError, isBridgeErrorCode, isDatabaseBridge, markToggleAction, newMutationContext, parseCellValue, renderRuns, toBridgeError, useBlock, useCoverAverageColor, useDatabaseTable, useDoc, useEditorContext, useMeta, usePresence, usePresenceSharing, useSelection, useSelectionView, useTableList, useText, validateProtocolDescriptor };
825
+ export { Alert, AlertDescription, AlertTitle, BASELINE_CAPABILITIES, BRIDGE_ERROR_CODES, Badge, BareSelect, BlobNotFoundError, BridgeError, Button, CanvasPasteError, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DEFAULT_EMBED_SANDBOX, DatabaseTable, DocBlocksUiError, DocHeader, DocblocksI18nProvider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Editor, EditorErrorBoundary, EditorProvider, EditorProviderError, FORMAT_PALETTE, FilterBuilder, HookMisuseError, ImportDocumentError, Input, Label, MONO_FONT_STACK, PROTOCOL_VERSION, PdfFetchError, Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, SHAPE_FONT_OPTIONS, SHAPE_FONT_STACKS, ScrollArea, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Skeleton, TEXT_TYPES, Tabs, TabsContent, TabsList, TabsTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UI_FONT_ID, UI_FONT_STACK, UnhandledValueError, UnknownSlashCommandError, badgeVariants, buttonVariants, cellValueEqual, cn, columnAnnotation, conditionMatches, createMemoryBlobStore, emptyFilter, filterIsComplete, importDocument, isBridgeError, isBridgeErrorCode, isDatabaseBridge, markToggleAction, newMutationContext, parseCellValue, renderRuns, toBridgeError, useBlock, useCoverAverageColor, useDatabaseTable, useDoc, useEditorContext, useMeta, usePresence, usePresenceSharing, useSelection, useSelectionView, useTableList, useText, validateProtocolDescriptor };
@@ -1,5 +1,5 @@
1
- import { a as clamp, d as Plus, f as Minus, p as LoaderCircle, s as preventDefault, u as TriangleAlert } from "../constants-DWJbJpt5.mjs";
2
- import { At as RotateCcw, Ft as Skeleton, Mt as Eye, Nt as CodeXml, O as SegmentSelector, f as textOf, gt as AlertTitle, ht as AlertDescription, i as useEditorContext, mt as Alert, nn as Button, o as childrenSlot, s as CodeHeader, u as TextBlock, y as INLINE_CODE_CLASS } from "../Editor-DQg2tfne.mjs";
1
+ import { a as clamp, d as Plus, f as Minus, p as LoaderCircle, s as preventDefault, u as TriangleAlert } from "../constants-D_3p65rk.mjs";
2
+ import { At as RotateCcw, Ft as Skeleton, Mt as Eye, Nt as CodeXml, O as SegmentSelector, f as textOf, gt as AlertTitle, ht as AlertDescription, i as useEditorContext, mt as Alert, nn as Button, o as childrenSlot, s as CodeHeader, u as TextBlock, y as INLINE_CODE_CLASS } from "../Editor-DCzrR1FJ.mjs";
3
3
  import { t as Maximize } from "../Maximize-BBHnCDWL.mjs";
4
4
  import { useEffect, useRef, useState } from "react";
5
5
  import { useTranslation } from "react-i18next";
@@ -1,4 +1,4 @@
1
- import { d as PdfPreviewProps } from "../index-DLLPjOP5.mjs";
1
+ import { d as PdfPreviewProps } from "../index-sNhMaFHp.mjs";
2
2
  //#region src/pdf/PdfFirstPage.d.ts
3
3
  declare function PdfFirstPage({ id, blockType, url, name }: PdfPreviewProps): import("react").JSX.Element;
4
4
  //#endregion
@@ -1,4 +1,4 @@
1
- import { C as cn, a as clamp, b as PdfFetchError, d as Plus, f as Minus, h as ChevronLeft, l as X, m as ChevronRight, n as ZOOM_STEP, o as isSafeDownloadHref, p as LoaderCircle, r as isEmbeddablePdfUrl, t as ZOOM_MIN, u as TriangleAlert } from "../constants-DWJbJpt5.mjs";
1
+ import { a as clamp, d as Plus, f as Minus, h as ChevronLeft, l as X, m as ChevronRight, n as ZOOM_STEP, o as isSafeDownloadHref, p as LoaderCircle, r as isEmbeddablePdfUrl, t as ZOOM_MIN, u as TriangleAlert, w as cn, x as PdfFetchError } from "../constants-D_3p65rk.mjs";
2
2
  import { t as Maximize } from "../Maximize-BBHnCDWL.mjs";
3
3
  import { useCallback, useEffect, useRef, useState } from "react";
4
4
  import { useTranslation } from "react-i18next";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docblocks-react-ui",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "React rendering + editing layer for docblocks: hooks, block renderers, caret/selection, keyboard, clipboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,6 +12,8 @@
12
12
  ],
13
13
  "sideEffects": [
14
14
  "**/*.css",
15
+ "dist/*.mjs",
16
+ "dist/mermaid/index.mjs",
15
17
  "dist/pdf/index.mjs"
16
18
  ],
17
19
  "exports": {
@@ -34,7 +36,7 @@
34
36
  "access": "public"
35
37
  },
36
38
  "peerDependencies": {
37
- "docblocks-core": "^0.8.0",
39
+ "docblocks-core": "^0.8.1",
38
40
  "framer-motion": "^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
39
41
  "mermaid": "^12.0.0",
40
42
  "pdfjs-dist": "^6.0.0",