@primeui/texteditor-core 0.0.1-alpha.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/LICENSE +23 -0
- package/README.md +1 -0
- package/dist/chunk-22B454VC.mjs +83 -0
- package/dist/chunk-22B454VC.mjs.map +1 -0
- package/dist/chunk-3RKMABZR.mjs +320 -0
- package/dist/chunk-3RKMABZR.mjs.map +1 -0
- package/dist/chunk-6GY64GPU.mjs +18 -0
- package/dist/chunk-6GY64GPU.mjs.map +1 -0
- package/dist/chunk-6YDCG63C.mjs +833 -0
- package/dist/chunk-6YDCG63C.mjs.map +1 -0
- package/dist/chunk-6ZN5XRH2.mjs +45 -0
- package/dist/chunk-6ZN5XRH2.mjs.map +1 -0
- package/dist/chunk-72T5I4O4.mjs +76 -0
- package/dist/chunk-72T5I4O4.mjs.map +1 -0
- package/dist/chunk-7QCHSEN2.mjs +16 -0
- package/dist/chunk-7QCHSEN2.mjs.map +1 -0
- package/dist/chunk-AJOKUIQD.mjs +33 -0
- package/dist/chunk-AJOKUIQD.mjs.map +1 -0
- package/dist/chunk-AUTGNC2Q.mjs +197 -0
- package/dist/chunk-AUTGNC2Q.mjs.map +1 -0
- package/dist/chunk-CRAB2MFE.mjs +19 -0
- package/dist/chunk-CRAB2MFE.mjs.map +1 -0
- package/dist/chunk-DXPG5XMX.mjs +18 -0
- package/dist/chunk-DXPG5XMX.mjs.map +1 -0
- package/dist/chunk-E2KXUP3F.mjs +9 -0
- package/dist/chunk-E2KXUP3F.mjs.map +1 -0
- package/dist/chunk-EA2YI7LA.mjs +23 -0
- package/dist/chunk-EA2YI7LA.mjs.map +1 -0
- package/dist/chunk-F7BJWPT6.mjs +401 -0
- package/dist/chunk-F7BJWPT6.mjs.map +1 -0
- package/dist/chunk-FFCQLWS5.mjs +32 -0
- package/dist/chunk-FFCQLWS5.mjs.map +1 -0
- package/dist/chunk-GG56GLXC.mjs +42 -0
- package/dist/chunk-GG56GLXC.mjs.map +1 -0
- package/dist/chunk-GGPBV4BM.mjs +37 -0
- package/dist/chunk-GGPBV4BM.mjs.map +1 -0
- package/dist/chunk-H3RFOYCT.mjs +27 -0
- package/dist/chunk-H3RFOYCT.mjs.map +1 -0
- package/dist/chunk-IUQKSDKG.mjs +23 -0
- package/dist/chunk-IUQKSDKG.mjs.map +1 -0
- package/dist/chunk-J5LGTIGS.mjs +9 -0
- package/dist/chunk-J5LGTIGS.mjs.map +1 -0
- package/dist/chunk-KNZAMA6H.mjs +198 -0
- package/dist/chunk-KNZAMA6H.mjs.map +1 -0
- package/dist/chunk-MNKMKFLQ.mjs +27 -0
- package/dist/chunk-MNKMKFLQ.mjs.map +1 -0
- package/dist/chunk-MWT5PK3Z.mjs +52 -0
- package/dist/chunk-MWT5PK3Z.mjs.map +1 -0
- package/dist/chunk-NWRVBNBW.mjs +65 -0
- package/dist/chunk-NWRVBNBW.mjs.map +1 -0
- package/dist/chunk-OGEMGWLR.mjs +180 -0
- package/dist/chunk-OGEMGWLR.mjs.map +1 -0
- package/dist/chunk-PRFYR67X.mjs +60 -0
- package/dist/chunk-PRFYR67X.mjs.map +1 -0
- package/dist/chunk-PT2O4RV7.mjs +143 -0
- package/dist/chunk-PT2O4RV7.mjs.map +1 -0
- package/dist/chunk-PT5V6UYE.mjs +10 -0
- package/dist/chunk-PT5V6UYE.mjs.map +1 -0
- package/dist/chunk-RH45QRSV.mjs +26 -0
- package/dist/chunk-RH45QRSV.mjs.map +1 -0
- package/dist/chunk-RQ2HHNI6.mjs +55 -0
- package/dist/chunk-RQ2HHNI6.mjs.map +1 -0
- package/dist/chunk-TB7ZSSR2.mjs +6 -0
- package/dist/chunk-TB7ZSSR2.mjs.map +1 -0
- package/dist/chunk-TBQVZVKA.mjs +1891 -0
- package/dist/chunk-TBQVZVKA.mjs.map +1 -0
- package/dist/chunk-VWGQMUPD.mjs +182 -0
- package/dist/chunk-VWGQMUPD.mjs.map +1 -0
- package/dist/chunk-XKY2VYPW.mjs +26 -0
- package/dist/chunk-XKY2VYPW.mjs.map +1 -0
- package/dist/chunk-XSVIGDQR.mjs +22 -0
- package/dist/chunk-XSVIGDQR.mjs.map +1 -0
- package/dist/chunk-YHMP6AN3.mjs +231 -0
- package/dist/chunk-YHMP6AN3.mjs.map +1 -0
- package/dist/commands/index.d.mts +13 -0
- package/dist/commands/index.mjs +13 -0
- package/dist/commands/index.mjs.map +1 -0
- package/dist/createTextEditor.d.mts +7 -0
- package/dist/createTextEditor.mjs +31 -0
- package/dist/createTextEditor.mjs.map +1 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.mjs +45 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plugins/columnWidthPin.d.mts +5 -0
- package/dist/plugins/columnWidthPin.mjs +4 -0
- package/dist/plugins/columnWidthPin.mjs.map +1 -0
- package/dist/plugins/contextToolbar.d.mts +9 -0
- package/dist/plugins/contextToolbar.mjs +5 -0
- package/dist/plugins/contextToolbar.mjs.map +1 -0
- package/dist/plugins/defineTextEditorPlugin.d.mts +20 -0
- package/dist/plugins/defineTextEditorPlugin.mjs +4 -0
- package/dist/plugins/defineTextEditorPlugin.mjs.map +1 -0
- package/dist/plugins/inputRules.d.mts +14 -0
- package/dist/plugins/inputRules.mjs +8 -0
- package/dist/plugins/inputRules.mjs.map +1 -0
- package/dist/plugins/keymap.d.mts +16 -0
- package/dist/plugins/keymap.mjs +6 -0
- package/dist/plugins/keymap.mjs.map +1 -0
- package/dist/plugins/mention.d.mts +24 -0
- package/dist/plugins/mention.mjs +5 -0
- package/dist/plugins/mention.mjs.map +1 -0
- package/dist/plugins/mentionController.d.mts +16 -0
- package/dist/plugins/mentionController.mjs +4 -0
- package/dist/plugins/mentionController.mjs.map +1 -0
- package/dist/plugins/placeholder.d.mts +9 -0
- package/dist/plugins/placeholder.mjs +5 -0
- package/dist/plugins/placeholder.mjs.map +1 -0
- package/dist/plugins/registry.d.mts +7 -0
- package/dist/plugins/registry.mjs +4 -0
- package/dist/plugins/registry.mjs.map +1 -0
- package/dist/plugins/selectionHighlight.d.mts +14 -0
- package/dist/plugins/selectionHighlight.mjs +5 -0
- package/dist/plugins/selectionHighlight.mjs.map +1 -0
- package/dist/plugins/slashCommands.d.mts +28 -0
- package/dist/plugins/slashCommands.mjs +5 -0
- package/dist/plugins/slashCommands.mjs.map +1 -0
- package/dist/plugins/tableOverlay.d.mts +15 -0
- package/dist/plugins/tableOverlay.mjs +6 -0
- package/dist/plugins/tableOverlay.mjs.map +1 -0
- package/dist/plugins/trailingNode.d.mts +6 -0
- package/dist/plugins/trailingNode.mjs +4 -0
- package/dist/plugins/trailingNode.mjs.map +1 -0
- package/dist/position-DbkbTrFL.d.mts +50 -0
- package/dist/schema/index.d.mts +89 -0
- package/dist/schema/index.mjs +8 -0
- package/dist/schema/index.mjs.map +1 -0
- package/dist/serialization/index.d.mts +8 -0
- package/dist/serialization/index.mjs +5 -0
- package/dist/serialization/index.mjs.map +1 -0
- package/dist/texteditor.classes.d.mts +34 -0
- package/dist/texteditor.classes.mjs +4 -0
- package/dist/texteditor.classes.mjs.map +1 -0
- package/dist/texteditor.constants.d.mts +36 -0
- package/dist/texteditor.constants.mjs +4 -0
- package/dist/texteditor.constants.mjs.map +1 -0
- package/dist/texteditor.props.d.mts +5 -0
- package/dist/texteditor.props.mjs +4 -0
- package/dist/texteditor.props.mjs.map +1 -0
- package/dist/texteditor.refs.d.mts +5 -0
- package/dist/texteditor.refs.mjs +4 -0
- package/dist/texteditor.refs.mjs.map +1 -0
- package/dist/texteditor.state.d.mts +5 -0
- package/dist/texteditor.state.mjs +4 -0
- package/dist/texteditor.state.mjs.map +1 -0
- package/dist/ui/focus.d.mts +5 -0
- package/dist/ui/focus.mjs +4 -0
- package/dist/ui/focus.mjs.map +1 -0
- package/dist/ui/index.d.mts +6 -0
- package/dist/ui/index.mjs +9 -0
- package/dist/ui/index.mjs.map +1 -0
- package/dist/ui/keyboard.d.mts +4 -0
- package/dist/ui/keyboard.mjs +4 -0
- package/dist/ui/keyboard.mjs.map +1 -0
- package/dist/ui/menu.d.mts +10 -0
- package/dist/ui/menu.mjs +4 -0
- package/dist/ui/menu.mjs.map +1 -0
- package/dist/ui/positioning.d.mts +30 -0
- package/dist/ui/positioning.mjs +5 -0
- package/dist/ui/positioning.mjs.map +1 -0
- package/dist/ui/scroll.d.mts +6 -0
- package/dist/ui/scroll.mjs +4 -0
- package/dist/ui/scroll.mjs.map +1 -0
- package/dist/utils/index.d.mts +18 -0
- package/dist/utils/index.mjs +18 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +73 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from '@primeui/texteditor-types';
|
|
2
|
+
export { createTextEditor } from './createTextEditor.mjs';
|
|
3
|
+
export { textEditorClasses } from './texteditor.classes.mjs';
|
|
4
|
+
export { TEXT_EDITOR_ALLOWED_TYPES, TEXT_EDITOR_FILE_SIZE } from './texteditor.constants.mjs';
|
|
5
|
+
export { defaultTextEditorProps } from './texteditor.props.mjs';
|
|
6
|
+
export { defaultTextEditorRefs } from './texteditor.refs.mjs';
|
|
7
|
+
export { defaultTextEditorState } from './texteditor.state.mjs';
|
|
8
|
+
export { TextEditorPluginDefineOptions, defineTextEditorPlugin } from './plugins/defineTextEditorPlugin.mjs';
|
|
9
|
+
export { SchemaExtension, baseMarks, baseNodes, createEditorSchema, extendNodeSpec, getEditorSchema } from './schema/index.mjs';
|
|
10
|
+
import '@primeui/core/types/api';
|
|
11
|
+
import 'prosemirror-state';
|
|
12
|
+
import 'prosemirror-model';
|
|
13
|
+
|
|
14
|
+
type PluginCommandMap = Record<string, (...args: unknown[]) => unknown>;
|
|
15
|
+
declare function collectPluginCommands(installed: Record<string, unknown>): Record<string, PluginCommandMap>;
|
|
16
|
+
|
|
17
|
+
export { collectPluginCommands };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export { defineTextEditorPlugin } from './chunk-XKY2VYPW.mjs';
|
|
2
|
+
export { TEXT_EDITOR_ALLOWED_TYPES, TEXT_EDITOR_FILE_SIZE } from './chunk-H3RFOYCT.mjs';
|
|
3
|
+
export { createTextEditor } from './chunk-TBQVZVKA.mjs';
|
|
4
|
+
import './chunk-PT2O4RV7.mjs';
|
|
5
|
+
import './chunk-YHMP6AN3.mjs';
|
|
6
|
+
import './chunk-OGEMGWLR.mjs';
|
|
7
|
+
import './chunk-IUQKSDKG.mjs';
|
|
8
|
+
import './chunk-MWT5PK3Z.mjs';
|
|
9
|
+
import './chunk-EA2YI7LA.mjs';
|
|
10
|
+
import './chunk-3RKMABZR.mjs';
|
|
11
|
+
import './chunk-KNZAMA6H.mjs';
|
|
12
|
+
import './chunk-6GY64GPU.mjs';
|
|
13
|
+
import './chunk-NWRVBNBW.mjs';
|
|
14
|
+
import './chunk-GGPBV4BM.mjs';
|
|
15
|
+
export { defaultTextEditorProps } from './chunk-AJOKUIQD.mjs';
|
|
16
|
+
export { defaultTextEditorRefs } from './chunk-E2KXUP3F.mjs';
|
|
17
|
+
export { defaultTextEditorState } from './chunk-PT5V6UYE.mjs';
|
|
18
|
+
import './chunk-22B454VC.mjs';
|
|
19
|
+
import './chunk-PRFYR67X.mjs';
|
|
20
|
+
export { baseMarks, baseNodes, createEditorSchema, extendNodeSpec, getEditorSchema } from './chunk-AUTGNC2Q.mjs';
|
|
21
|
+
import './chunk-6YDCG63C.mjs';
|
|
22
|
+
import './chunk-VWGQMUPD.mjs';
|
|
23
|
+
import './chunk-TB7ZSSR2.mjs';
|
|
24
|
+
import './chunk-72T5I4O4.mjs';
|
|
25
|
+
import './chunk-RQ2HHNI6.mjs';
|
|
26
|
+
import './chunk-6ZN5XRH2.mjs';
|
|
27
|
+
import './chunk-F7BJWPT6.mjs';
|
|
28
|
+
import './chunk-7QCHSEN2.mjs';
|
|
29
|
+
import './chunk-MNKMKFLQ.mjs';
|
|
30
|
+
export { textEditorClasses } from './chunk-GG56GLXC.mjs';
|
|
31
|
+
import './chunk-J5LGTIGS.mjs';
|
|
32
|
+
|
|
33
|
+
// src/logic/collectPluginCommands.ts
|
|
34
|
+
function collectPluginCommands(installed) {
|
|
35
|
+
const cmds = {};
|
|
36
|
+
for (const [name, plugin] of Object.entries(installed)) {
|
|
37
|
+
const pcommands = plugin.commands;
|
|
38
|
+
if (pcommands) cmds[name] = pcommands;
|
|
39
|
+
}
|
|
40
|
+
return cmds;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { collectPluginCommands };
|
|
44
|
+
//# sourceMappingURL=index.mjs.map
|
|
45
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/logic/collectPluginCommands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,SAAS,sBAAsB,SAAA,EAAsE;AACxG,EAAA,MAAM,OAAyC,EAAC;AAEhD,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,SAAS,CAAA,EAAG;AACpD,IAAA,MAAM,YAAa,MAAA,CAA2C,QAAA;AAE9D,IAAA,IAAI,SAAA,EAAW,IAAA,CAAK,IAAI,CAAA,GAAI,SAAA;AAAA,EAChC;AAEA,EAAA,OAAO,IAAA;AACX","file":"index.mjs","sourcesContent":["type PluginCommandMap = Record<string, (...args: unknown[]) => unknown>;\n\nexport function collectPluginCommands(installed: Record<string, unknown>): Record<string, PluginCommandMap> {\n const cmds: Record<string, PluginCommandMap> = {};\n\n for (const [name, plugin] of Object.entries(installed)) {\n const pcommands = (plugin as { commands?: PluginCommandMap }).commands;\n\n if (pcommands) cmds[name] = pcommands;\n }\n\n return cmds;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"columnWidthPin.mjs"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { CaretPosition } from '@primeui/texteditor-types';
|
|
3
|
+
|
|
4
|
+
interface ContextToolbarCallbacks {
|
|
5
|
+
onRequest: (position: CaretPosition) => void;
|
|
6
|
+
}
|
|
7
|
+
declare function createContextToolbarPlugin(callbacks: ContextToolbarCallbacks): Plugin<any>;
|
|
8
|
+
|
|
9
|
+
export { createContextToolbarPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"contextToolbar.mjs"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as _primeui_core_types_api from '@primeui/core/types/api';
|
|
2
|
+
import { TextEditorPluginContext, TextEditorPluginExpose, TextEditorInstance } from '@primeui/texteditor-types';
|
|
3
|
+
import { Plugin } from 'prosemirror-state';
|
|
4
|
+
import { Schema } from 'prosemirror-model';
|
|
5
|
+
import { SchemaExtension } from '../schema/index.mjs';
|
|
6
|
+
|
|
7
|
+
interface TextEditorPluginDefineOptions<TOptions = unknown> {
|
|
8
|
+
/** Nodes/marks contributed to the per-instance schema. */
|
|
9
|
+
schema?: SchemaExtension;
|
|
10
|
+
/**
|
|
11
|
+
* ProseMirror plugins added to the INITIAL editor state (e.g. Yjs ySyncPlugin
|
|
12
|
+
* for collaboration). Receives the assembled schema and the plugin's own
|
|
13
|
+
* options, so config-dependent plugins (provider URL, awareness, limits) can
|
|
14
|
+
* be built here rather than via the install-time registerProseMirrorPlugin.
|
|
15
|
+
*/
|
|
16
|
+
prosemirrorPlugins?: (schema: Schema, options?: TOptions) => Plugin[];
|
|
17
|
+
}
|
|
18
|
+
declare function defineTextEditorPlugin<TOptions = unknown>(name: string, install: (context: TextEditorPluginContext<TOptions>) => TextEditorPluginExpose, opts?: TextEditorPluginDefineOptions<TOptions>): _primeui_core_types_api.Plugin<TOptions, TextEditorPluginExpose, TextEditorInstance>;
|
|
19
|
+
|
|
20
|
+
export { type TextEditorPluginDefineOptions, defineTextEditorPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"defineTextEditorPlugin.mjs"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as prosemirror_state from 'prosemirror-state';
|
|
2
|
+
import { Schema } from 'prosemirror-model';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create all markdown input rules for the given schema.
|
|
6
|
+
*/
|
|
7
|
+
declare function createMarkdownInputRules(schema: Schema): prosemirror_state.Plugin<{
|
|
8
|
+
transform: prosemirror_state.Transaction;
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
text: string;
|
|
12
|
+
} | null>;
|
|
13
|
+
|
|
14
|
+
export { createMarkdownInputRules };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createMarkdownInputRules } from '../chunk-OGEMGWLR.mjs';
|
|
2
|
+
import '../chunk-VWGQMUPD.mjs';
|
|
3
|
+
import '../chunk-TB7ZSSR2.mjs';
|
|
4
|
+
import '../chunk-72T5I4O4.mjs';
|
|
5
|
+
import '../chunk-MNKMKFLQ.mjs';
|
|
6
|
+
import '../chunk-J5LGTIGS.mjs';
|
|
7
|
+
//# sourceMappingURL=inputRules.mjs.map
|
|
8
|
+
//# sourceMappingURL=inputRules.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"inputRules.mjs"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as prosemirror_state from 'prosemirror-state';
|
|
2
|
+
import { Command } from 'prosemirror-state';
|
|
3
|
+
export { keymap } from 'prosemirror-keymap';
|
|
4
|
+
export { baseKeymap } from 'prosemirror-commands';
|
|
5
|
+
import { Schema } from 'prosemirror-model';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Notion-like select: first Mod-a selects current block, second Mod-a selects all.
|
|
9
|
+
*/
|
|
10
|
+
declare function blockSelectAll(): Command;
|
|
11
|
+
interface EditorKeymapOptions {
|
|
12
|
+
blockMode?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function createEditorKeymap(schema: Schema, options?: EditorKeymapOptions): prosemirror_state.Plugin<any>;
|
|
15
|
+
|
|
16
|
+
export { blockSelectAll, createEditorKeymap };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { baseKeymap, blockSelectAll, createEditorKeymap, keymap } from '../chunk-YHMP6AN3.mjs';
|
|
2
|
+
import '../chunk-TB7ZSSR2.mjs';
|
|
3
|
+
import '../chunk-72T5I4O4.mjs';
|
|
4
|
+
import '../chunk-J5LGTIGS.mjs';
|
|
5
|
+
//# sourceMappingURL=keymap.mjs.map
|
|
6
|
+
//# sourceMappingURL=keymap.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"keymap.mjs"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CaretPosition } from '@primeui/texteditor-types';
|
|
2
|
+
import { Schema } from 'prosemirror-model';
|
|
3
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
|
|
6
|
+
declare const mentionPluginKey: PluginKey<any>;
|
|
7
|
+
interface MentionUpdate {
|
|
8
|
+
active: boolean;
|
|
9
|
+
text: string;
|
|
10
|
+
position: CaretPosition | null;
|
|
11
|
+
}
|
|
12
|
+
interface MentionPluginCallbacks {
|
|
13
|
+
onUpdate: (update: MentionUpdate) => void;
|
|
14
|
+
}
|
|
15
|
+
declare function createMentionPlugin(_schema: Schema, callbacks: MentionPluginCallbacks): Plugin<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Insert a mention node, replacing the '@query' text.
|
|
18
|
+
*/
|
|
19
|
+
declare function insertMention(view: EditorView, schema: Schema, data: unknown, options?: {
|
|
20
|
+
filterField?: string;
|
|
21
|
+
template?: (data: unknown) => string;
|
|
22
|
+
}): void;
|
|
23
|
+
|
|
24
|
+
export { type MentionUpdate, createMentionPlugin, insertMention, mentionPluginKey };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"mention.mjs"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface MentionUpdate {
|
|
2
|
+
active: boolean;
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
interface MentionControllerOptions {
|
|
6
|
+
getHandler: () => (() => unknown[] | Promise<unknown[]>) | undefined;
|
|
7
|
+
getFilterField: () => string;
|
|
8
|
+
emit: (update: MentionUpdate & {
|
|
9
|
+
items?: unknown[];
|
|
10
|
+
}) => void;
|
|
11
|
+
}
|
|
12
|
+
declare function createMentionController(opts: MentionControllerOptions): {
|
|
13
|
+
onUpdate(update: MentionUpdate): Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { type MentionControllerOptions, type MentionUpdate, createMentionController };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"mentionController.mjs"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
|
|
3
|
+
interface PlaceholderOptions {
|
|
4
|
+
text: () => string | null | undefined;
|
|
5
|
+
blockMode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare function createPlaceholderPlugin(options: PlaceholderOptions): Plugin<any>;
|
|
8
|
+
|
|
9
|
+
export { createPlaceholderPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"placeholder.mjs"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
|
|
4
|
+
declare function addProseMirrorPlugin(view: EditorView, plugin: Plugin): () => void;
|
|
5
|
+
declare function removeProseMirrorPlugin(view: EditorView, plugin: Plugin): void;
|
|
6
|
+
|
|
7
|
+
export { addProseMirrorPlugin, removeProseMirrorPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"registry.mjs"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
2
|
+
import { DecorationSet, EditorView } from 'prosemirror-view';
|
|
3
|
+
|
|
4
|
+
declare const selectionHighlightKey: PluginKey<any>;
|
|
5
|
+
interface HighlightState {
|
|
6
|
+
active: boolean;
|
|
7
|
+
from: number;
|
|
8
|
+
to: number;
|
|
9
|
+
decorations: DecorationSet;
|
|
10
|
+
}
|
|
11
|
+
declare function createSelectionHighlightPlugin(): Plugin<HighlightState>;
|
|
12
|
+
declare function preserveSelection(view: EditorView): void;
|
|
13
|
+
|
|
14
|
+
export { createSelectionHighlightPlugin, preserveSelection, selectionHighlightKey };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createSelectionHighlightPlugin, preserveSelection, selectionHighlightKey } from '../chunk-RQ2HHNI6.mjs';
|
|
2
|
+
import '../chunk-GG56GLXC.mjs';
|
|
3
|
+
import '../chunk-J5LGTIGS.mjs';
|
|
4
|
+
//# sourceMappingURL=selectionHighlight.mjs.map
|
|
5
|
+
//# sourceMappingURL=selectionHighlight.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"selectionHighlight.mjs"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CaretPosition } from '@primeui/texteditor-types';
|
|
2
|
+
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
|
|
5
|
+
declare const slashPluginKey: PluginKey<any>;
|
|
6
|
+
interface SlashUpdate {
|
|
7
|
+
active: boolean;
|
|
8
|
+
text: string;
|
|
9
|
+
position: CaretPosition | null;
|
|
10
|
+
}
|
|
11
|
+
interface SlashPluginOptions {
|
|
12
|
+
onUpdate: (update: SlashUpdate) => void;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function createSlashPlugin(callbacks: SlashPluginOptions): Plugin<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Execute an inline slash command: remove the '/query' text and run the callback in place.
|
|
18
|
+
* Does not create a new block — stays in the current block.
|
|
19
|
+
*/
|
|
20
|
+
declare function executeSlashCommandInline(view: EditorView, callback: () => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Execute a slash command.
|
|
23
|
+
* - Empty paragraph: delete '/query' and convert in place (Notion behavior).
|
|
24
|
+
* - Any other case: create a new block after the current one and convert that.
|
|
25
|
+
*/
|
|
26
|
+
declare function executeSlashCommand(view: EditorView, callback: () => void): void;
|
|
27
|
+
|
|
28
|
+
export { type SlashUpdate, createSlashPlugin, executeSlashCommand, executeSlashCommandInline, slashPluginKey };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createSlashPlugin, executeSlashCommand, executeSlashCommandInline, slashPluginKey } from '../chunk-KNZAMA6H.mjs';
|
|
2
|
+
import '../chunk-GG56GLXC.mjs';
|
|
3
|
+
import '../chunk-J5LGTIGS.mjs';
|
|
4
|
+
//# sourceMappingURL=slashCommands.mjs.map
|
|
5
|
+
//# sourceMappingURL=slashCommands.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"slashCommands.mjs"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { TableActiveState, TableOverlayRect } from '@primeui/texteditor-types';
|
|
3
|
+
|
|
4
|
+
interface TableOverlayCallbacks {
|
|
5
|
+
onActiveStateChange: (state: TableActiveState | null) => void;
|
|
6
|
+
onOverlayRectChange: (rect: TableOverlayRect | null) => void;
|
|
7
|
+
onColumnTriggerClick: (colIndex: number, event: MouseEvent) => void;
|
|
8
|
+
onRowTriggerClick: (rowIndex: number, event: MouseEvent) => void;
|
|
9
|
+
onCellTriggerClick: (event: MouseEvent) => void;
|
|
10
|
+
onAddColumn: () => void;
|
|
11
|
+
onAddRow: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare function createTableOverlayPlugin(callbacks: TableOverlayCallbacks): Plugin<any>;
|
|
14
|
+
|
|
15
|
+
export { createTableOverlayPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"tableOverlay.mjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"trailingNode.mjs"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RTL-aware positioning utilities.
|
|
3
|
+
*
|
|
4
|
+
* getBoundingClientRect() always returns physical (left/right) coordinates.
|
|
5
|
+
* In LTR we set `left`; in RTL we set `right` so the element anchors to the
|
|
6
|
+
* correct edge.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Returns an inline-start style for a **viewport-positioned** (fixed) element.
|
|
10
|
+
* In LTR → { left: `${value}px` }
|
|
11
|
+
* In RTL → { right: `${viewportWidth - value - elWidth}px` }
|
|
12
|
+
*/
|
|
13
|
+
declare function inlineStartFixed(left: number, elWidth: number): Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns an inline-start style for an **absolutely-positioned** element
|
|
16
|
+
* inside a container.
|
|
17
|
+
*
|
|
18
|
+
* @param offsetLeft Physical left offset relative to the container (e.g. elRect.left - containerRect.left)
|
|
19
|
+
* @param elWidth Width of the positioned element (use 0 for point positioning like triggers)
|
|
20
|
+
* @param containerWidth Width of the containing element
|
|
21
|
+
*/
|
|
22
|
+
declare function inlineStartAbsolute(offsetLeft: number, elWidth: number, containerWidth: number): Record<string, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Sets inline-start on an HTMLElement's style directly (for imperative DOM code like tableOverlay).
|
|
25
|
+
* Clears the opposite property to avoid conflicts.
|
|
26
|
+
*/
|
|
27
|
+
declare function setInlineStart(el: HTMLElement, offsetLeft: number, containerWidth: number, elWidth?: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Computes absolute-positioned style for block controls anchored to a block element
|
|
30
|
+
* within the editor container. Handles RTL by anchoring to inline-end (right) edge.
|
|
31
|
+
*/
|
|
32
|
+
declare function computeBlockControlsStyle(blockEl: HTMLElement | null, editorEl: HTMLElement | null): Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Computes absolute-positioned style for the block drop indicator line.
|
|
35
|
+
* Position is between blocks (or after the last block when targetIndex >= block count).
|
|
36
|
+
*/
|
|
37
|
+
declare function computeDropIndicatorStyle(editorEl: HTMLElement | null, dropTargetIndex: number, blockClassName: string): Record<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Computes the target drop index for block drag-and-drop based on mouse position.
|
|
40
|
+
* Returns -1 if the target would be at the dragged block's current position or right after it
|
|
41
|
+
* (no-op drop), otherwise returns the index where the block should be inserted.
|
|
42
|
+
*/
|
|
43
|
+
declare function computeDropTargetIndex(event: DragEvent, editorEl: HTMLElement, draggedBlockIndex: number, blockClassName: string): number;
|
|
44
|
+
/**
|
|
45
|
+
* Clamps a viewport-relative left value within margins, accounting for element width.
|
|
46
|
+
* Returns the clamped physical left value (caller then passes to inlineStartFixed).
|
|
47
|
+
*/
|
|
48
|
+
declare function clampToViewport(left: number, elWidth: number, margin: number): number;
|
|
49
|
+
|
|
50
|
+
export { computeBlockControlsStyle as a, computeDropIndicatorStyle as b, clampToViewport as c, computeDropTargetIndex as d, inlineStartFixed as e, inlineStartAbsolute as i, setInlineStart as s };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { NodeSpec, MarkSpec, Schema } from 'prosemirror-model';
|
|
2
|
+
|
|
3
|
+
declare function parseDimension(raw: string | null): string | null;
|
|
4
|
+
declare const doc: NodeSpec;
|
|
5
|
+
declare const text: NodeSpec;
|
|
6
|
+
declare const paragraph: NodeSpec;
|
|
7
|
+
declare const heading: NodeSpec;
|
|
8
|
+
declare const blockquote: NodeSpec;
|
|
9
|
+
declare const code_block: NodeSpec;
|
|
10
|
+
declare const horizontal_rule: NodeSpec;
|
|
11
|
+
declare const hard_break: NodeSpec;
|
|
12
|
+
declare const image: NodeSpec;
|
|
13
|
+
declare const mention: NodeSpec;
|
|
14
|
+
declare const image_upload_placeholder: NodeSpec;
|
|
15
|
+
declare const document_upload_placeholder: NodeSpec;
|
|
16
|
+
declare const bullet_list: NodeSpec;
|
|
17
|
+
declare const ordered_list: NodeSpec;
|
|
18
|
+
declare const list_item: NodeSpec;
|
|
19
|
+
declare const check_list: NodeSpec;
|
|
20
|
+
declare const check_list_item: NodeSpec;
|
|
21
|
+
declare const table: NodeSpec;
|
|
22
|
+
declare const table_row: NodeSpec;
|
|
23
|
+
declare const table_cell: NodeSpec;
|
|
24
|
+
declare const table_header: NodeSpec;
|
|
25
|
+
|
|
26
|
+
declare const nodes_blockquote: typeof blockquote;
|
|
27
|
+
declare const nodes_bullet_list: typeof bullet_list;
|
|
28
|
+
declare const nodes_check_list: typeof check_list;
|
|
29
|
+
declare const nodes_check_list_item: typeof check_list_item;
|
|
30
|
+
declare const nodes_code_block: typeof code_block;
|
|
31
|
+
declare const nodes_doc: typeof doc;
|
|
32
|
+
declare const nodes_document_upload_placeholder: typeof document_upload_placeholder;
|
|
33
|
+
declare const nodes_hard_break: typeof hard_break;
|
|
34
|
+
declare const nodes_heading: typeof heading;
|
|
35
|
+
declare const nodes_horizontal_rule: typeof horizontal_rule;
|
|
36
|
+
declare const nodes_image: typeof image;
|
|
37
|
+
declare const nodes_image_upload_placeholder: typeof image_upload_placeholder;
|
|
38
|
+
declare const nodes_list_item: typeof list_item;
|
|
39
|
+
declare const nodes_mention: typeof mention;
|
|
40
|
+
declare const nodes_ordered_list: typeof ordered_list;
|
|
41
|
+
declare const nodes_paragraph: typeof paragraph;
|
|
42
|
+
declare const nodes_parseDimension: typeof parseDimension;
|
|
43
|
+
declare const nodes_table: typeof table;
|
|
44
|
+
declare const nodes_table_cell: typeof table_cell;
|
|
45
|
+
declare const nodes_table_header: typeof table_header;
|
|
46
|
+
declare const nodes_table_row: typeof table_row;
|
|
47
|
+
declare const nodes_text: typeof text;
|
|
48
|
+
declare namespace nodes {
|
|
49
|
+
export { nodes_blockquote as blockquote, nodes_bullet_list as bullet_list, nodes_check_list as check_list, nodes_check_list_item as check_list_item, nodes_code_block as code_block, nodes_doc as doc, nodes_document_upload_placeholder as document_upload_placeholder, nodes_hard_break as hard_break, nodes_heading as heading, nodes_horizontal_rule as horizontal_rule, nodes_image as image, nodes_image_upload_placeholder as image_upload_placeholder, nodes_list_item as list_item, nodes_mention as mention, nodes_ordered_list as ordered_list, nodes_paragraph as paragraph, nodes_parseDimension as parseDimension, nodes_table as table, nodes_table_cell as table_cell, nodes_table_header as table_header, nodes_table_row as table_row, nodes_text as text };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare const bold: MarkSpec;
|
|
53
|
+
declare const italic: MarkSpec;
|
|
54
|
+
declare const underline: MarkSpec;
|
|
55
|
+
declare const strikethrough: MarkSpec;
|
|
56
|
+
declare const subscript: MarkSpec;
|
|
57
|
+
declare const superscript: MarkSpec;
|
|
58
|
+
declare const code: MarkSpec;
|
|
59
|
+
declare const link: MarkSpec;
|
|
60
|
+
declare const textStyle: MarkSpec;
|
|
61
|
+
|
|
62
|
+
declare const marks_bold: typeof bold;
|
|
63
|
+
declare const marks_code: typeof code;
|
|
64
|
+
declare const marks_italic: typeof italic;
|
|
65
|
+
declare const marks_link: typeof link;
|
|
66
|
+
declare const marks_strikethrough: typeof strikethrough;
|
|
67
|
+
declare const marks_subscript: typeof subscript;
|
|
68
|
+
declare const marks_superscript: typeof superscript;
|
|
69
|
+
declare const marks_textStyle: typeof textStyle;
|
|
70
|
+
declare const marks_underline: typeof underline;
|
|
71
|
+
declare namespace marks {
|
|
72
|
+
export { marks_bold as bold, marks_code as code, marks_italic as italic, marks_link as link, marks_strikethrough as strikethrough, marks_subscript as subscript, marks_superscript as superscript, marks_textStyle as textStyle, marks_underline as underline };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Derive a NodeSpec from a base one with shallow `attrs` merge — lets a plugin
|
|
77
|
+
* enrich an existing node (e.g. add `id` to `heading`) without copying its spec.
|
|
78
|
+
*/
|
|
79
|
+
declare function extendNodeSpec(base: NodeSpec, override: Partial<NodeSpec>): NodeSpec;
|
|
80
|
+
declare const baseNodes: Record<string, NodeSpec>;
|
|
81
|
+
declare const baseMarks: Record<string, MarkSpec>;
|
|
82
|
+
interface SchemaExtension {
|
|
83
|
+
nodes?: Record<string, NodeSpec>;
|
|
84
|
+
marks?: Record<string, MarkSpec>;
|
|
85
|
+
}
|
|
86
|
+
declare function createEditorSchema(extensions?: SchemaExtension[]): Schema;
|
|
87
|
+
declare function getEditorSchema(): Schema;
|
|
88
|
+
|
|
89
|
+
export { type SchemaExtension, baseMarks, baseNodes, createEditorSchema, extendNodeSpec, getEditorSchema, marks, nodes };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { baseMarks, baseNodes, createEditorSchema, extendNodeSpec, getEditorSchema, marks_exports as marks } from '../chunk-AUTGNC2Q.mjs';
|
|
2
|
+
export { nodes_exports as nodes } from '../chunk-F7BJWPT6.mjs';
|
|
3
|
+
import '../chunk-7QCHSEN2.mjs';
|
|
4
|
+
import '../chunk-MNKMKFLQ.mjs';
|
|
5
|
+
import '../chunk-GG56GLXC.mjs';
|
|
6
|
+
import '../chunk-J5LGTIGS.mjs';
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as prosemirror_model from 'prosemirror-model';
|
|
2
|
+
import { Schema, Node } from 'prosemirror-model';
|
|
3
|
+
|
|
4
|
+
declare function htmlToDoc(html: string, schema: Schema): prosemirror_model.Node;
|
|
5
|
+
|
|
6
|
+
declare function docToHtml(doc: Node, schema: Schema): string;
|
|
7
|
+
|
|
8
|
+
export { docToHtml, htmlToDoc };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const textEditorClasses: {
|
|
2
|
+
root: string;
|
|
3
|
+
toolbar: string;
|
|
4
|
+
body: string;
|
|
5
|
+
content: string;
|
|
6
|
+
block: string;
|
|
7
|
+
blockContent: string;
|
|
8
|
+
blockControls: string;
|
|
9
|
+
blockDropIndicator: string;
|
|
10
|
+
blockPlaceholder: string;
|
|
11
|
+
navigator: string;
|
|
12
|
+
navigatorBar: string;
|
|
13
|
+
navigatorPopover: string;
|
|
14
|
+
contextToolbar: string;
|
|
15
|
+
popoverMenu: string;
|
|
16
|
+
popoverSubmenu: string;
|
|
17
|
+
placeholder: string;
|
|
18
|
+
tableSelectionOutline: string;
|
|
19
|
+
tableTrigger: string;
|
|
20
|
+
tableTriggerCell: string;
|
|
21
|
+
tableTriggerCol: string;
|
|
22
|
+
tableTriggerRow: string;
|
|
23
|
+
tableAdd: string;
|
|
24
|
+
tableAddCol: string;
|
|
25
|
+
tableAddRow: string;
|
|
26
|
+
mentionTyping: string;
|
|
27
|
+
mention: string;
|
|
28
|
+
slashTyping: string;
|
|
29
|
+
selection: string;
|
|
30
|
+
imageUploadPlaceholder: string;
|
|
31
|
+
documentUploadPlaceholder: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { textEditorClasses };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"texteditor.classes.mjs"}
|