@docling/docling-components 0.0.7 → 0.0.10

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,180 @@
1
+ import { CustomElementDecorator } from 'lit/decorators.js';
2
+ import { PictureItem, DocItem as DocItem$1, PageItem, ProvenanceItem, PictureClassificationData, PictureDescriptionData, CodeItem, KeyValueItem, TableItem, TextItem, TitleItem, BoundingBox } from '@docling/docling-core';
3
+ import * as lit from 'lit';
4
+ import { LitElement, TemplateResult } from 'lit';
5
+ import * as lit_html from 'lit-html';
6
+
7
+ type Annotation = NonNullable<PictureItem['annotations']>[number];
8
+ declare abstract class DoclingAnnotationElement<I extends object = object, A extends object = object> extends LitElement {
9
+ annotation?: Annotation;
10
+ item?: DocItem$1;
11
+ page?: PageItem;
12
+ prov?: ProvenanceItem;
13
+ abstract renderAnnotation(annotation: A, item: I, page: PageItem, prov?: ProvenanceItem): TemplateResult;
14
+ abstract canDrawAnnotation(annotation: object): annotation is A;
15
+ abstract canDrawItem(item: object): item is I;
16
+ render(): TemplateResult | undefined;
17
+ }
18
+
19
+ declare function customDoclingAnnotationElement(tagName: string): CustomElementDecorator;
20
+
21
+ declare class AnnotationPictureClassification extends DoclingAnnotationElement<PictureItem, PictureClassificationData> {
22
+ precision: number;
23
+ renderAnnotation(annotation: PictureClassificationData, _item: PictureItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
24
+ canDrawAnnotation(annotation: PictureClassificationData): annotation is PictureClassificationData;
25
+ canDrawItem(item: PictureItem): item is PictureItem;
26
+ static styles: lit.CSSResult;
27
+ }
28
+
29
+ declare class AnnotationPictureDescription extends DoclingAnnotationElement<PictureItem, PictureDescriptionData> {
30
+ renderAnnotation(annotation: PictureDescriptionData, _item: PictureItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
31
+ canDrawAnnotation(annotation: PictureDescriptionData): annotation is PictureDescriptionData;
32
+ canDrawItem(item: PictureItem): item is PictureItem;
33
+ static styles: lit.CSSResult;
34
+ }
35
+
36
+ /**
37
+ * DocItem extended with an optional traversal fields.
38
+ */
39
+ type DocItem = DocItem$1 & {
40
+ level?: number;
41
+ };
42
+
43
+ declare abstract class DoclingItemElement<I extends object = object> extends LitElement {
44
+ item?: DocItem;
45
+ page?: PageItem;
46
+ prov?: ProvenanceItem;
47
+ abstract renderItem(item: I, page: PageItem, prov?: ProvenanceItem): TemplateResult;
48
+ abstract canDrawItem(item: object): item is I;
49
+ render(): TemplateResult | undefined;
50
+ static styles: lit.CSSResult;
51
+ }
52
+
53
+ declare abstract class ItemView extends DoclingItemElement<DocItem$1> {
54
+ abstract type: string;
55
+ private get itemChildren();
56
+ private get annotationChildren();
57
+ private get isCustomized();
58
+ renderItem(item: DocItem$1, page: PageItem, prov: ProvenanceItem): lit_html.TemplateResult<1>;
59
+ canDrawItem(item: object): item is DocItem$1;
60
+ }
61
+ declare class ItemOverlay extends ItemView {
62
+ type: string;
63
+ }
64
+ declare class ItemTooltip extends ItemView {
65
+ type: string;
66
+ }
67
+
68
+ declare class ImgTrace extends LitElement {
69
+ page?: PageItem;
70
+ items?: DocItem[];
71
+ render(): lit_html.TemplateResult<1> | undefined;
72
+ static styles: lit.CSSResult;
73
+ }
74
+
75
+ declare class ImgPage extends LitElement {
76
+ page?: PageItem;
77
+ items?: DocItem[];
78
+ pagenumbers: boolean;
79
+ itemPart?: (page: PageItem, item: DocItem) => string;
80
+ itemStyle?: (page: PageItem, item: DocItem) => string;
81
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
82
+ backdrop?: boolean;
83
+ overlay?: ItemOverlay;
84
+ tooltip?: ItemTooltip;
85
+ trace?: ImgTrace;
86
+ render(): lit_html.TemplateResult<1>;
87
+ private layOver;
88
+ private attachTooltip;
89
+ private removeTooltip;
90
+ private renderTrace;
91
+ static styles: lit.CSSResult;
92
+ }
93
+
94
+ declare class ImgPages extends LitElement {
95
+ alt?: string;
96
+ backdrop?: string;
97
+ items?: string | DocItem[];
98
+ pagenumbers?: boolean;
99
+ src: string;
100
+ trim: "pages";
101
+ itemPart?: (page: PageItem, item: DocItem) => string;
102
+ itemStyle?: (page: PageItem, item: DocItem) => string;
103
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
104
+ private fetchTask;
105
+ render(): lit_html.TemplateResult<1> | undefined;
106
+ static styles: lit.CSSResult;
107
+ }
108
+
109
+ declare function customDoclingItemElement(tagName: string): CustomElementDecorator;
110
+
111
+ declare class ItemCode extends DoclingItemElement<CodeItem> {
112
+ renderItem(item: CodeItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
113
+ canDrawItem(item: object): item is CodeItem;
114
+ static styles: lit.CSSResult;
115
+ }
116
+
117
+ declare class ItemKeyValue extends DoclingItemElement<KeyValueItem> {
118
+ renderItem(item: KeyValueItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
119
+ canDrawItem(item: object): item is KeyValueItem;
120
+ static styles: lit.CSSResult;
121
+ }
122
+
123
+ declare class ItemProvenance extends DoclingItemElement<DocItem> {
124
+ renderItem(item: DocItem, page: PageItem): lit_html.TemplateResult<1>;
125
+ canDrawItem(item: object): item is DocItem;
126
+ static styles: lit.CSSResult;
127
+ }
128
+
129
+ declare class ItemTable extends DoclingItemElement<TableItem> {
130
+ renderItem(item: TableItem): lit_html.TemplateResult<1>;
131
+ canDrawItem(item: object): item is TableItem;
132
+ static styles: lit.CSSResult;
133
+ }
134
+
135
+ declare class ItemTemplate extends DoclingItemElement<TextItem> {
136
+ renderItem: any;
137
+ canDrawItem(item: object): item is TextItem;
138
+ }
139
+
140
+ declare class ItemText extends DoclingItemElement<TextItem> {
141
+ renderItem(item: TextItem, page: PageItem, prov?: ProvenanceItem): TemplateResult;
142
+ private textClass;
143
+ /** Render bullet or numbered prefix for list items. */
144
+ private listPrefix;
145
+ canDrawItem(item: object): item is TextItem | TitleItem;
146
+ static styles: lit.CSSResult;
147
+ }
148
+
149
+ declare function normalBbox(bbox: BoundingBox, page: PageItem): BoundingBox;
150
+
151
+ declare class TableColumn extends ItemView {
152
+ type: string;
153
+ }
154
+
155
+ declare class TablePage extends LitElement {
156
+ page?: PageItem;
157
+ items?: DocItem[];
158
+ columns: TableColumn[];
159
+ pagenumbers?: boolean;
160
+ itemPart?: (page: PageItem, item: DocItem) => string;
161
+ itemStyle?: (page: PageItem, item: DocItem) => string;
162
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
163
+ render(): lit_html.TemplateResult<1>;
164
+ static styles: lit.CSSResult;
165
+ }
166
+
167
+ declare class TablePages extends LitElement {
168
+ alt?: string;
169
+ items?: string | DocItem[];
170
+ pagenumbers?: boolean;
171
+ src: string;
172
+ itemPart?: (page: PageItem, item: DocItem) => string;
173
+ itemStyle?: (page: PageItem, item: DocItem) => string;
174
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
175
+ private fetchTask;
176
+ render(): lit_html.TemplateResult<1> | undefined;
177
+ static styles: lit.CSSResult;
178
+ }
179
+
180
+ export { type Annotation, AnnotationPictureClassification, AnnotationPictureDescription, type DocItem, DoclingAnnotationElement, DoclingItemElement, ImgPage, ImgPages, ImgTrace, ItemCode, ItemKeyValue, ItemOverlay, ItemProvenance, ItemTable, ItemTemplate, ItemText, ItemTooltip, ItemView, TablePage, TablePages, customDoclingAnnotationElement, customDoclingItemElement, normalBbox };
@@ -0,0 +1,180 @@
1
+ import { CustomElementDecorator } from 'lit/decorators.js';
2
+ import { PictureItem, DocItem as DocItem$1, PageItem, ProvenanceItem, PictureClassificationData, PictureDescriptionData, CodeItem, KeyValueItem, TableItem, TextItem, TitleItem, BoundingBox } from '@docling/docling-core';
3
+ import * as lit from 'lit';
4
+ import { LitElement, TemplateResult } from 'lit';
5
+ import * as lit_html from 'lit-html';
6
+
7
+ type Annotation = NonNullable<PictureItem['annotations']>[number];
8
+ declare abstract class DoclingAnnotationElement<I extends object = object, A extends object = object> extends LitElement {
9
+ annotation?: Annotation;
10
+ item?: DocItem$1;
11
+ page?: PageItem;
12
+ prov?: ProvenanceItem;
13
+ abstract renderAnnotation(annotation: A, item: I, page: PageItem, prov?: ProvenanceItem): TemplateResult;
14
+ abstract canDrawAnnotation(annotation: object): annotation is A;
15
+ abstract canDrawItem(item: object): item is I;
16
+ render(): TemplateResult | undefined;
17
+ }
18
+
19
+ declare function customDoclingAnnotationElement(tagName: string): CustomElementDecorator;
20
+
21
+ declare class AnnotationPictureClassification extends DoclingAnnotationElement<PictureItem, PictureClassificationData> {
22
+ precision: number;
23
+ renderAnnotation(annotation: PictureClassificationData, _item: PictureItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
24
+ canDrawAnnotation(annotation: PictureClassificationData): annotation is PictureClassificationData;
25
+ canDrawItem(item: PictureItem): item is PictureItem;
26
+ static styles: lit.CSSResult;
27
+ }
28
+
29
+ declare class AnnotationPictureDescription extends DoclingAnnotationElement<PictureItem, PictureDescriptionData> {
30
+ renderAnnotation(annotation: PictureDescriptionData, _item: PictureItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
31
+ canDrawAnnotation(annotation: PictureDescriptionData): annotation is PictureDescriptionData;
32
+ canDrawItem(item: PictureItem): item is PictureItem;
33
+ static styles: lit.CSSResult;
34
+ }
35
+
36
+ /**
37
+ * DocItem extended with an optional traversal fields.
38
+ */
39
+ type DocItem = DocItem$1 & {
40
+ level?: number;
41
+ };
42
+
43
+ declare abstract class DoclingItemElement<I extends object = object> extends LitElement {
44
+ item?: DocItem;
45
+ page?: PageItem;
46
+ prov?: ProvenanceItem;
47
+ abstract renderItem(item: I, page: PageItem, prov?: ProvenanceItem): TemplateResult;
48
+ abstract canDrawItem(item: object): item is I;
49
+ render(): TemplateResult | undefined;
50
+ static styles: lit.CSSResult;
51
+ }
52
+
53
+ declare abstract class ItemView extends DoclingItemElement<DocItem$1> {
54
+ abstract type: string;
55
+ private get itemChildren();
56
+ private get annotationChildren();
57
+ private get isCustomized();
58
+ renderItem(item: DocItem$1, page: PageItem, prov: ProvenanceItem): lit_html.TemplateResult<1>;
59
+ canDrawItem(item: object): item is DocItem$1;
60
+ }
61
+ declare class ItemOverlay extends ItemView {
62
+ type: string;
63
+ }
64
+ declare class ItemTooltip extends ItemView {
65
+ type: string;
66
+ }
67
+
68
+ declare class ImgTrace extends LitElement {
69
+ page?: PageItem;
70
+ items?: DocItem[];
71
+ render(): lit_html.TemplateResult<1> | undefined;
72
+ static styles: lit.CSSResult;
73
+ }
74
+
75
+ declare class ImgPage extends LitElement {
76
+ page?: PageItem;
77
+ items?: DocItem[];
78
+ pagenumbers: boolean;
79
+ itemPart?: (page: PageItem, item: DocItem) => string;
80
+ itemStyle?: (page: PageItem, item: DocItem) => string;
81
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
82
+ backdrop?: boolean;
83
+ overlay?: ItemOverlay;
84
+ tooltip?: ItemTooltip;
85
+ trace?: ImgTrace;
86
+ render(): lit_html.TemplateResult<1>;
87
+ private layOver;
88
+ private attachTooltip;
89
+ private removeTooltip;
90
+ private renderTrace;
91
+ static styles: lit.CSSResult;
92
+ }
93
+
94
+ declare class ImgPages extends LitElement {
95
+ alt?: string;
96
+ backdrop?: string;
97
+ items?: string | DocItem[];
98
+ pagenumbers?: boolean;
99
+ src: string;
100
+ trim: "pages";
101
+ itemPart?: (page: PageItem, item: DocItem) => string;
102
+ itemStyle?: (page: PageItem, item: DocItem) => string;
103
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
104
+ private fetchTask;
105
+ render(): lit_html.TemplateResult<1> | undefined;
106
+ static styles: lit.CSSResult;
107
+ }
108
+
109
+ declare function customDoclingItemElement(tagName: string): CustomElementDecorator;
110
+
111
+ declare class ItemCode extends DoclingItemElement<CodeItem> {
112
+ renderItem(item: CodeItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
113
+ canDrawItem(item: object): item is CodeItem;
114
+ static styles: lit.CSSResult;
115
+ }
116
+
117
+ declare class ItemKeyValue extends DoclingItemElement<KeyValueItem> {
118
+ renderItem(item: KeyValueItem, _page: PageItem, _prov?: ProvenanceItem): TemplateResult;
119
+ canDrawItem(item: object): item is KeyValueItem;
120
+ static styles: lit.CSSResult;
121
+ }
122
+
123
+ declare class ItemProvenance extends DoclingItemElement<DocItem> {
124
+ renderItem(item: DocItem, page: PageItem): lit_html.TemplateResult<1>;
125
+ canDrawItem(item: object): item is DocItem;
126
+ static styles: lit.CSSResult;
127
+ }
128
+
129
+ declare class ItemTable extends DoclingItemElement<TableItem> {
130
+ renderItem(item: TableItem): lit_html.TemplateResult<1>;
131
+ canDrawItem(item: object): item is TableItem;
132
+ static styles: lit.CSSResult;
133
+ }
134
+
135
+ declare class ItemTemplate extends DoclingItemElement<TextItem> {
136
+ renderItem: any;
137
+ canDrawItem(item: object): item is TextItem;
138
+ }
139
+
140
+ declare class ItemText extends DoclingItemElement<TextItem> {
141
+ renderItem(item: TextItem, page: PageItem, prov?: ProvenanceItem): TemplateResult;
142
+ private textClass;
143
+ /** Render bullet or numbered prefix for list items. */
144
+ private listPrefix;
145
+ canDrawItem(item: object): item is TextItem | TitleItem;
146
+ static styles: lit.CSSResult;
147
+ }
148
+
149
+ declare function normalBbox(bbox: BoundingBox, page: PageItem): BoundingBox;
150
+
151
+ declare class TableColumn extends ItemView {
152
+ type: string;
153
+ }
154
+
155
+ declare class TablePage extends LitElement {
156
+ page?: PageItem;
157
+ items?: DocItem[];
158
+ columns: TableColumn[];
159
+ pagenumbers?: boolean;
160
+ itemPart?: (page: PageItem, item: DocItem) => string;
161
+ itemStyle?: (page: PageItem, item: DocItem) => string;
162
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
163
+ render(): lit_html.TemplateResult<1>;
164
+ static styles: lit.CSSResult;
165
+ }
166
+
167
+ declare class TablePages extends LitElement {
168
+ alt?: string;
169
+ items?: string | DocItem[];
170
+ pagenumbers?: boolean;
171
+ src: string;
172
+ itemPart?: (page: PageItem, item: DocItem) => string;
173
+ itemStyle?: (page: PageItem, item: DocItem) => string;
174
+ onClickItem?: (ev: MouseEvent, page: PageItem, item?: DocItem) => void;
175
+ private fetchTask;
176
+ render(): lit_html.TemplateResult<1> | undefined;
177
+ static styles: lit.CSSResult;
178
+ }
179
+
180
+ export { type Annotation, AnnotationPictureClassification, AnnotationPictureDescription, type DocItem, DoclingAnnotationElement, DoclingItemElement, ImgPage, ImgPages, ImgTrace, ItemCode, ItemKeyValue, ItemOverlay, ItemProvenance, ItemTable, ItemTemplate, ItemText, ItemTooltip, ItemView, TablePage, TablePages, customDoclingAnnotationElement, customDoclingItemElement, normalBbox };