draft-ole 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.ja.md +134 -0
- package/README.md +128 -0
- package/dist/chunk-5BNNDTRT.js +95 -0
- package/dist/chunk-5BNNDTRT.js.map +1 -0
- package/dist/chunk-STLTIBMA.js +7658 -0
- package/dist/chunk-STLTIBMA.js.map +1 -0
- package/dist/chunk-YK4Y4ENL.js +389 -0
- package/dist/chunk-YK4Y4ENL.js.map +1 -0
- package/dist/entries/app.cjs +7337 -0
- package/dist/entries/app.cjs.map +1 -0
- package/dist/entries/app.d.cts +115 -0
- package/dist/entries/app.d.ts +115 -0
- package/dist/entries/app.js +10 -0
- package/dist/entries/app.js.map +1 -0
- package/dist/entries/page.cjs +7558 -0
- package/dist/entries/page.cjs.map +1 -0
- package/dist/entries/page.d.cts +2 -0
- package/dist/entries/page.d.ts +2 -0
- package/dist/entries/page.js +30 -0
- package/dist/entries/page.js.map +1 -0
- package/dist/index.cjs +10524 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4700 -0
- package/dist/index.d.ts +4700 -0
- package/dist/index.js +2573 -0
- package/dist/index.js.map +1 -0
- package/dist/page-DylNkWXm.d.ts +366 -0
- package/dist/page-h3DPzs8l.d.cts +366 -0
- package/dist/transformer/call-detector.d.ts +38 -0
- package/dist/transformer/call-detector.d.ts.map +1 -0
- package/dist/transformer/call-detector.js +151 -0
- package/dist/transformer/call-detector.js.map +1 -0
- package/dist/transformer/command-injector.d.ts +27 -0
- package/dist/transformer/command-injector.d.ts.map +1 -0
- package/dist/transformer/command-injector.js +111 -0
- package/dist/transformer/command-injector.js.map +1 -0
- package/dist/transformer/diagnostic-reporter.d.ts +81 -0
- package/dist/transformer/diagnostic-reporter.d.ts.map +1 -0
- package/dist/transformer/diagnostic-reporter.js +330 -0
- package/dist/transformer/diagnostic-reporter.js.map +1 -0
- package/dist/transformer/each-scope-branch.d.ts +28 -0
- package/dist/transformer/each-scope-branch.d.ts.map +1 -0
- package/dist/transformer/each-scope-branch.js +95 -0
- package/dist/transformer/each-scope-branch.js.map +1 -0
- package/dist/transformer/each-state-rewriter.d.ts +117 -0
- package/dist/transformer/each-state-rewriter.d.ts.map +1 -0
- package/dist/transformer/each-state-rewriter.js +393 -0
- package/dist/transformer/each-state-rewriter.js.map +1 -0
- package/dist/transformer/format-diagnostics.d.ts +27 -0
- package/dist/transformer/format-diagnostics.d.ts.map +1 -0
- package/dist/transformer/format-diagnostics.js +50 -0
- package/dist/transformer/format-diagnostics.js.map +1 -0
- package/dist/transformer/handler-ir-extractor.d.ts +71 -0
- package/dist/transformer/handler-ir-extractor.d.ts.map +1 -0
- package/dist/transformer/handler-ir-extractor.js +171 -0
- package/dist/transformer/handler-ir-extractor.js.map +1 -0
- package/dist/transformer/handler-serializer.d.ts +56 -0
- package/dist/transformer/handler-serializer.d.ts.map +1 -0
- package/dist/transformer/handler-serializer.js +315 -0
- package/dist/transformer/handler-serializer.js.map +1 -0
- package/dist/transformer/helper-context-resolver.d.ts +180 -0
- package/dist/transformer/helper-context-resolver.d.ts.map +1 -0
- package/dist/transformer/helper-context-resolver.js +376 -0
- package/dist/transformer/helper-context-resolver.js.map +1 -0
- package/dist/transformer/helper-decl-utils.d.ts +28 -0
- package/dist/transformer/helper-decl-utils.d.ts.map +1 -0
- package/dist/transformer/helper-decl-utils.js +92 -0
- package/dist/transformer/helper-decl-utils.js.map +1 -0
- package/dist/transformer/identifier-collector.d.ts +28 -0
- package/dist/transformer/identifier-collector.d.ts.map +1 -0
- package/dist/transformer/identifier-collector.js +184 -0
- package/dist/transformer/identifier-collector.js.map +1 -0
- package/dist/transformer/index.d.ts +56 -0
- package/dist/transformer/index.d.ts.map +1 -0
- package/dist/transformer/index.js +333 -0
- package/dist/transformer/index.js.map +1 -0
- package/dist/transformer/inline-recovery.d.ts +109 -0
- package/dist/transformer/inline-recovery.d.ts.map +1 -0
- package/dist/transformer/inline-recovery.js +369 -0
- package/dist/transformer/inline-recovery.js.map +1 -0
- package/dist/transformer/label-injector.d.ts +105 -0
- package/dist/transformer/label-injector.d.ts.map +1 -0
- package/dist/transformer/label-injector.js +221 -0
- package/dist/transformer/label-injector.js.map +1 -0
- package/dist/transformer/package.json +3 -0
- package/dist/transformer/per-call-context.d.ts +95 -0
- package/dist/transformer/per-call-context.d.ts.map +1 -0
- package/dist/transformer/per-call-context.js +3 -0
- package/dist/transformer/per-call-context.js.map +1 -0
- package/dist/transformer/state-id-fallback.d.ts +85 -0
- package/dist/transformer/state-id-fallback.d.ts.map +1 -0
- package/dist/transformer/state-id-fallback.js +132 -0
- package/dist/transformer/state-id-fallback.js.map +1 -0
- package/dist/transformer/state-id-resolver.d.ts +104 -0
- package/dist/transformer/state-id-resolver.d.ts.map +1 -0
- package/dist/transformer/state-id-resolver.js +222 -0
- package/dist/transformer/state-id-resolver.js.map +1 -0
- package/dist/transformer/theme-class-detector.d.ts +47 -0
- package/dist/transformer/theme-class-detector.d.ts.map +1 -0
- package/dist/transformer/theme-class-detector.js +242 -0
- package/dist/transformer/theme-class-detector.js.map +1 -0
- package/dist/transformer/varname-resolver.d.ts +53 -0
- package/dist/transformer/varname-resolver.d.ts.map +1 -0
- package/dist/transformer/varname-resolver.js +231 -0
- package/dist/transformer/varname-resolver.js.map +1 -0
- package/dist/transformer/whitelist-registry.d.ts +68 -0
- package/dist/transformer/whitelist-registry.d.ts.map +1 -0
- package/dist/transformer/whitelist-registry.js +122 -0
- package/dist/transformer/whitelist-registry.js.map +1 -0
- package/dist/transformer/whitelist-validator.d.ts +59 -0
- package/dist/transformer/whitelist-validator.d.ts.map +1 -0
- package/dist/transformer/whitelist-validator.js +493 -0
- package/dist/transformer/whitelist-validator.js.map +1 -0
- package/dist/types-BXV3vhHS.d.cts +4590 -0
- package/dist/types-BXV3vhHS.d.ts +4590 -0
- package/package.json +121 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2573 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppDocument,
|
|
3
|
+
app
|
|
4
|
+
} from "./chunk-5BNNDTRT.js";
|
|
5
|
+
import {
|
|
6
|
+
Alignment,
|
|
7
|
+
AppSlot,
|
|
8
|
+
Button,
|
|
9
|
+
HStack,
|
|
10
|
+
Heading,
|
|
11
|
+
Image,
|
|
12
|
+
Link,
|
|
13
|
+
PageDocument,
|
|
14
|
+
Section,
|
|
15
|
+
Spacer,
|
|
16
|
+
Text as Text2,
|
|
17
|
+
VStack,
|
|
18
|
+
ZStackAlignment,
|
|
19
|
+
divider,
|
|
20
|
+
hstack,
|
|
21
|
+
page,
|
|
22
|
+
spacer,
|
|
23
|
+
vstack,
|
|
24
|
+
zstack
|
|
25
|
+
} from "./chunk-YK4Y4ENL.js";
|
|
26
|
+
import {
|
|
27
|
+
ARIA_ATTRIBUTE_KEYS,
|
|
28
|
+
BOOLEAN_ATTRIBUTE_KEYS,
|
|
29
|
+
BUTTON_TYPES,
|
|
30
|
+
Breakpoints,
|
|
31
|
+
CSSAnimation,
|
|
32
|
+
CSSBackground,
|
|
33
|
+
CSSBorder,
|
|
34
|
+
CSSFlex,
|
|
35
|
+
CSSFont,
|
|
36
|
+
CSSGrid,
|
|
37
|
+
CSSList,
|
|
38
|
+
CSSPropertyKey,
|
|
39
|
+
CSSSpacing,
|
|
40
|
+
CSSTable,
|
|
41
|
+
CSSText,
|
|
42
|
+
CSSTransform,
|
|
43
|
+
CSSVisibility,
|
|
44
|
+
CSSVisual,
|
|
45
|
+
CssConfig,
|
|
46
|
+
CssManager,
|
|
47
|
+
CssPositionMaker,
|
|
48
|
+
CssStyleManager,
|
|
49
|
+
DraftOleError,
|
|
50
|
+
DuplicateCssPropertyError,
|
|
51
|
+
ExportableError,
|
|
52
|
+
FileExporter,
|
|
53
|
+
HTMLFormatter,
|
|
54
|
+
HtmlAttribute,
|
|
55
|
+
HtmlStyle,
|
|
56
|
+
HtmlTag,
|
|
57
|
+
INPUT_TYPES,
|
|
58
|
+
JQueryHelper,
|
|
59
|
+
JQueryManager,
|
|
60
|
+
KEY_VALUE_ATTRIBUTE_KEYS,
|
|
61
|
+
PairType,
|
|
62
|
+
PseudoStyleBuilder,
|
|
63
|
+
SELF_CLOSING_TAGS,
|
|
64
|
+
SelfClosingType,
|
|
65
|
+
TAG_TYPES,
|
|
66
|
+
Text,
|
|
67
|
+
TextType,
|
|
68
|
+
__export,
|
|
69
|
+
a,
|
|
70
|
+
abbr,
|
|
71
|
+
address,
|
|
72
|
+
area,
|
|
73
|
+
article,
|
|
74
|
+
aside,
|
|
75
|
+
audio,
|
|
76
|
+
b,
|
|
77
|
+
base,
|
|
78
|
+
blockquote,
|
|
79
|
+
body,
|
|
80
|
+
br,
|
|
81
|
+
button,
|
|
82
|
+
canvas,
|
|
83
|
+
caption,
|
|
84
|
+
cite,
|
|
85
|
+
code,
|
|
86
|
+
col,
|
|
87
|
+
colgroup,
|
|
88
|
+
createBooleanValue,
|
|
89
|
+
createCustomValue,
|
|
90
|
+
createKeyValueValue,
|
|
91
|
+
createVanillaScript,
|
|
92
|
+
datalist,
|
|
93
|
+
dd,
|
|
94
|
+
decodeJsParamSentinel,
|
|
95
|
+
details,
|
|
96
|
+
dialog,
|
|
97
|
+
div,
|
|
98
|
+
djb2Hash,
|
|
99
|
+
dl,
|
|
100
|
+
dt,
|
|
101
|
+
em,
|
|
102
|
+
embed,
|
|
103
|
+
escapeHtml,
|
|
104
|
+
fieldset,
|
|
105
|
+
figcaption,
|
|
106
|
+
figure,
|
|
107
|
+
footer,
|
|
108
|
+
form,
|
|
109
|
+
generateScopedClassName,
|
|
110
|
+
getTagStructure,
|
|
111
|
+
guardDuplicateCssProperty,
|
|
112
|
+
h1,
|
|
113
|
+
h2,
|
|
114
|
+
h3,
|
|
115
|
+
h4,
|
|
116
|
+
h5,
|
|
117
|
+
h6,
|
|
118
|
+
head,
|
|
119
|
+
header,
|
|
120
|
+
hlUnitToCssString,
|
|
121
|
+
hr,
|
|
122
|
+
html,
|
|
123
|
+
i,
|
|
124
|
+
iframe,
|
|
125
|
+
img,
|
|
126
|
+
input,
|
|
127
|
+
isJsParam,
|
|
128
|
+
kbd,
|
|
129
|
+
label,
|
|
130
|
+
legend,
|
|
131
|
+
li,
|
|
132
|
+
link,
|
|
133
|
+
main,
|
|
134
|
+
mark,
|
|
135
|
+
meta,
|
|
136
|
+
nav,
|
|
137
|
+
normalizeClassNames,
|
|
138
|
+
noscript,
|
|
139
|
+
ol,
|
|
140
|
+
optgroup,
|
|
141
|
+
option,
|
|
142
|
+
output,
|
|
143
|
+
p,
|
|
144
|
+
picture,
|
|
145
|
+
pre,
|
|
146
|
+
q,
|
|
147
|
+
ref,
|
|
148
|
+
s,
|
|
149
|
+
samp,
|
|
150
|
+
sanitizeCssValue,
|
|
151
|
+
script,
|
|
152
|
+
section,
|
|
153
|
+
select,
|
|
154
|
+
small,
|
|
155
|
+
source,
|
|
156
|
+
span,
|
|
157
|
+
strong,
|
|
158
|
+
sub,
|
|
159
|
+
summary,
|
|
160
|
+
sup,
|
|
161
|
+
svg,
|
|
162
|
+
table,
|
|
163
|
+
tags,
|
|
164
|
+
tbody,
|
|
165
|
+
td,
|
|
166
|
+
textarea,
|
|
167
|
+
tfoot,
|
|
168
|
+
th,
|
|
169
|
+
thead,
|
|
170
|
+
time,
|
|
171
|
+
title,
|
|
172
|
+
tr,
|
|
173
|
+
track,
|
|
174
|
+
u,
|
|
175
|
+
ul,
|
|
176
|
+
varTag,
|
|
177
|
+
video,
|
|
178
|
+
wbr,
|
|
179
|
+
wrapDOMReady
|
|
180
|
+
} from "./chunk-STLTIBMA.js";
|
|
181
|
+
|
|
182
|
+
// src/html/attributes/attribute-builder-base.ts
|
|
183
|
+
var BaseAttributeBuilder = class {
|
|
184
|
+
/** Accumulated attributes (excluding class, which is handled separately) */
|
|
185
|
+
_attributes = [];
|
|
186
|
+
/** Accumulated class names (deduplicated and normalized on build) */
|
|
187
|
+
_classNames = [];
|
|
188
|
+
// ── Key-Value Helper ──
|
|
189
|
+
/**
|
|
190
|
+
* Adds a key-value HTML attribute.
|
|
191
|
+
*
|
|
192
|
+
* @param key - The attribute name
|
|
193
|
+
* @param value - The attribute value
|
|
194
|
+
* @returns This builder for method chaining
|
|
195
|
+
*
|
|
196
|
+
* @remarks
|
|
197
|
+
* This helper centralizes the keyValue attribute creation pattern.
|
|
198
|
+
* Subclasses may also use this helper for their own key-value attributes.
|
|
199
|
+
*/
|
|
200
|
+
addKeyValue(key, value) {
|
|
201
|
+
this._attributes.push(HtmlAttribute.keyValue(key, String(value)));
|
|
202
|
+
return this;
|
|
203
|
+
}
|
|
204
|
+
// ── Common Attributes ──
|
|
205
|
+
/**
|
|
206
|
+
* Sets the id attribute.
|
|
207
|
+
*
|
|
208
|
+
* @param id - The element ID
|
|
209
|
+
* @returns This builder for method chaining
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* builder.setId('main-content');
|
|
214
|
+
* // Produces: id="main-content"
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
setId(id) {
|
|
218
|
+
return this.addKeyValue("id", id);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Sets the title attribute (tooltip text).
|
|
222
|
+
*
|
|
223
|
+
* @param title - The tooltip text
|
|
224
|
+
* @returns This builder for method chaining
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* builder.setTitle('Click to expand');
|
|
229
|
+
* // Produces: title="Click to expand"
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
setTitle(title2) {
|
|
233
|
+
return this.addKeyValue("title", title2);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Sets the lang attribute (language code).
|
|
237
|
+
*
|
|
238
|
+
* @param lang - The language code (e.g., 'en', 'ja', 'fr')
|
|
239
|
+
* @returns This builder for method chaining
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* builder.setLang('ja');
|
|
244
|
+
* // Produces: lang="ja"
|
|
245
|
+
* ```
|
|
246
|
+
*/
|
|
247
|
+
setLang(lang) {
|
|
248
|
+
return this.addKeyValue("lang", lang);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Sets the role attribute (ARIA role).
|
|
252
|
+
*
|
|
253
|
+
* @param role - The ARIA role (e.g., 'button', 'navigation')
|
|
254
|
+
* @returns This builder for method chaining
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```typescript
|
|
258
|
+
* builder.setRole('navigation');
|
|
259
|
+
* // Produces: role="navigation"
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
setRole(role) {
|
|
263
|
+
return this.addKeyValue("role", role);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Sets the tabindex attribute.
|
|
267
|
+
*
|
|
268
|
+
* @param index - The tab order index (-1 for programmatically focusable, 0 for natural order)
|
|
269
|
+
* @returns This builder for method chaining
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```typescript
|
|
273
|
+
* builder.setTabindex(0); // Natural tab order
|
|
274
|
+
* builder.setTabindex(-1); // Programmatically focusable only
|
|
275
|
+
* ```
|
|
276
|
+
*/
|
|
277
|
+
setTabindex(index) {
|
|
278
|
+
return this.addKeyValue("tabindex", index);
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Sets the hidden boolean attribute.
|
|
282
|
+
*
|
|
283
|
+
* @param hidden - If true, adds the hidden attribute
|
|
284
|
+
* @returns This builder for method chaining
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```typescript
|
|
288
|
+
* builder.setHidden(true); // Produces: hidden
|
|
289
|
+
* builder.setHidden(false); // No attribute added
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
setHidden(hidden) {
|
|
293
|
+
if (hidden) {
|
|
294
|
+
this._attributes.push(HtmlAttribute.boolean("hidden"));
|
|
295
|
+
}
|
|
296
|
+
return this;
|
|
297
|
+
}
|
|
298
|
+
// ── Custom Attributes ──
|
|
299
|
+
/**
|
|
300
|
+
* Sets a custom data-* attribute.
|
|
301
|
+
*
|
|
302
|
+
* @param name - The data attribute name (without 'data-' prefix)
|
|
303
|
+
* @param value - The attribute value
|
|
304
|
+
* @returns This builder for method chaining
|
|
305
|
+
*
|
|
306
|
+
* @example
|
|
307
|
+
* ```typescript
|
|
308
|
+
* builder.setCustomAttribute('theme', 'dark');
|
|
309
|
+
* // Produces: data-theme="dark"
|
|
310
|
+
*
|
|
311
|
+
* builder.setCustomAttribute('user-id', '12345');
|
|
312
|
+
* // Produces: data-user-id="12345"
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
setCustomAttribute(name, value) {
|
|
316
|
+
this._attributes.push(HtmlAttribute.custom(name, value));
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
319
|
+
// ── ARIA Attributes ──
|
|
320
|
+
/**
|
|
321
|
+
* Sets the aria-label attribute.
|
|
322
|
+
*
|
|
323
|
+
* @param label - The accessible label text
|
|
324
|
+
* @returns This builder for method chaining
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* ```typescript
|
|
328
|
+
* builder.setAriaLabel('Close dialog');
|
|
329
|
+
* // Produces: aria-label="Close dialog"
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
setAriaLabel(label2) {
|
|
333
|
+
this._attributes.push(HtmlAttribute.ariaLabel(label2));
|
|
334
|
+
return this;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Sets the aria-hidden attribute.
|
|
338
|
+
*
|
|
339
|
+
* @param hidden - Whether the element should be hidden from assistive technologies
|
|
340
|
+
* @returns This builder for method chaining
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```typescript
|
|
344
|
+
* builder.setAriaHidden(true);
|
|
345
|
+
* // Produces: aria-hidden="true"
|
|
346
|
+
* ```
|
|
347
|
+
*/
|
|
348
|
+
setAriaHidden(hidden) {
|
|
349
|
+
this._attributes.push(HtmlAttribute.ariaHidden(hidden));
|
|
350
|
+
return this;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Sets the aria-expanded attribute.
|
|
354
|
+
*
|
|
355
|
+
* @param expanded - Whether the element is currently expanded
|
|
356
|
+
* @returns This builder for method chaining
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* builder.setAriaExpanded(false);
|
|
361
|
+
* // Produces: aria-expanded="false"
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
setAriaExpanded(expanded) {
|
|
365
|
+
this._attributes.push(HtmlAttribute.ariaExpanded(expanded));
|
|
366
|
+
return this;
|
|
367
|
+
}
|
|
368
|
+
// ── Class Management (4 Patterns) ──
|
|
369
|
+
/**
|
|
370
|
+
* Adds one or more class names (variadic pattern).
|
|
371
|
+
*
|
|
372
|
+
* @param classNames - One or more class name strings
|
|
373
|
+
* @returns This builder for method chaining
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```typescript
|
|
377
|
+
* builder.addClass('btn', 'btn-primary', 'btn-large');
|
|
378
|
+
* // Accumulates: ['btn', 'btn-primary', 'btn-large']
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
addClass(...classNames) {
|
|
382
|
+
this._classNames.push(...classNames);
|
|
383
|
+
return this;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Adds class names from an array (array pattern).
|
|
387
|
+
*
|
|
388
|
+
* @param classNames - Array of class name strings
|
|
389
|
+
* @returns This builder for method chaining
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```typescript
|
|
393
|
+
* const classes = ['container', 'mx-auto', 'px-4'];
|
|
394
|
+
* builder.addClasses(classes);
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
addClasses(classNames) {
|
|
398
|
+
this._classNames.push(...classNames);
|
|
399
|
+
return this;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Conditionally adds a class name (conditional pattern).
|
|
403
|
+
*
|
|
404
|
+
* @param className - The class name to add
|
|
405
|
+
* @param condition - Only adds the class if this is true
|
|
406
|
+
* @returns This builder for method chaining
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```typescript
|
|
410
|
+
* const isActive = true;
|
|
411
|
+
* builder.addClassWhen('active', isActive); // Adds 'active'
|
|
412
|
+
* builder.addClassWhen('disabled', false); // Doesn't add
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
415
|
+
addClassWhen(className, condition) {
|
|
416
|
+
if (condition) {
|
|
417
|
+
this._classNames.push(className);
|
|
418
|
+
}
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Adds classes from a toggle map (toggle pattern).
|
|
423
|
+
*
|
|
424
|
+
* @param classMap - Object mapping class names to boolean flags
|
|
425
|
+
* @returns This builder for method chaining
|
|
426
|
+
*
|
|
427
|
+
* @remarks
|
|
428
|
+
* Only class names with `true` values are added.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* builder.addClassesToggle({
|
|
433
|
+
* 'btn-primary': isPrimary,
|
|
434
|
+
* 'btn-disabled': isDisabled,
|
|
435
|
+
* 'btn-large': isLarge
|
|
436
|
+
* });
|
|
437
|
+
* // Adds only classes where the value is true
|
|
438
|
+
* ```
|
|
439
|
+
*/
|
|
440
|
+
addClassesToggle(classMap) {
|
|
441
|
+
for (const [name, enabled] of Object.entries(classMap)) {
|
|
442
|
+
if (enabled) {
|
|
443
|
+
this._classNames.push(name);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return this;
|
|
447
|
+
}
|
|
448
|
+
// ── Build ──
|
|
449
|
+
/**
|
|
450
|
+
* Builds and returns the accumulated attribute array.
|
|
451
|
+
*
|
|
452
|
+
* @returns Array of HtmlAttribute instances
|
|
453
|
+
*
|
|
454
|
+
* @remarks
|
|
455
|
+
* If any class names were added, they are normalized (trimmed, deduplicated)
|
|
456
|
+
* and merged into a single class attribute using {@link normalizeClassNames}.
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```typescript
|
|
460
|
+
* const attrs = new BaseAttributeBuilder()
|
|
461
|
+
* .setId('main')
|
|
462
|
+
* .addClass('btn', 'btn-primary', 'btn')
|
|
463
|
+
* .build();
|
|
464
|
+
* // Returns: [
|
|
465
|
+
* // HtmlAttribute { key: 'id', ... },
|
|
466
|
+
* // HtmlAttribute { key: 'class', value: 'btn btn-primary' }
|
|
467
|
+
* // ]
|
|
468
|
+
* ```
|
|
469
|
+
*/
|
|
470
|
+
build() {
|
|
471
|
+
const result = [...this._attributes];
|
|
472
|
+
if (this._classNames.length > 0) {
|
|
473
|
+
result.push(HtmlAttribute.className(...this._classNames));
|
|
474
|
+
}
|
|
475
|
+
return result;
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
// src/html/attributes/attribute-builder-form.ts
|
|
480
|
+
var FormAttributeBuilder = class extends BaseAttributeBuilder {
|
|
481
|
+
/**
|
|
482
|
+
* Sets the action attribute (form submission URL).
|
|
483
|
+
*
|
|
484
|
+
* @param action - The URL where the form data will be sent
|
|
485
|
+
* @returns This builder for method chaining
|
|
486
|
+
*
|
|
487
|
+
* @example
|
|
488
|
+
* ```typescript
|
|
489
|
+
* builder.setAction('/api/submit');
|
|
490
|
+
* // Produces: action="/api/submit"
|
|
491
|
+
* ```
|
|
492
|
+
*/
|
|
493
|
+
setAction(action) {
|
|
494
|
+
return this.addKeyValue("action", action);
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Sets the method attribute (HTTP method).
|
|
498
|
+
*
|
|
499
|
+
* @param method - The HTTP method ('get' or 'post')
|
|
500
|
+
* @returns This builder for method chaining
|
|
501
|
+
*
|
|
502
|
+
* @example
|
|
503
|
+
* ```typescript
|
|
504
|
+
* builder.setMethod('post');
|
|
505
|
+
* // Produces: method="post"
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
setMethod(method) {
|
|
509
|
+
return this.addKeyValue("method", method);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Sets the enctype attribute (encoding type).
|
|
513
|
+
*
|
|
514
|
+
* @param enctype - The encoding type (e.g., 'multipart/form-data', 'application/x-www-form-urlencoded')
|
|
515
|
+
* @returns This builder for method chaining
|
|
516
|
+
*
|
|
517
|
+
* @remarks
|
|
518
|
+
* Common values:
|
|
519
|
+
* - 'application/x-www-form-urlencoded' (default)
|
|
520
|
+
* - 'multipart/form-data' (for file uploads)
|
|
521
|
+
* - 'text/plain'
|
|
522
|
+
*
|
|
523
|
+
* @example
|
|
524
|
+
* ```typescript
|
|
525
|
+
* builder.setEnctype('multipart/form-data');
|
|
526
|
+
* // Produces: enctype="multipart/form-data"
|
|
527
|
+
* ```
|
|
528
|
+
*/
|
|
529
|
+
setEnctype(enctype) {
|
|
530
|
+
return this.addKeyValue("enctype", enctype);
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
var InputAttributeBuilder = class extends BaseAttributeBuilder {
|
|
534
|
+
/**
|
|
535
|
+
* Sets the type attribute for the input element.
|
|
536
|
+
*
|
|
537
|
+
* @param type - A valid HTML input type
|
|
538
|
+
* @returns This builder for method chaining
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```typescript
|
|
542
|
+
* builder.setInputType('email'); // Produces: type="email"
|
|
543
|
+
* builder.setInputType('password'); // Produces: type="password"
|
|
544
|
+
* builder.setInputType('checkbox'); // Produces: type="checkbox"
|
|
545
|
+
* ```
|
|
546
|
+
*
|
|
547
|
+
* @see {@link InputType} for all valid types
|
|
548
|
+
*/
|
|
549
|
+
setInputType(type) {
|
|
550
|
+
this._attributes.push(HtmlAttribute.inputType(type));
|
|
551
|
+
return this;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Sets the placeholder attribute.
|
|
555
|
+
*
|
|
556
|
+
* @param placeholder - The placeholder text
|
|
557
|
+
* @returns This builder for method chaining
|
|
558
|
+
*
|
|
559
|
+
* @example
|
|
560
|
+
* ```typescript
|
|
561
|
+
* builder.setPlaceholder('Enter your email address');
|
|
562
|
+
* // Produces: placeholder="Enter your email address"
|
|
563
|
+
* ```
|
|
564
|
+
*/
|
|
565
|
+
setPlaceholder(placeholder) {
|
|
566
|
+
return this.addKeyValue("placeholder", placeholder);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Sets the required boolean attribute.
|
|
570
|
+
*
|
|
571
|
+
* @param required - If true, adds the required attribute
|
|
572
|
+
* @returns This builder for method chaining
|
|
573
|
+
*
|
|
574
|
+
* @example
|
|
575
|
+
* ```typescript
|
|
576
|
+
* builder.setRequired(true); // Produces: required
|
|
577
|
+
* builder.setRequired(false); // No attribute added
|
|
578
|
+
* ```
|
|
579
|
+
*/
|
|
580
|
+
setRequired(required) {
|
|
581
|
+
if (required) {
|
|
582
|
+
this._attributes.push(HtmlAttribute.boolean("required"));
|
|
583
|
+
}
|
|
584
|
+
return this;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Sets the pattern attribute (validation regex).
|
|
588
|
+
*
|
|
589
|
+
* @param pattern - A regular expression pattern for validation
|
|
590
|
+
* @returns This builder for method chaining
|
|
591
|
+
*
|
|
592
|
+
* @remarks
|
|
593
|
+
* The pattern is matched against the entire input value (implicit ^ and $).
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
* ```typescript
|
|
597
|
+
* // Require at least one uppercase, one lowercase, one digit
|
|
598
|
+
* builder.setPattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).{8,}$');
|
|
599
|
+
*
|
|
600
|
+
* // Require specific format
|
|
601
|
+
* builder.setPattern('[0-9]{3}-[0-9]{4}'); // Matches: 123-4567
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
setPattern(pattern) {
|
|
605
|
+
return this.addKeyValue("pattern", pattern);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Sets the minlength attribute.
|
|
609
|
+
*
|
|
610
|
+
* @param length - Minimum number of characters required
|
|
611
|
+
* @returns This builder for method chaining
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```typescript
|
|
615
|
+
* builder.setMinLength(8);
|
|
616
|
+
* // Produces: minlength="8"
|
|
617
|
+
* ```
|
|
618
|
+
*/
|
|
619
|
+
setMinLength(length) {
|
|
620
|
+
return this.addKeyValue("minlength", length);
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Sets the maxlength attribute.
|
|
624
|
+
*
|
|
625
|
+
* @param length - Maximum number of characters allowed
|
|
626
|
+
* @returns This builder for method chaining
|
|
627
|
+
*
|
|
628
|
+
* @example
|
|
629
|
+
* ```typescript
|
|
630
|
+
* builder.setMaxLength(100);
|
|
631
|
+
* // Produces: maxlength="100"
|
|
632
|
+
* ```
|
|
633
|
+
*/
|
|
634
|
+
setMaxLength(length) {
|
|
635
|
+
return this.addKeyValue("maxlength", length);
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
var ButtonAttributeBuilder = class extends BaseAttributeBuilder {
|
|
639
|
+
/**
|
|
640
|
+
* Sets the type attribute for the button element.
|
|
641
|
+
*
|
|
642
|
+
* @param type - The button type ('submit', 'reset', or 'button')
|
|
643
|
+
* @returns This builder for method chaining
|
|
644
|
+
*
|
|
645
|
+
* @remarks
|
|
646
|
+
* - 'submit' - Submits the form (default if inside a form)
|
|
647
|
+
* - 'reset' - Resets form fields to their initial values
|
|
648
|
+
* - 'button' - No default behavior (use for custom JavaScript)
|
|
649
|
+
*
|
|
650
|
+
* @example
|
|
651
|
+
* ```typescript
|
|
652
|
+
* builder.setButtonType('submit');
|
|
653
|
+
* // Produces: type="submit"
|
|
654
|
+
*
|
|
655
|
+
* builder.setButtonType('button');
|
|
656
|
+
* // Produces: type="button"
|
|
657
|
+
* // Good for buttons that trigger JavaScript, not form submission
|
|
658
|
+
* ```
|
|
659
|
+
*
|
|
660
|
+
* @see {@link ButtonType} for all valid types
|
|
661
|
+
*/
|
|
662
|
+
setButtonType(type) {
|
|
663
|
+
this._attributes.push(HtmlAttribute.buttonType(type));
|
|
664
|
+
return this;
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
// src/html/attributes/attribute-builder-media.ts
|
|
669
|
+
var ImageAttributeBuilder = class extends BaseAttributeBuilder {
|
|
670
|
+
/**
|
|
671
|
+
* Sets the src attribute (image source URL).
|
|
672
|
+
*
|
|
673
|
+
* @param src - The URL of the image
|
|
674
|
+
* @returns This builder for method chaining
|
|
675
|
+
*
|
|
676
|
+
* @example
|
|
677
|
+
* ```typescript
|
|
678
|
+
* builder.setSrc('/images/logo.png');
|
|
679
|
+
* // Produces: src="/images/logo.png"
|
|
680
|
+
*
|
|
681
|
+
* builder.setSrc('https://example.com/photo.jpg');
|
|
682
|
+
* // Produces: src="https://example.com/photo.jpg"
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
setSrc(src) {
|
|
686
|
+
return this.addKeyValue("src", src);
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Sets the alt attribute (alternative text).
|
|
690
|
+
*
|
|
691
|
+
* @param alt - Descriptive text for the image (important for accessibility)
|
|
692
|
+
* @returns This builder for method chaining
|
|
693
|
+
*
|
|
694
|
+
* @remarks
|
|
695
|
+
* The alt attribute is crucial for accessibility. It should:
|
|
696
|
+
* - Describe the image content for screen readers
|
|
697
|
+
* - Be empty ("") for decorative images
|
|
698
|
+
* - Not include "image of" or "picture of"
|
|
699
|
+
*
|
|
700
|
+
* @example
|
|
701
|
+
* ```typescript
|
|
702
|
+
* builder.setAlt('Company logo');
|
|
703
|
+
* // Produces: alt="Company logo"
|
|
704
|
+
*
|
|
705
|
+
* builder.setAlt(''); // Decorative image
|
|
706
|
+
* // Produces: alt=""
|
|
707
|
+
* ```
|
|
708
|
+
*/
|
|
709
|
+
setAlt(alt) {
|
|
710
|
+
return this.addKeyValue("alt", alt);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Sets the width attribute.
|
|
714
|
+
*
|
|
715
|
+
* @param width - Image width in pixels (number or string)
|
|
716
|
+
* @returns This builder for method chaining
|
|
717
|
+
*
|
|
718
|
+
* @remarks
|
|
719
|
+
* Setting explicit width and height helps prevent layout shift during page load.
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```typescript
|
|
723
|
+
* builder.setWidth(800); // Produces: width="800"
|
|
724
|
+
* builder.setWidth('100%'); // Produces: width="100%"
|
|
725
|
+
* ```
|
|
726
|
+
*/
|
|
727
|
+
setWidth(width) {
|
|
728
|
+
return this.addKeyValue("width", width);
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Sets the height attribute.
|
|
732
|
+
*
|
|
733
|
+
* @param height - Image height in pixels (number or string)
|
|
734
|
+
* @returns This builder for method chaining
|
|
735
|
+
*
|
|
736
|
+
* @remarks
|
|
737
|
+
* Setting explicit width and height helps prevent layout shift during page load.
|
|
738
|
+
*
|
|
739
|
+
* @example
|
|
740
|
+
* ```typescript
|
|
741
|
+
* builder.setHeight(600); // Produces: height="600"
|
|
742
|
+
* builder.setHeight('auto'); // Produces: height="auto"
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
745
|
+
setHeight(height) {
|
|
746
|
+
return this.addKeyValue("height", height);
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* Sets the loading attribute (lazy loading strategy).
|
|
750
|
+
*
|
|
751
|
+
* @param loading - Loading strategy ('lazy' or 'eager')
|
|
752
|
+
* @returns This builder for method chaining
|
|
753
|
+
*
|
|
754
|
+
* @remarks
|
|
755
|
+
* - 'lazy' - Defer loading until the image is near the viewport (improves performance)
|
|
756
|
+
* - 'eager' - Load immediately (default browser behavior)
|
|
757
|
+
*
|
|
758
|
+
* @example
|
|
759
|
+
* ```typescript
|
|
760
|
+
* builder.setLoading('lazy');
|
|
761
|
+
* // Produces: loading="lazy"
|
|
762
|
+
* // Good for below-the-fold images
|
|
763
|
+
*
|
|
764
|
+
* builder.setLoading('eager');
|
|
765
|
+
* // Produces: loading="eager"
|
|
766
|
+
* // Good for above-the-fold images
|
|
767
|
+
* ```
|
|
768
|
+
*/
|
|
769
|
+
setLoading(loading) {
|
|
770
|
+
return this.addKeyValue("loading", loading);
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
var LinkAttributeBuilder = class extends BaseAttributeBuilder {
|
|
774
|
+
/**
|
|
775
|
+
* Sets the href attribute (link destination).
|
|
776
|
+
*
|
|
777
|
+
* @param href - The URL of the linked resource
|
|
778
|
+
* @returns This builder for method chaining
|
|
779
|
+
*
|
|
780
|
+
* @example
|
|
781
|
+
* ```typescript
|
|
782
|
+
* builder.setHref('/about');
|
|
783
|
+
* // Produces: href="/about"
|
|
784
|
+
*
|
|
785
|
+
* builder.setHref('https://example.com');
|
|
786
|
+
* // Produces: href="https://example.com"
|
|
787
|
+
*
|
|
788
|
+
* builder.setHref('#section-2');
|
|
789
|
+
* // Produces: href="#section-2"
|
|
790
|
+
* ```
|
|
791
|
+
*/
|
|
792
|
+
setHref(href) {
|
|
793
|
+
return this.addKeyValue("href", href);
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Sets the rel attribute (relationship).
|
|
797
|
+
*
|
|
798
|
+
* @param rel - The relationship type(s) (space-separated)
|
|
799
|
+
* @returns This builder for method chaining
|
|
800
|
+
*
|
|
801
|
+
* @remarks
|
|
802
|
+
* Common values:
|
|
803
|
+
* - 'stylesheet' - CSS stylesheet
|
|
804
|
+
* - 'icon' - Favicon
|
|
805
|
+
* - 'noopener' - Prevents window.opener access (security)
|
|
806
|
+
* - 'noreferrer' - Prevents referer header
|
|
807
|
+
* - 'nofollow' - Search engine hint
|
|
808
|
+
*
|
|
809
|
+
* @example
|
|
810
|
+
* ```typescript
|
|
811
|
+
* builder.setRel('stylesheet');
|
|
812
|
+
* // Produces: rel="stylesheet"
|
|
813
|
+
*
|
|
814
|
+
* builder.setRel('noopener noreferrer');
|
|
815
|
+
* // Produces: rel="noopener noreferrer"
|
|
816
|
+
* ```
|
|
817
|
+
*/
|
|
818
|
+
setRel(rel) {
|
|
819
|
+
return this.addKeyValue("rel", rel);
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Sets the type attribute (MIME type).
|
|
823
|
+
*
|
|
824
|
+
* @param type - The MIME type of the linked resource
|
|
825
|
+
* @returns This builder for method chaining
|
|
826
|
+
*
|
|
827
|
+
* @example
|
|
828
|
+
* ```typescript
|
|
829
|
+
* builder.setType('text/css');
|
|
830
|
+
* // Produces: type="text/css"
|
|
831
|
+
*
|
|
832
|
+
* builder.setType('application/rss+xml');
|
|
833
|
+
* // Produces: type="application/rss+xml"
|
|
834
|
+
* ```
|
|
835
|
+
*/
|
|
836
|
+
setType(type) {
|
|
837
|
+
return this.addKeyValue("type", type);
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Sets the media attribute (media query).
|
|
841
|
+
*
|
|
842
|
+
* @param media - CSS media query for when the link applies
|
|
843
|
+
* @returns This builder for method chaining
|
|
844
|
+
*
|
|
845
|
+
* @remarks
|
|
846
|
+
* Used primarily with `<link>` elements to conditionally load resources.
|
|
847
|
+
*
|
|
848
|
+
* @example
|
|
849
|
+
* ```typescript
|
|
850
|
+
* builder.setMedia('screen and (min-width: 768px)');
|
|
851
|
+
* // Produces: media="screen and (min-width: 768px)"
|
|
852
|
+
*
|
|
853
|
+
* builder.setMedia('print');
|
|
854
|
+
* // Produces: media="print"
|
|
855
|
+
* ```
|
|
856
|
+
*/
|
|
857
|
+
setMedia(media2) {
|
|
858
|
+
return this.addKeyValue("media", media2);
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
// src/css/manager/default-css-manager.ts
|
|
863
|
+
var noopLayout = {
|
|
864
|
+
tagPath: "",
|
|
865
|
+
get description() {
|
|
866
|
+
return {};
|
|
867
|
+
},
|
|
868
|
+
updateLLRegister(_register) {
|
|
869
|
+
},
|
|
870
|
+
getLLRegister() {
|
|
871
|
+
return void 0;
|
|
872
|
+
},
|
|
873
|
+
placeAbsoluteWith(_closure) {
|
|
874
|
+
},
|
|
875
|
+
placeRelativeWith(_closure) {
|
|
876
|
+
},
|
|
877
|
+
placeStaticWith(_closure) {
|
|
878
|
+
},
|
|
879
|
+
placeFixedWith(_closure) {
|
|
880
|
+
},
|
|
881
|
+
render() {
|
|
882
|
+
return "";
|
|
883
|
+
}
|
|
884
|
+
};
|
|
885
|
+
var noopStyleManager = {
|
|
886
|
+
get style() {
|
|
887
|
+
return { render() {
|
|
888
|
+
return "";
|
|
889
|
+
} };
|
|
890
|
+
},
|
|
891
|
+
getFontSizeUnit() {
|
|
892
|
+
return void 0;
|
|
893
|
+
},
|
|
894
|
+
render() {
|
|
895
|
+
return "";
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
var DefaultCssManager = class {
|
|
899
|
+
/** タグの階層パス(常に空文字列) */
|
|
900
|
+
tagPath = "";
|
|
901
|
+
/** no-opレイアウトマネージャー */
|
|
902
|
+
layout = noopLayout;
|
|
903
|
+
/** no-opスタイルマネージャー */
|
|
904
|
+
styleManager = noopStyleManager;
|
|
905
|
+
/**
|
|
906
|
+
* タグパスを更新する(no-op)
|
|
907
|
+
* @param newPath - 新しいタグパス
|
|
908
|
+
*/
|
|
909
|
+
updateTagPath(newPath) {
|
|
910
|
+
this.tagPath = newPath;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* 遅延レイアウトレジスタを更新する(no-op)
|
|
914
|
+
* @param _register - 遅延レイアウトレジスタ
|
|
915
|
+
*/
|
|
916
|
+
updateLazyLayoutRegister(_register) {
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* CSS文字列をレンダリングする(常に空文字列を返す)
|
|
920
|
+
* @returns 空文字列
|
|
921
|
+
*/
|
|
922
|
+
render() {
|
|
923
|
+
return "";
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* スコープドCSS文字列をレンダリングする(常に空文字列を返す)
|
|
927
|
+
* @returns 空文字列
|
|
928
|
+
*/
|
|
929
|
+
renderCss() {
|
|
930
|
+
return "";
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* @media ルールを追加する(no-op)
|
|
934
|
+
* @param _breakpointPx - ブレークポイント(px 値)
|
|
935
|
+
* @param _props - 追加するCSSプロパティのマップ
|
|
936
|
+
*/
|
|
937
|
+
addMediaRule(_breakpointPx, _props) {
|
|
938
|
+
}
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
// src/css/style/color/css-color-name.ts
|
|
942
|
+
var CSSColorName = {
|
|
943
|
+
// 基本色
|
|
944
|
+
black: "black",
|
|
945
|
+
white: "white",
|
|
946
|
+
red: "red",
|
|
947
|
+
green: "green",
|
|
948
|
+
blue: "blue",
|
|
949
|
+
yellow: "yellow",
|
|
950
|
+
cyan: "cyan",
|
|
951
|
+
magenta: "magenta",
|
|
952
|
+
orange: "orange",
|
|
953
|
+
pink: "pink",
|
|
954
|
+
purple: "purple",
|
|
955
|
+
brown: "brown",
|
|
956
|
+
// グレー系
|
|
957
|
+
gray: "gray",
|
|
958
|
+
grey: "grey",
|
|
959
|
+
darkGray: "darkgray",
|
|
960
|
+
darkGrey: "darkgrey",
|
|
961
|
+
lightGray: "lightgray",
|
|
962
|
+
lightGrey: "lightgrey",
|
|
963
|
+
dimGray: "dimgray",
|
|
964
|
+
dimGrey: "dimgrey",
|
|
965
|
+
silver: "silver",
|
|
966
|
+
// 拡張色
|
|
967
|
+
navy: "navy",
|
|
968
|
+
teal: "teal",
|
|
969
|
+
maroon: "maroon",
|
|
970
|
+
olive: "olive",
|
|
971
|
+
lime: "lime",
|
|
972
|
+
aqua: "aqua",
|
|
973
|
+
fuchsia: "fuchsia",
|
|
974
|
+
coral: "coral",
|
|
975
|
+
salmon: "salmon",
|
|
976
|
+
gold: "gold",
|
|
977
|
+
indigo: "indigo",
|
|
978
|
+
violet: "violet",
|
|
979
|
+
crimson: "crimson",
|
|
980
|
+
turquoise: "turquoise",
|
|
981
|
+
// CSS特殊キーワード
|
|
982
|
+
transparent: "transparent",
|
|
983
|
+
currentColor: "currentColor",
|
|
984
|
+
inherit: "inherit"
|
|
985
|
+
};
|
|
986
|
+
var CSS_COLOR_NAME_VALUES = new Set(
|
|
987
|
+
Object.values(CSSColorName)
|
|
988
|
+
);
|
|
989
|
+
|
|
990
|
+
// src/css/style/color/css-color.ts
|
|
991
|
+
var HEX_PATTERN = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
992
|
+
var RGB_PATTERN = /^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/;
|
|
993
|
+
var RGBA_PATTERN = /^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*[\d.]+\s*\)$/;
|
|
994
|
+
var CSSColor = class _CSSColor {
|
|
995
|
+
value;
|
|
996
|
+
/**
|
|
997
|
+
* @internal
|
|
998
|
+
* コンストラクタはプライベート。ファクトリメソッドを使用すること。
|
|
999
|
+
*/
|
|
1000
|
+
constructor(value) {
|
|
1001
|
+
this.value = value;
|
|
1002
|
+
}
|
|
1003
|
+
// ── ファクトリメソッド ──
|
|
1004
|
+
/**
|
|
1005
|
+
* HEX値から CSSColor を生成する
|
|
1006
|
+
*
|
|
1007
|
+
* @param value - HEX色値('#RGB', '#RRGGBB', '#RRGGBBAA' 形式)
|
|
1008
|
+
* @returns CSSColor インスタンス
|
|
1009
|
+
*
|
|
1010
|
+
* @example
|
|
1011
|
+
* ```ts
|
|
1012
|
+
* CSSColor.hex('#f00'); // → "#f00" (短縮形)
|
|
1013
|
+
* CSSColor.hex('#ff0000'); // → "#ff0000"
|
|
1014
|
+
* CSSColor.hex('#ff0000ff'); // → "#ff0000ff" (アルファ付き)
|
|
1015
|
+
* ```
|
|
1016
|
+
*/
|
|
1017
|
+
static hex(value) {
|
|
1018
|
+
return new _CSSColor(value);
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* RGB値から CSSColor を生成する
|
|
1022
|
+
*
|
|
1023
|
+
* @param r - Red (0-255)
|
|
1024
|
+
* @param g - Green (0-255)
|
|
1025
|
+
* @param b - Blue (0-255)
|
|
1026
|
+
* @returns CSSColor インスタンス
|
|
1027
|
+
*
|
|
1028
|
+
* @example
|
|
1029
|
+
* ```ts
|
|
1030
|
+
* CSSColor.rgb(255, 0, 0); // → "rgb(255, 0, 0)"
|
|
1031
|
+
* ```
|
|
1032
|
+
*/
|
|
1033
|
+
static rgb(r, g, b2) {
|
|
1034
|
+
return new _CSSColor(`rgb(${r}, ${g}, ${b2})`);
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* RGBA値から CSSColor を生成する
|
|
1038
|
+
*
|
|
1039
|
+
* @param r - Red (0-255)
|
|
1040
|
+
* @param g - Green (0-255)
|
|
1041
|
+
* @param b - Blue (0-255)
|
|
1042
|
+
* @param a - Alpha (0-1)
|
|
1043
|
+
* @returns CSSColor インスタンス
|
|
1044
|
+
*
|
|
1045
|
+
* @example
|
|
1046
|
+
* ```ts
|
|
1047
|
+
* CSSColor.rgba(255, 0, 0, 0.5); // → "rgba(255, 0, 0, 0.5)"
|
|
1048
|
+
* ```
|
|
1049
|
+
*/
|
|
1050
|
+
static rgba(r, g, b2, a2) {
|
|
1051
|
+
return new _CSSColor(`rgba(${r}, ${g}, ${b2}, ${a2})`);
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* CSS標準色名から CSSColor を生成する
|
|
1055
|
+
*
|
|
1056
|
+
* @param name - CSS標準色名({@link CSSColorNameValue})
|
|
1057
|
+
* @returns CSSColor インスタンス
|
|
1058
|
+
*
|
|
1059
|
+
* @example
|
|
1060
|
+
* ```ts
|
|
1061
|
+
* CSSColor.named('red');
|
|
1062
|
+
* CSSColor.named('transparent');
|
|
1063
|
+
* CSSColor.named('currentColor');
|
|
1064
|
+
* ```
|
|
1065
|
+
*/
|
|
1066
|
+
static named(name) {
|
|
1067
|
+
return new _CSSColor(name);
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* 任意のCSS色文字列から CSSColor を生成する
|
|
1071
|
+
*
|
|
1072
|
+
* hsl(), var(), カスタムプロパティなど、任意のCSS色表現に対応。
|
|
1073
|
+
*
|
|
1074
|
+
* @param value - 任意のCSS色文字列
|
|
1075
|
+
* @returns CSSColor インスタンス
|
|
1076
|
+
*
|
|
1077
|
+
* @example
|
|
1078
|
+
* ```ts
|
|
1079
|
+
* CSSColor.raw('hsl(0, 100%, 50%)');
|
|
1080
|
+
* CSSColor.raw('var(--primary-color)');
|
|
1081
|
+
* CSSColor.raw('currentColor');
|
|
1082
|
+
* ```
|
|
1083
|
+
*/
|
|
1084
|
+
static raw(value) {
|
|
1085
|
+
return new _CSSColor(value);
|
|
1086
|
+
}
|
|
1087
|
+
// ── 検証メソッド ──
|
|
1088
|
+
/**
|
|
1089
|
+
* 値が HEX 形式かどうかを判定する
|
|
1090
|
+
*
|
|
1091
|
+
* @returns HEX形式の場合 true
|
|
1092
|
+
*/
|
|
1093
|
+
isHex() {
|
|
1094
|
+
return HEX_PATTERN.test(this.value);
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* 値が rgb() 形式かどうかを判定する
|
|
1098
|
+
*
|
|
1099
|
+
* @returns rgb() 形式の場合 true
|
|
1100
|
+
*/
|
|
1101
|
+
isRgb() {
|
|
1102
|
+
return RGB_PATTERN.test(this.value);
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* 値が rgba() 形式かどうかを判定する
|
|
1106
|
+
*
|
|
1107
|
+
* @returns rgba() 形式の場合 true
|
|
1108
|
+
*/
|
|
1109
|
+
isRgba() {
|
|
1110
|
+
return RGBA_PATTERN.test(this.value);
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* 値が CSS 標準色名かどうかを判定する
|
|
1114
|
+
*
|
|
1115
|
+
* @returns CSS標準色名の場合 true
|
|
1116
|
+
*/
|
|
1117
|
+
isColorName() {
|
|
1118
|
+
return CSS_COLOR_NAME_VALUES.has(this.value);
|
|
1119
|
+
}
|
|
1120
|
+
// ── CSS 文字列出力 ──
|
|
1121
|
+
/**
|
|
1122
|
+
* CSS色値の文字列表現を返す
|
|
1123
|
+
*
|
|
1124
|
+
* @returns CSS色値文字列
|
|
1125
|
+
*/
|
|
1126
|
+
toString() {
|
|
1127
|
+
return this.value;
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
// src/css/layout/lazy-layout/lazy-layout-manager.ts
|
|
1132
|
+
var LazyLayoutManager = class {
|
|
1133
|
+
items = [];
|
|
1134
|
+
/**
|
|
1135
|
+
* レイアウトアイテムを登録する
|
|
1136
|
+
*
|
|
1137
|
+
* @param item - 登録するレイアウトアイテム
|
|
1138
|
+
*/
|
|
1139
|
+
registerItem(item) {
|
|
1140
|
+
this.items.push(item);
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* 指定されたタグパスの position 値を取得する
|
|
1144
|
+
*
|
|
1145
|
+
* @param tagPath - タグの階層パス
|
|
1146
|
+
* @returns position 値('static' | 'relative' | 'absolute' | 'fixed')、または undefined
|
|
1147
|
+
*/
|
|
1148
|
+
getRelationShip(tagPath) {
|
|
1149
|
+
const found = this.getItemsBy(tagPath);
|
|
1150
|
+
return found.length > 0 ? found[0]?.relationShip : void 0;
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* すべての遅延レイアウトを解決する
|
|
1154
|
+
*
|
|
1155
|
+
* 未解決の値(value が undefined)を持つアイテムを検索し、
|
|
1156
|
+
* 依存関係を辿って値を解決する。循環依存が検出された場合は Error をスローする。
|
|
1157
|
+
*
|
|
1158
|
+
* @throws {Error} 循環依存が検出された場合
|
|
1159
|
+
*/
|
|
1160
|
+
resolveAllLayout() {
|
|
1161
|
+
for (let i2 = 0; i2 < this.items.length; i2++) {
|
|
1162
|
+
const current = this.items[i2];
|
|
1163
|
+
if (current === void 0) continue;
|
|
1164
|
+
if (current.value === void 0) {
|
|
1165
|
+
const resolvedValue = this.getValue(current.basePosition, current.targetTagPath, /* @__PURE__ */ new Set());
|
|
1166
|
+
if (resolvedValue !== void 0) {
|
|
1167
|
+
this.items[i2] = {
|
|
1168
|
+
relationShip: current.relationShip,
|
|
1169
|
+
baseTagPath: current.baseTagPath,
|
|
1170
|
+
basePosition: current.basePosition,
|
|
1171
|
+
targetTagPath: current.targetTagPath,
|
|
1172
|
+
targetPosition: current.targetPosition,
|
|
1173
|
+
value: resolvedValue
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* 指定されたタグパスのレイアウトアイテムをCSS文字列として出力する
|
|
1181
|
+
*
|
|
1182
|
+
* position プロパティは出力されない(個別要素用)。
|
|
1183
|
+
*
|
|
1184
|
+
* @param tagPath - タグの階層パス
|
|
1185
|
+
* @returns CSS文字列(アイテムがない場合は空文字列)
|
|
1186
|
+
*/
|
|
1187
|
+
renderItemsBy(tagPath) {
|
|
1188
|
+
const items = this.getItemsBy(tagPath);
|
|
1189
|
+
return this.renderLayoutByRegisteredItem(items, false);
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* すべてのレイアウトアイテムをCSS文字列として出力する
|
|
1193
|
+
*
|
|
1194
|
+
* position プロパティを含む完全なCSS出力(static 以外)。
|
|
1195
|
+
*
|
|
1196
|
+
* @returns CSS文字列(アイテムがない場合は空文字列)
|
|
1197
|
+
*/
|
|
1198
|
+
renderAllItems() {
|
|
1199
|
+
return this.renderLayoutByRegisteredItem(this.items, true);
|
|
1200
|
+
}
|
|
1201
|
+
// ── Private ──
|
|
1202
|
+
getItemsBy(tagPath) {
|
|
1203
|
+
return this.items.filter((item) => item.baseTagPath === tagPath);
|
|
1204
|
+
}
|
|
1205
|
+
getValue(needPosition, targetPath, visitedPaths) {
|
|
1206
|
+
if (targetPath === void 0) return void 0;
|
|
1207
|
+
if (visitedPaths.has(targetPath)) {
|
|
1208
|
+
throw new Error(`Circular dependency detected: ${targetPath}`);
|
|
1209
|
+
}
|
|
1210
|
+
const targetItems = this.getItemsBy(targetPath);
|
|
1211
|
+
if (targetItems.length === 0) return void 0;
|
|
1212
|
+
const matchingItems = targetItems.filter((item) => item.basePosition === needPosition);
|
|
1213
|
+
if (matchingItems.length === 0) return void 0;
|
|
1214
|
+
const matchedItem = matchingItems[0];
|
|
1215
|
+
if (matchedItem === void 0) return void 0;
|
|
1216
|
+
if (matchedItem.value !== void 0) {
|
|
1217
|
+
return matchedItem.value;
|
|
1218
|
+
}
|
|
1219
|
+
const newVisitedPaths = new Set(visitedPaths);
|
|
1220
|
+
newVisitedPaths.add(targetPath);
|
|
1221
|
+
return this.getValue(needPosition, matchedItem.targetTagPath, newVisitedPaths);
|
|
1222
|
+
}
|
|
1223
|
+
renderLayoutByRegisteredItem(items, includePosition) {
|
|
1224
|
+
const entries = [];
|
|
1225
|
+
let relationShipAdded = false;
|
|
1226
|
+
for (const item of items) {
|
|
1227
|
+
if (item.value === void 0) continue;
|
|
1228
|
+
if (includePosition && !relationShipAdded && item.relationShip !== "static") {
|
|
1229
|
+
entries.push(`position: ${item.relationShip}`);
|
|
1230
|
+
relationShipAdded = true;
|
|
1231
|
+
}
|
|
1232
|
+
if (item.basePosition !== "none") {
|
|
1233
|
+
entries.push(`${item.basePosition}: ${hlUnitToCssString(item.value)}`);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
if (entries.length === 0) return "";
|
|
1237
|
+
return entries.join(";\n") + ";";
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1241
|
+
// src/css/variables/style-template-label.ts
|
|
1242
|
+
function __draftole_label__(value, debugVarName) {
|
|
1243
|
+
if (typeof value === "object" && value !== null && value._kind === "styleTemplate" && "bodyHash" in value) {
|
|
1244
|
+
return Object.freeze({ ...value, debugVarName });
|
|
1245
|
+
}
|
|
1246
|
+
return value;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
// src/css/variables/global-css.ts
|
|
1250
|
+
function brand(rendered) {
|
|
1251
|
+
return rendered;
|
|
1252
|
+
}
|
|
1253
|
+
function toKebabCase(camel) {
|
|
1254
|
+
return camel.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
|
|
1255
|
+
}
|
|
1256
|
+
function renderProperties(properties) {
|
|
1257
|
+
const lines = [];
|
|
1258
|
+
for (const [key, value] of Object.entries(properties)) {
|
|
1259
|
+
const safe = sanitizeCssValue(value);
|
|
1260
|
+
if (safe === "") continue;
|
|
1261
|
+
const kebab = toKebabCase(key);
|
|
1262
|
+
lines.push(` ${kebab}: ${safe};`);
|
|
1263
|
+
}
|
|
1264
|
+
return lines.join("\n");
|
|
1265
|
+
}
|
|
1266
|
+
function wrapBlock(selector, body2) {
|
|
1267
|
+
return `${selector} {
|
|
1268
|
+
${body2}
|
|
1269
|
+
}`;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
// src/css/variables/style-template.ts
|
|
1273
|
+
function stableStringify(value) {
|
|
1274
|
+
if (value === null || typeof value !== "object") {
|
|
1275
|
+
return JSON.stringify(value) ?? "null";
|
|
1276
|
+
}
|
|
1277
|
+
if (Array.isArray(value)) {
|
|
1278
|
+
return `[${value.map((v) => stableStringify(v)).join(",")}]`;
|
|
1279
|
+
}
|
|
1280
|
+
const obj = value;
|
|
1281
|
+
const keys = Object.keys(obj).sort();
|
|
1282
|
+
const entries = keys.map((k) => `${JSON.stringify(k)}:${stableStringify(obj[k])}`);
|
|
1283
|
+
return `{${entries.join(",")}}`;
|
|
1284
|
+
}
|
|
1285
|
+
function computeBodyHash(properties, selectors) {
|
|
1286
|
+
const normalized = stableStringify({
|
|
1287
|
+
properties,
|
|
1288
|
+
selectors: selectors ?? null
|
|
1289
|
+
});
|
|
1290
|
+
return djb2Hash(normalized);
|
|
1291
|
+
}
|
|
1292
|
+
function freezeProperties(properties) {
|
|
1293
|
+
const snapshot = {};
|
|
1294
|
+
for (const key of Object.keys(properties)) {
|
|
1295
|
+
const value = properties[key];
|
|
1296
|
+
if (value !== void 0) {
|
|
1297
|
+
snapshot[key] = value;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return Object.freeze(snapshot);
|
|
1301
|
+
}
|
|
1302
|
+
function freezeSelectors(selectors) {
|
|
1303
|
+
const snapshot = {};
|
|
1304
|
+
for (const key of Object.keys(selectors)) {
|
|
1305
|
+
const inner = selectors[key];
|
|
1306
|
+
if (inner !== void 0) {
|
|
1307
|
+
snapshot[key] = freezeProperties(inner);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
return Object.freeze(snapshot);
|
|
1311
|
+
}
|
|
1312
|
+
function createStyleTemplate(input2) {
|
|
1313
|
+
const { name, properties, selectors } = input2;
|
|
1314
|
+
const frozenProperties = freezeProperties(properties);
|
|
1315
|
+
const frozenSelectors = selectors !== void 0 ? freezeSelectors(selectors) : void 0;
|
|
1316
|
+
const bodyHash = computeBodyHash(properties, selectors);
|
|
1317
|
+
const template = {
|
|
1318
|
+
_kind: "styleTemplate",
|
|
1319
|
+
hasExplicitName: name !== void 0,
|
|
1320
|
+
...name !== void 0 ? { name } : {},
|
|
1321
|
+
properties: frozenProperties,
|
|
1322
|
+
...frozenSelectors !== void 0 ? { selectors: frozenSelectors } : {},
|
|
1323
|
+
bodyHash
|
|
1324
|
+
};
|
|
1325
|
+
return Object.freeze(template);
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
// src/css/variables/css-shared-style.ts
|
|
1329
|
+
function toKebabCase2(str) {
|
|
1330
|
+
return str.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
1331
|
+
}
|
|
1332
|
+
function renderCssBody(properties) {
|
|
1333
|
+
return Object.entries(properties).filter(([, v]) => sanitizeCssValue(v) !== "").map(([k, v]) => ` ${toKebabCase2(k)}: ${sanitizeCssValue(v)};`).join("\n");
|
|
1334
|
+
}
|
|
1335
|
+
var PSEUDO_SELECTORS = /* @__PURE__ */ new Set([
|
|
1336
|
+
"hover",
|
|
1337
|
+
"focus",
|
|
1338
|
+
"active",
|
|
1339
|
+
"visited",
|
|
1340
|
+
"disabled",
|
|
1341
|
+
"first-child",
|
|
1342
|
+
"last-child",
|
|
1343
|
+
"focus-within",
|
|
1344
|
+
"focus-visible"
|
|
1345
|
+
]);
|
|
1346
|
+
function resolveSelector(name, key) {
|
|
1347
|
+
if (PSEUDO_SELECTORS.has(key)) {
|
|
1348
|
+
return `.${name}:${key}`;
|
|
1349
|
+
}
|
|
1350
|
+
if (key.startsWith("&")) {
|
|
1351
|
+
return `.${name}${key.slice(1)}`;
|
|
1352
|
+
}
|
|
1353
|
+
if (key.startsWith(" ")) {
|
|
1354
|
+
return `.${name}${key}`;
|
|
1355
|
+
}
|
|
1356
|
+
return `.${name}:${key}`;
|
|
1357
|
+
}
|
|
1358
|
+
function createStyleNamed(name, properties, selectors) {
|
|
1359
|
+
const parts = [];
|
|
1360
|
+
const entries = Object.entries(properties);
|
|
1361
|
+
if (entries.length > 0) {
|
|
1362
|
+
parts.push(`.${name} {
|
|
1363
|
+
${renderCssBody(properties)}
|
|
1364
|
+
}`);
|
|
1365
|
+
}
|
|
1366
|
+
if (selectors) {
|
|
1367
|
+
for (const [key, props] of Object.entries(selectors)) {
|
|
1368
|
+
if (props && Object.keys(props).length > 0) {
|
|
1369
|
+
const selector = resolveSelector(name, key);
|
|
1370
|
+
parts.push(`${selector} {
|
|
1371
|
+
${renderCssBody(props)}
|
|
1372
|
+
}`);
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
const template = createStyleTemplate({
|
|
1377
|
+
name,
|
|
1378
|
+
properties,
|
|
1379
|
+
...selectors !== void 0 ? { selectors } : {}
|
|
1380
|
+
});
|
|
1381
|
+
return {
|
|
1382
|
+
className: name,
|
|
1383
|
+
css: parts.join("\n"),
|
|
1384
|
+
_template: template,
|
|
1385
|
+
toString() {
|
|
1386
|
+
return name;
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
function createStyle(arg1, arg2, arg3) {
|
|
1391
|
+
if (typeof arg1 === "string") {
|
|
1392
|
+
const properties2 = arg2 ?? {};
|
|
1393
|
+
return createStyleNamed(arg1, properties2, arg3);
|
|
1394
|
+
}
|
|
1395
|
+
const properties = arg1;
|
|
1396
|
+
const selectors = arg2;
|
|
1397
|
+
return createStyleTemplate({
|
|
1398
|
+
properties,
|
|
1399
|
+
...selectors !== void 0 ? { selectors } : {}
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
// src/css/variables/unified-theme.ts
|
|
1404
|
+
var CSS_KEYWORDS = /* @__PURE__ */ new Set([
|
|
1405
|
+
// CSS-wide keywords
|
|
1406
|
+
"inherit",
|
|
1407
|
+
"initial",
|
|
1408
|
+
"unset",
|
|
1409
|
+
"revert",
|
|
1410
|
+
"revert-layer",
|
|
1411
|
+
// generic
|
|
1412
|
+
"auto",
|
|
1413
|
+
"none",
|
|
1414
|
+
"normal",
|
|
1415
|
+
"currentcolor",
|
|
1416
|
+
"transparent",
|
|
1417
|
+
// display
|
|
1418
|
+
"block",
|
|
1419
|
+
"inline",
|
|
1420
|
+
"inline-block",
|
|
1421
|
+
"flex",
|
|
1422
|
+
"inline-flex",
|
|
1423
|
+
"grid",
|
|
1424
|
+
"inline-grid",
|
|
1425
|
+
"contents",
|
|
1426
|
+
"flow-root",
|
|
1427
|
+
"list-item",
|
|
1428
|
+
"table",
|
|
1429
|
+
"table-row",
|
|
1430
|
+
"table-cell",
|
|
1431
|
+
// visibility
|
|
1432
|
+
"visible",
|
|
1433
|
+
"hidden",
|
|
1434
|
+
"collapse",
|
|
1435
|
+
// position
|
|
1436
|
+
"static",
|
|
1437
|
+
"relative",
|
|
1438
|
+
"absolute",
|
|
1439
|
+
"fixed",
|
|
1440
|
+
"sticky",
|
|
1441
|
+
// font weight / style
|
|
1442
|
+
"bold",
|
|
1443
|
+
"bolder",
|
|
1444
|
+
"lighter",
|
|
1445
|
+
"italic",
|
|
1446
|
+
"oblique",
|
|
1447
|
+
// text
|
|
1448
|
+
"left",
|
|
1449
|
+
"right",
|
|
1450
|
+
"center",
|
|
1451
|
+
"justify",
|
|
1452
|
+
"start",
|
|
1453
|
+
"end",
|
|
1454
|
+
// border style
|
|
1455
|
+
"solid",
|
|
1456
|
+
"dashed",
|
|
1457
|
+
"dotted",
|
|
1458
|
+
"double",
|
|
1459
|
+
"groove",
|
|
1460
|
+
"ridge",
|
|
1461
|
+
"inset",
|
|
1462
|
+
"outset",
|
|
1463
|
+
// cursor
|
|
1464
|
+
"pointer",
|
|
1465
|
+
"default",
|
|
1466
|
+
"crosshair",
|
|
1467
|
+
"text",
|
|
1468
|
+
"wait",
|
|
1469
|
+
"help",
|
|
1470
|
+
"move",
|
|
1471
|
+
"not-allowed",
|
|
1472
|
+
"grab",
|
|
1473
|
+
"grabbing",
|
|
1474
|
+
// overflow
|
|
1475
|
+
"scroll",
|
|
1476
|
+
"clip",
|
|
1477
|
+
// flex / align
|
|
1478
|
+
"stretch",
|
|
1479
|
+
"baseline",
|
|
1480
|
+
"space-between",
|
|
1481
|
+
"space-around",
|
|
1482
|
+
"space-evenly",
|
|
1483
|
+
"flex-start",
|
|
1484
|
+
"flex-end",
|
|
1485
|
+
// box-sizing
|
|
1486
|
+
"content-box",
|
|
1487
|
+
"border-box",
|
|
1488
|
+
// CSS named colors (subset commonly used)
|
|
1489
|
+
"aliceblue",
|
|
1490
|
+
"antiquewhite",
|
|
1491
|
+
"aqua",
|
|
1492
|
+
"aquamarine",
|
|
1493
|
+
"azure",
|
|
1494
|
+
"beige",
|
|
1495
|
+
"bisque",
|
|
1496
|
+
"black",
|
|
1497
|
+
"blanchedalmond",
|
|
1498
|
+
"blue",
|
|
1499
|
+
"blueviolet",
|
|
1500
|
+
"brown",
|
|
1501
|
+
"burlywood",
|
|
1502
|
+
"cadetblue",
|
|
1503
|
+
"chartreuse",
|
|
1504
|
+
"chocolate",
|
|
1505
|
+
"coral",
|
|
1506
|
+
"cornflowerblue",
|
|
1507
|
+
"cornsilk",
|
|
1508
|
+
"crimson",
|
|
1509
|
+
"cyan",
|
|
1510
|
+
"darkblue",
|
|
1511
|
+
"darkcyan",
|
|
1512
|
+
"darkgoldenrod",
|
|
1513
|
+
"darkgray",
|
|
1514
|
+
"darkgreen",
|
|
1515
|
+
"darkgrey",
|
|
1516
|
+
"darkkhaki",
|
|
1517
|
+
"darkmagenta",
|
|
1518
|
+
"darkolivegreen",
|
|
1519
|
+
"darkorange",
|
|
1520
|
+
"darkorchid",
|
|
1521
|
+
"darkred",
|
|
1522
|
+
"darksalmon",
|
|
1523
|
+
"darkseagreen",
|
|
1524
|
+
"darkslateblue",
|
|
1525
|
+
"darkslategray",
|
|
1526
|
+
"darkslategrey",
|
|
1527
|
+
"darkturquoise",
|
|
1528
|
+
"darkviolet",
|
|
1529
|
+
"deeppink",
|
|
1530
|
+
"deepskyblue",
|
|
1531
|
+
"dimgray",
|
|
1532
|
+
"dimgrey",
|
|
1533
|
+
"dodgerblue",
|
|
1534
|
+
"firebrick",
|
|
1535
|
+
"floralwhite",
|
|
1536
|
+
"forestgreen",
|
|
1537
|
+
"fuchsia",
|
|
1538
|
+
"gainsboro",
|
|
1539
|
+
"ghostwhite",
|
|
1540
|
+
"gold",
|
|
1541
|
+
"goldenrod",
|
|
1542
|
+
"gray",
|
|
1543
|
+
"green",
|
|
1544
|
+
"greenyellow",
|
|
1545
|
+
"grey",
|
|
1546
|
+
"honeydew",
|
|
1547
|
+
"hotpink",
|
|
1548
|
+
"indianred",
|
|
1549
|
+
"indigo",
|
|
1550
|
+
"ivory",
|
|
1551
|
+
"khaki",
|
|
1552
|
+
"lavender",
|
|
1553
|
+
"lavenderblush",
|
|
1554
|
+
"lawngreen",
|
|
1555
|
+
"lemonchiffon",
|
|
1556
|
+
"lightblue",
|
|
1557
|
+
"lightcoral",
|
|
1558
|
+
"lightcyan",
|
|
1559
|
+
"lightgoldenrodyellow",
|
|
1560
|
+
"lightgray",
|
|
1561
|
+
"lightgreen",
|
|
1562
|
+
"lightgrey",
|
|
1563
|
+
"lightpink",
|
|
1564
|
+
"lightsalmon",
|
|
1565
|
+
"lightseagreen",
|
|
1566
|
+
"lightskyblue",
|
|
1567
|
+
"lightslategray",
|
|
1568
|
+
"lightslategrey",
|
|
1569
|
+
"lightsteelblue",
|
|
1570
|
+
"lightyellow",
|
|
1571
|
+
"lime",
|
|
1572
|
+
"limegreen",
|
|
1573
|
+
"linen",
|
|
1574
|
+
"magenta",
|
|
1575
|
+
"maroon",
|
|
1576
|
+
"mediumaquamarine",
|
|
1577
|
+
"mediumblue",
|
|
1578
|
+
"mediumorchid",
|
|
1579
|
+
"mediumpurple",
|
|
1580
|
+
"mediumseagreen",
|
|
1581
|
+
"mediumslateblue",
|
|
1582
|
+
"mediumspringgreen",
|
|
1583
|
+
"mediumturquoise",
|
|
1584
|
+
"mediumvioletred",
|
|
1585
|
+
"midnightblue",
|
|
1586
|
+
"mintcream",
|
|
1587
|
+
"mistyrose",
|
|
1588
|
+
"moccasin",
|
|
1589
|
+
"navajowhite",
|
|
1590
|
+
"navy",
|
|
1591
|
+
"oldlace",
|
|
1592
|
+
"olive",
|
|
1593
|
+
"olivedrab",
|
|
1594
|
+
"orange",
|
|
1595
|
+
"orangered",
|
|
1596
|
+
"orchid",
|
|
1597
|
+
"palegoldenrod",
|
|
1598
|
+
"palegreen",
|
|
1599
|
+
"paleturquoise",
|
|
1600
|
+
"palevioletred",
|
|
1601
|
+
"papayawhip",
|
|
1602
|
+
"peachpuff",
|
|
1603
|
+
"peru",
|
|
1604
|
+
"pink",
|
|
1605
|
+
"plum",
|
|
1606
|
+
"powderblue",
|
|
1607
|
+
"purple",
|
|
1608
|
+
"rebeccapurple",
|
|
1609
|
+
"red",
|
|
1610
|
+
"rosybrown",
|
|
1611
|
+
"royalblue",
|
|
1612
|
+
"saddlebrown",
|
|
1613
|
+
"salmon",
|
|
1614
|
+
"sandybrown",
|
|
1615
|
+
"seagreen",
|
|
1616
|
+
"seashell",
|
|
1617
|
+
"sienna",
|
|
1618
|
+
"silver",
|
|
1619
|
+
"skyblue",
|
|
1620
|
+
"slateblue",
|
|
1621
|
+
"slategray",
|
|
1622
|
+
"slategrey",
|
|
1623
|
+
"snow",
|
|
1624
|
+
"springgreen",
|
|
1625
|
+
"steelblue",
|
|
1626
|
+
"tan",
|
|
1627
|
+
"teal",
|
|
1628
|
+
"thistle",
|
|
1629
|
+
"tomato",
|
|
1630
|
+
"turquoise",
|
|
1631
|
+
"violet",
|
|
1632
|
+
"wheat",
|
|
1633
|
+
"white",
|
|
1634
|
+
"whitesmoke",
|
|
1635
|
+
"yellow",
|
|
1636
|
+
"yellowgreen"
|
|
1637
|
+
]);
|
|
1638
|
+
var COLOR_PROPERTIES = /* @__PURE__ */ new Set([
|
|
1639
|
+
"color",
|
|
1640
|
+
"background",
|
|
1641
|
+
"background-color",
|
|
1642
|
+
"border-color",
|
|
1643
|
+
"border-top-color",
|
|
1644
|
+
"border-right-color",
|
|
1645
|
+
"border-bottom-color",
|
|
1646
|
+
"border-left-color",
|
|
1647
|
+
"outline-color",
|
|
1648
|
+
"text-decoration-color",
|
|
1649
|
+
"caret-color",
|
|
1650
|
+
"fill",
|
|
1651
|
+
"stroke"
|
|
1652
|
+
]);
|
|
1653
|
+
var NON_COLOR_KEYWORDS = /* @__PURE__ */ new Set([
|
|
1654
|
+
// cursor 専用
|
|
1655
|
+
"text",
|
|
1656
|
+
"pointer",
|
|
1657
|
+
"default",
|
|
1658
|
+
"crosshair",
|
|
1659
|
+
"wait",
|
|
1660
|
+
"help",
|
|
1661
|
+
"move",
|
|
1662
|
+
"not-allowed",
|
|
1663
|
+
"grab",
|
|
1664
|
+
"grabbing",
|
|
1665
|
+
// display
|
|
1666
|
+
"block",
|
|
1667
|
+
"inline",
|
|
1668
|
+
"inline-block",
|
|
1669
|
+
"flex",
|
|
1670
|
+
"inline-flex",
|
|
1671
|
+
"grid",
|
|
1672
|
+
"inline-grid",
|
|
1673
|
+
"contents",
|
|
1674
|
+
"flow-root",
|
|
1675
|
+
"list-item",
|
|
1676
|
+
"table",
|
|
1677
|
+
"table-row",
|
|
1678
|
+
"table-cell",
|
|
1679
|
+
// visibility
|
|
1680
|
+
"visible",
|
|
1681
|
+
"hidden",
|
|
1682
|
+
"collapse",
|
|
1683
|
+
// position
|
|
1684
|
+
"static",
|
|
1685
|
+
"relative",
|
|
1686
|
+
"absolute",
|
|
1687
|
+
"fixed",
|
|
1688
|
+
"sticky",
|
|
1689
|
+
// overflow
|
|
1690
|
+
"scroll",
|
|
1691
|
+
"clip",
|
|
1692
|
+
// flex / align
|
|
1693
|
+
"stretch",
|
|
1694
|
+
"baseline",
|
|
1695
|
+
"space-between",
|
|
1696
|
+
"space-around",
|
|
1697
|
+
"space-evenly",
|
|
1698
|
+
"flex-start",
|
|
1699
|
+
"flex-end",
|
|
1700
|
+
// box-sizing
|
|
1701
|
+
"content-box",
|
|
1702
|
+
"border-box",
|
|
1703
|
+
// font-weight / style
|
|
1704
|
+
"bold",
|
|
1705
|
+
"bolder",
|
|
1706
|
+
"lighter",
|
|
1707
|
+
"italic",
|
|
1708
|
+
"oblique",
|
|
1709
|
+
// text-align
|
|
1710
|
+
"left",
|
|
1711
|
+
"right",
|
|
1712
|
+
"center",
|
|
1713
|
+
"justify",
|
|
1714
|
+
"start",
|
|
1715
|
+
"end",
|
|
1716
|
+
// border-style
|
|
1717
|
+
"solid",
|
|
1718
|
+
"dashed",
|
|
1719
|
+
"dotted",
|
|
1720
|
+
"double",
|
|
1721
|
+
"groove",
|
|
1722
|
+
"ridge",
|
|
1723
|
+
"inset",
|
|
1724
|
+
"outset",
|
|
1725
|
+
// generic non-color
|
|
1726
|
+
"auto",
|
|
1727
|
+
"normal"
|
|
1728
|
+
]);
|
|
1729
|
+
var COLOR_KEYWORDS = new Set(
|
|
1730
|
+
Array.from(CSS_KEYWORDS).filter((k) => !NON_COLOR_KEYWORDS.has(k))
|
|
1731
|
+
);
|
|
1732
|
+
function getKeywordsForProperty(propName) {
|
|
1733
|
+
const normalized = propName.toLowerCase();
|
|
1734
|
+
if (COLOR_PROPERTIES.has(normalized)) {
|
|
1735
|
+
return COLOR_KEYWORDS;
|
|
1736
|
+
}
|
|
1737
|
+
return CSS_KEYWORDS;
|
|
1738
|
+
}
|
|
1739
|
+
var defaultKeywordResolver = getKeywordsForProperty;
|
|
1740
|
+
function classifyEntry(key, value) {
|
|
1741
|
+
if (typeof value === "string") {
|
|
1742
|
+
return { kind: "token", key, value };
|
|
1743
|
+
}
|
|
1744
|
+
return { kind: "class", key, value };
|
|
1745
|
+
}
|
|
1746
|
+
var TokenAccumulator = class {
|
|
1747
|
+
entries = /* @__PURE__ */ new Map();
|
|
1748
|
+
add(name, rawValue) {
|
|
1749
|
+
const safe = sanitizeCssValue(rawValue);
|
|
1750
|
+
if (safe === "") return;
|
|
1751
|
+
this.entries.set(name, safe);
|
|
1752
|
+
}
|
|
1753
|
+
buildRootCss() {
|
|
1754
|
+
if (this.entries.size === 0) return void 0;
|
|
1755
|
+
const lines = [];
|
|
1756
|
+
for (const [k, v] of this.entries) {
|
|
1757
|
+
lines.push(` --${k}: ${v};`);
|
|
1758
|
+
}
|
|
1759
|
+
return brand(`:root {
|
|
1760
|
+
${lines.join("\n")}
|
|
1761
|
+
}`);
|
|
1762
|
+
}
|
|
1763
|
+
buildProxy() {
|
|
1764
|
+
const proxy = {};
|
|
1765
|
+
for (const k of this.entries.keys()) {
|
|
1766
|
+
proxy[k] = `var(--${k})`;
|
|
1767
|
+
}
|
|
1768
|
+
return proxy;
|
|
1769
|
+
}
|
|
1770
|
+
getNameSet() {
|
|
1771
|
+
return new Set(this.entries.keys());
|
|
1772
|
+
}
|
|
1773
|
+
};
|
|
1774
|
+
function resolveTokenRefs(properties, tokenNames, keywordResolver) {
|
|
1775
|
+
const out = {};
|
|
1776
|
+
for (const [k, v] of Object.entries(properties)) {
|
|
1777
|
+
out[k] = resolveValue(k, v, tokenNames, keywordResolver);
|
|
1778
|
+
}
|
|
1779
|
+
return out;
|
|
1780
|
+
}
|
|
1781
|
+
function resolveValue(propName, value, tokenNames, keywordResolver) {
|
|
1782
|
+
if (/[\s(),]/.test(value)) return value;
|
|
1783
|
+
const keywords = keywordResolver(propName);
|
|
1784
|
+
if (keywords.has(value)) return value;
|
|
1785
|
+
if (tokenNames.has(value)) return `var(--${value})`;
|
|
1786
|
+
return value;
|
|
1787
|
+
}
|
|
1788
|
+
var ClassAccumulator = class {
|
|
1789
|
+
entries = /* @__PURE__ */ new Map();
|
|
1790
|
+
tokenNames = /* @__PURE__ */ new Set();
|
|
1791
|
+
keywordResolver = defaultKeywordResolver;
|
|
1792
|
+
setTokenContext(tokenNames, keywordResolver) {
|
|
1793
|
+
this.tokenNames = tokenNames;
|
|
1794
|
+
this.keywordResolver = keywordResolver;
|
|
1795
|
+
}
|
|
1796
|
+
add(name, properties) {
|
|
1797
|
+
const resolved = resolveTokenRefs(properties, this.tokenNames, this.keywordResolver);
|
|
1798
|
+
const style = createStyleNamed(name, resolved);
|
|
1799
|
+
this.entries.set(name, style);
|
|
1800
|
+
}
|
|
1801
|
+
buildProxy() {
|
|
1802
|
+
const proxy = {};
|
|
1803
|
+
for (const [k, v] of this.entries) {
|
|
1804
|
+
proxy[k] = v;
|
|
1805
|
+
}
|
|
1806
|
+
return proxy;
|
|
1807
|
+
}
|
|
1808
|
+
buildCssBlocks() {
|
|
1809
|
+
const blocks = [];
|
|
1810
|
+
for (const style of this.entries.values()) {
|
|
1811
|
+
if (style.css !== "") blocks.push(brand(style.css));
|
|
1812
|
+
}
|
|
1813
|
+
return blocks;
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
function combineCss(parts) {
|
|
1817
|
+
const sections = [];
|
|
1818
|
+
if (parts.tokensCss !== void 0 && parts.tokensCss !== "") {
|
|
1819
|
+
sections.push(parts.tokensCss);
|
|
1820
|
+
}
|
|
1821
|
+
for (const block of parts.classesCss) {
|
|
1822
|
+
if (block !== "") sections.push(block);
|
|
1823
|
+
}
|
|
1824
|
+
return brand(sections.join("\n\n"));
|
|
1825
|
+
}
|
|
1826
|
+
function resolveSelectorsTokens(selectors, tokenNames, keywordResolver) {
|
|
1827
|
+
const out = {};
|
|
1828
|
+
for (const [k, props] of Object.entries(selectors)) {
|
|
1829
|
+
if (props !== void 0) {
|
|
1830
|
+
out[k] = resolveTokenRefs(props, tokenNames, keywordResolver);
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
return out;
|
|
1834
|
+
}
|
|
1835
|
+
function buildThemeClass(tokenNames, keywordResolver) {
|
|
1836
|
+
function impl(arg1, arg2, arg3) {
|
|
1837
|
+
if (typeof arg1 === "string") {
|
|
1838
|
+
const name = arg1;
|
|
1839
|
+
const properties2 = arg2 ?? {};
|
|
1840
|
+
const selectors2 = arg3;
|
|
1841
|
+
const resolvedProps2 = resolveTokenRefs(properties2, tokenNames, keywordResolver);
|
|
1842
|
+
const resolvedSelectors2 = selectors2 !== void 0 ? resolveSelectorsTokens(selectors2, tokenNames, keywordResolver) : void 0;
|
|
1843
|
+
return createStyleNamed(name, resolvedProps2, resolvedSelectors2);
|
|
1844
|
+
}
|
|
1845
|
+
const properties = arg1;
|
|
1846
|
+
const selectors = arg2;
|
|
1847
|
+
const resolvedProps = resolveTokenRefs(properties, tokenNames, keywordResolver);
|
|
1848
|
+
const resolvedSelectors = selectors !== void 0 ? resolveSelectorsTokens(selectors, tokenNames, keywordResolver) : void 0;
|
|
1849
|
+
return createStyleTemplate({
|
|
1850
|
+
properties: resolvedProps,
|
|
1851
|
+
...resolvedSelectors !== void 0 ? { selectors: resolvedSelectors } : {}
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
return impl;
|
|
1855
|
+
}
|
|
1856
|
+
function buildUnifiedTheme(input2) {
|
|
1857
|
+
const tokenAcc = new TokenAccumulator();
|
|
1858
|
+
const classAcc = new ClassAccumulator();
|
|
1859
|
+
const deferredClasses = [];
|
|
1860
|
+
for (const [key, value] of Object.entries(input2)) {
|
|
1861
|
+
const entry = classifyEntry(key, value);
|
|
1862
|
+
if (entry.kind === "token") {
|
|
1863
|
+
tokenAcc.add(entry.key, entry.value);
|
|
1864
|
+
} else {
|
|
1865
|
+
deferredClasses.push({ key: entry.key, value: entry.value });
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
classAcc.setTokenContext(tokenAcc.getNameSet(), defaultKeywordResolver);
|
|
1869
|
+
for (const { key, value } of deferredClasses) {
|
|
1870
|
+
classAcc.add(key, value);
|
|
1871
|
+
}
|
|
1872
|
+
const tokenProxy = tokenAcc.buildProxy();
|
|
1873
|
+
const classProxy = classAcc.buildProxy();
|
|
1874
|
+
const result = {};
|
|
1875
|
+
for (const [k, v] of Object.entries(tokenProxy)) result[k] = v;
|
|
1876
|
+
for (const [k, v] of Object.entries(classProxy)) result[k] = v;
|
|
1877
|
+
const tokensCss = tokenAcc.buildRootCss();
|
|
1878
|
+
const classesCss = classAcc.buildCssBlocks();
|
|
1879
|
+
const css2 = combineCss({ tokensCss, classesCss });
|
|
1880
|
+
Object.defineProperty(result, "css", {
|
|
1881
|
+
value: css2,
|
|
1882
|
+
enumerable: false,
|
|
1883
|
+
writable: false
|
|
1884
|
+
});
|
|
1885
|
+
const themeClass = buildThemeClass(tokenAcc.getNameSet(), defaultKeywordResolver);
|
|
1886
|
+
Object.defineProperty(result, "class", {
|
|
1887
|
+
value: themeClass,
|
|
1888
|
+
enumerable: false,
|
|
1889
|
+
writable: false
|
|
1890
|
+
});
|
|
1891
|
+
return Object.freeze(result);
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
// src/css/variables/css-theme.ts
|
|
1895
|
+
function createTheme(input2) {
|
|
1896
|
+
return buildUnifiedTheme(input2);
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
// src/css/variables/global-dsl.ts
|
|
1900
|
+
function selectorRule(selector, properties) {
|
|
1901
|
+
return brand(wrapBlock(selector, renderProperties(properties)));
|
|
1902
|
+
}
|
|
1903
|
+
function root(properties) {
|
|
1904
|
+
return selectorRule(":root", properties);
|
|
1905
|
+
}
|
|
1906
|
+
function all(properties) {
|
|
1907
|
+
return selectorRule("*", properties);
|
|
1908
|
+
}
|
|
1909
|
+
function tag(name, properties) {
|
|
1910
|
+
return selectorRule(name, properties);
|
|
1911
|
+
}
|
|
1912
|
+
function rule(selector, properties) {
|
|
1913
|
+
return selectorRule(selector, properties);
|
|
1914
|
+
}
|
|
1915
|
+
function media(query, rules) {
|
|
1916
|
+
const indented = rules.map(
|
|
1917
|
+
(r) => r.split("\n").map((line) => ` ${line}`).join("\n")
|
|
1918
|
+
).join("\n\n");
|
|
1919
|
+
return brand(`@media ${query} {
|
|
1920
|
+
${indented}
|
|
1921
|
+
}`);
|
|
1922
|
+
}
|
|
1923
|
+
function keyframes(name, frames) {
|
|
1924
|
+
const blocks = Object.entries(frames).map(
|
|
1925
|
+
([key, props]) => {
|
|
1926
|
+
const body2 = renderProperties(props).split("\n").map((line) => ` ${line}`).join("\n");
|
|
1927
|
+
return ` ${key} {
|
|
1928
|
+
${body2}
|
|
1929
|
+
}`;
|
|
1930
|
+
}
|
|
1931
|
+
);
|
|
1932
|
+
return brand(`@keyframes ${name} {
|
|
1933
|
+
${blocks.join("\n")}
|
|
1934
|
+
}`);
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
// src/css/css.ts
|
|
1938
|
+
function cssRaw(cssString) {
|
|
1939
|
+
return brand(cssString);
|
|
1940
|
+
}
|
|
1941
|
+
var DEFAULT_RESET = brand(
|
|
1942
|
+
"* {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n}"
|
|
1943
|
+
);
|
|
1944
|
+
function isStyleTemplate(v) {
|
|
1945
|
+
return typeof v === "object" && v !== null && v._kind === "styleTemplate";
|
|
1946
|
+
}
|
|
1947
|
+
function isSharedStyle(v) {
|
|
1948
|
+
return typeof v === "object" && v !== null && typeof v.className === "string" && typeof v.css === "string";
|
|
1949
|
+
}
|
|
1950
|
+
function cssReset(arg) {
|
|
1951
|
+
if (arg === void 0) return DEFAULT_RESET;
|
|
1952
|
+
let properties;
|
|
1953
|
+
if (isSharedStyle(arg)) {
|
|
1954
|
+
properties = { ...arg._template.properties };
|
|
1955
|
+
} else if (isStyleTemplate(arg)) {
|
|
1956
|
+
properties = { ...arg.properties };
|
|
1957
|
+
} else {
|
|
1958
|
+
properties = arg;
|
|
1959
|
+
}
|
|
1960
|
+
return brand(wrapBlock("*", renderProperties(properties)));
|
|
1961
|
+
}
|
|
1962
|
+
function variant(_theme, selector, overrides) {
|
|
1963
|
+
const lines = [];
|
|
1964
|
+
for (const [key, rawValue] of Object.entries(overrides)) {
|
|
1965
|
+
if (typeof rawValue !== "string") continue;
|
|
1966
|
+
const safe = sanitizeCssValue(rawValue);
|
|
1967
|
+
if (safe === "") continue;
|
|
1968
|
+
lines.push(` --${key}: ${safe};`);
|
|
1969
|
+
}
|
|
1970
|
+
return brand(wrapBlock(selector, lines.join("\n")));
|
|
1971
|
+
}
|
|
1972
|
+
function cssThemeImpl(input2) {
|
|
1973
|
+
return createTheme(input2);
|
|
1974
|
+
}
|
|
1975
|
+
var cssTheme = Object.assign(cssThemeImpl, { variant });
|
|
1976
|
+
var cssClass = ((arg1, arg2, arg3) => {
|
|
1977
|
+
if (typeof arg1 === "string") {
|
|
1978
|
+
return createStyle(arg1, arg2 ?? {}, arg3);
|
|
1979
|
+
}
|
|
1980
|
+
return createStyle(arg1, arg2);
|
|
1981
|
+
});
|
|
1982
|
+
var css = {
|
|
1983
|
+
theme: cssTheme,
|
|
1984
|
+
class: cssClass,
|
|
1985
|
+
reset: cssReset,
|
|
1986
|
+
media,
|
|
1987
|
+
keyframes,
|
|
1988
|
+
raw: cssRaw
|
|
1989
|
+
};
|
|
1990
|
+
|
|
1991
|
+
// src/html/protocols/jquery-method-type.ts
|
|
1992
|
+
var JQUERY_METHOD_TYPES = [
|
|
1993
|
+
"css",
|
|
1994
|
+
"height",
|
|
1995
|
+
"on",
|
|
1996
|
+
"text",
|
|
1997
|
+
"html",
|
|
1998
|
+
"addClass",
|
|
1999
|
+
"removeClass",
|
|
2000
|
+
"toggleClass"
|
|
2001
|
+
];
|
|
2002
|
+
|
|
2003
|
+
// src/js/js-template.ts
|
|
2004
|
+
function param(name) {
|
|
2005
|
+
return { __jsParam: true, name };
|
|
2006
|
+
}
|
|
2007
|
+
var DOM_PROPERTY_MAP = {
|
|
2008
|
+
"className": "className",
|
|
2009
|
+
"class": "className",
|
|
2010
|
+
"textContent": "textContent",
|
|
2011
|
+
"id": "id",
|
|
2012
|
+
"type": "type",
|
|
2013
|
+
"value": "value",
|
|
2014
|
+
"href": "href",
|
|
2015
|
+
"src": "src",
|
|
2016
|
+
"alt": "alt",
|
|
2017
|
+
"title": "title",
|
|
2018
|
+
"placeholder": "placeholder",
|
|
2019
|
+
"name": "name",
|
|
2020
|
+
"disabled": "disabled",
|
|
2021
|
+
"checked": "checked",
|
|
2022
|
+
"selected": "selected",
|
|
2023
|
+
"readonly": "readOnly",
|
|
2024
|
+
"hidden": "hidden"
|
|
2025
|
+
};
|
|
2026
|
+
function renderAttrValue(raw) {
|
|
2027
|
+
const paramName = decodeJsParamSentinel(raw);
|
|
2028
|
+
if (paramName !== null) {
|
|
2029
|
+
return paramName;
|
|
2030
|
+
}
|
|
2031
|
+
return JSON.stringify(raw);
|
|
2032
|
+
}
|
|
2033
|
+
function attrToJsLines(varName, attr) {
|
|
2034
|
+
const key = attr.key;
|
|
2035
|
+
const attrValue = attr.attributeValue;
|
|
2036
|
+
if (attrValue.type === "boolean") {
|
|
2037
|
+
const prop = DOM_PROPERTY_MAP[key] ?? key;
|
|
2038
|
+
return [`${varName}.${prop} = true;`];
|
|
2039
|
+
}
|
|
2040
|
+
if (attrValue.type === "custom") {
|
|
2041
|
+
const dataKey = `data-${attrValue.name}`;
|
|
2042
|
+
const rawValue = attrValue.value;
|
|
2043
|
+
const paramName = decodeJsParamSentinel(rawValue);
|
|
2044
|
+
if (paramName !== null) {
|
|
2045
|
+
return [`${varName}.setAttribute("${dataKey}", ${paramName});`];
|
|
2046
|
+
}
|
|
2047
|
+
return [`${varName}.setAttribute("${dataKey}", ${JSON.stringify(rawValue)});`];
|
|
2048
|
+
}
|
|
2049
|
+
if (attrValue.type === "keyValue") {
|
|
2050
|
+
const rawValue = attrValue.value;
|
|
2051
|
+
if (key === "class") {
|
|
2052
|
+
return [`${varName}.className = ${renderAttrValue(rawValue)};`];
|
|
2053
|
+
}
|
|
2054
|
+
const domProp = DOM_PROPERTY_MAP[key];
|
|
2055
|
+
if (domProp !== void 0) {
|
|
2056
|
+
return [`${varName}.${domProp} = ${renderAttrValue(rawValue)};`];
|
|
2057
|
+
}
|
|
2058
|
+
const paramName = decodeJsParamSentinel(rawValue);
|
|
2059
|
+
if (paramName !== null) {
|
|
2060
|
+
return [`${varName}.setAttribute("${key}", ${paramName});`];
|
|
2061
|
+
}
|
|
2062
|
+
return [`${varName}.setAttribute("${key}", ${JSON.stringify(rawValue)});`];
|
|
2063
|
+
}
|
|
2064
|
+
return [];
|
|
2065
|
+
}
|
|
2066
|
+
function walkNode(node, counter, lines, refs) {
|
|
2067
|
+
const jsNameAttr = node.attributes.find(
|
|
2068
|
+
(a2) => a2.attributeValue.type === "custom" && a2.attributeValue.name === "jsname"
|
|
2069
|
+
);
|
|
2070
|
+
let varName;
|
|
2071
|
+
if (jsNameAttr && jsNameAttr.attributeValue.type === "custom") {
|
|
2072
|
+
varName = jsNameAttr.attributeValue.value;
|
|
2073
|
+
refs[varName] = varName;
|
|
2074
|
+
} else {
|
|
2075
|
+
varName = `el${counter.value++}`;
|
|
2076
|
+
}
|
|
2077
|
+
const tagType = node.tagType;
|
|
2078
|
+
lines.push(`const ${varName} = document.createElement("${tagType}");`);
|
|
2079
|
+
for (const attr of node.attributes) {
|
|
2080
|
+
if (attr.attributeValue.type === "custom" && attr.attributeValue.name === "jsname") continue;
|
|
2081
|
+
const attrLines = attrToJsLines(varName, attr);
|
|
2082
|
+
for (const line of attrLines) {
|
|
2083
|
+
lines.push(line);
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
for (const child of node.children) {
|
|
2087
|
+
if (child instanceof TextType) {
|
|
2088
|
+
const content = child.content;
|
|
2089
|
+
const paramName = decodeJsParamSentinel(content);
|
|
2090
|
+
if (paramName !== null) {
|
|
2091
|
+
lines.push(`${varName}.textContent = ${paramName};`);
|
|
2092
|
+
} else {
|
|
2093
|
+
lines.push(`${varName}.textContent = ${JSON.stringify(content)};`);
|
|
2094
|
+
}
|
|
2095
|
+
} else {
|
|
2096
|
+
const childVar = walkNode(child, counter, lines, refs);
|
|
2097
|
+
lines.push(`${varName}.appendChild(${childVar});`);
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
return varName;
|
|
2101
|
+
}
|
|
2102
|
+
function jsTemplate(name, params, rootElement, afterCreate) {
|
|
2103
|
+
return {
|
|
2104
|
+
name,
|
|
2105
|
+
params: [...params],
|
|
2106
|
+
render() {
|
|
2107
|
+
const bodyLines = [];
|
|
2108
|
+
const counter = { value: 0 };
|
|
2109
|
+
const refs = {};
|
|
2110
|
+
const rootVarName = walkNode(rootElement, counter, bodyLines, refs);
|
|
2111
|
+
const paramsStr = params.join(", ");
|
|
2112
|
+
const indented = bodyLines.map((l) => ` ${l}`).join("\n");
|
|
2113
|
+
const parts = [
|
|
2114
|
+
`function ${name}(${paramsStr}) {`,
|
|
2115
|
+
indented
|
|
2116
|
+
];
|
|
2117
|
+
if (afterCreate) {
|
|
2118
|
+
const afterCode = afterCreate(refs);
|
|
2119
|
+
if (afterCode.trim().length > 0) {
|
|
2120
|
+
const afterLines = afterCode.split("\n").filter((l) => l.trim().length > 0).map((l) => ` ${l}`).join("\n");
|
|
2121
|
+
parts.push(afterLines);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
parts.push(` return ${rootVarName};`);
|
|
2125
|
+
parts.push("}");
|
|
2126
|
+
return parts.join("\n");
|
|
2127
|
+
}
|
|
2128
|
+
};
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
// src/js/vanilla/emit-handler.ts
|
|
2132
|
+
function emitHandler(code2, params = []) {
|
|
2133
|
+
return Object.assign(
|
|
2134
|
+
(s2) => {
|
|
2135
|
+
s2._emitHandlerBody(code2, params);
|
|
2136
|
+
},
|
|
2137
|
+
{ _draftoleEmitted: true }
|
|
2138
|
+
);
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
// src/css/variables/tag-dsl.generated.ts
|
|
2142
|
+
var tag_dsl_generated_exports = {};
|
|
2143
|
+
__export(tag_dsl_generated_exports, {
|
|
2144
|
+
tagA: () => tagA,
|
|
2145
|
+
tagAbbr: () => tagAbbr,
|
|
2146
|
+
tagAddress: () => tagAddress,
|
|
2147
|
+
tagArea: () => tagArea,
|
|
2148
|
+
tagArticle: () => tagArticle,
|
|
2149
|
+
tagAside: () => tagAside,
|
|
2150
|
+
tagAudio: () => tagAudio,
|
|
2151
|
+
tagB: () => tagB,
|
|
2152
|
+
tagBase: () => tagBase,
|
|
2153
|
+
tagBdi: () => tagBdi,
|
|
2154
|
+
tagBdo: () => tagBdo,
|
|
2155
|
+
tagBlockquote: () => tagBlockquote,
|
|
2156
|
+
tagBody: () => tagBody,
|
|
2157
|
+
tagBr: () => tagBr,
|
|
2158
|
+
tagButton: () => tagButton,
|
|
2159
|
+
tagCanvas: () => tagCanvas,
|
|
2160
|
+
tagCaption: () => tagCaption,
|
|
2161
|
+
tagCite: () => tagCite,
|
|
2162
|
+
tagCode: () => tagCode,
|
|
2163
|
+
tagCol: () => tagCol,
|
|
2164
|
+
tagColgroup: () => tagColgroup,
|
|
2165
|
+
tagData: () => tagData,
|
|
2166
|
+
tagDatalist: () => tagDatalist,
|
|
2167
|
+
tagDd: () => tagDd,
|
|
2168
|
+
tagDel: () => tagDel,
|
|
2169
|
+
tagDetails: () => tagDetails,
|
|
2170
|
+
tagDfn: () => tagDfn,
|
|
2171
|
+
tagDialog: () => tagDialog,
|
|
2172
|
+
tagDiv: () => tagDiv,
|
|
2173
|
+
tagDl: () => tagDl,
|
|
2174
|
+
tagDt: () => tagDt,
|
|
2175
|
+
tagEm: () => tagEm,
|
|
2176
|
+
tagEmbed: () => tagEmbed,
|
|
2177
|
+
tagFieldset: () => tagFieldset,
|
|
2178
|
+
tagFigcaption: () => tagFigcaption,
|
|
2179
|
+
tagFigure: () => tagFigure,
|
|
2180
|
+
tagFooter: () => tagFooter,
|
|
2181
|
+
tagForm: () => tagForm,
|
|
2182
|
+
tagH1: () => tagH1,
|
|
2183
|
+
tagH2: () => tagH2,
|
|
2184
|
+
tagH3: () => tagH3,
|
|
2185
|
+
tagH4: () => tagH4,
|
|
2186
|
+
tagH5: () => tagH5,
|
|
2187
|
+
tagH6: () => tagH6,
|
|
2188
|
+
tagHead: () => tagHead,
|
|
2189
|
+
tagHeader: () => tagHeader,
|
|
2190
|
+
tagHgroup: () => tagHgroup,
|
|
2191
|
+
tagHr: () => tagHr,
|
|
2192
|
+
tagHtml: () => tagHtml,
|
|
2193
|
+
tagI: () => tagI,
|
|
2194
|
+
tagIframe: () => tagIframe,
|
|
2195
|
+
tagImg: () => tagImg,
|
|
2196
|
+
tagInput: () => tagInput,
|
|
2197
|
+
tagIns: () => tagIns,
|
|
2198
|
+
tagKbd: () => tagKbd,
|
|
2199
|
+
tagLabel: () => tagLabel,
|
|
2200
|
+
tagLegend: () => tagLegend,
|
|
2201
|
+
tagLi: () => tagLi,
|
|
2202
|
+
tagLink: () => tagLink,
|
|
2203
|
+
tagMain: () => tagMain,
|
|
2204
|
+
tagMap: () => tagMap,
|
|
2205
|
+
tagMark: () => tagMark,
|
|
2206
|
+
tagMenu: () => tagMenu,
|
|
2207
|
+
tagMeta: () => tagMeta,
|
|
2208
|
+
tagMeter: () => tagMeter,
|
|
2209
|
+
tagNav: () => tagNav,
|
|
2210
|
+
tagNoscript: () => tagNoscript,
|
|
2211
|
+
tagObject: () => tagObject,
|
|
2212
|
+
tagOl: () => tagOl,
|
|
2213
|
+
tagOptgroup: () => tagOptgroup,
|
|
2214
|
+
tagOption: () => tagOption,
|
|
2215
|
+
tagOutput: () => tagOutput,
|
|
2216
|
+
tagP: () => tagP,
|
|
2217
|
+
tagPicture: () => tagPicture,
|
|
2218
|
+
tagPre: () => tagPre,
|
|
2219
|
+
tagProgress: () => tagProgress,
|
|
2220
|
+
tagQ: () => tagQ,
|
|
2221
|
+
tagRp: () => tagRp,
|
|
2222
|
+
tagRt: () => tagRt,
|
|
2223
|
+
tagRuby: () => tagRuby,
|
|
2224
|
+
tagS: () => tagS,
|
|
2225
|
+
tagSamp: () => tagSamp,
|
|
2226
|
+
tagScript: () => tagScript,
|
|
2227
|
+
tagSearch: () => tagSearch,
|
|
2228
|
+
tagSection: () => tagSection,
|
|
2229
|
+
tagSelect: () => tagSelect,
|
|
2230
|
+
tagSlot: () => tagSlot,
|
|
2231
|
+
tagSmall: () => tagSmall,
|
|
2232
|
+
tagSource: () => tagSource,
|
|
2233
|
+
tagSpan: () => tagSpan,
|
|
2234
|
+
tagStrong: () => tagStrong,
|
|
2235
|
+
tagStyle: () => tagStyle,
|
|
2236
|
+
tagSub: () => tagSub,
|
|
2237
|
+
tagSummary: () => tagSummary,
|
|
2238
|
+
tagSup: () => tagSup,
|
|
2239
|
+
tagTable: () => tagTable,
|
|
2240
|
+
tagTbody: () => tagTbody,
|
|
2241
|
+
tagTd: () => tagTd,
|
|
2242
|
+
tagTemplate: () => tagTemplate,
|
|
2243
|
+
tagTextarea: () => tagTextarea,
|
|
2244
|
+
tagTfoot: () => tagTfoot,
|
|
2245
|
+
tagTh: () => tagTh,
|
|
2246
|
+
tagThead: () => tagThead,
|
|
2247
|
+
tagTime: () => tagTime,
|
|
2248
|
+
tagTitle: () => tagTitle,
|
|
2249
|
+
tagTr: () => tagTr,
|
|
2250
|
+
tagTrack: () => tagTrack,
|
|
2251
|
+
tagU: () => tagU,
|
|
2252
|
+
tagUl: () => tagUl,
|
|
2253
|
+
tagVar: () => tagVar,
|
|
2254
|
+
tagVideo: () => tagVideo,
|
|
2255
|
+
tagWbr: () => tagWbr
|
|
2256
|
+
});
|
|
2257
|
+
var tagA = (properties) => tag("a", properties);
|
|
2258
|
+
var tagAbbr = (properties) => tag("abbr", properties);
|
|
2259
|
+
var tagAddress = (properties) => tag("address", properties);
|
|
2260
|
+
var tagArea = (properties) => tag("area", properties);
|
|
2261
|
+
var tagArticle = (properties) => tag("article", properties);
|
|
2262
|
+
var tagAside = (properties) => tag("aside", properties);
|
|
2263
|
+
var tagAudio = (properties) => tag("audio", properties);
|
|
2264
|
+
var tagB = (properties) => tag("b", properties);
|
|
2265
|
+
var tagBase = (properties) => tag("base", properties);
|
|
2266
|
+
var tagBdi = (properties) => tag("bdi", properties);
|
|
2267
|
+
var tagBdo = (properties) => tag("bdo", properties);
|
|
2268
|
+
var tagBlockquote = (properties) => tag("blockquote", properties);
|
|
2269
|
+
var tagBody = (properties) => tag("body", properties);
|
|
2270
|
+
var tagBr = (properties) => tag("br", properties);
|
|
2271
|
+
var tagButton = (properties) => tag("button", properties);
|
|
2272
|
+
var tagCanvas = (properties) => tag("canvas", properties);
|
|
2273
|
+
var tagCaption = (properties) => tag("caption", properties);
|
|
2274
|
+
var tagCite = (properties) => tag("cite", properties);
|
|
2275
|
+
var tagCode = (properties) => tag("code", properties);
|
|
2276
|
+
var tagCol = (properties) => tag("col", properties);
|
|
2277
|
+
var tagColgroup = (properties) => tag("colgroup", properties);
|
|
2278
|
+
var tagData = (properties) => tag("data", properties);
|
|
2279
|
+
var tagDatalist = (properties) => tag("datalist", properties);
|
|
2280
|
+
var tagDd = (properties) => tag("dd", properties);
|
|
2281
|
+
var tagDel = (properties) => tag("del", properties);
|
|
2282
|
+
var tagDetails = (properties) => tag("details", properties);
|
|
2283
|
+
var tagDfn = (properties) => tag("dfn", properties);
|
|
2284
|
+
var tagDialog = (properties) => tag("dialog", properties);
|
|
2285
|
+
var tagDiv = (properties) => tag("div", properties);
|
|
2286
|
+
var tagDl = (properties) => tag("dl", properties);
|
|
2287
|
+
var tagDt = (properties) => tag("dt", properties);
|
|
2288
|
+
var tagEm = (properties) => tag("em", properties);
|
|
2289
|
+
var tagEmbed = (properties) => tag("embed", properties);
|
|
2290
|
+
var tagFieldset = (properties) => tag("fieldset", properties);
|
|
2291
|
+
var tagFigcaption = (properties) => tag("figcaption", properties);
|
|
2292
|
+
var tagFigure = (properties) => tag("figure", properties);
|
|
2293
|
+
var tagFooter = (properties) => tag("footer", properties);
|
|
2294
|
+
var tagForm = (properties) => tag("form", properties);
|
|
2295
|
+
var tagH1 = (properties) => tag("h1", properties);
|
|
2296
|
+
var tagH2 = (properties) => tag("h2", properties);
|
|
2297
|
+
var tagH3 = (properties) => tag("h3", properties);
|
|
2298
|
+
var tagH4 = (properties) => tag("h4", properties);
|
|
2299
|
+
var tagH5 = (properties) => tag("h5", properties);
|
|
2300
|
+
var tagH6 = (properties) => tag("h6", properties);
|
|
2301
|
+
var tagHead = (properties) => tag("head", properties);
|
|
2302
|
+
var tagHeader = (properties) => tag("header", properties);
|
|
2303
|
+
var tagHgroup = (properties) => tag("hgroup", properties);
|
|
2304
|
+
var tagHr = (properties) => tag("hr", properties);
|
|
2305
|
+
var tagHtml = (properties) => tag("html", properties);
|
|
2306
|
+
var tagI = (properties) => tag("i", properties);
|
|
2307
|
+
var tagIframe = (properties) => tag("iframe", properties);
|
|
2308
|
+
var tagImg = (properties) => tag("img", properties);
|
|
2309
|
+
var tagInput = (properties) => tag("input", properties);
|
|
2310
|
+
var tagIns = (properties) => tag("ins", properties);
|
|
2311
|
+
var tagKbd = (properties) => tag("kbd", properties);
|
|
2312
|
+
var tagLabel = (properties) => tag("label", properties);
|
|
2313
|
+
var tagLegend = (properties) => tag("legend", properties);
|
|
2314
|
+
var tagLi = (properties) => tag("li", properties);
|
|
2315
|
+
var tagLink = (properties) => tag("link", properties);
|
|
2316
|
+
var tagMain = (properties) => tag("main", properties);
|
|
2317
|
+
var tagMap = (properties) => tag("map", properties);
|
|
2318
|
+
var tagMark = (properties) => tag("mark", properties);
|
|
2319
|
+
var tagMenu = (properties) => tag("menu", properties);
|
|
2320
|
+
var tagMeta = (properties) => tag("meta", properties);
|
|
2321
|
+
var tagMeter = (properties) => tag("meter", properties);
|
|
2322
|
+
var tagNav = (properties) => tag("nav", properties);
|
|
2323
|
+
var tagNoscript = (properties) => tag("noscript", properties);
|
|
2324
|
+
var tagObject = (properties) => tag("object", properties);
|
|
2325
|
+
var tagOl = (properties) => tag("ol", properties);
|
|
2326
|
+
var tagOptgroup = (properties) => tag("optgroup", properties);
|
|
2327
|
+
var tagOption = (properties) => tag("option", properties);
|
|
2328
|
+
var tagOutput = (properties) => tag("output", properties);
|
|
2329
|
+
var tagP = (properties) => tag("p", properties);
|
|
2330
|
+
var tagPicture = (properties) => tag("picture", properties);
|
|
2331
|
+
var tagPre = (properties) => tag("pre", properties);
|
|
2332
|
+
var tagProgress = (properties) => tag("progress", properties);
|
|
2333
|
+
var tagQ = (properties) => tag("q", properties);
|
|
2334
|
+
var tagRp = (properties) => tag("rp", properties);
|
|
2335
|
+
var tagRt = (properties) => tag("rt", properties);
|
|
2336
|
+
var tagRuby = (properties) => tag("ruby", properties);
|
|
2337
|
+
var tagS = (properties) => tag("s", properties);
|
|
2338
|
+
var tagSamp = (properties) => tag("samp", properties);
|
|
2339
|
+
var tagScript = (properties) => tag("script", properties);
|
|
2340
|
+
var tagSearch = (properties) => tag("search", properties);
|
|
2341
|
+
var tagSection = (properties) => tag("section", properties);
|
|
2342
|
+
var tagSelect = (properties) => tag("select", properties);
|
|
2343
|
+
var tagSlot = (properties) => tag("slot", properties);
|
|
2344
|
+
var tagSmall = (properties) => tag("small", properties);
|
|
2345
|
+
var tagSource = (properties) => tag("source", properties);
|
|
2346
|
+
var tagSpan = (properties) => tag("span", properties);
|
|
2347
|
+
var tagStrong = (properties) => tag("strong", properties);
|
|
2348
|
+
var tagStyle = (properties) => tag("style", properties);
|
|
2349
|
+
var tagSub = (properties) => tag("sub", properties);
|
|
2350
|
+
var tagSummary = (properties) => tag("summary", properties);
|
|
2351
|
+
var tagSup = (properties) => tag("sup", properties);
|
|
2352
|
+
var tagTable = (properties) => tag("table", properties);
|
|
2353
|
+
var tagTbody = (properties) => tag("tbody", properties);
|
|
2354
|
+
var tagTd = (properties) => tag("td", properties);
|
|
2355
|
+
var tagTemplate = (properties) => tag("template", properties);
|
|
2356
|
+
var tagTextarea = (properties) => tag("textarea", properties);
|
|
2357
|
+
var tagTfoot = (properties) => tag("tfoot", properties);
|
|
2358
|
+
var tagTh = (properties) => tag("th", properties);
|
|
2359
|
+
var tagThead = (properties) => tag("thead", properties);
|
|
2360
|
+
var tagTime = (properties) => tag("time", properties);
|
|
2361
|
+
var tagTitle = (properties) => tag("title", properties);
|
|
2362
|
+
var tagTr = (properties) => tag("tr", properties);
|
|
2363
|
+
var tagTrack = (properties) => tag("track", properties);
|
|
2364
|
+
var tagU = (properties) => tag("u", properties);
|
|
2365
|
+
var tagUl = (properties) => tag("ul", properties);
|
|
2366
|
+
var tagVar = (properties) => tag("var", properties);
|
|
2367
|
+
var tagVideo = (properties) => tag("video", properties);
|
|
2368
|
+
var tagWbr = (properties) => tag("wbr", properties);
|
|
2369
|
+
|
|
2370
|
+
// src/css/variables/css-namespace.ts
|
|
2371
|
+
var sel = {
|
|
2372
|
+
root,
|
|
2373
|
+
all,
|
|
2374
|
+
tag,
|
|
2375
|
+
rule,
|
|
2376
|
+
media,
|
|
2377
|
+
keyframes,
|
|
2378
|
+
...tag_dsl_generated_exports
|
|
2379
|
+
};
|
|
2380
|
+
export {
|
|
2381
|
+
ARIA_ATTRIBUTE_KEYS,
|
|
2382
|
+
Alignment,
|
|
2383
|
+
AppDocument,
|
|
2384
|
+
AppSlot,
|
|
2385
|
+
BOOLEAN_ATTRIBUTE_KEYS,
|
|
2386
|
+
BUTTON_TYPES,
|
|
2387
|
+
BaseAttributeBuilder,
|
|
2388
|
+
Breakpoints,
|
|
2389
|
+
Button,
|
|
2390
|
+
ButtonAttributeBuilder,
|
|
2391
|
+
CSSAnimation,
|
|
2392
|
+
CSSBackground,
|
|
2393
|
+
CSSBorder,
|
|
2394
|
+
CSSColor,
|
|
2395
|
+
CSSColorName,
|
|
2396
|
+
CSSFlex,
|
|
2397
|
+
CSSFont,
|
|
2398
|
+
CSSGrid,
|
|
2399
|
+
CSSList,
|
|
2400
|
+
CSSPropertyKey,
|
|
2401
|
+
CSSSpacing,
|
|
2402
|
+
CSSTable,
|
|
2403
|
+
CSSText,
|
|
2404
|
+
CSSTransform,
|
|
2405
|
+
CSSVisibility,
|
|
2406
|
+
CSSVisual,
|
|
2407
|
+
CssConfig,
|
|
2408
|
+
CssManager,
|
|
2409
|
+
CssPositionMaker,
|
|
2410
|
+
CssStyleManager,
|
|
2411
|
+
DefaultCssManager,
|
|
2412
|
+
DraftOleError,
|
|
2413
|
+
DuplicateCssPropertyError,
|
|
2414
|
+
ExportableError,
|
|
2415
|
+
FileExporter,
|
|
2416
|
+
FormAttributeBuilder,
|
|
2417
|
+
HStack,
|
|
2418
|
+
HTMLFormatter,
|
|
2419
|
+
Heading,
|
|
2420
|
+
HtmlAttribute,
|
|
2421
|
+
HtmlStyle,
|
|
2422
|
+
HtmlTag,
|
|
2423
|
+
INPUT_TYPES,
|
|
2424
|
+
Image,
|
|
2425
|
+
ImageAttributeBuilder,
|
|
2426
|
+
InputAttributeBuilder,
|
|
2427
|
+
JQUERY_METHOD_TYPES,
|
|
2428
|
+
JQueryHelper,
|
|
2429
|
+
JQueryManager,
|
|
2430
|
+
KEY_VALUE_ATTRIBUTE_KEYS,
|
|
2431
|
+
LazyLayoutManager,
|
|
2432
|
+
Link,
|
|
2433
|
+
LinkAttributeBuilder,
|
|
2434
|
+
PageDocument,
|
|
2435
|
+
PairType,
|
|
2436
|
+
PseudoStyleBuilder,
|
|
2437
|
+
SELF_CLOSING_TAGS,
|
|
2438
|
+
Section,
|
|
2439
|
+
SelfClosingType,
|
|
2440
|
+
Spacer,
|
|
2441
|
+
TAG_TYPES,
|
|
2442
|
+
Text,
|
|
2443
|
+
TextType,
|
|
2444
|
+
VStack,
|
|
2445
|
+
Text2 as ViewText,
|
|
2446
|
+
ZStackAlignment,
|
|
2447
|
+
__draftole_label__,
|
|
2448
|
+
a,
|
|
2449
|
+
abbr,
|
|
2450
|
+
address,
|
|
2451
|
+
app,
|
|
2452
|
+
area,
|
|
2453
|
+
article,
|
|
2454
|
+
aside,
|
|
2455
|
+
audio,
|
|
2456
|
+
b,
|
|
2457
|
+
base,
|
|
2458
|
+
blockquote,
|
|
2459
|
+
body,
|
|
2460
|
+
br,
|
|
2461
|
+
button,
|
|
2462
|
+
canvas,
|
|
2463
|
+
caption,
|
|
2464
|
+
cite,
|
|
2465
|
+
code,
|
|
2466
|
+
col,
|
|
2467
|
+
colgroup,
|
|
2468
|
+
createBooleanValue,
|
|
2469
|
+
createCustomValue,
|
|
2470
|
+
createKeyValueValue,
|
|
2471
|
+
createVanillaScript,
|
|
2472
|
+
css,
|
|
2473
|
+
datalist,
|
|
2474
|
+
dd,
|
|
2475
|
+
details,
|
|
2476
|
+
dialog,
|
|
2477
|
+
div,
|
|
2478
|
+
divider,
|
|
2479
|
+
djb2Hash,
|
|
2480
|
+
dl,
|
|
2481
|
+
dt,
|
|
2482
|
+
tags as el,
|
|
2483
|
+
em,
|
|
2484
|
+
embed,
|
|
2485
|
+
emitHandler,
|
|
2486
|
+
escapeHtml,
|
|
2487
|
+
fieldset,
|
|
2488
|
+
figcaption,
|
|
2489
|
+
figure,
|
|
2490
|
+
footer,
|
|
2491
|
+
form,
|
|
2492
|
+
generateScopedClassName,
|
|
2493
|
+
getTagStructure,
|
|
2494
|
+
guardDuplicateCssProperty,
|
|
2495
|
+
h1,
|
|
2496
|
+
h2,
|
|
2497
|
+
h3,
|
|
2498
|
+
h4,
|
|
2499
|
+
h5,
|
|
2500
|
+
h6,
|
|
2501
|
+
head,
|
|
2502
|
+
header,
|
|
2503
|
+
hlUnitToCssString,
|
|
2504
|
+
hr,
|
|
2505
|
+
hstack,
|
|
2506
|
+
html,
|
|
2507
|
+
i,
|
|
2508
|
+
iframe,
|
|
2509
|
+
img,
|
|
2510
|
+
input,
|
|
2511
|
+
isJsParam,
|
|
2512
|
+
jsTemplate,
|
|
2513
|
+
kbd,
|
|
2514
|
+
keyframes,
|
|
2515
|
+
label,
|
|
2516
|
+
legend,
|
|
2517
|
+
li,
|
|
2518
|
+
link,
|
|
2519
|
+
main,
|
|
2520
|
+
mark,
|
|
2521
|
+
media,
|
|
2522
|
+
meta,
|
|
2523
|
+
nav,
|
|
2524
|
+
normalizeClassNames,
|
|
2525
|
+
noscript,
|
|
2526
|
+
ol,
|
|
2527
|
+
optgroup,
|
|
2528
|
+
option,
|
|
2529
|
+
output,
|
|
2530
|
+
p,
|
|
2531
|
+
page,
|
|
2532
|
+
param,
|
|
2533
|
+
picture,
|
|
2534
|
+
pre,
|
|
2535
|
+
q,
|
|
2536
|
+
ref,
|
|
2537
|
+
s,
|
|
2538
|
+
samp,
|
|
2539
|
+
script,
|
|
2540
|
+
section,
|
|
2541
|
+
sel,
|
|
2542
|
+
select,
|
|
2543
|
+
small,
|
|
2544
|
+
source,
|
|
2545
|
+
spacer,
|
|
2546
|
+
span,
|
|
2547
|
+
strong,
|
|
2548
|
+
sub,
|
|
2549
|
+
summary,
|
|
2550
|
+
sup,
|
|
2551
|
+
svg,
|
|
2552
|
+
table,
|
|
2553
|
+
tags,
|
|
2554
|
+
tbody,
|
|
2555
|
+
td,
|
|
2556
|
+
textarea,
|
|
2557
|
+
tfoot,
|
|
2558
|
+
th,
|
|
2559
|
+
thead,
|
|
2560
|
+
time,
|
|
2561
|
+
title,
|
|
2562
|
+
tr,
|
|
2563
|
+
track,
|
|
2564
|
+
u,
|
|
2565
|
+
ul,
|
|
2566
|
+
varTag,
|
|
2567
|
+
video,
|
|
2568
|
+
vstack,
|
|
2569
|
+
wbr,
|
|
2570
|
+
wrapDOMReady,
|
|
2571
|
+
zstack
|
|
2572
|
+
};
|
|
2573
|
+
//# sourceMappingURL=index.js.map
|