@coding01/docsjs 0.1.2 → 0.1.5

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.d.cts CHANGED
@@ -1,8 +1,11 @@
1
- import React from 'react';
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 readClipboard;
27
+ private applyDocx;
28
+ loadClipboard(): Promise<void>;
19
29
  private applyFromClipboardData;
20
30
  private applyPayload;
21
31
  private onFrameLoad;
@@ -23,27 +33,41 @@ 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 DocsWordEditorChangeDetail {
30
- htmlSnapshot: string;
31
- }
32
- interface DocsWordEditorErrorDetail {
33
- message: string;
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
+ ommlCount: number;
52
+ chartCount: number;
53
+ smartArtCount: number;
54
+ listParagraphCount: number;
55
+ commentRefCount: number;
56
+ revisionInsCount: number;
57
+ revisionDelCount: number;
58
+ pageBreakCount: number;
59
+ pageSpacerCount: number;
60
+ textCharCount: number;
34
61
  }
62
+ declare function collectSemanticStatsFromDocument(doc: Document): SemanticStats;
63
+ declare function collectSemanticStatsFromHtml(rawHtml: string): SemanticStats;
35
64
 
36
- interface WordFidelityEditorReactProps {
37
- onChange?: (payload: DocsWordEditorChangeDetail) => void;
38
- onError?: (payload: DocsWordEditorErrorDetail) => void;
65
+ interface FidelityScore {
66
+ structure: number;
67
+ styleProxy: number;
68
+ pagination: number;
69
+ overall: number;
39
70
  }
40
- declare function WordFidelityEditorReact({ onChange, onError }: WordFidelityEditorReactProps): React.DOMElement<React.DOMAttributes<HTMLElement>, HTMLElement>;
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>;
71
+ declare function calculateFidelityScore(expected: SemanticStats, actual: SemanticStats): FidelityScore;
48
72
 
49
- export { type DocsWordEditorChangeDetail, type DocsWordEditorErrorDetail, DocsWordElement, WordFidelityEditorReact, type WordFidelityEditorReactProps, WordFidelityEditorVue, defineDocsWordElement };
73
+ export { DocsWordElement, type FidelityScore, type SemanticStats, calculateFidelityScore, collectSemanticStatsFromDocument, collectSemanticStatsFromHtml, defineDocsWordElement };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
- import React from 'react';
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 readClipboard;
27
+ private applyDocx;
28
+ loadClipboard(): Promise<void>;
19
29
  private applyFromClipboardData;
20
30
  private applyPayload;
21
31
  private onFrameLoad;
@@ -23,27 +33,41 @@ 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 DocsWordEditorChangeDetail {
30
- htmlSnapshot: string;
31
- }
32
- interface DocsWordEditorErrorDetail {
33
- message: string;
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
+ ommlCount: number;
52
+ chartCount: number;
53
+ smartArtCount: number;
54
+ listParagraphCount: number;
55
+ commentRefCount: number;
56
+ revisionInsCount: number;
57
+ revisionDelCount: number;
58
+ pageBreakCount: number;
59
+ pageSpacerCount: number;
60
+ textCharCount: number;
34
61
  }
62
+ declare function collectSemanticStatsFromDocument(doc: Document): SemanticStats;
63
+ declare function collectSemanticStatsFromHtml(rawHtml: string): SemanticStats;
35
64
 
36
- interface WordFidelityEditorReactProps {
37
- onChange?: (payload: DocsWordEditorChangeDetail) => void;
38
- onError?: (payload: DocsWordEditorErrorDetail) => void;
65
+ interface FidelityScore {
66
+ structure: number;
67
+ styleProxy: number;
68
+ pagination: number;
69
+ overall: number;
39
70
  }
40
- declare function WordFidelityEditorReact({ onChange, onError }: WordFidelityEditorReactProps): React.DOMElement<React.DOMAttributes<HTMLElement>, HTMLElement>;
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>;
71
+ declare function calculateFidelityScore(expected: SemanticStats, actual: SemanticStats): FidelityScore;
48
72
 
49
- export { type DocsWordEditorChangeDetail, type DocsWordEditorErrorDetail, DocsWordElement, WordFidelityEditorReact, type WordFidelityEditorReactProps, WordFidelityEditorVue, defineDocsWordElement };
73
+ export { DocsWordElement, type FidelityScore, type SemanticStats, calculateFidelityScore, collectSemanticStatsFromDocument, collectSemanticStatsFromHtml, defineDocsWordElement };