@formfeed/engine 0.3.11 → 0.3.13
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/index.cjs +2872 -280
- package/index.js +2872 -280
- package/package.json +3 -2
- package/types/frame/audit.d.cts +15 -0
- package/types/frame/audit.d.ts +15 -0
- package/types/frame/audit.entry.d.cts +1 -0
- package/types/frame/audit.entry.d.ts +1 -0
- package/types/frame/text-edit.d.cts +8 -1
- package/types/frame/text-edit.d.ts +8 -1
- package/types/index.d.cts +8 -1
- package/types/index.d.ts +8 -1
- package/types/lib/accessibility/index.d.cts +201 -0
- package/types/lib/accessibility/index.d.ts +201 -0
- package/types/lib/accessibility/static.d.cts +40 -0
- package/types/lib/accessibility/static.d.ts +40 -0
- package/types/lib/assemble.d.cts +16 -0
- package/types/lib/assemble.d.ts +16 -0
- package/types/lib/einvoice/check.d.cts +181 -0
- package/types/lib/einvoice/check.d.ts +181 -0
- package/types/lib/einvoice/cii.d.cts +18 -0
- package/types/lib/einvoice/cii.d.ts +18 -0
- package/types/lib/einvoice/codes.generated.d.cts +14 -0
- package/types/lib/einvoice/codes.generated.d.ts +14 -0
- package/types/lib/einvoice/decimal.d.cts +29 -0
- package/types/lib/einvoice/decimal.d.ts +29 -0
- package/types/lib/einvoice/display.d.cts +43 -0
- package/types/lib/einvoice/display.d.ts +43 -0
- package/types/lib/einvoice/html-text.d.cts +17 -0
- package/types/lib/einvoice/html-text.d.ts +17 -0
- package/types/lib/einvoice/index.d.cts +45 -0
- package/types/lib/einvoice/index.d.ts +45 -0
- package/types/lib/einvoice/locate.d.cts +21 -0
- package/types/lib/einvoice/locate.d.ts +21 -0
- package/types/lib/einvoice/report.d.cts +59 -0
- package/types/lib/einvoice/report.d.ts +59 -0
- package/types/lib/einvoice/schema.d.cts +293 -0
- package/types/lib/einvoice/schema.d.ts +293 -0
- package/types/lib/einvoice/skeleton.d.cts +10 -0
- package/types/lib/einvoice/skeleton.d.ts +10 -0
- package/types/lib/generated/frames.d.cts +4 -2
- package/types/lib/generated/frames.d.ts +4 -2
- package/types/lib/helpers/document.d.cts +5 -0
- package/types/lib/helpers/document.d.ts +5 -0
- package/types/lib/preview.d.cts +11 -0
- package/types/lib/preview.d.ts +11 -0
- package/types/lib/source-edit.d.cts +5 -0
- package/types/lib/source-edit.d.ts +5 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** VAT categories of UNCL 5305 as EN 16931 uses them (spec 17 §4.3). */
|
|
3
|
+
export declare const VAT_CATEGORIES: readonly ["S", "Z", "E", "AE", "K", "G", "O"];
|
|
4
|
+
export type VatCategory = (typeof VAT_CATEGORIES)[number];
|
|
5
|
+
export declare const invoiceSchema: z.ZodObject<{
|
|
6
|
+
number: z.ZodString;
|
|
7
|
+
issue_date: z.ZodString;
|
|
8
|
+
type_code: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
9
|
+
currency: z.ZodString;
|
|
10
|
+
accounting_currency: z.ZodOptional<z.ZodString>;
|
|
11
|
+
buyer_reference: z.ZodOptional<z.ZodString>;
|
|
12
|
+
order_reference: z.ZodOptional<z.ZodString>;
|
|
13
|
+
contract_reference: z.ZodOptional<z.ZodString>;
|
|
14
|
+
note: z.ZodOptional<z.ZodString>;
|
|
15
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
|
+
text: z.ZodString;
|
|
17
|
+
subject_code: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>>>;
|
|
19
|
+
period: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
start: z.ZodOptional<z.ZodString>;
|
|
21
|
+
end: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
preceding_invoices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
number: z.ZodString;
|
|
25
|
+
issue_date: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>>>;
|
|
27
|
+
operation: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
goods: "goods";
|
|
29
|
+
services: "services";
|
|
30
|
+
mixed: "mixed";
|
|
31
|
+
}>>;
|
|
32
|
+
operation_code: z.ZodOptional<z.ZodString>;
|
|
33
|
+
seller: z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
trading_name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
37
|
+
value: z.ZodString;
|
|
38
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strip>]>>;
|
|
40
|
+
legal_registration: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
41
|
+
value: z.ZodString;
|
|
42
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, z.core.$strip>]>>;
|
|
44
|
+
vat_id: z.ZodOptional<z.ZodString>;
|
|
45
|
+
address: z.ZodObject<{
|
|
46
|
+
street: z.ZodOptional<z.ZodString>;
|
|
47
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
48
|
+
street3: z.ZodOptional<z.ZodString>;
|
|
49
|
+
postcode: z.ZodOptional<z.ZodString>;
|
|
50
|
+
city: z.ZodOptional<z.ZodString>;
|
|
51
|
+
country: z.ZodString;
|
|
52
|
+
subdivision: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
contact: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
name: z.ZodOptional<z.ZodString>;
|
|
56
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
57
|
+
email: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
electronic_address: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
60
|
+
value: z.ZodString;
|
|
61
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>]>>;
|
|
63
|
+
tax_number: z.ZodOptional<z.ZodString>;
|
|
64
|
+
legal_info: z.ZodOptional<z.ZodString>;
|
|
65
|
+
vat_on_debits: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
buyer: z.ZodObject<{
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
trading_name: z.ZodOptional<z.ZodString>;
|
|
70
|
+
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
71
|
+
value: z.ZodString;
|
|
72
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>]>>;
|
|
74
|
+
legal_registration: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
75
|
+
value: z.ZodString;
|
|
76
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, z.core.$strip>]>>;
|
|
78
|
+
vat_id: z.ZodOptional<z.ZodString>;
|
|
79
|
+
address: z.ZodObject<{
|
|
80
|
+
street: z.ZodOptional<z.ZodString>;
|
|
81
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
82
|
+
street3: z.ZodOptional<z.ZodString>;
|
|
83
|
+
postcode: z.ZodOptional<z.ZodString>;
|
|
84
|
+
city: z.ZodOptional<z.ZodString>;
|
|
85
|
+
country: z.ZodString;
|
|
86
|
+
subdivision: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
contact: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
name: z.ZodOptional<z.ZodString>;
|
|
90
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
91
|
+
email: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
electronic_address: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
94
|
+
value: z.ZodString;
|
|
95
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>]>>;
|
|
97
|
+
siren: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
delivery: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
name: z.ZodOptional<z.ZodString>;
|
|
101
|
+
date: z.ZodOptional<z.ZodString>;
|
|
102
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
street: z.ZodOptional<z.ZodString>;
|
|
104
|
+
street2: z.ZodOptional<z.ZodString>;
|
|
105
|
+
street3: z.ZodOptional<z.ZodString>;
|
|
106
|
+
postcode: z.ZodOptional<z.ZodString>;
|
|
107
|
+
city: z.ZodOptional<z.ZodString>;
|
|
108
|
+
country: z.ZodString;
|
|
109
|
+
subdivision: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
113
|
+
id: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
114
|
+
name: z.ZodString;
|
|
115
|
+
description: z.ZodOptional<z.ZodString>;
|
|
116
|
+
quantity: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
117
|
+
unit_code: z.ZodDefault<z.ZodString>;
|
|
118
|
+
net_price: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
119
|
+
price_base_quantity: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
120
|
+
net_amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
121
|
+
tax: z.ZodObject<{
|
|
122
|
+
category: z.ZodEnum<{
|
|
123
|
+
Z: "Z";
|
|
124
|
+
E: "E";
|
|
125
|
+
G: "G";
|
|
126
|
+
S: "S";
|
|
127
|
+
AE: "AE";
|
|
128
|
+
K: "K";
|
|
129
|
+
O: "O";
|
|
130
|
+
}>;
|
|
131
|
+
rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
period: z.ZodOptional<z.ZodObject<{
|
|
134
|
+
start: z.ZodOptional<z.ZodString>;
|
|
135
|
+
end: z.ZodOptional<z.ZodString>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
allowances: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
138
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
139
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
140
|
+
reason_code: z.ZodOptional<z.ZodString>;
|
|
141
|
+
base_amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
142
|
+
percent: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
143
|
+
}, z.core.$strip>>>;
|
|
144
|
+
charges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
146
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
147
|
+
reason_code: z.ZodOptional<z.ZodString>;
|
|
148
|
+
base_amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
149
|
+
percent: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
151
|
+
buyer_accounting_reference: z.ZodOptional<z.ZodString>;
|
|
152
|
+
note: z.ZodOptional<z.ZodString>;
|
|
153
|
+
seller_item_id: z.ZodOptional<z.ZodString>;
|
|
154
|
+
buyer_item_id: z.ZodOptional<z.ZodString>;
|
|
155
|
+
standard_item_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
156
|
+
value: z.ZodString;
|
|
157
|
+
scheme: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strip>]>>;
|
|
159
|
+
order_line_reference: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
allowances: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
162
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
163
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
164
|
+
reason_code: z.ZodOptional<z.ZodString>;
|
|
165
|
+
base_amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
166
|
+
percent: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
167
|
+
tax: z.ZodObject<{
|
|
168
|
+
category: z.ZodEnum<{
|
|
169
|
+
Z: "Z";
|
|
170
|
+
E: "E";
|
|
171
|
+
G: "G";
|
|
172
|
+
S: "S";
|
|
173
|
+
AE: "AE";
|
|
174
|
+
K: "K";
|
|
175
|
+
O: "O";
|
|
176
|
+
}>;
|
|
177
|
+
rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
}, z.core.$strip>>>;
|
|
180
|
+
charges: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
181
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
182
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
183
|
+
reason_code: z.ZodOptional<z.ZodString>;
|
|
184
|
+
base_amount: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
185
|
+
percent: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
186
|
+
tax: z.ZodObject<{
|
|
187
|
+
category: z.ZodEnum<{
|
|
188
|
+
Z: "Z";
|
|
189
|
+
E: "E";
|
|
190
|
+
G: "G";
|
|
191
|
+
S: "S";
|
|
192
|
+
AE: "AE";
|
|
193
|
+
K: "K";
|
|
194
|
+
O: "O";
|
|
195
|
+
}>;
|
|
196
|
+
rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
}, z.core.$strip>>>;
|
|
199
|
+
tax: z.ZodObject<{
|
|
200
|
+
breakdown: z.ZodArray<z.ZodObject<{
|
|
201
|
+
category: z.ZodEnum<{
|
|
202
|
+
Z: "Z";
|
|
203
|
+
E: "E";
|
|
204
|
+
G: "G";
|
|
205
|
+
S: "S";
|
|
206
|
+
AE: "AE";
|
|
207
|
+
K: "K";
|
|
208
|
+
O: "O";
|
|
209
|
+
}>;
|
|
210
|
+
rate: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
211
|
+
basis: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
212
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
213
|
+
exemption_reason: z.ZodOptional<z.ZodString>;
|
|
214
|
+
exemption_reason_code: z.ZodOptional<z.ZodString>;
|
|
215
|
+
}, z.core.$strip>>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
totals: z.ZodObject<{
|
|
218
|
+
line_net: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
219
|
+
allowances: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
220
|
+
charges: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
221
|
+
tax_basis: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
222
|
+
tax_total: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
223
|
+
tax_total_accounting: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
224
|
+
grand: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
225
|
+
prepaid: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
226
|
+
rounding: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
227
|
+
due: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
payment: z.ZodOptional<z.ZodObject<{
|
|
230
|
+
means_code: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
231
|
+
iban: z.ZodOptional<z.ZodString>;
|
|
232
|
+
bic: z.ZodOptional<z.ZodString>;
|
|
233
|
+
account_name: z.ZodOptional<z.ZodString>;
|
|
234
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
235
|
+
terms: z.ZodOptional<z.ZodString>;
|
|
236
|
+
due_date: z.ZodOptional<z.ZodString>;
|
|
237
|
+
mandate_id: z.ZodOptional<z.ZodString>;
|
|
238
|
+
creditor_id: z.ZodOptional<z.ZodString>;
|
|
239
|
+
debited_iban: z.ZodOptional<z.ZodString>;
|
|
240
|
+
}, z.core.$strip>>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
/** The block as a caller writes it. */
|
|
243
|
+
export type InvoiceInput = z.input<typeof invoiceSchema>;
|
|
244
|
+
/** The block once parsed: defaults filled in, numbers still as they came. */
|
|
245
|
+
export type ParsedInvoice = z.output<typeof invoiceSchema>;
|
|
246
|
+
export type ParsedParty = ParsedInvoice['seller'] | ParsedInvoice['buyer'];
|
|
247
|
+
export type ParsedLine = ParsedInvoice['lines'][number];
|
|
248
|
+
export declare const EINVOICE_PROFILES: readonly ["basic", "en16931"];
|
|
249
|
+
export type EinvoiceProfile = (typeof EINVOICE_PROFILES)[number];
|
|
250
|
+
export declare const EINVOICE_FLAVOURS: readonly ["factur-x", "zugferd"];
|
|
251
|
+
export type EinvoiceFlavour = (typeof EINVOICE_FLAVOURS)[number];
|
|
252
|
+
/**
|
|
253
|
+
* `post.einvoice` of a request and `settings.einvoice` of a template (spec 17 §4.1). `profile` and
|
|
254
|
+
* `flavour` are text here on purpose: a profile we do not emit (`minimum`, `xrechnung`) is answered
|
|
255
|
+
* with `einvoice_profile_unsupported` and its own explanation, not as a malformed request.
|
|
256
|
+
*/
|
|
257
|
+
export declare const einvoiceOptionsSchema: z.ZodObject<{
|
|
258
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
259
|
+
flavour: z.ZodOptional<z.ZodString>;
|
|
260
|
+
xml: z.ZodOptional<z.ZodEnum<{
|
|
261
|
+
embedded: "embedded";
|
|
262
|
+
both: "both";
|
|
263
|
+
}>>;
|
|
264
|
+
display_check: z.ZodOptional<z.ZodEnum<{
|
|
265
|
+
warn: "warn";
|
|
266
|
+
strict: "strict";
|
|
267
|
+
}>>;
|
|
268
|
+
}, z.core.$strict>;
|
|
269
|
+
export type EinvoiceOptionsInput = z.infer<typeof einvoiceOptionsSchema>;
|
|
270
|
+
/** The options with every default filled in: what the worker acts on and the render records. */
|
|
271
|
+
export interface EinvoiceOptions {
|
|
272
|
+
profile: EinvoiceProfile;
|
|
273
|
+
flavour: EinvoiceFlavour;
|
|
274
|
+
xml: 'embedded' | 'both';
|
|
275
|
+
display_check: 'warn' | 'strict';
|
|
276
|
+
}
|
|
277
|
+
export declare const defaultEinvoiceOptions: EinvoiceOptions;
|
|
278
|
+
export type ResolvedEinvoice = {
|
|
279
|
+
ok: true;
|
|
280
|
+
options: EinvoiceOptions | null;
|
|
281
|
+
} | {
|
|
282
|
+
ok: false;
|
|
283
|
+
field: 'profile' | 'flavour';
|
|
284
|
+
value: string;
|
|
285
|
+
reason: string;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* One e-invoice declaration out of its layers, earliest first (the template's settings, the
|
|
289
|
+
* request's settings, `post.einvoice`). Fields merge one by one with the later layer winning, like
|
|
290
|
+
* every other setting; `false` drops whatever was declared before it, so a request can switch a
|
|
291
|
+
* template's declaration off; `null` when nothing declares an e-invoice.
|
|
292
|
+
*/
|
|
293
|
+
export declare function resolveEinvoiceOptions(...layers: Array<EinvoiceOptionsInput | false | null | undefined>): ResolvedEinvoice;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InvoiceInput } from './schema.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* A complete `_invoice` block with placeholder values, for a data set that has none yet: the editor
|
|
4
|
+
* inserts it, and the docs show it. Every value is one to replace; it is valid as it stands, so the
|
|
5
|
+
* first preview of a template that reads it renders, and passes the check.
|
|
6
|
+
*
|
|
7
|
+
* The names are the placeholders every published sample of ours uses. `issueDate` is a parameter
|
|
8
|
+
* because the engine has no clock of its own.
|
|
9
|
+
*/
|
|
10
|
+
export declare function invoiceSkeleton(issueDate?: string): InvoiceInput;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InvoiceInput } from './schema.js';
|
|
2
|
+
/**
|
|
3
|
+
* A complete `_invoice` block with placeholder values, for a data set that has none yet: the editor
|
|
4
|
+
* inserts it, and the docs show it. Every value is one to replace; it is valid as it stands, so the
|
|
5
|
+
* first preview of a template that reads it renders, and passes the check.
|
|
6
|
+
*
|
|
7
|
+
* The names are the placeholders every published sample of ours uses. `issueDate` is a parameter
|
|
8
|
+
* because the engine has no clock of its own.
|
|
9
|
+
*/
|
|
10
|
+
export declare function invoiceSkeleton(issueDate?: string): InvoiceInput;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Bundled from src/frame/text-edit.entry.ts. */
|
|
2
|
-
export declare const textEditRuntime = "\"use strict\";(()=>{var
|
|
2
|
+
export declare const textEditRuntime = "\"use strict\";(()=>{var O=`\nhtml.ff-edit-mode [data-ff-edit] { cursor: text; }\nhtml.ff-edit-mode [data-ff-edit]:hover { outline: 1px dashed rgba(37,99,235,.85); outline-offset: 2px; }\nhtml.ff-edit-mode [data-ff-edit=\"t\"]:hover { outline-color: rgba(147,51,234,.9); }\n.ff-editing { outline: 2px solid #2563eb !important; outline-offset: 2px; cursor: text; }\n.ff-editing .ff-chip { background: rgba(37,99,235,.14) !important; box-shadow: inset 0 0 0 1px rgba(37,99,235,.45) !important; border-radius: 3px !important; padding: 0 1px !important; cursor: default; }\n.ff-edit-badge { position: absolute; z-index: 2147483647; font: 500 11px/1.4 system-ui, sans-serif !important; color: #fff !important; background: #2563eb !important; padding: 1px 6px !important; border-radius: 4px !important; pointer-events: none; white-space: nowrap; }\n`;function F(l,d={}){let m=d.clicks!==!1,g=d.live===!0,o=l.document,i=null,s=null,f=e=>{try{l.parent.postMessage(e,\"*\")}catch{}},v=m?o.querySelector('meta[name=\"formfeed:document\"]')?.getAttribute(\"content\")??null:null,h=!1;l.addEventListener(\"blur\",()=>{h=!0}),l.addEventListener(\"focus\",()=>{h=!1});let y=o.createElement(\"style\");y.setAttribute(\"data-formfeed\",\"edit\"),y.setAttribute(\"data-pagedjs-ignore\",\"\"),y.textContent=O,(o.head??o.documentElement).appendChild(y),m&&o.documentElement.classList.add(\"ff-edit-mode\");let M=e=>(e&&typeof e.closest==\"function\"?e:null)?.closest(\"[data-ff-edit]\")??null;o.addEventListener(\"click\",e=>{if(!m)return;if(i&&!i.done&&i.element.contains(e.target)){e.stopImmediatePropagation();return}let t=M(e.target);t&&(e.preventDefault(),e.stopImmediatePropagation(),C(t,{x:e.clientX,y:e.clientY}))},!0);function C(e,t){i&&!i.done&&x();let n=e.getAttribute(\"data-ff-src\")??\"\",r=e.getBoundingClientRect(),u=Array.from(o.querySelectorAll(`[data-ff-src=\"${n.replace(/\"/g,\"\")}\"]`));s={src:n,element:e,point:t},f({type:\"formfeed:edit-request\",src:n,doc:v,edit:e.getAttribute(\"data-ff-edit\"),text:e.textContent??\"\",elements:e.childElementCount,count:u.length,index:Math.max(0,u.indexOf(e)),split:e.hasAttribute(\"data-split-from\")||e.hasAttribute(\"data-split-to\"),rect:{left:r.left,top:r.top,width:r.width,height:r.height}})}o.addEventListener(\"keydown\",e=>{if(!m||i&&!i.done||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();(t===\"z\"||t===\"y\")&&(e.preventDefault(),f({type:t===\"y\"||e.shiftKey?\"formfeed:redo\":\"formfeed:undo\"}))}),l.addEventListener(\"message\",e=>{if(e.source!==l.parent)return;let t=e.data;!t||typeof t.type!=\"string\"||(t.type===\"formfeed:edit-begin\"?P(t):t.type===\"formfeed:edit-refuse\"||t.type===\"formfeed:edit-end\"?(s=null,i&&!i.done&&E(!1)):t.type===\"formfeed:edit-open\"&&B(t))});function B(e){if(!m||typeof e.src!=\"string\"||i&&!i.done)return;let t=Array.from(o.querySelectorAll(`[data-ff-src=\"${e.src.replace(/\"/g,\"\")}\"][data-ff-edit]`)),n=Number.isInteger(e.index)?Number(e.index):0,r=t[n]??t[0];r&&C(r,null)}if(m){let e=()=>f({type:\"formfeed:edit-ready\",doc:v}),t=l;t.PagedConfig?t.formfeedEditReady=e:o.readyState===\"loading\"?o.addEventListener(\"DOMContentLoaded\",e):e()}function P(e){i&&!i.done&&E(!1);let t=e.layer?o.querySelector(`[data-ff-layer=\"${String(e.layer).replace(/\"/g,\"\")}\"] > .ff-text`):s&&s.src===e.src?s.element:o.querySelector(`[data-ff-src=\"${String(e.src).replace(/\"/g,\"\")}\"]`),n=e.at,r=e.layer?n&&Number.isFinite(n.x)&&Number.isFinite(n.y)?{x:Number(n.x),y:Number(n.y)}:null:s&&s.src===e.src?s.point:null;s=null;let u=h&&!o.hasFocus();if(!t||!Array.isArray(e.items)||u){f({type:\"formfeed:edit-cancel\",token:String(e.token)});return}let c=Array.from(t.childNodes),b=o.createDocumentFragment();for(let a of e.items)if(a.kind===\"text\")b.appendChild(o.createTextNode(String(a.text)));else if(a.kind===\"break\")b.appendChild(o.createElement(\"br\"));else if(a.kind===\"chip\"){let p=o.createElement(\"span\");p.className=\"ff-chip\",p.setAttribute(\"data-ff-chip\",String(a.index)),p.setAttribute(\"contenteditable\",\"false\"),a.title&&(p.title=String(a.title)),p.textContent=String(a.text),b.appendChild(p)}for(let a of c)t.removeChild(a);t.appendChild(b),t.contentEditable=\"true\",t.classList.add(\"ff-editing\"),t.setAttribute(\"role\",\"textbox\"),e.label&&t.setAttribute(\"aria-label\",String(e.label)),t.spellcheck=!0,i={token:String(e.token),element:t,saved:c,allowBreaks:e.allowBreaks===!0,badge:e.note?H(t,String(e.note)):null,done:!1},t.addEventListener(\"keydown\",A),t.addEventListener(\"beforeinput\",T),t.addEventListener(\"paste\",S),t.addEventListener(\"drop\",N),t.addEventListener(\"focusout\",R),g&&t.addEventListener(\"input\",k),t.focus(),e.select===\"all\"?I(t):K(t,r),f({type:\"formfeed:edit-started\",token:i.token}),typeof e.insert==\"string\"&&e.insert&&L(e.insert.replace(/\\r\\n?|\\n/g,\" \"))}function L(e){if(typeof o.execCommand==\"function\"&&o.execCommand(\"insertText\",!1,e))return;let t=l.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;n&&(n.deleteContents(),n.insertNode(o.createTextNode(e)),n.collapse(!1),g&&k())}function k(){i&&!i.done&&f({type:\"formfeed:edit-input\",token:i.token,items:D(i.element)})}function H(e,t){let n=o.createElement(\"div\");n.className=\"ff-edit-badge\",n.textContent=t;let r=e.getBoundingClientRect();return n.style.left=`${r.left+l.scrollX}px`,n.style.top=`${Math.max(0,r.top+l.scrollY-22)}px`,o.body.appendChild(n),n}function I(e){let t=l.getSelection();if(!t)return;let n=o.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function K(e,t){let n=l.getSelection();if(!n)return;let r=null,u=o;if(t){if(u.caretRangeFromPoint)r=u.caretRangeFromPoint(t.x,t.y);else if(u.caretPositionFromPoint){let c=u.caretPositionFromPoint(t.x,t.y);c&&(r=o.createRange(),r.setStart(c.offsetNode,c.offset))}}if(!r||!e.contains(r.startContainer))r=o.createRange(),r.selectNodeContents(e),r.collapse(!1);else if(t){let c=r.startContainer,a=(c.nodeType===1?c:c.parentElement)?.closest(\"[data-ff-chip]\")??null;if(a&&a!==e&&e.contains(a)){let p=a.getBoundingClientRect();r=o.createRange(),t.x<p.left+p.width/2?r.setStartBefore(a):r.setStartAfter(a),r.collapse(!0)}}n.removeAllRanges(),n.addRange(r)}function A(e){let t=e.key;t===\"Escape\"?(e.preventDefault(),E(!0)):t===\"Enter\"&&!e.shiftKey?(e.preventDefault(),x()):t===\"Enter\"?(e.preventDefault(),i?.allowBreaks&&q()):t===\"Tab\"?(e.preventDefault(),x()):(e.ctrlKey||e.metaKey)&&[\"b\",\"i\",\"u\"].includes(t.toLowerCase())&&(e.preventDefault(),g&&i&&!e.altKey&&f({type:\"formfeed:edit-style\",token:i.token,key:t.toLowerCase()}))}function T(e){let t=e.inputType??\"\";(t.startsWith(\"format\")||t===\"insertFromDrop\"||t===\"insertParagraph\"||t===\"insertLineBreak\")&&e.preventDefault()}function S(e){e.preventDefault(),L((e.clipboardData?.getData(\"text/plain\")??\"\").replace(/\\r\\n?|\\n/g,\" \"))}function N(e){e.preventDefault()}function R(){l.setTimeout(()=>{i&&!i.done&&(!o.hasFocus()||!i.element.contains(o.activeElement))&&x()},0)}function q(){let e=l.getSelection();if(!e||!e.rangeCount)return;let t=e.getRangeAt(0);t.deleteContents();let n=o.createElement(\"br\");t.insertNode(n),n.nextSibling||n.parentNode?.appendChild(o.createElement(\"br\"));let r=o.createRange();r.setStartAfter(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}function w(e){e.done=!0;let t=e.element;t.removeEventListener(\"keydown\",A),t.removeEventListener(\"beforeinput\",T),t.removeEventListener(\"paste\",S),t.removeEventListener(\"drop\",N),t.removeEventListener(\"focusout\",R),t.removeEventListener(\"input\",k),t.removeAttribute(\"contenteditable\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-label\"),t.classList.remove(\"ff-editing\"),e.badge?.remove(),i===e&&(i=null)}function x(){let e=i;if(!e||e.done)return;let t=D(e.element);w(e),f({type:\"formfeed:edit-commit\",token:e.token,items:t})}function E(e){let t=i;if(!t||t.done)return;let n=t.element;for(;n.firstChild;)n.removeChild(n.firstChild);for(let r of t.saved)n.appendChild(r);w(t),e&&f({type:\"formfeed:edit-cancel\",token:t.token})}}function D(l){let d=[],m=o=>{let i=d[d.length-1];i?.kind===\"text\"?i.text+=o:o&&d.push({kind:\"text\",text:o})},g=o=>{for(let i of Array.from(o.childNodes))if(i.nodeType===3)m(i.data);else if(i.nodeType===1){let s=i,f=s.getAttribute(\"data-ff-chip\");f!==null?d.push({kind:\"chip\",index:Number(f)}):s.tagName===\"BR\"?d.push({kind:\"break\"}):((s.tagName===\"DIV\"||s.tagName===\"P\")&&d.length&&d.push({kind:\"break\"}),g(s))}};for(g(l);d[d.length-1]?.kind===\"break\";)d.pop();return d}F(window);})();";
|
|
3
3
|
/** Bundled from src/frame/fit.entry.ts. */
|
|
4
4
|
export declare const fitRuntime = "\"use strict\";(()=>{function a(t,e,n){if(e===t)return t.scrollHeight<=t.clientHeight+.5&&t.scrollWidth<=t.clientWidth+.5;let o=n.getComputedStyle(t),i=t.clientHeight-(parseFloat(o.paddingTop)||0)-(parseFloat(o.paddingBottom)||0);return e.scrollHeight<=i+.5&&e.scrollWidth<=e.clientWidth+.5}function m(t,e){let n=t.firstElementChild??t;n.style.fontSize=\"\";let o=parseFloat(e.getComputedStyle(n).fontSize)||16,i=Math.min(o,parseFloat(t.getAttribute(\"data-ff-fit-min\")??\"\")||o/2);if(a(t,n,e))return o;let l=i,s=o;for(let d=0;d<14;d++){let r=(l+s)/2;n.style.fontSize=`${r}px`,a(t,n,e)?l=r:s=r}let f=Math.floor(l*100)/100;return n.style.fontSize=`${f}px`,f}function c(t){let e=()=>{for(let o of Array.from(t.document.querySelectorAll('[data-ff-fit=\"shrink\"]')))m(o,t);t.document.documentElement.setAttribute(\"data-ff-fit\",\"done\")};t.formfeedFit=e;let n=t.document.fonts;n?n.ready.then(e):t.addEventListener(\"load\",e)}c(window);})();";
|
|
5
5
|
/** Bundled from src/frame/stage.entry.ts. */
|
|
6
|
-
export declare const stageRuntime = "\"use strict\";(()=>{var I=`\nhtml.ff-edit-mode [data-ff-edit] { cursor: text; }\nhtml.ff-edit-mode [data-ff-edit]:hover { outline: 1px dashed rgba(37,99,235,.85); outline-offset: 2px; }\nhtml.ff-edit-mode [data-ff-edit=\"t\"]:hover { outline-color: rgba(147,51,234,.9); }\n.ff-editing { outline: 2px solid #2563eb !important; outline-offset: 2px; cursor: text; }\n.ff-editing .ff-chip { background: rgba(37,99,235,.14) !important; box-shadow: inset 0 0 0 1px rgba(37,99,235,.45) !important; border-radius: 3px !important; padding: 0 1px !important; cursor: default; }\n.ff-edit-badge { position: absolute; z-index: 2147483647; font: 500 11px/1.4 system-ui, sans-serif !important; color: #fff !important; background: #2563eb !important; padding: 1px 6px !important; border-radius: 4px !important; pointer-events: none; white-space: nowrap; }\n`;function D(a,l={}){let f=l.clicks!==!1,c=l.live===!0,o=a.document,n=null,s=null,u=e=>{try{a.parent.postMessage(e,\"*\")}catch{}},p=o.createElement(\"style\");p.setAttribute(\"data-formfeed\",\"edit\"),p.setAttribute(\"data-pagedjs-ignore\",\"\"),p.textContent=I,(o.head??o.documentElement).appendChild(p),f&&o.documentElement.classList.add(\"ff-edit-mode\");let d=e=>(e&&typeof e.closest==\"function\"?e:null)?.closest(\"[data-ff-edit]\")??null;o.addEventListener(\"click\",e=>{if(!f)return;if(n&&!n.done&&n.element.contains(e.target)){e.stopImmediatePropagation();return}let t=d(e.target);if(!t)return;e.preventDefault(),e.stopImmediatePropagation(),n&&!n.done&&v();let r=t.getAttribute(\"data-ff-src\")??\"\",i=t.getBoundingClientRect();s={src:r,element:t,x:e.clientX,y:e.clientY},u({type:\"formfeed:edit-request\",src:r,edit:t.getAttribute(\"data-ff-edit\"),text:t.textContent??\"\",count:o.querySelectorAll(`[data-ff-src=\"${r.replace(/\"/g,\"\")}\"]`).length,split:t.hasAttribute(\"data-split-from\")||t.hasAttribute(\"data-split-to\"),rect:{left:i.left,top:i.top,width:i.width,height:i.height}})},!0),o.addEventListener(\"keydown\",e=>{if(!f||n&&!n.done||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();(t===\"z\"||t===\"y\")&&(e.preventDefault(),u({type:t===\"y\"||e.shiftKey?\"formfeed:redo\":\"formfeed:undo\"}))}),a.addEventListener(\"message\",e=>{if(e.source!==a.parent)return;let t=e.data;!t||typeof t.type!=\"string\"||(t.type===\"formfeed:edit-begin\"?b(t):(t.type===\"formfeed:edit-refuse\"||t.type===\"formfeed:edit-end\")&&(s=null,n&&!n.done&&L(!1)))});function b(e){n&&!n.done&&L(!1);let t=e.layer?o.querySelector(`[data-ff-layer=\"${String(e.layer).replace(/\"/g,\"\")}\"] > .ff-text`):s&&s.src===e.src?s.element:o.querySelector(`[data-ff-src=\"${String(e.src).replace(/\"/g,\"\")}\"]`),r=e.at,i=e.layer?r&&Number.isFinite(r.x)&&Number.isFinite(r.y)?{x:Number(r.x),y:Number(r.y)}:null:s&&s.src===e.src?s:null;if(s=null,!t||!Array.isArray(e.items)){u({type:\"formfeed:edit-cancel\",token:String(e.token)});return}let x=Array.from(t.childNodes),g=o.createDocumentFragment();for(let y of e.items)if(y.kind===\"text\")g.appendChild(o.createTextNode(String(y.text)));else if(y.kind===\"break\")g.appendChild(o.createElement(\"br\"));else if(y.kind===\"chip\"){let m=o.createElement(\"span\");m.className=\"ff-chip\",m.setAttribute(\"data-ff-chip\",String(y.index)),m.setAttribute(\"contenteditable\",\"false\"),y.title&&(m.title=String(y.title)),m.textContent=String(y.text),g.appendChild(m)}for(let y of x)t.removeChild(y);t.appendChild(g),t.contentEditable=\"true\",t.classList.add(\"ff-editing\"),t.setAttribute(\"role\",\"textbox\"),e.label&&t.setAttribute(\"aria-label\",String(e.label)),t.spellcheck=!0,n={token:String(e.token),element:t,saved:x,allowBreaks:e.allowBreaks===!0,badge:e.note?E(t,String(e.note)):null,done:!1},t.addEventListener(\"keydown\",C),t.addEventListener(\"beforeinput\",S),t.addEventListener(\"paste\",A),t.addEventListener(\"drop\",T),t.addEventListener(\"focusout\",N),c&&t.addEventListener(\"input\",k),t.focus(),e.select===\"all\"?H(t):M(t,i),u({type:\"formfeed:edit-started\",token:n.token}),typeof e.insert==\"string\"&&e.insert&&h(e.insert.replace(/\\r\\n?|\\n/g,\" \"))}function h(e){if(typeof o.execCommand==\"function\"&&o.execCommand(\"insertText\",!1,e))return;let t=a.getSelection(),r=t&&t.rangeCount?t.getRangeAt(0):null;r&&(r.deleteContents(),r.insertNode(o.createTextNode(e)),r.collapse(!1),c&&k())}function k(){n&&!n.done&&u({type:\"formfeed:edit-input\",token:n.token,items:w(n.element)})}function E(e,t){let r=o.createElement(\"div\");r.className=\"ff-edit-badge\",r.textContent=t;let i=e.getBoundingClientRect();return r.style.left=`${i.left+a.scrollX}px`,r.style.top=`${Math.max(0,i.top+a.scrollY-22)}px`,o.body.appendChild(r),r}function H(e){let t=a.getSelection();if(!t)return;let r=o.createRange();r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r)}function M(e,t){let r=a.getSelection();if(!r)return;let i=null,x=o;if(t){if(x.caretRangeFromPoint)i=x.caretRangeFromPoint(t.x,t.y);else if(x.caretPositionFromPoint){let g=x.caretPositionFromPoint(t.x,t.y);g&&(i=o.createRange(),i.setStart(g.offsetNode,g.offset))}}if(!i||!e.contains(i.startContainer))i=o.createRange(),i.selectNodeContents(e),i.collapse(!1);else if(t){let g=i.startContainer,m=(g.nodeType===1?g:g.parentElement)?.closest(\"[data-ff-chip]\")??null;if(m&&m!==e&&e.contains(m)){let F=m.getBoundingClientRect();i=o.createRange(),t.x<F.left+F.width/2?i.setStartBefore(m):i.setStartAfter(m),i.collapse(!0)}}r.removeAllRanges(),r.addRange(i)}function C(e){let t=e.key;t===\"Escape\"?(e.preventDefault(),L(!0)):t===\"Enter\"&&!e.shiftKey?(e.preventDefault(),v()):t===\"Enter\"?(e.preventDefault(),n?.allowBreaks&&P()):t===\"Tab\"?(e.preventDefault(),v()):(e.ctrlKey||e.metaKey)&&[\"b\",\"i\",\"u\"].includes(t.toLowerCase())&&(e.preventDefault(),c&&n&&!e.altKey&&u({type:\"formfeed:edit-style\",token:n.token,key:t.toLowerCase()}))}function S(e){let t=e.inputType??\"\";(t.startsWith(\"format\")||t===\"insertFromDrop\"||t===\"insertParagraph\"||t===\"insertLineBreak\")&&e.preventDefault()}function A(e){e.preventDefault(),h((e.clipboardData?.getData(\"text/plain\")??\"\").replace(/\\r\\n?|\\n/g,\" \"))}function T(e){e.preventDefault()}function N(){a.setTimeout(()=>{n&&!n.done&&(!o.hasFocus()||!n.element.contains(o.activeElement))&&v()},0)}function P(){let e=a.getSelection();if(!e||!e.rangeCount)return;let t=e.getRangeAt(0);t.deleteContents();let r=o.createElement(\"br\");t.insertNode(r),r.nextSibling||r.parentNode?.appendChild(o.createElement(\"br\"));let i=o.createRange();i.setStartAfter(r),i.collapse(!0),e.removeAllRanges(),e.addRange(i)}function R(e){e.done=!0;let t=e.element;t.removeEventListener(\"keydown\",C),t.removeEventListener(\"beforeinput\",S),t.removeEventListener(\"paste\",A),t.removeEventListener(\"drop\",T),t.removeEventListener(\"focusout\",N),t.removeEventListener(\"input\",k),t.removeAttribute(\"contenteditable\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-label\"),t.classList.remove(\"ff-editing\"),e.badge?.remove(),n===e&&(n=null)}function v(){let e=n;if(!e||e.done)return;let t=w(e.element);R(e),u({type:\"formfeed:edit-commit\",token:e.token,items:t})}function L(e){let t=n;if(!t||t.done)return;let r=t.element;for(;r.firstChild;)r.removeChild(r.firstChild);for(let i of t.saved)r.appendChild(i);R(t),e&&u({type:\"formfeed:edit-cancel\",token:t.token})}}function w(a){let l=[],f=o=>{let n=l[l.length-1];n?.kind===\"text\"?n.text+=o:o&&l.push({kind:\"text\",text:o})},c=o=>{for(let n of Array.from(o.childNodes))if(n.nodeType===3)f(n.data);else if(n.nodeType===1){let s=n,u=s.getAttribute(\"data-ff-chip\");u!==null?l.push({kind:\"chip\",index:Number(u)}):s.tagName===\"BR\"?l.push({kind:\"break\"}):((s.tagName===\"DIV\"||s.tagName===\"P\")&&l.length&&l.push({kind:\"break\"}),c(s))}};for(c(a);l[l.length-1]?.kind===\"break\";)l.pop();return l}function K(a,l){return Array.from(a.querySelectorAll(\"[data-ff-layer]\")).map(f=>{let c=f.querySelector(\":scope > .ff-text\"),o=!1;if(c&&f.style.height!==\"auto\"){let n=l.getComputedStyle(f),s=f.clientHeight-(parseFloat(n.paddingTop)||0)-(parseFloat(n.paddingBottom)||0);o=n.overflow===\"hidden\"&&(c.scrollHeight>s+1||c.scrollWidth>c.clientWidth+1)}return{id:f.getAttribute(\"data-ff-layer\")??\"\",width:f.offsetWidth,height:f.offsetHeight,overflow:o}})}function B(a){let l=a.document,f=p=>{try{a.parent.postMessage(p,\"*\")}catch{}},c=p=>typeof p==\"string\"?l.querySelector(`[data-ff-layer=\"${p.replace(/\"/g,\"\")}\"]`):null,o=()=>{for(let p of Array.from(l.querySelectorAll(\"[data-ff-layer]\")))for(let d of[\"left\",\"top\",\"width\",\"height\",\"transform\"])p.style.removeProperty(d)},n=()=>{a.formfeedFit?.(),f({type:\"formfeed:ready\",layers:K(l,a)})};a.addEventListener(\"message\",p=>{if(p.source!==a.parent)return;let d=p.data;if(!(!d||typeof d.type!=\"string\")){if(d.type===\"formfeed:layer-style\"){let b=c(d.id);if(!b)return;let h=(k,E)=>{typeof E==\"number\"&&Number.isFinite(E)&&b.style.setProperty(k,`${E}px`)};h(\"left\",d.left),h(\"top\",d.top),h(\"width\",d.width),h(\"height\",d.height),typeof d.rotation==\"number\"&&Number.isFinite(d.rotation)&&b.style.setProperty(\"transform\",d.rotation?`rotate(${d.rotation}deg)`:\"none\")}else if(d.type===\"formfeed:layer-style-clear\")o();else if(d.type===\"formfeed:css\"&&typeof d.css==\"string\"){let b=l.querySelector('style[data-formfeed=\"template\"]');b&&(b.textContent=d.css),o(),n()}}}),D(a,{clicks:!1,live:!0});let s=l.fonts,u=()=>s?void s.ready.then(n):n();l.readyState===\"complete\"?u():a.addEventListener(\"load\",u)}B(window);})();";
|
|
6
|
+
export declare const stageRuntime = "\"use strict\";(()=>{var W=`\nhtml.ff-edit-mode [data-ff-edit] { cursor: text; }\nhtml.ff-edit-mode [data-ff-edit]:hover { outline: 1px dashed rgba(37,99,235,.85); outline-offset: 2px; }\nhtml.ff-edit-mode [data-ff-edit=\"t\"]:hover { outline-color: rgba(147,51,234,.9); }\n.ff-editing { outline: 2px solid #2563eb !important; outline-offset: 2px; cursor: text; }\n.ff-editing .ff-chip { background: rgba(37,99,235,.14) !important; box-shadow: inset 0 0 0 1px rgba(37,99,235,.45) !important; border-radius: 3px !important; padding: 0 1px !important; cursor: default; }\n.ff-edit-badge { position: absolute; z-index: 2147483647; font: 500 11px/1.4 system-ui, sans-serif !important; color: #fff !important; background: #2563eb !important; padding: 1px 6px !important; border-radius: 4px !important; pointer-events: none; white-space: nowrap; }\n`;function H(a,l={}){let f=l.clicks!==!1,p=l.live===!0,n=a.document,o=null,d=null,u=e=>{try{a.parent.postMessage(e,\"*\")}catch{}},m=f?n.querySelector('meta[name=\"formfeed:document\"]')?.getAttribute(\"content\")??null:null,s=!1;a.addEventListener(\"blur\",()=>{s=!0}),a.addEventListener(\"focus\",()=>{s=!1});let g=n.createElement(\"style\");g.setAttribute(\"data-formfeed\",\"edit\"),g.setAttribute(\"data-pagedjs-ignore\",\"\"),g.textContent=W,(n.head??n.documentElement).appendChild(g),f&&n.documentElement.classList.add(\"ff-edit-mode\");let x=e=>(e&&typeof e.closest==\"function\"?e:null)?.closest(\"[data-ff-edit]\")??null;n.addEventListener(\"click\",e=>{if(!f)return;if(o&&!o.done&&o.element.contains(e.target)){e.stopImmediatePropagation();return}let t=x(e.target);t&&(e.preventDefault(),e.stopImmediatePropagation(),v(t,{x:e.clientX,y:e.clientY}))},!0);function v(e,t){o&&!o.done&&L();let r=e.getAttribute(\"data-ff-src\")??\"\",i=e.getBoundingClientRect(),b=Array.from(n.querySelectorAll(`[data-ff-src=\"${r.replace(/\"/g,\"\")}\"]`));d={src:r,element:e,point:t},u({type:\"formfeed:edit-request\",src:r,doc:m,edit:e.getAttribute(\"data-ff-edit\"),text:e.textContent??\"\",elements:e.childElementCount,count:b.length,index:Math.max(0,b.indexOf(e)),split:e.hasAttribute(\"data-split-from\")||e.hasAttribute(\"data-split-to\"),rect:{left:i.left,top:i.top,width:i.width,height:i.height}})}n.addEventListener(\"keydown\",e=>{if(!f||o&&!o.done||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();(t===\"z\"||t===\"y\")&&(e.preventDefault(),u({type:t===\"y\"||e.shiftKey?\"formfeed:redo\":\"formfeed:undo\"}))}),a.addEventListener(\"message\",e=>{if(e.source!==a.parent)return;let t=e.data;!t||typeof t.type!=\"string\"||(t.type===\"formfeed:edit-begin\"?B(t):t.type===\"formfeed:edit-refuse\"||t.type===\"formfeed:edit-end\"?(d=null,o&&!o.done&&S(!1)):t.type===\"formfeed:edit-open\"&&E(t))});function E(e){if(!f||typeof e.src!=\"string\"||o&&!o.done)return;let t=Array.from(n.querySelectorAll(`[data-ff-src=\"${e.src.replace(/\"/g,\"\")}\"][data-ff-edit]`)),r=Number.isInteger(e.index)?Number(e.index):0,i=t[r]??t[0];i&&v(i,null)}if(f){let e=()=>u({type:\"formfeed:edit-ready\",doc:m}),t=a;t.PagedConfig?t.formfeedEditReady=e:n.readyState===\"loading\"?n.addEventListener(\"DOMContentLoaded\",e):e()}function B(e){o&&!o.done&&S(!1);let t=e.layer?n.querySelector(`[data-ff-layer=\"${String(e.layer).replace(/\"/g,\"\")}\"] > .ff-text`):d&&d.src===e.src?d.element:n.querySelector(`[data-ff-src=\"${String(e.src).replace(/\"/g,\"\")}\"]`),r=e.at,i=e.layer?r&&Number.isFinite(r.x)&&Number.isFinite(r.y)?{x:Number(r.x),y:Number(r.y)}:null:d&&d.src===e.src?d.point:null;d=null;let b=s&&!n.hasFocus();if(!t||!Array.isArray(e.items)||b){u({type:\"formfeed:edit-cancel\",token:String(e.token)});return}let y=Array.from(t.childNodes),k=n.createDocumentFragment();for(let c of e.items)if(c.kind===\"text\")k.appendChild(n.createTextNode(String(c.text)));else if(c.kind===\"break\")k.appendChild(n.createElement(\"br\"));else if(c.kind===\"chip\"){let h=n.createElement(\"span\");h.className=\"ff-chip\",h.setAttribute(\"data-ff-chip\",String(c.index)),h.setAttribute(\"contenteditable\",\"false\"),c.title&&(h.title=String(c.title)),h.textContent=String(c.text),k.appendChild(h)}for(let c of y)t.removeChild(c);t.appendChild(k),t.contentEditable=\"true\",t.classList.add(\"ff-editing\"),t.setAttribute(\"role\",\"textbox\"),e.label&&t.setAttribute(\"aria-label\",String(e.label)),t.spellcheck=!0,o={token:String(e.token),element:t,saved:y,allowBreaks:e.allowBreaks===!0,badge:e.note?I(t,String(e.note)):null,done:!1},t.addEventListener(\"keydown\",T),t.addEventListener(\"beforeinput\",N),t.addEventListener(\"paste\",w),t.addEventListener(\"drop\",R),t.addEventListener(\"focusout\",F),p&&t.addEventListener(\"input\",C),t.focus(),e.select===\"all\"?q(t):K(t,i),u({type:\"formfeed:edit-started\",token:o.token}),typeof e.insert==\"string\"&&e.insert&&A(e.insert.replace(/\\r\\n?|\\n/g,\" \"))}function A(e){if(typeof n.execCommand==\"function\"&&n.execCommand(\"insertText\",!1,e))return;let t=a.getSelection(),r=t&&t.rangeCount?t.getRangeAt(0):null;r&&(r.deleteContents(),r.insertNode(n.createTextNode(e)),r.collapse(!1),p&&C())}function C(){o&&!o.done&&u({type:\"formfeed:edit-input\",token:o.token,items:D(o.element)})}function I(e,t){let r=n.createElement(\"div\");r.className=\"ff-edit-badge\",r.textContent=t;let i=e.getBoundingClientRect();return r.style.left=`${i.left+a.scrollX}px`,r.style.top=`${Math.max(0,i.top+a.scrollY-22)}px`,n.body.appendChild(r),r}function q(e){let t=a.getSelection();if(!t)return;let r=n.createRange();r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r)}function K(e,t){let r=a.getSelection();if(!r)return;let i=null,b=n;if(t){if(b.caretRangeFromPoint)i=b.caretRangeFromPoint(t.x,t.y);else if(b.caretPositionFromPoint){let y=b.caretPositionFromPoint(t.x,t.y);y&&(i=n.createRange(),i.setStart(y.offsetNode,y.offset))}}if(!i||!e.contains(i.startContainer))i=n.createRange(),i.selectNodeContents(e),i.collapse(!1);else if(t){let y=i.startContainer,c=(y.nodeType===1?y:y.parentElement)?.closest(\"[data-ff-chip]\")??null;if(c&&c!==e&&e.contains(c)){let h=c.getBoundingClientRect();i=n.createRange(),t.x<h.left+h.width/2?i.setStartBefore(c):i.setStartAfter(c),i.collapse(!0)}}r.removeAllRanges(),r.addRange(i)}function T(e){let t=e.key;t===\"Escape\"?(e.preventDefault(),S(!0)):t===\"Enter\"&&!e.shiftKey?(e.preventDefault(),L()):t===\"Enter\"?(e.preventDefault(),o?.allowBreaks&&$()):t===\"Tab\"?(e.preventDefault(),L()):(e.ctrlKey||e.metaKey)&&[\"b\",\"i\",\"u\"].includes(t.toLowerCase())&&(e.preventDefault(),p&&o&&!e.altKey&&u({type:\"formfeed:edit-style\",token:o.token,key:t.toLowerCase()}))}function N(e){let t=e.inputType??\"\";(t.startsWith(\"format\")||t===\"insertFromDrop\"||t===\"insertParagraph\"||t===\"insertLineBreak\")&&e.preventDefault()}function w(e){e.preventDefault(),A((e.clipboardData?.getData(\"text/plain\")??\"\").replace(/\\r\\n?|\\n/g,\" \"))}function R(e){e.preventDefault()}function F(){a.setTimeout(()=>{o&&!o.done&&(!n.hasFocus()||!o.element.contains(n.activeElement))&&L()},0)}function $(){let e=a.getSelection();if(!e||!e.rangeCount)return;let t=e.getRangeAt(0);t.deleteContents();let r=n.createElement(\"br\");t.insertNode(r),r.nextSibling||r.parentNode?.appendChild(n.createElement(\"br\"));let i=n.createRange();i.setStartAfter(r),i.collapse(!0),e.removeAllRanges(),e.addRange(i)}function M(e){e.done=!0;let t=e.element;t.removeEventListener(\"keydown\",T),t.removeEventListener(\"beforeinput\",N),t.removeEventListener(\"paste\",w),t.removeEventListener(\"drop\",R),t.removeEventListener(\"focusout\",F),t.removeEventListener(\"input\",C),t.removeAttribute(\"contenteditable\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-label\"),t.classList.remove(\"ff-editing\"),e.badge?.remove(),o===e&&(o=null)}function L(){let e=o;if(!e||e.done)return;let t=D(e.element);M(e),u({type:\"formfeed:edit-commit\",token:e.token,items:t})}function S(e){let t=o;if(!t||t.done)return;let r=t.element;for(;r.firstChild;)r.removeChild(r.firstChild);for(let i of t.saved)r.appendChild(i);M(t),e&&u({type:\"formfeed:edit-cancel\",token:t.token})}}function D(a){let l=[],f=n=>{let o=l[l.length-1];o?.kind===\"text\"?o.text+=n:n&&l.push({kind:\"text\",text:n})},p=n=>{for(let o of Array.from(n.childNodes))if(o.nodeType===3)f(o.data);else if(o.nodeType===1){let d=o,u=d.getAttribute(\"data-ff-chip\");u!==null?l.push({kind:\"chip\",index:Number(u)}):d.tagName===\"BR\"?l.push({kind:\"break\"}):((d.tagName===\"DIV\"||d.tagName===\"P\")&&l.length&&l.push({kind:\"break\"}),p(d))}};for(p(a);l[l.length-1]?.kind===\"break\";)l.pop();return l}function O(a,l){return Array.from(a.querySelectorAll(\"[data-ff-layer]\")).map(f=>{let p=f.querySelector(\":scope > .ff-text\"),n=!1;if(p&&f.style.height!==\"auto\"){let o=l.getComputedStyle(f),d=f.clientHeight-(parseFloat(o.paddingTop)||0)-(parseFloat(o.paddingBottom)||0);n=o.overflow===\"hidden\"&&(p.scrollHeight>d+1||p.scrollWidth>p.clientWidth+1)}return{id:f.getAttribute(\"data-ff-layer\")??\"\",width:f.offsetWidth,height:f.offsetHeight,overflow:n}})}function P(a){let l=a.document,f=m=>{try{a.parent.postMessage(m,\"*\")}catch{}},p=m=>typeof m==\"string\"?l.querySelector(`[data-ff-layer=\"${m.replace(/\"/g,\"\")}\"]`):null,n=()=>{for(let m of Array.from(l.querySelectorAll(\"[data-ff-layer]\")))for(let s of[\"left\",\"top\",\"width\",\"height\",\"transform\"])m.style.removeProperty(s)},o=()=>{a.formfeedFit?.(),f({type:\"formfeed:ready\",layers:O(l,a)})};a.addEventListener(\"message\",m=>{if(m.source!==a.parent)return;let s=m.data;if(!(!s||typeof s.type!=\"string\")){if(s.type===\"formfeed:layer-style\"){let g=p(s.id);if(!g)return;let x=(v,E)=>{typeof E==\"number\"&&Number.isFinite(E)&&g.style.setProperty(v,`${E}px`)};x(\"left\",s.left),x(\"top\",s.top),x(\"width\",s.width),x(\"height\",s.height),typeof s.rotation==\"number\"&&Number.isFinite(s.rotation)&&g.style.setProperty(\"transform\",s.rotation?`rotate(${s.rotation}deg)`:\"none\")}else if(s.type===\"formfeed:layer-style-clear\")n();else if(s.type===\"formfeed:css\"&&typeof s.css==\"string\"){let g=l.querySelector('style[data-formfeed=\"template\"]');g&&(g.textContent=s.css),n(),o()}}}),H(a,{clicks:!1,live:!0});let d=l.fonts,u=()=>d?void d.ready.then(o):o();l.readyState===\"complete\"?u():a.addEventListener(\"load\",u)}P(window);})();";
|
|
7
|
+
/** Bundled from src/frame/audit.entry.ts. */
|
|
8
|
+
export declare const auditRuntime = "\"use strict\";(()=>{var I={\"document-title\":\"error\",\"image-alt\":\"error\",\"figure-name\":\"error\",\"heading-order\":\"error\",\"table-rows\":\"error\",\"table-cell-empty\":\"error\",\"masked-text\":\"error\",\"filtered-text\":\"warning\",\"document-language\":\"warning\",\"table-headers\":\"warning\",\"link-name\":\"warning\",\"generated-text\":\"warning\",\"fixed-text\":\"warning\",\"running-text\":\"warning\"};var S=120;var O=\".formfeed-chrome, .ff-running-header, .ff-running-footer\",_=\".pageNumber, .totalPages, .date, .title, .url, .ff-page-no, .ff-page-total\",k=new Set([\"script\",\"style\",\"template\",\"noscript\",\"head\"]),j=2e4,q=10,B=new Set([\"page\",\"pages\",\"of\",\"seite\",\"seiten\",\"von\",\"p\",\"s\"]),u=t=>(t??\"\").replace(/\\s+/g,\" \").trim(),D=t=>t.replace(/\\s+/g,\"\").toLowerCase(),$=t=>/[\\p{L}\\p{N}]/u.test(t),Y=/^data-(ref|id|split-(from|to|original)|(previous-|next-)?break-(before|after|inside)|(align-)?last-split-element|nth-of-type|counter-.+|page(-number)?|undisplayed|after-page|following|has-notes|children|item-num)$/;function X(t){let n=t.cloneNode(!1);n.removeAttribute(\"data-ff-src\"),n.removeAttribute(\"data-ff-edit\");let i=t.closest(\".pagedjs_page\")!==null;for(let s of Array.from(n.attributes))i&&Y.test(s.name)?n.removeAttribute(s.name):s.value.length>48&&n.setAttribute(s.name,`${s.value.slice(0,40)}\\u2026`);let o=n.outerHTML.replace(new RegExp(`</${t.tagName}>$`,\"i\"),\"\");return o.length>S?`${o.slice(0,S-1)}\\u2026`:o}function F(t,n={}){let i=t.document,o=i.body,s=[],d=new Set,a=n.findings!==!1,c=(e,r,l={})=>{if(!a)return;let m=r?.closest(\"[data-ff-src]\")?.getAttribute(\"data-ff-src\")??null,h=r?X(r):\"\",g=`${e}|${m??h}|${JSON.stringify(l)}`;d.has(g)||(d.add(g),s.push({code:e,severity:I[e],src:m,snippet:h,args:l}))},f=new WeakMap,A=e=>{let r=f.get(e);if(r!==void 0)return r;let l=t.getComputedStyle(e),m=l.display===\"none\"||l.visibility===\"hidden\"||l.visibility===\"collapse\"||e.parentElement!==null&&e.parentElement!==i.documentElement&&A(e.parentElement);return f.set(e,m),m},p=e=>e.closest('[aria-hidden=\"true\"]')!==null,E=e=>/^(presentation|none)$/.test(e.getAttribute(\"role\")??\"\"),H=e=>e.closest(O)!==null,y=e=>$(e.textContent??\"\"),x=e=>{let r=u(e.getAttribute(\"aria-label\"));return r||u((e.getAttribute(\"aria-labelledby\")??\"\").split(/\\s+/).filter(Boolean).map(l=>e.ownerDocument.getElementById(l)?.textContent??\"\").join(\" \"))},P=e=>x(e)||u(e.textContent)||u(Array.from(e.querySelectorAll(\"img[alt]\")).map(r=>r.getAttribute(\"alt\")).join(\" \"))||u(e.getAttribute(\"title\")),T=e=>{let r=e.getAttribute(\"href\")??\"\";return{href:r.startsWith(\"#\")?r:e.href??r,name:P(e)}};u(i.title)||c(\"document-title\",null),!u(i.documentElement.getAttribute(\"lang\"))&&!n.locale&&c(\"document-language\",null);let M=n.pages??(n.pageHeight&&n.pageHeight>0?Math.ceil(i.documentElement.scrollHeight/n.pageHeight):1),C=[],v=[],R={\"masked-text\":[],\"filtered-text\":[],\"fixed-text\":[]},w=(e,r)=>{R[e].some(l=>l.contains(r))||(R[e].push(r),c(e,r))},V=a&&ne(i),G=o?Array.from(o.querySelectorAll(\"*\")).slice(0,j):[];for(let e of G){let r=e.tagName.toLowerCase();if(k.has(r)||H(e)||A(e))continue;if(r===\"a\"&&e.hasAttribute(\"href\")){let g=T(e);C.push(g),!g.name&&!p(e)&&c(\"link-name\",e)}if(!a)continue;let l=t.getComputedStyle(e),m=l.getPropertyValue(\"mask-image\")||l.getPropertyValue(\"-webkit-mask-image\");if(m&&m!==\"none\"&&y(e)&&w(\"masked-text\",e),l.filter&&l.filter!==\"none\"&&y(e)&&w(\"filtered-text\",e),l.position===\"fixed\"&&M>1&&y(e)&&w(\"fixed-text\",e),V)for(let g of[\"::before\",\"::after\"]){let U=re(t.getComputedStyle(e,g).content);U&&c(\"generated-text\",e,{text:U})}if(p(e))continue;r===\"img\"&&!E(e)?e.hasAttribute(\"alt\")||x(e)||u(e.getAttribute(\"title\"))||c(\"image-alt\",e):(r===\"canvas\"||e.getAttribute(\"role\")===\"img\"&&r!==\"img\")&&(x(e)||u(e.getAttribute(\"title\"))||u(e.querySelector(\":scope > title\")?.textContent)||c(\"figure-name\",e,{tag:r}));let h=/^h[1-6]$/.test(r)?Number(r[1]):e.getAttribute(\"role\")===\"heading\"?Number(e.getAttribute(\"aria-level\"))||2:0;h&&v.push({element:e,level:h}),r===\"table\"&&!E(e)&&Q(e,c)}let b=0;for(let{element:e,level:r}of v)(b===0?r!==1:r>b+1)&&c(\"heading-order\",e,{level:r,previous:b}),b=r;let N=[],W=a&&o?D(J(o)):\"\",L=0;for(let e of[\"header\",\"footer\"])for(let r of z(i,e,n[e])){for(let l of Array.from(r.querySelectorAll(\"a[href]\")))N.push(T(l));if(a)for(let{text:l,element:m}of K(r)){if(L>=q||W.includes(D(l)))continue;let h=s.length;c(\"running-text\",m,{text:l.slice(0,80),part:e}),s.length>h&&L++}}return{findings:s,links:C,templateLinks:N}}function z(t,n,i){if(i!==void 0){if(!i.trim())return[];let o=new DOMParser().parseFromString(`<!doctype html><body>${i}</body>`,\"text/html\");return o.body?[o.body]:[]}return Array.from(t.querySelectorAll(`.ff-running-${n}, .formfeed-chrome[data-ff-chrome=\"${n}\"]`))}function J(t){let n=[],i=o=>{if(o.nodeType===3){n.push(o.nodeValue??\"\");return}if(o.nodeType!==1)return;let s=o;if(!(k.has(s.tagName.toLowerCase())||s.matches(O)))for(let d of Array.from(o.childNodes))i(d)};return i(t),n.join(\" \")}function K(t){let n=[],i=o=>{let s=o.tagName.toLowerCase();if(k.has(s)||o.matches(_))return;let d=Array.from(o.children).some(a=>a.matches(_));for(let a of Array.from(o.childNodes))if(a.nodeType===1)i(a);else if(a.nodeType===3&&!d)for(let c of(a.nodeValue??\"\").split(/\\s*[\u00B7\u2022|]\\s*|\\s{2,}|\\n/)){let f=u(c);(f.toLowerCase().match(/[\\p{L}\\p{N}]+/gu)??[]).some(p=>!B.has(p))&&n.push({text:f,element:o})}};return i(t),n}function Q(t,n){let i=Array.from(t.rows);if(!(t.querySelector('th, [role=\"columnheader\"], [role=\"rowheader\"]')!==null)){i.length>=2&&n(\"table-headers\",t);return}let s=te(i),d=s.find(c=>c!==s[0]);d!==void 0&&n(\"table-rows\",t,{first:s[0]??0,other:d});let a=i.flatMap(c=>Array.from(c.cells).filter(f=>f.tagName===\"TD\"&&ee(f)));a[0]&&n(\"table-cell-empty\",a[0],{count:a.length})}var Z='img[alt]:not([alt=\"\"]), svg, canvas, input, select, textarea, button, meter, progress';function ee(t){return!/[^ \\t\\n\\r\\f]/.test(t.textContent??\"\")&&t.querySelector(Z)===null}function te(t){let n=[];return t.map(i=>{let o=[],s=0,d=()=>{for(;(n[s]??0)>0;)o[s]=n[s]-1,s++};for(let a of Array.from(i.cells)){d();let c=Math.max(1,a.rowSpan||1)-1;for(let f=Math.max(1,a.colSpan||1);f>0;f--)o[s++]=c}d();for(let a=s;a<n.length;a++)(n[a]??0)>0&&(o[a]=n[a]-1,s=a+1);return n=o,s})}function ne(t){let n=i=>{for(let o of Array.from(i??[])){let s=o;if(s.selectorText&&/::?(before|after)/.test(s.selectorText)&&s.style?.content||o.cssRules&&n(o.cssRules))return!0}return!1};for(let i of Array.from(t.styleSheets))try{if(n(i.cssRules))return!0}catch{return!0}return!1}function re(t){if(!t||t===\"none\"||t===\"normal\")return\"\";let n=(t.match(/\"(?:[^\"\\\\]|\\\\.)*\"/g)??[]).map(o=>o.slice(1,-1).replace(/\\\\(.)/g,\"$1\"));if(/\\bcounters?\\(/.test(t))return u(t).slice(0,80);let i=u(n.join(\"\"));return $(i)?i.slice(0,80):\"\"}window.formfeedAudit=t=>F(window,t);})();";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Bundled from src/frame/text-edit.entry.ts. */
|
|
2
|
-
export declare const textEditRuntime = "\"use strict\";(()=>{var
|
|
2
|
+
export declare const textEditRuntime = "\"use strict\";(()=>{var O=`\nhtml.ff-edit-mode [data-ff-edit] { cursor: text; }\nhtml.ff-edit-mode [data-ff-edit]:hover { outline: 1px dashed rgba(37,99,235,.85); outline-offset: 2px; }\nhtml.ff-edit-mode [data-ff-edit=\"t\"]:hover { outline-color: rgba(147,51,234,.9); }\n.ff-editing { outline: 2px solid #2563eb !important; outline-offset: 2px; cursor: text; }\n.ff-editing .ff-chip { background: rgba(37,99,235,.14) !important; box-shadow: inset 0 0 0 1px rgba(37,99,235,.45) !important; border-radius: 3px !important; padding: 0 1px !important; cursor: default; }\n.ff-edit-badge { position: absolute; z-index: 2147483647; font: 500 11px/1.4 system-ui, sans-serif !important; color: #fff !important; background: #2563eb !important; padding: 1px 6px !important; border-radius: 4px !important; pointer-events: none; white-space: nowrap; }\n`;function F(l,d={}){let m=d.clicks!==!1,g=d.live===!0,o=l.document,i=null,s=null,f=e=>{try{l.parent.postMessage(e,\"*\")}catch{}},v=m?o.querySelector('meta[name=\"formfeed:document\"]')?.getAttribute(\"content\")??null:null,h=!1;l.addEventListener(\"blur\",()=>{h=!0}),l.addEventListener(\"focus\",()=>{h=!1});let y=o.createElement(\"style\");y.setAttribute(\"data-formfeed\",\"edit\"),y.setAttribute(\"data-pagedjs-ignore\",\"\"),y.textContent=O,(o.head??o.documentElement).appendChild(y),m&&o.documentElement.classList.add(\"ff-edit-mode\");let M=e=>(e&&typeof e.closest==\"function\"?e:null)?.closest(\"[data-ff-edit]\")??null;o.addEventListener(\"click\",e=>{if(!m)return;if(i&&!i.done&&i.element.contains(e.target)){e.stopImmediatePropagation();return}let t=M(e.target);t&&(e.preventDefault(),e.stopImmediatePropagation(),C(t,{x:e.clientX,y:e.clientY}))},!0);function C(e,t){i&&!i.done&&x();let n=e.getAttribute(\"data-ff-src\")??\"\",r=e.getBoundingClientRect(),u=Array.from(o.querySelectorAll(`[data-ff-src=\"${n.replace(/\"/g,\"\")}\"]`));s={src:n,element:e,point:t},f({type:\"formfeed:edit-request\",src:n,doc:v,edit:e.getAttribute(\"data-ff-edit\"),text:e.textContent??\"\",elements:e.childElementCount,count:u.length,index:Math.max(0,u.indexOf(e)),split:e.hasAttribute(\"data-split-from\")||e.hasAttribute(\"data-split-to\"),rect:{left:r.left,top:r.top,width:r.width,height:r.height}})}o.addEventListener(\"keydown\",e=>{if(!m||i&&!i.done||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();(t===\"z\"||t===\"y\")&&(e.preventDefault(),f({type:t===\"y\"||e.shiftKey?\"formfeed:redo\":\"formfeed:undo\"}))}),l.addEventListener(\"message\",e=>{if(e.source!==l.parent)return;let t=e.data;!t||typeof t.type!=\"string\"||(t.type===\"formfeed:edit-begin\"?P(t):t.type===\"formfeed:edit-refuse\"||t.type===\"formfeed:edit-end\"?(s=null,i&&!i.done&&E(!1)):t.type===\"formfeed:edit-open\"&&B(t))});function B(e){if(!m||typeof e.src!=\"string\"||i&&!i.done)return;let t=Array.from(o.querySelectorAll(`[data-ff-src=\"${e.src.replace(/\"/g,\"\")}\"][data-ff-edit]`)),n=Number.isInteger(e.index)?Number(e.index):0,r=t[n]??t[0];r&&C(r,null)}if(m){let e=()=>f({type:\"formfeed:edit-ready\",doc:v}),t=l;t.PagedConfig?t.formfeedEditReady=e:o.readyState===\"loading\"?o.addEventListener(\"DOMContentLoaded\",e):e()}function P(e){i&&!i.done&&E(!1);let t=e.layer?o.querySelector(`[data-ff-layer=\"${String(e.layer).replace(/\"/g,\"\")}\"] > .ff-text`):s&&s.src===e.src?s.element:o.querySelector(`[data-ff-src=\"${String(e.src).replace(/\"/g,\"\")}\"]`),n=e.at,r=e.layer?n&&Number.isFinite(n.x)&&Number.isFinite(n.y)?{x:Number(n.x),y:Number(n.y)}:null:s&&s.src===e.src?s.point:null;s=null;let u=h&&!o.hasFocus();if(!t||!Array.isArray(e.items)||u){f({type:\"formfeed:edit-cancel\",token:String(e.token)});return}let c=Array.from(t.childNodes),b=o.createDocumentFragment();for(let a of e.items)if(a.kind===\"text\")b.appendChild(o.createTextNode(String(a.text)));else if(a.kind===\"break\")b.appendChild(o.createElement(\"br\"));else if(a.kind===\"chip\"){let p=o.createElement(\"span\");p.className=\"ff-chip\",p.setAttribute(\"data-ff-chip\",String(a.index)),p.setAttribute(\"contenteditable\",\"false\"),a.title&&(p.title=String(a.title)),p.textContent=String(a.text),b.appendChild(p)}for(let a of c)t.removeChild(a);t.appendChild(b),t.contentEditable=\"true\",t.classList.add(\"ff-editing\"),t.setAttribute(\"role\",\"textbox\"),e.label&&t.setAttribute(\"aria-label\",String(e.label)),t.spellcheck=!0,i={token:String(e.token),element:t,saved:c,allowBreaks:e.allowBreaks===!0,badge:e.note?H(t,String(e.note)):null,done:!1},t.addEventListener(\"keydown\",A),t.addEventListener(\"beforeinput\",T),t.addEventListener(\"paste\",S),t.addEventListener(\"drop\",N),t.addEventListener(\"focusout\",R),g&&t.addEventListener(\"input\",k),t.focus(),e.select===\"all\"?I(t):K(t,r),f({type:\"formfeed:edit-started\",token:i.token}),typeof e.insert==\"string\"&&e.insert&&L(e.insert.replace(/\\r\\n?|\\n/g,\" \"))}function L(e){if(typeof o.execCommand==\"function\"&&o.execCommand(\"insertText\",!1,e))return;let t=l.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;n&&(n.deleteContents(),n.insertNode(o.createTextNode(e)),n.collapse(!1),g&&k())}function k(){i&&!i.done&&f({type:\"formfeed:edit-input\",token:i.token,items:D(i.element)})}function H(e,t){let n=o.createElement(\"div\");n.className=\"ff-edit-badge\",n.textContent=t;let r=e.getBoundingClientRect();return n.style.left=`${r.left+l.scrollX}px`,n.style.top=`${Math.max(0,r.top+l.scrollY-22)}px`,o.body.appendChild(n),n}function I(e){let t=l.getSelection();if(!t)return;let n=o.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function K(e,t){let n=l.getSelection();if(!n)return;let r=null,u=o;if(t){if(u.caretRangeFromPoint)r=u.caretRangeFromPoint(t.x,t.y);else if(u.caretPositionFromPoint){let c=u.caretPositionFromPoint(t.x,t.y);c&&(r=o.createRange(),r.setStart(c.offsetNode,c.offset))}}if(!r||!e.contains(r.startContainer))r=o.createRange(),r.selectNodeContents(e),r.collapse(!1);else if(t){let c=r.startContainer,a=(c.nodeType===1?c:c.parentElement)?.closest(\"[data-ff-chip]\")??null;if(a&&a!==e&&e.contains(a)){let p=a.getBoundingClientRect();r=o.createRange(),t.x<p.left+p.width/2?r.setStartBefore(a):r.setStartAfter(a),r.collapse(!0)}}n.removeAllRanges(),n.addRange(r)}function A(e){let t=e.key;t===\"Escape\"?(e.preventDefault(),E(!0)):t===\"Enter\"&&!e.shiftKey?(e.preventDefault(),x()):t===\"Enter\"?(e.preventDefault(),i?.allowBreaks&&q()):t===\"Tab\"?(e.preventDefault(),x()):(e.ctrlKey||e.metaKey)&&[\"b\",\"i\",\"u\"].includes(t.toLowerCase())&&(e.preventDefault(),g&&i&&!e.altKey&&f({type:\"formfeed:edit-style\",token:i.token,key:t.toLowerCase()}))}function T(e){let t=e.inputType??\"\";(t.startsWith(\"format\")||t===\"insertFromDrop\"||t===\"insertParagraph\"||t===\"insertLineBreak\")&&e.preventDefault()}function S(e){e.preventDefault(),L((e.clipboardData?.getData(\"text/plain\")??\"\").replace(/\\r\\n?|\\n/g,\" \"))}function N(e){e.preventDefault()}function R(){l.setTimeout(()=>{i&&!i.done&&(!o.hasFocus()||!i.element.contains(o.activeElement))&&x()},0)}function q(){let e=l.getSelection();if(!e||!e.rangeCount)return;let t=e.getRangeAt(0);t.deleteContents();let n=o.createElement(\"br\");t.insertNode(n),n.nextSibling||n.parentNode?.appendChild(o.createElement(\"br\"));let r=o.createRange();r.setStartAfter(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}function w(e){e.done=!0;let t=e.element;t.removeEventListener(\"keydown\",A),t.removeEventListener(\"beforeinput\",T),t.removeEventListener(\"paste\",S),t.removeEventListener(\"drop\",N),t.removeEventListener(\"focusout\",R),t.removeEventListener(\"input\",k),t.removeAttribute(\"contenteditable\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-label\"),t.classList.remove(\"ff-editing\"),e.badge?.remove(),i===e&&(i=null)}function x(){let e=i;if(!e||e.done)return;let t=D(e.element);w(e),f({type:\"formfeed:edit-commit\",token:e.token,items:t})}function E(e){let t=i;if(!t||t.done)return;let n=t.element;for(;n.firstChild;)n.removeChild(n.firstChild);for(let r of t.saved)n.appendChild(r);w(t),e&&f({type:\"formfeed:edit-cancel\",token:t.token})}}function D(l){let d=[],m=o=>{let i=d[d.length-1];i?.kind===\"text\"?i.text+=o:o&&d.push({kind:\"text\",text:o})},g=o=>{for(let i of Array.from(o.childNodes))if(i.nodeType===3)m(i.data);else if(i.nodeType===1){let s=i,f=s.getAttribute(\"data-ff-chip\");f!==null?d.push({kind:\"chip\",index:Number(f)}):s.tagName===\"BR\"?d.push({kind:\"break\"}):((s.tagName===\"DIV\"||s.tagName===\"P\")&&d.length&&d.push({kind:\"break\"}),g(s))}};for(g(l);d[d.length-1]?.kind===\"break\";)d.pop();return d}F(window);})();";
|
|
3
3
|
/** Bundled from src/frame/fit.entry.ts. */
|
|
4
4
|
export declare const fitRuntime = "\"use strict\";(()=>{function a(t,e,n){if(e===t)return t.scrollHeight<=t.clientHeight+.5&&t.scrollWidth<=t.clientWidth+.5;let o=n.getComputedStyle(t),i=t.clientHeight-(parseFloat(o.paddingTop)||0)-(parseFloat(o.paddingBottom)||0);return e.scrollHeight<=i+.5&&e.scrollWidth<=e.clientWidth+.5}function m(t,e){let n=t.firstElementChild??t;n.style.fontSize=\"\";let o=parseFloat(e.getComputedStyle(n).fontSize)||16,i=Math.min(o,parseFloat(t.getAttribute(\"data-ff-fit-min\")??\"\")||o/2);if(a(t,n,e))return o;let l=i,s=o;for(let d=0;d<14;d++){let r=(l+s)/2;n.style.fontSize=`${r}px`,a(t,n,e)?l=r:s=r}let f=Math.floor(l*100)/100;return n.style.fontSize=`${f}px`,f}function c(t){let e=()=>{for(let o of Array.from(t.document.querySelectorAll('[data-ff-fit=\"shrink\"]')))m(o,t);t.document.documentElement.setAttribute(\"data-ff-fit\",\"done\")};t.formfeedFit=e;let n=t.document.fonts;n?n.ready.then(e):t.addEventListener(\"load\",e)}c(window);})();";
|
|
5
5
|
/** Bundled from src/frame/stage.entry.ts. */
|
|
6
|
-
export declare const stageRuntime = "\"use strict\";(()=>{var I=`\nhtml.ff-edit-mode [data-ff-edit] { cursor: text; }\nhtml.ff-edit-mode [data-ff-edit]:hover { outline: 1px dashed rgba(37,99,235,.85); outline-offset: 2px; }\nhtml.ff-edit-mode [data-ff-edit=\"t\"]:hover { outline-color: rgba(147,51,234,.9); }\n.ff-editing { outline: 2px solid #2563eb !important; outline-offset: 2px; cursor: text; }\n.ff-editing .ff-chip { background: rgba(37,99,235,.14) !important; box-shadow: inset 0 0 0 1px rgba(37,99,235,.45) !important; border-radius: 3px !important; padding: 0 1px !important; cursor: default; }\n.ff-edit-badge { position: absolute; z-index: 2147483647; font: 500 11px/1.4 system-ui, sans-serif !important; color: #fff !important; background: #2563eb !important; padding: 1px 6px !important; border-radius: 4px !important; pointer-events: none; white-space: nowrap; }\n`;function D(a,l={}){let f=l.clicks!==!1,c=l.live===!0,o=a.document,n=null,s=null,u=e=>{try{a.parent.postMessage(e,\"*\")}catch{}},p=o.createElement(\"style\");p.setAttribute(\"data-formfeed\",\"edit\"),p.setAttribute(\"data-pagedjs-ignore\",\"\"),p.textContent=I,(o.head??o.documentElement).appendChild(p),f&&o.documentElement.classList.add(\"ff-edit-mode\");let d=e=>(e&&typeof e.closest==\"function\"?e:null)?.closest(\"[data-ff-edit]\")??null;o.addEventListener(\"click\",e=>{if(!f)return;if(n&&!n.done&&n.element.contains(e.target)){e.stopImmediatePropagation();return}let t=d(e.target);if(!t)return;e.preventDefault(),e.stopImmediatePropagation(),n&&!n.done&&v();let r=t.getAttribute(\"data-ff-src\")??\"\",i=t.getBoundingClientRect();s={src:r,element:t,x:e.clientX,y:e.clientY},u({type:\"formfeed:edit-request\",src:r,edit:t.getAttribute(\"data-ff-edit\"),text:t.textContent??\"\",count:o.querySelectorAll(`[data-ff-src=\"${r.replace(/\"/g,\"\")}\"]`).length,split:t.hasAttribute(\"data-split-from\")||t.hasAttribute(\"data-split-to\"),rect:{left:i.left,top:i.top,width:i.width,height:i.height}})},!0),o.addEventListener(\"keydown\",e=>{if(!f||n&&!n.done||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();(t===\"z\"||t===\"y\")&&(e.preventDefault(),u({type:t===\"y\"||e.shiftKey?\"formfeed:redo\":\"formfeed:undo\"}))}),a.addEventListener(\"message\",e=>{if(e.source!==a.parent)return;let t=e.data;!t||typeof t.type!=\"string\"||(t.type===\"formfeed:edit-begin\"?b(t):(t.type===\"formfeed:edit-refuse\"||t.type===\"formfeed:edit-end\")&&(s=null,n&&!n.done&&L(!1)))});function b(e){n&&!n.done&&L(!1);let t=e.layer?o.querySelector(`[data-ff-layer=\"${String(e.layer).replace(/\"/g,\"\")}\"] > .ff-text`):s&&s.src===e.src?s.element:o.querySelector(`[data-ff-src=\"${String(e.src).replace(/\"/g,\"\")}\"]`),r=e.at,i=e.layer?r&&Number.isFinite(r.x)&&Number.isFinite(r.y)?{x:Number(r.x),y:Number(r.y)}:null:s&&s.src===e.src?s:null;if(s=null,!t||!Array.isArray(e.items)){u({type:\"formfeed:edit-cancel\",token:String(e.token)});return}let x=Array.from(t.childNodes),g=o.createDocumentFragment();for(let y of e.items)if(y.kind===\"text\")g.appendChild(o.createTextNode(String(y.text)));else if(y.kind===\"break\")g.appendChild(o.createElement(\"br\"));else if(y.kind===\"chip\"){let m=o.createElement(\"span\");m.className=\"ff-chip\",m.setAttribute(\"data-ff-chip\",String(y.index)),m.setAttribute(\"contenteditable\",\"false\"),y.title&&(m.title=String(y.title)),m.textContent=String(y.text),g.appendChild(m)}for(let y of x)t.removeChild(y);t.appendChild(g),t.contentEditable=\"true\",t.classList.add(\"ff-editing\"),t.setAttribute(\"role\",\"textbox\"),e.label&&t.setAttribute(\"aria-label\",String(e.label)),t.spellcheck=!0,n={token:String(e.token),element:t,saved:x,allowBreaks:e.allowBreaks===!0,badge:e.note?E(t,String(e.note)):null,done:!1},t.addEventListener(\"keydown\",C),t.addEventListener(\"beforeinput\",S),t.addEventListener(\"paste\",A),t.addEventListener(\"drop\",T),t.addEventListener(\"focusout\",N),c&&t.addEventListener(\"input\",k),t.focus(),e.select===\"all\"?H(t):M(t,i),u({type:\"formfeed:edit-started\",token:n.token}),typeof e.insert==\"string\"&&e.insert&&h(e.insert.replace(/\\r\\n?|\\n/g,\" \"))}function h(e){if(typeof o.execCommand==\"function\"&&o.execCommand(\"insertText\",!1,e))return;let t=a.getSelection(),r=t&&t.rangeCount?t.getRangeAt(0):null;r&&(r.deleteContents(),r.insertNode(o.createTextNode(e)),r.collapse(!1),c&&k())}function k(){n&&!n.done&&u({type:\"formfeed:edit-input\",token:n.token,items:w(n.element)})}function E(e,t){let r=o.createElement(\"div\");r.className=\"ff-edit-badge\",r.textContent=t;let i=e.getBoundingClientRect();return r.style.left=`${i.left+a.scrollX}px`,r.style.top=`${Math.max(0,i.top+a.scrollY-22)}px`,o.body.appendChild(r),r}function H(e){let t=a.getSelection();if(!t)return;let r=o.createRange();r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r)}function M(e,t){let r=a.getSelection();if(!r)return;let i=null,x=o;if(t){if(x.caretRangeFromPoint)i=x.caretRangeFromPoint(t.x,t.y);else if(x.caretPositionFromPoint){let g=x.caretPositionFromPoint(t.x,t.y);g&&(i=o.createRange(),i.setStart(g.offsetNode,g.offset))}}if(!i||!e.contains(i.startContainer))i=o.createRange(),i.selectNodeContents(e),i.collapse(!1);else if(t){let g=i.startContainer,m=(g.nodeType===1?g:g.parentElement)?.closest(\"[data-ff-chip]\")??null;if(m&&m!==e&&e.contains(m)){let F=m.getBoundingClientRect();i=o.createRange(),t.x<F.left+F.width/2?i.setStartBefore(m):i.setStartAfter(m),i.collapse(!0)}}r.removeAllRanges(),r.addRange(i)}function C(e){let t=e.key;t===\"Escape\"?(e.preventDefault(),L(!0)):t===\"Enter\"&&!e.shiftKey?(e.preventDefault(),v()):t===\"Enter\"?(e.preventDefault(),n?.allowBreaks&&P()):t===\"Tab\"?(e.preventDefault(),v()):(e.ctrlKey||e.metaKey)&&[\"b\",\"i\",\"u\"].includes(t.toLowerCase())&&(e.preventDefault(),c&&n&&!e.altKey&&u({type:\"formfeed:edit-style\",token:n.token,key:t.toLowerCase()}))}function S(e){let t=e.inputType??\"\";(t.startsWith(\"format\")||t===\"insertFromDrop\"||t===\"insertParagraph\"||t===\"insertLineBreak\")&&e.preventDefault()}function A(e){e.preventDefault(),h((e.clipboardData?.getData(\"text/plain\")??\"\").replace(/\\r\\n?|\\n/g,\" \"))}function T(e){e.preventDefault()}function N(){a.setTimeout(()=>{n&&!n.done&&(!o.hasFocus()||!n.element.contains(o.activeElement))&&v()},0)}function P(){let e=a.getSelection();if(!e||!e.rangeCount)return;let t=e.getRangeAt(0);t.deleteContents();let r=o.createElement(\"br\");t.insertNode(r),r.nextSibling||r.parentNode?.appendChild(o.createElement(\"br\"));let i=o.createRange();i.setStartAfter(r),i.collapse(!0),e.removeAllRanges(),e.addRange(i)}function R(e){e.done=!0;let t=e.element;t.removeEventListener(\"keydown\",C),t.removeEventListener(\"beforeinput\",S),t.removeEventListener(\"paste\",A),t.removeEventListener(\"drop\",T),t.removeEventListener(\"focusout\",N),t.removeEventListener(\"input\",k),t.removeAttribute(\"contenteditable\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-label\"),t.classList.remove(\"ff-editing\"),e.badge?.remove(),n===e&&(n=null)}function v(){let e=n;if(!e||e.done)return;let t=w(e.element);R(e),u({type:\"formfeed:edit-commit\",token:e.token,items:t})}function L(e){let t=n;if(!t||t.done)return;let r=t.element;for(;r.firstChild;)r.removeChild(r.firstChild);for(let i of t.saved)r.appendChild(i);R(t),e&&u({type:\"formfeed:edit-cancel\",token:t.token})}}function w(a){let l=[],f=o=>{let n=l[l.length-1];n?.kind===\"text\"?n.text+=o:o&&l.push({kind:\"text\",text:o})},c=o=>{for(let n of Array.from(o.childNodes))if(n.nodeType===3)f(n.data);else if(n.nodeType===1){let s=n,u=s.getAttribute(\"data-ff-chip\");u!==null?l.push({kind:\"chip\",index:Number(u)}):s.tagName===\"BR\"?l.push({kind:\"break\"}):((s.tagName===\"DIV\"||s.tagName===\"P\")&&l.length&&l.push({kind:\"break\"}),c(s))}};for(c(a);l[l.length-1]?.kind===\"break\";)l.pop();return l}function K(a,l){return Array.from(a.querySelectorAll(\"[data-ff-layer]\")).map(f=>{let c=f.querySelector(\":scope > .ff-text\"),o=!1;if(c&&f.style.height!==\"auto\"){let n=l.getComputedStyle(f),s=f.clientHeight-(parseFloat(n.paddingTop)||0)-(parseFloat(n.paddingBottom)||0);o=n.overflow===\"hidden\"&&(c.scrollHeight>s+1||c.scrollWidth>c.clientWidth+1)}return{id:f.getAttribute(\"data-ff-layer\")??\"\",width:f.offsetWidth,height:f.offsetHeight,overflow:o}})}function B(a){let l=a.document,f=p=>{try{a.parent.postMessage(p,\"*\")}catch{}},c=p=>typeof p==\"string\"?l.querySelector(`[data-ff-layer=\"${p.replace(/\"/g,\"\")}\"]`):null,o=()=>{for(let p of Array.from(l.querySelectorAll(\"[data-ff-layer]\")))for(let d of[\"left\",\"top\",\"width\",\"height\",\"transform\"])p.style.removeProperty(d)},n=()=>{a.formfeedFit?.(),f({type:\"formfeed:ready\",layers:K(l,a)})};a.addEventListener(\"message\",p=>{if(p.source!==a.parent)return;let d=p.data;if(!(!d||typeof d.type!=\"string\")){if(d.type===\"formfeed:layer-style\"){let b=c(d.id);if(!b)return;let h=(k,E)=>{typeof E==\"number\"&&Number.isFinite(E)&&b.style.setProperty(k,`${E}px`)};h(\"left\",d.left),h(\"top\",d.top),h(\"width\",d.width),h(\"height\",d.height),typeof d.rotation==\"number\"&&Number.isFinite(d.rotation)&&b.style.setProperty(\"transform\",d.rotation?`rotate(${d.rotation}deg)`:\"none\")}else if(d.type===\"formfeed:layer-style-clear\")o();else if(d.type===\"formfeed:css\"&&typeof d.css==\"string\"){let b=l.querySelector('style[data-formfeed=\"template\"]');b&&(b.textContent=d.css),o(),n()}}}),D(a,{clicks:!1,live:!0});let s=l.fonts,u=()=>s?void s.ready.then(n):n();l.readyState===\"complete\"?u():a.addEventListener(\"load\",u)}B(window);})();";
|
|
6
|
+
export declare const stageRuntime = "\"use strict\";(()=>{var W=`\nhtml.ff-edit-mode [data-ff-edit] { cursor: text; }\nhtml.ff-edit-mode [data-ff-edit]:hover { outline: 1px dashed rgba(37,99,235,.85); outline-offset: 2px; }\nhtml.ff-edit-mode [data-ff-edit=\"t\"]:hover { outline-color: rgba(147,51,234,.9); }\n.ff-editing { outline: 2px solid #2563eb !important; outline-offset: 2px; cursor: text; }\n.ff-editing .ff-chip { background: rgba(37,99,235,.14) !important; box-shadow: inset 0 0 0 1px rgba(37,99,235,.45) !important; border-radius: 3px !important; padding: 0 1px !important; cursor: default; }\n.ff-edit-badge { position: absolute; z-index: 2147483647; font: 500 11px/1.4 system-ui, sans-serif !important; color: #fff !important; background: #2563eb !important; padding: 1px 6px !important; border-radius: 4px !important; pointer-events: none; white-space: nowrap; }\n`;function H(a,l={}){let f=l.clicks!==!1,p=l.live===!0,n=a.document,o=null,d=null,u=e=>{try{a.parent.postMessage(e,\"*\")}catch{}},m=f?n.querySelector('meta[name=\"formfeed:document\"]')?.getAttribute(\"content\")??null:null,s=!1;a.addEventListener(\"blur\",()=>{s=!0}),a.addEventListener(\"focus\",()=>{s=!1});let g=n.createElement(\"style\");g.setAttribute(\"data-formfeed\",\"edit\"),g.setAttribute(\"data-pagedjs-ignore\",\"\"),g.textContent=W,(n.head??n.documentElement).appendChild(g),f&&n.documentElement.classList.add(\"ff-edit-mode\");let x=e=>(e&&typeof e.closest==\"function\"?e:null)?.closest(\"[data-ff-edit]\")??null;n.addEventListener(\"click\",e=>{if(!f)return;if(o&&!o.done&&o.element.contains(e.target)){e.stopImmediatePropagation();return}let t=x(e.target);t&&(e.preventDefault(),e.stopImmediatePropagation(),v(t,{x:e.clientX,y:e.clientY}))},!0);function v(e,t){o&&!o.done&&L();let r=e.getAttribute(\"data-ff-src\")??\"\",i=e.getBoundingClientRect(),b=Array.from(n.querySelectorAll(`[data-ff-src=\"${r.replace(/\"/g,\"\")}\"]`));d={src:r,element:e,point:t},u({type:\"formfeed:edit-request\",src:r,doc:m,edit:e.getAttribute(\"data-ff-edit\"),text:e.textContent??\"\",elements:e.childElementCount,count:b.length,index:Math.max(0,b.indexOf(e)),split:e.hasAttribute(\"data-split-from\")||e.hasAttribute(\"data-split-to\"),rect:{left:i.left,top:i.top,width:i.width,height:i.height}})}n.addEventListener(\"keydown\",e=>{if(!f||o&&!o.done||!(e.ctrlKey||e.metaKey)||e.altKey)return;let t=e.key.toLowerCase();(t===\"z\"||t===\"y\")&&(e.preventDefault(),u({type:t===\"y\"||e.shiftKey?\"formfeed:redo\":\"formfeed:undo\"}))}),a.addEventListener(\"message\",e=>{if(e.source!==a.parent)return;let t=e.data;!t||typeof t.type!=\"string\"||(t.type===\"formfeed:edit-begin\"?B(t):t.type===\"formfeed:edit-refuse\"||t.type===\"formfeed:edit-end\"?(d=null,o&&!o.done&&S(!1)):t.type===\"formfeed:edit-open\"&&E(t))});function E(e){if(!f||typeof e.src!=\"string\"||o&&!o.done)return;let t=Array.from(n.querySelectorAll(`[data-ff-src=\"${e.src.replace(/\"/g,\"\")}\"][data-ff-edit]`)),r=Number.isInteger(e.index)?Number(e.index):0,i=t[r]??t[0];i&&v(i,null)}if(f){let e=()=>u({type:\"formfeed:edit-ready\",doc:m}),t=a;t.PagedConfig?t.formfeedEditReady=e:n.readyState===\"loading\"?n.addEventListener(\"DOMContentLoaded\",e):e()}function B(e){o&&!o.done&&S(!1);let t=e.layer?n.querySelector(`[data-ff-layer=\"${String(e.layer).replace(/\"/g,\"\")}\"] > .ff-text`):d&&d.src===e.src?d.element:n.querySelector(`[data-ff-src=\"${String(e.src).replace(/\"/g,\"\")}\"]`),r=e.at,i=e.layer?r&&Number.isFinite(r.x)&&Number.isFinite(r.y)?{x:Number(r.x),y:Number(r.y)}:null:d&&d.src===e.src?d.point:null;d=null;let b=s&&!n.hasFocus();if(!t||!Array.isArray(e.items)||b){u({type:\"formfeed:edit-cancel\",token:String(e.token)});return}let y=Array.from(t.childNodes),k=n.createDocumentFragment();for(let c of e.items)if(c.kind===\"text\")k.appendChild(n.createTextNode(String(c.text)));else if(c.kind===\"break\")k.appendChild(n.createElement(\"br\"));else if(c.kind===\"chip\"){let h=n.createElement(\"span\");h.className=\"ff-chip\",h.setAttribute(\"data-ff-chip\",String(c.index)),h.setAttribute(\"contenteditable\",\"false\"),c.title&&(h.title=String(c.title)),h.textContent=String(c.text),k.appendChild(h)}for(let c of y)t.removeChild(c);t.appendChild(k),t.contentEditable=\"true\",t.classList.add(\"ff-editing\"),t.setAttribute(\"role\",\"textbox\"),e.label&&t.setAttribute(\"aria-label\",String(e.label)),t.spellcheck=!0,o={token:String(e.token),element:t,saved:y,allowBreaks:e.allowBreaks===!0,badge:e.note?I(t,String(e.note)):null,done:!1},t.addEventListener(\"keydown\",T),t.addEventListener(\"beforeinput\",N),t.addEventListener(\"paste\",w),t.addEventListener(\"drop\",R),t.addEventListener(\"focusout\",F),p&&t.addEventListener(\"input\",C),t.focus(),e.select===\"all\"?q(t):K(t,i),u({type:\"formfeed:edit-started\",token:o.token}),typeof e.insert==\"string\"&&e.insert&&A(e.insert.replace(/\\r\\n?|\\n/g,\" \"))}function A(e){if(typeof n.execCommand==\"function\"&&n.execCommand(\"insertText\",!1,e))return;let t=a.getSelection(),r=t&&t.rangeCount?t.getRangeAt(0):null;r&&(r.deleteContents(),r.insertNode(n.createTextNode(e)),r.collapse(!1),p&&C())}function C(){o&&!o.done&&u({type:\"formfeed:edit-input\",token:o.token,items:D(o.element)})}function I(e,t){let r=n.createElement(\"div\");r.className=\"ff-edit-badge\",r.textContent=t;let i=e.getBoundingClientRect();return r.style.left=`${i.left+a.scrollX}px`,r.style.top=`${Math.max(0,i.top+a.scrollY-22)}px`,n.body.appendChild(r),r}function q(e){let t=a.getSelection();if(!t)return;let r=n.createRange();r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r)}function K(e,t){let r=a.getSelection();if(!r)return;let i=null,b=n;if(t){if(b.caretRangeFromPoint)i=b.caretRangeFromPoint(t.x,t.y);else if(b.caretPositionFromPoint){let y=b.caretPositionFromPoint(t.x,t.y);y&&(i=n.createRange(),i.setStart(y.offsetNode,y.offset))}}if(!i||!e.contains(i.startContainer))i=n.createRange(),i.selectNodeContents(e),i.collapse(!1);else if(t){let y=i.startContainer,c=(y.nodeType===1?y:y.parentElement)?.closest(\"[data-ff-chip]\")??null;if(c&&c!==e&&e.contains(c)){let h=c.getBoundingClientRect();i=n.createRange(),t.x<h.left+h.width/2?i.setStartBefore(c):i.setStartAfter(c),i.collapse(!0)}}r.removeAllRanges(),r.addRange(i)}function T(e){let t=e.key;t===\"Escape\"?(e.preventDefault(),S(!0)):t===\"Enter\"&&!e.shiftKey?(e.preventDefault(),L()):t===\"Enter\"?(e.preventDefault(),o?.allowBreaks&&$()):t===\"Tab\"?(e.preventDefault(),L()):(e.ctrlKey||e.metaKey)&&[\"b\",\"i\",\"u\"].includes(t.toLowerCase())&&(e.preventDefault(),p&&o&&!e.altKey&&u({type:\"formfeed:edit-style\",token:o.token,key:t.toLowerCase()}))}function N(e){let t=e.inputType??\"\";(t.startsWith(\"format\")||t===\"insertFromDrop\"||t===\"insertParagraph\"||t===\"insertLineBreak\")&&e.preventDefault()}function w(e){e.preventDefault(),A((e.clipboardData?.getData(\"text/plain\")??\"\").replace(/\\r\\n?|\\n/g,\" \"))}function R(e){e.preventDefault()}function F(){a.setTimeout(()=>{o&&!o.done&&(!n.hasFocus()||!o.element.contains(n.activeElement))&&L()},0)}function $(){let e=a.getSelection();if(!e||!e.rangeCount)return;let t=e.getRangeAt(0);t.deleteContents();let r=n.createElement(\"br\");t.insertNode(r),r.nextSibling||r.parentNode?.appendChild(n.createElement(\"br\"));let i=n.createRange();i.setStartAfter(r),i.collapse(!0),e.removeAllRanges(),e.addRange(i)}function M(e){e.done=!0;let t=e.element;t.removeEventListener(\"keydown\",T),t.removeEventListener(\"beforeinput\",N),t.removeEventListener(\"paste\",w),t.removeEventListener(\"drop\",R),t.removeEventListener(\"focusout\",F),t.removeEventListener(\"input\",C),t.removeAttribute(\"contenteditable\"),t.removeAttribute(\"role\"),t.removeAttribute(\"aria-label\"),t.classList.remove(\"ff-editing\"),e.badge?.remove(),o===e&&(o=null)}function L(){let e=o;if(!e||e.done)return;let t=D(e.element);M(e),u({type:\"formfeed:edit-commit\",token:e.token,items:t})}function S(e){let t=o;if(!t||t.done)return;let r=t.element;for(;r.firstChild;)r.removeChild(r.firstChild);for(let i of t.saved)r.appendChild(i);M(t),e&&u({type:\"formfeed:edit-cancel\",token:t.token})}}function D(a){let l=[],f=n=>{let o=l[l.length-1];o?.kind===\"text\"?o.text+=n:n&&l.push({kind:\"text\",text:n})},p=n=>{for(let o of Array.from(n.childNodes))if(o.nodeType===3)f(o.data);else if(o.nodeType===1){let d=o,u=d.getAttribute(\"data-ff-chip\");u!==null?l.push({kind:\"chip\",index:Number(u)}):d.tagName===\"BR\"?l.push({kind:\"break\"}):((d.tagName===\"DIV\"||d.tagName===\"P\")&&l.length&&l.push({kind:\"break\"}),p(d))}};for(p(a);l[l.length-1]?.kind===\"break\";)l.pop();return l}function O(a,l){return Array.from(a.querySelectorAll(\"[data-ff-layer]\")).map(f=>{let p=f.querySelector(\":scope > .ff-text\"),n=!1;if(p&&f.style.height!==\"auto\"){let o=l.getComputedStyle(f),d=f.clientHeight-(parseFloat(o.paddingTop)||0)-(parseFloat(o.paddingBottom)||0);n=o.overflow===\"hidden\"&&(p.scrollHeight>d+1||p.scrollWidth>p.clientWidth+1)}return{id:f.getAttribute(\"data-ff-layer\")??\"\",width:f.offsetWidth,height:f.offsetHeight,overflow:n}})}function P(a){let l=a.document,f=m=>{try{a.parent.postMessage(m,\"*\")}catch{}},p=m=>typeof m==\"string\"?l.querySelector(`[data-ff-layer=\"${m.replace(/\"/g,\"\")}\"]`):null,n=()=>{for(let m of Array.from(l.querySelectorAll(\"[data-ff-layer]\")))for(let s of[\"left\",\"top\",\"width\",\"height\",\"transform\"])m.style.removeProperty(s)},o=()=>{a.formfeedFit?.(),f({type:\"formfeed:ready\",layers:O(l,a)})};a.addEventListener(\"message\",m=>{if(m.source!==a.parent)return;let s=m.data;if(!(!s||typeof s.type!=\"string\")){if(s.type===\"formfeed:layer-style\"){let g=p(s.id);if(!g)return;let x=(v,E)=>{typeof E==\"number\"&&Number.isFinite(E)&&g.style.setProperty(v,`${E}px`)};x(\"left\",s.left),x(\"top\",s.top),x(\"width\",s.width),x(\"height\",s.height),typeof s.rotation==\"number\"&&Number.isFinite(s.rotation)&&g.style.setProperty(\"transform\",s.rotation?`rotate(${s.rotation}deg)`:\"none\")}else if(s.type===\"formfeed:layer-style-clear\")n();else if(s.type===\"formfeed:css\"&&typeof s.css==\"string\"){let g=l.querySelector('style[data-formfeed=\"template\"]');g&&(g.textContent=s.css),n(),o()}}}),H(a,{clicks:!1,live:!0});let d=l.fonts,u=()=>d?void d.ready.then(o):o();l.readyState===\"complete\"?u():a.addEventListener(\"load\",u)}P(window);})();";
|
|
7
|
+
/** Bundled from src/frame/audit.entry.ts. */
|
|
8
|
+
export declare const auditRuntime = "\"use strict\";(()=>{var I={\"document-title\":\"error\",\"image-alt\":\"error\",\"figure-name\":\"error\",\"heading-order\":\"error\",\"table-rows\":\"error\",\"table-cell-empty\":\"error\",\"masked-text\":\"error\",\"filtered-text\":\"warning\",\"document-language\":\"warning\",\"table-headers\":\"warning\",\"link-name\":\"warning\",\"generated-text\":\"warning\",\"fixed-text\":\"warning\",\"running-text\":\"warning\"};var S=120;var O=\".formfeed-chrome, .ff-running-header, .ff-running-footer\",_=\".pageNumber, .totalPages, .date, .title, .url, .ff-page-no, .ff-page-total\",k=new Set([\"script\",\"style\",\"template\",\"noscript\",\"head\"]),j=2e4,q=10,B=new Set([\"page\",\"pages\",\"of\",\"seite\",\"seiten\",\"von\",\"p\",\"s\"]),u=t=>(t??\"\").replace(/\\s+/g,\" \").trim(),D=t=>t.replace(/\\s+/g,\"\").toLowerCase(),$=t=>/[\\p{L}\\p{N}]/u.test(t),Y=/^data-(ref|id|split-(from|to|original)|(previous-|next-)?break-(before|after|inside)|(align-)?last-split-element|nth-of-type|counter-.+|page(-number)?|undisplayed|after-page|following|has-notes|children|item-num)$/;function X(t){let n=t.cloneNode(!1);n.removeAttribute(\"data-ff-src\"),n.removeAttribute(\"data-ff-edit\");let i=t.closest(\".pagedjs_page\")!==null;for(let s of Array.from(n.attributes))i&&Y.test(s.name)?n.removeAttribute(s.name):s.value.length>48&&n.setAttribute(s.name,`${s.value.slice(0,40)}\\u2026`);let o=n.outerHTML.replace(new RegExp(`</${t.tagName}>$`,\"i\"),\"\");return o.length>S?`${o.slice(0,S-1)}\\u2026`:o}function F(t,n={}){let i=t.document,o=i.body,s=[],d=new Set,a=n.findings!==!1,c=(e,r,l={})=>{if(!a)return;let m=r?.closest(\"[data-ff-src]\")?.getAttribute(\"data-ff-src\")??null,h=r?X(r):\"\",g=`${e}|${m??h}|${JSON.stringify(l)}`;d.has(g)||(d.add(g),s.push({code:e,severity:I[e],src:m,snippet:h,args:l}))},f=new WeakMap,A=e=>{let r=f.get(e);if(r!==void 0)return r;let l=t.getComputedStyle(e),m=l.display===\"none\"||l.visibility===\"hidden\"||l.visibility===\"collapse\"||e.parentElement!==null&&e.parentElement!==i.documentElement&&A(e.parentElement);return f.set(e,m),m},p=e=>e.closest('[aria-hidden=\"true\"]')!==null,E=e=>/^(presentation|none)$/.test(e.getAttribute(\"role\")??\"\"),H=e=>e.closest(O)!==null,y=e=>$(e.textContent??\"\"),x=e=>{let r=u(e.getAttribute(\"aria-label\"));return r||u((e.getAttribute(\"aria-labelledby\")??\"\").split(/\\s+/).filter(Boolean).map(l=>e.ownerDocument.getElementById(l)?.textContent??\"\").join(\" \"))},P=e=>x(e)||u(e.textContent)||u(Array.from(e.querySelectorAll(\"img[alt]\")).map(r=>r.getAttribute(\"alt\")).join(\" \"))||u(e.getAttribute(\"title\")),T=e=>{let r=e.getAttribute(\"href\")??\"\";return{href:r.startsWith(\"#\")?r:e.href??r,name:P(e)}};u(i.title)||c(\"document-title\",null),!u(i.documentElement.getAttribute(\"lang\"))&&!n.locale&&c(\"document-language\",null);let M=n.pages??(n.pageHeight&&n.pageHeight>0?Math.ceil(i.documentElement.scrollHeight/n.pageHeight):1),C=[],v=[],R={\"masked-text\":[],\"filtered-text\":[],\"fixed-text\":[]},w=(e,r)=>{R[e].some(l=>l.contains(r))||(R[e].push(r),c(e,r))},V=a&&ne(i),G=o?Array.from(o.querySelectorAll(\"*\")).slice(0,j):[];for(let e of G){let r=e.tagName.toLowerCase();if(k.has(r)||H(e)||A(e))continue;if(r===\"a\"&&e.hasAttribute(\"href\")){let g=T(e);C.push(g),!g.name&&!p(e)&&c(\"link-name\",e)}if(!a)continue;let l=t.getComputedStyle(e),m=l.getPropertyValue(\"mask-image\")||l.getPropertyValue(\"-webkit-mask-image\");if(m&&m!==\"none\"&&y(e)&&w(\"masked-text\",e),l.filter&&l.filter!==\"none\"&&y(e)&&w(\"filtered-text\",e),l.position===\"fixed\"&&M>1&&y(e)&&w(\"fixed-text\",e),V)for(let g of[\"::before\",\"::after\"]){let U=re(t.getComputedStyle(e,g).content);U&&c(\"generated-text\",e,{text:U})}if(p(e))continue;r===\"img\"&&!E(e)?e.hasAttribute(\"alt\")||x(e)||u(e.getAttribute(\"title\"))||c(\"image-alt\",e):(r===\"canvas\"||e.getAttribute(\"role\")===\"img\"&&r!==\"img\")&&(x(e)||u(e.getAttribute(\"title\"))||u(e.querySelector(\":scope > title\")?.textContent)||c(\"figure-name\",e,{tag:r}));let h=/^h[1-6]$/.test(r)?Number(r[1]):e.getAttribute(\"role\")===\"heading\"?Number(e.getAttribute(\"aria-level\"))||2:0;h&&v.push({element:e,level:h}),r===\"table\"&&!E(e)&&Q(e,c)}let b=0;for(let{element:e,level:r}of v)(b===0?r!==1:r>b+1)&&c(\"heading-order\",e,{level:r,previous:b}),b=r;let N=[],W=a&&o?D(J(o)):\"\",L=0;for(let e of[\"header\",\"footer\"])for(let r of z(i,e,n[e])){for(let l of Array.from(r.querySelectorAll(\"a[href]\")))N.push(T(l));if(a)for(let{text:l,element:m}of K(r)){if(L>=q||W.includes(D(l)))continue;let h=s.length;c(\"running-text\",m,{text:l.slice(0,80),part:e}),s.length>h&&L++}}return{findings:s,links:C,templateLinks:N}}function z(t,n,i){if(i!==void 0){if(!i.trim())return[];let o=new DOMParser().parseFromString(`<!doctype html><body>${i}</body>`,\"text/html\");return o.body?[o.body]:[]}return Array.from(t.querySelectorAll(`.ff-running-${n}, .formfeed-chrome[data-ff-chrome=\"${n}\"]`))}function J(t){let n=[],i=o=>{if(o.nodeType===3){n.push(o.nodeValue??\"\");return}if(o.nodeType!==1)return;let s=o;if(!(k.has(s.tagName.toLowerCase())||s.matches(O)))for(let d of Array.from(o.childNodes))i(d)};return i(t),n.join(\" \")}function K(t){let n=[],i=o=>{let s=o.tagName.toLowerCase();if(k.has(s)||o.matches(_))return;let d=Array.from(o.children).some(a=>a.matches(_));for(let a of Array.from(o.childNodes))if(a.nodeType===1)i(a);else if(a.nodeType===3&&!d)for(let c of(a.nodeValue??\"\").split(/\\s*[\u00B7\u2022|]\\s*|\\s{2,}|\\n/)){let f=u(c);(f.toLowerCase().match(/[\\p{L}\\p{N}]+/gu)??[]).some(p=>!B.has(p))&&n.push({text:f,element:o})}};return i(t),n}function Q(t,n){let i=Array.from(t.rows);if(!(t.querySelector('th, [role=\"columnheader\"], [role=\"rowheader\"]')!==null)){i.length>=2&&n(\"table-headers\",t);return}let s=te(i),d=s.find(c=>c!==s[0]);d!==void 0&&n(\"table-rows\",t,{first:s[0]??0,other:d});let a=i.flatMap(c=>Array.from(c.cells).filter(f=>f.tagName===\"TD\"&&ee(f)));a[0]&&n(\"table-cell-empty\",a[0],{count:a.length})}var Z='img[alt]:not([alt=\"\"]), svg, canvas, input, select, textarea, button, meter, progress';function ee(t){return!/[^ \\t\\n\\r\\f]/.test(t.textContent??\"\")&&t.querySelector(Z)===null}function te(t){let n=[];return t.map(i=>{let o=[],s=0,d=()=>{for(;(n[s]??0)>0;)o[s]=n[s]-1,s++};for(let a of Array.from(i.cells)){d();let c=Math.max(1,a.rowSpan||1)-1;for(let f=Math.max(1,a.colSpan||1);f>0;f--)o[s++]=c}d();for(let a=s;a<n.length;a++)(n[a]??0)>0&&(o[a]=n[a]-1,s=a+1);return n=o,s})}function ne(t){let n=i=>{for(let o of Array.from(i??[])){let s=o;if(s.selectorText&&/::?(before|after)/.test(s.selectorText)&&s.style?.content||o.cssRules&&n(o.cssRules))return!0}return!1};for(let i of Array.from(t.styleSheets))try{if(n(i.cssRules))return!0}catch{return!0}return!1}function re(t){if(!t||t===\"none\"||t===\"normal\")return\"\";let n=(t.match(/\"(?:[^\"\\\\]|\\\\.)*\"/g)??[]).map(o=>o.slice(1,-1).replace(/\\\\(.)/g,\"$1\"));if(/\\bcounters?\\(/.test(t))return u(t).slice(0,80);let i=u(n.join(\"\"));return $(i)?i.slice(0,80):\"\"}window.formfeedAudit=t=>F(window,t);})();";
|
|
@@ -18,6 +18,11 @@ export interface ChartSpec {
|
|
|
18
18
|
/** Colour of the single series; a list colours pie and doughnut slices one by one. */
|
|
19
19
|
color?: string | string[];
|
|
20
20
|
series?: ChartSeries[];
|
|
21
|
+
/**
|
|
22
|
+
* What the chart shows, in words: a screen reader says it in place of the picture, and a tagged
|
|
23
|
+
* PDF carries it as the figure's alternative text. A chart without one fails PDF/UA-1.
|
|
24
|
+
*/
|
|
25
|
+
alt?: string;
|
|
21
26
|
}
|
|
22
27
|
export interface ChartSeries {
|
|
23
28
|
label?: string;
|
|
@@ -18,6 +18,11 @@ export interface ChartSpec {
|
|
|
18
18
|
/** Colour of the single series; a list colours pie and doughnut slices one by one. */
|
|
19
19
|
color?: string | string[];
|
|
20
20
|
series?: ChartSeries[];
|
|
21
|
+
/**
|
|
22
|
+
* What the chart shows, in words: a screen reader says it in place of the picture, and a tagged
|
|
23
|
+
* PDF carries it as the figure's alternative text. A chart without one fails PDF/UA-1.
|
|
24
|
+
*/
|
|
25
|
+
alt?: string;
|
|
21
26
|
}
|
|
22
27
|
export interface ChartSeries {
|
|
23
28
|
label?: string;
|