docblocks-react-ui 0.4.6 → 0.5.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 +67 -0
- package/README.md +57 -5
- package/dist/{Editor-DRvBv_X-.mjs → Editor-BBbAwxWT.mjs} +2398 -1483
- package/dist/{index-CZEO5s2i.d.mts → index-DtVBbaEs.d.mts} +4 -0
- package/dist/index.d.mts +32 -4
- package/dist/index.mjs +2 -2
- package/dist/mermaid/index.mjs +1 -1
- package/dist/pdf/index.d.mts +1 -1
- package/dist/styles.css +72 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# docblocks-react-ui
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3d0b793: Add a database column manager for restoring hidden columns and reordering the full column list by mouse or keyboard while preserving visible column widths. Keep a newly inserted row visible with a themed orange outline when it does not match the active filter until editing loses focus.
|
|
8
|
+
- ca80cd1: Rebuild the database filter menu over the library's field style: the
|
|
9
|
+
condition's field / operator / value stand a single line over styled
|
|
10
|
+
controls in a widened popover, the conditions and the nested group cards
|
|
11
|
+
are bound by the group's left connector line, the AND/OR logic's labels
|
|
12
|
+
stand the UI's locale and the active pill takes the prominent `primary`
|
|
13
|
+
token's fill (the white's stand over the neutral's dark theme), and the
|
|
14
|
+
footer's apply/clear stand over a separator line. The grid toolbar's undo/redo/columns/filter buttons
|
|
15
|
+
stand the standard toolbar height and rounding, and the standalone
|
|
16
|
+
`DatabaseTable` renders no table name (the consumer's own visual element
|
|
17
|
+
stands the name — the document block's grid keeps the live name and the
|
|
18
|
+
rename).
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 87a2cc9: Preserve thin cell boundaries in native table drag previews with or without a cell background, and keep the dragged handle aligned with the moving row or column by removing its positional animation lag.
|
|
23
|
+
|
|
24
|
+
## 0.4.7
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- e065e49: The `DocblocksI18nProvider` (exported from the package entry) accepts an
|
|
29
|
+
optional `locale` prop: the controlled mode for server-rendered
|
|
30
|
+
consumers, where the `<html lang>` read is unavailable on the server and
|
|
31
|
+
the first client render would take a different language (the hydration
|
|
32
|
+
mismatch). The passed locale is normalized over the existing rules
|
|
33
|
+
(`ru*` → `ru`, `en*` / unknown / empty → `en`), the provider creates its
|
|
34
|
+
own synchronously initialized `i18next` instance keyed by the normalized
|
|
35
|
+
value (a locale change selects the new instance and re-renders the
|
|
36
|
+
subtree), and a nested provider without a `locale` inherits the outer's
|
|
37
|
+
instance. The controlled mode never mutates the legacy attribute-driven
|
|
38
|
+
instance and never touches the consumer's global `i18next`, so
|
|
39
|
+
concurrent subtrees over different locales stay isolated; the locale is
|
|
40
|
+
UI state only. Outside a controlled provider, the attribute-driven
|
|
41
|
+
behavior is unchanged.
|
|
42
|
+
- 3223722: The page view now edits over one shared `contenteditable` surface (the
|
|
43
|
+
page's container), with each text block's inner a nested editable: the
|
|
44
|
+
native selection crosses block boundaries in every engine, and the
|
|
45
|
+
block's handlers receive the container-level events through a dispatch
|
|
46
|
+
that resolves the active block from the live selection. The follow-up
|
|
47
|
+
keys run in the shared surface's context, so the in-block range's
|
|
48
|
+
Delete / Backspace commits as a command (the caret re-seats at the
|
|
49
|
+
range's start), the empty cell's activation layer suppresses the
|
|
50
|
+
line-backspace, and the Home / End over a page text block resolve the
|
|
51
|
+
block's own line edges. The gutter-handle drag's release keeps the
|
|
52
|
+
user's text seat: the browser's release over the drag's non-editable
|
|
53
|
+
chrome would collapse the selection to the page container (and the
|
|
54
|
+
release's click would stand a residual blocks selection), so the drag
|
|
55
|
+
session suppresses the release's click over non-text chrome and
|
|
56
|
+
restores the captured seat on the release (a drop over a text inner
|
|
57
|
+
seats the caret at the drop point instead).
|
|
58
|
+
- aa7ffb3: The table's row/column drag preview now applies the transform over the
|
|
59
|
+
dragged row/column's cells instead of the row element (the `<tr>` is not
|
|
60
|
+
a CSS transformable element — the engine may ignore the row's
|
|
61
|
+
transform, leaving the preview dead while the handle follows the
|
|
62
|
+
pointer). The dragged cell reads as a lifted card (a `--card`
|
|
63
|
+
background + a `--docblocks-table-drag-shadow` box shadow over the
|
|
64
|
+
uncolored cells, behind the cell's own row/column color), so the
|
|
65
|
+
preview is visible over an empty table. The read-only modes render an
|
|
66
|
+
empty table cell's placeholder (one line, matching the activation
|
|
67
|
+
layer's footprint), keeping the edit mode's minimum row height in the
|
|
68
|
+
view/published views.
|
|
69
|
+
|
|
3
70
|
## 0.4.6
|
|
4
71
|
|
|
5
72
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -395,6 +395,26 @@ package root: `BridgeError` (the structured error type) with
|
|
|
395
395
|
`isDatabaseBridge`, and `useDatabaseTable(bridge, tableId, filter?)` — the
|
|
396
396
|
grid controller for a consumer-owned grid over the bridge.
|
|
397
397
|
|
|
398
|
+
The grid's **Columns** control lists every column, restores hidden columns,
|
|
399
|
+
and reorders them by dragging their grips or pressing ArrowUp/ArrowDown on a
|
|
400
|
+
focused grip. Header drag and the popover share one full column order, and
|
|
401
|
+
visible column widths follow the moved column.
|
|
402
|
+
|
|
403
|
+
The grid's **Filter** control edits a recursive and/or condition tree: one
|
|
404
|
+
row per condition (the field / the operator / the value over the column's
|
|
405
|
+
annotation, a single line), the nested groups over bordered cards, and the
|
|
406
|
+
conditions and the groups bound by the group's left connector line. The
|
|
407
|
+
logic's labels stand the UI's locale (en/ru), the active pill over the
|
|
408
|
+
prominent `primary` fill. `Apply` commits the draft as
|
|
409
|
+
the view's `filter` attr (the block's write stand); `Clear` resets it.
|
|
410
|
+
|
|
411
|
+
When an inserted row does not match the active filter, the grid keeps it
|
|
412
|
+
visible with an orange outline while its initial edit session has focus. The
|
|
413
|
+
row leaves the filtered view when focus moves elsewhere; the bridge data is
|
|
414
|
+
unchanged. `useDatabaseTable` exposes this transient row as `pendingRow` and
|
|
415
|
+
`dismissPendingRow(rowId?)` for consumer-owned grids implementing the same
|
|
416
|
+
interaction.
|
|
417
|
+
|
|
398
418
|
### Standalone database table
|
|
399
419
|
|
|
400
420
|
The database's UI stands outside any document as well — the
|
|
@@ -431,7 +451,10 @@ className? })` —
|
|
|
431
451
|
the optional `view` prop at mount); `onViewChange(patch)` receives one
|
|
432
452
|
patch per change for the consumer's persistence (the controlled mode
|
|
433
453
|
stands absent — the state is never external). `readOnly` gates the
|
|
434
|
-
editing's paths (the read-only block's parity). The
|
|
454
|
+
editing's paths (the read-only block's parity). The standalone's grid
|
|
455
|
+
stands no table-name display — the consumer's own visual element (the
|
|
456
|
+
section's list / the heading) stands the name; the document block's
|
|
457
|
+
grid keeps the live name + the rename over it. The sizing's stand is
|
|
435
458
|
the consumer's: the grid stands the root's width (`w-full`), and the
|
|
436
459
|
`className` over the root (the component's own classes stand merged
|
|
437
460
|
over it) — a height-constrained root stands the grid's inner scroll
|
|
@@ -550,11 +573,40 @@ and pan are view state — they never reach the document.
|
|
|
550
573
|
### Localization
|
|
551
574
|
|
|
552
575
|
The editor's UI strings ship localized (en + ru). The language is
|
|
553
|
-
consumer-driven
|
|
554
|
-
prefix
|
|
576
|
+
consumer-driven: by default the package reads the `<html lang>` attribute
|
|
577
|
+
(the `ru*` prefix picks Russian; the absent / unknown language falls back
|
|
555
578
|
to English) and follows the attribute's change at runtime (the editor
|
|
556
|
-
re-renders over the flip).
|
|
557
|
-
|
|
579
|
+
re-renders over the flip).
|
|
580
|
+
|
|
581
|
+
**Controlled locale (SSR / hydration).** For server-rendered consumers
|
|
582
|
+
the `<html lang>` read is unavailable on the server, so the server render
|
|
583
|
+
would take English while the first client render takes the browser's
|
|
584
|
+
language — a hydration mismatch for any `ru` document. The
|
|
585
|
+
`DocblocksI18nProvider` accepts an optional `locale` prop that pins the
|
|
586
|
+
subtree's language explicitly (the consumer passes its own resolved
|
|
587
|
+
locale — the same value on the server and the first client render):
|
|
588
|
+
|
|
589
|
+
```tsx
|
|
590
|
+
import { DocblocksI18nProvider } from "docblocks-react-ui";
|
|
591
|
+
|
|
592
|
+
<DocblocksI18nProvider locale={locale}>{/* the header + the editor */}</DocblocksI18nProvider>;
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
- The passed locale is normalized over the same rules as the attribute
|
|
596
|
+
read: `ru*` → `ru`, `en*` / unknown / empty → `en`.
|
|
597
|
+
- A nested `DocblocksI18nProvider` without a `locale` inherits the
|
|
598
|
+
outer's instance — the package's internal scopes (`DocHeader`,
|
|
599
|
+
`EditorProvider`, the standalone `DatabaseTable`) keep the consumer's
|
|
600
|
+
locale without threading it through each component.
|
|
601
|
+
- The controlled mode runs its own `i18next` instance (one per provider,
|
|
602
|
+
keyed by the normalized locale — a locale change selects the new
|
|
603
|
+
instance and re-renders the subtree). It never mutates the legacy
|
|
604
|
+
attribute-driven instance and never touches the consumer's global
|
|
605
|
+
`i18next`, so concurrent subtrees over different locales stay
|
|
606
|
+
isolated. The locale is UI state only — it never reaches the document,
|
|
607
|
+
the CRDT, or the transport.
|
|
608
|
+
- Outside a controlled provider, the provider without a `locale` keeps
|
|
609
|
+
the attribute-driven behavior above.
|
|
558
610
|
|
|
559
611
|
The package runs its **own** `i18next` instance (the shipped catalogs,
|
|
560
612
|
`i18next` + `react-i18next` are runtime dependencies) under the
|