@coding01/docsjs 0.1.6 → 0.1.7
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/index.cjs +26 -2339
- package/dist/index.d.ts +44 -3
- package/dist/index.js +60 -79
- package/dist/react.cjs +1 -2339
- package/dist/react.d.ts +3 -2
- package/dist/react.js +1 -50
- package/dist/{types-VvdwVF0_.d.cts → types-BgP7Zasj.d.ts} +1 -6
- package/dist/vue.cjs +1 -2333
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +1 -44
- package/package.json +6 -3
- package/dist/chunk-632UOG2B.js +0 -2267
- package/dist/chunk-632UOG2B.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -73
- package/dist/index.js.map +0 -1
- package/dist/react.cjs.map +0 -1
- package/dist/react.d.cts +0 -16
- package/dist/react.js.map +0 -1
- package/dist/types-VvdwVF0_.d.ts +0 -44
- package/dist/vue.cjs.map +0 -1
- package/dist/vue.d.cts +0 -24
- package/dist/vue.js.map +0 -1
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DocsWordEditorChangeDetail, DocsWordEditorErrorDetail, DocsWordEditorReadyDetail, DocsWordEditorElementApi } from './index';
|
|
3
|
+
export { D as DocsWordEditorChangeDetail, a as DocsWordEditorElementApi, b as DocsWordEditorErrorDetail, c as DocsWordEditorReadyDetail } from './types-BgP7Zasj.js';
|
|
3
4
|
|
|
4
5
|
interface WordFidelityEditorReactProps {
|
|
5
6
|
lang?: "zh" | "en";
|
|
@@ -13,4 +14,4 @@ declare function WordFidelityEditorReact({ lang, onChange, onError, onReady, edi
|
|
|
13
14
|
lang: "zh" | "en" | undefined;
|
|
14
15
|
}, string | React.JSXElementConstructor<any>>;
|
|
15
16
|
|
|
16
|
-
export {
|
|
17
|
+
export { WordFidelityEditorReact, type WordFidelityEditorReactProps };
|
package/dist/react.js
CHANGED
|
@@ -1,50 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineDocsWordElement
|
|
3
|
-
} from "./chunk-632UOG2B.js";
|
|
4
|
-
|
|
5
|
-
// src/react/WordFidelityEditorReact.tsx
|
|
6
|
-
import React, { useEffect, useRef } from "react";
|
|
7
|
-
defineDocsWordElement();
|
|
8
|
-
function WordFidelityEditorReact({
|
|
9
|
-
lang,
|
|
10
|
-
onChange,
|
|
11
|
-
onError,
|
|
12
|
-
onReady,
|
|
13
|
-
editorRef
|
|
14
|
-
}) {
|
|
15
|
-
const ref = useRef(null);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const node = ref.current;
|
|
18
|
-
if (!node) return;
|
|
19
|
-
const onChangeEvent = (event) => {
|
|
20
|
-
const detail = event.detail;
|
|
21
|
-
onChange?.(detail);
|
|
22
|
-
};
|
|
23
|
-
const onErrorEvent = (event) => {
|
|
24
|
-
const detail = event.detail;
|
|
25
|
-
onError?.(detail);
|
|
26
|
-
};
|
|
27
|
-
const onReadyEvent = (event) => {
|
|
28
|
-
const detail = event.detail;
|
|
29
|
-
onReady?.(detail);
|
|
30
|
-
};
|
|
31
|
-
node.addEventListener("docsjs-change", onChangeEvent);
|
|
32
|
-
node.addEventListener("docsjs-error", onErrorEvent);
|
|
33
|
-
node.addEventListener("docsjs-ready", onReadyEvent);
|
|
34
|
-
editorRef?.(node);
|
|
35
|
-
return () => {
|
|
36
|
-
node.removeEventListener("docsjs-change", onChangeEvent);
|
|
37
|
-
node.removeEventListener("docsjs-error", onErrorEvent);
|
|
38
|
-
node.removeEventListener("docsjs-ready", onReadyEvent);
|
|
39
|
-
editorRef?.(null);
|
|
40
|
-
};
|
|
41
|
-
}, [editorRef, onChange, onError, onReady]);
|
|
42
|
-
return React.createElement("docs-word-editor", {
|
|
43
|
-
ref,
|
|
44
|
-
lang
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export {
|
|
48
|
-
WordFidelityEditorReact
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=react.js.map
|
|
1
|
+
import D,{useEffect as m,useRef as p}from"react";import{defineDocsWordElement as W}from"../index";W();function v({lang:l,onChange:d,onError:i,onReady:n,editorRef:r}){let a=p(null);return m(()=>{let e=a.current;if(!e)return;let s=o=>{let t=o.detail;d?.(t)},E=o=>{let t=o.detail;i?.(t)},c=o=>{let t=o.detail;n?.(t)};return e.addEventListener("docsjs-change",s),e.addEventListener("docsjs-error",E),e.addEventListener("docsjs-ready",c),r?.(e),()=>{e.removeEventListener("docsjs-change",s),e.removeEventListener("docsjs-error",E),e.removeEventListener("docsjs-ready",c),r?.(null)}},[r,d,i,n]),D.createElement("docs-word-editor",{ref:a,lang:l})}export{v as WordFidelityEditorReact};
|
|
@@ -15,11 +15,6 @@ interface DocxParseReport {
|
|
|
15
15
|
elapsedMs: number;
|
|
16
16
|
features: DocxParseFeatureCounts;
|
|
17
17
|
}
|
|
18
|
-
declare function parseDocxToHtmlSnapshotWithReport(file: File): Promise<{
|
|
19
|
-
htmlSnapshot: string;
|
|
20
|
-
report: DocxParseReport;
|
|
21
|
-
}>;
|
|
22
|
-
declare function parseDocxToHtmlSnapshot(file: File): Promise<string>;
|
|
23
18
|
|
|
24
19
|
interface DocsWordEditorChangeDetail {
|
|
25
20
|
htmlSnapshot: string;
|
|
@@ -41,4 +36,4 @@ interface DocsWordEditorElementApi extends HTMLElement {
|
|
|
41
36
|
getSnapshot(): string;
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
export {
|
|
39
|
+
export type { DocsWordEditorChangeDetail as D, DocsWordEditorElementApi as a, DocsWordEditorErrorDetail as b, DocsWordEditorReadyDetail as c };
|