docblocks-core 0.1.3 → 0.2.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,41 @@
1
1
  # docblocks-core
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c0559db: The mark commands stand the Y.Text format's length contract: `setMark`
8
+ (the exclusive path) and `unsetMark` passed the range's end offset as
9
+ the format's length argument (the Yjs `format(start, length)` signature).
10
+ Over a range whose `from + to` exceeds the text's length the command
11
+ extended the block's text with line breaks (the overhang's characters
12
+ got the mark or the drop) — the ghost empty lines over the mark's
13
+ toggle. The mark now stands the exact `[from, to)` bounds (the length is
14
+ `to - from`); the text is byte-stable over the toggle.
15
+
16
+ ## 0.2.0
17
+
18
+ ### Minor Changes
19
+
20
+ - 0791efb: The `embed` block gains the persisted view attrs: the optional `zoom`
21
+ (the scale factor, positive) and `panX` / `panY` (the pan offsets, px).
22
+ Absent or `null` stand the identity view (the attrs' null idiom — the
23
+ values are never removed, `null` = the view cleared). The reader stands
24
+ the unknown attrs over the older data (absent = the identity); the
25
+ validator stands the finite-number / positive-zoom rules over the
26
+ strict's path.
27
+ - 48ef4fb: The `embed` block's height stands the stretchable stand: the
28
+ `--docblocks-embed-height` token (300 px) is the default — the minimum,
29
+ and the block's bottom edge stands the resize handle (the hover reveal's
30
+ grip bar, the `cursor-row-resize`'s stand, the keyboard's arrows over
31
+ the 16 px's step — the slider's aria). The drag stretches the wrapper's
32
+ height over the gesture (the live's stand), and the rest's commit stands
33
+ the block's new `height` attr (px; absent or `null` = the token's
34
+ default — the null idiom's stand, so the reload restores the stretched
35
+ stand and the panes share it over the wire). The stretch only stands
36
+ over the minimum (the drag over it clamps, the clear stands the `null`'s
37
+ write); the read-only's stand gates the handle off.
38
+
3
39
  ## 0.1.3
4
40
 
5
41
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -283,6 +283,21 @@ interface EmbedAttrs {
283
283
  src: string;
284
284
  /** Accessible title; falls back to the kind in the renderer. */
285
285
  title?: string;
286
+ /**
287
+ * The persisted zoom (the scale factor; 1 = 100%). Absent or `null` = the
288
+ * identity (the null idiom — attrs are never removed).
289
+ */
290
+ zoom?: number | null;
291
+ /** The persisted horizontal pan offset (px); absent or `null` = 0. */
292
+ panX?: number | null;
293
+ /** The persisted vertical pan offset (px); absent or `null` = 0. */
294
+ panY?: number | null;
295
+ /**
296
+ * The persisted height (px; the block's stretched stand). Absent or
297
+ * `null` = the default (the `--docblocks-embed-height` token's stand —
298
+ * the minimum; the resize only stretches over it).
299
+ */
300
+ height?: number | null;
286
301
  /** Nesting depth in the page sequence (default 0). */
287
302
  indent?: PageIndent;
288
303
  }
package/dist/index.mjs CHANGED
@@ -710,7 +710,17 @@ const BLOCK_REGISTRY = {
710
710
  nonEmpty: true,
711
711
  required: true
712
712
  },
713
- title: { kind: "string" }
713
+ title: { kind: "string" },
714
+ zoom: {
715
+ kind: "nullable-number",
716
+ positive: true
717
+ },
718
+ panX: { kind: "nullable-number" },
719
+ panY: { kind: "nullable-number" },
720
+ height: {
721
+ kind: "nullable-number",
722
+ positive: true
723
+ }
714
724
  }
715
725
  },
716
726
  "sync-embed": {
@@ -4455,7 +4465,7 @@ function setMark(ydoc, blockId, from, to, mark) {
4455
4465
  if (exclusive) {
4456
4466
  const clear = {};
4457
4467
  for (const other of MARK_NAMES) if (other !== name) clear[other] = null;
4458
- content.format(from, to, {
4468
+ content.format(from, to - from, {
4459
4469
  ...clear,
4460
4470
  [name]: value
4461
4471
  });
@@ -4470,7 +4480,7 @@ function unsetMark(ydoc, blockId, from, to, name) {
4470
4480
  if (!Number.isInteger(from) || !Number.isInteger(to) || from < 0 || from > to || to > total) throw new InvalidRangeError(`Range must satisfy 0 <= from < to <= ${total} (got from=${from}, to=${to}).`);
4471
4481
  if (from === to) return;
4472
4482
  localTransact(ydoc, () => {
4473
- content.format(from, to, { [name]: null });
4483
+ content.format(from, to - from, { [name]: null });
4474
4484
  });
4475
4485
  }
4476
4486
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docblocks-core",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "description": "Headless CRDT document engine: schema v1, Doc (commands/transactions/undo), sync providers. Yjs-based, zero UI dependencies.",
5
5
  "type": "module",
6
6
  "license": "MIT",