aktion-runtime 0.5.9 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -36
- package/dist/aktion.iife.js +920 -144
- package/dist/aktion.iife.js.map +1 -1
- package/dist/aktion.js +17025 -10815
- package/dist/aktion.js.map +1 -1
- package/dist/aktion.umd.cjs +920 -144
- package/dist/aktion.umd.cjs.map +1 -1
- package/dist/devtools.js +554 -20
- package/dist/devtools.js.map +1 -1
- package/dist/language.js +7042 -2455
- package/dist/language.js.map +1 -1
- package/dist/plugin.cjs +2 -2
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +2 -2
- package/dist/plugin.js.map +1 -1
- package/dist/system_prompt.txt +292 -41
- package/dist/system_prompt_chat.txt +14 -14
- package/dist/testing.js +16223 -7977
- package/dist/testing.js.map +1 -1
- package/dist/types/devtools/panel.d.ts +32 -0
- package/dist/types/devtools/styles.d.ts +1 -1
- package/dist/types/element.d.ts +26 -0
- package/dist/types/icons/index.d.ts +10 -0
- package/dist/types/library/components/_internal.d.ts +18 -0
- package/dist/types/library/components/a11y.d.ts +5 -0
- package/dist/types/library/components/canvas.d.ts +3 -0
- package/dist/types/library/components/extras.d.ts +15 -0
- package/dist/types/library/components/feedback.d.ts +1 -0
- package/dist/types/library/components/forms-shared.d.ts +55 -0
- package/dist/types/library/components/layout-motion.d.ts +14 -0
- package/dist/types/library/components/layout.d.ts +1 -0
- package/dist/types/library/components/marketing.d.ts +35 -0
- package/dist/types/library/components/new-components.d.ts +1 -0
- package/dist/types/library/components/scheduling.d.ts +2 -0
- package/dist/types/library/components/wave3.d.ts +6 -0
- package/dist/types/library/highlight.d.ts +21 -0
- package/dist/types/library/qr.d.ts +12 -0
- package/dist/types/library/responsive-style.d.ts +51 -0
- package/dist/types/library/sx.d.ts +51 -0
- package/dist/types/library/types.d.ts +50 -0
- package/dist/types/library/utils.d.ts +28 -0
- package/dist/types/library/validate.d.ts +2 -2
- package/dist/types/runtime/env.d.ts +33 -0
- package/dist/types/runtime/evaluator.d.ts +38 -0
- package/dist/types/runtime/http.d.ts +37 -1
- package/dist/types/runtime/index.d.ts +2 -0
- package/dist/types/runtime/namespaces-extra.d.ts +73 -0
- package/dist/types/runtime/realtime.d.ts +46 -0
- package/dist/types/runtime/router.d.ts +42 -4
- package/dist/types/runtime/ssr.d.ts +29 -0
- package/dist/types/runtime/util.d.ts +65 -0
- package/dist/types/testing/index.d.ts +35 -0
- package/dist/types/theme/fonts.d.ts +30 -0
- package/dist/types/theme/index.d.ts +31 -0
- package/dist/types/theme/styles.d.ts +1 -1
- package/dist/types/tooling/html-import.d.ts +19 -0
- package/dist/types/tooling/index.d.ts +3 -0
- package/dist/types/tooling/schema.d.ts +58 -0
- package/dist/types/tooling/signature-help.d.ts +35 -0
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ A program is a flat list of `name = expression` statements in standard JavaScrip
|
|
|
12
12
|
### Component calls
|
|
13
13
|
- **Case doesn't matter** — `Card` and `card` are equivalent.
|
|
14
14
|
- **Always invoke with parentheses** — `Column([Header(), Body()])`, never `Column([Header, Body])`; write `Hero()` even with no args.
|
|
15
|
-
- **
|
|
15
|
+
- **Canonical call: one positional arg, the rest in a trailing object** — `Callout("info", { title: "Heads up", icon: "circle-info" })`, `Badge("Live", { tone: "success" })`. All-positional (signature order) and all-named (single `{ }` object) calls also work.
|
|
16
16
|
|
|
17
17
|
### Build UI from data — JS is fully supported
|
|
18
18
|
`.map` / `.filter` arrays into nodes (`rows.map(r => ListItem(r.title))`), ternaries for branching, and the array-pluck shortcut `rows.title` → `[each row.title]` to feed columns (`Col("Title", rows.title)`) and chart series (`PieChart(rows.label, rows.value)`). `if` / `for` are statements — not usable on the right of `=`.
|
|
@@ -29,20 +29,20 @@ rows = [{ region: "NA", revenue: 184000 }, { region: "EU", revenue: 122000 }]
|
|
|
29
29
|
Use only these components. Each signature lists props in declaration order; optional props end with `?`. Pass the positional prop bare, then all other props in a trailing `{ prop: value }` object.
|
|
30
30
|
|
|
31
31
|
### Layout
|
|
32
|
-
- Column(children: Node[], gap?: "xs"|"
|
|
33
|
-
- Row(children: Node[], gap?: "xs"|"
|
|
34
|
-
- Center(children: Node[], axis?: "both"|"horizontal"|"vertical", minHeight?: string, gap?: "xs"|"
|
|
35
|
-
- Stack(children: Node[], direction?: "column"|"row", gap?: "xs"|"
|
|
32
|
+
- Column(children: Node[], gap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", align?: "start"|"center"|"end"|"stretch", justify?: "start"|"center"|"end"|"between"|"around"|"evenly", wrap?: boolean, reverse?: boolean, padding?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", inline?: boolean) — Lay children out vertically (top → bottom) with even spacing — the most common page/section layout. Children stretch to the full width by default; set `align` to `start`/`center`/`end` to change that. This is the recommended root container for a page or a card body.
|
|
33
|
+
- Row(children: Node[], gap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", align?: "start"|"center"|"end"|"stretch", justify?: "start"|"center"|"end"|"between"|"around"|"evenly", grow?: boolean, wrap?: boolean, reverse?: boolean, padding?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", inline?: boolean, alignContent?: "start"|"center"|"end"|"between"|"around"|"stretch") — Lay children out horizontally (left → right) with even spacing. The developer-friendly default: children keep their natural width and are vertically centered. Set `grow=true` to make children share the row equally (for equal-width columns prefer `Grid(columns: N)`); drop a `Spacer()` between children to push them apart; wrap a child in `StackItem` for per-child grow/shrink/alignment. Use `wrap=true` for chips/tags that should flow onto multiple lines.
|
|
34
|
+
- Center(children: Node[], axis?: "both"|"horizontal"|"vertical", minHeight?: string, gap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", padding?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", inline?: boolean) — Centers its children on both axes — the easy way to drop a spinner, an empty state, a hero call-to-action, or a modal body into the middle of a region. Give it `minHeight` (e.g. `"60vh"`) to center vertically inside a tall area, or `axis` to center on only one axis. Multiple children stack in a column and are centered as a group.
|
|
35
|
+
- Stack(children: Node[], direction?: "column"|"row", gap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", align?: "start"|"center"|"end"|"stretch", justify?: "start"|"center"|"end"|"between"|"around"|"evenly", alignContent?: "start"|"center"|"end"|"between"|"around"|"stretch", wrap?: boolean, reverse?: boolean, uniform?: boolean, inline?: boolean, padding?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl") — Low-level flex container with a configurable, optionally responsive `direction`. Reach for `Row` or `Column` first — they are clearer for fixed-direction layouts. Use `Stack` when the direction itself must change across breakpoints, e.g. `direction: {base: "column", md: "row"}` for a sidebar that stacks on mobile. `gap`, `align`, `justify`, and `padding` also accept responsive maps. NOTE: a `row` Stack grows its children equally by default (`uniform=true`); set `uniform=false` for natural widths (this is `Row`'s default).
|
|
36
36
|
- StackItem(child: Node, grow?: number, shrink?: number, basis?: string, alignSelf?: "start"|"center"|"end"|"stretch", order?: number, minWidth?: string, maxWidth?: string) — Per-child flex control inside a `Row`, `Column`, or `Stack`. Wraps one child so it can `grow` to fill leftover space, `shrink`, set a `basis`, override `alignSelf`, or change visual `order` — the building block for asymmetric rows like `Row([StackItem(searchInput, { grow: 1 }), saveButton])` (input expands, button hugs).
|
|
37
|
-
- Grid(children: Node[], columns?: number | object, gap?: "xs"|"
|
|
37
|
+
- Grid(children: Node[], columns?: number | object, gap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", rowGap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", columnGap?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", minChildWidth?: string, alignItems?: "start"|"center"|"end"|"stretch", justifyItems?: "start"|"center"|"end"|"stretch", dense?: boolean) — Two-dimensional grid with three modes:
|
|
38
38
|
1. AUTO-FIT (default, no `columns`): wraps as many equal columns as fit, each at least `minChildWidth` wide (default 220px) — perfect for card/KPI grids that should reflow on their own.
|
|
39
39
|
2. FIXED (`columns: N`, 1–12): exactly N equal columns.
|
|
40
40
|
3. SPAN (`columns: 12` or any `GridItem` children): a 12-track grid where each `GridItem` sets its own `span` (a number 1–12 or a fraction like `"1/3"`) for dashboards and asymmetric layouts.
|
|
41
41
|
`columns` and `gap` accept responsive maps like `{base: 1, md: 2, lg: 4}`.
|
|
42
42
|
- GridItem(child: Node, span?: number | string, offset?: number, spanAt?: object) — Wraps a child in a 12-column grid cell with `span`, `offset`, and responsive `spanAt` maps. Parent `Grid` auto-enables 12-column mode when any child is a `GridItem`. Fraction spans like `"1/3"` resolve against the 12-column track.
|
|
43
|
-
- Box(children: Node[], padding?: "xs"|"
|
|
44
|
-
- Container(children: Node[], size?: "sm"|"md"|"lg"|"xl"|"full", maxWidth?: string, padding?: "none"|"
|
|
45
|
-
- Spacer(size?: "xs"|"
|
|
43
|
+
- Box(children: Node[], padding?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", margin?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", border?: "none"|"subtle"|"default", background?: "none"|"surface"|"muted"|"primary"|"success"|"warning"|"danger"|"info", maxWidth?: string) — Spacing and surface wrapper for padding, margin, borders, semantic backgrounds, and max-width constraints. Use when a `Card` is too heavy but the content needs a subtle surface or inset.
|
|
44
|
+
- Container(children: Node[], size?: "sm"|"md"|"lg"|"xl"|"full", maxWidth?: string, padding?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl") — Centered, max-width content wrapper. Use when a page is wider than comfortable reading width — landing pages, marketing sections, long documents. Picks a sensible default max-width per size; pass `maxWidth` to override with any CSS value.
|
|
45
|
+
- Spacer(size?: "none"|"3xs"|"2xs"|"xs"|"sm"|"md"|"lg"|"xl"|"2xl"|"3xl", flex?: boolean) — Explicit space element for fine layout control. By default acts as a flex spacer that pushes following content to the far edge (use inside `Stack(direction="row")`). Pass `size` to render a fixed vertical/horizontal gap instead.
|
|
46
46
|
- Card(children: Node[], variant?: "default"|"outlined"|"elevated") — Vertical card container.
|
|
47
47
|
- CardHeader(title: string, subtitle?: string) — Card header with title and optional subtitle.
|
|
48
48
|
- CardFooter(children: Node[]) — Card footer for actions.
|
|
@@ -55,13 +55,13 @@ Use only these components. Each signature lists props in declaration order; opti
|
|
|
55
55
|
- AspectRatio(ratio: string, children: Node[]) — Container that constrains its child to a fixed aspect ratio (e.g. 16:9 for video embeds, 1:1 for thumbnails). The child fills the box.
|
|
56
56
|
|
|
57
57
|
### Content
|
|
58
|
-
- Text(value: string, variant?: "small"|"small-heavy"|"body"|"body-heavy"|"large"|"large-heavy"|"heading"|"title", tone?: "default"|"muted"|"primary"|"success"|"warning"|"danger", style?: string) — Renders plain text with a typographic variant. Optional `style` prop accepts a CSS declaration string (e.g. "font-size: 16px; color: #000;") applied directly to the rendered element.
|
|
59
|
-
- Image(src: string, alt?: string, caption?: string, ratio?: string, fit?: "cover"|"contain"|"fill"|"none"|"scale-down", fallback?: string) — Inline image. `ratio` constrains the box to a fixed aspect ratio (e.g. `16:9`, `1:1`) so callers do not need an outer `AspectRatio
|
|
58
|
+
- Text(value: string, variant?: "small"|"small-heavy"|"body"|"body-heavy"|"large"|"large-heavy"|"heading"|"title", tone?: "default"|"muted"|"primary"|"success"|"warning"|"danger", align?: "left"|"center"|"right", style?: string) — Renders plain text with a typographic variant. `align` (left|center|right) sets the horizontal alignment (the text renders as its own block). Optional `style` prop accepts a CSS declaration string (e.g. "font-size: 16px; color: #000;") applied directly to the rendered element.
|
|
59
|
+
- Image(src: string, alt?: string, caption?: string, ratio?: string, fit?: "cover"|"contain"|"fill"|"none"|"scale-down", fallback?: string, placeholder?: "blur"|"none", loading?: "lazy"|"eager", sizes?: string, srcset?: string) — Inline image. `ratio` constrains the box to a fixed aspect ratio (e.g. `16:9`, `1:1`) so callers do not need an outer `AspectRatio` (and it reserves space to avoid layout shift). `fit` controls how the image fills that box. `placeholder: "blur"` fades the image in once loaded; `sizes`/`srcset` enable responsive loading; `loading: "eager"` opts out of lazy-loading. When `src` is missing/unsafe or fails to load it shows the `fallback` text/icon.
|
|
60
60
|
- Badge(label: string (positional), tone?: "neutral"|"primary"|"success"|"warning"|"danger"|"info", icon?: string, size?: "xs"|"sm"|"md"|"lg"|"xl") — Small pill-style tag for status, counts, categories. Accepts an optional leading `icon` and a `size`.
|
|
61
61
|
- BadgeList(labels: string[] (positional), tone?: "neutral"|"primary"|"success"|"warning"|"danger"|"info", size?: "xs"|"sm"|"md"|"lg"|"xl") — Cluster of Badge pills rendered from an array of strings.
|
|
62
62
|
- Callout(tone?: "neutral"|"info"|"success"|"warning"|"danger"|"error", title: string (positional), description?: string, icon?: string, compact?: boolean) — Highlighted callout banner with variant, title, description, and leading icon. Pass `compact: true` for a one-line inline-note rendering.
|
|
63
63
|
- Quote(text: string, cite?: string, tone?: "default"|"primary"|"success"|"warning"|"danger"|"info") — Inline pull-quote with optional citation. Lighter than `Testimonial` — use inside articles, blog posts, marketing sections, or anywhere you need to highlight a sentence without the full quote/author/role + rating shape.
|
|
64
|
-
- CodeBlock(language?: string, codeString: string (positional), showLineNumbers?: boolean, highlightLines?: string, copy?: boolean) — Read-only code block with a language label and a copy-to-clipboard button. Pass `showLineNumbers=true` to render a gutter; `highlightLines` accepts a string like `"3-5,8"` to emphasise specific lines.
|
|
64
|
+
- CodeBlock(language?: string, codeString: string (positional), showLineNumbers?: boolean, highlightLines?: string, highlight?: boolean, copy?: boolean, header?: boolean, width?: string, height?: string) — Read-only code block with a language label and a copy-to-clipboard button. Pass `showLineNumbers=true` to render a gutter; `highlightLines` accepts a string like `"3-5,8"` to emphasise specific lines. `header=false` renders a chromeless variant — no language label or copy button, no border or rounding — that fills its container (100%×100%), for embedding in your own frame (CodeWindow uses it). `width`/`height` set an explicit size; overflowing code scrolls either way.
|
|
65
65
|
- Skeleton(variant?: "paragraph"|"card"|"table-row"|"avatar"|"image", lines?: number, height?: number | string, shape?: "rect"|"circle", width?: string) — Loading placeholder. Pass a `variant` for common shapes — `paragraph` (default), `card`, `table-row`, `avatar`, `image` — or use `shape` / `width` / `height` to build a custom one. All variants use a shimmer animation that respects `prefers-reduced-motion`.
|
|
66
66
|
- Spinner(size?: "xs"|"sm"|"md"|"lg"|"xl", label?: string, tone?: "default"|"neutral"|"primary"|"success"|"warning"|"danger"|"info") — Indeterminate inline loader. Use for tiny loading states inside buttons, toolbars, table cells, or chat bubbles where `Skeleton` and `Progress(indeterminate=true)` are too heavy. Pass `label` to render an inline caption beside the spinner (also announced via `aria-label`).
|
|
67
67
|
- Markdown(content: string) — Render markdown-flavoured text. Supports **bold**, *italic*, `code`, headings (`#`/`##`/`###`), blockquotes (`>`), bullet (`-`/`*`) and numbered (`1.`) lists, fenced code blocks (```), images (``), inline links, and auto-linked bare URLs. Multi-line paragraphs collapse into `<p>` blocks.
|
|
@@ -94,7 +94,7 @@ Use only these components. Each signature lists props in declaration order; opti
|
|
|
94
94
|
- Series(name: string, values: number[]) — Named data series for charts. Used inside BarChart, LineChart, PieChart.
|
|
95
95
|
|
|
96
96
|
### Feedback & Media
|
|
97
|
-
- Avatar(name: string, src?: string, size?: "xs"|"sm"|"md"|"lg"|"xl", status?: "online"|"offline"|"busy"|"away", fallback?: "initials"|"dicebear") — User avatar. Shows the image at `src`. When `src` is missing, falls back to a deterministic DiceBear illustration seeded by `name` (pass `fallback="initials"` to render two-letter initials instead). If the image errors at runtime the avatar gracefully degrades to initials.
|
|
97
|
+
- Avatar(name: string, src?: string, size?: "xs"|"sm"|"md"|"lg"|"xl", status?: "online"|"offline"|"busy"|"away", fallback?: "initials"|"dicebear"|"gradient") — User avatar. Shows the image at `src`. When `src` is missing, falls back to a deterministic DiceBear illustration seeded by `name` (pass `fallback="initials"` to render two-letter initials instead). If the image errors at runtime the avatar gracefully degrades to initials.
|
|
98
98
|
- AvatarGroup(items: Avatar[], max?: number, size?: "xs"|"sm"|"md"|"lg"|"xl") — Stack of overlapping avatars with a `+N` chip when the list overflows. Pass either Avatar(...) nodes or plain {name, src} objects.
|
|
99
99
|
- PersonChip(name: string, role?: string, avatarSrc?: string, size?: "sm"|"md"|"lg", status?: "online"|"offline"|"busy"|"away", onClick?: callable) — Inline avatar + name + optional role/meta pill. Use anywhere a person needs to be referenced compactly: table cells, list rows, comments, kanban cards, sidebar footers. Pair multiple chips with `Stack(direction="row", wrap=true)` for assignee lists.
|
|
100
100
|
- Rating(value: number, max?: number, label?: string, count?: number, size?: "sm"|"md"|"lg", interactive?: boolean, readonly?: boolean, halfStep?: boolean, icon?: string, onChange?: callable) — Compact 0–5 star rating with optional numeric badge and review count. Use in product cards, testimonials, reviews, and KPI rows. Pass `interactive: true` (or an `onChange` handler) to let users pick a rating; bind `value: $rating` for two-way binding, or read the new value from `onChange: (v) => …`. With `halfStep: true` clicking the left half of a star sets a fractional value. `icon` swaps the glyph family — `star` (default), `heart`, `thumb`, `fire`, `bolt`, or any custom Font Awesome name.
|
|
@@ -186,4 +186,4 @@ References resolve from the whole scope, not source order — undefined refs ren
|
|
|
186
186
|
2. Every component is invoked with `()` — `Hero()`, never bare `Hero`.
|
|
187
187
|
3. Only the read-only display components above — no forms, clickable buttons, state writes, actions, effects, HTTP, or routing.
|
|
188
188
|
4. Tables are column-oriented (`Table([Col("Label", arr)])`, cells may be components via `rows.map(r => Badge(r.status))`); charts take numeric arrays (array-pluck `rows.value`).
|
|
189
|
-
5.
|
|
189
|
+
5. Prefer one positional arg per call with everything else in a trailing `{ }` object; no statement split across lines outside an unmatched bracket.
|