@wanghe1995/docx-editor-ui-lite 1.0.4 → 1.0.6
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/docx-editor-lite.js +924 -40
- package/dist/docx-editor-lite.umd.cjs +2 -1
- package/dist/main.d.ts +0 -0
- package/dist/object/WordEditor.d.ts +16 -0
- package/dist/object/word-editor.types.d.ts +30 -0
- package/dist/ui/LiteEditorShell.vue.d.ts +14 -0
- package/package.json +60 -60
- package/dist/src/object/WordEditor.d.ts +0 -24
- package/fonts/material-icons/material-icons.css +0 -23
- package/fonts/material-icons/material-icons.woff2 +0 -0
- /package/dist/{src/editor → editor}/index.d.ts +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IEditorData, IEditorOption, IElement } from '@wanghe1995/docx-editor-core';
|
|
2
|
+
export type ImportMode = 'overwrite' | 'append' | 'cancel';
|
|
3
|
+
export interface SaveSnapshot {
|
|
4
|
+
meta: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
submittedAt: string;
|
|
9
|
+
};
|
|
10
|
+
content: any;
|
|
11
|
+
}
|
|
12
|
+
export interface WordEditorOptions {
|
|
13
|
+
container: string | HTMLElement;
|
|
14
|
+
title?: string;
|
|
15
|
+
data?: IEditorData | IElement[];
|
|
16
|
+
options?: IEditorOption;
|
|
17
|
+
onReady?: (editor: any) => void;
|
|
18
|
+
onChange?: () => void;
|
|
19
|
+
onPageChange?: (pageNo: number) => void;
|
|
20
|
+
onScaleChange?: (scale: number) => void;
|
|
21
|
+
onSave?: (snapshot: SaveSnapshot) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface LiteEditorShellExposed {
|
|
24
|
+
getInstance: () => any;
|
|
25
|
+
getCommand: () => any;
|
|
26
|
+
getListener: () => any;
|
|
27
|
+
executeCommand: (command: string, ...args: any[]) => any;
|
|
28
|
+
setTitle: (title: string) => void;
|
|
29
|
+
destroyShell: () => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WordEditorOptions } from '../object/word-editor.types';
|
|
2
|
+
type __VLS_Props = Omit<WordEditorOptions, 'container'>;
|
|
3
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
4
|
+
getInstance: () => any;
|
|
5
|
+
getCommand: () => any;
|
|
6
|
+
getListener: () => any;
|
|
7
|
+
executeCommand: (command: string, ...args: any[]) => any;
|
|
8
|
+
setTitle: (title: string) => void;
|
|
9
|
+
destroyShell: () => void;
|
|
10
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
11
|
+
shellRef: HTMLDivElement;
|
|
12
|
+
editorContainerRef: HTMLDivElement;
|
|
13
|
+
}, HTMLDivElement>;
|
|
14
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@wanghe1995/docx-editor-ui-lite",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "DocxEditor 精简版UI库(Lite)",
|
|
5
|
-
"author": "wanghe",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "./dist/docx-editor-lite.umd.cjs",
|
|
9
|
-
"module": "./dist/docx-editor-lite.js",
|
|
10
|
-
"types": "./dist/
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/
|
|
14
|
-
"import": "./dist/docx-editor-lite.js",
|
|
15
|
-
"require": "./dist/docx-editor-lite.umd.cjs"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public"
|
|
20
|
-
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"static",
|
|
24
|
-
"fonts",
|
|
25
|
-
"README.md",
|
|
26
|
-
"package.json"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"dev": "vite --config vite.config.ts",
|
|
30
|
-
"clean": "node -e \"const fs = require('fs'); if(fs.existsSync('dist')) fs.rmSync('dist', {recursive: true})\"",
|
|
31
|
-
"build": "npm run clean &&
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"
|
|
41
|
-
"eslint": "^
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"typescript": "^
|
|
45
|
-
"
|
|
46
|
-
"vite": "^
|
|
47
|
-
"vite-plugin-dts": "^4.5.4",
|
|
48
|
-
"vue-tsc": "^2.0.0"
|
|
49
|
-
},
|
|
50
|
-
"engines": {
|
|
51
|
-
"node": ">=16.0.0"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@wanghe1995/docx-editor-core": "^3.0.8",
|
|
55
|
-
"vue": "^3.4.0"
|
|
56
|
-
},
|
|
57
|
-
"peerDependencies": {
|
|
58
|
-
"vue": "^3.4.0"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@wanghe1995/docx-editor-ui-lite",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "DocxEditor 精简版UI库(Lite)",
|
|
5
|
+
"author": "wanghe",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/docx-editor-lite.umd.cjs",
|
|
9
|
+
"module": "./dist/docx-editor-lite.js",
|
|
10
|
+
"types": "./dist/editor/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/editor/index.d.ts",
|
|
14
|
+
"import": "./dist/docx-editor-lite.js",
|
|
15
|
+
"require": "./dist/docx-editor-lite.umd.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"static",
|
|
24
|
+
"fonts",
|
|
25
|
+
"README.md",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "vite --config vite.config.ts",
|
|
30
|
+
"clean": "node -e \"const fs = require('fs'); if(fs.existsSync('dist')) fs.rmSync('dist', {recursive: true})\"",
|
|
31
|
+
"build": "npm run clean && vite build --config vite.lib.config.ts",
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"type:check": "vue-tsc --noEmit"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@eslint/js": "^10.0.1",
|
|
37
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
38
|
+
"@types/node": "^25.3.3",
|
|
39
|
+
"@vitejs/plugin-vue": "^5.1.4",
|
|
40
|
+
"eslint": "^10.4.0",
|
|
41
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
42
|
+
"tslib": "^2.8.1",
|
|
43
|
+
"typescript": "^5.0.0",
|
|
44
|
+
"typescript-eslint": "^8.59.4",
|
|
45
|
+
"vite": "^5.4.10",
|
|
46
|
+
"vite-plugin-css-injected-by-js": "^2.4.0",
|
|
47
|
+
"vite-plugin-dts": "^4.5.4",
|
|
48
|
+
"vue-tsc": "^2.0.0"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=16.0.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@wanghe1995/docx-editor-core": "^3.0.8",
|
|
55
|
+
"vue": "^3.4.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"vue": "^3.4.0"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import DocxEditor from '@wanghe1995/docx-editor-core';
|
|
2
|
-
import type { IEditorData, IElement, IEditorOption } from '@wanghe1995/docx-editor-core';
|
|
3
|
-
export interface WordEditorOptions {
|
|
4
|
-
container: string | HTMLElement;
|
|
5
|
-
data?: IEditorData | IElement[];
|
|
6
|
-
options?: IEditorOption;
|
|
7
|
-
onReady?: (editor: DocxEditor) => void;
|
|
8
|
-
onChange?: () => void;
|
|
9
|
-
onPageChange?: (pageNo: number) => void;
|
|
10
|
-
onScaleChange?: (scale: number) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare class WordEditor {
|
|
13
|
-
private config;
|
|
14
|
-
private editor;
|
|
15
|
-
private _container;
|
|
16
|
-
constructor(config: WordEditorOptions);
|
|
17
|
-
private _applyDefaultTheme;
|
|
18
|
-
private _bindListeners;
|
|
19
|
-
get command(): import("@wanghe1995/docx-editor-transform").Command | undefined;
|
|
20
|
-
get listener(): import("@wanghe1995/docx-editor-state").Listener | undefined;
|
|
21
|
-
get container(): HTMLDivElement;
|
|
22
|
-
executeCommand(command: string, ...args: any[]): any;
|
|
23
|
-
destroy(): void;
|
|
24
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/* Material Icons Local Font */
|
|
2
|
-
@font-face {
|
|
3
|
-
font-family: 'Material Icons';
|
|
4
|
-
font-style: normal;
|
|
5
|
-
font-weight: 400;
|
|
6
|
-
src: url('./material-icons.woff2') format('woff2');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.material-icons {
|
|
10
|
-
font-family: 'Material Icons';
|
|
11
|
-
font-weight: normal;
|
|
12
|
-
font-style: normal;
|
|
13
|
-
font-size: 0.9em;
|
|
14
|
-
line-height: 1;
|
|
15
|
-
letter-spacing: normal;
|
|
16
|
-
text-transform: none;
|
|
17
|
-
display: inline-block;
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
word-wrap: normal;
|
|
20
|
-
direction: ltr;
|
|
21
|
-
-webkit-font-feature-settings: 'liga';
|
|
22
|
-
-webkit-font-smoothing: antialiased;
|
|
23
|
-
}
|
|
Binary file
|
|
File without changes
|