@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,69 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export { CORE_CATALOG_ID, CORE_LITE_CATALOG_ID, A2UI_BASIC_CATALOG_ID, A2UI_VERSION, SUPPORTED_CATALOG_IDS, UNKNOWN_COMPONENT, TOKEN_GROUPS, coreCatalog, coreMacros, catalogView, sharedCatalogView, componentDef, componentNames, coreLite, isOffered, parseTokenRef, isKnownToken, } from "./catalog.js";
|
|
3
|
+
export type { CatalogView } from "./catalog.js";
|
|
4
|
+
export * from "./catalog.generated.js";
|
|
5
|
+
export { STYLE_KEYS, STYLE_LAYOUT_KEYS, STYLE_VISUAL_KEYS, STYLE_LAYOUT_EFFECT_KEYS, STYLE_MEDIA, STYLE_STATES, STYLE_TRANSFORM, validateStyle, create, props, parseMediaCondition, mediaMatches, resolveConditions, activeBreakpoint, styleKeyEnum, styleKeyType, } from "./style.js";
|
|
6
|
+
export type { Style, StyleProps, MediaKey, StateKey, StyleIssue, Gradient, ConditionContext, MediaCondition } from "./style.js";
|
|
7
|
+
export { validateProps, validateNode, isCallableName, isDynamic } from "./validate.js";
|
|
8
|
+
export type { PropIssue } from "./validate.js";
|
|
9
|
+
export { evalValue, evalExpr, evalCondition, evalConditionValue, truthy, isBinding, isCall, percent, valuesEqual, clampNumber, fillTemplate, filterItems, CORE_FUNCTIONS, CORE_FUNCTION_NAMES } from "./expr.js";
|
|
10
|
+
export type { ExprContext, Dynamic } from "./expr.js";
|
|
11
|
+
export { expandMacros, isResponsiveValue, responsiveAt, propsAt, BREAKPOINTS } from "./macros.js";
|
|
12
|
+
export { resolveDynamic, isVisible, runAction, withOwnWrites, submitClosesOverlay, bindTree, readPointer, writePointer, writeTokens, POINTER_ISSUES, absolutePath, readPath, hasItem, isDataSchema, resolveProp, resolveNodeProps, hasRowSlots, rowScope, bindRowSlot, sectionScope, bindSectionHeader, BIND_FUNCTIONS, BIND_FUNCTION_NAMES } from "./dynamic.js";
|
|
13
|
+
export { displayString, englishFormatter, intlFormatter, formatFunctions, formatPattern, parseDateValue, relativeTimeUnit, currencyDigits, FORMAT_FUNCTION_NAMES, ENGLISH_FORMAT_FUNCTIONS, ENGLISH_DATE_PATTERNS, ENGLISH_TIME_PATTERN, ENGLISH_DATE_TIME_JOIN, fixedOffset, intlZoneOffset } from "./format.js";
|
|
14
|
+
export type { Formatter, NumberOptions, DateOptions, DateStyle, PluralCategory, RelativeUnit, ZoneOffset } from "./format.js";
|
|
15
|
+
export { templateItemKeys, tableRowKeys, templateInstances, itemExtents, itemOffsets, virtualWindow, scrollOffsetForIndex, scrollOffsetForItem, instanceSegment, listSections, sectionRows, stickyHeader, templateBudget, templateSiteKey, WINDOW_OVERSCAN } from "./list.js";
|
|
16
|
+
export type { TemplateInstance, TemplateBudget, WindowRange, ScrollAlign, ListSection } from "./list.js";
|
|
17
|
+
export { normalizeSizes, resizePanels, keyboardResize, panelExtents, dragDelta, RESIZE_STEP, PANEL_MIN, RESIZE_HANDLE_HIT } from "./resizable.js";
|
|
18
|
+
export type { PanelLimits, ResizeKey } from "./resizable.js";
|
|
19
|
+
export { nodeDirections, physicalTextAlign, nodeTextAlign } from "./direction.js";
|
|
20
|
+
export type { Direction, PhysicalAlign } from "./direction.js";
|
|
21
|
+
export { LIMITS, MAX_COMPONENTS, MAX_DEPTH, MAX_MESSAGE_BYTES, MAX_TEMPLATE_ITEMS, MAX_POINTER_BYTES, MAX_POINTER_SEGMENTS, LIMIT_ISSUES } from "./limits.js";
|
|
22
|
+
export { LAYOUT_CONSTANTS, FIELD_INTRINSIC_WIDTH, MEDIA_INTRINSIC_WIDTH, MEDIA_ASPECT_RATIO, TREE_GUIDE_COLUMN, TREE_GUIDE_RADIUS, TREE_GUIDE_BRIDGE, PENDING_DELAY_MS, SKELETON_PULSE_MS, SKELETON_OPACITY_LOW, SKELETON_OPACITY_HIGH, SKELETON_REDUCED_OPACITY, SEARCH_LIST_FADE } from "./layout.js";
|
|
23
|
+
export { treeGuides, applyTreeGuides, isRowRoot } from "./tree-guides.js";
|
|
24
|
+
export type { TreeGuide } from "./tree-guides.js";
|
|
25
|
+
export { ANIMATIONS, ANIMATION_NAMES, ANIMATION_PROPERTIES_CSS, animatesOpacity, animationTiming, animationFrame, cubicBezier, keyframesCss, animationCss, paintedOpacity } from "./animation.js";
|
|
26
|
+
export type { AnimationDef, AnimationFrame, AnimationTiming, Keyframe } from "./animation.js";
|
|
27
|
+
export type { DataScope, ResolveOptions, ActionOutcome, FunctionTable, PointerWrite } from "./dynamic.js";
|
|
28
|
+
export { DEFAULT_STRINGS, STRING_IDS, parseStringRef, isStringRef, stringTable, formatString, resolveString } from "./strings.js";
|
|
29
|
+
export { DEFAULT_LOCALE, parseLocale, localeRegion, weekStart, textDirection, RTL_MIRRORED_ICONS, mirrorsInRtl } from "./locale.js";
|
|
30
|
+
export type { LocaleParts } from "./locale.js";
|
|
31
|
+
export { tokenizeCode, codeText, ansiRuns, CODE_LANGUAGES, CODE_LANGUAGE_NAMES } from "./code.js";
|
|
32
|
+
export type { AnsiRun } from "./code.js";
|
|
33
|
+
export { textShimmer, TEXT_SHIMMER } from "./text-shimmer.js";
|
|
34
|
+
export type { TextShimmer } from "./text-shimmer.js";
|
|
35
|
+
export { voiceWave, voiceWavePath, voiceWavePhase, voiceWaveChildSize, voiceWaveChildBox, voiceWaveActivity, VOICE_WAVE, VOICE_WAVE_ACTIVITIES, VOICE_WAVE_RINGS } from "./voice-wave.js";
|
|
36
|
+
export type { VoiceWave, VoiceWaveActivity, VoiceWaveChildBox, VoiceWaveInput, VoiceWaveRing, VoiceWaveRingName } from "./voice-wave.js";
|
|
37
|
+
export { voiceWaveBars, voiceWaveBarsBox, voiceWaveVariant, VOICE_WAVE_BARS, VOICE_WAVE_SIZES, VOICE_WAVE_VARIANTS } from "./voice-wave.js";
|
|
38
|
+
export type { VoiceWaveBar, VoiceWaveBars, VoiceWaveBarsInput, VoiceWaveSizeName, VoiceWaveVariant } from "./voice-wave.js";
|
|
39
|
+
export { qrMatrix, qrLayout, qrLevel, qrVersion, QR_CODE, QR_LEVELS } from "./qr-code.js";
|
|
40
|
+
export type { QrLevel, QrMatrix } from "./qr-code.js";
|
|
41
|
+
export { A11Y_ROLES, A11Y_RULES, A11Y_COMMANDS, COMPONENT_A11Y, componentA11y, isA11yRole } from "./a11y.js";
|
|
42
|
+
export { chartExtent, chartSummaryParams, sparklineSummaryParams, niceTicks, seriesColor, DONUT_HOLE, WINDOW_THRESHOLD } from "./chart.js";
|
|
43
|
+
export type { ChartSeries } from "./chart.js";
|
|
44
|
+
export type { ComponentA11y } from "./a11y.js";
|
|
45
|
+
export type { CodeToken } from "./code.js";
|
|
46
|
+
export { basicMap, mapBasicComponent, mapBasicIcon, BASIC_TRANSFORM_NAMES } from "./basic-map.js";
|
|
47
|
+
export type { MappedComponent } from "./basic-map.js";
|
|
48
|
+
export { reduceSurface, reduceNested, preorder, RESERVED_KEYS, validVisible, slotAllowed, childTemplate } from "./reducer.js";
|
|
49
|
+
export type { ReduceOptions, ReduceResult } from "./reducer.js";
|
|
50
|
+
export { defineExtension, validateExtension } from "./extension.js";
|
|
51
|
+
export { defineSurface, flattenSurface, ui, el, bind, call, event, run } from "./define.js";
|
|
52
|
+
export type { SurfaceNode, TemplateChildren, DefineOptions, DefinedSurface, Factory } from "./define.js";
|
|
53
|
+
export * from "./theme-types.js";
|
|
54
|
+
export { parseColor, toHex, toThemeHex, isThemeHex, luminance, contrast } from "./color.js";
|
|
55
|
+
export type { Rgba } from "./color.js";
|
|
56
|
+
export { RECIPE_STATES, RECIPE_KEYS, recipeParts, macroParts, nativeRecipeProps } from "./recipes.js";
|
|
57
|
+
export type { PartSpec } from "./recipes.js";
|
|
58
|
+
export { MODES, DENSITIES, THEME_SCHEMA_ID, resolveMode, applyDensity, applyContrast, resolveConditionKey, easingCss, ThemeError, validateTheme, tryLoadTheme, loadTheme, resolveToken, resolveStyleValues, recipeStyle, resolveRecipe, nodeRecipeQuery, resolveNodeStyle, shadowCss, } from "./theme.js";
|
|
59
|
+
export type { ThemeOptions } from "./theme.js";
|
|
60
|
+
export { BUILTIN_THEMES, BUILTIN_THEME_IDS, DEFAULT_THEME_ID, neutralTheme, exponentialTheme, playfulTheme, orangeTheme, builtinTheme, builtinThemes, themeOrDefault } from "./themes.js";
|
|
61
|
+
export { styleToCss, styleAttribute, gradientCss } from "./css.js";
|
|
62
|
+
export { SHADCN_COLOR_VARS, importShadcnCss, themeFromImport, diffTheme, exportThemeJson, parseThemeJson, parseShadow } from "./builder.js";
|
|
63
|
+
export type { ThemeImport } from "./builder.js";
|
|
64
|
+
export { CONTROL_PARTS, GEOMETRY_KEYS, controlGeometry, checkGeometry, verifyPainterGeometry } from "./geometry.js";
|
|
65
|
+
export type { ControlGeometry, GeometryKey, MeasuredBox, PainterOverride, GeometryIssue } from "./geometry.js";
|
|
66
|
+
export { OVERLAY_OFFSET, OVERLAY_PADDING, placeOverlay } from "./overlay.js";
|
|
67
|
+
export type { OverlaySide, OverlayAlign, OverlayPlacement, Rect, Size } from "./overlay.js";
|
|
68
|
+
export * from "./host/index.js";
|
|
69
|
+
export * from "./connector/index.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const LAYOUT_CONSTANTS: Readonly<Record<string, number>>;
|
|
2
|
+
export declare const WINDOW_THRESHOLD: number;
|
|
3
|
+
export declare const WINDOW_OVERSCAN: number;
|
|
4
|
+
export declare const RESIZE_STEP: number;
|
|
5
|
+
export declare const PANEL_MIN: number;
|
|
6
|
+
export declare const RESIZE_HANDLE_HIT: number;
|
|
7
|
+
export declare const FIELD_INTRINSIC_WIDTH: number;
|
|
8
|
+
export declare const MEDIA_INTRINSIC_WIDTH: number;
|
|
9
|
+
export declare const MEDIA_ASPECT_RATIO: number;
|
|
10
|
+
export declare const TREE_GUIDE_COLUMN: number;
|
|
11
|
+
/** Round 3: the elbow's corner radius and how far the guide verticals overshoot a row's top edge (paint only). */
|
|
12
|
+
export declare const TREE_GUIDE_RADIUS: number;
|
|
13
|
+
export declare const TREE_GUIDE_BRIDGE: number;
|
|
14
|
+
/** EXP-1259: the pending Button's delay, the Skeleton's pulse and the SearchList's bottom fade (feedback-states.json, search-list.json). */
|
|
15
|
+
export declare const PENDING_DELAY_MS: number;
|
|
16
|
+
export declare const SKELETON_PULSE_MS: number;
|
|
17
|
+
export declare const SKELETON_OPACITY_LOW: number;
|
|
18
|
+
export declare const SKELETON_OPACITY_HIGH: number;
|
|
19
|
+
export declare const SKELETON_REDUCED_OPACITY: number;
|
|
20
|
+
export declare const SEARCH_LIST_FADE: number;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const LIMITS: Readonly<Record<string, number>>;
|
|
2
|
+
/** Nodes the reducer places in one surface's tree (template nodes included). */
|
|
3
|
+
export declare const MAX_COMPONENTS: number;
|
|
4
|
+
/** Component nesting levels (the root = 1). */
|
|
5
|
+
export declare const MAX_DEPTH: number;
|
|
6
|
+
/** One server message as UTF-8 JSON. */
|
|
7
|
+
export declare const MAX_MESSAGE_BYTES: number;
|
|
8
|
+
/** Template items one surface instantiates. */
|
|
9
|
+
export declare const MAX_TEMPLATE_ITEMS: number;
|
|
10
|
+
/** A data pointer's length in UTF-8 bytes. */
|
|
11
|
+
export declare const MAX_POINTER_BYTES: number;
|
|
12
|
+
/** A data pointer's token count. */
|
|
13
|
+
export declare const MAX_POINTER_SEGMENTS: number;
|
|
14
|
+
/** The issue messages, byte-identical in every core. */
|
|
15
|
+
export declare const LIMIT_ISSUES: {
|
|
16
|
+
readonly usedTwice: "id used twice; only its first place renders";
|
|
17
|
+
readonly depth: `nesting deeper than ${number} levels`;
|
|
18
|
+
readonly components: `surface: more than ${number} components; the rest is dropped`;
|
|
19
|
+
readonly templateItems: `template: more than ${number} items; the rest is not rendered`;
|
|
20
|
+
readonly messageBytes: `message larger than ${number} bytes`;
|
|
21
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { ChildTemplate, ReduceIssue, UiNode } from "./types.js";
|
|
2
|
+
export { WINDOW_THRESHOLD, WINDOW_OVERSCAN } from "./layout.js";
|
|
3
|
+
/** The instance key of every item: the value at `keyPointer` (relative to
|
|
4
|
+
* the item; objects as their JSON) — `#<index>` when that value is missing,
|
|
5
|
+
* null, `` or a DUPLICATE of an earlier item's key (more `#`s until unique);
|
|
6
|
+
* without a pointer, the index. */
|
|
7
|
+
export declare function templateItemKeys(items: readonly unknown[], keyPointer?: string): string[];
|
|
8
|
+
/** Table row keys: the `rowKey` FIELD (default `id`) under the same rules
|
|
9
|
+
* (`#<index>` for missing, empty or duplicate). */
|
|
10
|
+
export declare function tableRowKeys(rows: readonly unknown[], rowKey?: string): string[];
|
|
11
|
+
/** A key as one instance-suffix segment: `~` → `~0`, `.` → `~1` (as JSON
|
|
12
|
+
* pointer escapes `/`), so dotted keys never collide across nesting levels
|
|
13
|
+
* (`a.b` + `c` vs `a` + `b.c`). */
|
|
14
|
+
export declare const instanceSegment: (key: string) => string;
|
|
15
|
+
export interface TemplateInstance {
|
|
16
|
+
/** The item's key (see `templateItemKeys`). */
|
|
17
|
+
key: string;
|
|
18
|
+
/** The item's data pointer: its scope (`/posts/3`). */
|
|
19
|
+
path: string;
|
|
20
|
+
index: number;
|
|
21
|
+
/** The suffix every node of the item wears: the enclosing instance's
|
|
22
|
+
* suffix + `.<key>`, the key escaped by `instanceSegment` (`.a` for an
|
|
23
|
+
* outer item, `.a.0` inside it, `.a~1b` for key `a.b`). A node's painted
|
|
24
|
+
* id = its id + the suffix. */
|
|
25
|
+
instance: string;
|
|
26
|
+
}
|
|
27
|
+
/** The items a node's `template` renders in a data scope: one per array
|
|
28
|
+
* item at `template.path` (relative to `scope`), keyed by `template.key`.
|
|
29
|
+
* `instance` = the suffix of the item the template sits in (`` at the top). */
|
|
30
|
+
export declare function templateInstances(data: unknown, template: ChildTemplate, scope?: string, instance?: string): TemplateInstance[];
|
|
31
|
+
/** A template site's key in a `TemplateBudget`: the node holding the
|
|
32
|
+
* template + the data scope it sits in. */
|
|
33
|
+
export declare const templateSiteKey: (nodeId: string, scope: string) => string;
|
|
34
|
+
export interface TemplateBudget {
|
|
35
|
+
/** Items each visited template site builds (absent = a site the walk
|
|
36
|
+
* never reached: it sits in an item that is not built). */
|
|
37
|
+
allowed: Map<string, number>;
|
|
38
|
+
/** ONE issue per build: the template component whose next item did not
|
|
39
|
+
* fit (`LIMIT_ISSUES.templateItems` or `LIMIT_ISSUES.components`); null =
|
|
40
|
+
* everything fits. */
|
|
41
|
+
issue: ReduceIssue | null;
|
|
42
|
+
}
|
|
43
|
+
/** VAPP-103: the template items ONE surface builds, in the Rust layout
|
|
44
|
+
* build's order (depth-first: a node's slots and static children, then its
|
|
45
|
+
* template items, each item's own subtree, nested items included, before
|
|
46
|
+
* the next item). The build holds `maxComponents` nodes: it starts at the
|
|
47
|
+
* reduced root tree's own nodes (children + slots; template definitions
|
|
48
|
+
* aside), and every item costs 1 against `maxTemplateItems` AND its
|
|
49
|
+
* template subtree's nodes. The first item that does not fit either budget
|
|
50
|
+
* and every later one is not built, with ONE issue on that template
|
|
51
|
+
* component. A windowed List (more than `WINDOW_THRESHOLD` rows) mounts
|
|
52
|
+
* its rows on demand: its items are not counted up front. Iterative. */
|
|
53
|
+
export declare function templateBudget(root: UiNode, data: unknown, templateNode: (componentId: string) => UiNode | undefined): TemplateBudget;
|
|
54
|
+
/** Start offsets of items laid end to end on one axis with `gap` between
|
|
55
|
+
* them (a `divided` list adds `$control.hairline` to the gap; the divider
|
|
56
|
+
* is centred in it): `offsets[i]` = where item i starts, `offsets[count]` =
|
|
57
|
+
* the content length. */
|
|
58
|
+
export declare function itemOffsets(extents: readonly number[], gap?: number): number[];
|
|
59
|
+
/** Every item's extent on the list's axis: a measured item keeps its
|
|
60
|
+
* extent; an unmeasured one (`null`) takes the MEAN of the measured
|
|
61
|
+
* extents once any item is measured (the content length stays stable while
|
|
62
|
+
* rows measure in, so a fling lands on the real end), else `row` (the
|
|
63
|
+
* theme's `$control.row`). */
|
|
64
|
+
export declare function itemExtents(measured: readonly (number | null | undefined)[], row: number): number[];
|
|
65
|
+
export interface WindowRange {
|
|
66
|
+
/** First rendered item. */
|
|
67
|
+
start: number;
|
|
68
|
+
/** One past the last rendered item. */
|
|
69
|
+
end: number;
|
|
70
|
+
/** Space before `start` / after `end - 1` (the spacers). */
|
|
71
|
+
before: number;
|
|
72
|
+
after: number;
|
|
73
|
+
/** The content length. */
|
|
74
|
+
total: number;
|
|
75
|
+
}
|
|
76
|
+
/** The items to render for a viewport `[scroll, scroll + viewport)` on the
|
|
77
|
+
* list's axis (both relative to the list's content start; a list without a
|
|
78
|
+
* bounded size windows against its nearest scrolling ancestor or the host
|
|
79
|
+
* viewport, translated into this frame): every item that intersects it
|
|
80
|
+
* (an item ending exactly at the viewport start still counts) plus
|
|
81
|
+
* `overscan` items on each side. Unmeasured items take `itemExtents`'s
|
|
82
|
+
* estimate (the caller's extents). `offsets` = `itemOffsets(extents, gap)` when the
|
|
83
|
+
* caller caches it (recompute only when an extent changes): the window is
|
|
84
|
+
* then two binary searches, O(log n) per scroll frame. */
|
|
85
|
+
export declare function virtualWindow(extents: readonly number[], gap: number, scroll: number, viewport: number, overscan?: number, offsets?: readonly number[]): WindowRange;
|
|
86
|
+
export type ScrollAlign = `start` | `center` | `end` | `nearest`;
|
|
87
|
+
/** The scroll offset that brings item `index` into a viewport of length
|
|
88
|
+
* `viewport` currently at `scroll` (the `scrollToIndex` command): `start` =
|
|
89
|
+
* its start at the viewport start (after `inset`, the pinned header's
|
|
90
|
+
* extent), `end` = its end at the viewport end, `center` = centred,
|
|
91
|
+
* `nearest` (default) = the smallest move that shows it whole (none when it
|
|
92
|
+
* already is). Clamped to `[0, max(0, total - viewport)]`. `offsets` = the
|
|
93
|
+
* cached `itemOffsets`, as for `virtualWindow`. */
|
|
94
|
+
export declare function scrollOffsetForIndex(extents: readonly number[], gap: number, index: number, viewport: number, scroll: number, align?: ScrollAlign, inset?: number, offsets?: readonly number[]): number;
|
|
95
|
+
export interface ListSection {
|
|
96
|
+
/** The `sectionBy` value its items share (as `displayString`; `` for
|
|
97
|
+
* missing). */
|
|
98
|
+
value: string;
|
|
99
|
+
/** Index of the section's first item in the data. */
|
|
100
|
+
start: number;
|
|
101
|
+
count: number;
|
|
102
|
+
}
|
|
103
|
+
/** Consecutive template items with the same `sectionBy` value (a pointer
|
|
104
|
+
* relative to each item) form a section; the data order is kept (sort the
|
|
105
|
+
* data to group it). */
|
|
106
|
+
export declare function listSections(items: readonly unknown[], sectionBy: string): ListSection[];
|
|
107
|
+
/** The flat ROW list a sectioned list windows: a header row before each
|
|
108
|
+
* section's items (`{header: sectionIndex}` / `{item: dataIndex}`). */
|
|
109
|
+
export declare function sectionRows(sections: readonly ListSection[]): ({
|
|
110
|
+
header: number;
|
|
111
|
+
} | {
|
|
112
|
+
item: number;
|
|
113
|
+
})[];
|
|
114
|
+
/** `scrollToIndex` on a SECTIONED list: the DATA index → its flat row
|
|
115
|
+
* (`sectionRows`; -1 = absent → no move), then `scrollOffsetForIndex` over
|
|
116
|
+
* the rows' extents with `inset` = the extent of the item's own section
|
|
117
|
+
* header when headers are sticky (it pins over the item), else 0. */
|
|
118
|
+
export declare function scrollOffsetForItem(rows: readonly ({
|
|
119
|
+
header: number;
|
|
120
|
+
} | {
|
|
121
|
+
item: number;
|
|
122
|
+
})[], rowExtents: readonly number[], gap: number, dataIndex: number, viewport: number, scroll: number, align?: ScrollAlign, stickyHeaders?: boolean, offsets?: readonly number[]): number;
|
|
123
|
+
/** The sticky header at a scroll offset: the LAST header row starting at or
|
|
124
|
+
* before `scroll` is pinned at the viewport start — pushed back by the next
|
|
125
|
+
* header as it arrives (its offset = min(scroll, nextHeaderStart −
|
|
126
|
+
* extent)). `rowOffsets` = itemOffsets of the flat rows; `headerRows` = the
|
|
127
|
+
* flat indices of the header rows, ascending. Null before the first header
|
|
128
|
+
* reaches the viewport start. Binary search: O(log headers). The pinned header is rendered even when the
|
|
129
|
+
* window does not contain it. */
|
|
130
|
+
export declare function stickyHeader(rowOffsets: readonly number[], rowExtents: readonly number[], headerRows: readonly number[], scroll: number): {
|
|
131
|
+
row: number;
|
|
132
|
+
offset: number;
|
|
133
|
+
} | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const DEFAULT_LOCALE: string;
|
|
2
|
+
export interface LocaleParts {
|
|
3
|
+
language: string;
|
|
4
|
+
region: string | null;
|
|
5
|
+
}
|
|
6
|
+
/** `pt-BR` → {pt, BR}; `zh-Hant-TW` → {zh, TW}; `de` → {de, null}. The
|
|
7
|
+
* region = the first 2-letter or 3-digit subtag after the language; a
|
|
8
|
+
* deprecated language code is normalised (`iw` → `he`, `ji` → `yi`, `in` →
|
|
9
|
+
* `id`: `languageAliases`). */
|
|
10
|
+
export declare function parseLocale(locale: string): LocaleParts;
|
|
11
|
+
/** The region a locale's data comes from: its own, else the language's
|
|
12
|
+
* likely region (CLDR likelySubtags), else null. */
|
|
13
|
+
export declare function localeRegion(locale: string): string | null;
|
|
14
|
+
/** The first day of the week, 0 = Sunday … 6 = Saturday. */
|
|
15
|
+
export declare function weekStart(locale: string): number;
|
|
16
|
+
/** `rtl` for the right-to-left languages, else `ltr`. */
|
|
17
|
+
export declare function textDirection(locale: string): `ltr` | `rtl`;
|
|
18
|
+
/** The directional glyphs (icons.json names) a painter mirrors under rtl. */
|
|
19
|
+
export declare const RTL_MIRRORED_ICONS: readonly string[];
|
|
20
|
+
/** True when `icon` is drawn mirrored (scaleX(-1), outermost) in this
|
|
21
|
+
* direction. */
|
|
22
|
+
export declare function mirrorsInRtl(icon: string, direction: `ltr` | `rtl`): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { isDynamic, truthy } from "./expr.js";
|
|
2
|
+
import type { ExtensionDef, MacroChild, ReduceIssue, UiNode } from "./types.js";
|
|
3
|
+
/** The breakpoint names in ascending order (tokens.json). */
|
|
4
|
+
export declare const BREAKPOINTS: readonly string[];
|
|
5
|
+
/** `{base, sm?, md?, lg?, xl?}`: an object with `base` and only breakpoint
|
|
6
|
+
* keys besides. */
|
|
7
|
+
export declare function isResponsiveValue(value: unknown): value is Record<string, unknown> & {
|
|
8
|
+
base: unknown;
|
|
9
|
+
};
|
|
10
|
+
/** The value a responsive prop takes at a breakpoint: the nearest defined
|
|
11
|
+
* key at or below it, `base` under the first one. `null` = the base. */
|
|
12
|
+
export declare function responsiveAt(value: Record<string, unknown> & {
|
|
13
|
+
base: unknown;
|
|
14
|
+
}, breakpoint: string | null): unknown;
|
|
15
|
+
/** The author's props with every responsive object replaced by its value at
|
|
16
|
+
* `breakpoint`. */
|
|
17
|
+
export declare function propsAt(props: Record<string, unknown>, breakpoint: string | null): Record<string, unknown>;
|
|
18
|
+
/** The normalized tree with every macro (core + extensions) expanded into
|
|
19
|
+
* natives, recipes attached. Pure: the input is not mutated; expansion
|
|
20
|
+
* problems (an author function that replaces a `$set` write) are pushed to
|
|
21
|
+
* `options.issues` when given. */
|
|
22
|
+
export declare function expandMacros(root: UiNode, options?: {
|
|
23
|
+
extensions?: readonly ExtensionDef[];
|
|
24
|
+
issues?: ReduceIssue[];
|
|
25
|
+
}): UiNode;
|
|
26
|
+
/** True for a value the expander would keep (see expr.ts). */
|
|
27
|
+
export declare const keeps: typeof truthy;
|
|
28
|
+
export { isDynamic };
|
|
29
|
+
export type { MacroChild };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const OVERLAY_OFFSET = 4;
|
|
2
|
+
export declare const OVERLAY_PADDING = 8;
|
|
3
|
+
export type OverlaySide = `top` | `right` | `bottom` | `left`;
|
|
4
|
+
export type OverlayAlign = `start` | `center` | `end`;
|
|
5
|
+
export interface Rect {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Size {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
export interface OverlayPlacement {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
side: OverlaySide;
|
|
19
|
+
/** True when the preferred side was swapped for its opposite. */
|
|
20
|
+
flipped: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function placeOverlay(anchor: Rect, size: Size, viewport: Size, options?: {
|
|
23
|
+
side?: OverlaySide;
|
|
24
|
+
align?: OverlayAlign;
|
|
25
|
+
offset?: number;
|
|
26
|
+
padding?: number;
|
|
27
|
+
}): OverlayPlacement;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ComponentDef, ExtensionDef } from "./types.js";
|
|
2
|
+
/** The sections of the prompt, in print order (VAPP-108): an agent (or the
|
|
3
|
+
* host serving it) asks for the ones it needs. `index` = one line per
|
|
4
|
+
* component (name, group, description) instead of the full `components`
|
|
5
|
+
* blocks: the agent reads the index, then asks for `componentPrompt(name)`
|
|
6
|
+
* of the ones it will use. */
|
|
7
|
+
export type PromptSection = `rules` | `components` | `index` | `shapes` | `functions` | `style` | `extensions`;
|
|
8
|
+
export declare const PROMPT_SECTIONS: readonly PromptSection[];
|
|
9
|
+
/** What `catalogPrompt()` prints without `sections`. */
|
|
10
|
+
export declare const DEFAULT_SECTIONS: readonly PromptSection[];
|
|
11
|
+
export interface PromptOptions {
|
|
12
|
+
extensions?: readonly ExtensionDef[];
|
|
13
|
+
/** The core-lite subset (the app-shaped vocabulary: no overlays, media, Chart, data tables or the rarer controls). */
|
|
14
|
+
lite?: boolean;
|
|
15
|
+
/** Omit the per-prop lines (names + types only). */
|
|
16
|
+
terse?: boolean;
|
|
17
|
+
/** VAPP-108: which sections to print (default `DEFAULT_SECTIONS`, in that order whatever the order given). */
|
|
18
|
+
sections?: readonly PromptSection[];
|
|
19
|
+
/** VAPP-108: print only these components (full blocks) and the shapes they reach; `index` still lists every one. */
|
|
20
|
+
only?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/** The rules every surface author (a model) must follow, shared by the core
|
|
23
|
+
* and the basic catalog. Kept to a few lines on purpose. */
|
|
24
|
+
export declare const PROMPT_RULES: readonly string[];
|
|
25
|
+
/** Props whose meaning is the same everywhere: described ONCE in the full
|
|
26
|
+
* prompt (the per-prop line then carries only name, marks and type). The
|
|
27
|
+
* catalog keeps every per-component description for the docs. */
|
|
28
|
+
export declare const COMMON_PROPS: Readonly<Record<string, string>>;
|
|
29
|
+
export declare function componentBlock(name: string, def: ComponentDef, enums: Record<string, readonly string[]>, terse: boolean): string;
|
|
30
|
+
/** Every catalog function as `name(arg:type,…)→returns` (round 4: the
|
|
31
|
+
* model sees the argument names, not just the function names). */
|
|
32
|
+
export declare function functionSignatures(): string[];
|
|
33
|
+
/** VAPP-108: one component's full block on demand (the per-component
|
|
34
|
+
* section an agent requests after reading the index), with the shapes its
|
|
35
|
+
* props reach. Unknown or hidden names give an empty string. */
|
|
36
|
+
export declare function componentPrompt(name: string, options?: Pick<PromptOptions, `extensions` | `terse`>): string;
|
|
37
|
+
/** VAPP-108: the index — every offered component on one line (name, group, kind, its sentence), grouped. */
|
|
38
|
+
export declare function catalogIndex(options?: Pick<PromptOptions, `extensions` | `lite`>): string[];
|
|
39
|
+
/** The system prompt for a surface author. */
|
|
40
|
+
export declare function catalogPrompt(options?: PromptOptions): string;
|
|
41
|
+
/** Characters per token the budget assumes (the same rule as the context
|
|
42
|
+
* layout's `charsPerToken`): an estimate, not a tokenizer. */
|
|
43
|
+
export declare const CHARS_PER_TOKEN = 4;
|
|
44
|
+
export declare function estimateTokens(text: string): number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const QR_CODE: {
|
|
2
|
+
$comment: string;
|
|
3
|
+
quietZone: number;
|
|
4
|
+
labelGap: number;
|
|
5
|
+
maxValueBytes: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const QR_LEVELS: readonly ["L", "M", "Q", "H"];
|
|
8
|
+
export type QrLevel = (typeof QR_LEVELS)[number];
|
|
9
|
+
export interface QrMatrix {
|
|
10
|
+
/** Modules per side (21 + 4 × (version − 1)). */
|
|
11
|
+
size: number;
|
|
12
|
+
version: number;
|
|
13
|
+
/** The mask pattern chosen (0..7). */
|
|
14
|
+
mask: number;
|
|
15
|
+
/** `size` rows of `size` characters: '1' = dark, '0' = light; no quiet zone. */
|
|
16
|
+
rows: string[];
|
|
17
|
+
}
|
|
18
|
+
/** The level as the catalog names it; anything else is `M` (the default). */
|
|
19
|
+
export declare function qrLevel(value: unknown): QrLevel;
|
|
20
|
+
/** The smallest version whose data capacity holds `bytes` at `level`, or null. */
|
|
21
|
+
export declare function qrVersion(byteLength: number, level: QrLevel): number | null;
|
|
22
|
+
/** The QR matrix of `value` (UTF-8, byte mode) at `level`; null for an empty
|
|
23
|
+
* value or one too long for version 40 at that level. */
|
|
24
|
+
export declare function qrMatrix(value: string, rawLevel?: unknown): QrMatrix | null;
|
|
25
|
+
/** The painted geometry of a QrCode of edge `size` px (style.json `qrCode`):
|
|
26
|
+
* the module edge and the quiet zone's inset, both in px. */
|
|
27
|
+
export declare function qrLayout(size: number, modules: number): {
|
|
28
|
+
module: number;
|
|
29
|
+
inset: number;
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExtensionDef, MacroDef } from "./types.js";
|
|
2
|
+
export declare const RECIPE_STATES: readonly string[];
|
|
3
|
+
export declare const RECIPE_KEYS: readonly string[];
|
|
4
|
+
export interface PartSpec {
|
|
5
|
+
parts: string[];
|
|
6
|
+
/** The prop names a `when` may use (besides `state`). */
|
|
7
|
+
props: string[];
|
|
8
|
+
}
|
|
9
|
+
/** A macro's parts and recipe props, read off its template. */
|
|
10
|
+
export declare function macroParts(def: MacroDef): PartSpec;
|
|
11
|
+
/** Every component (core + the given extensions) → its parts and `when`
|
|
12
|
+
* props. An extension's natives declare `recipe: {parts, props}` on their
|
|
13
|
+
* component def; without it a native gets `root` and its enum/boolean props. */
|
|
14
|
+
export declare function recipeParts(extensions?: readonly ExtensionDef[]): Record<string, PartSpec>;
|
|
15
|
+
/** The recipe query a NATIVE node answers to: its `when` props with the
|
|
16
|
+
* catalog defaults filled in (a macro part carries its own `recipe`). */
|
|
17
|
+
export declare function nativeRecipeProps(component: string, props: Record<string, unknown>, extensions?: readonly ExtensionDef[]): Record<string, unknown>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ChildTemplate, ExtensionDef, FlatComponent, NestedNode, ReduceIssue, UiNode, Visible, WireChildTemplate } from "./types.js";
|
|
2
|
+
/** The keys of a flat component that are not props (round 1 adds `visible`). */
|
|
3
|
+
export declare const RESERVED_KEYS: readonly string[];
|
|
4
|
+
export interface ReduceOptions {
|
|
5
|
+
/** The surface's catalog: the core, the lite subset, the basic catalog or an extension's id. */
|
|
6
|
+
catalogId: string;
|
|
7
|
+
extensions?: readonly ExtensionDef[];
|
|
8
|
+
/** The root component id (A2UI: `root`). */
|
|
9
|
+
rootId?: string;
|
|
10
|
+
/** Expand macros (default true); false keeps the pre-expansion tree. */
|
|
11
|
+
expand?: boolean;
|
|
12
|
+
/** Record prop validation issues (default true). */
|
|
13
|
+
validate?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ReduceResult {
|
|
16
|
+
root: UiNode;
|
|
17
|
+
issues: ReduceIssue[];
|
|
18
|
+
/** Round 2 (docs/round-2-contract.md §4): the nodes a data `template`
|
|
19
|
+
* renders per item, by component id, LIFTED out of the tree (a template
|
|
20
|
+
* node listed as a child too never renders in place), validated and
|
|
21
|
+
* expanded like the root; in discovery order. Absent without templates. */
|
|
22
|
+
templates?: Record<string, UiNode>;
|
|
23
|
+
}
|
|
24
|
+
/** A `visible` value is a boolean or a dynamic value (a binding or a call). */
|
|
25
|
+
export declare function validVisible(value: unknown): value is Visible;
|
|
26
|
+
export declare function childTemplate(value: WireChildTemplate): ChildTemplate;
|
|
27
|
+
/** Reduce a flat component list. Children are resolved from the root down, so
|
|
28
|
+
* components nothing references (a basic Button's consumed Text child) do
|
|
29
|
+
* not appear. A missing or cyclic reference becomes an Unknown placeholder
|
|
30
|
+
* plus an issue. VAPP-103: an id placed a second time (two parents, or one
|
|
31
|
+
* parent twice) renders at its first place only (`id used twice`), a node
|
|
32
|
+
* deeper than `maxDepth` is an Unknown placeholder, and past
|
|
33
|
+
* `maxComponents` nodes the rest is dropped (catalog/limits.json). */
|
|
34
|
+
export declare function reduceSurface(components: readonly FlatComponent[], options: ReduceOptions): ReduceResult;
|
|
35
|
+
/** A component's slot list admits a name when it lists it or lists `*`. */
|
|
36
|
+
export declare function slotAllowed(slots: readonly string[] | undefined, name: string): boolean;
|
|
37
|
+
/** The nested authoring form → a normalized tree (same validation and
|
|
38
|
+
* expansion as reduceSurface). */
|
|
39
|
+
export declare function reduceNested(tree: NestedNode, options: Omit<ReduceOptions, `rootId`>): ReduceResult;
|
|
40
|
+
/** Pre-order ids of a tree, the painters' accessibility order. */
|
|
41
|
+
export declare function preorder(root: UiNode): string[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** One panel's limits (Resizable `panels[i]`), percent. */
|
|
2
|
+
export interface PanelLimits {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
/** Dragging below half its `min` collapses it to 0; Enter toggles. */
|
|
6
|
+
collapsible?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export { PANEL_MIN, RESIZE_HANDLE_HIT, RESIZE_STEP } from "./layout.js";
|
|
9
|
+
/** The sizes a group of `count` panels starts with: the valid given sizes
|
|
10
|
+
* (finite, ≥ 0), the missing ones sharing what is left of 100 (equal split
|
|
11
|
+
* when nothing is given), scaled to sum 100, then each clamped into its
|
|
12
|
+
* [min, max] (a collapsible panel may stay at 0) with the difference handed
|
|
13
|
+
* to the panels that still have room, in order. A `min` above 100 / count
|
|
14
|
+
* is lowered to it. */
|
|
15
|
+
export declare function normalizeSizes(sizes: readonly unknown[] | undefined, count: number, limits?: readonly PanelLimits[]): number[];
|
|
16
|
+
/** Move handle `handle` (between panels `handle` and `handle + 1`) by
|
|
17
|
+
* `delta` percentage points (positive = the first panel grows). Always
|
|
18
|
+
* computed from the sizes at the START of a drag (no drift). The move is
|
|
19
|
+
* clamped so both panels stay in their [min, max]; a collapsible panel
|
|
20
|
+
* dragged below half its min collapses to 0 (the other takes its space, if
|
|
21
|
+
* it can), and a collapsed one dragged past half its min reopens: at its
|
|
22
|
+
* min, or where the pointer is when that is further (clamped as above).
|
|
23
|
+
* Other panels never change. */
|
|
24
|
+
export declare function resizePanels(sizes: readonly number[], handle: number, delta: number, limits?: readonly PanelLimits[]): number[];
|
|
25
|
+
export type ResizeKey = `ArrowLeft` | `ArrowRight` | `ArrowUp` | `ArrowDown` | `Home` | `End` | `Enter`;
|
|
26
|
+
/** A key on a focused handle. Arrows move the HANDLE on screen by
|
|
27
|
+
* RESIZE_STEP (horizontal group: Left/Right — in rtl the first panel sits
|
|
28
|
+
* on the right, so ArrowRight shrinks it; vertical group: Up/Down); Home /
|
|
29
|
+
* End take the first panel to its min / max (as far as the second allows);
|
|
30
|
+
* Enter collapses the first panel when collapsible (else the second),
|
|
31
|
+
* reopening a collapsed one at its min. Other keys change nothing. */
|
|
32
|
+
export declare function keyboardResize(sizes: readonly number[], handle: number, key: ResizeKey | string, orientation: `horizontal` | `vertical`, direction?: `ltr` | `rtl`, limits?: readonly PanelLimits[]): number[];
|
|
33
|
+
/** Panel lengths in px on the main axis: the container minus every handle
|
|
34
|
+
* (`handleExtent` each, `$control.hairline`), shared by the sizes. */
|
|
35
|
+
export declare function panelExtents(sizes: readonly number[], container: number, handleExtent?: number): number[];
|
|
36
|
+
/** A pointer movement (px on the main axis, screen direction) as the
|
|
37
|
+
* percentage delta `resizePanels` takes (rtl horizontal groups flip it). */
|
|
38
|
+
export declare function dragDelta(px: number, container: number, panelCount: number, orientation: `horizontal` | `vertical`, direction?: `ltr` | `rtl`, handleExtent?: number): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExtensionDef } from "./types.js";
|
|
2
|
+
type Json = Record<string, unknown>;
|
|
3
|
+
/** The core catalog's JSON Schema. */
|
|
4
|
+
export declare function coreSchema(iconNames: readonly string[]): Json;
|
|
5
|
+
/** An extension's JSON Schema: its own id, `extends` the core, its components. */
|
|
6
|
+
export declare function extensionSchema(ext: ExtensionDef, iconNames: readonly string[]): Json;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const DEFAULT_STRINGS: Readonly<Record<string, string>>;
|
|
2
|
+
export declare const STRING_IDS: readonly string[];
|
|
3
|
+
/** `$string.choose` → `choose`; null for any other value. */
|
|
4
|
+
export declare function parseStringRef(value: unknown): string | null;
|
|
5
|
+
/** True for a well-formed reference to a KNOWN id. */
|
|
6
|
+
export declare function isStringRef(value: unknown): boolean;
|
|
7
|
+
/** The host's overrides merged over the defaults. */
|
|
8
|
+
export declare function stringTable(overrides?: Readonly<Record<string, string>>): Record<string, string>;
|
|
9
|
+
/** `{name}` placeholders filled from `params`; unknown ones stay. */
|
|
10
|
+
export declare function formatString(template: string, params?: Record<string, unknown>): string;
|
|
11
|
+
/** A prop value with any `$string.<id>` reference replaced by the table's
|
|
12
|
+
* text (an unknown id resolves to the id itself); other values pass. */
|
|
13
|
+
export declare function resolveString(value: unknown, table?: Readonly<Record<string, string>>): unknown;
|