@coding01/docsjs 0.1.2 → 0.1.3
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/README.md +121 -91
- package/README.zh-CN.md +179 -0
- package/dist/chunk-PRPDJOB7.js +1921 -0
- package/dist/chunk-PRPDJOB7.js.map +1 -0
- package/dist/index.cjs +528 -113
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -20
- package/dist/index.d.ts +41 -20
- package/dist/index.js +56 -1553
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1992 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +16 -0
- package/dist/react.d.ts +16 -0
- package/dist/react.js +41 -0
- package/dist/react.js.map +1 -0
- package/dist/types-DF14w1ol.d.cts +20 -0
- package/dist/types-DF14w1ol.d.ts +20 -0
- package/dist/vue.cjs +1995 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.cts +24 -0
- package/dist/vue.d.ts +24 -0
- package/dist/vue.js +44 -0
- package/dist/vue.js.map +1 -0
- package/package.json +29 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import * as vue from 'vue';
|
|
1
|
+
export { D as DocsWordEditorChangeDetail, a as DocsWordEditorElementApi, b as DocsWordEditorErrorDetail, c as DocsWordEditorReadyDetail } from './types-DF14w1ol.cjs';
|
|
3
2
|
|
|
4
3
|
declare class DocsWordElement extends HTMLElement {
|
|
5
4
|
private rootRef;
|
|
5
|
+
private toolbar;
|
|
6
|
+
private btnRead;
|
|
7
|
+
private btnUpload;
|
|
8
|
+
private btnClear;
|
|
6
9
|
private frame;
|
|
7
10
|
private pasteArea;
|
|
8
11
|
private fileInput;
|
|
@@ -10,12 +13,19 @@ declare class DocsWordElement extends HTMLElement {
|
|
|
10
13
|
private htmlSnapshot;
|
|
11
14
|
private styleProfile;
|
|
12
15
|
private frameHeight;
|
|
16
|
+
private locale;
|
|
13
17
|
constructor();
|
|
18
|
+
static get observedAttributes(): string[];
|
|
19
|
+
attributeChangedCallback(name: string, _: string | null, newValue: string | null): void;
|
|
14
20
|
connectedCallback(): void;
|
|
15
21
|
setSnapshot(rawHtml: string): void;
|
|
22
|
+
loadHtml(rawHtml: string): void;
|
|
23
|
+
getSnapshot(): string;
|
|
16
24
|
clear(): void;
|
|
25
|
+
loadDocx(file: File): Promise<void>;
|
|
17
26
|
private onUpload;
|
|
18
|
-
private
|
|
27
|
+
private applyDocx;
|
|
28
|
+
loadClipboard(): Promise<void>;
|
|
19
29
|
private applyFromClipboardData;
|
|
20
30
|
private applyPayload;
|
|
21
31
|
private onFrameLoad;
|
|
@@ -23,27 +33,38 @@ declare class DocsWordElement extends HTMLElement {
|
|
|
23
33
|
private renderSnapshot;
|
|
24
34
|
private emitChange;
|
|
25
35
|
private emitError;
|
|
36
|
+
private setHint;
|
|
37
|
+
private parseLocale;
|
|
38
|
+
private syncToolbarVisibility;
|
|
39
|
+
private syncLocaleText;
|
|
26
40
|
}
|
|
27
41
|
declare function defineDocsWordElement(): void;
|
|
28
42
|
|
|
29
|
-
interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
interface SemanticStats {
|
|
44
|
+
paragraphCount: number;
|
|
45
|
+
headingCount: number;
|
|
46
|
+
tableCount: number;
|
|
47
|
+
tableCellCount: number;
|
|
48
|
+
imageCount: number;
|
|
49
|
+
anchorImageCount: number;
|
|
50
|
+
wrappedImageCount: number;
|
|
51
|
+
listParagraphCount: number;
|
|
52
|
+
commentRefCount: number;
|
|
53
|
+
revisionInsCount: number;
|
|
54
|
+
revisionDelCount: number;
|
|
55
|
+
pageBreakCount: number;
|
|
56
|
+
pageSpacerCount: number;
|
|
57
|
+
textCharCount: number;
|
|
34
58
|
}
|
|
59
|
+
declare function collectSemanticStatsFromDocument(doc: Document): SemanticStats;
|
|
60
|
+
declare function collectSemanticStatsFromHtml(rawHtml: string): SemanticStats;
|
|
35
61
|
|
|
36
|
-
interface
|
|
37
|
-
|
|
38
|
-
|
|
62
|
+
interface FidelityScore {
|
|
63
|
+
structure: number;
|
|
64
|
+
styleProxy: number;
|
|
65
|
+
pagination: number;
|
|
66
|
+
overall: number;
|
|
39
67
|
}
|
|
40
|
-
declare function
|
|
41
|
-
|
|
42
|
-
declare const WordFidelityEditorVue: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "error")[], "change" | "error", vue.PublicProps, Readonly<{}> & Readonly<{
|
|
45
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
46
|
-
onError?: ((...args: any[]) => any) | undefined;
|
|
47
|
-
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
68
|
+
declare function calculateFidelityScore(expected: SemanticStats, actual: SemanticStats): FidelityScore;
|
|
48
69
|
|
|
49
|
-
export { type
|
|
70
|
+
export { DocsWordElement, type FidelityScore, type SemanticStats, calculateFidelityScore, collectSemanticStatsFromDocument, collectSemanticStatsFromHtml, defineDocsWordElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import * as vue from 'vue';
|
|
1
|
+
export { D as DocsWordEditorChangeDetail, a as DocsWordEditorElementApi, b as DocsWordEditorErrorDetail, c as DocsWordEditorReadyDetail } from './types-DF14w1ol.js';
|
|
3
2
|
|
|
4
3
|
declare class DocsWordElement extends HTMLElement {
|
|
5
4
|
private rootRef;
|
|
5
|
+
private toolbar;
|
|
6
|
+
private btnRead;
|
|
7
|
+
private btnUpload;
|
|
8
|
+
private btnClear;
|
|
6
9
|
private frame;
|
|
7
10
|
private pasteArea;
|
|
8
11
|
private fileInput;
|
|
@@ -10,12 +13,19 @@ declare class DocsWordElement extends HTMLElement {
|
|
|
10
13
|
private htmlSnapshot;
|
|
11
14
|
private styleProfile;
|
|
12
15
|
private frameHeight;
|
|
16
|
+
private locale;
|
|
13
17
|
constructor();
|
|
18
|
+
static get observedAttributes(): string[];
|
|
19
|
+
attributeChangedCallback(name: string, _: string | null, newValue: string | null): void;
|
|
14
20
|
connectedCallback(): void;
|
|
15
21
|
setSnapshot(rawHtml: string): void;
|
|
22
|
+
loadHtml(rawHtml: string): void;
|
|
23
|
+
getSnapshot(): string;
|
|
16
24
|
clear(): void;
|
|
25
|
+
loadDocx(file: File): Promise<void>;
|
|
17
26
|
private onUpload;
|
|
18
|
-
private
|
|
27
|
+
private applyDocx;
|
|
28
|
+
loadClipboard(): Promise<void>;
|
|
19
29
|
private applyFromClipboardData;
|
|
20
30
|
private applyPayload;
|
|
21
31
|
private onFrameLoad;
|
|
@@ -23,27 +33,38 @@ declare class DocsWordElement extends HTMLElement {
|
|
|
23
33
|
private renderSnapshot;
|
|
24
34
|
private emitChange;
|
|
25
35
|
private emitError;
|
|
36
|
+
private setHint;
|
|
37
|
+
private parseLocale;
|
|
38
|
+
private syncToolbarVisibility;
|
|
39
|
+
private syncLocaleText;
|
|
26
40
|
}
|
|
27
41
|
declare function defineDocsWordElement(): void;
|
|
28
42
|
|
|
29
|
-
interface
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
interface SemanticStats {
|
|
44
|
+
paragraphCount: number;
|
|
45
|
+
headingCount: number;
|
|
46
|
+
tableCount: number;
|
|
47
|
+
tableCellCount: number;
|
|
48
|
+
imageCount: number;
|
|
49
|
+
anchorImageCount: number;
|
|
50
|
+
wrappedImageCount: number;
|
|
51
|
+
listParagraphCount: number;
|
|
52
|
+
commentRefCount: number;
|
|
53
|
+
revisionInsCount: number;
|
|
54
|
+
revisionDelCount: number;
|
|
55
|
+
pageBreakCount: number;
|
|
56
|
+
pageSpacerCount: number;
|
|
57
|
+
textCharCount: number;
|
|
34
58
|
}
|
|
59
|
+
declare function collectSemanticStatsFromDocument(doc: Document): SemanticStats;
|
|
60
|
+
declare function collectSemanticStatsFromHtml(rawHtml: string): SemanticStats;
|
|
35
61
|
|
|
36
|
-
interface
|
|
37
|
-
|
|
38
|
-
|
|
62
|
+
interface FidelityScore {
|
|
63
|
+
structure: number;
|
|
64
|
+
styleProxy: number;
|
|
65
|
+
pagination: number;
|
|
66
|
+
overall: number;
|
|
39
67
|
}
|
|
40
|
-
declare function
|
|
41
|
-
|
|
42
|
-
declare const WordFidelityEditorVue: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "error")[], "change" | "error", vue.PublicProps, Readonly<{}> & Readonly<{
|
|
45
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
46
|
-
onError?: ((...args: any[]) => any) | undefined;
|
|
47
|
-
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
68
|
+
declare function calculateFidelityScore(expected: SemanticStats, actual: SemanticStats): FidelityScore;
|
|
48
69
|
|
|
49
|
-
export { type
|
|
70
|
+
export { DocsWordElement, type FidelityScore, type SemanticStats, calculateFidelityScore, collectSemanticStatsFromDocument, collectSemanticStatsFromHtml, defineDocsWordElement };
|