docblocks-react-ui 0.0.0-stage → 0.1.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/LICENSE +21 -0
  3. package/README.md +585 -2
  4. package/dist/Editor-CiJY5R4v.mjs +26587 -0
  5. package/dist/Editor-DT7RkRXf.d.mts +32 -0
  6. package/dist/LoaderCircle-AGVFE4IP.mjs +19 -0
  7. package/dist/Skeleton-D922Ths5.mjs +13 -0
  8. package/dist/constants-D4FTL0ph.mjs +81 -0
  9. package/dist/fonts/OFL.txt +162 -0
  10. package/dist/fonts/inter-300-c.woff2 +0 -0
  11. package/dist/fonts/inter-300-l.woff2 +0 -0
  12. package/dist/fonts/inter-300i-c.woff2 +0 -0
  13. package/dist/fonts/inter-300i-l.woff2 +0 -0
  14. package/dist/fonts/inter-400-c.woff2 +0 -0
  15. package/dist/fonts/inter-400-l.woff2 +0 -0
  16. package/dist/fonts/inter-400i-c.woff2 +0 -0
  17. package/dist/fonts/inter-400i-l.woff2 +0 -0
  18. package/dist/fonts/inter-600-c.woff2 +0 -0
  19. package/dist/fonts/inter-600-l.woff2 +0 -0
  20. package/dist/fonts/inter-600i-c.woff2 +0 -0
  21. package/dist/fonts/inter-600i-l.woff2 +0 -0
  22. package/dist/fonts/jetbrains-mono-300-c.woff2 +0 -0
  23. package/dist/fonts/jetbrains-mono-300-l.woff2 +0 -0
  24. package/dist/fonts/jetbrains-mono-300i-c.woff2 +0 -0
  25. package/dist/fonts/jetbrains-mono-300i-l.woff2 +0 -0
  26. package/dist/fonts/jetbrains-mono-400-c.woff2 +0 -0
  27. package/dist/fonts/jetbrains-mono-400-l.woff2 +0 -0
  28. package/dist/fonts/jetbrains-mono-400i-c.woff2 +0 -0
  29. package/dist/fonts/jetbrains-mono-400i-l.woff2 +0 -0
  30. package/dist/fonts/jetbrains-mono-600-c.woff2 +0 -0
  31. package/dist/fonts/jetbrains-mono-600-l.woff2 +0 -0
  32. package/dist/fonts/jetbrains-mono-600i-c.woff2 +0 -0
  33. package/dist/fonts/jetbrains-mono-600i-l.woff2 +0 -0
  34. package/dist/fonts/lora-400-c.woff2 +0 -0
  35. package/dist/fonts/lora-400-l.woff2 +0 -0
  36. package/dist/fonts/lora-400i-c.woff2 +0 -0
  37. package/dist/fonts/lora-400i-l.woff2 +0 -0
  38. package/dist/fonts/lora-600-c.woff2 +0 -0
  39. package/dist/fonts/lora-600-l.woff2 +0 -0
  40. package/dist/fonts/lora-600i-c.woff2 +0 -0
  41. package/dist/fonts/lora-600i-l.woff2 +0 -0
  42. package/dist/fonts/lora-700-c.woff2 +0 -0
  43. package/dist/fonts/lora-700-l.woff2 +0 -0
  44. package/dist/fonts/lora-700i-c.woff2 +0 -0
  45. package/dist/fonts/lora-700i-l.woff2 +0 -0
  46. package/dist/fonts/open-sans-300-c.woff2 +0 -0
  47. package/dist/fonts/open-sans-300-l.woff2 +0 -0
  48. package/dist/fonts/open-sans-300i-c.woff2 +0 -0
  49. package/dist/fonts/open-sans-300i-l.woff2 +0 -0
  50. package/dist/fonts/open-sans-400-c.woff2 +0 -0
  51. package/dist/fonts/open-sans-400-l.woff2 +0 -0
  52. package/dist/fonts/open-sans-400i-c.woff2 +0 -0
  53. package/dist/fonts/open-sans-400i-l.woff2 +0 -0
  54. package/dist/fonts/open-sans-600-c.woff2 +0 -0
  55. package/dist/fonts/open-sans-600-l.woff2 +0 -0
  56. package/dist/fonts/open-sans-600i-c.woff2 +0 -0
  57. package/dist/fonts/open-sans-600i-l.woff2 +0 -0
  58. package/dist/fonts/pt-sans-400-c.woff2 +0 -0
  59. package/dist/fonts/pt-sans-400-l.woff2 +0 -0
  60. package/dist/fonts/pt-sans-400i-c.woff2 +0 -0
  61. package/dist/fonts/pt-sans-400i-l.woff2 +0 -0
  62. package/dist/fonts/pt-sans-700-c.woff2 +0 -0
  63. package/dist/fonts/pt-sans-700-l.woff2 +0 -0
  64. package/dist/fonts/pt-sans-700i-c.woff2 +0 -0
  65. package/dist/fonts/pt-sans-700i-l.woff2 +0 -0
  66. package/dist/fonts/pt-serif-400-c.woff2 +0 -0
  67. package/dist/fonts/pt-serif-400-l.woff2 +0 -0
  68. package/dist/fonts/pt-serif-400i-c.woff2 +0 -0
  69. package/dist/fonts/pt-serif-400i-l.woff2 +0 -0
  70. package/dist/fonts/pt-serif-700-c.woff2 +0 -0
  71. package/dist/fonts/pt-serif-700-l.woff2 +0 -0
  72. package/dist/fonts/pt-serif-700i-c.woff2 +0 -0
  73. package/dist/fonts/pt-serif-700i-l.woff2 +0 -0
  74. package/dist/index-D6_ysSmQ.d.mts +1075 -0
  75. package/dist/index-YJcgf8Hh.d.mts +39 -0
  76. package/dist/index.d.mts +388 -0
  77. package/dist/index.mjs +641 -0
  78. package/dist/mermaid/index.d.mts +10 -0
  79. package/dist/mermaid/index.mjs +252 -0
  80. package/dist/motion/index.d.mts +8 -0
  81. package/dist/motion/index.mjs +1009 -0
  82. package/dist/pdf/index.d.mts +5 -0
  83. package/dist/pdf/index.mjs +164 -0
  84. package/dist/pdf/jbig2.wasm +0 -0
  85. package/dist/pdf/jbig2_nowasm_fallback.js +15 -0
  86. package/dist/pdf/pdf.worker.min.mjs +28 -0
  87. package/dist/styles.css +4562 -0
  88. package/package.json +99 -4
  89. package/theme.css +128 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,100 @@
1
+ # docblocks-react-ui
2
+
3
+ ## 0.1.0
4
+
5
+ ### Added
6
+
7
+ - The initial release of the React rendering + editing layer (peer
8
+ dependencies: `docblocks-core`, `react`, `react-dom`; the optional
9
+ peers `framer-motion`, `mermaid`, and `pdfjs-dist` stand behind the
10
+ optional subpaths; the package builds strictly on the core's public
11
+ API — it never imports `yjs`).
12
+ - `EditorProvider` + `Editor`: the page view (the block flow over the
13
+ flat model) and the canvas view (`view: "canvas"` — the page
14
+ miniature plus the root-level surfaces), and the per-instance store
15
+ with the reference-stability re-render contract (the `useBlock`
16
+ re-renders only for the changed blocks).
17
+ - The editing layer: the text blocks (the contenteditable inner managed
18
+ from the store runs, the single-transaction input commits), the
19
+ selection (gutter / mouse / cross-block text range), the slash menu,
20
+ the floating format toolbar, the markdown + multi-block `text/html`
21
+ paste, the gutter quick-insert, the keyboard and clipboard
22
+ conventions, the undo / redo with the selection re-seat, and the `@`
23
+ mention picker (the consumer's `mentionProvider`).
24
+ - The block-renderer registry — the consumer extension point: a custom
25
+ renderer per block type stands over the built-in renderers (which
26
+ cover every v1 block type).
27
+ - The canvas: the five block types, the zoom / pan viewport + the
28
+ bottom dock, the move / resize / nudge / fit / connector-draw /
29
+ copy-paste sessions, the connectors (the endpoint system, the ports,
30
+ the orthogonal avoidance, the labels, the style), and the explicit
31
+ `zIndex` (the arrange menu). The frame stands the viewport window —
32
+ moving the frame pans the window, not the content, and the frame
33
+ renders behind the other surface elements; the page frame block
34
+ stands the inline live window into the referenced canvas frame (the
35
+ `/frame` slash picker). The canvas-text stands the ghost double-click
36
+ entry and the shape-parity press contract (the press selects and
37
+ moves, the double-click edits).
38
+ - The native `table` block: the cells as the mini-docs, the row and
39
+ column commands, the handles and menus, the seam resize, and the
40
+ add-row / add-column chips.
41
+ - The `database` block: the inline form and the external form over the
42
+ versioned `DatabaseBridge` contract — the ordered row wire, the
43
+ snapshot → subscribe → replay → live bootstrap, the append-only
44
+ per-table envelope stream (one transaction → one `seq` / `prevSeq`),
45
+ the idempotent writes (the fresh `operationId` per op), the atomic
46
+ mixed `batchRows`, the structured `BridgeError` codes, and the
47
+ protocol negotiation (`describeProtocol` + the capability gate). The
48
+ package ships the contract and the UI only — the in-memory reference
49
+ bridge is the consumer's own implementation (the playground harness's
50
+ `memory-bridge` directory is the reference stand); without a
51
+ `databaseBridge` prop the external-form block renders the
52
+ not-connected placeholder and the `/database` slash command is
53
+ hidden. `TEXT_TYPES` (the set of the bridge column types that hold
54
+ text) is exported from the package root.
55
+ - The `embed` / `sync-embed` blocks: the consumer's `syncEmbedResolver`
56
+ mounts a nested `EditorProvider` over the master doc (its own
57
+ selection and undo; the cycle guarded by the ancestor-doc chain +
58
+ the depth limit), and the `image` block over the blob bridge (the
59
+ consumer's `BlobStore`, the opaque `src` key, the subtype from
60
+ `resolve.meta` — never guessed; the legacy view-only `blobResolver`
61
+ is wrapped as a store).
62
+ - The optional subpaths with the optional peer dependencies:
63
+ `./motion` (`framer-motion` — the drag-reorder and the row
64
+ animations), `./mermaid` (the mermaid preview over the `code`
65
+ blocks), and `./pdf` (`pdfjs-dist` — the first-page PDF preview, the
66
+ worker bundled to `dist/pdf/`).
67
+ - `DocHeader` — the consumer-placed panel (rendered in the consumer's
68
+ chrome, outside the editor): the page / canvas switcher, the
69
+ document mode's switcher (Edit / View / Published — consumer-
70
+ controlled over the `mode` + `onModeChange` props), the avatar, and
71
+ the title (the inline edit commits one core command each).
72
+ - The consumer-controlled access modes and publishing: `accessLevel`
73
+ (`viewer` / `editor`, default `editor`), `mode` (`edit` / `view` /
74
+ `published`, default `edit`), and `publishedDoc` (the hydrated
75
+ snapshot) on the `EditorProvider` — the consumer session state,
76
+ never document data, never on the wire. The `viewer` stands the
77
+ security model: the reader's browser receives only the published
78
+ snapshot (passed as the `doc` — no live document, no sync
79
+ transport), and an absent stand renders the "not published yet"
80
+ placeholder; `view` is the read-only live document (the sync stays
81
+ live); the editor's `published` renders the snapshot read-only (its
82
+ own store and selection, static over the live edits; a new snapshot
83
+ is a remount via `key`). Over the read-only modes the editing
84
+ surfaces are off (the text inners, the gutter / drag / hotkeys / the
85
+ format toolbar, the table and database chrome, the canvas sessions
86
+ and dock, the attribute menus) and the observing gestures keep
87
+ (scroll, the embed pan / zoom, the canvas wheel zoom / pan); the
88
+ consecutive empty text blocks render as one (the document data
89
+ untouched).
90
+ - The theming: the `--docblocks-*` custom properties mapped onto the
91
+ optional shadcn standard tokens on the editor root (a themed consumer
92
+ themes the editor automatically, dark included; the fallbacks equal
93
+ the unthemed literals — zero visual diff without a theme), the
94
+ optional seed `docblocks-react-ui/theme.css`, and the self-hosted
95
+ `Inter` UI font.
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies
100
+ - docblocks-core@0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 wereintouch
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.