plitejs 54.0.0-beta.6 → 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.
- package/README.md +4 -4
- package/dist/authored/index.d.ts +25 -8
- package/dist/authored/index.js +3112 -343
- package/dist/{authored-veto-BsBDXC0b.js → authored-veto-CferDljr.js} +1 -1
- package/dist/clipboard-format-key-CLFcThXH.js +14 -0
- package/dist/{comparison-plan-IOewH50q.js → comparison-plan-7iIABSWG.js} +108 -2
- package/dist/{comparison-types-DBQFu7Rt.d.ts → comparison-types-CsmDG5r2.d.ts} +1 -1
- package/dist/{create-editor-DRRzGwaC.js → create-editor-acDgsovY.js} +25 -49
- package/dist/diff/index.d.ts +2 -2
- package/dist/diff/index.js +111 -20
- package/dist/dom/index.d.ts +3 -2
- package/dist/dom/index.js +3 -2
- package/dist/{dom-CVYV5Qd5.js → dom-B5bAma7X.js} +553 -179
- package/dist/history/index.d.ts +1 -1
- package/dist/history/index.js +4899 -3966
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/hyperscript/index.js +1 -1
- package/dist/{hyperscript-CT6hhnAY.js → hyperscript-BXUV6sdO.js} +2 -2
- package/dist/{index-PDROnF1G.d.ts → index-CTTjpWgb.d.ts} +1 -1
- package/dist/{index-D7-n2GCk.d.ts → index-D8DQ1YFB.d.ts} +22 -22
- package/dist/{index-VZrKWWeh.d.ts → index-DJvrmSRP.d.ts} +82 -199
- package/dist/{index-BT7D4vtf.d.ts → index-LhVJuuEf.d.ts} +1 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal/index.js +5 -5
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/react.d.ts +14 -11
- package/dist/pagination/react.js +150 -103
- package/dist/{pagination-Cs5ka6hW.js → pagination-CwjmxPoX.js} +1 -1
- package/dist/{plugin-Bm6nsPHh.js → plugin-BZCGtqMI.js} +8162 -2747
- package/dist/{range-geometry-DO-kbNrb.d.ts → range-geometry-CZari453.d.ts} +1 -1
- package/dist/{range-geometry-D1XfYWs0.js → range-geometry-CqWrwkjH.js} +2 -2
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +7 -7
- package/dist/react/virtualized.d.ts +5 -5
- package/dist/react/virtualized.js +12 -7
- package/dist/{react-BYtwRr4v.js → react-DO9IETEQ.js} +126 -125
- package/dist/{retraction-DnEUo8oE.js → retraction-RHEKiF3h.js} +2 -18
- package/dist/{src-DIQDddmh.js → src-fLbHzUjC.js} +126 -41
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/{index-DHt8nZQ6.d.ts → tx-only-1FM45FSj.d.ts} +9198 -8803
- package/dist/{editor-owner-CGj1wYCa.js → update-policy-C32RjjGt.js} +53 -2
- package/dist/{use-editor-dom-scope-hT7W9d-p.js → use-editor-dom-scope-CUBnNAZV.js} +5785 -4179
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/dist/yjs/react/index.d.ts +3 -3
- package/dist/yjs/react/index.js +3 -3
- package/dist/{yjs-C_g9gZwI.js → yjs-BMguSAX_.js} +309 -128
- package/package.json +1 -7
- package/dist/annotation-store-metrics-Ccjkef45.js +0 -12
- package/dist/annotations/index.d.ts +0 -2
- package/dist/annotations/index.js +0 -2
- package/dist/index-BvQzYVAW.d.ts +0 -71
- package/dist/mapped-view-store-CBk2-bDR.js +0 -120
- package/dist/store-BLYxJgOU.js +0 -747
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
|
|
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('
|
|
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,
|
|
81
|
+
DOM, React, history, hyperscript, pagination, diff, and testing APIs live on explicit `plitejs/*` subpaths. There is no public `/internal` entrypoint.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Build anchored overlays directly on `editor.anchor`, `commit.changed.anchors()`, and `DecorationSource`.
|
package/dist/authored/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as TwoWayComparison } from "../comparison-types-
|
|
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: "
|
|
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 `'
|
|
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
|
|
512
|
-
*
|
|
513
|
-
*
|
|
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
|
}>;
|