aktion-runtime 0.5.8 → 0.5.10
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 +196 -26
- package/dist/aktion.iife.js +879 -78
- package/dist/aktion.iife.js.map +1 -1
- package/dist/aktion.js +16396 -10312
- package/dist/aktion.js.map +1 -1
- package/dist/aktion.umd.cjs +879 -78
- 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 +4883 -572
- 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 +269 -20
- package/dist/system_prompt_chat.txt +3 -3
- package/dist/testing.js +15977 -7890
- 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/runtime/env.d.ts +33 -0
- package/dist/types/runtime/evaluator.d.ts +30 -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 +28 -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/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML → Aktion importer (suggestions-global XIV.1).
|
|
3
|
+
*
|
|
4
|
+
* A pragmatic codemod that converts a chunk of static HTML into an equivalent
|
|
5
|
+
* Aktion program string, mapping common tags to the closest library component.
|
|
6
|
+
* It is not a 1:1 fidelity tool — it gives authors a running head-start that
|
|
7
|
+
* they then refine. Parsing uses the DOM when available (browsers / jsdom /
|
|
8
|
+
* happy-dom) and falls back to a tiny tag tokenizer in pure-Node contexts.
|
|
9
|
+
*
|
|
10
|
+
* import { htmlToAktion } from "aktion-runtime/tooling";
|
|
11
|
+
* const program = htmlToAktion("<section><h1>Hi</h1><p>Body</p></section>");
|
|
12
|
+
* // → $app(Section([Heading("Hi"), Text("Body")]))
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Convert an HTML string to an Aktion program. The result is wrapped in
|
|
16
|
+
* `$app(...)`; a single root renders directly, multiple roots become a
|
|
17
|
+
* `Column([...])`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function htmlToAktion(html: string): string;
|
|
@@ -30,3 +30,6 @@ export { getSemanticTokens, semanticTokenTypes, semanticTokenModifiers, } from '
|
|
|
30
30
|
export type { SemanticToken, SemanticTokenType, SemanticTokenModifier, } from './semantic-tokens.js';
|
|
31
31
|
export { getSignatureHelp, } from './signature-help.js';
|
|
32
32
|
export type { SignatureHelp, SignatureInfo, ParameterInfo, } from './signature-help.js';
|
|
33
|
+
export { htmlToAktion } from './html-import.js';
|
|
34
|
+
export { componentSchema, tailwindToSx, buildGallery, suggestComponent, } from './schema.js';
|
|
35
|
+
export type { LibrarySchema, ComponentSchemaEntry, ComponentPropSchema, GalleryOptions, } from './schema.js';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ComponentLibrary } from '../library/types.js';
|
|
2
|
+
export interface ComponentPropSchema {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
optional: boolean;
|
|
6
|
+
positional: boolean;
|
|
7
|
+
required: boolean;
|
|
8
|
+
enum?: readonly string[];
|
|
9
|
+
aliases?: readonly string[];
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ComponentSchemaEntry {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
props: ComponentPropSchema[];
|
|
16
|
+
}
|
|
17
|
+
export interface LibrarySchema {
|
|
18
|
+
version: 1;
|
|
19
|
+
components: ComponentSchemaEntry[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build a stable, machine-readable JSON schema of every component in a
|
|
23
|
+
* library — names, props, types, enums, positional/required flags. Feed it
|
|
24
|
+
* to an editor for autocomplete / hover docs, or diff it across releases.
|
|
25
|
+
*/
|
|
26
|
+
export declare function componentSchema(library: ComponentLibrary): LibrarySchema;
|
|
27
|
+
/**
|
|
28
|
+
* Suggest the closest real component name(s) for a misspelling (XIV.4) — the
|
|
29
|
+
* "did you mean `Button`?" experience. Returns up to `limit` names within a
|
|
30
|
+
* small edit distance, best first.
|
|
31
|
+
*/
|
|
32
|
+
export declare function suggestComponent(name: unknown, library: ComponentLibrary, limit?: number): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Map a Tailwind-style class string to the closest Aktion `sx` object (XIV.2).
|
|
35
|
+
* A pragmatic migration aid:
|
|
36
|
+
*
|
|
37
|
+
* - spacing / color / typography / flex / grid / radius / shadow / sizing /
|
|
38
|
+
* position / z-index / overflow utilities map onto sx tokens;
|
|
39
|
+
* - responsive prefixes (`md:p-8`) become sx breakpoint maps
|
|
40
|
+
* (`{ p: { base: "m", md: "l" } }`, 2xl folds onto xl);
|
|
41
|
+
* - state prefixes (`hover:bg-primary`) become `sx.states` entries for the
|
|
42
|
+
* props the bounded state engine supports;
|
|
43
|
+
* - anything unrecognised is returned under `_unmapped` so callers can
|
|
44
|
+
* surface a warning instead of silently dropping intent.
|
|
45
|
+
*/
|
|
46
|
+
export declare function tailwindToSx(classString: unknown): Record<string, unknown>;
|
|
47
|
+
export interface GalleryOptions {
|
|
48
|
+
/** Page title (default "Aktion Components"). */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** Only include components whose name matches this filter. */
|
|
51
|
+
include?: (name: string) => boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build a static HTML "Storybook"-style gallery from a library's schema
|
|
55
|
+
* (XIV.5): one card per component listing its description and prop table.
|
|
56
|
+
* Self-contained (inline CSS); write it to a file or serve it for browsing.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildGallery(library: ComponentLibrary, options?: GalleryOptions): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aktion-runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "Aktion is a single web component that turns a compact, streaming-first DSL into a rich, interactive UI inside its shadow DOM. Works in React, Vue, Angular, Svelte, plain HTML — or no framework at all.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|