@stll/folio-nuxt 0.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.
@@ -0,0 +1,26 @@
1
+ import { NuxtModule } from '@nuxt/schema';
2
+
3
+ /**
4
+ * Configuration for the folio DOCX editor Nuxt module, read from the
5
+ * `docxEditor` key of `nuxt.config`.
6
+ *
7
+ * @public
8
+ */
9
+ type ModuleOptions = {
10
+ /**
11
+ * Component name prefix. With `prefix: 'Folio'` the component is
12
+ * auto-imported as `<FolioDocxEditor>` instead of `<DocxEditor>`. Defaults to
13
+ * `''`.
14
+ */
15
+ prefix?: string;
16
+ /**
17
+ * Whether the module pushes the editor stylesheet into `nuxt.options.css`.
18
+ * Set to `false` to import `@stll/folio-vue/editor.css` yourself. Defaults to
19
+ * `true`.
20
+ */
21
+ injectStyles?: boolean;
22
+ };
23
+ declare const module$1: NuxtModule<ModuleOptions>;
24
+
25
+ export { module$1 as default };
26
+ export type { ModuleOptions };
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@stll/folio-nuxt",
3
+ "configKey": "docxEditor",
4
+ "compatibility": {
5
+ "nuxt": ">=3.0.0"
6
+ },
7
+ "version": "0.1.0",
8
+ "builder": {
9
+ "@nuxt/module-builder": "1.0.2",
10
+ "unbuild": "unknown"
11
+ }
12
+ }
@@ -0,0 +1,47 @@
1
+ import { defineNuxtModule, createResolver, addComponent, addImports } from '@nuxt/kit';
2
+
3
+ const COMPOSABLES_SUBPATH = "@stll/folio-vue/composables";
4
+ const STYLES_SUBPATH = "@stll/folio-vue/editor.css";
5
+ const VUE_COMPOSABLES = [
6
+ "useClipboard",
7
+ "useDocxEditor",
8
+ "useDragAutoScroll",
9
+ "useFixedDropdown",
10
+ "useHistory",
11
+ "useSelectionHighlight",
12
+ "useTableResize",
13
+ "useTableSelection",
14
+ "useTrackedChanges",
15
+ "useVisualLineNavigation",
16
+ "useWheelZoom",
17
+ "useZoom"
18
+ ];
19
+ const module$1 = defineNuxtModule({
20
+ meta: {
21
+ name: "@stll/folio-nuxt",
22
+ configKey: "docxEditor",
23
+ compatibility: {
24
+ nuxt: ">=3.0.0"
25
+ }
26
+ },
27
+ defaults: {
28
+ prefix: "",
29
+ injectStyles: true
30
+ },
31
+ setup(options, nuxt) {
32
+ const resolver = createResolver(import.meta.url);
33
+ if (options.injectStyles) {
34
+ nuxt.options.css.push(STYLES_SUBPATH);
35
+ }
36
+ const optimizeDeps = nuxt.options.vite.optimizeDeps ??= {};
37
+ optimizeDeps.include = [...optimizeDeps.include ?? [], "@stll/folio-core", "@stll/folio-vue"];
38
+ addComponent({
39
+ name: `${options.prefix}DocxEditor`,
40
+ filePath: resolver.resolve("./runtime/components/DocxEditor"),
41
+ mode: "client"
42
+ });
43
+ addImports(VUE_COMPOSABLES.map((name) => ({ name, from: COMPOSABLES_SUBPATH })));
44
+ }
45
+ });
46
+
47
+ export { module$1 as default };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Runtime entry for the auto-imported `<DocxEditor>` component.
3
+ *
4
+ * Re-exports the Vue adapter's editor component unchanged so all of its props,
5
+ * events, and the `DocxEditorRef` typing flow through to Nuxt consumers. The
6
+ * client-only behaviour is applied by `module.ts` via `addComponent`, not here.
7
+ */
8
+ export { DocxEditor as default } from "@stll/folio-vue";
9
+ //# sourceMappingURL=DocxEditor.d.ts.map
@@ -0,0 +1 @@
1
+ export { DocxEditor as default } from "@stll/folio-vue";
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions } from './module.mjs'
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@stll/folio-nuxt",
3
+ "version": "0.1.0",
4
+ "description": "Nuxt 3 & 4 module for folio: auto-imports an SSR-safe <DocxEditor> component built on @stll/folio-vue and ProseMirror.",
5
+ "keywords": [
6
+ "docx",
7
+ "editor",
8
+ "nuxt",
9
+ "nuxt-module",
10
+ "ooxml",
11
+ "prosemirror",
12
+ "vue",
13
+ "word",
14
+ "wysiwyg"
15
+ ],
16
+ "homepage": "https://github.com/stella/folio",
17
+ "bugs": {
18
+ "url": "https://github.com/stella/folio/issues"
19
+ },
20
+ "license": "Apache-2.0",
21
+ "author": "STLL",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/stella/folio.git",
25
+ "directory": "packages/nuxt"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "type": "module",
31
+ "main": "./dist/module.mjs",
32
+ "types": "./dist/types.d.mts",
33
+ "typesVersions": {
34
+ "*": {
35
+ ".": [
36
+ "./dist/types.d.mts"
37
+ ]
38
+ }
39
+ },
40
+ "exports": {
41
+ ".": {
42
+ "types": "./dist/types.d.mts",
43
+ "import": "./dist/module.mjs"
44
+ }
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "scripts": {
50
+ "build": "nuxt-module-build build",
51
+ "prepack": "bun run build",
52
+ "typecheck": "tsc --noEmit"
53
+ },
54
+ "dependencies": {
55
+ "@nuxt/kit": "^3.14.0 || ^4.0.0",
56
+ "@stll/folio-vue": "^0.2.0",
57
+ "prosemirror-history": "^1.4.0",
58
+ "prosemirror-model": "^1.19.4",
59
+ "prosemirror-state": "^1.4.3",
60
+ "prosemirror-tables": "^1.8.5",
61
+ "prosemirror-view": "^1.41.6"
62
+ },
63
+ "devDependencies": {
64
+ "@nuxt/module-builder": "^1.0.0",
65
+ "@nuxt/schema": "^4.0.0",
66
+ "nuxt": "^3.14.0 || ^4.0.0",
67
+ "vue": "^3.5.0"
68
+ },
69
+ "peerDependencies": {
70
+ "vue": "^3.3.0"
71
+ }
72
+ }