nuvra 0.4.0 → 0.5.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.
- package/README.md +179 -13
- package/dist/compare.vue.d.ts +19 -0
- package/dist/components/document-editor.vue.d.ts +49 -3
- package/dist/components/editor-canvas.vue.d.ts +6 -7
- package/dist/components/editor-changes.vue.d.ts +18 -0
- package/dist/components/editor-comments.vue.d.ts +32 -0
- package/dist/components/editor-footnote-form.vue.d.ts +19 -0
- package/dist/components/editor-outline.vue.d.ts +16 -0
- package/dist/components/editor-slash-menu.vue.d.ts +13 -0
- package/dist/components/editor-toolbar.vue.d.ts +24 -1
- package/dist/core/comments.d.ts +26 -0
- package/dist/core/dates.d.ts +8 -0
- package/dist/core/diff.d.ts +11 -0
- package/dist/core/document-templates.d.ts +22 -0
- package/dist/core/docx/export.d.ts +19 -0
- package/dist/core/docx/import.d.ts +19 -0
- package/dist/core/docx/zip.d.ts +23 -0
- package/dist/core/engine/dom.d.ts +31 -1
- package/dist/core/engine/editing.d.ts +11 -0
- package/dist/core/engine/engine.d.ts +144 -2
- package/dist/core/engine/input-rules.d.ts +3 -1
- package/dist/core/engine/marks.d.ts +50 -1
- package/dist/core/engine/schema.d.ts +7 -2
- package/dist/core/export.d.ts +6 -5
- package/dist/core/footnotes.d.ts +15 -0
- package/dist/core/icons.d.ts +1 -1
- package/dist/core/labels.d.ts +6 -2
- package/dist/core/locales/uz-cyrl.d.ts +3 -0
- package/dist/core/locales/uz.d.ts +64 -1
- package/dist/core/numbers.d.ts +19 -0
- package/dist/core/outline.d.ts +42 -0
- package/dist/core/page.d.ts +12 -2
- package/dist/core/pagination.d.ts +4 -1
- package/dist/core/signature.d.ts +15 -0
- package/dist/core/slash-commands.d.ts +19 -0
- package/dist/core/templates.d.ts +32 -0
- package/dist/core/transliterate.d.ts +13 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/ui-state.d.ts +8 -0
- package/dist/editor.vue.d.ts +6 -2
- package/dist/export-DhHI3ZrQ.js +94 -0
- package/dist/export-DhHI3ZrQ.js.map +1 -0
- package/dist/footnotes-DBShImw7.js +11 -0
- package/dist/footnotes-DBShImw7.js.map +1 -0
- package/dist/form.vue.d.ts +39 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +8005 -4236
- package/dist/index.js.map +1 -1
- package/dist/{page-DL7Oj2o8.js → page-DY5fdgcT.js} +10 -10
- package/dist/page-DY5fdgcT.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/zip-CpbwZtot.js +46 -0
- package/dist/zip-CpbwZtot.js.map +1 -0
- package/package.json +5 -2
- package/dist/export-VeTfgCEp.js +0 -117
- package/dist/export-VeTfgCEp.js.map +0 -1
- package/dist/page-DL7Oj2o8.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Uzbek (Latin) texts of the editor interface; `{name}` marks a placeholder filled in at translation time. */
|
|
2
2
|
export declare const uz: {
|
|
3
|
+
readonly 'editor.amountInWords': "Summani so‘z bilan yozish";
|
|
3
4
|
readonly 'editor.align': "Tekislash";
|
|
4
5
|
readonly 'editor.align.center': "Markazga";
|
|
5
6
|
readonly 'editor.align.justify': "Ikki tomonga";
|
|
@@ -14,9 +15,32 @@ export declare const uz: {
|
|
|
14
15
|
readonly 'editor.case.toggle': "rEGISTRNI ALMASHTIRISH";
|
|
15
16
|
readonly 'editor.case.upper': "BOSH HARFLAR";
|
|
16
17
|
readonly 'editor.changeCase': "Harf registri";
|
|
18
|
+
readonly 'editor.changes': "O‘zgarishlar";
|
|
19
|
+
readonly 'editor.changes.accept': "Qabul qilish";
|
|
20
|
+
readonly 'editor.changes.acceptAll': "Hammasini qabul qilish";
|
|
21
|
+
readonly 'editor.changes.deleted': "O‘chirildi";
|
|
22
|
+
readonly 'editor.changes.empty': "Kuzatilgan o‘zgarishlar yo‘q. Kuzatishni yoqing — yozilgan va o‘chirilgan matn shu yerda ko‘rinadi.";
|
|
23
|
+
readonly 'editor.changes.inserted': "Qo‘shildi";
|
|
24
|
+
readonly 'editor.changes.reject': "Rad etish";
|
|
25
|
+
readonly 'editor.changes.rejectAll': "Hammasini rad etish";
|
|
17
26
|
readonly 'editor.clearFormatting': "Formatni tozalash";
|
|
18
27
|
readonly 'editor.close': "Yopish";
|
|
19
28
|
readonly 'editor.codeBlock': "Kod bloki";
|
|
29
|
+
readonly 'editor.comment.add': "Izoh qo‘shish";
|
|
30
|
+
readonly 'editor.comment.cancel': "Bekor qilish";
|
|
31
|
+
readonly 'editor.comment.detached': "Izoh qoldirilgan matn o‘chirilgan";
|
|
32
|
+
readonly 'editor.comment.placeholder': "Izoh yozing… (Ctrl+Enter — saqlash)";
|
|
33
|
+
readonly 'editor.comment.reopen': "Qayta ochish";
|
|
34
|
+
readonly 'editor.comment.reply': "Javob";
|
|
35
|
+
readonly 'editor.comment.replyPlaceholder': "Javob yozing…";
|
|
36
|
+
readonly 'editor.comment.resolve': "Hal qilindi";
|
|
37
|
+
readonly 'editor.comment.resolved': "Hal qilingan";
|
|
38
|
+
readonly 'editor.comment.save': "Saqlash";
|
|
39
|
+
readonly 'editor.comments': "Izohlar";
|
|
40
|
+
readonly 'editor.comments.empty': "Hali izohlar yo‘q. Matnni belgilab, izoh qo‘shing.";
|
|
41
|
+
readonly 'editor.compare.deletions': "O‘chirilgan so‘zlar: {count}";
|
|
42
|
+
readonly 'editor.compare.insertions': "Qo‘shilgan so‘zlar: {count}";
|
|
43
|
+
readonly 'editor.compare.same': "Versiyalar bir xil";
|
|
20
44
|
readonly 'editor.colors.automatic': "Avtomatik";
|
|
21
45
|
readonly 'editor.colors.custom': "Boshqa rang…";
|
|
22
46
|
readonly 'editor.colors.none': "Rangsiz";
|
|
@@ -35,10 +59,12 @@ export declare const uz: {
|
|
|
35
59
|
readonly 'editor.enterFullscreen': "To‘liq ekran";
|
|
36
60
|
readonly 'editor.exitFullscreen': "To‘liq ekrandan chiqish";
|
|
37
61
|
readonly 'editor.exportHtml': "HTML sifatida yuklab olish";
|
|
38
|
-
readonly 'editor.exportWord': "Word (.
|
|
62
|
+
readonly 'editor.exportWord': "Word (.docx) sifatida yuklab olish";
|
|
39
63
|
readonly 'editor.fitWidth': "Kenglikka moslash";
|
|
40
64
|
readonly 'editor.fontFamily': "Shrift";
|
|
41
65
|
readonly 'editor.fontSize': "Shrift o‘lchami";
|
|
66
|
+
readonly 'editor.footnote': "Snoska (sahifa osti izohi)";
|
|
67
|
+
readonly 'editor.footnote.placeholder': "Snoska matni… (Ctrl+Enter — saqlash)";
|
|
42
68
|
readonly 'editor.footer': "Pastki kolontitul";
|
|
43
69
|
readonly 'editor.formatPainter': "Format bo‘yoqchasi";
|
|
44
70
|
readonly 'editor.formattingMarks': "Formatlash belgilari";
|
|
@@ -46,6 +72,8 @@ export declare const uz: {
|
|
|
46
72
|
readonly 'editor.headerFooter': "Kolontitullar";
|
|
47
73
|
readonly 'editor.headerFooter.center': "Markaz";
|
|
48
74
|
readonly 'editor.headerFooter.clear': "Tozalash";
|
|
75
|
+
readonly 'editor.headerFooter.differentFirst': "Birinchi sahifada ko‘rsatilmasin";
|
|
76
|
+
readonly 'editor.headerFooter.firstNumber': "Raqamlash boshlanishi";
|
|
49
77
|
readonly 'editor.headerFooter.hint': "Matn har bir sahifada takrorlanadi.";
|
|
50
78
|
readonly 'editor.headerFooter.left': "Chap";
|
|
51
79
|
readonly 'editor.headerFooter.right': "O‘ng";
|
|
@@ -63,11 +91,13 @@ export declare const uz: {
|
|
|
63
91
|
readonly 'editor.imageSizeError': "Rasm hajmi {size} MB dan oshmasligi kerak";
|
|
64
92
|
readonly 'editor.imageTypeError': "Faqat rasm fayllarini qo‘shish mumkin";
|
|
65
93
|
readonly 'editor.imageUploadError': "Rasmni yuklab bo‘lmadi";
|
|
94
|
+
readonly 'editor.importWord': "Word faylini ochish (.docx)";
|
|
66
95
|
readonly 'editor.increaseFontSize': "Shriftni kattalashtirish";
|
|
67
96
|
readonly 'editor.indent': "Chekinishni oshirish";
|
|
68
97
|
readonly 'editor.inlineCode': "Kod";
|
|
69
98
|
readonly 'editor.insert': "Qo‘shish";
|
|
70
99
|
readonly 'editor.insertDate': "Bugungi sana";
|
|
100
|
+
readonly 'editor.insertDateLong': "Bugungi sana (to‘liq)";
|
|
71
101
|
readonly 'editor.insertMore': "Boshqa elementlar";
|
|
72
102
|
readonly 'editor.italic': "Kursiv";
|
|
73
103
|
readonly 'editor.lineHeight': "Qator oralig‘i";
|
|
@@ -77,6 +107,11 @@ export declare const uz: {
|
|
|
77
107
|
readonly 'editor.linkUrl': "Manzil (URL)";
|
|
78
108
|
readonly 'editor.more': "Yana";
|
|
79
109
|
readonly 'editor.moreFormatting': "Boshqa formatlar";
|
|
110
|
+
readonly 'editor.numbering': "Raqamlash turi";
|
|
111
|
+
readonly 'editor.numbering.default': "Oddiy raqamlash (1, 2, 3)";
|
|
112
|
+
readonly 'editor.numbering.legal': "Ko‘p darajali raqamlash (1.1, 1.2)";
|
|
113
|
+
readonly 'editor.outline': "Navigatsiya paneli";
|
|
114
|
+
readonly 'editor.outline.empty': "Hujjatda sarlavhalar yo‘q. Sarlavha uslubini qo‘llang, ular shu yerda ko‘rinadi.";
|
|
80
115
|
readonly 'editor.openLink': "Havolani ochish";
|
|
81
116
|
readonly 'editor.or': "yoki havola orqali";
|
|
82
117
|
readonly 'editor.orderedList': "Raqamli ro‘yxat";
|
|
@@ -125,6 +160,21 @@ export declare const uz: {
|
|
|
125
160
|
readonly 'editor.search.title': "Qidirish va almashtirish";
|
|
126
161
|
readonly 'editor.search.wholeWord': "Butun so‘z";
|
|
127
162
|
readonly 'editor.selectAll': "Barchasini tanlash";
|
|
163
|
+
readonly 'editor.signature': "Imzo bloki";
|
|
164
|
+
readonly 'editor.signature.agreed': "KELISHILDI grifi";
|
|
165
|
+
readonly 'editor.signature.approval': "TASDIQLAYMAN grifi";
|
|
166
|
+
readonly 'editor.signature.parties': "Tomonlarning imzolari";
|
|
167
|
+
readonly 'editor.signature.signer': "Imzo qatori";
|
|
168
|
+
readonly 'editor.signature.text.agreed': "KELISHILDI";
|
|
169
|
+
readonly 'editor.signature.text.approved': "TASDIQLAYMAN";
|
|
170
|
+
readonly 'editor.signature.text.contractor': "IJROCHI:";
|
|
171
|
+
readonly 'editor.signature.text.customer': "BUYURTMACHI:";
|
|
172
|
+
readonly 'editor.signature.text.date': "«___» ____________ 20__ y.";
|
|
173
|
+
readonly 'editor.signature.text.name': "F.I.Sh.";
|
|
174
|
+
readonly 'editor.signature.text.organization': "Tashkilot nomi";
|
|
175
|
+
readonly 'editor.signature.text.position': "Lavozim";
|
|
176
|
+
readonly 'editor.signature.text.seal': "M.O‘.";
|
|
177
|
+
readonly 'editor.slash.title': "Buyruqlar";
|
|
128
178
|
readonly 'editor.source': "HTML kod";
|
|
129
179
|
readonly 'editor.spacing.addAfter': "Keyin bo‘sh joy qo‘shish";
|
|
130
180
|
readonly 'editor.spacing.addBefore': "Oldin bo‘sh joy qo‘shish";
|
|
@@ -151,15 +201,28 @@ export declare const uz: {
|
|
|
151
201
|
readonly 'editor.table.splitCell': "Katakni ajratish";
|
|
152
202
|
readonly 'editor.table.title': "Jadval";
|
|
153
203
|
readonly 'editor.taskList': "Vazifalar ro‘yxati";
|
|
204
|
+
readonly 'editor.templates': "Hujjat shablonlari";
|
|
205
|
+
readonly 'editor.templates.act': "Dalolatnoma";
|
|
206
|
+
readonly 'editor.templates.application': "Ariza";
|
|
207
|
+
readonly 'editor.templates.certificate': "Ma’lumotnoma";
|
|
208
|
+
readonly 'editor.templates.letter': "Xizmat xati";
|
|
209
|
+
readonly 'editor.templates.order': "Buyruq";
|
|
154
210
|
readonly 'editor.textColor': "Matn rangi";
|
|
155
211
|
readonly 'editor.textDirection': "Matn yo‘nalishi";
|
|
156
212
|
readonly 'editor.textStyle': "Matn uslubi";
|
|
213
|
+
readonly 'editor.toc': "Mundarija";
|
|
214
|
+
readonly 'editor.toc.empty': "Hujjatda sarlavhalar yo‘q";
|
|
215
|
+
readonly 'editor.toc.update': "Mundarijani yangilash";
|
|
157
216
|
readonly 'editor.toolbar': "Muharrir asboblari";
|
|
217
|
+
readonly 'editor.track': "O‘zgarishlarni kuzatish";
|
|
218
|
+
readonly 'editor.transliterate.toCyrillic': "Kirill yozuviga o‘girish";
|
|
219
|
+
readonly 'editor.transliterate.toLatin': "Lotin yozuviga o‘girish";
|
|
158
220
|
readonly 'editor.underline': "Tagiga chizilgan";
|
|
159
221
|
readonly 'editor.undo': "Bekor qilish";
|
|
160
222
|
readonly 'editor.unlink': "Havolani olib tashlash";
|
|
161
223
|
readonly 'editor.uploadImage': "Kompyuterdan yuklash";
|
|
162
224
|
readonly 'editor.uploading': "Rasm yuklanmoqda…";
|
|
225
|
+
readonly 'editor.variables': "O‘zgaruvchi qo‘shish";
|
|
163
226
|
readonly 'editor.view.page': "Sahifa ko‘rinishi";
|
|
164
227
|
readonly 'editor.view.web': "Veb ko‘rinish";
|
|
165
228
|
readonly 'editor.zoom': "Masshtab";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Languages numbers can be written out in. */
|
|
2
|
+
export type NumberWordsLocale = 'uz' | 'uz-Cyrl' | 'ru' | 'en';
|
|
3
|
+
/**
|
|
4
|
+
* Writes a whole number out in words, for example `15 000 000` as `o‘n besh million`. Fractions are dropped; negative
|
|
5
|
+
* numbers get a minus word.
|
|
6
|
+
*
|
|
7
|
+
* @throws RangeError for values that are not finite or reach a quadrillion.
|
|
8
|
+
*/
|
|
9
|
+
export declare const numberToWords: (value: number, locale?: NumberWordsLocale) => string;
|
|
10
|
+
/**
|
|
11
|
+
* An amount with its digits grouped and the whole part in words, as written in contracts and payment documents:
|
|
12
|
+
* `15 000 000 (o‘n besh million)`. Hundredths stay in digits: `1 250,50 (bir ming ikki yuz ellik)`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const formatAmountInWords: (value: number, locale?: NumberWordsLocale) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Reads a typed amount such as `15 000 000`, `15000000`, `1 250,50` or `1,250.50`; `null` when the text is not an
|
|
17
|
+
* amount. A separator followed by exactly three digits groups thousands; one or two digits at the end are decimals.
|
|
18
|
+
*/
|
|
19
|
+
export declare const parseAmount: (text: string) => number | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The outline of a document: its headings, the navigation panel built from them, and the table of contents. The table
|
|
3
|
+
* of contents is a borderless `<table data-type="toc">` of ordinary content, so it prints and exports to Word like any
|
|
4
|
+
* other table and can be refreshed after the headings or the page breaks change.
|
|
5
|
+
*/
|
|
6
|
+
/** A heading of the document. */
|
|
7
|
+
export interface OutlineHeading {
|
|
8
|
+
/** Heading level, 1 to 6. */
|
|
9
|
+
level: number;
|
|
10
|
+
/** Heading text with collapsed whitespace. */
|
|
11
|
+
text: string;
|
|
12
|
+
/** The heading element in the editable document. */
|
|
13
|
+
element: HTMLElement;
|
|
14
|
+
}
|
|
15
|
+
/** A line of the table of contents. */
|
|
16
|
+
export interface TableOfContentsEntry {
|
|
17
|
+
/** Heading level, 1 to 6; deeper levels are indented. */
|
|
18
|
+
level: number;
|
|
19
|
+
/** Heading text. */
|
|
20
|
+
text: string;
|
|
21
|
+
/** Page the heading starts on, or `null` when the document is not laid out in pages. */
|
|
22
|
+
page: number | null;
|
|
23
|
+
}
|
|
24
|
+
/** Options of {@link buildTableOfContents}. */
|
|
25
|
+
export interface TableOfContentsOptions {
|
|
26
|
+
/** Title written above the entries. */
|
|
27
|
+
title: string;
|
|
28
|
+
/** Text shown instead of the entries when the document has no headings. */
|
|
29
|
+
emptyText: string;
|
|
30
|
+
/** Width of the text column in pixels; the table spans it plus the page number column. */
|
|
31
|
+
width?: number;
|
|
32
|
+
}
|
|
33
|
+
/** Marks the table of contents among the tables of a document. */
|
|
34
|
+
export declare const TABLE_OF_CONTENTS_TYPE = "toc";
|
|
35
|
+
/** Selector of the table of contents. */
|
|
36
|
+
export declare const TABLE_OF_CONTENTS_SELECTOR = "table[data-type=\"toc\"]";
|
|
37
|
+
/** Deepest heading level the table of contents lists by default. */
|
|
38
|
+
export declare const TABLE_OF_CONTENTS_DEPTH = 3;
|
|
39
|
+
/** Headings written directly in the document, not inside tables, lists or quotes, in document order. */
|
|
40
|
+
export declare const readOutline: (root: HTMLElement, depth?: number) => OutlineHeading[];
|
|
41
|
+
/** HTML of a table of contents: the title, then one row per heading with its page number on the right. */
|
|
42
|
+
export declare const buildTableOfContents: (entries: TableOfContentsEntry[], options: TableOfContentsOptions) => string;
|
package/dist/core/page.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export interface PageSettings {
|
|
|
47
47
|
footer?: PageHeaderFooter;
|
|
48
48
|
/** Watermark drawn behind the text of every page; omitted while the document has none. */
|
|
49
49
|
watermark?: PageWatermark;
|
|
50
|
+
/** Whether the first page shows no header, footer or page number, as on title pages and letterheads. */
|
|
51
|
+
differentFirstPage?: boolean;
|
|
52
|
+
/** Number printed on the first page; the following pages count on from it. Defaults to 1. */
|
|
53
|
+
firstPageNumber?: number;
|
|
50
54
|
}
|
|
51
55
|
/** Page geometry in CSS pixels, ready for layout. */
|
|
52
56
|
export interface PageMetrics {
|
|
@@ -130,15 +134,21 @@ export declare const createPageSettings: () => PageSettings;
|
|
|
130
134
|
export declare const createHeaderFooter: () => PageHeaderFooter;
|
|
131
135
|
/** Whether a header or footer holds any text at all. */
|
|
132
136
|
export declare const hasHeaderFooterText: (value: PageHeaderFooter | undefined) => boolean;
|
|
137
|
+
/** Largest first page number the page setup accepts. */
|
|
138
|
+
export declare const MAX_FIRST_PAGE_NUMBER = 9999;
|
|
139
|
+
/** Number printed on a sheet, counted from 1 for the first sheet. */
|
|
140
|
+
export declare const pageNumberOf: (page: PageSettings, sheet: number) => number;
|
|
141
|
+
/** Whether the header, footer and page number are drawn on a sheet, counted from 1 for the first sheet. */
|
|
142
|
+
export declare const showsRunningTexts: (page: PageSettings, sheet: number) => boolean;
|
|
133
143
|
/** Tokens a header or footer text may contain, replaced when the text is drawn on a page. */
|
|
134
144
|
export declare const HEADER_FOOTER_TOKENS: readonly ["page", "pages", "date", "title"];
|
|
135
145
|
/** One of the tokens a header or footer text may contain. */
|
|
136
146
|
export type HeaderFooterToken = (typeof HEADER_FOOTER_TOKENS)[number];
|
|
137
147
|
/** Values the tokens of a header or footer are replaced with. */
|
|
138
148
|
export interface HeaderFooterContext {
|
|
139
|
-
/** Number
|
|
149
|
+
/** Number printed on the page the text is drawn on. */
|
|
140
150
|
page: number;
|
|
141
|
-
/** Number of pages in the document. */
|
|
151
|
+
/** Number of pages in the document, as Word counts them: every sheet, whatever number it prints. */
|
|
142
152
|
pages: number;
|
|
143
153
|
/** Document title. */
|
|
144
154
|
title: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SheetFootnote } from './footnotes';
|
|
1
2
|
import type { PageMetrics } from './page';
|
|
2
3
|
/** Handle returned by {@link createPagination}. */
|
|
3
4
|
export interface PaginationController {
|
|
@@ -12,13 +13,15 @@ export interface PaginationController {
|
|
|
12
13
|
interface PaginationOptions {
|
|
13
14
|
/** Receives the number of sheets whenever it changes. */
|
|
14
15
|
onPageCount: (count: number) => void;
|
|
16
|
+
/** Receives the footnotes of every sheet whenever they change; the web view is one sheet holding all of them. */
|
|
17
|
+
onFootnotes?: (sheets: SheetFootnote[][]) => void;
|
|
15
18
|
/** Whether an IME composition is in progress, during which blocks must not move. */
|
|
16
19
|
isComposing: () => boolean;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* Splits the laid-out document into the clean HTML of every sheet, for printing and export. Pagination has already
|
|
20
23
|
* moved every block onto its page, so a block belongs to the page its top falls on; blocks taller than a page stay
|
|
21
|
-
* whole, exactly as they are shown on screen.
|
|
24
|
+
* whole, exactly as they are shown on screen. Footnote references keep their document-wide numbers.
|
|
22
25
|
*/
|
|
23
26
|
export declare const splitIntoPages: (root: HTMLElement, metrics: PageMetrics, pageCount: number) => string[];
|
|
24
27
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EditorLabelKey } from './labels';
|
|
2
|
+
/** Signature blocks offered by the toolbar. */
|
|
3
|
+
export type SignaturePreset = 'signer' | 'approval' | 'agreed' | 'parties';
|
|
4
|
+
/** Every preset, in the order the menu lists them. */
|
|
5
|
+
export declare const SIGNATURE_PRESETS: ReadonlyArray<{
|
|
6
|
+
value: SignaturePreset;
|
|
7
|
+
label: EditorLabelKey;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* HTML of a signature block in the editor's language. Every text in it is ordinary editable content: the user replaces
|
|
11
|
+
* the position and name, or puts template variables there.
|
|
12
|
+
*
|
|
13
|
+
* @param t Translates the placeholder texts into the editor's language.
|
|
14
|
+
*/
|
|
15
|
+
export declare const buildSignatureBlock: (preset: SignaturePreset, t: (key: EditorLabelKey) => string) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DocumentEngine } from './engine/engine';
|
|
2
|
+
import type { IconName } from './icons';
|
|
3
|
+
/** An entry of the `/` command menu, opened by typing `/` at the start of a line or after a space. */
|
|
4
|
+
export interface SlashCommand {
|
|
5
|
+
/** Unique id; also matched by the typed filter. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Name shown in the menu. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Icon from the editor's icon set. */
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
/** More words the typed filter finds the command by, for example in other languages. */
|
|
12
|
+
keywords?: readonly string[];
|
|
13
|
+
/** Runs the command; the typed `/filter` has already been removed and the caret is where it was. */
|
|
14
|
+
run: (engine: DocumentEngine) => void;
|
|
15
|
+
}
|
|
16
|
+
/** The filter typed after `/` before the caret, or `null` when the text does not end with a trigger. */
|
|
17
|
+
export declare const readSlashQuery: (textBeforeCaret: string | null) => string | null;
|
|
18
|
+
/** Commands whose id, label or keywords contain the filter, those starting with it first. */
|
|
19
|
+
export declare const filterSlashCommands: (commands: readonly SlashCommand[], query: string) => SlashCommand[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template variables outside the editor. A saved document writes every variable as
|
|
3
|
+
* `<span data-variable="name">{{name}}</span>`, so a template can be filled in the browser, on a Node server or by a
|
|
4
|
+
* plain string replacement in any backend.
|
|
5
|
+
*/
|
|
6
|
+
/** A variable the user can insert into a template. */
|
|
7
|
+
export interface TemplateVariable {
|
|
8
|
+
/** Name used in the saved HTML and in `{{name}}`: letters, digits, `_`, `.` and `-`. */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Text the chip shows in the editor and the variable menu lists, for example `Full name`. */
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
/** Values for the variables of a template, by name. */
|
|
14
|
+
export type TemplateValues = Readonly<Record<string, string | number | null | undefined>>;
|
|
15
|
+
/** How {@link fillTemplate} treats a variable without a value. */
|
|
16
|
+
export interface FillTemplateOptions {
|
|
17
|
+
/**
|
|
18
|
+
* `keep` (the default) leaves the variable in place, so the result is still a template; `empty` removes it; `name`
|
|
19
|
+
* writes `{{name}}` as plain text.
|
|
20
|
+
*/
|
|
21
|
+
missing?: 'keep' | 'empty' | 'name';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replaces the variables of a document saved by the editor with values. Values are escaped, so user input cannot
|
|
25
|
+
* inject markup; the formatting around a variable (bold, font, colour) applies to its value.
|
|
26
|
+
*
|
|
27
|
+
* @param html Document HTML as saved by the editor.
|
|
28
|
+
* @param values Values by variable name.
|
|
29
|
+
*/
|
|
30
|
+
export declare const fillTemplate: (html: string, values: TemplateValues, options?: FillTemplateOptions) => string;
|
|
31
|
+
/** Names of the variables a saved document uses, each once, in document order. */
|
|
32
|
+
export declare const getTemplateVariables: (html: string) => string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conversion of Uzbek text between the Latin and the Cyrillic alphabet, following the official correspondence of the
|
|
3
|
+
* two alphabets. Placeholders such as `{count}` and `{{name}}` are left untouched.
|
|
4
|
+
*/
|
|
5
|
+
/** Direction of a conversion. */
|
|
6
|
+
export type TransliterationDirection = 'toCyrillic' | 'toLatin';
|
|
7
|
+
/**
|
|
8
|
+
* Converts Uzbek text between the Latin and the Cyrillic alphabet. Letters of the other alphabet, digits, punctuation
|
|
9
|
+
* and placeholders stay as they are.
|
|
10
|
+
*
|
|
11
|
+
* @param previous The character before `text`, when `text` continues earlier text; it decides the spelling of `e`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const transliterate: (text: string, direction: TransliterationDirection, previous?: string) => string;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Uploads an image and resolves with its public URL. Without a handler, images are embedded as data URLs. */
|
|
2
2
|
export type DocumentImageUploadHandler = (file: File) => Promise<string>;
|
|
3
|
-
export type DocumentMenuAction = 'source' | 'print' | 'exportHtml' | 'exportWord' | 'formattingMarks' | 'ruler' | 'fullscreen';
|
|
3
|
+
export type DocumentMenuAction = 'source' | 'print' | 'exportHtml' | 'exportWord' | 'importWord' | 'formattingMarks' | 'ruler' | 'outline' | 'tableOfContents' | 'comments' | 'addComment' | 'footnote' | 'trackChanges' | 'changes' | 'fullscreen';
|
package/dist/core/ui-state.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export interface EditorUiState {
|
|
|
53
53
|
orderedList: boolean;
|
|
54
54
|
/** Whether the selection is in a task list. */
|
|
55
55
|
taskList: boolean;
|
|
56
|
+
/** Whether the numbered list at the selection uses legal (1.1, 1.2) numbering. */
|
|
57
|
+
legalNumbering: boolean;
|
|
56
58
|
/** Whether the selection is inside a quote. */
|
|
57
59
|
blockquote: boolean;
|
|
58
60
|
/** Whether the selection is inside a code block. */
|
|
@@ -63,6 +65,12 @@ export interface EditorUiState {
|
|
|
63
65
|
canRedo: boolean;
|
|
64
66
|
/** Whether the format painter carries a copied format and waits for the text to paint. */
|
|
65
67
|
formatPainter: boolean;
|
|
68
|
+
/** Whether the document has a table of contents, which the insert menu then offers to update. */
|
|
69
|
+
tableOfContents: boolean;
|
|
70
|
+
/** Whether text is selected, which comments can be added to. */
|
|
71
|
+
textSelected: boolean;
|
|
72
|
+
/** Id of the innermost comment at the selection, or an empty string. */
|
|
73
|
+
comment: string;
|
|
66
74
|
}
|
|
67
75
|
/** Everything {@link readUiState} needs to know about the editor. */
|
|
68
76
|
interface UiStateSource {
|
package/dist/editor.vue.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EditorLocaleInput } from './core/labels';
|
|
2
|
+
import type { TemplateVariable } from './core/templates';
|
|
2
3
|
import type { DocumentImageUploadHandler } from './core/types';
|
|
3
4
|
interface Props {
|
|
4
5
|
/** Places the caret at the end of the content once the editor is ready. */
|
|
@@ -21,6 +22,8 @@ interface Props {
|
|
|
21
22
|
placeholder?: string;
|
|
22
23
|
/** Uploads an image and resolves with its URL; without it images are embedded as data URLs. */
|
|
23
24
|
uploadImage?: DocumentImageUploadHandler;
|
|
25
|
+
/** Template variables the user can insert; typing `{{name}}` of one of them inserts it as well. */
|
|
26
|
+
variables?: readonly TemplateVariable[];
|
|
24
27
|
}
|
|
25
28
|
type __VLS_Props = Props;
|
|
26
29
|
type __VLS_ModelProps = {
|
|
@@ -39,14 +42,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
39
42
|
onUploadError?: ((error: unknown) => any) | undefined;
|
|
40
43
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
41
44
|
}>, {
|
|
45
|
+
locale: EditorLocaleInput;
|
|
42
46
|
placeholder: string;
|
|
43
47
|
disabled: boolean;
|
|
44
48
|
minHeight: number | string;
|
|
45
|
-
maxLength: number;
|
|
46
49
|
maxHeight: number | string;
|
|
50
|
+
maxLength: number;
|
|
51
|
+
variables: readonly TemplateVariable[];
|
|
47
52
|
autofocus: boolean;
|
|
48
53
|
canvasPadding: number | string;
|
|
49
|
-
locale: EditorLocaleInput;
|
|
50
54
|
maxImageSizeMb: number;
|
|
51
55
|
uploadImage: DocumentImageUploadHandler;
|
|
52
56
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { f as e, h as t, i as n, l as r, m as i, p as a, u as o } from "./page-DY5fdgcT.js";
|
|
2
|
+
import { t as s } from "./footnotes-DBShImw7.js";
|
|
3
|
+
//#region src/styles/document-content.css?inline
|
|
4
|
+
var c = ".doc-content{color:#1f2328;white-space:pre-wrap;overflow-wrap:break-word;tab-size:4;font-family:Times New Roman,Times,serif;font-size:12pt;line-height:1.5}.doc-content :is(p,h1,h2,h3,h4,h5,h6):not([dir]){unicode-bidi:plaintext}.doc-content p{margin:0 0 6pt}.doc-content h1,.doc-content h2,.doc-content h3,.doc-content h4,.doc-content h5,.doc-content h6{margin:0 0 6pt;padding-top:6pt;font-weight:700;line-height:1.25}.doc-content h1{font-size:20pt}.doc-content h2{font-size:16pt}.doc-content h3{font-size:14pt}.doc-content h4{font-size:12pt}.doc-content h5{font-size:11pt}.doc-content h6{font-size:10pt}.doc-content ul,.doc-content ol{margin:0 0 6pt;padding-left:24pt}.doc-content li>p{margin-bottom:2pt}.doc-content ol[data-numbering=legal],.doc-content ol[data-numbering=legal] ol{counter-reset:doc-legal;padding-left:0;list-style:none}.doc-content ol[data-numbering=legal]>li,.doc-content ol[data-numbering=legal] ol>li{counter-increment:doc-legal;grid-template-columns:auto minmax(0,1fr);column-gap:6pt;display:grid}.doc-content ol[data-numbering=legal]>li:before,.doc-content ol[data-numbering=legal] ol>li:before{content:counters(doc-legal, \".\") \".\";grid-area:1/1}.doc-content ol[data-numbering=legal] li>*{grid-column:2}.doc-content ol[data-numbering=legal] ol{margin:2pt 0 0}.doc-content ul[data-type=taskList]{padding-left:2pt;list-style:none}.doc-content ul[data-type=taskList] li{align-items:flex-start;gap:6pt;display:flex}.doc-content ul[data-type=taskList] li>label{-webkit-user-select:none;user-select:none;flex:none;margin-top:.3em}.doc-content ul[data-type=taskList] li>div{flex:auto;min-width:0}.doc-content ul[data-type=taskList] li[data-checked=true]>div{color:#667085;text-decoration:line-through}.doc-content blockquote{color:#475467;border-left:3px solid #b3c5f5;margin:0 0 6pt;padding:2pt 0 2pt 12pt}.doc-content blockquote>p:last-child,.doc-content li>p:last-child,.doc-content td>p:last-child,.doc-content th>p:last-child{margin-bottom:0}.doc-content pre{white-space:pre-wrap;background:#f4f6f8;border-radius:4px;margin:0 0 6pt;padding:8pt 10pt;font-family:Consolas,Courier New,monospace;font-size:10pt;line-height:1.45}.doc-content code{background:#eef1f4;border-radius:3px;padding:1px 4px;font-family:Consolas,Courier New,monospace;font-size:.9em}.doc-content pre code{font-size:inherit;background:0 0;padding:0}.doc-content hr{border:0;border-bottom:1px solid #c4cad4;height:0;margin:0 0 6pt;padding-top:6pt}.doc-content a{color:#1d4ed8;text-decoration:underline}.doc-content mark{color:inherit;border-radius:2px;padding:0 1px}.doc-content img{max-width:100%;height:auto}.doc-content img[data-align=left]{margin:0 auto 6pt 0;display:block}.doc-content img[data-align=center]{margin:0 auto 6pt;display:block}.doc-content img[data-align=right]{margin:0 0 6pt auto;display:block}.doc-content table{border-collapse:collapse;table-layout:fixed;width:100%;margin:0 0 6pt}.doc-content td,.doc-content th{box-sizing:border-box;vertical-align:top;border:1px solid #8f99a8;min-width:1em;padding:3pt 5pt}.doc-content th{text-align:left;background:#f2f4f7;font-weight:700}.doc-content table[data-type=signature] td,.doc-content table[data-type=signature] th,.doc-content table[data-type=toc] td,.doc-content table[data-type=toc] th{background:0 0;border:0;padding:0 5pt}.doc-content table[data-type=toc] tr:first-child td{padding-bottom:6pt}.doc-content ins[data-change]{color:#15803d;text-decoration:underline}.doc-content del[data-change]{color:#b91c1c;text-decoration:line-through}.doc-content{counter-reset:doc-footnote}.doc-content sup[data-footnote]{counter-increment:doc-footnote}.doc-content sup[data-footnote]:empty:after{content:counter(doc-footnote)}.doc-footnotes{box-sizing:border-box;color:#1f2328;padding-top:4pt;font:10pt/1.3 Times New Roman,Times,serif}.doc-footnotes:before{content:\"\";border-top:1px solid #667085;width:33%;margin-bottom:3pt;display:block}.doc-footnotes p{text-align:justify;margin:0 0 2pt}.doc-content .doc-page-break{break-after:page;page-break-after:always;height:0}", l = {
|
|
5
|
+
"&": "&",
|
|
6
|
+
"<": "<",
|
|
7
|
+
">": ">",
|
|
8
|
+
"\"": """,
|
|
9
|
+
"'": "'"
|
|
10
|
+
}, u = /[\\/:*?"<>|]+/g, d = "document", f = 6e4, p = 4, m = 96 / 25.4, h = .16, g = [
|
|
11
|
+
"left",
|
|
12
|
+
"center",
|
|
13
|
+
"right"
|
|
14
|
+
], _ = {
|
|
15
|
+
position: "fixed",
|
|
16
|
+
left: "-10000px",
|
|
17
|
+
top: "0",
|
|
18
|
+
width: "1px",
|
|
19
|
+
height: "1px",
|
|
20
|
+
border: "0"
|
|
21
|
+
}, v = (e) => e.replace(/[&<>"']/g, (e) => l[e] ?? e), y = ({ size: e, orientation: t }) => {
|
|
22
|
+
let r = n[e] ?? n.a4, i = t === "portrait";
|
|
23
|
+
return {
|
|
24
|
+
width: i ? r.width : r.height,
|
|
25
|
+
height: i ? r.height : r.width
|
|
26
|
+
};
|
|
27
|
+
}, b = (e) => {
|
|
28
|
+
let { width: t, height: n } = y(e), { margins: r } = e;
|
|
29
|
+
return `size: ${t}mm ${n}mm; margin: ${r.top}mm ${r.right}mm ${r.bottom}mm ${r.left}mm;`;
|
|
30
|
+
}, x = (e) => Math.max(p, e / 2 - 2), S = "\n.doc-running { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; color: #475467; font: 10pt/1.4 'Times New Roman', Times, serif; }\n.doc-running span { min-width: 0; overflow: hidden; white-space: pre-wrap; }\n.doc-running span:nth-child(2) { text-align: center; }\n.doc-running span:nth-child(3) { text-align: right; }", C = (e, t, n) => !e || !r(e) ? "" : `<div class="doc-running doc-running--${t}">${g.map((t) => `<span>${v(a(e[t], n))}</span>`).join("")}</div>`, w = (e) => o(e) && e ? `<div class="doc-watermark">${v(e.text.trim())}</div>` : "", T = (e, n) => {
|
|
31
|
+
let { watermark: r } = e;
|
|
32
|
+
if (!o(r) || !r) return "";
|
|
33
|
+
let { width: i, height: a } = y(e), s = t(i * m, a * m, r.text, r.diagonal), c = r.diagonal ? " transform: rotate(-35deg);" : "";
|
|
34
|
+
return `
|
|
35
|
+
.doc-watermark { position: ${n ? "fixed" : "absolute"}; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: ${r.color}; font: 700 ${s}px/1 'Times New Roman', Times, serif; letter-spacing: 0.06em; opacity: ${h}; text-transform: uppercase; white-space: nowrap; pointer-events: none;${c} }`;
|
|
36
|
+
}, E = (t, n, r, a = []) => t.map((o, c) => {
|
|
37
|
+
let l = {
|
|
38
|
+
page: e(n, c + 1),
|
|
39
|
+
pages: t.length,
|
|
40
|
+
title: r
|
|
41
|
+
}, u = i(n, c + 1), d = u ? C(n.header, "header", l) : "", f = u ? C(n.footer, "footer", l) : "";
|
|
42
|
+
return `<section class="doc-sheet">${w(n.watermark)}${d}<article class="doc-content">${o}</article>${a[c]?.length ? `<div class="doc-sheet__notes">${s(a[c] ?? [])}</div>` : ""}${f}</section>`;
|
|
43
|
+
}).join(""), D = (e) => {
|
|
44
|
+
let { width: t, height: n } = y(e), { margins: r } = e;
|
|
45
|
+
return `@page { size: ${t}mm ${n}mm; margin: 0; }
|
|
46
|
+
.doc-sheet { position: relative; box-sizing: border-box; width: ${t}mm; min-height: ${n}mm; padding: ${r.top}mm ${r.right}mm ${r.bottom}mm ${r.left}mm; overflow: hidden; background: #fff; break-after: page; }
|
|
47
|
+
.doc-sheet:last-child { break-after: auto; }
|
|
48
|
+
.doc-running { position: absolute; right: ${r.right}mm; left: ${r.left}mm; }
|
|
49
|
+
.doc-sheet__notes { position: absolute; right: ${r.right}mm; bottom: ${r.bottom}mm; left: ${r.left}mm; }
|
|
50
|
+
.doc-running--header { top: ${x(r.top)}mm; }
|
|
51
|
+
.doc-running--footer { bottom: ${x(r.bottom)}mm; }${S}${T(e, !1)}`;
|
|
52
|
+
}, O = (e) => {
|
|
53
|
+
let { margins: t } = e;
|
|
54
|
+
return `@page { ${b(e)} }
|
|
55
|
+
.doc-running { position: fixed; right: 0; left: 0; }
|
|
56
|
+
.doc-running--header { top: -${x(t.top)}mm; }
|
|
57
|
+
.doc-running--footer { bottom: -${x(t.bottom)}mm; }${S}${T(e, !0)}`;
|
|
58
|
+
}, k = (e) => e.replace(u, " ").trim() || d, A = ({ html: e, pages: t, footnotes: n, title: r, page: i }) => {
|
|
59
|
+
let a = t !== void 0 && t.length > 0, o = {
|
|
60
|
+
page: 1,
|
|
61
|
+
pages: 1,
|
|
62
|
+
title: r
|
|
63
|
+
}, l = `${w(i.watermark)}${C(i.header, "header", o)}${C(i.footer, "footer", o)}<article class="doc-content">${e}</article>${s(n?.flat() ?? [])}`;
|
|
64
|
+
return `<!doctype html>
|
|
65
|
+
<html lang="uz">
|
|
66
|
+
<head>
|
|
67
|
+
<meta charset="utf-8">
|
|
68
|
+
<title>${v(r)}</title>
|
|
69
|
+
<style>${a ? D(i) : O(i)} html, body { margin: 0; background: #fff; } ${c}</style>
|
|
70
|
+
</head>
|
|
71
|
+
<body>${a && t ? E(t, i, r, n) : l}</body>
|
|
72
|
+
</html>`;
|
|
73
|
+
}, j = (e, t, n) => {
|
|
74
|
+
let r = URL.createObjectURL(e instanceof Blob ? e : new Blob([e], { type: n })), i = document.createElement("a");
|
|
75
|
+
i.href = r, i.download = t, i.click(), setTimeout(() => URL.revokeObjectURL(r), 0);
|
|
76
|
+
}, M = (e) => {
|
|
77
|
+
let t = document.createElement("iframe");
|
|
78
|
+
t.setAttribute("aria-hidden", "true"), t.tabIndex = -1, Object.assign(t.style, _);
|
|
79
|
+
let n = () => t.remove();
|
|
80
|
+
t.onload = () => {
|
|
81
|
+
let e = t.contentWindow;
|
|
82
|
+
if (!e) return n();
|
|
83
|
+
let r = Array.from(e.document.images).filter((e) => !e.complete).map((e) => new Promise((t) => {
|
|
84
|
+
e.addEventListener("load", t, { once: !0 }), e.addEventListener("error", t, { once: !0 });
|
|
85
|
+
}));
|
|
86
|
+
Promise.allSettled(r).then(() => {
|
|
87
|
+
e.addEventListener("afterprint", () => setTimeout(n, 0), { once: !0 }), e.focus(), e.print(), setTimeout(n, f);
|
|
88
|
+
});
|
|
89
|
+
}, t.srcdoc = e, document.body.appendChild(t);
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { A as buildPrintableHtml, j as downloadFile, M as printHtml, k as toFileName };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=export-DhHI3ZrQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-DhHI3ZrQ.js","names":[],"sources":["../src/styles/document-content.css?inline","../src/core/export.ts"],"sourcesContent":["/*\n * Typography of the document itself. Shared by the editor page, print output and Word/HTML export,\n * so every rule is plain CSS scoped to `.doc-content`. Vertical rhythm uses bottom margins only:\n * no margin collapsing keeps page layout measurements exact.\n */\n\n/* Base text. Typed spaces are content, so they are kept exactly. */\n.doc-content {\n color: #1f2328;\n font-family: \"Times New Roman\", Times, serif;\n font-size: 12pt;\n line-height: 1.5;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n tab-size: 4;\n}\n\n/* Paragraphs without an explicit direction follow their own text (Arabic and Latin in one document). */\n.doc-content :is(p, h1, h2, h3, h4, h5, h6):not([dir]) {\n unicode-bidi: plaintext;\n}\n\n/* Paragraphs and headings. */\n.doc-content p {\n margin: 0 0 6pt;\n}\n\n.doc-content h1,\n.doc-content h2,\n.doc-content h3,\n.doc-content h4,\n.doc-content h5,\n.doc-content h6 {\n margin: 0 0 6pt;\n padding-top: 6pt;\n font-weight: 700;\n line-height: 1.25;\n}\n\n.doc-content h1 {\n font-size: 20pt;\n}\n\n.doc-content h2 {\n font-size: 16pt;\n}\n\n.doc-content h3 {\n font-size: 14pt;\n}\n\n.doc-content h4 {\n font-size: 12pt;\n}\n\n.doc-content h5 {\n font-size: 11pt;\n}\n\n.doc-content h6 {\n font-size: 10pt;\n}\n\n/* Lists, including task lists with a checkbox label and a content column. */\n.doc-content ul,\n.doc-content ol {\n margin: 0 0 6pt;\n padding-left: 24pt;\n}\n\n.doc-content li > p {\n margin-bottom: 2pt;\n}\n\n/* Legal numbering (1., 1.1., 1.1.1.) for regulations and orders: nested ordered lists continue their parent's number. */\n.doc-content ol[data-numbering=\"legal\"],\n.doc-content ol[data-numbering=\"legal\"] ol {\n padding-left: 0;\n list-style: none;\n counter-reset: doc-legal;\n}\n\n/* The number sits in its own column, so wrapped lines and nested lists align with the item text. */\n.doc-content ol[data-numbering=\"legal\"] > li,\n.doc-content ol[data-numbering=\"legal\"] ol > li {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n column-gap: 6pt;\n counter-increment: doc-legal;\n}\n\n.doc-content ol[data-numbering=\"legal\"] > li::before,\n.doc-content ol[data-numbering=\"legal\"] ol > li::before {\n grid-row: 1;\n grid-column: 1;\n content: counters(doc-legal, \".\") \".\";\n}\n\n.doc-content ol[data-numbering=\"legal\"] li > * {\n grid-column: 2;\n}\n\n.doc-content ol[data-numbering=\"legal\"] ol {\n margin: 2pt 0 0;\n}\n\n.doc-content ul[data-type=\"taskList\"] {\n padding-left: 2pt;\n list-style: none;\n}\n\n.doc-content ul[data-type=\"taskList\"] li {\n display: flex;\n align-items: flex-start;\n gap: 6pt;\n}\n\n.doc-content ul[data-type=\"taskList\"] li > label {\n flex: 0 0 auto;\n margin-top: 0.3em;\n user-select: none;\n}\n\n.doc-content ul[data-type=\"taskList\"] li > div {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.doc-content ul[data-type=\"taskList\"] li[data-checked=\"true\"] > div {\n color: #667085;\n text-decoration: line-through;\n}\n\n/* Quotes. */\n.doc-content blockquote {\n margin: 0 0 6pt;\n padding: 2pt 0 2pt 12pt;\n border-left: 3px solid #b3c5f5;\n color: #475467;\n}\n\n/* The last paragraph of a container adds no space below it. */\n.doc-content blockquote > p:last-child,\n.doc-content li > p:last-child,\n.doc-content td > p:last-child,\n.doc-content th > p:last-child {\n margin-bottom: 0;\n}\n\n/* Code blocks and inline code. */\n.doc-content pre {\n margin: 0 0 6pt;\n padding: 8pt 10pt;\n border-radius: 4px;\n background: #f4f6f8;\n font-family: Consolas, \"Courier New\", monospace;\n font-size: 10pt;\n line-height: 1.45;\n white-space: pre-wrap;\n}\n\n.doc-content code {\n padding: 1px 4px;\n border-radius: 3px;\n background: #eef1f4;\n font-family: Consolas, \"Courier New\", monospace;\n font-size: 0.9em;\n}\n\n.doc-content pre code {\n padding: 0;\n background: none;\n font-size: inherit;\n}\n\n/* Horizontal rule. */\n.doc-content hr {\n height: 0;\n margin: 0 0 6pt;\n padding-top: 6pt;\n border: 0;\n border-bottom: 1px solid #c4cad4;\n}\n\n/* Inline marks. */\n.doc-content a {\n color: #1d4ed8;\n text-decoration: underline;\n}\n\n.doc-content mark {\n padding: 0 1px;\n border-radius: 2px;\n color: inherit;\n}\n\n/* Images are blocks aligned through their data-align attribute. */\n.doc-content img {\n max-width: 100%;\n height: auto;\n}\n\n.doc-content img[data-align=\"left\"] {\n display: block;\n margin: 0 auto 6pt 0;\n}\n\n.doc-content img[data-align=\"center\"] {\n display: block;\n margin: 0 auto 6pt;\n}\n\n.doc-content img[data-align=\"right\"] {\n display: block;\n margin: 0 0 6pt auto;\n}\n\n/* Tables. */\n.doc-content table {\n width: 100%;\n margin: 0 0 6pt;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.doc-content td,\n.doc-content th {\n box-sizing: border-box;\n min-width: 1em;\n padding: 3pt 5pt;\n border: 1px solid #8f99a8;\n vertical-align: top;\n}\n\n.doc-content th {\n background: #f2f4f7;\n font-weight: 700;\n text-align: left;\n}\n\n/* Signature blocks and the table of contents are laid out in tables without visible borders. */\n.doc-content table[data-type=\"signature\"] td,\n.doc-content table[data-type=\"signature\"] th,\n.doc-content table[data-type=\"toc\"] td,\n.doc-content table[data-type=\"toc\"] th {\n padding: 0 5pt;\n border: 0;\n background: none;\n}\n\n.doc-content table[data-type=\"toc\"] tr:first-child td {\n padding-bottom: 6pt;\n}\n\n/* Tracked changes are shown, and printed, as reviewers expect them from Word. */\n.doc-content ins[data-change] {\n color: #15803d;\n text-decoration: underline;\n}\n\n.doc-content del[data-change] {\n color: #b91c1c;\n text-decoration: line-through;\n}\n\n/* Footnote references are numbered in document order; saved HTML also carries the number as text. */\n.doc-content {\n counter-reset: doc-footnote;\n}\n\n.doc-content sup[data-footnote] {\n counter-increment: doc-footnote;\n}\n\n.doc-content sup[data-footnote]:empty::after {\n content: counter(doc-footnote);\n}\n\n/* Notes at the bottom of a sheet, under a short rule. */\n.doc-footnotes {\n box-sizing: border-box;\n padding-top: 4pt;\n color: #1f2328;\n font:\n 10pt / 1.3 \"Times New Roman\",\n Times,\n serif;\n}\n\n.doc-footnotes::before {\n display: block;\n width: 33%;\n margin-bottom: 3pt;\n border-top: 1px solid #667085;\n content: \"\";\n}\n\n.doc-footnotes p {\n margin: 0 0 2pt;\n text-align: justify;\n}\n\n/* Manual page break: invisible in print, where it starts a new sheet. */\n.doc-content .doc-page-break {\n height: 0;\n break-after: page;\n page-break-after: always;\n}\n","import contentCss from '../styles/document-content.css?inline';\nimport { type SheetFootnote, footnotesHtml } from './footnotes';\nimport {\n type HeaderFooterContext,\n PAGE_SIZES,\n type PageHeaderFooter,\n type PageSettings,\n type PageWatermark,\n WATERMARK_ANGLE,\n hasHeaderFooterText,\n hasWatermarkText,\n pageNumberOf,\n renderHeaderFooter,\n showsRunningTexts,\n watermarkFontSize\n} from './page';\n\n/** Everything needed to print or export the document. */\ninterface DocumentSnapshot {\n /** Clean document HTML, used when the document is not laid out in sheets. */\n html: string;\n /**\n * Clean HTML of every sheet, in document order. The page view passes it so printing repeats the header and footer\n * with real page numbers and breaks the pages exactly where the editor shows them.\n */\n pages?: string[];\n /** Footnotes of every sheet of `pages`; without pages, the notes of all of them are printed after the document. */\n footnotes?: SheetFootnote[][];\n /** Document title, used for the print title and file names. */\n title: string;\n /** Page size, orientation, margins and the running texts. */\n page: PageSettings;\n}\n\n/** Characters escaped when text is placed into HTML. */\nconst HTML_ESCAPES: Record<string, string> = { '&': '&', '<': '<', '>': '>', '\"': '"', \"'\": ''' };\n/** Characters not allowed in file names on common systems. */\nconst INVALID_FILE_NAME_CHARACTERS = /[\\\\/:*?\"<>|]+/g;\n/** File name used when the title is empty. */\nconst DEFAULT_FILE_NAME = 'document';\n/** Removes the print iframe even when the browser never reports `afterprint`. */\nconst PRINT_CLEANUP_TIMEOUT_MS = 60_000;\n/** Distance a running text keeps from the paper edge when its margin is too small to centre it in, in millimetres. */\nconst MIN_RUNNING_EDGE_MM = 4;\n/** CSS pixels per millimetre at 96 DPI, used to size the watermark for the paper. */\nconst PX_PER_MM = 96 / 25.4;\n/** How faintly the watermark is printed. */\nconst WATERMARK_OPACITY = 0.16;\n/** The three parts of a running text, in the order they are drawn. */\nconst RUNNING_PARTS = ['left', 'center', 'right'] as const;\n/** Styles that keep the print iframe out of view without `display: none`, which would stop it from printing. */\nconst HIDDEN_FRAME_STYLE: Partial<CSSStyleDeclaration> = {\n position: 'fixed',\n left: '-10000px',\n top: '0',\n width: '1px',\n height: '1px',\n border: '0'\n};\n\n/** Escapes text for use inside HTML. */\nconst escapeHtml = (value: string) => value.replace(/[&<>\"']/g, character => HTML_ESCAPES[character] ?? character);\n\n/** Paper width and height in millimetres, in the chosen orientation. */\nconst paperSize = ({ size, orientation }: PageSettings) => {\n const paper = PAGE_SIZES[size] ?? PAGE_SIZES.a4;\n const portrait = orientation === 'portrait';\n return { width: portrait ? paper.width : paper.height, height: portrait ? paper.height : paper.width };\n};\n\n/** CSS declarations for `@page` with the paper size and margins of the page settings. */\nconst pageRule = (page: PageSettings) => {\n const { width, height } = paperSize(page);\n const { margins } = page;\n return `size: ${width}mm ${height}mm; margin: ${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm;`;\n};\n\n/** Distance of a running text from the top or bottom edge of the paper, centred in its margin. */\nconst runningEdge = (margin: number) => Math.max(MIN_RUNNING_EDGE_MM, margin / 2 - 2);\n\n/** Shared look of the header and footer, both in print and in the exported page. */\nconst RUNNING_CSS = `\n.doc-running { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; color: #475467; font: 10pt/1.4 'Times New Roman', Times, serif; }\n.doc-running span { min-width: 0; overflow: hidden; white-space: pre-wrap; }\n.doc-running span:nth-child(2) { text-align: center; }\n.doc-running span:nth-child(3) { text-align: right; }`;\n\n/** One running text rendered for a page, or an empty string when it holds no text. */\nconst runningHtml = (\n value: PageHeaderFooter | undefined,\n place: 'header' | 'footer',\n context: HeaderFooterContext\n): string => {\n if (!value || !hasHeaderFooterText(value)) return '';\n const parts = RUNNING_PARTS.map(part => `<span>${escapeHtml(renderHeaderFooter(value[part], context))}</span>`).join(\n ''\n );\n return `<div class=\"doc-running doc-running--${place}\">${parts}</div>`;\n};\n\n/** The watermark of a page, or an empty string when the document has none. */\nconst watermarkHtml = (watermark: PageWatermark | undefined): string =>\n hasWatermarkText(watermark) && watermark\n ? `<div class=\"doc-watermark\">${escapeHtml(watermark.text.trim())}</div>`\n : '';\n\n/** Look of the watermark; it is positioned per sheet when the pages are known, and fixed when the document flows. */\nconst watermarkCss = (page: PageSettings, fixed: boolean): string => {\n const { watermark } = page;\n if (!hasWatermarkText(watermark) || !watermark) return '';\n const { width, height } = paperSize(page);\n const size = watermarkFontSize(width * PX_PER_MM, height * PX_PER_MM, watermark.text, watermark.diagonal);\n const rotation = watermark.diagonal ? ` transform: rotate(${WATERMARK_ANGLE}deg);` : '';\n return `\n.doc-watermark { position: ${fixed ? 'fixed' : 'absolute'}; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: ${watermark.color}; font: 700 ${size}px/1 'Times New Roman', Times, serif; letter-spacing: 0.06em; opacity: ${WATERMARK_OPACITY}; text-transform: uppercase; white-space: nowrap; pointer-events: none;${rotation} }`;\n};\n\n/** Sheets with their own header and footer, used when the editor knows where the pages break. */\nconst sheetsHtml = (pages: string[], page: PageSettings, title: string, footnotes: SheetFootnote[][] = []): string =>\n pages\n .map((content, index) => {\n const context: HeaderFooterContext = { page: pageNumberOf(page, index + 1), pages: pages.length, title };\n const shown = showsRunningTexts(page, index + 1);\n const header = shown ? runningHtml(page.header, 'header', context) : '';\n const footer = shown ? runningHtml(page.footer, 'footer', context) : '';\n const watermark = watermarkHtml(page.watermark);\n const notes = footnotes[index]?.length\n ? `<div class=\"doc-sheet__notes\">${footnotesHtml(footnotes[index] ?? [])}</div>`\n : '';\n return `<section class=\"doc-sheet\">${watermark}${header}<article class=\"doc-content\">${content}</article>${notes}${footer}</section>`;\n })\n .join('');\n\n/** Page geometry of the sheet layout: the paper is the page box and every sheet carries the margins itself. */\nconst sheetCss = (page: PageSettings) => {\n const { width, height } = paperSize(page);\n const { margins } = page;\n return `@page { size: ${width}mm ${height}mm; margin: 0; }\n.doc-sheet { position: relative; box-sizing: border-box; width: ${width}mm; min-height: ${height}mm; padding: ${margins.top}mm ${margins.right}mm ${margins.bottom}mm ${margins.left}mm; overflow: hidden; background: #fff; break-after: page; }\n.doc-sheet:last-child { break-after: auto; }\n.doc-running { position: absolute; right: ${margins.right}mm; left: ${margins.left}mm; }\n.doc-sheet__notes { position: absolute; right: ${margins.right}mm; bottom: ${margins.bottom}mm; left: ${margins.left}mm; }\n.doc-running--header { top: ${runningEdge(margins.top)}mm; }\n.doc-running--footer { bottom: ${runningEdge(margins.bottom)}mm; }${RUNNING_CSS}${watermarkCss(page, false)}`;\n};\n\n/** Page geometry of the flowing layout, where the browser breaks the pages and repeats the fixed running texts. */\nconst flowCss = (page: PageSettings) => {\n const { margins } = page;\n return `@page { ${pageRule(page)} }\n.doc-running { position: fixed; right: 0; left: 0; }\n.doc-running--header { top: -${runningEdge(margins.top)}mm; }\n.doc-running--footer { bottom: -${runningEdge(margins.bottom)}mm; }${RUNNING_CSS}${watermarkCss(page, true)}`;\n};\n\n/** Turns a document title into a safe file name without extension. */\nexport const toFileName = (title: string): string =>\n title.replace(INVALID_FILE_NAME_CHARACTERS, ' ').trim() || DEFAULT_FILE_NAME;\n\n/**\n * Standalone HTML with the page size, margins and running texts encoded in CSS, used for printing and HTML export.\n * With the sheets of the page view every page carries its own header and footer, so the page numbers are exact and\n * the pages break where the editor shows them; without them the document flows and the browser repeats one fixed\n * header and footer on every page.\n */\nexport const buildPrintableHtml = ({ html, pages, footnotes, title, page }: DocumentSnapshot): string => {\n const paginated = pages !== undefined && pages.length > 0;\n const context: HeaderFooterContext = { page: 1, pages: 1, title };\n const flow = `${watermarkHtml(page.watermark)}${runningHtml(page.header, 'header', context)}${runningHtml(page.footer, 'footer', context)}<article class=\"doc-content\">${html}</article>${footnotesHtml(footnotes?.flat() ?? [])}`;\n return `<!doctype html>\n<html lang=\"uz\">\n<head>\n<meta charset=\"utf-8\">\n<title>${escapeHtml(title)}</title>\n<style>${paginated ? sheetCss(page) : flowCss(page)} html, body { margin: 0; background: #fff; } ${contentCss}</style>\n</head>\n<body>${paginated && pages ? sheetsHtml(pages, page, title, footnotes) : flow}</body>\n</html>`;\n};\n\n/** Offers text or binary content as a file download. */\nexport const downloadFile = (content: string | Blob, fileName: string, type: string): void => {\n const url = URL.createObjectURL(content instanceof Blob ? content : new Blob([content], { type }));\n const link = document.createElement('a');\n link.href = url;\n link.download = fileName;\n link.click();\n setTimeout(() => URL.revokeObjectURL(url), 0);\n};\n\n/** Prints through a detached iframe so the application chrome never ends up on paper. Waits for images first. */\nexport const printHtml = (documentHtml: string): void => {\n const frame = document.createElement('iframe');\n frame.setAttribute('aria-hidden', 'true');\n frame.tabIndex = -1;\n Object.assign(frame.style, HIDDEN_FRAME_STYLE);\n\n /** Removes the iframe once printing is done. */\n const cleanup = () => frame.remove();\n frame.onload = () => {\n const printWindow = frame.contentWindow;\n if (!printWindow) return cleanup();\n const pendingImages = Array.from(printWindow.document.images)\n .filter(image => !image.complete)\n .map(\n image =>\n new Promise(resolve => {\n image.addEventListener('load', resolve, { once: true });\n image.addEventListener('error', resolve, { once: true });\n })\n );\n void Promise.allSettled(pendingImages).then(() => {\n printWindow.addEventListener('afterprint', () => setTimeout(cleanup, 0), { once: true });\n printWindow.focus();\n printWindow.print();\n setTimeout(cleanup, PRINT_CLEANUP_TIMEOUT_MS);\n });\n };\n frame.srcdoc = documentHtml;\n document.body.appendChild(frame);\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/core/footnotes.ts
|
|
2
|
+
var e = {
|
|
3
|
+
"&": "&",
|
|
4
|
+
"<": "<",
|
|
5
|
+
">": ">",
|
|
6
|
+
"\"": """
|
|
7
|
+
}, t = (t) => t.replace(/[&<>"]/g, (t) => e[t] ?? t), n = "doc-footnotes", r = (e) => e.length ? `<div class="${n}">${e.map((e) => `<p><sup>${e.number}</sup> ${t(e.text)}</p>`).join("")}</div>` : "";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { r as t };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=footnotes-DBShImw7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footnotes-DBShImw7.js","names":[],"sources":["../src/core/footnotes.ts"],"sourcesContent":["/**\n * The notes of footnotes as they are drawn at the bottom of a sheet. The editor, the layout measurement and printing\n * all render them with this markup, so the space pagination reserves matches what is drawn.\n */\n\n/** A footnote as it appears at the bottom of a sheet. */\nexport interface SheetFootnote {\n /** Number of the footnote in the document, starting at 1. */\n number: number;\n /** Text of the note. */\n text: string;\n}\n\nconst HTML_ESCAPES: Record<string, string> = { '&': '&', '<': '<', '>': '>', '\"': '"' };\n\nconst escapeHtml = (value: string) => value.replace(/[&<>\"]/g, character => HTML_ESCAPES[character] ?? character);\n\n/** Class of the notes block; its look is defined in `document-content.css`. */\nexport const FOOTNOTES_CLASS = 'doc-footnotes';\n\n/** HTML of the notes block of one sheet, or an empty string when the sheet has no footnotes. */\nexport const footnotesHtml = (notes: readonly SheetFootnote[]): string =>\n notes.length\n ? `<div class=\"${FOOTNOTES_CLASS}\">${notes\n .map(note => `<p><sup>${note.number}</sup> ${escapeHtml(note.text)}</p>`)\n .join('')}</div>`\n : '';\n"],"mappings":";AAaA,IAAM,IAAuC;CAAE,KAAK;CAAS,KAAK;CAAQ,KAAK;CAAQ,MAAK;AAAS,GAE/F,KAAc,MAAkB,EAAM,QAAQ,YAAW,MAAa,EAAa,MAAc,CAAS,GAGnG,IAAkB,iBAGlB,KAAiB,MAC5B,EAAM,SACF,eAAe,EAAgB,IAAI,EAChC,KAAI,MAAQ,WAAW,EAAK,OAAO,SAAS,EAAW,EAAK,IAAI,EAAE,KAAK,CAAC,CACxE,KAAK,EAAE,EAAE,UACZ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type EditorLocaleInput } from './core/labels';
|
|
2
|
+
import { type FillTemplateOptions, type TemplateVariable } from './core/templates';
|
|
3
|
+
import './styles/document-content.css';
|
|
4
|
+
import './styles/editor-ui.css';
|
|
5
|
+
interface Props {
|
|
6
|
+
/** Template HTML as saved by the editor, with its variables. */
|
|
7
|
+
template: string;
|
|
8
|
+
/** Labels shown in empty fields; built-in template variables are labelled without it. */
|
|
9
|
+
variables?: readonly TemplateVariable[];
|
|
10
|
+
/** Interface language: a built-in locale or its code; defaults to the app-wide language. */
|
|
11
|
+
locale?: EditorLocaleInput;
|
|
12
|
+
/** Shows the values without letting them change. */
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
}
|
|
15
|
+
type __VLS_Props = Props;
|
|
16
|
+
type __VLS_ModelProps = {
|
|
17
|
+
/** Values by variable name. */
|
|
18
|
+
modelValue?: Record<string, string>;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
22
|
+
/** The filled document HTML; variables without a value follow `options.missing`. */
|
|
23
|
+
getHTML: (options?: FillTemplateOptions) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Marks the fields left empty and focuses the first of them.
|
|
26
|
+
* @returns names of the variables without a value; an empty list when the form is complete.
|
|
27
|
+
*/
|
|
28
|
+
validate: () => string[];
|
|
29
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: Record<string, string>) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: Record<string, string>) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
locale: EditorLocaleInput;
|
|
35
|
+
readonly: boolean;
|
|
36
|
+
variables: readonly TemplateVariable[];
|
|
37
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
38
|
+
declare const _default: typeof __VLS_export;
|
|
39
|
+
export default _default;
|