@prosekit/extensions 0.7.18 → 0.7.20
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/dist/_tsup-dts-rollup.d.ts +2463 -2312
- package/dist/prosekit-extensions-autocomplete.d.ts +3 -3
- package/dist/prosekit-extensions-blockquote.d.ts +8 -8
- package/dist/prosekit-extensions-bold.d.ts +8 -8
- package/dist/prosekit-extensions-code-block.d.ts +20 -20
- package/dist/prosekit-extensions-code.d.ts +8 -8
- package/dist/prosekit-extensions-commit.d.ts +4 -4
- package/dist/prosekit-extensions-drop-cursor.d.ts +3 -3
- package/dist/prosekit-extensions-enter-rule.d.ts +5 -5
- package/dist/prosekit-extensions-file.d.ts +8 -0
- package/dist/prosekit-extensions-file.js +151 -0
- package/dist/prosekit-extensions-gap-cursor.d.ts +2 -2
- package/dist/prosekit-extensions-heading.d.ts +9 -9
- package/dist/prosekit-extensions-horizontal-rule.d.ts +8 -8
- package/dist/prosekit-extensions-image.d.ts +7 -7
- package/dist/prosekit-extensions-image.js +14 -2
- package/dist/prosekit-extensions-input-rule.d.ts +6 -6
- package/dist/prosekit-extensions-italic.d.ts +8 -8
- package/dist/prosekit-extensions-link.d.ts +10 -10
- package/dist/prosekit-extensions-list.d.ts +16 -16
- package/dist/prosekit-extensions-loro.d.ts +11 -11
- package/dist/prosekit-extensions-mark-rule.d.ts +2 -2
- package/dist/prosekit-extensions-mention.d.ts +4 -4
- package/dist/prosekit-extensions-mod-click-prevention.d.ts +2 -2
- package/dist/prosekit-extensions-placeholder.d.ts +2 -2
- package/dist/prosekit-extensions-placeholder.js +2 -2
- package/dist/prosekit-extensions-readonly.d.ts +1 -1
- package/dist/prosekit-extensions-search.d.ts +3 -3
- package/dist/prosekit-extensions-strike.d.ts +8 -8
- package/dist/prosekit-extensions-table.d.ts +25 -25
- package/dist/prosekit-extensions-text-align.d.ts +8 -8
- package/dist/prosekit-extensions-underline.d.ts +7 -7
- package/dist/prosekit-extensions-virtual-selection.d.ts +2 -2
- package/dist/prosekit-extensions-yjs.d.ts +14 -14
- package/package.json +19 -11
@@ -1,3 +1,3 @@
|
|
1
|
-
export { defineAutocomplete_alias_1 as defineAutocomplete } from './_tsup-dts-rollup';
|
2
|
-
export { AutocompleteRule_alias_1 as AutocompleteRule } from './_tsup-dts-rollup';
|
3
|
-
export { MatchHandler_alias_1 as MatchHandler } from './_tsup-dts-rollup';
|
1
|
+
export { defineAutocomplete_alias_1 as defineAutocomplete } from './_tsup-dts-rollup.js';
|
2
|
+
export { AutocompleteRule_alias_1 as AutocompleteRule } from './_tsup-dts-rollup.js';
|
3
|
+
export { MatchHandler_alias_1 as MatchHandler } from './_tsup-dts-rollup.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { defineBlockquote_alias_1 as defineBlockquote } from './_tsup-dts-rollup';
|
2
|
-
export { BlockquoteExtension_alias_1 as BlockquoteExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineBlockquoteCommands_alias_1 as defineBlockquoteCommands } from './_tsup-dts-rollup';
|
4
|
-
export { BlockquoteCommandsExtension_alias_1 as BlockquoteCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineBlockquoteInputRule_alias_1 as defineBlockquoteInputRule } from './_tsup-dts-rollup';
|
6
|
-
export { defineBlockquoteKeymap_alias_1 as defineBlockquoteKeymap } from './_tsup-dts-rollup';
|
7
|
-
export { defineBlockquoteSpec_alias_1 as defineBlockquoteSpec } from './_tsup-dts-rollup';
|
8
|
-
export { BlockquoteSpecExtension_alias_1 as BlockquoteSpecExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineBlockquote_alias_1 as defineBlockquote } from './_tsup-dts-rollup.js';
|
2
|
+
export { BlockquoteExtension_alias_1 as BlockquoteExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineBlockquoteCommands_alias_1 as defineBlockquoteCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { BlockquoteCommandsExtension_alias_1 as BlockquoteCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineBlockquoteInputRule_alias_1 as defineBlockquoteInputRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineBlockquoteKeymap_alias_1 as defineBlockquoteKeymap } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineBlockquoteSpec_alias_1 as defineBlockquoteSpec } from './_tsup-dts-rollup.js';
|
8
|
+
export { BlockquoteSpecExtension_alias_1 as BlockquoteSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { defineBold_alias_1 as defineBold } from './_tsup-dts-rollup';
|
2
|
-
export { BoldExtension_alias_1 as BoldExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineBoldCommands_alias_1 as defineBoldCommands } from './_tsup-dts-rollup';
|
4
|
-
export { BoldCommandsExtension_alias_1 as BoldCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineBoldInputRule_alias_1 as defineBoldInputRule } from './_tsup-dts-rollup';
|
6
|
-
export { defineBoldKeymap_alias_1 as defineBoldKeymap } from './_tsup-dts-rollup';
|
7
|
-
export { defineBoldSpec_alias_1 as defineBoldSpec } from './_tsup-dts-rollup';
|
8
|
-
export { BoldSpecExtension_alias_1 as BoldSpecExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineBold_alias_1 as defineBold } from './_tsup-dts-rollup.js';
|
2
|
+
export { BoldExtension_alias_1 as BoldExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineBoldCommands_alias_1 as defineBoldCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { BoldCommandsExtension_alias_1 as BoldCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineBoldInputRule_alias_1 as defineBoldInputRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineBoldKeymap_alias_1 as defineBoldKeymap } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineBoldSpec_alias_1 as defineBoldSpec } from './_tsup-dts-rollup.js';
|
8
|
+
export { BoldSpecExtension_alias_1 as BoldSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -1,20 +1,20 @@
|
|
1
|
-
export { defineCodeBlock_alias_1 as defineCodeBlock } from './_tsup-dts-rollup';
|
2
|
-
export { CodeBlockExtension_alias_1 as CodeBlockExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineCodeBlockCommands_alias_1 as defineCodeBlockCommands } from './_tsup-dts-rollup';
|
4
|
-
export { CodeBlockCommandsExtension_alias_1 as CodeBlockCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineCodeBlockHighlight_alias_1 as defineCodeBlockHighlight } from './_tsup-dts-rollup';
|
6
|
-
export { CodeBlockHighlightOptions_alias_1 as CodeBlockHighlightOptions } from './_tsup-dts-rollup';
|
7
|
-
export { HighlightParser_alias_1 as HighlightParser } from './_tsup-dts-rollup';
|
8
|
-
export { defineCodeBlockEnterRule_alias_1 as defineCodeBlockEnterRule } from './_tsup-dts-rollup';
|
9
|
-
export { defineCodeBlockInputRule_alias_1 as defineCodeBlockInputRule } from './_tsup-dts-rollup';
|
10
|
-
export { defineCodeBlockKeymap_alias_1 as defineCodeBlockKeymap } from './_tsup-dts-rollup';
|
11
|
-
export { defineCodeBlockShiki_alias_1 as defineCodeBlockShiki } from './_tsup-dts-rollup';
|
12
|
-
export { defineCodeBlockSpec_alias_1 as defineCodeBlockSpec } from './_tsup-dts-rollup';
|
13
|
-
export { CodeBlockSpecExtension_alias_1 as CodeBlockSpecExtension } from './_tsup-dts-rollup';
|
14
|
-
export { CodeBlockAttrs_alias_1 as CodeBlockAttrs } from './_tsup-dts-rollup';
|
15
|
-
export { shikiBundledLanguagesInfo } from './_tsup-dts-rollup';
|
16
|
-
export { shikiBundledThemesInfo } from './_tsup-dts-rollup';
|
17
|
-
export { ShikiBundledLanguage } from './_tsup-dts-rollup';
|
18
|
-
export { ShikiBundledLanguageInfo } from './_tsup-dts-rollup';
|
19
|
-
export { ShikiBundledTheme } from './_tsup-dts-rollup';
|
20
|
-
export { ShikiBundledThemeInfo } from './_tsup-dts-rollup';
|
1
|
+
export { defineCodeBlock_alias_1 as defineCodeBlock } from './_tsup-dts-rollup.js';
|
2
|
+
export { CodeBlockExtension_alias_1 as CodeBlockExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineCodeBlockCommands_alias_1 as defineCodeBlockCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { CodeBlockCommandsExtension_alias_1 as CodeBlockCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineCodeBlockHighlight_alias_1 as defineCodeBlockHighlight } from './_tsup-dts-rollup.js';
|
6
|
+
export { CodeBlockHighlightOptions_alias_1 as CodeBlockHighlightOptions } from './_tsup-dts-rollup.js';
|
7
|
+
export { HighlightParser_alias_1 as HighlightParser } from './_tsup-dts-rollup.js';
|
8
|
+
export { defineCodeBlockEnterRule_alias_1 as defineCodeBlockEnterRule } from './_tsup-dts-rollup.js';
|
9
|
+
export { defineCodeBlockInputRule_alias_1 as defineCodeBlockInputRule } from './_tsup-dts-rollup.js';
|
10
|
+
export { defineCodeBlockKeymap_alias_1 as defineCodeBlockKeymap } from './_tsup-dts-rollup.js';
|
11
|
+
export { defineCodeBlockShiki_alias_1 as defineCodeBlockShiki } from './_tsup-dts-rollup.js';
|
12
|
+
export { defineCodeBlockSpec_alias_1 as defineCodeBlockSpec } from './_tsup-dts-rollup.js';
|
13
|
+
export { CodeBlockSpecExtension_alias_1 as CodeBlockSpecExtension } from './_tsup-dts-rollup.js';
|
14
|
+
export { CodeBlockAttrs_alias_1 as CodeBlockAttrs } from './_tsup-dts-rollup.js';
|
15
|
+
export { shikiBundledLanguagesInfo } from './_tsup-dts-rollup.js';
|
16
|
+
export { shikiBundledThemesInfo } from './_tsup-dts-rollup.js';
|
17
|
+
export { ShikiBundledLanguage } from './_tsup-dts-rollup.js';
|
18
|
+
export { ShikiBundledLanguageInfo } from './_tsup-dts-rollup.js';
|
19
|
+
export { ShikiBundledTheme } from './_tsup-dts-rollup.js';
|
20
|
+
export { ShikiBundledThemeInfo } from './_tsup-dts-rollup.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { defineCode_alias_1 as defineCode } from './_tsup-dts-rollup';
|
2
|
-
export { CodeExtension_alias_1 as CodeExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineCodeCommands_alias_1 as defineCodeCommands } from './_tsup-dts-rollup';
|
4
|
-
export { CodeCommandsExtension_alias_1 as CodeCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineCodeInputRule_alias_1 as defineCodeInputRule } from './_tsup-dts-rollup';
|
6
|
-
export { defineCodeKeymap_alias_1 as defineCodeKeymap } from './_tsup-dts-rollup';
|
7
|
-
export { defineCodeSpec_alias_1 as defineCodeSpec } from './_tsup-dts-rollup';
|
8
|
-
export { CodeSpecExtension_alias_1 as CodeSpecExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineCode_alias_1 as defineCode } from './_tsup-dts-rollup.js';
|
2
|
+
export { CodeExtension_alias_1 as CodeExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineCodeCommands_alias_1 as defineCodeCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { CodeCommandsExtension_alias_1 as CodeCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineCodeInputRule_alias_1 as defineCodeInputRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineCodeKeymap_alias_1 as defineCodeKeymap } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineCodeSpec_alias_1 as defineCodeSpec } from './_tsup-dts-rollup.js';
|
8
|
+
export { CodeSpecExtension_alias_1 as CodeSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { CommitRecorder } from './_tsup-dts-rollup';
|
2
|
-
export { defineCommitRecorder } from './_tsup-dts-rollup';
|
3
|
-
export { defineCommitViewer } from './_tsup-dts-rollup';
|
4
|
-
export { Commit } from './_tsup-dts-rollup';
|
1
|
+
export { CommitRecorder } from './_tsup-dts-rollup.js';
|
2
|
+
export { defineCommitRecorder } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineCommitViewer } from './_tsup-dts-rollup.js';
|
4
|
+
export { Commit } from './_tsup-dts-rollup.js';
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { DropCursorOptions_alias_1 as DropCursorOptions } from './_tsup-dts-rollup';
|
2
|
-
export { DropCursorExtension_alias_1 as DropCursorExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineDropCursor_alias_1 as defineDropCursor } from './_tsup-dts-rollup';
|
1
|
+
export { DropCursorOptions_alias_1 as DropCursorOptions } from './_tsup-dts-rollup.js';
|
2
|
+
export { DropCursorExtension_alias_1 as DropCursorExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineDropCursor_alias_1 as defineDropCursor } from './_tsup-dts-rollup.js';
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export { defineEnterRule } from './_tsup-dts-rollup';
|
2
|
-
export { defineTextBlockEnterRule } from './_tsup-dts-rollup';
|
3
|
-
export { EnterRuleHandler } from './_tsup-dts-rollup';
|
4
|
-
export { EnterRuleOptions } from './_tsup-dts-rollup';
|
5
|
-
export { TextBlockEnterRuleOptions } from './_tsup-dts-rollup';
|
1
|
+
export { defineEnterRule } from './_tsup-dts-rollup.js';
|
2
|
+
export { defineTextBlockEnterRule } from './_tsup-dts-rollup.js';
|
3
|
+
export { EnterRuleHandler } from './_tsup-dts-rollup.js';
|
4
|
+
export { EnterRuleOptions } from './_tsup-dts-rollup.js';
|
5
|
+
export { TextBlockEnterRuleOptions } from './_tsup-dts-rollup.js';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
export { defineFilePasteHandler_alias_1 as defineFilePasteHandler } from './_tsup-dts-rollup.js';
|
2
|
+
export { FilePasteHandlerOptions_alias_1 as FilePasteHandlerOptions } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineFileDropHandler_alias_1 as defineFileDropHandler } from './_tsup-dts-rollup.js';
|
4
|
+
export { FileDropHandlerOptions_alias_1 as FileDropHandlerOptions } from './_tsup-dts-rollup.js';
|
5
|
+
export { UploadProgress_alias_1 as UploadProgress } from './_tsup-dts-rollup.js';
|
6
|
+
export { UploaderOptions_alias_1 as UploaderOptions } from './_tsup-dts-rollup.js';
|
7
|
+
export { Uploader_alias_1 as Uploader } from './_tsup-dts-rollup.js';
|
8
|
+
export { UploadTask_alias_1 as UploadTask } from './_tsup-dts-rollup.js';
|
@@ -0,0 +1,151 @@
|
|
1
|
+
// src/file/file-paste-handler.ts
|
2
|
+
import {
|
3
|
+
defineFacet,
|
4
|
+
defineFacetPayload,
|
5
|
+
editorEventFacet
|
6
|
+
} from "@prosekit/core";
|
7
|
+
|
8
|
+
// src/file/helpers.ts
|
9
|
+
function handleFile(view, event, file, handlers) {
|
10
|
+
for (let i = handlers.length - 1; i >= 0; i--) {
|
11
|
+
const handler = handlers[i];
|
12
|
+
if (handler({ view, event, file })) {
|
13
|
+
return true;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
function handleEvent(view, event, handlers, getFiles3) {
|
19
|
+
const files = getFiles3(event);
|
20
|
+
let handled = false;
|
21
|
+
for (const file of files) {
|
22
|
+
if (handleFile(view, event, file, handlers)) {
|
23
|
+
handled = true;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
return handled;
|
27
|
+
}
|
28
|
+
|
29
|
+
// src/file/file-paste-handler.ts
|
30
|
+
function defineFilePasteHandler(handler) {
|
31
|
+
return defineFacetPayload(facet, [handler]);
|
32
|
+
}
|
33
|
+
function getFiles(event) {
|
34
|
+
var _a, _b;
|
35
|
+
return Array.from((_b = (_a = event.clipboardData) == null ? void 0 : _a.files) != null ? _b : []);
|
36
|
+
}
|
37
|
+
var facet = defineFacet({
|
38
|
+
parent: editorEventFacet,
|
39
|
+
singleton: true,
|
40
|
+
reducer: (handlers) => {
|
41
|
+
const pasteHandler = (view, event) => {
|
42
|
+
return handleEvent(view, event, handlers, getFiles);
|
43
|
+
};
|
44
|
+
return ["paste", pasteHandler];
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
// src/file/file-drop-handler.ts
|
49
|
+
import {
|
50
|
+
defineFacet as defineFacet2,
|
51
|
+
defineFacetPayload as defineFacetPayload2,
|
52
|
+
editorEventFacet as editorEventFacet2
|
53
|
+
} from "@prosekit/core";
|
54
|
+
function defineFileDropHandler(handler) {
|
55
|
+
return defineFacetPayload2(facet2, [handler]);
|
56
|
+
}
|
57
|
+
function getFiles2(event) {
|
58
|
+
var _a, _b;
|
59
|
+
return Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);
|
60
|
+
}
|
61
|
+
var facet2 = defineFacet2({
|
62
|
+
parent: editorEventFacet2,
|
63
|
+
singleton: true,
|
64
|
+
reducer: (handlers) => {
|
65
|
+
const dropHandler = (view, event) => {
|
66
|
+
const position = view.posAtCoords({ left: event.x, top: event.y });
|
67
|
+
if (!position) {
|
68
|
+
return false;
|
69
|
+
}
|
70
|
+
const pos = position.inside > 0 ? position.inside : position.pos;
|
71
|
+
return handleEvent(
|
72
|
+
view,
|
73
|
+
event,
|
74
|
+
handlers.map((handler) => (options) => handler({ ...options, pos })),
|
75
|
+
getFiles2
|
76
|
+
);
|
77
|
+
};
|
78
|
+
return ["drop", dropHandler];
|
79
|
+
}
|
80
|
+
});
|
81
|
+
|
82
|
+
// src/file/file-upload.ts
|
83
|
+
var UploadTask = class {
|
84
|
+
/**
|
85
|
+
* Creates a new upload task. You can find the upload task by its object URL
|
86
|
+
* later using `UploadTask.get()`.
|
87
|
+
*
|
88
|
+
* @param options - The options for the upload task.
|
89
|
+
*/
|
90
|
+
constructor({ file, uploader }) {
|
91
|
+
/**
|
92
|
+
* A boolean indicating whether the upload is complete (either successfully or with an error).
|
93
|
+
*/
|
94
|
+
this.done = false;
|
95
|
+
this.subscribers = [];
|
96
|
+
this.objectURL = URL.createObjectURL(file);
|
97
|
+
this.finished = new Promise((resolve, reject) => {
|
98
|
+
const maybePromise = uploader({
|
99
|
+
file,
|
100
|
+
onProgress: (progress) => {
|
101
|
+
for (const subscriber of this.subscribers) {
|
102
|
+
subscriber(progress);
|
103
|
+
}
|
104
|
+
}
|
105
|
+
});
|
106
|
+
Promise.resolve(maybePromise).then(
|
107
|
+
(result) => {
|
108
|
+
this.done = true;
|
109
|
+
URL.revokeObjectURL(this.objectURL);
|
110
|
+
resolve(result);
|
111
|
+
},
|
112
|
+
(error) => {
|
113
|
+
this.done = true;
|
114
|
+
reject(
|
115
|
+
new Error("[prosekit] Failed to upload file", { cause: error })
|
116
|
+
);
|
117
|
+
}
|
118
|
+
);
|
119
|
+
});
|
120
|
+
store.set(this.objectURL, this);
|
121
|
+
}
|
122
|
+
/**
|
123
|
+
* Subscribes to progress updates. Returns a function to unsubscribe.
|
124
|
+
*/
|
125
|
+
subscribeProgress(callback) {
|
126
|
+
this.subscribers.push(callback);
|
127
|
+
return () => {
|
128
|
+
this.subscribers = this.subscribers.filter(
|
129
|
+
(subscriber) => subscriber !== callback
|
130
|
+
);
|
131
|
+
};
|
132
|
+
}
|
133
|
+
/**
|
134
|
+
* Finds an upload task by its object URL.
|
135
|
+
*/
|
136
|
+
static get(objectURL) {
|
137
|
+
return store.get(objectURL);
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Deletes an upload task by its object URL.
|
141
|
+
*/
|
142
|
+
static delete(objectURL) {
|
143
|
+
store.delete(objectURL);
|
144
|
+
}
|
145
|
+
};
|
146
|
+
var store = /* @__PURE__ */ new Map();
|
147
|
+
export {
|
148
|
+
UploadTask,
|
149
|
+
defineFileDropHandler,
|
150
|
+
defineFilePasteHandler
|
151
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { defineGapCursor_alias_1 as defineGapCursor } from './_tsup-dts-rollup';
|
2
|
-
export { GapCursorExtension_alias_1 as GapCursorExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineGapCursor_alias_1 as defineGapCursor } from './_tsup-dts-rollup.js';
|
2
|
+
export { GapCursorExtension_alias_1 as GapCursorExtension } from './_tsup-dts-rollup.js';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
export { defineHeading_alias_1 as defineHeading } from './_tsup-dts-rollup';
|
2
|
-
export { HeadingExtension_alias_1 as HeadingExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineHeadingCommands_alias_1 as defineHeadingCommands } from './_tsup-dts-rollup';
|
4
|
-
export { HeadingCommandsExtension_alias_1 as HeadingCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineHeadingInputRule_alias_1 as defineHeadingInputRule } from './_tsup-dts-rollup';
|
6
|
-
export { defineHeadingKeymap_alias_1 as defineHeadingKeymap } from './_tsup-dts-rollup';
|
7
|
-
export { defineHeadingSpec_alias_1 as defineHeadingSpec } from './_tsup-dts-rollup';
|
8
|
-
export { HeadingSpecExtension_alias_1 as HeadingSpecExtension } from './_tsup-dts-rollup';
|
9
|
-
export { HeadingAttrs_alias_1 as HeadingAttrs } from './_tsup-dts-rollup';
|
1
|
+
export { defineHeading_alias_1 as defineHeading } from './_tsup-dts-rollup.js';
|
2
|
+
export { HeadingExtension_alias_1 as HeadingExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineHeadingCommands_alias_1 as defineHeadingCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { HeadingCommandsExtension_alias_1 as HeadingCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineHeadingInputRule_alias_1 as defineHeadingInputRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineHeadingKeymap_alias_1 as defineHeadingKeymap } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineHeadingSpec_alias_1 as defineHeadingSpec } from './_tsup-dts-rollup.js';
|
8
|
+
export { HeadingSpecExtension_alias_1 as HeadingSpecExtension } from './_tsup-dts-rollup.js';
|
9
|
+
export { HeadingAttrs_alias_1 as HeadingAttrs } from './_tsup-dts-rollup.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { defineHorizontalRule_alias_1 as defineHorizontalRule } from './_tsup-dts-rollup';
|
2
|
-
export { HorizontalRuleExtension_alias_1 as HorizontalRuleExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineHorizontalRuleCommands_alias_1 as defineHorizontalRuleCommands } from './_tsup-dts-rollup';
|
4
|
-
export { insertHorizontalRule_alias_1 as insertHorizontalRule } from './_tsup-dts-rollup';
|
5
|
-
export { HorizontalRuleCommandsExtension_alias_1 as HorizontalRuleCommandsExtension } from './_tsup-dts-rollup';
|
6
|
-
export { defineHorizontalRuleInputRule_alias_1 as defineHorizontalRuleInputRule } from './_tsup-dts-rollup';
|
7
|
-
export { defineHorizontalRuleSpec_alias_1 as defineHorizontalRuleSpec } from './_tsup-dts-rollup';
|
8
|
-
export { HorizontalRuleSpecExtension_alias_1 as HorizontalRuleSpecExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineHorizontalRule_alias_1 as defineHorizontalRule } from './_tsup-dts-rollup.js';
|
2
|
+
export { HorizontalRuleExtension_alias_1 as HorizontalRuleExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineHorizontalRuleCommands_alias_1 as defineHorizontalRuleCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { insertHorizontalRule_alias_1 as insertHorizontalRule } from './_tsup-dts-rollup.js';
|
5
|
+
export { HorizontalRuleCommandsExtension_alias_1 as HorizontalRuleCommandsExtension } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineHorizontalRuleInputRule_alias_1 as defineHorizontalRuleInputRule } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineHorizontalRuleSpec_alias_1 as defineHorizontalRuleSpec } from './_tsup-dts-rollup.js';
|
8
|
+
export { HorizontalRuleSpecExtension_alias_1 as HorizontalRuleSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -1,7 +1,7 @@
|
|
1
|
-
export { defineImage_alias_1 as defineImage } from './_tsup-dts-rollup';
|
2
|
-
export { ImageExtension_alias_1 as ImageExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineImageCommands_alias_1 as defineImageCommands } from './_tsup-dts-rollup';
|
4
|
-
export { ImageCommandsExtension_alias_1 as ImageCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineImageSpec_alias_1 as defineImageSpec } from './_tsup-dts-rollup';
|
6
|
-
export { ImageAttrs_alias_1 as ImageAttrs } from './_tsup-dts-rollup';
|
7
|
-
export { ImageSpecExtension_alias_1 as ImageSpecExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineImage_alias_1 as defineImage } from './_tsup-dts-rollup.js';
|
2
|
+
export { ImageExtension_alias_1 as ImageExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineImageCommands_alias_1 as defineImageCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { ImageCommandsExtension_alias_1 as ImageCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineImageSpec_alias_1 as defineImageSpec } from './_tsup-dts-rollup.js';
|
6
|
+
export { ImageAttrs_alias_1 as ImageAttrs } from './_tsup-dts-rollup.js';
|
7
|
+
export { ImageSpecExtension_alias_1 as ImageSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -17,7 +17,9 @@ function defineImageSpec() {
|
|
17
17
|
return defineNodeSpec({
|
18
18
|
name: "image",
|
19
19
|
attrs: {
|
20
|
-
src: { default: null }
|
20
|
+
src: { default: null },
|
21
|
+
width: { default: null },
|
22
|
+
height: { default: null }
|
21
23
|
},
|
22
24
|
group: "block",
|
23
25
|
defining: true,
|
@@ -30,7 +32,17 @@ function defineImageSpec() {
|
|
30
32
|
return { src: null };
|
31
33
|
}
|
32
34
|
const src = element.getAttribute("src") || null;
|
33
|
-
|
35
|
+
let width = null;
|
36
|
+
let height = null;
|
37
|
+
const rect = element.getBoundingClientRect();
|
38
|
+
if (rect.width > 0 && rect.height > 0) {
|
39
|
+
width = rect.width;
|
40
|
+
height = rect.height;
|
41
|
+
} else if (element instanceof HTMLImageElement && element.naturalWidth > 0 && element.naturalHeight > 0) {
|
42
|
+
width = element.naturalWidth;
|
43
|
+
height = element.naturalHeight;
|
44
|
+
}
|
45
|
+
return { src, width, height };
|
34
46
|
}
|
35
47
|
}
|
36
48
|
],
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export { defineInputRule } from './_tsup-dts-rollup';
|
2
|
-
export { createMarkInputRule } from './_tsup-dts-rollup';
|
3
|
-
export { defineMarkInputRule } from './_tsup-dts-rollup';
|
4
|
-
export { defineTextBlockInputRule } from './_tsup-dts-rollup';
|
5
|
-
export { defineWrappingInputRule } from './_tsup-dts-rollup';
|
6
|
-
export { MarkInputRuleOptions } from './_tsup-dts-rollup';
|
1
|
+
export { defineInputRule } from './_tsup-dts-rollup.js';
|
2
|
+
export { createMarkInputRule } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineMarkInputRule } from './_tsup-dts-rollup.js';
|
4
|
+
export { defineTextBlockInputRule } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineWrappingInputRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { MarkInputRuleOptions } from './_tsup-dts-rollup.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { defineItalic } from './_tsup-dts-rollup';
|
2
|
-
export { ItalicExtension } from './_tsup-dts-rollup';
|
3
|
-
export { defineItalicCommands } from './_tsup-dts-rollup';
|
4
|
-
export { ItalicCommandsExtension } from './_tsup-dts-rollup';
|
5
|
-
export { defineItalicInputRule } from './_tsup-dts-rollup';
|
6
|
-
export { defineItalicKeymap } from './_tsup-dts-rollup';
|
7
|
-
export { defineItalicSpec } from './_tsup-dts-rollup';
|
8
|
-
export { ItalicSpecExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineItalic } from './_tsup-dts-rollup.js';
|
2
|
+
export { ItalicExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineItalicCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { ItalicCommandsExtension } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineItalicInputRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineItalicKeymap } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineItalicSpec } from './_tsup-dts-rollup.js';
|
8
|
+
export { ItalicSpecExtension } from './_tsup-dts-rollup.js';
|
@@ -1,10 +1,10 @@
|
|
1
|
-
export { defineLinkSpec } from './_tsup-dts-rollup';
|
2
|
-
export { defineLinkCommands } from './_tsup-dts-rollup';
|
3
|
-
export { defineLinkInputRule } from './_tsup-dts-rollup';
|
4
|
-
export { defineLinkEnterRule } from './_tsup-dts-rollup';
|
5
|
-
export { defineLinkMarkRule } from './_tsup-dts-rollup';
|
6
|
-
export { defineLink } from './_tsup-dts-rollup';
|
7
|
-
export { LinkAttrs } from './_tsup-dts-rollup';
|
8
|
-
export { LinkSpecExtension } from './_tsup-dts-rollup';
|
9
|
-
export { LinkCommandsExtension } from './_tsup-dts-rollup';
|
10
|
-
export { LinkExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineLinkSpec } from './_tsup-dts-rollup.js';
|
2
|
+
export { defineLinkCommands } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineLinkInputRule } from './_tsup-dts-rollup.js';
|
4
|
+
export { defineLinkEnterRule } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineLinkMarkRule } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineLink } from './_tsup-dts-rollup.js';
|
7
|
+
export { LinkAttrs } from './_tsup-dts-rollup.js';
|
8
|
+
export { LinkSpecExtension } from './_tsup-dts-rollup.js';
|
9
|
+
export { LinkCommandsExtension } from './_tsup-dts-rollup.js';
|
10
|
+
export { LinkExtension } from './_tsup-dts-rollup.js';
|
@@ -1,16 +1,16 @@
|
|
1
|
-
export { ListDOMSerializer } from './_tsup-dts-rollup';
|
2
|
-
export { DedentListOptions } from './_tsup-dts-rollup';
|
3
|
-
export { IndentListOptions } from './_tsup-dts-rollup';
|
4
|
-
export { ToggleCollapsedOptions } from './_tsup-dts-rollup';
|
5
|
-
export { UnwrapListOptions } from './_tsup-dts-rollup';
|
6
|
-
export { WrapInListGetAttrs } from './_tsup-dts-rollup';
|
7
|
-
export { defineList } from './_tsup-dts-rollup';
|
8
|
-
export { ListExtension } from './_tsup-dts-rollup';
|
9
|
-
export { defineListCommands } from './_tsup-dts-rollup';
|
10
|
-
export { ListCommandsExtension } from './_tsup-dts-rollup';
|
11
|
-
export { defineListInputRules } from './_tsup-dts-rollup';
|
12
|
-
export { defineListKeymap } from './_tsup-dts-rollup';
|
13
|
-
export { defineListPlugins } from './_tsup-dts-rollup';
|
14
|
-
export { defineListSpec } from './_tsup-dts-rollup';
|
15
|
-
export { ListSpecExtension } from './_tsup-dts-rollup';
|
16
|
-
export { ListAttrs } from './_tsup-dts-rollup';
|
1
|
+
export { ListDOMSerializer } from './_tsup-dts-rollup.js';
|
2
|
+
export { DedentListOptions } from './_tsup-dts-rollup.js';
|
3
|
+
export { IndentListOptions } from './_tsup-dts-rollup.js';
|
4
|
+
export { ToggleCollapsedOptions } from './_tsup-dts-rollup.js';
|
5
|
+
export { UnwrapListOptions } from './_tsup-dts-rollup.js';
|
6
|
+
export { WrapInListGetAttrs } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineList } from './_tsup-dts-rollup.js';
|
8
|
+
export { ListExtension } from './_tsup-dts-rollup.js';
|
9
|
+
export { defineListCommands } from './_tsup-dts-rollup.js';
|
10
|
+
export { ListCommandsExtension } from './_tsup-dts-rollup.js';
|
11
|
+
export { defineListInputRules } from './_tsup-dts-rollup.js';
|
12
|
+
export { defineListKeymap } from './_tsup-dts-rollup.js';
|
13
|
+
export { defineListPlugins } from './_tsup-dts-rollup.js';
|
14
|
+
export { defineListSpec } from './_tsup-dts-rollup.js';
|
15
|
+
export { ListSpecExtension } from './_tsup-dts-rollup.js';
|
16
|
+
export { ListAttrs } from './_tsup-dts-rollup.js';
|
@@ -1,11 +1,11 @@
|
|
1
|
-
export { LoroSyncPluginProps } from './_tsup-dts-rollup';
|
2
|
-
export { LoroUndoPluginProps } from './_tsup-dts-rollup';
|
3
|
-
export { defineLoroCommands } from './_tsup-dts-rollup';
|
4
|
-
export { LoroCursorOptions } from './_tsup-dts-rollup';
|
5
|
-
export { defineLoroCursorPlugin } from './_tsup-dts-rollup';
|
6
|
-
export { defineLoroKeymap } from './_tsup-dts-rollup';
|
7
|
-
export { defineLoroSyncPlugin } from './_tsup-dts-rollup';
|
8
|
-
export { defineLoroUndoPlugin } from './_tsup-dts-rollup';
|
9
|
-
export { defineLoro } from './_tsup-dts-rollup';
|
10
|
-
export { LoroExtension } from './_tsup-dts-rollup';
|
11
|
-
export { LoroOptions } from './_tsup-dts-rollup';
|
1
|
+
export { LoroSyncPluginProps } from './_tsup-dts-rollup.js';
|
2
|
+
export { LoroUndoPluginProps } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineLoroCommands } from './_tsup-dts-rollup.js';
|
4
|
+
export { LoroCursorOptions } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineLoroCursorPlugin } from './_tsup-dts-rollup.js';
|
6
|
+
export { defineLoroKeymap } from './_tsup-dts-rollup.js';
|
7
|
+
export { defineLoroSyncPlugin } from './_tsup-dts-rollup.js';
|
8
|
+
export { defineLoroUndoPlugin } from './_tsup-dts-rollup.js';
|
9
|
+
export { defineLoro } from './_tsup-dts-rollup.js';
|
10
|
+
export { LoroExtension } from './_tsup-dts-rollup.js';
|
11
|
+
export { LoroOptions } from './_tsup-dts-rollup.js';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { defineMarkRule } from './_tsup-dts-rollup';
|
2
|
-
export { MarkRuleOptions } from './_tsup-dts-rollup';
|
1
|
+
export { defineMarkRule } from './_tsup-dts-rollup.js';
|
2
|
+
export { MarkRuleOptions } from './_tsup-dts-rollup.js';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { defineMentionSpec } from './_tsup-dts-rollup';
|
2
|
-
export { defineMentionCommands } from './_tsup-dts-rollup';
|
3
|
-
export { defineMention } from './_tsup-dts-rollup';
|
4
|
-
export { MentionAttrs } from './_tsup-dts-rollup';
|
1
|
+
export { defineMentionSpec } from './_tsup-dts-rollup.js';
|
2
|
+
export { defineMentionCommands } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineMention } from './_tsup-dts-rollup.js';
|
4
|
+
export { MentionAttrs } from './_tsup-dts-rollup.js';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { defineModClickPrevention } from './_tsup-dts-rollup';
|
2
|
-
export { ModClickPreventionExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineModClickPrevention } from './_tsup-dts-rollup.js';
|
2
|
+
export { ModClickPreventionExtension } from './_tsup-dts-rollup.js';
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { definePlaceholder } from './_tsup-dts-rollup';
|
2
|
-
export { PlaceholderOptions } from './_tsup-dts-rollup';
|
1
|
+
export { definePlaceholder } from './_tsup-dts-rollup.js';
|
2
|
+
export { PlaceholderOptions } from './_tsup-dts-rollup.js';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// src/placeholder/index.ts
|
2
|
-
import { definePlugin, isInCodeBlock } from "@prosekit/core";
|
2
|
+
import { definePlugin, isInCodeBlock, maybeRun } from "@prosekit/core";
|
3
3
|
import { Plugin, PluginKey } from "@prosekit/pm/state";
|
4
4
|
import { Decoration, DecorationSet } from "@prosekit/pm/view";
|
5
5
|
function definePlaceholder(options) {
|
@@ -19,7 +19,7 @@ function createPlaceholderPlugin({
|
|
19
19
|
if (isInCodeBlock(state.selection)) {
|
20
20
|
return null;
|
21
21
|
}
|
22
|
-
const placeholderText =
|
22
|
+
const placeholderText = maybeRun(placeholder, state);
|
23
23
|
const deco = createPlaceholderDecoration(state, placeholderText);
|
24
24
|
if (!deco) {
|
25
25
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
export { defineReadonly } from './_tsup-dts-rollup';
|
1
|
+
export { defineReadonly } from './_tsup-dts-rollup.js';
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { defineSearchQuery } from './_tsup-dts-rollup';
|
2
|
-
export { defineSearchCommands } from './_tsup-dts-rollup';
|
3
|
-
export { SearchQueryOptions } from './_tsup-dts-rollup';
|
1
|
+
export { defineSearchQuery } from './_tsup-dts-rollup.js';
|
2
|
+
export { defineSearchCommands } from './_tsup-dts-rollup.js';
|
3
|
+
export { SearchQueryOptions } from './_tsup-dts-rollup.js';
|
@@ -1,8 +1,8 @@
|
|
1
|
-
export { defineStrikeSpec } from './_tsup-dts-rollup';
|
2
|
-
export { defineStrikeCommands } from './_tsup-dts-rollup';
|
3
|
-
export { defineStrikeKeymap } from './_tsup-dts-rollup';
|
4
|
-
export { defineStrikeInputRule } from './_tsup-dts-rollup';
|
5
|
-
export { defineStrike } from './_tsup-dts-rollup';
|
6
|
-
export { StrikeSpecExtension } from './_tsup-dts-rollup';
|
7
|
-
export { StrikeCommandsExtension } from './_tsup-dts-rollup';
|
8
|
-
export { StrikeExtension } from './_tsup-dts-rollup';
|
1
|
+
export { defineStrikeSpec } from './_tsup-dts-rollup.js';
|
2
|
+
export { defineStrikeCommands } from './_tsup-dts-rollup.js';
|
3
|
+
export { defineStrikeKeymap } from './_tsup-dts-rollup.js';
|
4
|
+
export { defineStrikeInputRule } from './_tsup-dts-rollup.js';
|
5
|
+
export { defineStrike } from './_tsup-dts-rollup.js';
|
6
|
+
export { StrikeSpecExtension } from './_tsup-dts-rollup.js';
|
7
|
+
export { StrikeCommandsExtension } from './_tsup-dts-rollup.js';
|
8
|
+
export { StrikeExtension } from './_tsup-dts-rollup.js';
|