@exponential_app/eui 0.0.0-stage → 0.2.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 +201 -0
- package/NOTICE +54 -0
- package/README.md +377 -2
- package/catalog/a11y.json +705 -0
- package/catalog/basic-map.json +104 -0
- package/catalog/code.json +58 -0
- package/catalog/core.catalog.json +5190 -0
- package/catalog/core.schema.json +24542 -0
- package/catalog/host.json +95 -0
- package/catalog/layout.json +20 -0
- package/catalog/limits.json +9 -0
- package/catalog/locale.json +48 -0
- package/catalog/macros.json +4152 -0
- package/catalog/recipes.json +64 -0
- package/catalog/strings.json +84 -0
- package/catalog/style.json +180 -0
- package/catalog/theme.schema.json +47754 -0
- package/catalog/tokens.json +47 -0
- package/conformance/README.md +218 -0
- package/conformance/baseline.ts +101 -0
- package/conformance/browser-page.ts +146 -0
- package/conformance/browser-suites.ts +699 -0
- package/conformance/compare.ts +201 -0
- package/conformance/dom.ts +97 -0
- package/conformance/dump.ts +163 -0
- package/conformance/fonts.json +157 -0
- package/conformance/manifest.json +233 -0
- package/conformance/parity-compare.ts +191 -0
- package/conformance/parity-report.schema.json +73 -0
- package/conformance/parity.ts +412 -0
- package/conformance/pixel.ts +177 -0
- package/conformance/primitives-page.ts +49 -0
- package/conformance/report.schema.json +66 -0
- package/conformance/run.ts +118 -0
- package/conformance/voice-wave-child.ts +102 -0
- package/dist/chunks/index-5fmaa0xq.js +8384 -0
- package/dist/chunks/index-5fmaa0xq.js.map +10 -0
- package/dist/chunks/index-62yzr94z.js +2784 -0
- package/dist/chunks/index-62yzr94z.js.map +10 -0
- package/dist/chunks/index-bg2jsgjq.js +8541 -0
- package/dist/chunks/index-bg2jsgjq.js.map +15 -0
- package/dist/chunks/index-fy7y2nz8.js +186 -0
- package/dist/chunks/index-fy7y2nz8.js.map +9 -0
- package/dist/chunks/index-gtk2gwsb.js +4555 -0
- package/dist/chunks/index-gtk2gwsb.js.map +31 -0
- package/dist/chunks/index-t6qz1770.js +95 -0
- package/dist/chunks/index-t6qz1770.js.map +11 -0
- package/dist/conformance.js +230462 -0
- package/dist/conformance.js.map +10 -0
- package/dist/entries/prompt.js +251 -0
- package/dist/entries/prompt.js.map +11 -0
- package/dist/entries/schema.js +1725 -0
- package/dist/entries/schema.js.map +11 -0
- package/dist/host/index.js +194 -0
- package/dist/host/index.js.map +9 -0
- package/dist/index.js +3840 -0
- package/dist/index.js.map +29 -0
- package/dist/types/src/a11y.d.ts +21 -0
- package/dist/types/src/animation.d.ts +76 -0
- package/dist/types/src/basic-map.d.ts +38 -0
- package/dist/types/src/builder.d.ts +50 -0
- package/dist/types/src/catalog.d.ts +54 -0
- package/dist/types/src/catalog.described.d.ts +33 -0
- package/dist/types/src/catalog.generated.d.ts +904 -0
- package/dist/types/src/chart.d.ts +46 -0
- package/dist/types/src/code.d.ts +44 -0
- package/dist/types/src/color.d.ts +20 -0
- package/dist/types/src/conformance.d.ts +39 -0
- package/dist/types/src/connector/app.d.ts +14 -0
- package/dist/types/src/connector/connector.d.ts +77 -0
- package/dist/types/src/connector/index.d.ts +4 -0
- package/dist/types/src/css.d.ts +27 -0
- package/dist/types/src/define.d.ts +66 -0
- package/dist/types/src/direction.d.ts +16 -0
- package/dist/types/src/dynamic.d.ts +161 -0
- package/dist/types/src/entries/prompt.d.ts +11 -0
- package/dist/types/src/entries/schema.d.ts +8 -0
- package/dist/types/src/expr.d.ts +71 -0
- package/dist/types/src/extension.d.ts +4 -0
- package/dist/types/src/format.d.ts +112 -0
- package/dist/types/src/geometry.d.ts +40 -0
- package/dist/types/src/host/contract.d.ts +225 -0
- package/dist/types/src/host/decoders.d.ts +61 -0
- package/dist/types/src/host/index.d.ts +15 -0
- package/dist/types/src/host/package.d.ts +102 -0
- package/dist/types/src/host/policy.d.ts +107 -0
- package/dist/types/src/host/record-store.d.ts +103 -0
- package/dist/types/src/host/records.d.ts +45 -0
- package/dist/types/src/host/router.d.ts +38 -0
- package/dist/types/src/host/runtime.d.ts +213 -0
- package/dist/types/src/host/signature.d.ts +52 -0
- package/dist/types/src/host/sources.d.ts +22 -0
- package/dist/types/src/host/tools.d.ts +42 -0
- package/dist/types/src/host/transports.d.ts +109 -0
- package/dist/types/src/index.d.ts +69 -0
- package/dist/types/src/layout.d.ts +20 -0
- package/dist/types/src/limits.d.ts +21 -0
- package/dist/types/src/list.d.ts +133 -0
- package/dist/types/src/locale.d.ts +22 -0
- package/dist/types/src/macros.d.ts +29 -0
- package/dist/types/src/overlay.d.ts +27 -0
- package/dist/types/src/prompt.d.ts +44 -0
- package/dist/types/src/qr-code.d.ts +30 -0
- package/dist/types/src/recipes.d.ts +17 -0
- package/dist/types/src/reducer.d.ts +41 -0
- package/dist/types/src/resizable.d.ts +38 -0
- package/dist/types/src/schema.d.ts +7 -0
- package/dist/types/src/strings.d.ts +13 -0
- package/dist/types/src/style.d.ts +201 -0
- package/dist/types/src/test-preload.d.ts +1 -0
- package/dist/types/src/text-shimmer.d.ts +24 -0
- package/dist/types/src/theme-types.d.ts +162 -0
- package/dist/types/src/theme.d.ts +75 -0
- package/dist/types/src/themes.d.ts +22 -0
- package/dist/types/src/tree-guides.d.ts +17 -0
- package/dist/types/src/types.d.ts +320 -0
- package/dist/types/src/validate.d.ts +31 -0
- package/dist/types/src/voice-wave.d.ts +181 -0
- package/dist/types/src/web/base-css.d.ts +1 -0
- package/dist/types/src/web/box-css.d.ts +63 -0
- package/dist/types/src/web/coerce.d.ts +32 -0
- package/dist/types/src/web/custom-icons.generated.d.ts +4 -0
- package/dist/types/src/web/data.d.ts +107 -0
- package/dist/types/src/web/dates.d.ts +12 -0
- package/dist/types/src/web/form.d.ts +44 -0
- package/dist/types/src/web/host-types.d.ts +126 -0
- package/dist/types/src/web/index.d.ts +35 -0
- package/dist/types/src/web/inputs.d.ts +55 -0
- package/dist/types/src/web/list.d.ts +16 -0
- package/dist/types/src/web/listbox.d.ts +14 -0
- package/dist/types/src/web/markdown.d.ts +96 -0
- package/dist/types/src/web/media.d.ts +63 -0
- package/dist/types/src/web/parts.d.ts +4 -0
- package/dist/types/src/web/primitives/alert-dialog.d.ts +10 -0
- package/dist/types/src/web/primitives/alert.d.ts +9 -0
- package/dist/types/src/web/primitives/avatar-color.d.ts +2 -0
- package/dist/types/src/web/primitives/avatar.d.ts +13 -0
- package/dist/types/src/web/primitives/badge.d.ts +10 -0
- package/dist/types/src/web/primitives/breadcrumb.d.ts +10 -0
- package/dist/types/src/web/primitives/button.d.ts +6 -0
- package/dist/types/src/web/primitives/calendar.d.ts +43 -0
- package/dist/types/src/web/primitives/card.d.ts +9 -0
- package/dist/types/src/web/primitives/checkbox.d.ts +5 -0
- package/dist/types/src/web/primitives/choice-tiles.d.ts +32 -0
- package/dist/types/src/web/primitives/cn.d.ts +3 -0
- package/dist/types/src/web/primitives/code-block.d.ts +24 -0
- package/dist/types/src/web/primitives/command.d.ts +134 -0
- package/dist/types/src/web/primitives/context-ring.d.ts +24 -0
- package/dist/types/src/web/primitives/dialog-arms.d.ts +6 -0
- package/dist/types/src/web/primitives/dialog.d.ts +24 -0
- package/dist/types/src/web/primitives/disclosure-header.d.ts +5 -0
- package/dist/types/src/web/primitives/dock.d.ts +42 -0
- package/dist/types/src/web/primitives/dropdown-menu.d.ts +14 -0
- package/dist/types/src/web/primitives/empty-state.d.ts +15 -0
- package/dist/types/src/web/primitives/glass-card.d.ts +4 -0
- package/dist/types/src/web/primitives/hover-card.d.ts +7 -0
- package/dist/types/src/web/primitives/icon-disc.d.ts +12 -0
- package/dist/types/src/web/primitives/index.d.ts +50 -0
- package/dist/types/src/web/primitives/input.d.ts +5 -0
- package/dist/types/src/web/primitives/kbd.d.ts +4 -0
- package/dist/types/src/web/primitives/label.d.ts +3 -0
- package/dist/types/src/web/primitives/measure.d.ts +16 -0
- package/dist/types/src/web/primitives/menu-surface.d.ts +17 -0
- package/dist/types/src/web/primitives/meter.d.ts +21 -0
- package/dist/types/src/web/primitives/popover.d.ts +3 -0
- package/dist/types/src/web/primitives/progress-ring.d.ts +5 -0
- package/dist/types/src/web/primitives/progress.d.ts +8 -0
- package/dist/types/src/web/primitives/scroll-area.d.ts +49 -0
- package/dist/types/src/web/primitives/segmented-control.d.ts +5 -0
- package/dist/types/src/web/primitives/select.d.ts +47 -0
- package/dist/types/src/web/primitives/separator.d.ts +3 -0
- package/dist/types/src/web/primitives/sheet-chrome.d.ts +4 -0
- package/dist/types/src/web/primitives/sheet.d.ts +20 -0
- package/dist/types/src/web/primitives/skeleton.d.ts +3 -0
- package/dist/types/src/web/primitives/spinner.d.ts +3 -0
- package/dist/types/src/web/primitives/switch.d.ts +4 -0
- package/dist/types/src/web/primitives/table.d.ts +11 -0
- package/dist/types/src/web/primitives/tabs.d.ts +13 -0
- package/dist/types/src/web/primitives/textarea.d.ts +3 -0
- package/dist/types/src/web/primitives/toast.d.ts +163 -0
- package/dist/types/src/web/primitives/tooltip.d.ts +3 -0
- package/dist/types/src/web/primitives/truncate.d.ts +7 -0
- package/dist/types/src/web/primitives/typeahead-portal.d.ts +12 -0
- package/dist/types/src/web/primitives/voice-wave.d.ts +50 -0
- package/dist/types/src/web/round5.d.ts +107 -0
- package/dist/types/src/web/share.d.ts +6 -0
- package/dist/types/src/web/table.d.ts +20 -0
- package/dist/types/src/web/theme-css.d.ts +69 -0
- package/dist/types/src/web/urls.d.ts +21 -0
- package/dist/web/index.js +2565 -0
- package/dist/web/index.js.map +28 -0
- package/dist/web/primitives/index.js +1476 -0
- package/dist/web/primitives/index.js.map +57 -0
- package/docs/components.generated.json +6783 -0
- package/docs/package-format.md +182 -0
- package/docs/round-1-contract.md +679 -0
- package/docs/round-2-contract.md +476 -0
- package/docs/round-3-contract.md +174 -0
- package/docs/round-5-contract.md +268 -0
- package/docs/themes.generated.json +3647 -0
- package/fixtures/animations.json +2890 -0
- package/fixtures/bench-list.json +58 -0
- package/fixtures/bind-time.json +54734 -0
- package/fixtures/catalog-basic-map.json +1692 -0
- package/fixtures/catalog-components.json +10293 -0
- package/fixtures/catalog-extension.json +620 -0
- package/fixtures/catalog-macros.json +51805 -0
- package/fixtures/code-tokens.json +1993 -0
- package/fixtures/conformance-baseline.json +59016 -0
- package/fixtures/conformance-cases.json +49 -0
- package/fixtures/conformance-known.json +2111 -0
- package/fixtures/control-geometry.json +5129 -0
- package/fixtures/dashboard.data.json +74 -0
- package/fixtures/dashboard.json +781 -0
- package/fixtures/demo-surface.json +47 -0
- package/fixtures/format.json +870 -0
- package/fixtures/host-package.json +1262 -0
- package/fixtures/host-policy.json +1209 -0
- package/fixtures/host-router.json +2034 -0
- package/fixtures/host-transport.json +590 -0
- package/fixtures/interactions-round1.json +1058 -0
- package/fixtures/kitchen-sink.expanded.json +11972 -0
- package/fixtures/kitchen-sink.json +3140 -0
- package/fixtures/layout-geometry-round1.json +7278 -0
- package/fixtures/layout-geometry.json +2072 -0
- package/fixtures/overlay-geometry.json +272 -0
- package/fixtures/pointer.json +89 -0
- package/fixtures/primitive-specimens.json +59 -0
- package/fixtures/prompt-budget.json +33 -0
- package/fixtures/qr-code.json +480 -0
- package/fixtures/resizable.json +714 -0
- package/fixtures/round4-contract.json +2985 -0
- package/fixtures/specimens.json +11168 -0
- package/fixtures/style-conditions.json +336 -0
- package/fixtures/template-items.json +2215 -0
- package/fixtures/text-direction.json +309 -0
- package/fixtures/text-shimmer.json +96 -0
- package/fixtures/theme-extends.json +573 -0
- package/fixtures/theme-invalid.json +1300 -0
- package/fixtures/theme-recipes.json +61762 -0
- package/fixtures/theme-resolved.json +25969 -0
- package/fixtures/toast-stack.json +215 -0
- package/fixtures/tree-guides.json +224 -0
- package/fixtures/virtual-list.json +733 -0
- package/fixtures/voice-wave.json +19236 -0
- package/generated/ExponentialUICatalog.generated.kt +67 -0
- package/generated/ExponentialUICatalog.generated.swift +67 -0
- package/generated/ExponentialUIThemes.generated.kt +23 -0
- package/generated/ExponentialUIThemes.generated.swift +23 -0
- package/generated/catalog.descriptions.generated.rs +6 -0
- package/generated/catalog.generated.rs +80 -0
- package/generated/catalog.themes.generated.rs +34 -0
- package/generated/core.descriptions.json +2726 -0
- package/generated/core.runtime.json +3944 -0
- package/package.json +87 -4
- package/themes/exponential.recipes.json +49 -0
- package/themes/exponential.theme.json +768 -0
- package/themes/neutral.theme.json +6178 -0
- package/themes/orange.theme.json +43 -0
- package/themes/playful.theme.json +219 -0
- package/vendor/a2ui/LICENSE.txt +203 -0
- package/vendor/a2ui/README.md +27 -0
- package/vendor/a2ui/v0_9/basic_catalog.json +1387 -0
- package/vendor/a2ui/v0_9/basic_catalog_rules.txt +5 -0
- package/vendor/a2ui/v0_9/client_capabilities.json +97 -0
- package/vendor/a2ui/v0_9/client_to_server.json +104 -0
- package/vendor/a2ui/v0_9/common_types.json +315 -0
- package/vendor/a2ui/v0_9/server_to_client.json +132 -0
- package/vendor/json-render/LICENSE.txt +201 -0
- package/vendor/json-render/README.md +13 -0
- package/vendor/nayuki-qr/LICENSE.txt +20 -0
- package/vendor/nayuki-qr/README.md +10 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
export type PropType = `string` | `markdown` | `number` | `boolean` | `enum` | `icon` | `color` | `style` | `array` | `object` | `date` | `url`;
|
|
2
|
+
export interface PropSchema {
|
|
3
|
+
type: PropType;
|
|
4
|
+
/** Model-facing. VAPP-106: ABSENT at runtime on the runtime catalog (`coreCatalog`) until
|
|
5
|
+
* `describeCatalog()` attaches it; typed present because its readers (the prompt, the schema
|
|
6
|
+
* emitter, the docs, an extension's validation) always see it attached. */
|
|
7
|
+
description: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
default?: unknown;
|
|
10
|
+
/** Accepts an A2UI data binding `{path}` or a function call instead of a literal. */
|
|
11
|
+
bindable?: boolean;
|
|
12
|
+
/** Round 1: ALSO accepts `{base, sm?, md?, lg?, xl?}` (keys = the
|
|
13
|
+
* `$breakpoint` token names); the macro expander emits the media blocks. */
|
|
14
|
+
responsive?: boolean;
|
|
15
|
+
/** `enum`: the name of a shared list in `enums`, or … */
|
|
16
|
+
enum?: string;
|
|
17
|
+
/** … an inline list of values. */
|
|
18
|
+
values?: readonly (string | number)[];
|
|
19
|
+
/** `number`: the inclusive bounds a literal must respect (R8 F51: a
|
|
20
|
+
* Rating's `max` stops at 100); both validators refuse a value outside. */
|
|
21
|
+
minimum?: number;
|
|
22
|
+
maximum?: number;
|
|
23
|
+
/** `array`: the item schema. */
|
|
24
|
+
items?: PropSchema;
|
|
25
|
+
/** `object`: the name of a shared shape in `defs`; none = any object. */
|
|
26
|
+
shape?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DefSchema {
|
|
29
|
+
/** Model-facing. VAPP-106: ABSENT at runtime on the runtime catalog (`coreCatalog`) until
|
|
30
|
+
* `describeCatalog()` attaches it; typed present because its readers (the prompt, the schema
|
|
31
|
+
* emitter, the docs, an extension's validation) always see it attached. */
|
|
32
|
+
description: string;
|
|
33
|
+
properties: Record<string, PropSchema>;
|
|
34
|
+
}
|
|
35
|
+
export type ComponentKind = `native` | `macro`;
|
|
36
|
+
export type ChildrenRule = `none` | `one` | `many`;
|
|
37
|
+
export interface ComponentDef {
|
|
38
|
+
kind: ComponentKind;
|
|
39
|
+
group: string;
|
|
40
|
+
lite: boolean;
|
|
41
|
+
children: ChildrenRule;
|
|
42
|
+
/** Named child slots; `["*"]` = any slot name (Table cell templates). */
|
|
43
|
+
slots?: readonly string[];
|
|
44
|
+
/** Round 1: `row` = every slot is a per-ROW cell template (Table): the bind
|
|
45
|
+
* pass leaves it unbound and the painter binds it once per row with the
|
|
46
|
+
* row as its data scope (src/dynamic.ts bindRowSlot). */
|
|
47
|
+
slotScope?: `row`;
|
|
48
|
+
/** Never offered to a model (the Unknown placeholder, TreeGuides = a Row part). */
|
|
49
|
+
hidden?: boolean;
|
|
50
|
+
/** `planned` = in the catalog, painters land later. */
|
|
51
|
+
status?: string;
|
|
52
|
+
/** Model-facing. VAPP-106: ABSENT at runtime on the runtime catalog (`coreCatalog`) until
|
|
53
|
+
* `describeCatalog()` attaches it; typed present because its readers (the prompt, the schema
|
|
54
|
+
* emitter, the docs, an extension's validation) always see it attached. */
|
|
55
|
+
description: string;
|
|
56
|
+
props: Record<string, PropSchema>;
|
|
57
|
+
events?: readonly string[];
|
|
58
|
+
/** The docs' and the fixtures' specimen props; absent on the runtime catalog like `description`. */
|
|
59
|
+
example?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
export interface CatalogSource {
|
|
62
|
+
id: string;
|
|
63
|
+
liteId: string;
|
|
64
|
+
name: string;
|
|
65
|
+
version: string;
|
|
66
|
+
unknownComponent: string;
|
|
67
|
+
enums: Record<string, readonly string[]>;
|
|
68
|
+
defs: Record<string, DefSchema>;
|
|
69
|
+
functions: {
|
|
70
|
+
names: readonly string[];
|
|
71
|
+
core: Record<string, CoreFunctionDef>;
|
|
72
|
+
basic: Record<string, FunctionSignature>;
|
|
73
|
+
};
|
|
74
|
+
/** Round 1: `<Component>.<part>[.<variant>]` → the icons.json name a
|
|
75
|
+
* renderer draws for a part it owns (`$comment` aside). */
|
|
76
|
+
builtinIcons: Record<string, string>;
|
|
77
|
+
components: Record<string, ComponentDef>;
|
|
78
|
+
}
|
|
79
|
+
/** Round 4: a basic function's signature (core.catalog.json `functions.basic`). */
|
|
80
|
+
export interface FunctionSignature {
|
|
81
|
+
/** Argument name → its type (`number`, `string`, `boolean`, `array`, `object`, `any`). */
|
|
82
|
+
args: Record<string, string>;
|
|
83
|
+
returns: string;
|
|
84
|
+
}
|
|
85
|
+
/** Round 1: one core function (core.catalog.json `functions.core`). */
|
|
86
|
+
export interface CoreFunctionDef {
|
|
87
|
+
/** Model-facing. VAPP-106: ABSENT at runtime on the runtime catalog (`coreCatalog`) until
|
|
88
|
+
* `describeCatalog()` attaches it; typed present because its readers (the prompt, the schema
|
|
89
|
+
* emitter, the docs, an extension's validation) always see it attached. */
|
|
90
|
+
description: string;
|
|
91
|
+
/** Argument name → its type (`number`, `string`, `boolean`, `array`, `object`, `any`). */
|
|
92
|
+
args: Record<string, string>;
|
|
93
|
+
returns: string;
|
|
94
|
+
}
|
|
95
|
+
/** A child entry of a macro template: a part, the author's children
|
|
96
|
+
* (`$children`) or one of the author's slots spliced in place (`$slot:name`). */
|
|
97
|
+
export type MacroChild = MacroTemplate | `$children` | `$slot:${string}`;
|
|
98
|
+
/** A macro template node (catalog/macros.json). */
|
|
99
|
+
export interface MacroTemplate {
|
|
100
|
+
part: string;
|
|
101
|
+
component: string;
|
|
102
|
+
props?: Record<string, unknown>;
|
|
103
|
+
style?: Record<string, unknown>;
|
|
104
|
+
children?: MacroChild[];
|
|
105
|
+
/** `$slot:name` copies the author's slot; a template node builds a part. */
|
|
106
|
+
slots?: Record<string, string | MacroTemplate>;
|
|
107
|
+
$if?: unknown;
|
|
108
|
+
$any?: unknown[];
|
|
109
|
+
$each?: string;
|
|
110
|
+
$as?: string;
|
|
111
|
+
$on?: Record<string, string>;
|
|
112
|
+
$context?: Record<string, unknown>;
|
|
113
|
+
$recipe?: Record<string, unknown>;
|
|
114
|
+
/** Round 1 two-way binding: per part event, the macro prop a bound author
|
|
115
|
+
* value is written back to (`set`) and the template value it takes. */
|
|
116
|
+
$set?: Record<string, {
|
|
117
|
+
prop: string;
|
|
118
|
+
value: unknown;
|
|
119
|
+
}>;
|
|
120
|
+
/** Round 1 (docs/round-1-contract.md §6): the part's accessibility — a
|
|
121
|
+
* machine-readable `role` (catalog/a11y.json `roles`), its states and an
|
|
122
|
+
* accessible name — evaluated like any template value (bound inputs emit
|
|
123
|
+
* calls) into the expanded node's `accessibility`. */
|
|
124
|
+
$a11y?: Record<string, unknown>;
|
|
125
|
+
}
|
|
126
|
+
export interface MacroDef {
|
|
127
|
+
recipeProps: readonly string[];
|
|
128
|
+
root: MacroTemplate;
|
|
129
|
+
}
|
|
130
|
+
/** An extension catalog: its own id, extending the core, with components and
|
|
131
|
+
* the macro templates for its macro components. */
|
|
132
|
+
export interface ExtensionDef {
|
|
133
|
+
id: string;
|
|
134
|
+
name: string;
|
|
135
|
+
/** VAPP-161: `MAJOR.MINOR.PATCH`, what a package's `extensions` entry
|
|
136
|
+
* is checked against (caret); unset = satisfies any. */
|
|
137
|
+
version?: string;
|
|
138
|
+
extends: string;
|
|
139
|
+
enums?: Record<string, readonly string[]>;
|
|
140
|
+
defs?: Record<string, DefSchema>;
|
|
141
|
+
components: Record<string, ComponentDef>;
|
|
142
|
+
macros?: Record<string, MacroDef>;
|
|
143
|
+
}
|
|
144
|
+
/** An A2UI v0.9 data binding or function call, passed through untouched. */
|
|
145
|
+
export interface DataBinding {
|
|
146
|
+
path: string;
|
|
147
|
+
}
|
|
148
|
+
export interface FunctionCall {
|
|
149
|
+
call: string;
|
|
150
|
+
args?: Record<string, unknown>;
|
|
151
|
+
returnType?: string;
|
|
152
|
+
}
|
|
153
|
+
/** An A2UI v0.9 Action: a server event or a client function. Round 1: the
|
|
154
|
+
* expander may emit BOTH (a routed event plus a `set` write); a renderer
|
|
155
|
+
* evaluates the function args and the event context first, then runs the
|
|
156
|
+
* function, then dispatches the event. */
|
|
157
|
+
export interface Action {
|
|
158
|
+
event?: {
|
|
159
|
+
name: string;
|
|
160
|
+
context?: Record<string, unknown>;
|
|
161
|
+
};
|
|
162
|
+
/** A2UI v0.9's client function action (round 4: the ONLY key). */
|
|
163
|
+
functionCall?: FunctionCall;
|
|
164
|
+
}
|
|
165
|
+
/** A data-driven child list: one `component` per item at `path`; `key` = a
|
|
166
|
+
* pointer relative to the item that identifies it (reordering keeps the
|
|
167
|
+
* item's state), the index when absent. */
|
|
168
|
+
export interface ChildTemplate {
|
|
169
|
+
component: string;
|
|
170
|
+
path: string;
|
|
171
|
+
key?: string;
|
|
172
|
+
}
|
|
173
|
+
/** The wire form of a template child list (A2UI's `{componentId, path}`,
|
|
174
|
+
* plus round 1's optional `key`). */
|
|
175
|
+
export interface WireChildTemplate {
|
|
176
|
+
componentId: string;
|
|
177
|
+
path: string;
|
|
178
|
+
key?: string;
|
|
179
|
+
}
|
|
180
|
+
/** The common `visible` value: a literal boolean or a dynamic value the
|
|
181
|
+
* renderer resolves (truthiness as `expr.ts truthy`: undefined, null, false
|
|
182
|
+
* and "" hide; 0 shows). Absent = visible. */
|
|
183
|
+
export type Visible = boolean | DataBinding | FunctionCall;
|
|
184
|
+
/** A2UI's AccessibilityAttributes: `label`/`description` are DynamicStrings
|
|
185
|
+
* (a literal, a binding or a call; the bind pass resolves them). */
|
|
186
|
+
export interface AuthoredAccessibility {
|
|
187
|
+
label?: unknown;
|
|
188
|
+
description?: unknown;
|
|
189
|
+
}
|
|
190
|
+
/** Round 1 (docs/round-1-contract.md §6): the accessibility a NORMALIZED node
|
|
191
|
+
* carries: the author's label/description, plus what a macro part's `$a11y`
|
|
192
|
+
* adds (an author's label/description on a macro win over its root's). Every
|
|
193
|
+
* value may be dynamic until the bind pass. A painter maps `role` (one of
|
|
194
|
+
* catalog/a11y.json `roles`) and the states onto the platform: ARIA
|
|
195
|
+
* role/aria-*, SwiftUI traits/values, Compose semantics, AccessKit. */
|
|
196
|
+
export interface NodeAccessibility extends AuthoredAccessibility {
|
|
197
|
+
/** One of `A11Y_ROLES`; absent = the component's own (a11y.json). */
|
|
198
|
+
role?: unknown;
|
|
199
|
+
/** Heading level 1..6 (role heading). */
|
|
200
|
+
level?: unknown;
|
|
201
|
+
/** A disclosure's state (aria-expanded). */
|
|
202
|
+
expanded?: unknown;
|
|
203
|
+
/** `page`, `step` or false (aria-current). */
|
|
204
|
+
current?: unknown;
|
|
205
|
+
/** A selected option, tab or row (aria-selected). */
|
|
206
|
+
selected?: unknown;
|
|
207
|
+
/** A toggle button's state (aria-pressed). */
|
|
208
|
+
pressed?: unknown;
|
|
209
|
+
/** A checkbox/radio state (aria-checked). */
|
|
210
|
+
checked?: unknown;
|
|
211
|
+
/** Progressbar/meter/slider values (aria-valuenow/min/max). */
|
|
212
|
+
valueNow?: unknown;
|
|
213
|
+
valueMin?: unknown;
|
|
214
|
+
valueMax?: unknown;
|
|
215
|
+
/** True = out of the accessibility tree (decorative). */
|
|
216
|
+
hidden?: unknown;
|
|
217
|
+
/** True = focus lands here when the enclosing dialog opens. */
|
|
218
|
+
autoFocus?: unknown;
|
|
219
|
+
}
|
|
220
|
+
/** A node as it rides A2UI's `updateComponents`: props at the top level,
|
|
221
|
+
* children by id. The core catalog keeps that convention. */
|
|
222
|
+
export interface FlatComponent {
|
|
223
|
+
id: string;
|
|
224
|
+
component: string;
|
|
225
|
+
children?: string[] | WireChildTemplate;
|
|
226
|
+
slots?: Record<string, string>;
|
|
227
|
+
on?: Record<string, Action>;
|
|
228
|
+
style?: Record<string, unknown>;
|
|
229
|
+
visible?: Visible;
|
|
230
|
+
accessibility?: AuthoredAccessibility;
|
|
231
|
+
[prop: string]: unknown;
|
|
232
|
+
}
|
|
233
|
+
/** A node of the NORMALIZED tree every painter reads: core vocabulary, props
|
|
234
|
+
* under `props`, children nested, macros expanded (`recipe` names the macro
|
|
235
|
+
* part a theme styles). */
|
|
236
|
+
export interface UiNode {
|
|
237
|
+
id: string;
|
|
238
|
+
component: string;
|
|
239
|
+
props: Record<string, unknown>;
|
|
240
|
+
style?: Record<string, unknown>;
|
|
241
|
+
/** Round 1: falsy once resolved = the node is not rendered and takes no
|
|
242
|
+
* layout space; the expander sets it for a part whose `$if` was bound. */
|
|
243
|
+
visible?: Visible;
|
|
244
|
+
on?: Record<string, Action>;
|
|
245
|
+
accessibility?: NodeAccessibility;
|
|
246
|
+
children: UiNode[];
|
|
247
|
+
slots?: Record<string, UiNode>;
|
|
248
|
+
template?: ChildTemplate;
|
|
249
|
+
/** `authored` (VAPP-163, expansion roots only): the top-level style keys
|
|
250
|
+
* written ON the macro node, sorted; they win over the part recipe. */
|
|
251
|
+
recipe?: {
|
|
252
|
+
macro: string;
|
|
253
|
+
part: string;
|
|
254
|
+
props: Record<string, unknown>;
|
|
255
|
+
authored?: string[];
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** The nested authoring form (fixtures, kitchen sink): the same as UiNode
|
|
259
|
+
* minus what the reducer fills in. */
|
|
260
|
+
export interface NestedNode {
|
|
261
|
+
id: string;
|
|
262
|
+
component: string;
|
|
263
|
+
props?: Record<string, unknown>;
|
|
264
|
+
style?: Record<string, unknown>;
|
|
265
|
+
visible?: Visible;
|
|
266
|
+
on?: Record<string, Action>;
|
|
267
|
+
accessibility?: AuthoredAccessibility;
|
|
268
|
+
children?: NestedNode[];
|
|
269
|
+
slots?: Record<string, NestedNode>;
|
|
270
|
+
template?: ChildTemplate;
|
|
271
|
+
}
|
|
272
|
+
export interface ReduceIssue {
|
|
273
|
+
id: string;
|
|
274
|
+
message: string;
|
|
275
|
+
}
|
|
276
|
+
/** Round 1 (docs/round-1-contract.md §4–6): what a host sets per surface.
|
|
277
|
+
* Every field is optional; the defaults are what a renderer assumes. */
|
|
278
|
+
export interface SurfaceSettings {
|
|
279
|
+
/** BCP 47; drives the format functions, calendar names, the week start
|
|
280
|
+
* and the text direction (catalog/locale.json). Default `en-US`. */
|
|
281
|
+
locale?: string;
|
|
282
|
+
/** Round 2: the IANA zone instants format in (the host Formatter's;
|
|
283
|
+
* default the platform's; the English fallback and the fixtures: UTC). */
|
|
284
|
+
timeZone?: string;
|
|
285
|
+
/** Built-in UI string overrides by id (catalog/strings.json). */
|
|
286
|
+
strings?: Record<string, string>;
|
|
287
|
+
/** `system` (default) = the platform's light/dark preference. */
|
|
288
|
+
mode?: `light` | `dark` | `system`;
|
|
289
|
+
/** Scales `$control.*` and `$spacing.*` by the theme's `$density.*`. */
|
|
290
|
+
density?: `compact` | `default` | `comfortable`;
|
|
291
|
+
/** `system` (default) = the platform's high-contrast setting; `high`
|
|
292
|
+
* forces the theme's `contrast` overlays. */
|
|
293
|
+
contrast?: `normal` | `high` | `system`;
|
|
294
|
+
/** The theme id (a built-in or one the host loaded). */
|
|
295
|
+
theme?: string;
|
|
296
|
+
}
|
|
297
|
+
/** Round 1 (catalog/a11y.json `commands`): what a host may ask of a live
|
|
298
|
+
* surface. */
|
|
299
|
+
export type SurfaceCommand = {
|
|
300
|
+
focus: {
|
|
301
|
+
id: string;
|
|
302
|
+
};
|
|
303
|
+
} | {
|
|
304
|
+
announce: {
|
|
305
|
+
text: string;
|
|
306
|
+
live?: `polite` | `assertive`;
|
|
307
|
+
};
|
|
308
|
+
} | {
|
|
309
|
+
scrollIntoView: {
|
|
310
|
+
id: string;
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/** Round 2: bring item `index` (data order) of List/Table `id` into view. */
|
|
314
|
+
| {
|
|
315
|
+
scrollToIndex: {
|
|
316
|
+
id: string;
|
|
317
|
+
index: number;
|
|
318
|
+
align?: `start` | `center` | `end` | `nearest`;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { isDynamic } from "./expr.js";
|
|
2
|
+
import type { ComponentDef, ExtensionDef } from "./types.js";
|
|
3
|
+
export interface PropIssue {
|
|
4
|
+
path: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export { isDynamic };
|
|
8
|
+
/** A function name a surface may call: a catalog function, or a HOST
|
|
9
|
+
* function, which is always namespaced (`app.toast`, `harness.openIssue`). */
|
|
10
|
+
export declare function isCallableName(name: string): boolean;
|
|
11
|
+
/** What validateProps leaves out, round 4 (VAPP-103): the node's `style`
|
|
12
|
+
* (whitelisted keys, known tokens, `$color.*` colours), every function a
|
|
13
|
+
* prop (along its schema: never inside DATA), `visible` or an `on` action
|
|
14
|
+
* calls, and a Table's slot columns (each `type: slot` column names one of
|
|
15
|
+
* the node's slots). In this order; the Rust core
|
|
16
|
+
* (`validate::validate_node`) reports the same issues. */
|
|
17
|
+
export declare function validateNode(node: {
|
|
18
|
+
component: string;
|
|
19
|
+
props: Record<string, unknown>;
|
|
20
|
+
style?: unknown;
|
|
21
|
+
visible?: unknown;
|
|
22
|
+
on?: Record<string, unknown>;
|
|
23
|
+
slots?: Record<string, unknown>;
|
|
24
|
+
}, options?: {
|
|
25
|
+
extensions?: readonly ExtensionDef[];
|
|
26
|
+
}): PropIssue[];
|
|
27
|
+
/** Every issue in a node's props against its component definition. */
|
|
28
|
+
export declare function validateProps(def: ComponentDef, props: Record<string, unknown>, options?: {
|
|
29
|
+
path?: string;
|
|
30
|
+
extensions?: readonly ExtensionDef[];
|
|
31
|
+
}): PropIssue[];
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export declare const VOICE_WAVE: {
|
|
2
|
+
$comment: string;
|
|
3
|
+
steps: number;
|
|
4
|
+
radius: number[];
|
|
5
|
+
harmonics: number[][];
|
|
6
|
+
phase0: number[];
|
|
7
|
+
ringAmp: number[];
|
|
8
|
+
ampBase: number;
|
|
9
|
+
ampLevel: number;
|
|
10
|
+
thinkingAmp: number;
|
|
11
|
+
phaseSpeed: number;
|
|
12
|
+
fillAlpha: number[];
|
|
13
|
+
strokeAlpha: number[];
|
|
14
|
+
strokeWidth: number[];
|
|
15
|
+
childScale: number;
|
|
16
|
+
childScaleLarge: number;
|
|
17
|
+
maxBands: number;
|
|
18
|
+
bars: {
|
|
19
|
+
$comment: string;
|
|
20
|
+
count: number;
|
|
21
|
+
minFraction: number;
|
|
22
|
+
envelope: number;
|
|
23
|
+
shapeFreq: number;
|
|
24
|
+
shapeBase: number;
|
|
25
|
+
sizes: {
|
|
26
|
+
sm: {
|
|
27
|
+
height: number;
|
|
28
|
+
barWidth: number;
|
|
29
|
+
gap: number;
|
|
30
|
+
};
|
|
31
|
+
md: {
|
|
32
|
+
height: number;
|
|
33
|
+
barWidth: number;
|
|
34
|
+
gap: number;
|
|
35
|
+
};
|
|
36
|
+
lg: {
|
|
37
|
+
height: number;
|
|
38
|
+
barWidth: number;
|
|
39
|
+
gap: number;
|
|
40
|
+
};
|
|
41
|
+
xl: {
|
|
42
|
+
height: number;
|
|
43
|
+
barWidth: number;
|
|
44
|
+
gap: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const VOICE_WAVE_ACTIVITIES: readonly ["idle", "listening", "thinking", "speaking", "muted"];
|
|
50
|
+
export type VoiceWaveActivity = (typeof VOICE_WAVE_ACTIVITIES)[number];
|
|
51
|
+
export declare const VOICE_WAVE_RINGS: readonly ["outer", "mid", "inner"];
|
|
52
|
+
export type VoiceWaveRingName = (typeof VOICE_WAVE_RINGS)[number];
|
|
53
|
+
export interface VoiceWaveInput {
|
|
54
|
+
/** The box edge in px (the root recipe's width). */
|
|
55
|
+
size: number;
|
|
56
|
+
activity: VoiceWaveActivity;
|
|
57
|
+
/** 0..1; clamped. */
|
|
58
|
+
level?: number;
|
|
59
|
+
/** 0..1 each; the first `maxBands` count, clamped. */
|
|
60
|
+
bands?: readonly number[];
|
|
61
|
+
/** Seconds since the wave started animating (ignored when idle or muted). */
|
|
62
|
+
elapsed?: number;
|
|
63
|
+
reducedMotion?: boolean;
|
|
64
|
+
/** The one child's own laid-out size (the core centres it at that size). */
|
|
65
|
+
child?: {
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Where the painter draws the child: its own box scaled about the wave's
|
|
71
|
+
* centre by `scale` = min(1, childSize / its longer edge), never up; 0 =
|
|
72
|
+
* kept in the tree but not painted (`sm`). */
|
|
73
|
+
export interface VoiceWaveChildBox {
|
|
74
|
+
x: number;
|
|
75
|
+
y: number;
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
scale: number;
|
|
79
|
+
}
|
|
80
|
+
export interface VoiceWaveRing {
|
|
81
|
+
/** The recipe part that colours it. */
|
|
82
|
+
part: VoiceWaveRingName;
|
|
83
|
+
/** `steps + 1` points, x/y in px from the box's top-left (the last repeats the first). */
|
|
84
|
+
points: Array<[number, number]>;
|
|
85
|
+
fillAlpha: number;
|
|
86
|
+
strokeAlpha: number;
|
|
87
|
+
strokeWidth: number;
|
|
88
|
+
}
|
|
89
|
+
export interface VoiceWave {
|
|
90
|
+
rings: VoiceWaveRing[];
|
|
91
|
+
/** The centre child's edge in px; 0 = the child is not painted (`sm`). */
|
|
92
|
+
childSize: number;
|
|
93
|
+
/** The phase the rings were drawn at (radians). */
|
|
94
|
+
phase: number;
|
|
95
|
+
/** Present when the input gave the child's size. */
|
|
96
|
+
child?: VoiceWaveChildBox;
|
|
97
|
+
}
|
|
98
|
+
/** The phase a painter draws at `elapsed` seconds. */
|
|
99
|
+
export declare function voiceWavePhase(raw: VoiceWaveActivity, elapsed: number, reducedMotion?: boolean): number;
|
|
100
|
+
/** The child's edge for a box `size` (the size enum's px, sm 32 · md 56 · lg 160 · xl 200). */
|
|
101
|
+
export declare function voiceWaveChildSize(size: number): number;
|
|
102
|
+
/** The child's painted box in a wave of edge `size` (see VoiceWaveChildBox). */
|
|
103
|
+
export declare function voiceWaveChildBox(size: number, child: {
|
|
104
|
+
width: number;
|
|
105
|
+
height: number;
|
|
106
|
+
}): VoiceWaveChildBox;
|
|
107
|
+
/** The three rings for one frame. Coordinates are rounded to 0.01 px. */
|
|
108
|
+
/** The activity as the catalog names it; anything else (a bound string, a
|
|
109
|
+
* typo) is `idle`, in every renderer (the Rust core: `#[serde(other)]`). */
|
|
110
|
+
export declare function voiceWaveActivity(value: unknown): VoiceWaveActivity;
|
|
111
|
+
export declare function voiceWave(raw: VoiceWaveInput): VoiceWave;
|
|
112
|
+
/** An SVG path (`M … L … Z`) for a ring: what the web painters set as `d`. */
|
|
113
|
+
export declare function voiceWavePath(ring: VoiceWaveRing): string;
|
|
114
|
+
export declare const VOICE_WAVE_BARS: {
|
|
115
|
+
$comment: string;
|
|
116
|
+
count: number;
|
|
117
|
+
minFraction: number;
|
|
118
|
+
envelope: number;
|
|
119
|
+
shapeFreq: number;
|
|
120
|
+
shapeBase: number;
|
|
121
|
+
sizes: {
|
|
122
|
+
sm: {
|
|
123
|
+
height: number;
|
|
124
|
+
barWidth: number;
|
|
125
|
+
gap: number;
|
|
126
|
+
};
|
|
127
|
+
md: {
|
|
128
|
+
height: number;
|
|
129
|
+
barWidth: number;
|
|
130
|
+
gap: number;
|
|
131
|
+
};
|
|
132
|
+
lg: {
|
|
133
|
+
height: number;
|
|
134
|
+
barWidth: number;
|
|
135
|
+
gap: number;
|
|
136
|
+
};
|
|
137
|
+
xl: {
|
|
138
|
+
height: number;
|
|
139
|
+
barWidth: number;
|
|
140
|
+
gap: number;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
export declare const VOICE_WAVE_SIZES: readonly ["sm", "md", "lg", "xl"];
|
|
145
|
+
export type VoiceWaveSizeName = (typeof VOICE_WAVE_SIZES)[number];
|
|
146
|
+
export declare const VOICE_WAVE_VARIANTS: readonly ["ring", "bars"];
|
|
147
|
+
export type VoiceWaveVariant = (typeof VOICE_WAVE_VARIANTS)[number];
|
|
148
|
+
/** The variant as the catalog names it; anything else is `ring`. */
|
|
149
|
+
export declare function voiceWaveVariant(value: unknown): VoiceWaveVariant;
|
|
150
|
+
export interface VoiceWaveBarsInput {
|
|
151
|
+
/** The size class (an unknown one is `md`). */
|
|
152
|
+
size: VoiceWaveSizeName;
|
|
153
|
+
activity: VoiceWaveActivity;
|
|
154
|
+
level?: number;
|
|
155
|
+
bands?: readonly number[];
|
|
156
|
+
elapsed?: number;
|
|
157
|
+
reducedMotion?: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface VoiceWaveBar {
|
|
160
|
+
x: number;
|
|
161
|
+
y: number;
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
164
|
+
radius: number;
|
|
165
|
+
}
|
|
166
|
+
export interface VoiceWaveBars {
|
|
167
|
+
/** The root box: count × barWidth + (count − 1) × gap wide, `height` tall. */
|
|
168
|
+
width: number;
|
|
169
|
+
height: number;
|
|
170
|
+
phase: number;
|
|
171
|
+
bars: VoiceWaveBar[];
|
|
172
|
+
}
|
|
173
|
+
/** The box of a `bars` meter for a size class. */
|
|
174
|
+
export declare function voiceWaveBarsBox(raw: unknown): {
|
|
175
|
+
width: number;
|
|
176
|
+
height: number;
|
|
177
|
+
barWidth: number;
|
|
178
|
+
gap: number;
|
|
179
|
+
};
|
|
180
|
+
/** The bars for one frame (style.json `voiceWave.bars` $comment). */
|
|
181
|
+
export declare function voiceWaveBars(raw: VoiceWaveBarsInput): VoiceWaveBars;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BASE_CSS: string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type FontSpec, type ResolvedTheme, type UiNode } from "@exponential_app/eui";
|
|
2
|
+
export declare const nodeClass: (id: string) => string;
|
|
3
|
+
export declare const surfaceClass: (surfaceId: string) => string;
|
|
4
|
+
/** Ids are author strings; keep the class usable in a selector. */
|
|
5
|
+
export declare function cssEscape(text: string): string;
|
|
6
|
+
export declare function walkNodes(root: UiNode): Generator<UiNode>;
|
|
7
|
+
/** One dynamic style value of a node: where it sits and its variable. */
|
|
8
|
+
export interface DynamicStyleEntry {
|
|
9
|
+
/** `--xd-<n>`, numbered in walk order (base keys, then each block). */
|
|
10
|
+
name: string;
|
|
11
|
+
/** The condition key (`@media …`, `:hover`) or `` for the base style. */
|
|
12
|
+
block: string;
|
|
13
|
+
key: string;
|
|
14
|
+
value: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** The node's dynamic style values in the order the sheet numbers them. */
|
|
17
|
+
export declare function dynamicStyleEntries(style: Record<string, unknown> | undefined): DynamicStyleEntry[];
|
|
18
|
+
/** A JS-evaluated condition (height / orientation): its `data-xq` token. */
|
|
19
|
+
export declare function queryToken(key: string): string;
|
|
20
|
+
export interface NodeSheet {
|
|
21
|
+
css: string;
|
|
22
|
+
/** The resolved condition keys the surface must evaluate itself and list
|
|
23
|
+
* in `data-xq` when they hold (height, orientation). */
|
|
24
|
+
queries: string[];
|
|
25
|
+
/** VAPP-152: each styled node's rules by id, in walk order (`css` is
|
|
26
|
+
* their concatenation inside the `xui-node` layer). VAPP-163: a node
|
|
27
|
+
* with authored keys appends `AUTHOR_SEP` + its `xui-author` rules;
|
|
28
|
+
* `layeredCss` splits them into the two layers. */
|
|
29
|
+
chunks: ReadonlyMap<string, string>;
|
|
30
|
+
}
|
|
31
|
+
/** The key a surface evaluates itself for a `@media` block (size values
|
|
32
|
+
* resolved to px: `@media (min-width: 768px)`); null = never matches. */
|
|
33
|
+
export declare function resolvedMediaKey(key: string, theme: ResolvedTheme | undefined): string | null;
|
|
34
|
+
/** A node's own `direction` (round 2 §2): its base style's, then every
|
|
35
|
+
* MATCHING `@media` block's in source order (later wins), as
|
|
36
|
+
* `resolveConditions` flattens it; `matches` = the surface's `data-xq`. */
|
|
37
|
+
export declare function styleDirection(style: Record<string, unknown> | undefined, theme: ResolvedTheme | undefined, matches: (resolvedKey: string) => boolean): `ltr` | `rtl` | undefined;
|
|
38
|
+
/** VAPP-163: separates a chunk's `xui-node` rules from its `xui-author`
|
|
39
|
+
* rules (NUL never survives in CSS, so it never occurs in a rule). */
|
|
40
|
+
export declare const AUTHOR_SEP = "\0";
|
|
41
|
+
/** Chunks (`NodeSheet.chunks`) as one stylesheet: every node's rules in the
|
|
42
|
+
* `xui-node` layer, then the authored ones in `xui-author`. */
|
|
43
|
+
export declare function layeredCss(chunks: Iterable<string>): string;
|
|
44
|
+
/** The node sheet for one tree (plus the template subtrees it renders). */
|
|
45
|
+
export declare function compileNodeSheet(roots: readonly UiNode[], surfaceId: string, theme?: ResolvedTheme, fonts?: Record<string, FontSpec>): NodeSheet;
|
|
46
|
+
/** VAPP-152: one `<style>` of the node sheet: the rules of some nodes. */
|
|
47
|
+
export interface NodeSheetBatch {
|
|
48
|
+
readonly chunks: ReadonlyMap<string, string>;
|
|
49
|
+
readonly css: string;
|
|
50
|
+
}
|
|
51
|
+
/** VAPP-152: the node sheet as `<style>` batches, the last ones kept. A
|
|
52
|
+
* rewritten stylesheet makes Chromium re-match every node its rules
|
|
53
|
+
* select, so a batch whose rules are all unchanged keeps its OBJECT (the
|
|
54
|
+
* renderers leave its element alone), a batch with a changed or removed
|
|
55
|
+
* node is rewritten in place, and the new nodes' rules land in ONE new
|
|
56
|
+
* batch at the end (a streamed card restyles only itself). A batch at
|
|
57
|
+
* least as large as the one before it merges into it (a binary counter:
|
|
58
|
+
* at most log2(n) batches, each node rewritten O(log n) times). Rules of
|
|
59
|
+
* different nodes never select the same element, so the order of the
|
|
60
|
+
* batches does not change the cascade. */
|
|
61
|
+
export declare function nodeSheetBatches(prev: readonly NodeSheetBatch[], chunks: ReadonlyMap<string, string>): NodeSheetBatch[];
|
|
62
|
+
/** The node sheet's CSS for one tree (the VAPP-87 entry point). */
|
|
63
|
+
export declare function nodeSheet(root: UiNode, surfaceId: string, fontsOrTheme?: Record<string, FontSpec> | ResolvedTheme, extra?: readonly UiNode[]): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const str: (v: unknown, fallback?: string) => string;
|
|
2
|
+
export declare const num: (v: unknown, fallback?: number) => number;
|
|
3
|
+
export declare const bool: (v: unknown) => boolean;
|
|
4
|
+
export declare const arr: <T>(v: unknown) => T[];
|
|
5
|
+
/** An array of OBJECTS (options, items, tabs, columns, rows…): entries that
|
|
6
|
+
* are not objects (`options: [null]`) are skipped, never painted. */
|
|
7
|
+
export declare const objects: <T>(v: unknown) => T[];
|
|
8
|
+
/** A built-in PHRASE with placeholders (`removeItem` = `Remove {name}`):
|
|
9
|
+
* the surface's string table entry when it carries `id` (word order is the
|
|
10
|
+
* translation's), else `fallback()`, the round-1 composition kept until
|
|
11
|
+
* catalog/strings.json ships the id. */
|
|
12
|
+
export declare function phrase(ctx: {
|
|
13
|
+
strings: Readonly<Record<string, string>>;
|
|
14
|
+
t: (id: string, params?: Record<string, unknown>) => string;
|
|
15
|
+
}, id: string, params: Record<string, unknown>, fallback: () => string): string;
|
|
16
|
+
/** A byte count in the surface locale with a LOCALIZED unit (1024 steps,
|
|
17
|
+
* `Intl.NumberFormat` `style: "unit"`, e.g. `1,5 kB` / `١٫٥ ك.بايت`). */
|
|
18
|
+
export declare function formatFileSize(bytes: number, locale: string): string;
|
|
19
|
+
/** Does a file match an `accept` list (`image/*,.pdf`)? */
|
|
20
|
+
export declare function acceptsFile(accept: string, file: {
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}): boolean;
|
|
24
|
+
/** A control's `checks` evaluated: EVERY failing message, in order (a
|
|
25
|
+
* check without one says `$string.invalidValue`: pass the surface's). */
|
|
26
|
+
export declare function failingChecks(checks: unknown, fallback?: string): string[];
|
|
27
|
+
/** The first failing message, or null (kept for hosts that used it). */
|
|
28
|
+
export declare function failingCheck(checks: unknown, fallback?: string): string | null;
|
|
29
|
+
/** The icons.json name a renderer draws for an owned part. */
|
|
30
|
+
export declare function builtinIconName(slot: string): string;
|
|
31
|
+
/** Space-joined element ids (`aria-describedby`), undefined when none. */
|
|
32
|
+
export declare function joinIds(...ids: (string | undefined | false)[]): string | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** One Lucide icon node: an element name and its attributes. */
|
|
2
|
+
export type CustomIconNode = [string, Record<string, string>][];
|
|
3
|
+
/** icons.json `custom` + `imported` names -> their Lucide icon nodes. */
|
|
4
|
+
export declare const CUSTOM_ICON_NODES: Record<string, CustomIconNode>;
|