@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
|
@@ -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.2
|
|
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.2
|
|
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",
|
|
@@ -158,7 +157,7 @@
|
|
|
158
157
|
"nanoid": "^5.1.5",
|
|
159
158
|
"reka-ui": "^2.5.0",
|
|
160
159
|
"tailwind-merge": "^3.3.1",
|
|
161
|
-
"unplugin-vue-components": "^29.
|
|
160
|
+
"unplugin-vue-components": "^29.1.0",
|
|
162
161
|
"uuid": "^13.0.0",
|
|
163
162
|
"y-prosemirror": "^1.3.7",
|
|
164
163
|
"yjs": "^13.6.27"
|
|
@@ -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.2
|
|
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",
|
|
@@ -18,6 +18,11 @@ export const useEditor = (options: Partial<EditorOptions> = {}) => {
|
|
|
18
18
|
onBeforeUnmount(() => {
|
|
19
19
|
// Cloning root node (and its children) to avoid content being lost by destroy
|
|
20
20
|
const nodes = editor.value?.options.element
|
|
21
|
+
if (nodes && !(nodes instanceof HTMLElement)) {
|
|
22
|
+
// eslint-disable-next-line no-console
|
|
23
|
+
console.warn(`Expected editor element to be an HTMLElement, got ${nodes.constructor.name}: ${nodes}`)
|
|
24
|
+
return
|
|
25
|
+
}
|
|
21
26
|
const newEl = nodes?.cloneNode(true) as HTMLElement
|
|
22
27
|
|
|
23
28
|
nodes?.parentNode?.replaceChild(newEl, nodes)
|
|
@@ -9,7 +9,7 @@ export const useWindowDebugging = (editor: ShallowRef<Editor | undefined>): void
|
|
|
9
9
|
watch(editor, () => {
|
|
10
10
|
if (!editor.value) return
|
|
11
11
|
if (typeof window === "undefined" || typeof process === "undefined") return
|
|
12
|
-
if (
|
|
12
|
+
if (import.meta.dev && editor.value !== undefined) {
|
|
13
13
|
const w = window as any
|
|
14
14
|
w.editor = editor.value
|
|
15
15
|
w.tr = () => editor.value!.state.tr
|
|
@@ -9,7 +9,7 @@ const SUB_SELECTION_REGEX = /(\[[0-9 -]*\])/
|
|
|
9
9
|
|
|
10
10
|
export const debugSelectionPluginKey = new PluginKey("debugSelection")
|
|
11
11
|
/**
|
|
12
|
-
* Sets the window title to the current selection for debugging in development mode (by checking
|
|
12
|
+
* Sets the window title to the current selection for debugging in development mode (by checking import.meta.dev).
|
|
13
13
|
*
|
|
14
14
|
* For embedded editors, adds the selection as `[from - to]`.
|
|
15
15
|
*/
|
|
@@ -20,7 +20,7 @@ export const debugSelectionPlugin = (editor: Editor, log: boolean = false): Plug
|
|
|
20
20
|
state: {
|
|
21
21
|
init(): void { /**/ },
|
|
22
22
|
apply(tr: Transaction): void {
|
|
23
|
-
if (
|
|
23
|
+
if (!import.meta.dev) { return }
|
|
24
24
|
const sel = `${tr.selection.from} - ${tr.selection.to}`
|
|
25
25
|
if (isEmbeddedBlock(editor.view)) {
|
|
26
26
|
if (log) {
|
|
@@ -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"
|