@witchcraft/editor 0.0.7 → 0.0.8
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/runtime/components/CodeBlockThemePicker.vue +0 -1
- package/dist/runtime/components/Commands.vue +1 -1
- package/dist/runtime/components/Editor.vue +1 -2
- package/dist/runtime/composables/useEditor.d.ts +1 -1
- package/dist/runtime/demo/App.vue +0 -1
- package/dist/runtime/pm/features/Blockquote/Blockquote.d.ts +1 -1
- package/dist/runtime/pm/features/Blocks/components/DragTreeHandle.d.vue.ts +26 -0
- package/dist/runtime/pm/features/Blocks/components/DragTreeHandle.vue +1 -1
- package/dist/runtime/pm/features/Blocks/components/DragTreeHandle.vue.d.ts +26 -0
- package/dist/runtime/pm/features/Blocks/components/ItemMenu.vue +1 -2
- package/dist/runtime/pm/features/Blocks/components/ItemNodeView.vue +0 -1
- package/dist/runtime/pm/features/Blocks/components/defaultItemMenu.d.ts +2 -2
- package/dist/runtime/pm/features/Blocks/composables/useNodeStates.d.ts +2 -2
- package/dist/runtime/pm/features/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/runtime/pm/features/CodeBlock/components/CodeBlockView.vue +0 -1
- package/dist/runtime/pm/features/CodeBlock/composables/useHighlightJsTheme.d.ts +3 -3
- package/dist/runtime/pm/features/CommandsMenus/components/CommandBar.vue +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandBarItem.vue +1 -1
- package/dist/runtime/pm/features/CommandsMenus/components/CommandMenuGroup.vue +0 -1
- package/dist/runtime/pm/features/CommandsMenus/icons/HighlightIcon.vue +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.vue +0 -1
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedNodeView.vue +0 -1
- package/dist/runtime/pm/features/FileLoader/components/FileLoaderNodeView.vue +0 -1
- package/dist/runtime/pm/features/HardBreak/HardBreak.d.ts +1 -1
- package/dist/runtime/pm/features/Link/components/BubbleMenuExternalLink.vue +1 -1
- package/dist/runtime/pm/features/Link/components/BubbleMenuInternalLink.vue +1 -1
- package/dist/runtime/pm/features/Link/components/BubbleMenuLink.vue +1 -1
- package/dist/runtime/pm/features/Menus/components/MarkMenuManager.vue +1 -1
- package/dist/runtime/pm/features/Tables/index.d.ts +5 -5
- package/dist/runtime/pm/testSchema.d.ts +1 -1
- package/package.json +1 -1
- package/src/module.ts +1 -0
- package/src/runtime/components/CodeBlockThemePicker.vue +0 -1
- package/src/runtime/components/Editor.vue +0 -1
- package/src/runtime/demo/App.vue +0 -1
- package/src/runtime/pm/features/Blocks/components/DragTreeHandle.vue +5 -6
- package/src/runtime/pm/features/Blocks/components/ItemMenu.vue +0 -1
- package/src/runtime/pm/features/Blocks/components/ItemNodeView.vue +0 -1
- package/src/runtime/pm/features/CodeBlock/components/CodeBlockView.vue +0 -1
- package/src/runtime/pm/features/CommandsMenus/components/CommandMenuGroup.vue +0 -1
- package/src/runtime/pm/features/EmbeddedDocument/components/EmbeddedDocumentPicker.vue +0 -1
- package/src/runtime/pm/features/EmbeddedDocument/components/EmbeddedNodeView.vue +0 -1
- package/src/runtime/pm/features/FileLoader/components/FileLoaderNodeView.vue +0 -1
package/dist/module.json
CHANGED
|
@@ -46,7 +46,7 @@ import { pretty } from "@alanscodelog/utils";
|
|
|
46
46
|
import WButton from "@witchcraft/ui/components/LibButton";
|
|
47
47
|
import { twMerge } from "tailwind-merge";
|
|
48
48
|
const props = defineProps({
|
|
49
|
-
editor: { type:
|
|
49
|
+
editor: { type: Object, required: true },
|
|
50
50
|
commands: { type: Array, required: true }
|
|
51
51
|
});
|
|
52
52
|
function handlePointerDown($event, command, args) {
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
v-bind="$attrs"
|
|
28
28
|
>
|
|
29
29
|
<!-- The class `is-embedded-block` is not needed internally, but is added for consistency in case it might be useful. -->
|
|
30
|
-
<!-- @vue-expect-error -->
|
|
31
30
|
<editor-content
|
|
32
31
|
:editor="editor"
|
|
33
32
|
spellcheck="false"
|
|
@@ -80,7 +79,7 @@ import MarkMenuManager from "../pm/features/Menus/components/MarkMenuManager.vue
|
|
|
80
79
|
import { extensions } from "../pm/schema.js";
|
|
81
80
|
import { menusInjectionKey } from "../types/index.js";
|
|
82
81
|
const props = defineProps({
|
|
83
|
-
content: { type: null, required: false, default: void 0 },
|
|
82
|
+
content: { type: [String, Object, Array, null], required: false, default: void 0 },
|
|
84
83
|
docId: { type: String, required: false, default: void 0 },
|
|
85
84
|
documentApi: { type: null, required: false, default: void 0 },
|
|
86
85
|
linkOptions: { type: Object, required: false, default: void 0 },
|
|
@@ -4,6 +4,6 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
4
4
|
* Unline tiptap's useEditor, this does not auto-mount the editor. Instead the returned `recreate` function must be called manually. This was built with the use of {@link useContentEditor} in mind.
|
|
5
5
|
*/
|
|
6
6
|
export declare const useEditor: (options?: Partial<EditorOptions>) => {
|
|
7
|
-
editor: import("
|
|
7
|
+
editor: import("vue").ShallowRef<Editor | undefined, Editor | undefined>;
|
|
8
8
|
recreate: (modifyOptions?: (options: Partial<EditorOptions>) => Partial<EditorOptions>) => void;
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node } from "@tiptap/core";
|
|
2
|
-
export declare const Blockquote: Node<import("@tiptap/extension-blockquote"
|
|
2
|
+
export declare const Blockquote: Node<import("@tiptap/extension-blockquote").BlockquoteOptions, any>;
|
|
3
3
|
export type NodeBlockquoteName = "blockquote";
|
|
4
4
|
export declare const Cite: Node<any, any>;
|
|
5
5
|
export type NodeCiteName = "cite";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multipurpose drag handle + collapse indicator.
|
|
3
|
+
*
|
|
4
|
+
* This is incredibly useful for making a compact draggable tree view.
|
|
5
|
+
*
|
|
6
|
+
* The collapse indicator has a default height, but it should be set manually. For example `[&>.collapse-indicator]:h-[...]`
|
|
7
|
+
*
|
|
8
|
+
* The component only emits a few events, it does not handle the dragging itself or what actually happens on any clicks/input.
|
|
9
|
+
*/
|
|
10
|
+
interface Props {
|
|
11
|
+
hasChildren: boolean;
|
|
12
|
+
passedDragThreshold: boolean;
|
|
13
|
+
hideChildren: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
16
|
+
collapseIndicatorClick: (event: MouseEvent) => any;
|
|
17
|
+
grabHandlePassiveTouchStart: (event: TouchEvent) => any;
|
|
18
|
+
grabHandlePointerDown: (event: PointerEvent) => any;
|
|
19
|
+
grabHandleContextMenu: (event: PointerEvent) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
21
|
+
onCollapseIndicatorClick?: ((event: MouseEvent) => any) | undefined;
|
|
22
|
+
onGrabHandlePassiveTouchStart?: ((event: TouchEvent) => any) | undefined;
|
|
23
|
+
onGrabHandlePointerDown?: ((event: PointerEvent) => any) | undefined;
|
|
24
|
+
onGrabHandleContextMenu?: ((event: PointerEvent) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multipurpose drag handle + collapse indicator.
|
|
3
|
+
*
|
|
4
|
+
* This is incredibly useful for making a compact draggable tree view.
|
|
5
|
+
*
|
|
6
|
+
* The collapse indicator has a default height, but it should be set manually. For example `[&>.collapse-indicator]:h-[...]`
|
|
7
|
+
*
|
|
8
|
+
* The component only emits a few events, it does not handle the dragging itself or what actually happens on any clicks/input.
|
|
9
|
+
*/
|
|
10
|
+
interface Props {
|
|
11
|
+
hasChildren: boolean;
|
|
12
|
+
passedDragThreshold: boolean;
|
|
13
|
+
hideChildren: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
16
|
+
collapseIndicatorClick: (event: MouseEvent) => any;
|
|
17
|
+
grabHandlePassiveTouchStart: (event: TouchEvent) => any;
|
|
18
|
+
grabHandlePointerDown: (event: PointerEvent) => any;
|
|
19
|
+
grabHandleContextMenu: (event: PointerEvent) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
21
|
+
onCollapseIndicatorClick?: ((event: MouseEvent) => any) | undefined;
|
|
22
|
+
onGrabHandlePassiveTouchStart?: ((event: TouchEvent) => any) | undefined;
|
|
23
|
+
onGrabHandlePointerDown?: ((event: PointerEvent) => any) | undefined;
|
|
24
|
+
onGrabHandleContextMenu?: ((event: PointerEvent) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- @vue-expect-error -->
|
|
3
2
|
<WPopup
|
|
4
3
|
:model-value="menu.opened"
|
|
5
4
|
:preferred-horizontal="['left-most']"
|
|
@@ -33,7 +32,7 @@ import { popupVerticalPositioner } from "../../CommandsMenus/utils/popupVertical
|
|
|
33
32
|
import { itemMenuPluginKey } from "../types.js";
|
|
34
33
|
import { createItemMenuCommandExecuter } from "../utils/createItemMenuCommandExecuter.js";
|
|
35
34
|
const props = defineProps({
|
|
36
|
-
editor: { type:
|
|
35
|
+
editor: { type: Object, required: true }
|
|
37
36
|
});
|
|
38
37
|
const menu = ref({ opened: false, id: void 0 });
|
|
39
38
|
const popup = ref();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const defaultItemMenu: (import("../types.
|
|
1
|
+
export declare const defaultItemMenu: (import("../types.js").ItemMenuCommand | {
|
|
2
2
|
type: "group";
|
|
3
3
|
title: string;
|
|
4
|
-
variations: import("../types.
|
|
4
|
+
variations: import("../types.js").ItemMenuCommand[];
|
|
5
5
|
})[];
|
|
@@ -2,6 +2,6 @@ import type { Node } from "@tiptap/pm/model";
|
|
|
2
2
|
export declare function useNodeStates(props: {
|
|
3
3
|
node: Node;
|
|
4
4
|
}): {
|
|
5
|
-
counterStyle: import("
|
|
6
|
-
nodeState: import("
|
|
5
|
+
counterStyle: import("vue").ComputedRef<string>;
|
|
6
|
+
nodeState: import("vue").ComputedRef<import("../types.js").StatefulNodeStateEntry<string> | undefined>;
|
|
7
7
|
};
|
|
@@ -12,5 +12,5 @@ export declare const lowlightInstance: {
|
|
|
12
12
|
};
|
|
13
13
|
registered: (aliasOrName: string) => boolean;
|
|
14
14
|
};
|
|
15
|
-
export declare const CodeBlock: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight"
|
|
15
|
+
export declare const CodeBlock: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight").CodeBlockLowlightOptions, any>;
|
|
16
16
|
export type NodeCodeBlockName = "codeBlock";
|
|
@@ -30,8 +30,8 @@ export declare function useHighlightJsTheme({ defaultTheme, darkLightBgs, additi
|
|
|
30
30
|
theme: Ref<string, string>;
|
|
31
31
|
knownThemes: Ref<string[], string[]>;
|
|
32
32
|
loadTheme: (themeName: string) => Promise<undefined | Error>;
|
|
33
|
-
isDark: import("
|
|
34
|
-
backgroundColor: import("
|
|
35
|
-
themeCss: import("
|
|
33
|
+
isDark: import("vue").ComputedRef<boolean>;
|
|
34
|
+
backgroundColor: import("vue").ComputedRef<string>;
|
|
35
|
+
themeCss: import("vue").ComputedRef<string[]>;
|
|
36
36
|
rawThemeCss: Ref<string, string>;
|
|
37
37
|
};
|
|
@@ -29,7 +29,7 @@ import { commandExecuterInjectionKey } from "../types.js";
|
|
|
29
29
|
import { defaultCommandExecuter } from "../utils/defaultCommandExecutor";
|
|
30
30
|
const props = defineProps({
|
|
31
31
|
item: { type: null, required: true },
|
|
32
|
-
editor: { type:
|
|
32
|
+
editor: { type: Object, required: true }
|
|
33
33
|
});
|
|
34
34
|
const emit = defineEmits(["close"]);
|
|
35
35
|
const executer = inject(commandExecuterInjectionKey, defaultCommandExecuter);
|
|
@@ -32,7 +32,7 @@ import { computed } from "vue";
|
|
|
32
32
|
import FaSolidHighlighter from "~icons/lucide/highlighter";
|
|
33
33
|
import { highlightPluginKey } from "../../Highlight/types.js";
|
|
34
34
|
const props = defineProps({
|
|
35
|
-
editor: { type:
|
|
35
|
+
editor: { type: Object, required: true },
|
|
36
36
|
colorSlot: { type: null, required: false }
|
|
37
37
|
});
|
|
38
38
|
const color = computed(() => {
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Extends the tiptap hard break extension to set the linebreakReplacement option (which tiptap does not expose).
|
|
3
3
|
* This option tells prosemirror that when converting between blocks that can/can't show whitespace, it should use this node type to represent line breaks in node types that don't display them.
|
|
4
4
|
*/
|
|
5
|
-
export declare const HardBreak: import("@tiptap/core").Node<import("@tiptap/extension-hard-break"
|
|
5
|
+
export declare const HardBreak: import("@tiptap/core").Node<import("@tiptap/extension-hard-break").HardBreakOptions, any>;
|
|
@@ -83,7 +83,7 @@ import iFaSolidExternalLinkAlt from "~icons/fa-solid/external-link-alt";
|
|
|
83
83
|
import iIcRoundLink from "~icons/ic/round-link";
|
|
84
84
|
import iIcRoundShortText from "~icons/ic/round-short-text";
|
|
85
85
|
const props = defineProps({
|
|
86
|
-
editor: { type:
|
|
86
|
+
editor: { type: Object, required: true },
|
|
87
87
|
linkSuggestions: { type: Array, required: false },
|
|
88
88
|
linkMark: { type: null, required: true },
|
|
89
89
|
isChanged: { type: Boolean, required: true }
|
|
@@ -56,7 +56,7 @@ import { ref, watch } from "vue";
|
|
|
56
56
|
import BubbleMenuLinkActions from "./BubbleMenuLinkActions.vue";
|
|
57
57
|
import iIcRoundLink from "~icons/ic/round-link";
|
|
58
58
|
const props = defineProps({
|
|
59
|
-
editor: { type:
|
|
59
|
+
editor: { type: Object, required: true },
|
|
60
60
|
linkSuggestions: { type: Array, required: false },
|
|
61
61
|
linkMark: { type: null, required: true },
|
|
62
62
|
isChanged: { type: Boolean, required: true },
|
|
@@ -53,7 +53,7 @@ import { getMarkPosition } from "../../../utils/getMarkPosition.js";
|
|
|
53
53
|
import { getMarksInSelection } from "../../../utils/getMarksInSelection.js";
|
|
54
54
|
import { linkMenuPluginKey } from "../types.js";
|
|
55
55
|
const props = defineProps({
|
|
56
|
-
editor: { type:
|
|
56
|
+
editor: { type: Object, required: true },
|
|
57
57
|
linkSuggestions: { type: Array, required: false },
|
|
58
58
|
internalLinkSuggestions: { type: Array, required: false },
|
|
59
59
|
getLinkSuggestions: { type: Function, required: false },
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
import { findUpwards } from "../../../utils/findUpwards.js";
|
|
48
48
|
import { menusInjectionKey, menusPluginKey } from "../types.js";
|
|
49
49
|
const props = defineProps({
|
|
50
|
-
editor: { type:
|
|
50
|
+
editor: { type: Object, required: true }
|
|
51
51
|
});
|
|
52
52
|
const menus = inject(menusInjectionKey, ref({}));
|
|
53
53
|
const activeMarkMenu = ref();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const TableRow: import("@tiptap/core").Node<import("@tiptap/extension-table"
|
|
2
|
-
export declare const TableCell: import("@tiptap/core").Node<import("@tiptap/extension-table"
|
|
3
|
-
export declare const TableHeader: import("@tiptap/core").Node<import("@tiptap/extension-table"
|
|
4
|
-
export declare const Table: import("@tiptap/core").Node<import("@tiptap/extension-table"
|
|
5
|
-
export declare const TableExtensions: (import("@tiptap/core").Node<import("@tiptap/extension-table"
|
|
1
|
+
export declare const TableRow: import("@tiptap/core").Node<import("@tiptap/extension-table").TableRowOptions, any>;
|
|
2
|
+
export declare const TableCell: import("@tiptap/core").Node<import("@tiptap/extension-table").TableCellOptions, any>;
|
|
3
|
+
export declare const TableHeader: import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>;
|
|
4
|
+
export declare const Table: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
|
|
5
|
+
export declare const TableExtensions: (import("@tiptap/core").Node<import("@tiptap/extension-table").TableRowOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>)[];
|
|
6
6
|
export type NodeTableName = "table";
|
|
7
7
|
export type NodeTableRowName = "tableRow";
|
|
8
8
|
export type NodeTableCellName = "tableCell";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Schema } from "@tiptap/pm/model";
|
|
2
2
|
import { type NodeFileLoaderName } from "./features/FileLoader/FileLoader.js";
|
|
3
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.
|
|
4
|
+
export declare const testExtensions: (import("@tiptap/core").AnyExtension | import("@tiptap/core").Node<import("./features/FileLoader/types.js").FileLoaderExtensionOptions, any>)[];
|
|
5
5
|
export declare const testSchema: typeof baseSchema & Schema<NodeFileLoaderName & "itemNoId">;
|
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.8",
|
|
5
5
|
"main": "./dist/runtime/main.lib.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
package/src/module.ts
CHANGED
|
@@ -89,6 +89,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
89
89
|
nuxt.options.build.transpile.push("@tiptap/pm")
|
|
90
90
|
|
|
91
91
|
nuxt.hook("vite:extendConfig", config => {
|
|
92
|
+
// @ts-expect-error - optimizeDeps is now readonly but also possibly undefined :/
|
|
92
93
|
config.optimizeDeps ??= {}
|
|
93
94
|
config.optimizeDeps.exclude ??= []
|
|
94
95
|
// causes issues with the import.meta.globs here
|
package/src/runtime/demo/App.vue
CHANGED
|
@@ -107,7 +107,11 @@
|
|
|
107
107
|
*
|
|
108
108
|
* The component only emits a few events, it does not handle the dragging itself or what actually happens on any clicks/input.
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
interface Props {
|
|
111
|
+
hasChildren: boolean
|
|
112
|
+
passedDragThreshold: boolean
|
|
113
|
+
hideChildren: boolean
|
|
114
|
+
}
|
|
111
115
|
</script>
|
|
112
116
|
|
|
113
117
|
<script setup lang="ts">
|
|
@@ -118,11 +122,6 @@ import { onMounted, onUnmounted, ref, useAttrs } from "vue"
|
|
|
118
122
|
defineOptions({
|
|
119
123
|
name: "DragTreeHandle"
|
|
120
124
|
})
|
|
121
|
-
interface Props {
|
|
122
|
-
hasChildren: boolean
|
|
123
|
-
passedDragThreshold: boolean
|
|
124
|
-
hideChildren: boolean
|
|
125
|
-
}
|
|
126
125
|
|
|
127
126
|
const $attrs = useAttrs()
|
|
128
127
|
defineProps<Props>()
|