plitejs 54.0.0-beta.5 → 54.0.0-beta.7

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 (59) hide show
  1. package/README.md +4 -4
  2. package/dist/authored/index.d.ts +25 -8
  3. package/dist/authored/index.js +4316 -735
  4. package/dist/{authored-veto-Cu-5JdVj.js → authored-veto-CferDljr.js} +1 -1
  5. package/dist/clipboard-format-key-CLFcThXH.js +14 -0
  6. package/dist/{comparison-plan-BJxnVPcS.js → comparison-plan-7iIABSWG.js} +108 -2
  7. package/dist/{comparison-types-Bvvxzxq2.d.ts → comparison-types-CsmDG5r2.d.ts} +1 -1
  8. package/dist/{create-editor-XvI_4sYc.js → create-editor-acDgsovY.js} +25 -49
  9. package/dist/diff/index.d.ts +2 -2
  10. package/dist/diff/index.js +111 -20
  11. package/dist/dom/index.d.ts +3 -2
  12. package/dist/dom/index.js +3 -2
  13. package/dist/{dom-BjspML2h.js → dom-B5bAma7X.js} +859 -210
  14. package/dist/history/index.d.ts +1 -1
  15. package/dist/history/index.js +5302 -4295
  16. package/dist/hyperscript/index.d.ts +1 -1
  17. package/dist/hyperscript/index.js +1 -1
  18. package/dist/{hyperscript-BFypA5qW.js → hyperscript-BXUV6sdO.js} +2 -2
  19. package/dist/{index-BwmXxqbi.d.ts → index-CTTjpWgb.d.ts} +1 -1
  20. package/dist/{index-DaXz-4c7.d.ts → index-D8DQ1YFB.d.ts} +22 -22
  21. package/dist/{index-CYac3_ID.d.ts → index-DJvrmSRP.d.ts} +82 -199
  22. package/dist/{index-BUJsM0oV.d.ts → index-LhVJuuEf.d.ts} +1 -1
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +4 -4
  25. package/dist/internal/index.d.ts +2 -2
  26. package/dist/internal/index.js +5 -5
  27. package/dist/pagination/index.d.ts +1 -1
  28. package/dist/pagination/index.js +1 -1
  29. package/dist/pagination/react.d.ts +14 -11
  30. package/dist/pagination/react.js +150 -103
  31. package/dist/{pagination-ChDBJtdC.js → pagination-CwjmxPoX.js} +1 -1
  32. package/dist/{plugin-BvM4s-Lr.js → plugin-BZCGtqMI.js} +8691 -2054
  33. package/dist/{range-geometry-wFuJaBlA.d.ts → range-geometry-CZari453.d.ts} +1 -1
  34. package/dist/{range-geometry-B5CITwMp.js → range-geometry-CqWrwkjH.js} +2 -2
  35. package/dist/react/index.d.ts +4 -5
  36. package/dist/react/index.js +7 -7
  37. package/dist/react/virtualized.d.ts +5 -5
  38. package/dist/react/virtualized.js +12 -7
  39. package/dist/{react-cmFeNP6P.js → react-DO9IETEQ.js} +128 -126
  40. package/dist/{retraction-lXQwo2Ia.js → retraction-RHEKiF3h.js} +1 -1
  41. package/dist/{src-BA6F9yxN.js → src-fLbHzUjC.js} +277 -72
  42. package/dist/testing/index.d.ts +2 -2
  43. package/dist/testing/index.js +3 -3
  44. package/dist/{index-QuqD4Dyj.d.ts → tx-only-1FM45FSj.d.ts} +9060 -8608
  45. package/dist/{editor-owner-CRgIQ625.js → update-policy-C32RjjGt.js} +53 -2
  46. package/dist/{use-editor-dom-scope-B4gF9t_Y.js → use-editor-dom-scope-CUBnNAZV.js} +6133 -4076
  47. package/dist/yjs/index.d.ts +1 -1
  48. package/dist/yjs/index.js +1 -1
  49. package/dist/yjs/react/index.d.ts +3 -3
  50. package/dist/yjs/react/index.js +3 -3
  51. package/dist/{yjs-CWdWDrpv.js → yjs-BMguSAX_.js} +311 -127
  52. package/package.json +1 -7
  53. package/dist/annotation-store-metrics-Ccjkef45.js +0 -12
  54. package/dist/annotations/index.d.ts +0 -2
  55. package/dist/annotations/index.js +0 -2
  56. package/dist/index-CRmyGzS8.d.ts +0 -71
  57. package/dist/mapped-view-store-XUJ-fnHE.js +0 -120
  58. package/dist/native-grouping-input-8kO12VK9.js +0 -8
  59. package/dist/store-Bllfuqp4.js +0 -717
package/README.md CHANGED
@@ -14,7 +14,7 @@ const editor = createEditor({
14
14
 
15
15
  Use `isEditor` when library code needs to validate an unknown value before treating it as an editor.
16
16
 
17
- Use `createEditorView(editor, options)` when framework packages need a root-scoped view over a committed editor. React components use `useEditor` from `plitejs/react`.
17
+ Use `createEditorView(editor, options)` when framework packages need a root-scoped view over a committed editor. React components create an editor with `useCreateEditor` and read the active editor with `useEditor` from `plitejs/react`.
18
18
 
19
19
  Read committed state with `editor.read(...)`. Use direct read methods for one-shot reads and the callback form when several reads must share one state view.
20
20
 
@@ -69,7 +69,7 @@ import { definePlugin, defineEffect } from 'plitejs';
69
69
 
70
70
  const refreshIndex = defineEffect({ key: 'search.refresh-index' });
71
71
 
72
- const searchEffects = definePlugin('search-effects', {
72
+ const searchEffects = definePlugin('searchEffects', {
73
73
  effectTypes: [refreshIndex],
74
74
  });
75
75
  ```
@@ -78,6 +78,6 @@ Advanced library code can install descriptor-based read middleware and grouped t
78
78
 
79
79
  Pure data helpers live on namespaces such as `ElementApi`, `NodeApi`, `PathApi`, `PointApi`, `RangeApi`, `SpanApi`, and `TextApi`. Inside a live editor, prefer `editor.read.<group>.<method>()` for one-shot reads, grouped `state.*` reads for custom read logic, `editor.update.<group>.<method>()` for one-shot writes, and grouped `tx.*` writes for composed commands. Plugin `read` factories return callable method trees built once per configuration; methods read live state when invoked.
80
80
 
81
- DOM, React, annotations, history, hyperscript, layout, diff, and testing APIs live on explicit `plitejs/*` subpaths. There is no public `/internal` entrypoint.
81
+ DOM, React, history, hyperscript, pagination, diff, and testing APIs live on explicit `plitejs/*` subpaths. There is no public `/internal` entrypoint.
82
82
 
83
- React components create annotation stores with `useAnnotationStore` from `plitejs/react`. Framework adapters with an independent lifetime use `createAnnotationStore` from `plitejs/annotations`; the React root does not export the imperative constructor.
83
+ Build anchored overlays directly on `editor.anchor`, `commit.changed.anchors()`, and `DecorationSource`.
@@ -1,5 +1,5 @@
1
- import { As as SchemaPropertyLandingPolicy, Cs as SchemaPropertyCopyPolicy, Hd as PluginDependencyReferenceFor, Jg as EditorJsonValue, Lm as TxDeclaredMethod, Mg as Location, Mo as PropertySetDescriptor, Ms as SchemaPropertyRole, Ns as SchemaPropertySplitPolicy, Oc as ContentSlice, Od as Plugin, Of as Value, Og as Range, Oo as PropertyJsonDescriptor, Ps as SchemaPropertyTypeChangePolicy, Ts as SchemaPropertyExclusiveGroup, Ug as Path, dn as AuthoredDocumentProjection, fn as AuthoredProjectionDiagnostic, gd as EditorViewOptions, ol as EditorDocumentValue, pn as AuthoredProjectionRefusal, wc as AnyEditor, wd as NodeKey, zg as Point, zm as TxOnlyMethod } from "../index-QuqD4Dyj.js";
2
- import { h as TwoWayComparison } from "../comparison-types-Bvvxzxq2.js";
1
+ import { Ah as SchemaPropertyLandingPolicy, B_ as EditorJsonValue, Ch as SchemaPropertyCopyPolicy, Dm as PropertyJsonDescriptor, G as EditorDocumentValue, Mh as SchemaPropertyRole, Nh as SchemaPropertySplitPolicy, Ph as SchemaPropertyTypeChangePolicy, S_ as Path, Th as SchemaPropertyExclusiveGroup, _r as Plugin, d_ as Location, dc as AuthoredProjectionRefusal, jm as PropertySetDescriptor, jr as PluginDependencyReferenceFor, l as AnyEditor, lc as AuthoredDocumentProjection, p as ContentSlice, pr as NodeKey, r as TxOnlyMethod, rr as EditorViewOptions, s_ as Range, t as TxDeclaredMethod, uc as AuthoredProjectionDiagnostic, v_ as Point, vi as Value } from "../tx-only-1FM45FSj.js";
2
+ import { h as TwoWayComparison } from "../comparison-types-CsmDG5r2.js";
3
3
  //#region src/authored/tree/layers.d.ts
4
4
  type FormatWrite = Readonly<{
5
5
  kind: 'remove';
@@ -88,8 +88,17 @@ type AuthoredMark = (MarkBase & Readonly<{
88
88
  key?: undefined;
89
89
  kind: Exclude<AuthoredMarkKind, 'format' | 'insert' | 'join' | 'joined' | 'split'>;
90
90
  }>) | (MarkBase & Follows & NoGave & Readonly<{
91
+ key?: undefined;
91
92
  kind: 'insert';
92
93
  }>) | (MarkBase & Follows & Readonly<{
94
+ /**
95
+ * On a suggested block split, the split's identity within its
96
+ * incarnation, minted once when the recorder writes it, which the
97
+ * `end` member it leaves on the line it cut names. Absent on a split
98
+ * an Editing change records and on one stored before keys, which
99
+ * rejoin the nearest line before them that the decision keeps.
100
+ */
101
+ key?: string;
93
102
  /**
94
103
  * On a block split, what the split gave its new line: for each key a
95
104
  * join compares, and `type`, whose value the split did not copy from
@@ -120,14 +129,15 @@ type Follows = Readonly<{
120
129
  * holder is a `joined` claim.
121
130
  */
122
131
  follows?: string;
123
- key?: undefined;
124
132
  }>;
125
133
  type NoGave = Readonly<{
126
134
  gave?: undefined;
127
135
  }>;
136
+ /** A format write an authored split carried onto the split-off block, optionally naming its source. */
128
137
  type GaveWrite = FormatWrite & Readonly<{
129
138
  from?: string;
130
139
  }>;
140
+ /** Format writes keyed by property name that an authored split carried onto the split-off block. */
131
141
  type SplitGave = Readonly<Record<string, GaveWrite>>;
132
142
  declare const authoredMarksSchema: Readonly<{
133
143
  properties: (Readonly<{
@@ -195,7 +205,7 @@ declare const authoredRecords: Plugin<Readonly<{
195
205
  };
196
206
  };
197
207
  }> & Readonly<{
198
- name: "authored-records";
208
+ name: "authoredRecords";
199
209
  }>>;
200
210
  //#endregion
201
211
  //#region src/authored/refusal.d.ts
@@ -218,7 +228,7 @@ type AuthoredRefusal = Readonly<{
218
228
  code: 'generated-values' | 'unrepresentable' | 'veto';
219
229
  message: string;
220
230
  /**
221
- * Each veto reason the change met, such as `'table'`, or the
231
+ * Each veto reason the change met, such as `'code-block'`, or the
222
232
  * {@link UnrepresentableReason} an unrepresentable edit met.
223
233
  */
224
234
  reasons: readonly string[];
@@ -454,6 +464,13 @@ type AuthoredRead = {
454
464
  * author withdrew it, or when the document never held the id.
455
465
  */
456
466
  outcome: (id: string) => AuthoredOutcome | null;
467
+ /**
468
+ * Whether a stored grid element, such as a table, takes no write that
469
+ * reshapes it or sizes its rows and columns: it waits as a pending deletion
470
+ * or holds a pending row, column or format change of a change that does not
471
+ * insert it whole.
472
+ */
473
+ gridLocked: (node: unknown) => boolean;
457
474
  /** What review reads on a node of the stored document. */
458
475
  reviewOf: (node: unknown) => AuthoredReview;
459
476
  };
@@ -508,9 +525,9 @@ type AuthoredTestOptions = AuthoredOptions & Readonly<{
508
525
  intent?: 'edit' | 'propose';
509
526
  now?: () => number;
510
527
  /**
511
- * Record what a feature's veto refuses in Suggesting, such as a new table
512
- * row, as content loaded from elsewhere can hold it. A write review cannot
513
- * show in a table, such as a lone new cell, still refuses.
528
+ * Record what a feature's veto refuses in Suggesting, such as a code block,
529
+ * as content loaded from elsewhere can hold it. A write review cannot show
530
+ * in a table, such as a lone new cell, still refuses.
514
531
  */
515
532
  vetoes?: false;
516
533
  }>;