plitejs 0.0.1 → 54.0.0-beta.3
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/LICENSE +4 -1
- package/README.md +83 -0
- package/dist/annotation-store-metrics-Ccjkef45.js +12 -0
- package/dist/annotations/index.d.ts +2 -0
- package/dist/annotations/index.js +2 -0
- package/dist/authored/index.d.ts +596 -0
- package/dist/authored/index.js +18558 -0
- package/dist/authored-veto-DSnQcHGR.js +6 -0
- package/dist/browser-protocol-pvt4HFF7.js +5 -0
- package/dist/comparison-plan-CEQL0ooW.js +1338 -0
- package/dist/comparison-types-Dt-unJZY.d.ts +179 -0
- package/dist/create-editor-CkHtPWXV.js +1107 -0
- package/dist/diff/index.d.ts +32 -0
- package/dist/diff/index.js +1748 -0
- package/dist/dom/index.d.ts +2 -0
- package/dist/dom/index.js +2 -0
- package/dist/dom-Cgfscvnm.js +9220 -0
- package/dist/editor-owner-IUmkTeXz.js +171 -0
- package/dist/editor-view-lifetime-GJKa_QGh.js +23 -0
- package/dist/history/index.d.ts +170 -0
- package/dist/history/index.js +6718 -0
- package/dist/hyperscript/index.d.ts +2 -0
- package/dist/hyperscript/index.js +2 -0
- package/dist/hyperscript-FPuoArEi.js +299 -0
- package/dist/index-BpQx2UG4.d.ts +1093 -0
- package/dist/index-Cw-oC2ps.d.ts +190 -0
- package/dist/index-DPWyk3lG.d.ts +65 -0
- package/dist/index-DpltOCot.d.ts +9753 -0
- package/dist/index-HPYawTae.d.ts +119 -0
- package/dist/index-K0Za9YXc.d.ts +1246 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/internal/index.js +156 -0
- package/dist/mapped-view-store-ld-6uxEU.js +120 -0
- package/dist/native-grouping-input-DMNcsIaW.js +8 -0
- package/dist/pagination/index.d.ts +169 -0
- package/dist/pagination/index.js +2 -0
- package/dist/pagination/react.d.ts +33 -0
- package/dist/pagination/react.js +1509 -0
- package/dist/pagination-D_A8iPJP.js +1021 -0
- package/dist/plugin-DWzkJbnJ.js +50999 -0
- package/dist/range-geometry-BLAHRE11.d.ts +38 -0
- package/dist/range-geometry-BjeLHOnl.js +486 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.js +7 -0
- package/dist/react/virtualized.d.ts +13 -0
- package/dist/react/virtualized.js +209 -0
- package/dist/react-DZ15gmz2.js +1018 -0
- package/dist/retraction-BMem8Rfk.js +109 -0
- package/dist/src-cT1OTKP_.js +1386 -0
- package/dist/store-Cz2mXyDe.js +704 -0
- package/dist/testing/index.d.ts +183 -0
- package/dist/testing/index.js +96 -0
- package/dist/use-editor-dom-scope-BbMDSCpW.js +28354 -0
- package/dist/yjs/index.d.ts +2 -0
- package/dist/yjs/index.js +2 -0
- package/dist/yjs/react/index.d.ts +26 -0
- package/dist/yjs/react/index.js +85 -0
- package/dist/yjs-DOK-m7kl.js +13413 -0
- package/package.json +191 -43
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { $f as insertText, Dc as Editor, Df as deleteBackward, Hp as unhangRange, If as getChildren, Ii as setEditorFocused, Og as Point, Qs as Element, Rp as string, Si as getLiveSelection, Sp as positions, Tf as before, Uf as getSelection, Wf as getSnapshot, Yf as insertBreak, _g as Range, bc as AnyEditor, bf as Value, gp as move, kf as deleteForward, kp as replace, mc as Text, nh as Selection, oh as TextSelection, rp as isEditor, tp as isBlock, vh as Descendant, wf as after, xg as Location } from "../index-DpltOCot.js";
|
|
2
|
+
import { i as createHyperscript, o as createEditor } from "../index-HPYawTae.js";
|
|
3
|
+
//#region src/testing/createDataTransfer.d.ts
|
|
4
|
+
declare const createDataTransfer: (dataMap?: Map<string, string>) => DataTransfer;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/testing/jsx.d.ts
|
|
7
|
+
type TestEditorFixture = {
|
|
8
|
+
children: Element[];
|
|
9
|
+
selection?: Selection<TextSelection>;
|
|
10
|
+
};
|
|
11
|
+
type TestEditor = TestEditorFixture;
|
|
12
|
+
declare const projectTestSelectionRange: (selection: Selection | undefined) => Range | null;
|
|
13
|
+
declare const createEditorFromFixture: (fixture: TestEditorFixture) => Editor<Value>;
|
|
14
|
+
type HyperscriptIntrinsicAttributes = {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
children?: unknown;
|
|
17
|
+
};
|
|
18
|
+
declare global {
|
|
19
|
+
namespace JSX {
|
|
20
|
+
interface IntrinsicElements {
|
|
21
|
+
anchor: HyperscriptIntrinsicAttributes;
|
|
22
|
+
cursor: HyperscriptIntrinsicAttributes;
|
|
23
|
+
editor: HyperscriptIntrinsicAttributes;
|
|
24
|
+
element: HyperscriptIntrinsicAttributes;
|
|
25
|
+
focus: HyperscriptIntrinsicAttributes;
|
|
26
|
+
fragment: HyperscriptIntrinsicAttributes;
|
|
27
|
+
ha: HyperscriptIntrinsicAttributes;
|
|
28
|
+
haudio: HyperscriptIntrinsicAttributes;
|
|
29
|
+
hblockquote: HyperscriptIntrinsicAttributes;
|
|
30
|
+
hcallout: HyperscriptIntrinsicAttributes;
|
|
31
|
+
hcodeblock: HyperscriptIntrinsicAttributes;
|
|
32
|
+
hcolumn: HyperscriptIntrinsicAttributes;
|
|
33
|
+
hcolumngroup: HyperscriptIntrinsicAttributes;
|
|
34
|
+
hdate: HyperscriptIntrinsicAttributes;
|
|
35
|
+
hdefault: HyperscriptIntrinsicAttributes;
|
|
36
|
+
hdetails: HyperscriptIntrinsicAttributes;
|
|
37
|
+
hequation: HyperscriptIntrinsicAttributes;
|
|
38
|
+
hexcalidraw: HyperscriptIntrinsicAttributes;
|
|
39
|
+
hfile: HyperscriptIntrinsicAttributes;
|
|
40
|
+
hfootnoteDefinition: HyperscriptIntrinsicAttributes;
|
|
41
|
+
hfootnoteReference: HyperscriptIntrinsicAttributes;
|
|
42
|
+
hheading: HyperscriptIntrinsicAttributes;
|
|
43
|
+
himg: HyperscriptIntrinsicAttributes;
|
|
44
|
+
hinlineequation: HyperscriptIntrinsicAttributes;
|
|
45
|
+
hmediaembed: HyperscriptIntrinsicAttributes;
|
|
46
|
+
hmention: HyperscriptIntrinsicAttributes;
|
|
47
|
+
hnli: HyperscriptIntrinsicAttributes;
|
|
48
|
+
hp: HyperscriptIntrinsicAttributes;
|
|
49
|
+
hplaceholder: HyperscriptIntrinsicAttributes;
|
|
50
|
+
hsummary: HyperscriptIntrinsicAttributes;
|
|
51
|
+
htable: HyperscriptIntrinsicAttributes;
|
|
52
|
+
htd: HyperscriptIntrinsicAttributes;
|
|
53
|
+
htext: {
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
bold?: boolean;
|
|
56
|
+
children?: unknown;
|
|
57
|
+
code?: boolean;
|
|
58
|
+
italic?: boolean;
|
|
59
|
+
underline?: boolean;
|
|
60
|
+
};
|
|
61
|
+
hth: HyperscriptIntrinsicAttributes;
|
|
62
|
+
htoc: HyperscriptIntrinsicAttributes;
|
|
63
|
+
htodoli: HyperscriptIntrinsicAttributes;
|
|
64
|
+
htr: HyperscriptIntrinsicAttributes;
|
|
65
|
+
hvideo: HyperscriptIntrinsicAttributes;
|
|
66
|
+
selection: HyperscriptIntrinsicAttributes;
|
|
67
|
+
text: HyperscriptIntrinsicAttributes;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
declare const voidChildren: Text[];
|
|
72
|
+
declare const elements: {
|
|
73
|
+
readonly ha: {
|
|
74
|
+
readonly type: 'link';
|
|
75
|
+
};
|
|
76
|
+
readonly haudio: {
|
|
77
|
+
readonly type: 'audio';
|
|
78
|
+
};
|
|
79
|
+
readonly hblockquote: {
|
|
80
|
+
readonly type: 'blockquote';
|
|
81
|
+
};
|
|
82
|
+
readonly hcallout: {
|
|
83
|
+
readonly type: 'callout';
|
|
84
|
+
};
|
|
85
|
+
readonly hcodeblock: {
|
|
86
|
+
readonly type: 'codeBlock';
|
|
87
|
+
};
|
|
88
|
+
readonly hcolumn: {
|
|
89
|
+
readonly type: 'column';
|
|
90
|
+
};
|
|
91
|
+
readonly hcolumngroup: {
|
|
92
|
+
readonly type: 'columnGroup';
|
|
93
|
+
};
|
|
94
|
+
readonly hdate: {
|
|
95
|
+
readonly type: 'date';
|
|
96
|
+
};
|
|
97
|
+
readonly hdefault: {
|
|
98
|
+
readonly type: 'paragraph';
|
|
99
|
+
};
|
|
100
|
+
readonly hdetails: {
|
|
101
|
+
readonly type: 'details';
|
|
102
|
+
};
|
|
103
|
+
readonly hequation: {
|
|
104
|
+
readonly type: 'equation';
|
|
105
|
+
};
|
|
106
|
+
readonly hexcalidraw: {
|
|
107
|
+
readonly type: 'excalidraw';
|
|
108
|
+
};
|
|
109
|
+
readonly hfile: {
|
|
110
|
+
readonly type: 'file';
|
|
111
|
+
};
|
|
112
|
+
readonly hfootnoteDefinition: {
|
|
113
|
+
readonly type: 'footnoteDefinition';
|
|
114
|
+
};
|
|
115
|
+
readonly hfootnoteReference: {
|
|
116
|
+
readonly type: 'footnoteReference';
|
|
117
|
+
};
|
|
118
|
+
readonly hheading: {
|
|
119
|
+
readonly type: 'heading';
|
|
120
|
+
};
|
|
121
|
+
readonly himg: {
|
|
122
|
+
readonly type: 'image';
|
|
123
|
+
};
|
|
124
|
+
readonly hinlineequation: {
|
|
125
|
+
readonly type: 'inlineEquation';
|
|
126
|
+
};
|
|
127
|
+
readonly hmediaembed: {
|
|
128
|
+
readonly type: 'mediaEmbed';
|
|
129
|
+
};
|
|
130
|
+
readonly hmention: {
|
|
131
|
+
readonly type: 'mention';
|
|
132
|
+
};
|
|
133
|
+
readonly hnli: {
|
|
134
|
+
readonly type: 'nli';
|
|
135
|
+
};
|
|
136
|
+
readonly hp: {
|
|
137
|
+
readonly type: 'paragraph';
|
|
138
|
+
};
|
|
139
|
+
readonly hplaceholder: {
|
|
140
|
+
readonly type: 'placeholder';
|
|
141
|
+
};
|
|
142
|
+
readonly hsummary: {
|
|
143
|
+
readonly type: 'summary';
|
|
144
|
+
};
|
|
145
|
+
readonly htable: {
|
|
146
|
+
readonly type: 'table';
|
|
147
|
+
};
|
|
148
|
+
readonly htd: {
|
|
149
|
+
readonly type: 'tableCell';
|
|
150
|
+
};
|
|
151
|
+
readonly hth: {
|
|
152
|
+
readonly header: true;
|
|
153
|
+
readonly type: 'tableCell';
|
|
154
|
+
};
|
|
155
|
+
readonly htoc: {
|
|
156
|
+
readonly type: 'toc';
|
|
157
|
+
};
|
|
158
|
+
readonly htodoli: {
|
|
159
|
+
readonly type: 'todoList';
|
|
160
|
+
};
|
|
161
|
+
readonly htr: {
|
|
162
|
+
readonly type: 'tableRow';
|
|
163
|
+
};
|
|
164
|
+
readonly hvideo: {
|
|
165
|
+
readonly type: 'video';
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
type ElementTag = keyof typeof elements;
|
|
169
|
+
declare function jsx(tagName: 'editor', attributes?: object | null, ...children: unknown[]): TestEditor;
|
|
170
|
+
declare function jsx(tagName: 'fragment', attributes?: object | null, ...children: unknown[]): Descendant[];
|
|
171
|
+
declare function jsx(tagName: 'htext' | 'text', attributes?: object | null, ...children: unknown[]): Text;
|
|
172
|
+
declare function jsx(tagName: ElementTag, attributes?: object | null, ...children: unknown[]): Element;
|
|
173
|
+
declare const jsxt: typeof jsx;
|
|
174
|
+
declare const hjsx: typeof jsx;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/editor/end.d.ts
|
|
177
|
+
declare const end: (editor: AnyEditor, at: Location) => Point;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/internal/browser-protocol.d.ts
|
|
180
|
+
/** The editable element property `installBrowserHandle()` sets. */
|
|
181
|
+
declare const BROWSER_HANDLE_KEY = "__EDITOR_BROWSER_HANDLE__";
|
|
182
|
+
//#endregion
|
|
183
|
+
export { BROWSER_HANDLE_KEY, TestEditor, TestEditorFixture, after, before, createDataTransfer, createEditor, createEditorFromFixture, createHyperscript, deleteBackward, deleteForward, elements, end, getChildren, getLiveSelection as getEditorLiveSelection, getSelection, getSnapshot, hjsx, insertBreak, insertText, isBlock, isEditor, jsx, jsxt, move, positions, projectTestSelectionRange, replace, setEditorFocused, string, unhangRange, voidChildren };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Bt as point, Ft as move, J as deleteForward, Jt as replace, K as deleteBackward, St as isEditor, U as after, Vt as positions, W as before, bt as isBlock, ct as getSelection, lt as getSnapshot, mt as insertBreak, mu as RangeApi, ni as setEditorFocused, or as getLiveSelection, rn as string, sn as unhangRange, tt as getChildren, vt as insertText } from "../plugin-DWzkJbnJ.js";
|
|
2
|
+
import { a as createEditor$1 } from "../create-editor-CkHtPWXV.js";
|
|
3
|
+
import { a as createText, i as createEditorFixture, n as createHyperscript, r as createEditor, t as jsx$1 } from "../hyperscript-FPuoArEi.js";
|
|
4
|
+
import { t as BROWSER_HANDLE_KEY } from "../browser-protocol-pvt4HFF7.js";
|
|
5
|
+
//#region src/testing/createDataTransfer.ts
|
|
6
|
+
const createDataTransfer = (dataMap = /* @__PURE__ */ new Map()) => ({
|
|
7
|
+
files: [],
|
|
8
|
+
getData: (type) => dataMap.get(type) ?? "",
|
|
9
|
+
setData: (type, value) => {
|
|
10
|
+
dataMap.set(type, value);
|
|
11
|
+
},
|
|
12
|
+
get types() {
|
|
13
|
+
return [...dataMap.keys()];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/testing/jsx.ts
|
|
18
|
+
const projectTestSelectionRange = (selection) => {
|
|
19
|
+
if (!selection) return null;
|
|
20
|
+
if (!RangeApi.isRange(selection)) throw new Error("Expected a range-backed test selection.");
|
|
21
|
+
return {
|
|
22
|
+
anchor: selection.anchor,
|
|
23
|
+
focus: selection.focus
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const createEditorFromFixture = (fixture) => createEditor$1({
|
|
27
|
+
initialSelection: fixture.selection,
|
|
28
|
+
...fixture.children.length > 0 ? { initialValue: fixture.children } : {}
|
|
29
|
+
});
|
|
30
|
+
const voidChildren = [{ text: "" }];
|
|
31
|
+
const elements = {
|
|
32
|
+
ha: { type: "link" },
|
|
33
|
+
haudio: { type: "audio" },
|
|
34
|
+
hblockquote: { type: "blockquote" },
|
|
35
|
+
hcallout: { type: "callout" },
|
|
36
|
+
hcodeblock: { type: "codeBlock" },
|
|
37
|
+
hcolumn: { type: "column" },
|
|
38
|
+
hcolumngroup: { type: "columnGroup" },
|
|
39
|
+
hdate: { type: "date" },
|
|
40
|
+
hdefault: { type: "paragraph" },
|
|
41
|
+
hdetails: { type: "details" },
|
|
42
|
+
hequation: { type: "equation" },
|
|
43
|
+
hexcalidraw: { type: "excalidraw" },
|
|
44
|
+
hfile: { type: "file" },
|
|
45
|
+
hfootnoteDefinition: { type: "footnoteDefinition" },
|
|
46
|
+
hfootnoteReference: { type: "footnoteReference" },
|
|
47
|
+
hheading: { type: "heading" },
|
|
48
|
+
himg: { type: "image" },
|
|
49
|
+
hinlineequation: { type: "inlineEquation" },
|
|
50
|
+
hmediaembed: { type: "mediaEmbed" },
|
|
51
|
+
hmention: { type: "mention" },
|
|
52
|
+
hnli: { type: "nli" },
|
|
53
|
+
hp: { type: "paragraph" },
|
|
54
|
+
hplaceholder: { type: "placeholder" },
|
|
55
|
+
hsummary: { type: "summary" },
|
|
56
|
+
htable: { type: "table" },
|
|
57
|
+
htd: { type: "tableCell" },
|
|
58
|
+
hth: {
|
|
59
|
+
header: true,
|
|
60
|
+
type: "tableCell"
|
|
61
|
+
},
|
|
62
|
+
htoc: { type: "toc" },
|
|
63
|
+
htodoli: { type: "todoList" },
|
|
64
|
+
htr: { type: "tableRow" },
|
|
65
|
+
hvideo: { type: "video" }
|
|
66
|
+
};
|
|
67
|
+
const createElementWithDefaultText = (type) => (_tagName, attributes, children) => ({
|
|
68
|
+
type,
|
|
69
|
+
...attributes,
|
|
70
|
+
children: children.length > 0 ? jsx$1("fragment", {}, ...children) : voidChildren.map((child) => ({ ...child }))
|
|
71
|
+
});
|
|
72
|
+
const plateHyperscript = createHyperscript({
|
|
73
|
+
creators: {
|
|
74
|
+
haudio: createElementWithDefaultText("audio"),
|
|
75
|
+
hdate: createElementWithDefaultText("date"),
|
|
76
|
+
hfile: createElementWithDefaultText("file"),
|
|
77
|
+
himg: createElementWithDefaultText("image"),
|
|
78
|
+
hmediaembed: createElementWithDefaultText("mediaEmbed"),
|
|
79
|
+
hmention: createElementWithDefaultText("mention"),
|
|
80
|
+
hplaceholder: createElementWithDefaultText("placeholder"),
|
|
81
|
+
hvideo: createElementWithDefaultText("video"),
|
|
82
|
+
editor: createEditorFixture,
|
|
83
|
+
htext: createText
|
|
84
|
+
},
|
|
85
|
+
elements
|
|
86
|
+
});
|
|
87
|
+
function jsx(tagName, attributes, ...children) {
|
|
88
|
+
return plateHyperscript(tagName, attributes ?? void 0, ...children);
|
|
89
|
+
}
|
|
90
|
+
const jsxt = jsx;
|
|
91
|
+
const hjsx = jsx;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/editor/end.ts
|
|
94
|
+
const end = (editor, at) => point(editor, at, { edge: "end" });
|
|
95
|
+
//#endregion
|
|
96
|
+
export { BROWSER_HANDLE_KEY, after, before, createDataTransfer, createEditor, createEditorFromFixture, createHyperscript, deleteBackward, deleteForward, elements, end, getChildren, getLiveSelection as getEditorLiveSelection, getSelection, getSnapshot, hjsx, insertBreak, insertText, isBlock, isEditor, jsx, jsxt, move, positions, projectTestSelectionRange, replace, setEditorFocused, string, unhangRange, voidChildren };
|