@witchcraft/editor 0.0.2 → 0.0.4
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Editor.d.vue.ts +3 -3
- package/dist/runtime/components/Editor.vue.d.ts +3 -3
- package/dist/runtime/composables/useEditor.js +4 -0
- package/dist/runtime/composables/useWindowDebugging.js +1 -1
- package/dist/runtime/demo/main.d.ts +1 -1
- package/dist/runtime/injectionKeys.d.ts +1 -1
- package/dist/runtime/main.lib.d.ts +2 -2
- package/dist/runtime/pm/features/Base/Base.d.ts +1 -1
- package/dist/runtime/pm/features/Base/plugins/debugSelectionPlugin.d.ts +1 -1
- package/dist/runtime/pm/features/Base/plugins/debugSelectionPlugin.js +1 -1
- package/dist/runtime/pm/features/Base/types.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/Blocks.d.ts +2 -2
- package/dist/runtime/pm/features/Blocks/Item.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/List.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/commands/changeItemType.d.ts +2 -2
- package/dist/runtime/pm/features/Blocks/commands/changeTypeAttr.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/components/defaultItemMenu.d.ts +2 -2
- package/dist/runtime/pm/features/Blocks/composables/useNodeStates.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/itemMenuMenuItems.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/plugins/itemBlockIdPlugin.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/plugins/itemMenuPlugin.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/states/stateful.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/types.d.ts +3 -3
- package/dist/runtime/pm/features/Blocks/utils/createItemMenuCommandExecuter.d.ts +1 -1
- package/dist/runtime/pm/features/CodeBlock/composables/useAsyncCodeBlockHighlighting.d.ts +1 -1
- package/dist/runtime/pm/features/CodeBlock/types.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/CommandBar.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/commandBarMenuItems.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandBar.d.vue.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandBar.vue.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandBarItem.d.vue.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandBarItem.vue.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuGroup.d.vue.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuGroup.vue.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuItem.d.vue.ts +2 -2
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuItem.vue.d.ts +2 -2
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuList.d.vue.ts +2 -2
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuList.vue.d.ts +2 -2
- package/dist/runtime/pm/features/CommandsMenus/icons/HighlightIcon.d.vue.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/icons/HighlightIcon.vue.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/utils/defaultCommandExecutor.d.ts +1 -1
- package/dist/runtime/pm/features/CommandsMenus/utils/findCommand.d.ts +1 -1
- package/dist/runtime/pm/features/DocumentApi/DocumentApi.d.ts +1 -1
- package/dist/runtime/pm/features/DocumentApi/composables/useEditorContent.d.ts +1 -1
- package/dist/runtime/pm/features/DocumentApi/composables/useTestDocumentApi.d.ts +1 -1
- package/dist/runtime/pm/features/DocumentApi/utils/convertFullTransactionForPartialState.d.ts +1 -1
- package/dist/runtime/pm/features/DocumentApi/utils/getStateEmbedRange.d.ts +1 -1
- package/dist/runtime/pm/features/DocumentApi/utils/isEmbedId.d.ts +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/Embedded.d.ts +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/EmbeddedDocument.d.ts +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.d.vue.ts +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.vue +0 -2
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.vue.d.ts +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedNodeView.vue +0 -2
- package/dist/runtime/pm/features/EmbeddedDocument/composables/useEmbeddedEditor.d.ts +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/types.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/FileLoader.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/FileLoaderHandler/FileLoaderHandler.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/FileLoaderHandler/TestFileLoaderHandler.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/commands/insertFile.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/plugins/fileLoaderPlugin.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/types.d.ts +2 -2
- package/dist/runtime/pm/features/FileLoader/utils/cleanupFileLoaderNodes.d.ts +1 -1
- package/dist/runtime/pm/features/FileLoader/utils/optionsCheck.d.ts +1 -1
- package/dist/runtime/pm/features/Heading/Heading.d.ts +1 -1
- package/dist/runtime/pm/features/Heading/commands/changeLevelAttr.d.ts +1 -1
- package/dist/runtime/pm/features/Highlight/Highlight.d.ts +1 -1
- package/dist/runtime/pm/features/Highlight/types.d.ts +1 -1
- package/dist/runtime/pm/features/Iframe/Iframe.d.ts +1 -1
- package/dist/runtime/pm/features/Iframe/components/IframeNodeView.vue +0 -3
- package/dist/runtime/pm/features/Iframe/types.d.ts +2 -2
- package/dist/runtime/pm/features/Link/Link.d.ts +1 -1
- package/dist/runtime/pm/features/Link/components/BubbleMenuExternalLink.vue +0 -1
- package/dist/runtime/pm/features/Link/components/BubbleMenuInternalLink.vue +1 -4
- package/dist/runtime/pm/features/Link/components/BubbleMenuLinkActions.vue +0 -3
- package/dist/runtime/pm/features/Menus/Menus.d.ts +1 -1
- package/dist/runtime/pm/features/Menus/components/MarkMenuManager.vue +0 -1
- package/dist/runtime/pm/features/Menus/utils/isMarkMenu.d.ts +1 -1
- package/dist/runtime/pm/testSchema.d.ts +3 -3
- package/dist/runtime/pm/utils/createDropIndicator.d.ts +2 -2
- package/dist/runtime/pm/utils/dropPointInfo.d.ts +1 -1
- package/dist/runtime/pm/utils/index.d.ts +15 -15
- package/dist/runtime/pm/utils/nodesBetween.d.ts +1 -1
- package/dist/runtime/pm/utils/pointToPmPoint.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +9 -9
- package/package.json +8 -9
- package/src/runtime/composables/useEditor.ts +5 -0
- package/src/runtime/composables/useWindowDebugging.ts +1 -1
- package/src/runtime/pm/features/Base/plugins/debugSelectionPlugin.ts +2 -2
- package/src/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.vue +0 -2
- package/src/runtime/pm/features/EmbeddedDocument/components/EmbeddedNodeView.vue +0 -2
- package/src/runtime/pm/features/Iframe/components/IframeNodeView.vue +0 -3
- package/src/runtime/pm/features/Link/components/BubbleMenuExternalLink.vue +0 -1
- package/src/runtime/pm/features/Link/components/BubbleMenuInternalLink.vue +1 -4
- package/src/runtime/pm/features/Link/components/BubbleMenuLinkActions.vue +0 -3
- package/src/runtime/pm/features/Menus/components/MarkMenuManager.vue +0 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Content, EditorOptions } from "@tiptap/core";
|
|
2
2
|
import type { ScrollNearContainerEdgesOptions } from "@witchcraft/ui/types/index";
|
|
3
|
-
import { type DocumentApiInterface } from "../pm/features/DocumentApi/types.js
|
|
4
|
-
import type { EditorLinkOptions } from "../pm/features/Link/types
|
|
5
|
-
import { type CssVariables, type MenuRenderInfo } from "../types/index.js
|
|
3
|
+
import { type DocumentApiInterface } from "../pm/features/DocumentApi/types.js";
|
|
4
|
+
import type { EditorLinkOptions } from "../pm/features/Link/types";
|
|
5
|
+
import { type CssVariables, type MenuRenderInfo } from "../types/index.js";
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
/** The content for the editor. It is better to use docId and the documentApi instead. */
|
|
8
8
|
content?: Content;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Content, EditorOptions } from "@tiptap/core";
|
|
2
2
|
import type { ScrollNearContainerEdgesOptions } from "@witchcraft/ui/types/index";
|
|
3
|
-
import { type DocumentApiInterface } from "../pm/features/DocumentApi/types.js
|
|
4
|
-
import type { EditorLinkOptions } from "../pm/features/Link/types
|
|
5
|
-
import { type CssVariables, type MenuRenderInfo } from "../types/index.js
|
|
3
|
+
import { type DocumentApiInterface } from "../pm/features/DocumentApi/types.js";
|
|
4
|
+
import type { EditorLinkOptions } from "../pm/features/Link/types";
|
|
5
|
+
import { type CssVariables, type MenuRenderInfo } from "../types/index.js";
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
/** The content for the editor. It is better to use docId and the documentApi instead. */
|
|
8
8
|
content?: Content;
|
|
@@ -9,6 +9,10 @@ export const useEditor = (options = {}) => {
|
|
|
9
9
|
}
|
|
10
10
|
onBeforeUnmount(() => {
|
|
11
11
|
const nodes = editor.value?.options.element;
|
|
12
|
+
if (nodes && !(nodes instanceof HTMLElement)) {
|
|
13
|
+
console.warn(`Expected editor element to be an HTMLElement, got ${nodes.constructor.name}: ${nodes}`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
12
16
|
const newEl = nodes?.cloneNode(true);
|
|
13
17
|
nodes?.parentNode?.replaceChild(newEl, nodes);
|
|
14
18
|
editor.value?.destroy();
|
|
@@ -5,7 +5,7 @@ export const useWindowDebugging = (editor) => {
|
|
|
5
5
|
watch(editor, () => {
|
|
6
6
|
if (!editor.value) return;
|
|
7
7
|
if (typeof window === "undefined" || typeof process === "undefined") return;
|
|
8
|
-
if (
|
|
8
|
+
if (import.meta.dev && editor.value !== void 0) {
|
|
9
9
|
const w = window;
|
|
10
10
|
w.editor = editor.value;
|
|
11
11
|
w.tr = () => editor.value.state.tr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./tailwind.css
|
|
1
|
+
import "./tailwind.css";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { useScrollNearContainerEdges } from "@witchcraft/ui/composables/useScrollNearContainerEdges";
|
|
2
2
|
import type { ComputedRef, InjectionKey } from "vue";
|
|
3
|
-
import type { CssVariables } from "./types/index.js
|
|
3
|
+
import type { CssVariables } from "./types/index.js";
|
|
4
4
|
export declare const editorCssVariablesInjectionKey: InjectionKey<ComputedRef<CssVariables>>;
|
|
5
5
|
export declare const editorScrollInjectionKey: InjectionKey<ReturnType<typeof useScrollNearContainerEdges>>;
|
|
6
6
|
export declare const editorTeleportToInjectionKey: InjectionKey<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./types/index.js
|
|
2
|
-
export { default as Editor } from "./components/Editor.vue
|
|
1
|
+
export * from "./types/index.js";
|
|
2
|
+
export { default as Editor } from "./components/Editor.vue";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/core";
|
|
2
|
-
import type { BaseExtensionOptions } from "./types.js
|
|
2
|
+
import type { BaseExtensionOptions } from "./types.js";
|
|
3
3
|
/** Adds some basic commands and plugins to the editor. */
|
|
4
4
|
export declare const Base: Extension<BaseExtensionOptions, any>;
|
|
@@ -2,7 +2,7 @@ import type { Editor } from "@tiptap/core";
|
|
|
2
2
|
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
3
3
|
export declare const debugSelectionPluginKey: PluginKey<any>;
|
|
4
4
|
/**
|
|
5
|
-
* Sets the window title to the current selection for debugging in development mode (by checking
|
|
5
|
+
* Sets the window title to the current selection for debugging in development mode (by checking import.meta.dev).
|
|
6
6
|
*
|
|
7
7
|
* For embedded editors, adds the selection as `[from - to]`.
|
|
8
8
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Item } from "./Item.js
|
|
2
|
-
export { List } from "./List.js
|
|
1
|
+
export { Item } from "./Item.js";
|
|
2
|
+
export { List } from "./List.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Command } from "@tiptap/core";
|
|
2
|
-
import type { CommandAttributeOptions } from "../../../../types/index.js
|
|
3
|
-
import type { StatefulNodeStates } from "../types.js
|
|
2
|
+
import type { CommandAttributeOptions } from "../../../../types/index.js";
|
|
3
|
+
import type { StatefulNodeStates } from "../types.js";
|
|
4
4
|
declare module "@tiptap/core" {
|
|
5
5
|
interface Commands<ReturnType> {
|
|
6
6
|
changeItemType: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "@tiptap/core";
|
|
2
|
-
import type { CommandAttributeOptions } from "../../../../types/index.js
|
|
2
|
+
import type { CommandAttributeOptions } from "../../../../types/index.js";
|
|
3
3
|
declare module "@tiptap/core" {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
changeTypeAttr: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const defaultItemMenu: (import("../types.ts
|
|
1
|
+
export declare const defaultItemMenu: (import("../types.ts").ItemMenuCommand | {
|
|
2
2
|
type: "group";
|
|
3
3
|
title: string;
|
|
4
|
-
variations: import("../types.ts
|
|
4
|
+
variations: import("../types.ts").ItemMenuCommand[];
|
|
5
5
|
})[];
|
|
@@ -3,5 +3,5 @@ export declare function useNodeStates(props: {
|
|
|
3
3
|
node: Node;
|
|
4
4
|
}): {
|
|
5
5
|
counterStyle: import("@vue/reactivity").ComputedRef<string>;
|
|
6
|
-
nodeState: import("@vue/reactivity").ComputedRef<import("../types.js
|
|
6
|
+
nodeState: import("@vue/reactivity").ComputedRef<import("../types.js").StatefulNodeStateEntry<string> | undefined>;
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ItemMenuCommand } from "./types.js
|
|
1
|
+
import type { ItemMenuCommand } from "./types.js";
|
|
2
2
|
export declare const deleteNodesCommand: ItemMenuCommand;
|
|
3
3
|
export declare const regularItemCommand: ItemMenuCommand;
|
|
4
4
|
export declare const bulletItemCommand: ItemMenuCommand;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NodeType } from "@tiptap/pm/model";
|
|
2
2
|
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
3
|
-
import type { ItemNodeOptions } from "../types.js
|
|
3
|
+
import type { ItemNodeOptions } from "../types.js";
|
|
4
4
|
export declare const itemBlockIdPluginKey: PluginKey<any>;
|
|
5
5
|
export declare function itemBlockIdPlugin(self: {
|
|
6
6
|
type: NodeType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
2
|
-
import type { ItemMenuPluginState } from "../types.js
|
|
2
|
+
import type { ItemMenuPluginState } from "../types.js";
|
|
3
3
|
export declare const itemMenuPluginKey: PluginKey<ItemMenuPluginState>;
|
|
4
4
|
export declare function itemMenuPlugin(): Plugin<ItemMenuPluginState>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { StatefulNodeStates } from "../types.js
|
|
1
|
+
import type { StatefulNodeStates } from "../types.js";
|
|
2
2
|
export declare const statefulStates: StatefulNodeStates;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
2
|
import type { InjectionKey, Ref } from "vue";
|
|
3
|
-
import type { HTMLAttributesOptions } from "../../../types/index.js
|
|
4
|
-
import type { Command, CommandGroup } from "../CommandsMenus/types.js
|
|
3
|
+
import type { HTMLAttributesOptions } from "../../../types/index.js";
|
|
4
|
+
import type { Command, CommandGroup } from "../CommandsMenus/types.js";
|
|
5
5
|
export interface ItemNodeOptions extends HTMLAttributesOptions {
|
|
6
6
|
types: string[];
|
|
7
7
|
states: StatefulNodeStates;
|
|
@@ -34,7 +34,7 @@ export type ItemMenuPluginState = {
|
|
|
34
34
|
opened: boolean;
|
|
35
35
|
id?: string;
|
|
36
36
|
};
|
|
37
|
-
export { itemMenuPluginKey } from "./plugins/itemMenuPlugin.js
|
|
37
|
+
export { itemMenuPluginKey } from "./plugins/itemMenuPlugin.js";
|
|
38
38
|
export type ItemMenuCommand = Command<("$blockId" | "$blockPos" | "$contentPos" | any)[], ((editor: Editor, context: {
|
|
39
39
|
blockId?: string;
|
|
40
40
|
blockPos: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { ItemMenuCommand } from "../types.js
|
|
2
|
+
import type { ItemMenuCommand } from "../types.js";
|
|
3
3
|
export declare function createItemMenuCommandExecuter(getBlockId: () => string | undefined): (item: ItemMenuCommand, editor: Editor) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Editor, Editor as PmEditor } from "@tiptap/core";
|
|
2
2
|
import type { createLowlight } from "lowlight";
|
|
3
3
|
import { type Ref, type ShallowRef } from "vue";
|
|
4
|
-
import { type HighlightJsLanguageInfo } from "../highlightJsInfo.js
|
|
4
|
+
import { type HighlightJsLanguageInfo } from "../highlightJsInfo.js";
|
|
5
5
|
/**
|
|
6
6
|
* Listens for transactions and scans the document, dynamically loading the used highlight.js language themes.
|
|
7
7
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InjectionKey, Ref } from "vue";
|
|
2
|
-
import type { HighlightJsLanguageInfo } from "./highlightJsInfo.js
|
|
2
|
+
import type { HighlightJsLanguageInfo } from "./highlightJsInfo.js";
|
|
3
3
|
export declare const langsInfoInjectionKey: InjectionKey<Ref<HighlightJsLanguageInfo>>;
|
|
4
4
|
export declare const codeBlockThemeIsDarkInjectionKey: InjectionKey<Ref<boolean>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorState } from "@tiptap/pm/state";
|
|
2
|
-
import type { CommandBarCommand, CommandBarMenu } from "./types.js
|
|
2
|
+
import type { CommandBarCommand, CommandBarMenu } from "./types.js";
|
|
3
3
|
export declare const toggleBoldCommand: CommandBarCommand;
|
|
4
4
|
export declare const toggleItalicCommand: CommandBarCommand;
|
|
5
5
|
export declare const toggleStrikeCommand: CommandBarCommand;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { CommandBarCommand, CommandBarGroup } from "../types
|
|
2
|
+
import type { CommandBarCommand, CommandBarGroup } from "../types";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
commands: (CommandBarCommand | CommandBarGroup)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { CommandBarCommand, CommandBarGroup } from "../types
|
|
2
|
+
import type { CommandBarCommand, CommandBarGroup } from "../types";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
commands: (CommandBarCommand | CommandBarGroup)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ItemMenuCommand } from "../../Blocks/types.js
|
|
2
|
-
import { type CommandGroup } from "../types.js
|
|
1
|
+
import type { ItemMenuCommand } from "../../Blocks/types.js";
|
|
2
|
+
import { type CommandGroup } from "../types.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
item: ItemMenuCommand | CommandGroup;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ItemMenuCommand } from "../../Blocks/types.js
|
|
2
|
-
import { type CommandGroup } from "../types.js
|
|
1
|
+
import type { ItemMenuCommand } from "../../Blocks/types.js";
|
|
2
|
+
import { type CommandGroup } from "../types.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
item: ItemMenuCommand | CommandGroup;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ItemMenuCommand } from "../../Blocks/types
|
|
2
|
-
import type { CommandGroup } from "../types.js
|
|
1
|
+
import type { ItemMenuCommand } from "../../Blocks/types";
|
|
2
|
+
import type { CommandGroup } from "../types.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
entries: (ItemMenuCommand | CommandGroup)[];
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ItemMenuCommand } from "../../Blocks/types
|
|
2
|
-
import type { CommandGroup } from "../types.js
|
|
1
|
+
import type { ItemMenuCommand } from "../../Blocks/types";
|
|
2
|
+
import type { CommandGroup } from "../types.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
entries: (ItemMenuCommand | CommandGroup)[];
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { HighlightMarkOptions } from "../../Highlight/types.js
|
|
2
|
+
import type { HighlightMarkOptions } from "../../Highlight/types.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
colorSlot?: keyof HighlightMarkOptions["colors"] | string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { HighlightMarkOptions } from "../../Highlight/types.js
|
|
2
|
+
import type { HighlightMarkOptions } from "../../Highlight/types.js";
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
colorSlot?: keyof HighlightMarkOptions["colors"] | string;
|
|
@@ -2,7 +2,7 @@ import type { Content, EditorOptions } from "@tiptap/core";
|
|
|
2
2
|
import type { Schema } from "@tiptap/pm/model";
|
|
3
3
|
import type { EditorState, Plugin, Transaction } from "@tiptap/pm/state";
|
|
4
4
|
import { Editor } from "@tiptap/vue-3";
|
|
5
|
-
import type { DocId, DocumentApiInterface, EmbedId, OnSaveDocumentCallback, OnUpdateDocumentCallback } from "./types.js
|
|
5
|
+
import type { DocId, DocumentApiInterface, EmbedId, OnSaveDocumentCallback, OnUpdateDocumentCallback } from "./types.js";
|
|
6
6
|
/**
|
|
7
7
|
* Configures the document api which tells the editor how to load/unload/save/cache documents, including embedded ones.
|
|
8
8
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Content, Editor, EditorOptions } from "@tiptap/core";
|
|
2
2
|
import { type Ref, type ShallowRef } from "vue";
|
|
3
|
-
import type { DocumentApiInterface } from "../types.js
|
|
3
|
+
import type { DocumentApiInterface } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Provides two ways to load content into the editor.
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EditorOptions } from "@tiptap/core";
|
|
2
2
|
import { EditorState } from "@tiptap/pm/state";
|
|
3
3
|
import { type Ref } from "vue";
|
|
4
|
-
import type { DocumentApiInterface } from "../types.js
|
|
4
|
+
import type { DocumentApiInterface } from "../types.js";
|
|
5
5
|
type Cache = Record<string, {
|
|
6
6
|
state?: EditorState;
|
|
7
7
|
count: number;
|
package/dist/runtime/pm/features/DocumentApi/utils/convertFullTransactionForPartialState.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from "@tiptap/pm/state";
|
|
2
|
-
import type { EmbedId } from "../types.js
|
|
2
|
+
import type { EmbedId } from "../types.js";
|
|
3
3
|
export declare function convertFullTransactionForPartialState(state: EditorState, tr: Transaction, embedId: EmbedId): Transaction | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { EmbedId, MaybeEmbedId } from "../types.js
|
|
1
|
+
import type { EmbedId, MaybeEmbedId } from "../types.js";
|
|
2
2
|
export declare function isEmbedId(embedId: MaybeEmbedId): embedId is EmbedId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/core";
|
|
2
|
-
import type { EmbeddedDocumentNodeOptions } from "./types.js
|
|
2
|
+
import type { EmbeddedDocumentNodeOptions } from "./types.js";
|
|
3
3
|
declare module "@tiptap/core" {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
embeddedCommandRedirect: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node } from "@tiptap/core";
|
|
2
|
-
import type { HTMLAttributesOptions } from "../../../types/index.js
|
|
2
|
+
import type { HTMLAttributesOptions } from "../../../types/index.js";
|
|
3
3
|
declare module "@tiptap/core" {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
embeddedDocument: {};
|
package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.d.vue.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MaybeEmbedId } from "../../DocumentApi/types.js
|
|
1
|
+
import { type MaybeEmbedId } from "../../DocumentApi/types.js";
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
embedId: MaybeEmbedId;
|
|
4
4
|
/** We need this, otherwise prosemirror? gets in an infinite loop because the component is not actually displayed? I think... Chrome debugger freezes completely. */
|
|
@@ -93,14 +93,12 @@
|
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
<div class="flex flex-row no-wrap gap-2 justify-end">
|
|
96
|
-
<!-- @vue-expect-error -->
|
|
97
96
|
<WButton
|
|
98
97
|
color="danger"
|
|
99
98
|
@click="emit('cancel')"
|
|
100
99
|
>
|
|
101
100
|
Cancel
|
|
102
101
|
</WButton>
|
|
103
|
-
<!-- @vue-expect-error -->
|
|
104
102
|
<WButton
|
|
105
103
|
color="ok"
|
|
106
104
|
@click="submit"
|
package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type MaybeEmbedId } from "../../DocumentApi/types.js
|
|
1
|
+
import { type MaybeEmbedId } from "../../DocumentApi/types.js";
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
embedId: MaybeEmbedId;
|
|
4
4
|
/** We need this, otherwise prosemirror? gets in an infinite loop because the component is not actually displayed? I think... Chrome debugger freezes completely. */
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
>
|
|
42
42
|
Blank Embed
|
|
43
43
|
</div>
|
|
44
|
-
<!-- @vue-expect-error -->
|
|
45
44
|
<WButton
|
|
46
45
|
v-if="editor?.isEditable"
|
|
47
46
|
title="Change embed link."
|
|
@@ -50,7 +49,6 @@
|
|
|
50
49
|
>
|
|
51
50
|
<WIcon><i-fa-solid-link class="w-[0.7rem]"/></WIcon>
|
|
52
51
|
</WButton>
|
|
53
|
-
<!-- @vue-expect-error -->
|
|
54
52
|
<WPopup
|
|
55
53
|
:use-backdrop="true"
|
|
56
54
|
:preferred-horizontal="['center-screen']"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Content, Editor, EditorOptions } from "@tiptap/core";
|
|
2
2
|
import { type ComputedRef, type Ref, type ShallowRef } from "vue";
|
|
3
|
-
import { type DocumentApiInterface, type MaybeEmbedId } from "../../DocumentApi/types.js
|
|
3
|
+
import { type DocumentApiInterface, type MaybeEmbedId } from "../../DocumentApi/types.js";
|
|
4
4
|
/** Sets up nearly everything for the embedded editor nodeview. */
|
|
5
5
|
export declare function useEmbeddedEditor(embedIdRef: ComputedRef<MaybeEmbedId> | Ref<MaybeEmbedId>, editor: ShallowRef<Editor | undefined>, rootEditor: Editor,
|
|
6
6
|
/** For forwarding commands the embedded editor can't handle. See {@link Embedded}. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Dispatch, Editor, EditorOptions } from "@tiptap/core";
|
|
2
2
|
import type { ComputedRef, InjectionKey, Ref } from "vue";
|
|
3
|
-
import type { MaybeEmbedId } from "../DocumentApi/types.js
|
|
3
|
+
import type { MaybeEmbedId } from "../DocumentApi/types.js";
|
|
4
4
|
export interface EmbeddedDocumentNodeOptions extends WithOnTriggerByEmbeddedBlockOptions {
|
|
5
5
|
rootEditor: Editor;
|
|
6
6
|
/** Provided by the embedded node view. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node } from "@tiptap/core";
|
|
2
|
-
import type { FileLoaderExtensionOptions } from "./types.js
|
|
2
|
+
import type { FileLoaderExtensionOptions } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Provides a way to asynchronously load files into the editor and a node to display while they are loading.
|
|
5
5
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MakeOptional } from "@alanscodelog/utils/types";
|
|
2
2
|
import type { Editor } from "@tiptap/core";
|
|
3
|
-
import type { IFileLoaderHandler } from "../types.js
|
|
3
|
+
import type { IFileLoaderHandler } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* A partial implementation of {@link IFileLoaderHandler}.
|
|
6
6
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileLoaderHandler } from "./FileLoaderHandler.js
|
|
1
|
+
import { FileLoaderHandler } from "./FileLoaderHandler.js";
|
|
2
2
|
export declare const testFileLoaderDelay = 2000;
|
|
3
3
|
/** Instance of {@link FileLoaderHandler} for testing. */
|
|
4
4
|
export declare const TestFileLoaderHandler: FileLoaderHandler<File & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
2
|
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
3
|
-
import type { FileLoaderExtensionOptions } from "../types.js
|
|
3
|
+
import type { FileLoaderExtensionOptions } from "../types.js";
|
|
4
4
|
export declare const fileLoaderPluginKey: PluginKey<any>;
|
|
5
5
|
export declare function fileLoaderPlugin(editor: Editor, options: Pick<FileLoaderExtensionOptions, "cleanupOnLoad">): Plugin<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { HTMLAttributesOptions } from "../../../types/index.js
|
|
3
|
-
import type { WithOnTriggerByEmbeddedBlockOptions } from "../EmbeddedDocument/types.js
|
|
2
|
+
import type { HTMLAttributesOptions } from "../../../types/index.js";
|
|
3
|
+
import type { WithOnTriggerByEmbeddedBlockOptions } from "../EmbeddedDocument/types.js";
|
|
4
4
|
export interface FileLoaderExtensionOptions extends HTMLAttributesOptions, WithOnTriggerByEmbeddedBlockOptions {
|
|
5
5
|
/**
|
|
6
6
|
* By default, the plugin removes fileLoader nodes using {@link cleanupFileLoaderNodes} when the document is loaded. This can happen if the user interrupts a file load/upload/save and the document is saved with a fileLoader node.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { NodeType, Schema } from "@tiptap/pm/model";
|
|
2
2
|
import type { Transaction } from "@tiptap/pm/state";
|
|
3
|
-
import { cleanupFileLoaderNode } from "./cleanupFileLoaderNode.js
|
|
3
|
+
import { cleanupFileLoaderNode } from "./cleanupFileLoaderNode.js";
|
|
4
4
|
/**
|
|
5
5
|
* Removes all `fileLoader` nodes from the document.
|
|
6
6
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Editor } from "@tiptap/core";
|
|
2
|
-
import type { FileLoaderExtensionOptions } from "../types.js
|
|
2
|
+
import type { FileLoaderExtensionOptions } from "../types.js";
|
|
3
3
|
export declare function optionsCheck(editor: Editor, options: FileLoaderExtensionOptions): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Command } from "@tiptap/core";
|
|
2
|
-
import type { CommandAttributeOptions, CommandToggleNodesOptions } from "../../../../types/index.js
|
|
2
|
+
import type { CommandAttributeOptions, CommandToggleNodesOptions } from "../../../../types/index.js";
|
|
3
3
|
declare module "@tiptap/core" {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
changeLevelAttr: {
|