@skaile/forge-editor 6.0.0 → 6.1.0
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/CHANGELOG.md +12 -0
- package/dist/code/CodeSurface.vue.d.ts +2 -2
- package/dist/document/DocumentSurface.vue.d.ts +2 -2
- package/dist/features/ai/protocol/generate.d.ts +1 -1
- package/dist/markdown/MarkdownSurface.vue.d.ts +8 -8
- package/dist/nuxt/module.d.ts +11 -2013
- package/dist/nuxt/module.js +26 -22
- package/dist/nuxt/module.js.map +1 -1
- package/dist/server/handlers/ai.d.ts +1 -1
- package/dist/tree/tree-host.js +1 -1
- package/dist/vue/AdvancedEditor.vue.d.ts +6 -6
- package/dist/vue/SimpleEditor.vue.d.ts +6 -6
- package/dist/vue/components/EditorSurface.vue.d.ts +6 -6
- package/package.json +3 -3
package/dist/nuxt/module.js
CHANGED
|
@@ -12,40 +12,44 @@ var module_default = defineNuxtModule({
|
|
|
12
12
|
name: "tiptap-editor",
|
|
13
13
|
configKey: "tiptapEditor"
|
|
14
14
|
},
|
|
15
|
-
setup(options, nuxt) {
|
|
15
|
+
setup({ server = true, ...options }, nuxt) {
|
|
16
16
|
const { resolve } = createResolver(import.meta.url);
|
|
17
17
|
const packageSrc = resolve("..");
|
|
18
18
|
nuxt.options.build.transpile.push(packageSrc);
|
|
19
19
|
nuxt.options.css.push(resolve("../vue/kit/nuxt-ui.css"));
|
|
20
20
|
nuxt.options.css.push(resolve("../styles/core.css"), resolve("../styles/media.css"), resolve("../styles/mentions.css"), resolve("../styles/authors.css"), resolve("../styles/comments.css"), resolve("../styles/transcript.css"), resolve("../styles/composites.css"), resolve("../styles/ai.css"), resolve("../styles/collab.css"), resolve("../styles/block-ui.css"), resolve("../styles/themes.css"));
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (server) {
|
|
22
|
+
addPlugin({
|
|
23
|
+
src: resolve("./runtime/plugins/editor-context-nuxt-ui.client.ts"),
|
|
24
|
+
mode: "client"
|
|
25
|
+
});
|
|
26
|
+
addServerScanDir(resolve("./runtime/server"));
|
|
27
|
+
}
|
|
26
28
|
nuxt.hook("modules:done", () => {
|
|
27
29
|
const uiCss = nuxt.options.build.templates.find((t) => t.filename === "ui.css");
|
|
28
30
|
if (!uiCss?.getContents) throw new Error("tiptap-editor: @nuxt/ui muss vor diesem Modul registriert sein (ui.css-Template fehlt)");
|
|
29
31
|
const getContents = uiCss.getContents;
|
|
30
32
|
uiCss.getContents = async (data) => `@source "${packageSrc}/**/*";\n${await getContents(data)}`;
|
|
31
33
|
});
|
|
32
|
-
nuxt.options.nitro.experimental = {
|
|
33
|
-
...nuxt.options.nitro.experimental,
|
|
34
|
-
websocket: true
|
|
35
|
-
};
|
|
36
|
-
nuxt.options.nitro.externals = {
|
|
37
|
-
...nuxt.options.nitro.externals,
|
|
38
|
-
inline: [
|
|
39
|
-
...nuxt.options.nitro.externals?.inline ?? [],
|
|
40
|
-
"@skaile/forge-editor",
|
|
41
|
-
packageSrc
|
|
42
|
-
]
|
|
43
|
-
};
|
|
44
34
|
const config = defineEditorConfig(options);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
if (server) {
|
|
36
|
+
nuxt.options.nitro.experimental = {
|
|
37
|
+
...nuxt.options.nitro.experimental,
|
|
38
|
+
websocket: true
|
|
39
|
+
};
|
|
40
|
+
nuxt.options.nitro.externals = {
|
|
41
|
+
...nuxt.options.nitro.externals,
|
|
42
|
+
inline: [
|
|
43
|
+
...nuxt.options.nitro.externals?.inline ?? [],
|
|
44
|
+
"@skaile/forge-editor",
|
|
45
|
+
packageSrc
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
nuxt.options.runtimeConfig.tiptapEditor = {
|
|
49
|
+
...serverConfig(config),
|
|
50
|
+
...nuxt.options.runtimeConfig.tiptapEditor
|
|
51
|
+
};
|
|
52
|
+
}
|
|
49
53
|
nuxt.options.runtimeConfig.public.tiptapEditor = {
|
|
50
54
|
...publicConfig(config),
|
|
51
55
|
...nuxt.options.runtimeConfig.public.tiptapEditor
|
package/dist/nuxt/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","names":[],"sources":["../../src/nuxt/module.ts"],"sourcesContent":["import { addPlugin, addServerScanDir, createResolver, defineNuxtModule } from 'nuxt/kit'\nimport { defineEditorConfig, type EditorConfigInput, publicConfig, serverConfig } from '../config'\n\n
|
|
1
|
+
{"version":3,"file":"module.js","names":[],"sources":["../../src/nuxt/module.ts"],"sourcesContent":["import { addPlugin, addServerScanDir, createResolver, defineNuxtModule } from 'nuxt/kit'\nimport { defineEditorConfig, type EditorConfigInput, publicConfig, serverConfig } from '../config'\n\n/**\n * Module options (`tiptapEditor` in `nuxt.config`): the editor's configuration with every key optional, see `EditorConfig`,\n * plus `server`. `server: false` is for a host without an editor server (a client-only editor, or a host that serves its own\n * `/api/editor/*`): the module then adds only the build wiring (stylesheets, transpile, Tailwind `@source`) and the public\n * AI configuration. It mounts no routes, no websocket and no server config, and registers no client plugin, because that\n * plugin's backend talks to the module's routes; the host installs the editor context itself. Default `true`.\n */\nexport type ModuleOptions = EditorConfigInput & { server?: boolean }\n\n/**\n * Nuxt/Nitro integration of the editor package: the client context plugin (settings persistence, AI configuration),\n * a server plugin that mounts the editor's routes and the collaboration websocket (`installEditorServer`) and the AI configuration with its server-only secrets. The host\n * plugs in through `provideEditorServer()` (`@skaile/forge-editor/server/nitro`) in a Nitro plugin (auth, loading and storing\n * document content). Components are imported explicitly from the package entries; nothing is auto-registered.\n */\nexport default defineNuxtModule<ModuleOptions>({\n meta: { name: 'tiptap-editor', configKey: 'tiptapEditor' },\n setup({ server = true, ...options }, nuxt) {\n const { resolve } = createResolver(import.meta.url)\n // `resolve('..')` is the package root of the built output (`dist`) or of `src` in this repository's app: both\n // hold the stylesheets and the unbundled `nuxt/runtime` files, which Nuxt compiles for the client and Nitro for the server.\n const packageSrc = resolve('..')\n nuxt.options.build.transpile.push(packageSrc)\n // The Nuxt UI token map comes first: the feature sheets (and an Obsidian theme, `themes.css`, last) read and may override `--sk-*`.\n nuxt.options.css.push(resolve('../vue/kit/nuxt-ui.css'))\n nuxt.options.css.push(\n resolve('../styles/core.css'),\n resolve('../styles/media.css'),\n resolve('../styles/mentions.css'),\n resolve('../styles/authors.css'),\n resolve('../styles/comments.css'),\n resolve('../styles/transcript.css'),\n resolve('../styles/composites.css'),\n resolve('../styles/ai.css'),\n resolve('../styles/collab.css'),\n resolve('../styles/block-ui.css'),\n resolve('../styles/themes.css'),\n )\n if (server) {\n addPlugin({ src: resolve('./runtime/plugins/editor-context-nuxt-ui.client.ts'), mode: 'client' })\n addServerScanDir(resolve('./runtime/server'))\n }\n // Tailwind only scans the app layers listed in Nuxt UI's generated `ui.css` (`@source \"<layer>/app/**/*\"`), so the\n // utility classes used by the package's components would never be generated. Append its source. `@nuxt/ui` must be\n // registered before this module.\n nuxt.hook('modules:done', () => {\n const uiCss = nuxt.options.build.templates.find(t => t.filename === 'ui.css')\n if (!uiCss?.getContents) throw new Error('tiptap-editor: @nuxt/ui muss vor diesem Modul registriert sein (ui.css-Template fehlt)')\n const getContents = uiCss.getContents\n uiCss.getContents = async data => `@source \"${packageSrc}/**/*\";\\n${await getContents(data)}`\n })\n const config = defineEditorConfig(options)\n if (server) {\n nuxt.options.nitro.experimental = { ...nuxt.options.nitro.experimental, websocket: true }\n // Nitro bundles the package (the runtime files import `h3` and `nitropack/runtime`, which the host's Nitro resolves): never leave it external.\n nuxt.options.nitro.externals = { ...nuxt.options.nitro.externals, inline: [...(nuxt.options.nitro.externals?.inline ?? []), '@skaile/forge-editor', packageSrc] }\n // The server view keeps an empty `apiKey` on the shared key, every preset and the transcription, so their `NUXT_TIPTAP_EDITOR_AI_*` env variables have a key to override.\n nuxt.options.runtimeConfig.tiptapEditor = {\n ...serverConfig(config),\n ...(nuxt.options.runtimeConfig.tiptapEditor as object | undefined),\n }\n }\n // Default role presets for the client before `GET /api/ai/models` has answered; read by the client context plugin (or, with `server: false`, by the host's own).\n nuxt.options.runtimeConfig.public.tiptapEditor = {\n ...publicConfig(config),\n ...(nuxt.options.runtimeConfig.public.tiptapEditor as object | undefined),\n }\n },\n})\n"],"mappings":";;;;;;;;;AAkBA,IAAA,iBAAe,iBAAgC;CAC7C,MAAM;EAAE,MAAM;EAAiB,WAAW;CAAe;CACzD,MAAM,EAAE,SAAS,MAAM,GAAG,WAAW,MAAM;EACzC,MAAM,EAAE,YAAY,eAAe,YAAY,GAAG;EAGlD,MAAM,aAAa,QAAQ,IAAI;EAC/B,KAAK,QAAQ,MAAM,UAAU,KAAK,UAAU;EAE5C,KAAK,QAAQ,IAAI,KAAK,QAAQ,wBAAwB,CAAC;EACvD,KAAK,QAAQ,IAAI,KACf,QAAQ,oBAAoB,GAC5B,QAAQ,qBAAqB,GAC7B,QAAQ,wBAAwB,GAChC,QAAQ,uBAAuB,GAC/B,QAAQ,wBAAwB,GAChC,QAAQ,0BAA0B,GAClC,QAAQ,0BAA0B,GAClC,QAAQ,kBAAkB,GAC1B,QAAQ,sBAAsB,GAC9B,QAAQ,wBAAwB,GAChC,QAAQ,sBAAsB,CAChC;EACA,IAAI,QAAQ;GACV,UAAU;IAAE,KAAK,QAAQ,oDAAoD;IAAG,MAAM;GAAS,CAAC;GAChG,iBAAiB,QAAQ,kBAAkB,CAAC;EAC9C;EAIA,KAAK,KAAK,sBAAsB;GAC9B,MAAM,QAAQ,KAAK,QAAQ,MAAM,UAAU,MAAK,MAAK,EAAE,aAAa,QAAQ;GAC5E,IAAI,CAAC,OAAO,aAAa,MAAM,IAAI,MAAM,wFAAwF;GACjI,MAAM,cAAc,MAAM;GAC1B,MAAM,cAAc,OAAM,SAAQ,YAAY,WAAW,WAAW,MAAM,YAAY,IAAI;EAC5F,CAAC;EACD,MAAM,SAAS,mBAAmB,OAAO;EACzC,IAAI,QAAQ;GACV,KAAK,QAAQ,MAAM,eAAe;IAAE,GAAG,KAAK,QAAQ,MAAM;IAAc,WAAW;GAAK;GAExF,KAAK,QAAQ,MAAM,YAAY;IAAE,GAAG,KAAK,QAAQ,MAAM;IAAW,QAAQ;KAAC,GAAI,KAAK,QAAQ,MAAM,WAAW,UAAU,CAAC;KAAI;KAAwB;IAAU;GAAE;GAEhK,KAAK,QAAQ,cAAc,eAAe;IACxC,GAAG,aAAa,MAAM;IACtB,GAAI,KAAK,QAAQ,cAAc;GACjC;EACF;EAEA,KAAK,QAAQ,cAAc,OAAO,eAAe;GAC/C,GAAG,aAAa,MAAM;GACtB,GAAI,KAAK,QAAQ,cAAc,OAAO;EACxC;CACF;AACF,CAAC"}
|
|
@@ -148,10 +148,10 @@ export declare const extractBodySchema: z.ZodObject<{
|
|
|
148
148
|
documentId: z.ZodString;
|
|
149
149
|
name: z.ZodOptional<z.ZodString>;
|
|
150
150
|
method: z.ZodEnum<{
|
|
151
|
-
transcription: "transcription";
|
|
152
151
|
description: "description";
|
|
153
152
|
bibliography: "bibliography";
|
|
154
153
|
auto: "auto";
|
|
154
|
+
transcription: "transcription";
|
|
155
155
|
"pdf-text": "pdf-text";
|
|
156
156
|
ocr: "ocr";
|
|
157
157
|
}>;
|
package/dist/tree/tree-host.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isTypedBlock, newTypedBlockJSON } from "../core/typed-block.js";
|
|
2
2
|
import { findBlockById } from "../core/schema/block-ids.js";
|
|
3
3
|
import { blockTypesOf, compositeBasketsOf } from "../features/composites/nodes.js";
|
|
4
|
+
import { revealBlockInEditor } from "../outline/heading-outline.js";
|
|
4
5
|
import { pickFiles } from "../features/media/upload.js";
|
|
5
6
|
import { compositeFocusOf } from "../features/composites/focus.js";
|
|
6
7
|
import { moveBlockInto, moveIntoVerdict } from "../features/composites/outline.js";
|
|
7
|
-
import { revealBlockInEditor } from "../outline/heading-outline.js";
|
|
8
8
|
import { readOutline } from "./tree-items.js";
|
|
9
9
|
//#region src/tree/tree-host.ts
|
|
10
10
|
/** The model's view of `editor`: its Block types, outline and move verdicts (worded in the language of `t`), read live. Create it once per editor. */
|
|
@@ -82,21 +82,21 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
82
82
|
editor: import("vue").ComputedRef<Editor | undefined>;
|
|
83
83
|
preset: ComposedEditor<Component>;
|
|
84
84
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
85
|
-
"update:modelValue": (content: JSONContent) => any;
|
|
86
|
-
ready: (editor: Editor) => any;
|
|
87
|
-
settingsOpen: (tab?: string | undefined) => any;
|
|
88
85
|
"update:sidebarOpen": (value: boolean) => any;
|
|
89
86
|
"update:commentsOpen": (value: boolean) => any;
|
|
87
|
+
ready: (editor: Editor) => any;
|
|
88
|
+
"update:modelValue": (content: JSONContent) => any;
|
|
90
89
|
metadataCreate: (list: string, item: MetadataItem) => any;
|
|
91
90
|
contentError: (error: Error) => any;
|
|
91
|
+
settingsOpen: (tab?: string | undefined) => any;
|
|
92
92
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
93
|
-
"onUpdate:modelValue"?: ((content: JSONContent) => any) | undefined;
|
|
94
|
-
onReady?: ((editor: Editor) => any) | undefined;
|
|
95
|
-
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
96
93
|
"onUpdate:sidebarOpen"?: ((value: boolean) => any) | undefined;
|
|
97
94
|
"onUpdate:commentsOpen"?: ((value: boolean) => any) | undefined;
|
|
95
|
+
onReady?: ((editor: Editor) => any) | undefined;
|
|
96
|
+
"onUpdate:modelValue"?: ((content: JSONContent) => any) | undefined;
|
|
98
97
|
onMetadataCreate?: ((list: string, item: MetadataItem) => any) | undefined;
|
|
99
98
|
onContentError?: ((error: Error) => any) | undefined;
|
|
99
|
+
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
100
100
|
}>, {
|
|
101
101
|
content: ContentLevel | readonly FeatureId[];
|
|
102
102
|
ai: boolean;
|
|
@@ -41,21 +41,21 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
41
41
|
editor: import("vue").ComputedRef<Editor | undefined>;
|
|
42
42
|
preset: EditorPreset<Component>;
|
|
43
43
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
44
|
-
"update:modelValue": (content: JSONContent) => any;
|
|
45
|
-
ready: (editor: Editor) => any;
|
|
46
|
-
settingsOpen: (tab?: string | undefined) => any;
|
|
47
44
|
"update:sidebarOpen": (value: boolean) => any;
|
|
48
45
|
"update:commentsOpen": (value: boolean) => any;
|
|
46
|
+
ready: (editor: Editor) => any;
|
|
47
|
+
"update:modelValue": (content: JSONContent) => any;
|
|
49
48
|
metadataCreate: (list: string, item: MetadataItem) => any;
|
|
50
49
|
contentError: (error: Error) => any;
|
|
50
|
+
settingsOpen: (tab?: string | undefined) => any;
|
|
51
51
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
52
|
-
"onUpdate:modelValue"?: ((content: JSONContent) => any) | undefined;
|
|
53
|
-
onReady?: ((editor: Editor) => any) | undefined;
|
|
54
|
-
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
55
52
|
"onUpdate:sidebarOpen"?: ((value: boolean) => any) | undefined;
|
|
56
53
|
"onUpdate:commentsOpen"?: ((value: boolean) => any) | undefined;
|
|
54
|
+
onReady?: ((editor: Editor) => any) | undefined;
|
|
55
|
+
"onUpdate:modelValue"?: ((content: JSONContent) => any) | undefined;
|
|
57
56
|
onMetadataCreate?: ((list: string, item: MetadataItem) => any) | undefined;
|
|
58
57
|
onContentError?: ((error: Error) => any) | undefined;
|
|
58
|
+
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
59
59
|
}>, {
|
|
60
60
|
editable: boolean;
|
|
61
61
|
settingsUi: "internal" | "external";
|
|
@@ -43,21 +43,21 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
43
43
|
settingsOpen: import("vue").Ref<boolean, boolean>;
|
|
44
44
|
settingsTab: import("vue").Ref<string | undefined, string | undefined>;
|
|
45
45
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
46
|
-
"update:modelValue": (content: JSONContent) => any;
|
|
47
|
-
ready: (editor: Editor) => any;
|
|
48
|
-
settingsOpen: (tab?: string | undefined) => any;
|
|
49
46
|
"update:sidebarOpen": (value: boolean) => any;
|
|
50
47
|
"update:commentsOpen": (value: boolean) => any;
|
|
48
|
+
ready: (editor: Editor) => any;
|
|
49
|
+
"update:modelValue": (content: JSONContent) => any;
|
|
51
50
|
metadataCreate: (list: string, item: MetadataItem) => any;
|
|
52
51
|
contentError: (error: Error) => any;
|
|
52
|
+
settingsOpen: (tab?: string | undefined) => any;
|
|
53
53
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
54
|
-
"onUpdate:modelValue"?: ((content: JSONContent) => any) | undefined;
|
|
55
|
-
onReady?: ((editor: Editor) => any) | undefined;
|
|
56
|
-
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
57
54
|
"onUpdate:sidebarOpen"?: ((value: boolean) => any) | undefined;
|
|
58
55
|
"onUpdate:commentsOpen"?: ((value: boolean) => any) | undefined;
|
|
56
|
+
onReady?: ((editor: Editor) => any) | undefined;
|
|
57
|
+
"onUpdate:modelValue"?: ((content: JSONContent) => any) | undefined;
|
|
59
58
|
onMetadataCreate?: ((list: string, item: MetadataItem) => any) | undefined;
|
|
60
59
|
onContentError?: ((error: Error) => any) | undefined;
|
|
60
|
+
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
61
61
|
}>, {
|
|
62
62
|
editable: boolean;
|
|
63
63
|
settingsUi: "internal" | "external";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skaile/forge-editor",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vue and React editor library on TipTap v3 (Vue: Nuxt UI; React: shadcn/ui): framework-free features with Vue and React bindings, simple and advanced presets, tree-shakeable entries. Built ESM with type declarations.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -702,7 +702,7 @@
|
|
|
702
702
|
"@iconify/vue": "^5.0.3",
|
|
703
703
|
"@lezer/highlight": "^1.2.1",
|
|
704
704
|
"@nuxt/ui": "^4.11.1",
|
|
705
|
-
"@skaile/forge-app-actions": "^0.1.0 || ^0.2.0 || ^0.3.0",
|
|
705
|
+
"@skaile/forge-app-actions": "^0.1.0 || ^0.2.0 || ^0.3.0 || ^0.4.0",
|
|
706
706
|
"@skaile/forge-chat": "^0.2.0",
|
|
707
707
|
"@tiptap/core": "^3.31.3",
|
|
708
708
|
"@tiptap/pm": "^3.31.3",
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
"@iconify/react": "^6.0.2",
|
|
767
767
|
"@iconify/vue": "^5.0.3",
|
|
768
768
|
"@lezer/highlight": "^1.2.1",
|
|
769
|
-
"@skaile/forge-app-actions": "^0.
|
|
769
|
+
"@skaile/forge-app-actions": "^0.4.0",
|
|
770
770
|
"@skaile/forge-chat": "^0.2.3",
|
|
771
771
|
"@tiptap/react": "3.31.3",
|
|
772
772
|
"@types/react": "^19.3.0",
|