@hyebook/vue3-adapter 0.2.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,16 @@
1
+ import { EditorEngine, PlayerEngine, type EditorWorkbenchHandle, type EditorWorkbenchOptions, type EbookDoc, type PlayerDataProvider } from "@hyebook/core";
2
+ export interface Vue3EditorAdapterOptions {
3
+ initialDoc: EbookDoc;
4
+ onDocumentChange?: (doc: EbookDoc) => void;
5
+ }
6
+ export interface Vue3PlayerAdapterOptions {
7
+ provider: PlayerDataProvider;
8
+ }
9
+ export interface Vue3EditorWorkbenchOptions extends EditorWorkbenchOptions {
10
+ }
11
+ export interface Vue3EditorWorkbenchHandle extends EditorWorkbenchHandle {
12
+ }
13
+ export declare function createVue3EditorAdapter(options: Vue3EditorAdapterOptions): EditorEngine;
14
+ export declare function createVue3PlayerAdapter(options: Vue3PlayerAdapterOptions): PlayerEngine;
15
+ export declare function mountVue3EditorWorkbench(container: HTMLElement, options?: Vue3EditorWorkbenchOptions): Vue3EditorWorkbenchHandle;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,EAEZ,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,QAAQ,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;CAAG;AAE7E,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;CAAG;AAE3E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,YAAY,CAId;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,wBAAwB,GAChC,YAAY,CAEd;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,WAAW,EACtB,OAAO,GAAE,0BAA+B,GACvC,yBAAyB,CAE3B"}
@@ -0,0 +1,12 @@
1
+ import { EditorEngine, PlayerEngine, mountEditorWorkbench, } from "@hyebook/core";
2
+ export function createVue3EditorAdapter(options) {
3
+ const engine = new EditorEngine(options.initialDoc);
4
+ options.onDocumentChange?.(engine.getDocument());
5
+ return engine;
6
+ }
7
+ export function createVue3PlayerAdapter(options) {
8
+ return new PlayerEngine(options.provider);
9
+ }
10
+ export function mountVue3EditorWorkbench(container, options = {}) {
11
+ return mountEditorWorkbench(container, options);
12
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@hyebook/vue3-adapter",
3
+ "version": "0.2.0",
4
+ "description": "Vue3 adapter for hy-ebook core",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "ssh://git@49.235.190.160:2424/hy/hy_ebook.git",
8
+ "directory": "packages/vue3-adapter"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "type": "module",
14
+ "main": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "dependencies": {
20
+ "@hyebook/core": "^0.2.0"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc -p tsconfig.json",
24
+ "typecheck": "tsc -p tsconfig.json --noEmit",
25
+ "lint": "echo 'No lint configured for @hyebook/vue3-adapter'"
26
+ }
27
+ }