docblocks-react-ui 0.20.0 → 0.22.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 CHANGED
@@ -1,5 +1,81 @@
1
1
  # docblocks-react-ui
2
2
 
3
+ ## 0.22.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9f02d63: The table's merged cells over the editor: the anchor cell renders the
8
+ region's `colspan`/`rowspan` (the covered cells stand no `<td>`, the
9
+ browser's own table layout carries the geometry), and the cell's corner grip
10
+ drags a rectangular cell range — the new `tableRange` view-state slice,
11
+ never document data. The cell's right-click menu gains **Merge cells** over
12
+ a selected rectangle and **Split cells** over a merged cell (the anchor
13
+ keeps its content, the restored cells stand empty); the grid coordinates the
14
+ hover and the range read come from the resolver, not the DOM's
15
+ `cellIndex`/`rowIndex`, so a merged cell's drawn position never lies. The
16
+ read-only modes render the spans without the grip, the menu commands or the
17
+ resizing chrome.
18
+
19
+ The range's drag resolves the cell from the DOM boxes (never the top-most
20
+ element — the table's chrome overlays the grid), selects whole regions (a
21
+ rectangle never cuts a merged cell), stands no resize seam inside a region,
22
+ and clears on a press over the document's content outside the table.
23
+
24
+ A region's chrome offers nothing it cannot do: no resize seam inside the
25
+ region, no reorder handle over a spanned column / row, and the cell range
26
+ resets over a structural change (its rectangles were read from the cells'
27
+ positions).
28
+
29
+ The add-row chip's drag counts the rows the pointer actually travels: the
30
+ step is the last row's height (it was a fixed 24 px, so one row's worth of
31
+ drag removed two), the removal walks the real row heights from the last one,
32
+ the ghost rows stand the real row height, and the size stand spells the
33
+ delta out (`3 × 3 − 1`).
34
+
35
+ The rows a negative add-chip drag removes stand the columns' fill over the
36
+ last rows (the count rides the size stand), and the slash `/table` takes an
37
+ empty block's slot instead of leaving an empty paragraph above the grid.
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [db5cfee]
42
+ - docblocks-core@0.9.0
43
+
44
+ ## 0.21.0
45
+
46
+ ### Minor Changes
47
+
48
+ - 1dd5577: `EditorProvider` takes a `scrollContainer` prop: the element that scrolls
49
+ the document when the consumer renders the editor inside its own `overflow`
50
+ box instead of the page scroll. The lazy blob resolution's preload band is
51
+ an `IntersectionObserver` — an element clipped by an inner scroller never
52
+ intersects a window-rooted observer, so the band degenerated to the visible
53
+ area and the bytes resolved only once an image entered the view. The band
54
+ and the first screen's eager measure now frame on the passed container; a
55
+ nested provider inherits it, and `null` (the default) keeps the window
56
+ frame — the page-scroll consumers are unchanged.
57
+
58
+ ### Patch Changes
59
+
60
+ - 258233c: The blob placeholder's box stays inside the page column and its content
61
+ stands centered. A figure whose intrinsic ratio is far wider than the
62
+ column (a 26:1 banner) let the loading placeholder outgrow the row on
63
+ Chromium — the box took its width from the inline `aspect-ratio` alone and
64
+ the document scroller grew a horizontal overflow; the shared placeholder
65
+ class now clamps the card to the row width. The placeholder's content (the
66
+ spinner + the label) is centered on both axes inside the reserved height
67
+ instead of sitting at the top edge — centered with auto margins, so a
68
+ reserved box shorter than the content keeps its top edge rather than
69
+ spilling above it.
70
+ - 1e71630: A standalone markdown image line (`![alt](src)`) is dropped by the markdown
71
+ import and paste, the same stand the `text/html` paste already takes with
72
+ `<img>`: the document's image source is an opaque blob-store key, and a
73
+ markdown payload carries no bytes to store under one — the materialized
74
+ block took the source string verbatim (`img.png`, an external URL) and stood
75
+ a permanently broken `image` block whose store lookup never resolves. The
76
+ inline image in the middle of a line keeps its literal text. An imported
77
+ image becomes a real `image` block only through the consumer's upload.
78
+
3
79
  ## 0.20.0
4
80
 
5
81
  ### Minor Changes
package/README.md CHANGED
@@ -299,6 +299,11 @@ attach(doc, provider);
299
299
  - an empty or whitespace-only payload is a no-op (no transaction);
300
300
  - a non-fresh document (the root has children) throws the typed
301
301
  `ImportDocumentError` — the import fills the root, it never appends;
302
+ - a standalone markdown image line (`![alt](src)`) is dropped, the same
303
+ stand as the HTML paste's `img`: the data model's image source is an
304
+ opaque blob-store key, and a payload carries no bytes to store under one
305
+ (an imported image becomes a real `image` block only through the
306
+ consumer's upload);
302
307
  - the markdown's YAML frontmatter (a leading `--- … ---` fence, a hand-
303
308
  rolled subset) is stripped before the blocks' parse and mapped to the
304
309
  meta over the fresh document: `title` → the doc's title, the known
@@ -441,6 +446,10 @@ between those ids and the stored objects:
441
446
  interface BlobMeta {
442
447
  name: string;
443
448
  mimeType: string;
449
+ /** The intrinsic dimensions: the lazy placeholder reserves the aspect
450
+ * ratio from them (the landing shifts nothing). */
451
+ width?: number;
452
+ height?: number;
444
453
  }
445
454
 
446
455
  interface BlobStore {
@@ -469,6 +478,24 @@ interface BlobStore {
469
478
  `downloadUrl` — the blocks keep the legacy stand (the bytes over `get`,
470
479
  the object URL's href). Both members are optional: existing consumers and
471
480
  `createMemoryBlobStore` stand exactly the legacy behavior.
481
+ - **The lazy resolution (the default):** the metadata's head lookup runs at
482
+ mount (the placeholder reserves the aspect ratio from `width`/`height`),
483
+ and the bytes resolve only once the block enters the preload band — the
484
+ viewport grown by the `--docblocks-image-preload-margin` token (200% by
485
+ default, two viewport heights on each side). The blocks standing in view
486
+ at mount resolve at once (the first screen's priority); a resolved view
487
+ never falls back to the placeholder on a store change, and outside the
488
+ band the bytes are not re-fetched. `blobLoading: "eager"` on the provider
489
+ resolves every block at mount (the pre-lazy behavior); `"lazy"` is the
490
+ default, and a nested provider inherits the enclosing policy.
491
+ - **The scroll container** (`scrollContainer`): the preload band and the
492
+ first screen's measure are framed by this element when the consumer
493
+ scrolls the document inside its own `overflow` box instead of the page —
494
+ an element clipped by an inner scroller never intersects a window-rooted
495
+ observer, so the band would shrink to the visible area. `null` (the
496
+ default) frames the window; the value is read per render into the provider
497
+ context, so pass a stable reference (and the element itself may land after
498
+ the provider's first render — the band re-frames on it).
472
499
  - The file picker accepts arbitrary files. New `image/*` uploads create an
473
500
  `image` block; other MIME types, including `application/pdf`, create a
474
501
  `file` block. PDF files render through `pdfPreview` or the sandboxed native