docblocks-react-ui 0.24.1 → 0.26.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 +48 -0
- package/README.md +56 -25
- package/dist/{Editor-Du_hrZ3E.mjs → Editor-DsnFHj1x.mjs} +325 -123
- package/dist/{index-CE8wKsue.d.mts → index-DAc-REs_.d.mts} +54 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +15 -2
- package/dist/mermaid/index.mjs +1 -1
- package/dist/pdf/index.d.mts +1 -1
- package/dist/styles.css +33 -14
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# docblocks-react-ui
|
|
2
2
|
|
|
3
|
+
## 0.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 78e986a: Every page row now stands `data-block-id` and `data-block-type` on its own
|
|
8
|
+
element (`data-slot="docblocks/row"`), in addition to the block's wrapper —
|
|
9
|
+
the block's DOM anchor for navigating to it by id (a table of contents
|
|
10
|
+
scrolling to a heading). The stand holds over the edit's, the view's, and
|
|
11
|
+
the published's renders. The row's anchor is not a block element: the
|
|
12
|
+
selection mapping and the remount's re-seat resolve the block from the
|
|
13
|
+
wrapper (the row's zone — e.g. a form control's focus residue — stands no
|
|
14
|
+
blocks selection over the block).
|
|
15
|
+
|
|
16
|
+
## 0.25.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- b113562: The external-form database grid's header row is resizable: dragging the strip
|
|
21
|
+
over its lower edge sets the height of every header cell at once, with the
|
|
22
|
+
live preview and one commit on the release. The height lands in the block's
|
|
23
|
+
`headerHeight` attr (document data — undoable, synced, restored on reload) or,
|
|
24
|
+
over the `EditorProvider.databaseTableSection` contract, in the consumer's
|
|
25
|
+
per-table value (one height over every block referencing the table; the
|
|
26
|
+
block's own attr wins). The auto height is the drag's floor and read-only
|
|
27
|
+
modes render no handle. The standalone `DatabaseTable` takes the same
|
|
28
|
+
`tableSection` contract.
|
|
29
|
+
- 58dfce7: The published stand's selection policy is the consumer's: the new
|
|
30
|
+
`publishedCopyable` provider prop makes the published snapshot's page text
|
|
31
|
+
selectable and copyable — the `view` mode's parity (the editor's copy
|
|
32
|
+
payload: marks, `@label` mentions, cross-block ranges, the table's grid
|
|
33
|
+
serialization). The default keeps the reader's selection and copy off; the
|
|
34
|
+
canvas world keeps the no-select stand either way.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 4d8da14: The floating format toolbar never paints over the consumer's chrome above the
|
|
39
|
+
editor: a selection the DOM carries no rect for (the canvas/page switch
|
|
40
|
+
re-seats it over a re-mounted page) keeps the bar's last position instead of
|
|
41
|
+
anchoring off an empty rect, and the bar's own stand never lands above the
|
|
42
|
+
editor root's upper edge.
|
|
43
|
+
- 86d46fa: The column seam at a merged region's interior boundary stands and resizes
|
|
44
|
+
its covered column: a drag over the seam of a column a `colspan` region
|
|
45
|
+
covers commits that column's width (the region's width follows the
|
|
46
|
+
columns' sum). The region's reorder handles stay hidden (the core's
|
|
47
|
+
move/insert guards stand).
|
|
48
|
+
- Updated dependencies [b113562]
|
|
49
|
+
- docblocks-core@0.10.0
|
|
50
|
+
|
|
3
51
|
## 0.24.1
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -97,25 +97,27 @@ 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
|
-
| `
|
|
109
|
-
| `
|
|
110
|
-
| `
|
|
111
|
-
| `
|
|
112
|
-
| `
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
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
|
+
| `databaseTableSection?` | The per-table section settings: `getHeaderHeight(tableId)` + `setHeaderHeight(tableId, height)` (see Database below). The grid reads the header-row height per table; a block's own attr wins over it. |
|
|
109
|
+
| `syncEmbedResolver?` | `(ref) => Doc \| null` — resolves a `sync-embed` block's ref to the master doc (see below). |
|
|
110
|
+
| `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. |
|
|
111
|
+
| `pdfPreview?` | A first-page preview component for PDF file blocks (and legacy PDF image blocks). |
|
|
112
|
+
| `mentionProvider?` | The `@` mention picker's search catalog (see below). |
|
|
113
|
+
| `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). |
|
|
114
|
+
| `rootBlockId?` | Render the entry list of this block instead of the document root (the subtree view). Must not change after mount. |
|
|
115
|
+
| `commandPalettePlaceholder?` | The empty-block hint override; the default is localized (en/ru). |
|
|
116
|
+
| `accessLevel?` | The consumer's user access level (default `editor`): `viewer` forces the `published` mode (the current state is never rendered to a reader). |
|
|
117
|
+
| `mode?` | The document mode (default `edit`): `view` is a read-only live document; `published` renders the `publishedDoc` snapshot read-only. |
|
|
118
|
+
| `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. |
|
|
119
|
+
| `publishedCopyable?` | The published stand's selection policy (default `false`): `true` makes the published snapshot's page text selectable and copyable — the `view` mode's parity (the editor's copy payload: marks, `@label` mentions, cross-block ranges, the table's grid serialization); the canvas world keeps the no-select stand. The consumer decides per reader. Session state — never document data. |
|
|
120
|
+
| `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
121
|
|
|
120
122
|
Two rules for the optional props:
|
|
121
123
|
|
|
@@ -210,10 +212,14 @@ document data, never on the wire):
|
|
|
210
212
|
ranges); a native table block copies as a spreadsheet's grid (the
|
|
211
213
|
`text/html` flavor is a real `<table>`, the `text/plain` one the TSV —
|
|
212
214
|
the block's own selection copies the whole table). The `published`
|
|
213
|
-
mode stands no selection and no copy (the reader gets the
|
|
214
|
-
only)
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
mode stands no selection and no copy by default (the reader gets the
|
|
216
|
+
rendered page only); the `publishedCopyable` provider prop lifts the
|
|
217
|
+
block per reader — the published page text then stands selectable and
|
|
218
|
+
copyable over the same editor payload as `view`. The canvas world keeps
|
|
219
|
+
the no-select stand in every mode. The editor root carries the resolved
|
|
220
|
+
mode over the `data-mode` attribute (the styling hook; `data-readonly`
|
|
221
|
+
marks both read-only modes, `data-copyable` the copyable published
|
|
222
|
+
stand).
|
|
217
223
|
- Publishing is a consumer action: snapshot the doc state (`doc.encode()`
|
|
218
224
|
or `doc.toJSON()`), persist it where the reader loads it from, and
|
|
219
225
|
hydrate it (`loadDoc` / `fromJSON`) — for the `editor`'s `published`
|
|
@@ -597,6 +603,19 @@ and reorders them by dragging their grips or pressing ArrowUp/ArrowDown on a
|
|
|
597
603
|
focused grip. Header drag and the popover share one full column order, and
|
|
598
604
|
visible column widths follow the moved column.
|
|
599
605
|
|
|
606
|
+
The header row's **height** is adjustable: dragging the lower edge of the
|
|
607
|
+
header row (the full-width strip over its bottom border) sets the height of
|
|
608
|
+
every header cell at once, with the live preview and one commit on the
|
|
609
|
+
release. The drag cannot go below the header's own auto height (the column
|
|
610
|
+
names never render clipped) and stops at a 600 px ceiling. The height has
|
|
611
|
+
two persistence levels: the block's `headerHeight` attr (document data —
|
|
612
|
+
survives the reload, reaches the other participants over the wire, undoes),
|
|
613
|
+
and the table-level value of the consumer's tables section (the
|
|
614
|
+
`databaseTableSection` provider prop, see the props table). A block's own
|
|
615
|
+
attr wins over the table-level value; a block without one follows the table
|
|
616
|
+
and falls back to the auto height. Read-only modes apply the height and
|
|
617
|
+
render no handle.
|
|
618
|
+
|
|
600
619
|
The grid's **Filter** control edits a recursive and/or condition tree: one
|
|
601
620
|
row per condition (the field / the operator / the value over the column's
|
|
602
621
|
annotation, a single line), the nested groups over bordered cards, and the
|
|
@@ -640,7 +659,7 @@ function TablesSection({ bridge }: { bridge: DatabaseBridge }) {
|
|
|
640
659
|
```
|
|
641
660
|
|
|
642
661
|
- `DatabaseTable({ bridge, tableId, readOnly?, view?, onViewChange?,
|
|
643
|
-
className? })` —
|
|
662
|
+
className?, tableSection? })` —
|
|
644
663
|
the live grid over the bridge's table id (the same data stand as the
|
|
645
664
|
document block: the schema, the rows, the live events, the optimistic
|
|
646
665
|
cell layer). The view's settings (`filter`, `columnOrder`,
|
|
@@ -648,7 +667,13 @@ className? })` —
|
|
|
648
667
|
the optional `view` prop at mount); `onViewChange(patch)` receives one
|
|
649
668
|
patch per change for the consumer's persistence (the controlled mode
|
|
650
669
|
stands absent — the state is never external). `readOnly` gates the
|
|
651
|
-
editing's paths (the read-only block's parity).
|
|
670
|
+
editing's paths (the read-only block's parity). `tableSection` is the
|
|
671
|
+
same per-table contract the `EditorProvider` takes: the header row's
|
|
672
|
+
height comes from `getHeaderHeight(tableId)` and the grid's drag commits
|
|
673
|
+
it back over `setHeaderHeight(tableId, height)`, so the section's value and
|
|
674
|
+
the document blocks over the same table stand one height. Without the
|
|
675
|
+
contract the grid renders no header handle (the header keeps the auto
|
|
676
|
+
height). The standalone's grid
|
|
652
677
|
stands no table-name display — the consumer's own visual element (the
|
|
653
678
|
section's list / the heading) stands the name; the document block's
|
|
654
679
|
grid keeps the live name + the rename over it. The sizing's stand is
|
|
@@ -1144,3 +1169,9 @@ Structural styling hooks are `data-slot` attributes (`docblocks/editor`,
|
|
|
1144
1169
|
`data-block-type`, `data-list`, `data-depth`, and the per-state attributes — see
|
|
1145
1170
|
the stylesheet header for the full list. User content styling (run color /
|
|
1146
1171
|
highlight) is document data, not theme, and is applied inline.
|
|
1172
|
+
|
|
1173
|
+
Block anchors: the block's wrapper (and its inner editable) stand
|
|
1174
|
+
`data-block-id` + `data-block-type`, and every page row stands the same
|
|
1175
|
+
attributes over its own element (`data-slot="docblocks/row"`) — the block's
|
|
1176
|
+
DOM anchor for navigating to it by id (a table of contents scrolling to a
|
|
1177
|
+
heading).
|