@witchcraft/editor 0.0.3 → 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/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/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 +7 -8
- 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;
|
|
@@ -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>;
|
|
@@ -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: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PluginKey } from "@tiptap/pm/state";
|
|
2
|
-
import type { HTMLAttributesOptions } from "../../../types/index.js
|
|
2
|
+
import type { HTMLAttributesOptions } from "../../../types/index.js";
|
|
3
3
|
export interface HighlightMarkOptions<T extends string = `slot${[1, 2, 3, 4, 5][number]}`> extends HTMLAttributesOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The colors to use for the highlight in Record<name, {color: string, name: string}> format.
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
transition-opacity
|
|
29
29
|
"
|
|
30
30
|
>
|
|
31
|
-
<!-- @vue-expect-error -->
|
|
32
31
|
<WButton
|
|
33
32
|
:border="false"
|
|
34
33
|
@click="deleteNode();
|
|
@@ -36,14 +35,12 @@
|
|
|
36
35
|
>
|
|
37
36
|
<WIcon><i-fa-solid-trash/></WIcon>
|
|
38
37
|
</WButton>
|
|
39
|
-
<!-- @vue-expect-error -->
|
|
40
38
|
<WButton
|
|
41
39
|
:border="false"
|
|
42
40
|
@click="copy(node.attrs.src)"
|
|
43
41
|
>
|
|
44
42
|
<WIcon><i-fa-solid-copy/></WIcon>
|
|
45
43
|
</WButton>
|
|
46
|
-
<!-- @vue-expect-error -->
|
|
47
44
|
<WButton
|
|
48
45
|
:border="false"
|
|
49
46
|
@click="openLink"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IframeSourceParser } from "./IframeParsers.js
|
|
2
|
-
import type { HTMLAttributesOptions } from "../../../types/index.js
|
|
1
|
+
import type { IframeSourceParser } from "./IframeParsers.js";
|
|
2
|
+
import type { HTMLAttributesOptions } from "../../../types/index.js";
|
|
3
3
|
export interface IframeNodeOptions extends HTMLAttributesOptions {
|
|
4
4
|
handlers: Record<string, IframeSourceParser>;
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LinkOptions } from "@tiptap/extension-link";
|
|
2
|
-
import { type AdditionalLinkOptions as AdditionalLinkNodeOptions, type LinkMenuPluginState } from "./types.js
|
|
2
|
+
import { type AdditionalLinkOptions as AdditionalLinkNodeOptions, type LinkMenuPluginState } from "./types.js";
|
|
3
3
|
declare module "@tiptap/core" {
|
|
4
4
|
interface Commands<ReturnType> {
|
|
5
5
|
links: {
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
ref="el"
|
|
8
8
|
>
|
|
9
9
|
<div class="flex flex-nowrap flex-row gap-1 items-center">
|
|
10
|
-
<!-- @vue-expect-error -->
|
|
11
10
|
<WLabel
|
|
12
11
|
id="menu-link-input"
|
|
13
12
|
title="Internal Link"
|
|
@@ -42,8 +41,7 @@
|
|
|
42
41
|
ref="suggestionsComponent"
|
|
43
42
|
v-model="linkText"
|
|
44
43
|
v-model:input-value="inputValue"
|
|
45
|
-
v-model:
|
|
46
|
-
v-model:active-suggestion="activeSuggestion"
|
|
44
|
+
v-model:open="isOpen"
|
|
47
45
|
@submit="submitHandler"
|
|
48
46
|
/>
|
|
49
47
|
</div>
|
|
@@ -69,7 +67,6 @@ const linkText = defineModel("linkText", { type: String, ...{ required: true } }
|
|
|
69
67
|
const inputValue = defineModel("tempLinkTextValue", { type: String, ...{ default: "" } });
|
|
70
68
|
const canOpen = ref(false);
|
|
71
69
|
const isOpen = ref(false);
|
|
72
|
-
const activeSuggestion = ref(-1);
|
|
73
70
|
const el = ref(null);
|
|
74
71
|
const suggestionsComponent = ref();
|
|
75
72
|
watch(linkText, () => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-nowrap flex-row gap-1 border border-transparent">
|
|
3
|
-
<!-- @vue-expect-error -->
|
|
4
3
|
<WButton
|
|
5
4
|
:border="false"
|
|
6
5
|
:disabled="!isChanged"
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
<i-fa-solid-plus/>
|
|
17
16
|
</WIcon>
|
|
18
17
|
</WButton>
|
|
19
|
-
<!-- @vue-expect-error -->
|
|
20
18
|
<WButton
|
|
21
19
|
v-if="linkHref"
|
|
22
20
|
:border="false"
|
|
@@ -27,7 +25,6 @@
|
|
|
27
25
|
>
|
|
28
26
|
<WIcon><i-fa-solid-copy class="w-[1.25em]"/></WIcon>
|
|
29
27
|
</WButton>
|
|
30
|
-
<!-- @vue-expect-error -->
|
|
31
28
|
<WButton
|
|
32
29
|
v-if="linkMark"
|
|
33
30
|
:border="false"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Extension } from "@tiptap/core";
|
|
2
2
|
import { type PluginKey } from "@tiptap/pm/state";
|
|
3
|
-
import { type Menu, type OpenMenuInfo } from "./types.js
|
|
3
|
+
import { type Menu, type OpenMenuInfo } from "./types.js";
|
|
4
4
|
declare module "@tiptap/core" {
|
|
5
5
|
interface Commands<ReturnType> {
|
|
6
6
|
menus: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MarkMenu, Menu } from "../types.js
|
|
1
|
+
import type { MarkMenu, Menu } from "../types.js";
|
|
2
2
|
export declare function isMarkMenu(menu: Menu): menu is MarkMenu;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Schema } from "@tiptap/pm/model";
|
|
2
|
-
import { type NodeFileLoaderName } from "./features/FileLoader/FileLoader.js
|
|
3
|
-
import { type schema as baseSchema } from "./schema.js
|
|
4
|
-
export declare const testExtensions: (import("@tiptap/core").AnyExtension | import("@tiptap/core").Node<import("./features/FileLoader/types.ts
|
|
2
|
+
import { type NodeFileLoaderName } from "./features/FileLoader/FileLoader.js";
|
|
3
|
+
import { type schema as baseSchema } from "./schema.js";
|
|
4
|
+
export declare const testExtensions: (import("@tiptap/core").AnyExtension | import("@tiptap/core").Node<import("./features/FileLoader/types.ts").FileLoaderExtensionOptions, any>)[];
|
|
5
5
|
export declare const testSchema: typeof baseSchema & Schema<NodeFileLoaderName & "itemNoId">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type DropInfo } from "./dropPointInfo.js
|
|
2
|
-
import type { Point } from "../../types/index.js
|
|
1
|
+
import { type DropInfo } from "./dropPointInfo.js";
|
|
2
|
+
import type { Point } from "../../types/index.js";
|
|
3
3
|
export interface DropIndicator extends Point {
|
|
4
4
|
width: number;
|
|
5
5
|
type: "child" | "before" | "after";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EnumLike } from "@alanscodelog/utils";
|
|
2
|
-
import type { Point } from "../../types/index.js
|
|
2
|
+
import type { Point } from "../../types/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Given a point (a mouse position), a box, and a possible indent, returns information regarding it's position.
|
|
5
5
|
*
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { createStateOnlyPluginApply } from "./createStateOnlyPluginApply.js
|
|
2
|
-
export { createStateOnlyPluginObjApply } from "./createStateOnlyPluginObjApply.js
|
|
3
|
-
export { dropPointInfo } from "./dropPointInfo.js
|
|
4
|
-
export { findUpwards } from "./findUpwards.js
|
|
5
|
-
export { getChildChunks } from "./getChildChunks.js
|
|
6
|
-
export { getDiffReplacementRange } from "./getDiffReplacementRange.js
|
|
7
|
-
export { getElMaxVisualSize } from "./getElMaxVisualSize.js
|
|
8
|
-
export { getElPropertyAsInt } from "./getElPropertyAsInt.js
|
|
9
|
-
export { getGroupNodeNames } from "./getGroupNodeNames.js
|
|
10
|
-
export { getMarkPosition } from "./getMarkPosition.js
|
|
11
|
-
export { getMarksInSelection } from "./getMarksInSelection.js
|
|
12
|
-
export { mapSelection } from "./mapSelection.js
|
|
13
|
-
export { nodesBetween } from "./nodesBetween.js
|
|
14
|
-
export { pointToPmPoint } from "./pointToPmPoint.js
|
|
15
|
-
export { splitIntoChunks } from "./splitIntoChunks.js
|
|
1
|
+
export { createStateOnlyPluginApply } from "./createStateOnlyPluginApply.js";
|
|
2
|
+
export { createStateOnlyPluginObjApply } from "./createStateOnlyPluginObjApply.js";
|
|
3
|
+
export { dropPointInfo } from "./dropPointInfo.js";
|
|
4
|
+
export { findUpwards } from "./findUpwards.js";
|
|
5
|
+
export { getChildChunks } from "./getChildChunks.js";
|
|
6
|
+
export { getDiffReplacementRange } from "./getDiffReplacementRange.js";
|
|
7
|
+
export { getElMaxVisualSize } from "./getElMaxVisualSize.js";
|
|
8
|
+
export { getElPropertyAsInt } from "./getElPropertyAsInt.js";
|
|
9
|
+
export { getGroupNodeNames } from "./getGroupNodeNames.js";
|
|
10
|
+
export { getMarkPosition } from "./getMarkPosition.js";
|
|
11
|
+
export { getMarksInSelection } from "./getMarksInSelection.js";
|
|
12
|
+
export { mapSelection } from "./mapSelection.js";
|
|
13
|
+
export { nodesBetween } from "./nodesBetween.js";
|
|
14
|
+
export { pointToPmPoint } from "./pointToPmPoint.js";
|
|
15
|
+
export { splitIntoChunks } from "./splitIntoChunks.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Node } from "@tiptap/pm/model";
|
|
2
2
|
import type { Selection } from "@tiptap/pm/state";
|
|
3
|
-
import type { NodesBetweenFilter } from "../../types/index.js
|
|
3
|
+
import type { NodesBetweenFilter } from "../../types/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* A more intuitive nodesBetween wrapper. Goes only through the nodes inside or touching the selection.
|
|
6
6
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PmPoint, Point } from "../../types/index.js
|
|
1
|
+
import type { PmPoint, Point } from "../../types/index.js";
|
|
2
2
|
export declare function pointToPmPoint(point: Point): PmPoint;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Node } from "@tiptap/pm/model";
|
|
2
|
-
export * from "../pm/features/Link/types.js
|
|
3
|
-
export * from "../pm/features/Base/types.js
|
|
4
|
-
export * from "../pm/features/Menus/types.js
|
|
5
|
-
export * from "../pm/features/Blocks/types.js
|
|
6
|
-
export * from "../pm/features/CommandsMenus/types.js
|
|
7
|
-
export * from "../pm/features/CodeBlock/types.js
|
|
8
|
-
export * from "../pm/features/FileLoader/types.js
|
|
9
|
-
export * from "../pm/features/DocumentApi/types.js
|
|
10
|
-
export * from "../pm/features/EmbeddedDocument/types.js
|
|
2
|
+
export * from "../pm/features/Link/types.js";
|
|
3
|
+
export * from "../pm/features/Base/types.js";
|
|
4
|
+
export * from "../pm/features/Menus/types.js";
|
|
5
|
+
export * from "../pm/features/Blocks/types.js";
|
|
6
|
+
export * from "../pm/features/CommandsMenus/types.js";
|
|
7
|
+
export * from "../pm/features/CodeBlock/types.js";
|
|
8
|
+
export * from "../pm/features/FileLoader/types.js";
|
|
9
|
+
export * from "../pm/features/DocumentApi/types.js";
|
|
10
|
+
export * from "../pm/features/EmbeddedDocument/types.js";
|
|
11
11
|
export type NodesBetweenFilter = (node: Node | null, start: number, parent: Node | null, index: number) => boolean;
|
|
12
12
|
export type PmPoint = {
|
|
13
13
|
left: number;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@witchcraft/editor",
|
|
3
3
|
"description": "Block base prosemirror editor with partial/full editable document embeds, infinite embeds, and document uploads.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"main": "./dist/runtime/main.lib.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -64,8 +64,7 @@
|
|
|
64
64
|
"failOnWarn": false
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"
|
|
68
|
-
"prepare": "husky && pnpm build",
|
|
67
|
+
"prepare": "husky && pnpm nuxt-module-build prepare && pnpm build:only && cd playground && pnpm i --ignore-scripts --ignore-workspace",
|
|
69
68
|
"build:only": "nuxt-module-build build",
|
|
70
69
|
"build": "pnpm gen:highlightJsLangInfo && nuxt-module-build prepare && nuxt-module-build build && nuxi generate playground",
|
|
71
70
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
@@ -73,9 +72,9 @@
|
|
|
73
72
|
"//dev:vite": "The module needs to be build, not stubbed, for vite's dev to work.",
|
|
74
73
|
"dev:vite": "concurrently \"pnpm build\" \"vite --mode development --config vite.config.ts\"",
|
|
75
74
|
"lint:eslint": "eslint \"{src,tests,playground/app}/**/*.{cjs,js,ts,vue}\" \"*.{cjs,js,ts}\" --max-warnings=0 --report-unused-disable-directives",
|
|
76
|
-
"lint:commits": "commitlint --from
|
|
75
|
+
"lint:commits": "commitlint --from-last-tag --to HEAD --verbose",
|
|
77
76
|
"lint:imports": "echo not working madge --circular --extensions ts ./src",
|
|
78
|
-
"lint": "pnpm lint:eslint && pnpm lint:types && pnpm lint:imports",
|
|
77
|
+
"lint": "pnpm lint:eslint && pnpm lint:types && pnpm lint:commits && pnpm lint:imports",
|
|
79
78
|
"lint:types": "vue-tsc --noEmit",
|
|
80
79
|
"test": "vitest",
|
|
81
80
|
"test:watch": "vitest --watch",
|
|
@@ -123,7 +122,7 @@
|
|
|
123
122
|
"@tiptap/extension-underline": "^3.4.2",
|
|
124
123
|
"@tiptap/pm": "^3.4.2",
|
|
125
124
|
"@tiptap/vue-3": "^3.4.2",
|
|
126
|
-
"@witchcraft/ui": "^0.3.
|
|
125
|
+
"@witchcraft/ui": "^0.3.2",
|
|
127
126
|
"tailwindcss": "^4.0.0",
|
|
128
127
|
"vue": "^3.2.47"
|
|
129
128
|
},
|
|
@@ -148,7 +147,7 @@
|
|
|
148
147
|
"@fortawesome/free-solid-svg-icons": "^7.0.1",
|
|
149
148
|
"@nuxt/eslint-config": "^1.9.0",
|
|
150
149
|
"@witchcraft/nuxt-utils": "^0.3.2",
|
|
151
|
-
"@witchcraft/ui": "^0.3.
|
|
150
|
+
"@witchcraft/ui": "^0.3.2",
|
|
152
151
|
"colord": "^2.9.3",
|
|
153
152
|
"defu": "^6.1.4",
|
|
154
153
|
"highlight.js": "^11.11.1",
|
|
@@ -182,7 +181,7 @@
|
|
|
182
181
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
183
182
|
"@vitest/browser": "^3.2.4",
|
|
184
183
|
"@vitest/coverage-v8": "^3.2.4",
|
|
185
|
-
"@witchcraft/ui": "^0.3.
|
|
184
|
+
"@witchcraft/ui": "^0.3.2",
|
|
186
185
|
"concurrently": "^9.2.1",
|
|
187
186
|
"cross-env": "^10.0.0",
|
|
188
187
|
"eslint": "^9.35.0",
|
|
@@ -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"
|
|
@@ -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']"
|
|
@@ -28,21 +28,18 @@
|
|
|
28
28
|
transition-opacity
|
|
29
29
|
"
|
|
30
30
|
>
|
|
31
|
-
<!-- @vue-expect-error -->
|
|
32
31
|
<WButton
|
|
33
32
|
:border="false"
|
|
34
33
|
@click="deleteNode();editor.commands.focus()"
|
|
35
34
|
>
|
|
36
35
|
<WIcon><i-fa-solid-trash/></WIcon>
|
|
37
36
|
</WButton>
|
|
38
|
-
<!-- @vue-expect-error -->
|
|
39
37
|
<WButton
|
|
40
38
|
:border="false"
|
|
41
39
|
@click="copy(node.attrs.src)"
|
|
42
40
|
>
|
|
43
41
|
<WIcon><i-fa-solid-copy/></WIcon>
|
|
44
42
|
</WButton>
|
|
45
|
-
<!-- @vue-expect-error -->
|
|
46
43
|
<WButton
|
|
47
44
|
:border="false"
|
|
48
45
|
@click="openLink"
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
ref="el"
|
|
8
8
|
>
|
|
9
9
|
<div class="flex flex-nowrap flex-row gap-1 items-center">
|
|
10
|
-
<!-- @vue-expect-error -->
|
|
11
10
|
<WLabel
|
|
12
11
|
id="menu-link-input"
|
|
13
12
|
title="Internal Link"
|
|
@@ -42,8 +41,7 @@
|
|
|
42
41
|
ref="suggestionsComponent"
|
|
43
42
|
v-model="linkText"
|
|
44
43
|
v-model:input-value="inputValue"
|
|
45
|
-
v-model:
|
|
46
|
-
v-model:active-suggestion="activeSuggestion"
|
|
44
|
+
v-model:open="isOpen"
|
|
47
45
|
@submit="submitHandler"
|
|
48
46
|
/>
|
|
49
47
|
</div>
|
|
@@ -82,7 +80,6 @@ const linkText = defineModel<string>("linkText", { required: true })
|
|
|
82
80
|
const inputValue = defineModel<string>("tempLinkTextValue", { default: "" })
|
|
83
81
|
const canOpen = ref(false)
|
|
84
82
|
const isOpen = ref(false)
|
|
85
|
-
const activeSuggestion = ref(-1)
|
|
86
83
|
const el = ref<HTMLElement | null>(null)
|
|
87
84
|
const suggestionsComponent = ref<ComponentExposed<typeof WSuggestions>>()
|
|
88
85
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-nowrap flex-row gap-1 border border-transparent">
|
|
3
|
-
<!-- @vue-expect-error -->
|
|
4
3
|
<WButton
|
|
5
4
|
:border="false"
|
|
6
5
|
:disabled="!isChanged"
|
|
@@ -16,7 +15,6 @@
|
|
|
16
15
|
<i-fa-solid-plus/>
|
|
17
16
|
</WIcon>
|
|
18
17
|
</WButton>
|
|
19
|
-
<!-- @vue-expect-error -->
|
|
20
18
|
<WButton
|
|
21
19
|
v-if="linkHref"
|
|
22
20
|
:border="false"
|
|
@@ -27,7 +25,6 @@
|
|
|
27
25
|
>
|
|
28
26
|
<WIcon><i-fa-solid-copy class="w-[1.25em]"/></WIcon>
|
|
29
27
|
</WButton>
|
|
30
|
-
<!-- @vue-expect-error -->
|
|
31
28
|
<WButton
|
|
32
29
|
v-if="linkMark"
|
|
33
30
|
:border="false"
|