slexkit 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/AGENTS.slexkit.md +29 -0
- package/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +165 -0
- package/README.zh-CN.md +165 -0
- package/dist/ai/llms-authoring.txt +44 -0
- package/dist/ai/llms-components.txt +669 -0
- package/dist/ai/llms-full.txt +6586 -0
- package/dist/ai/llms-runtime.txt +1475 -0
- package/dist/ai/llms-toolhost.txt +295 -0
- package/dist/ai/llms.txt +69 -0
- package/dist/ai/slexkit-ai-manifest.json +2922 -0
- package/dist/base.css +621 -0
- package/dist/chunks/accordion-5f0nvjjm.js +376 -0
- package/dist/chunks/accordion-830dw78f.js +221 -0
- package/dist/chunks/accordion-cfjyxw93.js +630 -0
- package/dist/chunks/accordion-cw5r75jm.js +424 -0
- package/dist/chunks/accordion-ehnhpeca.js +492 -0
- package/dist/chunks/accordion-hzyrngd6.js +2377 -0
- package/dist/chunks/accordion-nw12ytps.js +6823 -0
- package/dist/components/accordion.js +163 -0
- package/dist/components/badge.js +80 -0
- package/dist/components/button.css +114 -0
- package/dist/components/button.js +16 -0
- package/dist/components/callout.js +154 -0
- package/dist/components/card.js +95 -0
- package/dist/components/checkbox.js +114 -0
- package/dist/components/choice.css +165 -0
- package/dist/components/code-block.js +264 -0
- package/dist/components/collapsible.js +111 -0
- package/dist/components/column.js +49 -0
- package/dist/components/content.css +474 -0
- package/dist/components/disclosure.css +162 -0
- package/dist/components/display.css +259 -0
- package/dist/components/divider.js +98 -0
- package/dist/components/feedback.css +219 -0
- package/dist/components/grid.js +67 -0
- package/dist/components/index.js +13364 -0
- package/dist/components/input.css +1247 -0
- package/dist/components/input.js +384 -0
- package/dist/components/link.js +77 -0
- package/dist/components/progress.js +111 -0
- package/dist/components/radio-group.js +189 -0
- package/dist/components/row.js +200 -0
- package/dist/components/section.js +161 -0
- package/dist/components/select.css +260 -0
- package/dist/components/select.js +16 -0
- package/dist/components/slider.css +125 -0
- package/dist/components/slider.js +175 -0
- package/dist/components/specs.js +1090 -0
- package/dist/components/stat.js +178 -0
- package/dist/components/submit.css +9 -0
- package/dist/components/submit.js +77 -0
- package/dist/components/switch.css +114 -0
- package/dist/components/switch.js +114 -0
- package/dist/components/table.js +157 -0
- package/dist/components/tabs.css +192 -0
- package/dist/components/tabs.js +17 -0
- package/dist/components/text-input.css +245 -0
- package/dist/components/text.js +50 -0
- package/dist/components/toast.js +240 -0
- package/dist/components/tooling.css +1009 -0
- package/dist/components/tooling.js +48951 -0
- package/dist/runtime.cjs +3728 -0
- package/dist/runtime.js +3686 -0
- package/dist/slexkit.cjs +18539 -0
- package/dist/slexkit.css +4776 -0
- package/dist/slexkit.js +18497 -0
- package/dist/tooling.js +59141 -0
- package/dist/types/components/accordion.d.ts +2 -0
- package/dist/types/components/badge.d.ts +2 -0
- package/dist/types/components/button.d.ts +2 -0
- package/dist/types/components/callout.d.ts +2 -0
- package/dist/types/components/card.d.ts +2 -0
- package/dist/types/components/checkbox.d.ts +2 -0
- package/dist/types/components/code-block.d.ts +2 -0
- package/dist/types/components/collapsible.d.ts +2 -0
- package/dist/types/components/column.d.ts +2 -0
- package/dist/types/components/divider.d.ts +2 -0
- package/dist/types/components/entries/accordion.d.ts +3 -0
- package/dist/types/components/entries/badge.d.ts +3 -0
- package/dist/types/components/entries/button.d.ts +3 -0
- package/dist/types/components/entries/callout.d.ts +3 -0
- package/dist/types/components/entries/card.d.ts +3 -0
- package/dist/types/components/entries/checkbox.d.ts +3 -0
- package/dist/types/components/entries/code-block.d.ts +3 -0
- package/dist/types/components/entries/collapsible.d.ts +3 -0
- package/dist/types/components/entries/column.d.ts +3 -0
- package/dist/types/components/entries/divider.d.ts +3 -0
- package/dist/types/components/entries/grid.d.ts +3 -0
- package/dist/types/components/entries/input.d.ts +3 -0
- package/dist/types/components/entries/link.d.ts +3 -0
- package/dist/types/components/entries/progress.d.ts +3 -0
- package/dist/types/components/entries/radio-group.d.ts +3 -0
- package/dist/types/components/entries/row.d.ts +3 -0
- package/dist/types/components/entries/section.d.ts +3 -0
- package/dist/types/components/entries/select.d.ts +3 -0
- package/dist/types/components/entries/slider.d.ts +3 -0
- package/dist/types/components/entries/specs.d.ts +1 -0
- package/dist/types/components/entries/stat.d.ts +3 -0
- package/dist/types/components/entries/submit.d.ts +3 -0
- package/dist/types/components/entries/switch.d.ts +3 -0
- package/dist/types/components/entries/table.d.ts +3 -0
- package/dist/types/components/entries/tabs.d.ts +3 -0
- package/dist/types/components/entries/text.d.ts +3 -0
- package/dist/types/components/entries/toast.d.ts +3 -0
- package/dist/types/components/entries/tooling.d.ts +1 -0
- package/dist/types/components/grid.d.ts +2 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/components/input.d.ts +2 -0
- package/dist/types/components/link.d.ts +2 -0
- package/dist/types/components/progress.d.ts +2 -0
- package/dist/types/components/radio-group.d.ts +2 -0
- package/dist/types/components/row.d.ts +2 -0
- package/dist/types/components/section.d.ts +2 -0
- package/dist/types/components/select.d.ts +2 -0
- package/dist/types/components/slider.d.ts +2 -0
- package/dist/types/components/spec-helpers.d.ts +23 -0
- package/dist/types/components/spec-registry.d.ts +12 -0
- package/dist/types/components/spec-schema.d.ts +74 -0
- package/dist/types/components/specs.d.ts +2 -0
- package/dist/types/components/stat.d.ts +2 -0
- package/dist/types/components/submit.d.ts +2 -0
- package/dist/types/components/svelte/adapter.d.ts +3 -0
- package/dist/types/components/svelte/bindProps.d.ts +2 -0
- package/dist/types/components/svelte/helpers.d.ts +33 -0
- package/dist/types/components/svelte/layout/balancedTiles.d.ts +14 -0
- package/dist/types/components/svelte/types.d.ts +12 -0
- package/dist/types/components/switch.d.ts +2 -0
- package/dist/types/components/table.d.ts +2 -0
- package/dist/types/components/tabs.d.ts +2 -0
- package/dist/types/components/text.d.ts +2 -0
- package/dist/types/components/toast.d.ts +2 -0
- package/dist/types/components/tooling.d.ts +2 -0
- package/dist/types/components-svelte.d.ts +5 -0
- package/dist/types/engine/component-scope.d.ts +14 -0
- package/dist/types/engine/component-state.d.ts +9 -0
- package/dist/types/engine/diagnostics.d.ts +24 -0
- package/dist/types/engine/engineering.d.ts +11 -0
- package/dist/types/engine/eval.d.ts +5 -0
- package/dist/types/engine/index.d.ts +26 -0
- package/dist/types/engine/markdown-runtime.d.ts +33 -0
- package/dist/types/engine/merge.d.ts +1 -0
- package/dist/types/engine/reactive.d.ts +11 -0
- package/dist/types/engine/registry.d.ts +4 -0
- package/dist/types/engine/renderer.d.ts +6 -0
- package/dist/types/engine/sandbox-runner.d.ts +2 -0
- package/dist/types/engine/secure-runtime.d.ts +214 -0
- package/dist/types/engine/store.d.ts +12 -0
- package/dist/types/engine/types.d.ts +58 -0
- package/dist/types/icons/manager.d.ts +17 -0
- package/dist/types/icons/phosphor.d.ts +45 -0
- package/dist/types/index.d.ts +61 -0
- package/dist/types/runtime.d.ts +32 -0
- package/dist/types/toolhost/index.d.ts +78 -0
- package/dist/types/tooling-umd.d.ts +47 -0
- package/dist/types/version.d.ts +8 -0
- package/dist/umd/slexkit.tooling.umd.js +66553 -0
- package/dist/umd/slexkit.umd.js +18552 -0
- package/package.json +136 -0
- package/scripts/cli.mjs +47 -0
- package/skills/slexkit/SKILL.md +27 -0
- package/skills/slexkit-author/SKILL.md +50 -0
- package/skills/slexkit-host-integration/SKILL.md +33 -0
- package/skills/slexkit-secure-runtime/SKILL.md +31 -0
- package/skills/slexkit-toolhost/SKILL.md +38 -0
- package/skills/slexkit-update/SKILL.md +23 -0
- package/src/components/svelte/InlineIcon.svelte +66 -0
- package/src/components/svelte/adapter.ts +76 -0
- package/src/components/svelte/bindProps.ts +9 -0
- package/src/components/svelte/content/Badge.svelte +19 -0
- package/src/components/svelte/content/Callout.svelte +57 -0
- package/src/components/svelte/content/CodeBlock.svelte +130 -0
- package/src/components/svelte/content/Divider.svelte +21 -0
- package/src/components/svelte/content/Link.svelte +21 -0
- package/src/components/svelte/content/Section.svelte +24 -0
- package/src/components/svelte/content/Table.svelte +44 -0
- package/src/components/svelte/disclosure/Accordion.svelte +100 -0
- package/src/components/svelte/disclosure/Collapsible.svelte +45 -0
- package/src/components/svelte/display/Stat.svelte +102 -0
- package/src/components/svelte/display/Text.svelte +11 -0
- package/src/components/svelte/feedback/Progress.svelte +34 -0
- package/src/components/svelte/feedback/Toast.svelte +105 -0
- package/src/components/svelte/helpers.ts +148 -0
- package/src/components/svelte/input/Button.svelte +78 -0
- package/src/components/svelte/input/Checkbox.svelte +52 -0
- package/src/components/svelte/input/Input.svelte +202 -0
- package/src/components/svelte/input/RadioGroup.svelte +71 -0
- package/src/components/svelte/input/Select.svelte +220 -0
- package/src/components/svelte/input/Slider.svelte +96 -0
- package/src/components/svelte/input/Submit.svelte +32 -0
- package/src/components/svelte/input/Switch.svelte +53 -0
- package/src/components/svelte/input/Tabs.svelte +188 -0
- package/src/components/svelte/layout/Card.svelte +17 -0
- package/src/components/svelte/layout/Column.svelte +15 -0
- package/src/components/svelte/layout/Grid.svelte +26 -0
- package/src/components/svelte/layout/Row.svelte +105 -0
- package/src/components/svelte/layout/balancedTiles.ts +85 -0
- package/src/components/svelte/tooling/CodeMirror.svelte +91 -0
- package/src/components/svelte/tooling/Playground.svelte +765 -0
- package/src/components/svelte/tooling/PlaygroundMarkdown.svelte +26 -0
- package/src/components/svelte/tooling/PlaygroundSlexCode.svelte +76 -0
- package/src/components/svelte/types.ts +17 -0
- package/src/styles/animation.css +98 -0
- package/src/styles/components/button.css +114 -0
- package/src/styles/components/choice.css +165 -0
- package/src/styles/components/select.css +260 -0
- package/src/styles/components/slider.css +125 -0
- package/src/styles/components/submit.css +9 -0
- package/src/styles/components/switch.css +114 -0
- package/src/styles/components/tabs.css +192 -0
- package/src/styles/components/text-input.css +245 -0
- package/src/styles/content.css +474 -0
- package/src/styles/disclosure.css +162 -0
- package/src/styles/display.css +259 -0
- package/src/styles/entry.css +34 -0
- package/src/styles/feedback.css +219 -0
- package/src/styles/input.css +8 -0
- package/src/styles/layout.css +365 -0
- package/src/styles/theme.css +31 -0
- package/src/styles/tooling.css +1009 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const componentSpecs: import("../spec-schema").ComponentSpec[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SvelteBuiltinComponent } from "./svelte/types";
|
|
2
|
+
import type { ComponentRegistrationOptions } from "../engine/types";
|
|
3
|
+
export declare const ALL_COMPONENT_TYPES: string[];
|
|
4
|
+
export declare function registerAll(): void;
|
|
5
|
+
export declare function registerSvelteComponent(type: string, component: SvelteBuiltinComponent, options?: ComponentRegistrationOptions): void;
|
|
6
|
+
export declare function registerSubset(types: string[]): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentSpec } from "./spec-schema";
|
|
2
|
+
import type { SlexExpression } from "../engine/types";
|
|
3
|
+
export declare function docs(type: string): {
|
|
4
|
+
href: string;
|
|
5
|
+
anchors: {
|
|
6
|
+
api: string;
|
|
7
|
+
examples: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare function example(type: string, propsOrSource: Record<string, unknown> | SlexExpression, title?: string): ComponentSpec["examples"][number];
|
|
11
|
+
export declare const semanticTones: readonly ["info", "success", "warning", "danger", "muted"];
|
|
12
|
+
export declare function stateFor(type: string): ComponentSpec["state"];
|
|
13
|
+
export declare function component(spec: Omit<ComponentSpec, "status" | "since" | "docs" | "state"> & {
|
|
14
|
+
state?: ComponentSpec["state"];
|
|
15
|
+
}): ComponentSpec;
|
|
16
|
+
export declare const childContent: {
|
|
17
|
+
allowed: boolean;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const noChildren: {
|
|
21
|
+
allowed: boolean;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComponentSpec, ComponentSpecLocaleOverlay, LocalizedComponentSpec } from "./spec-schema";
|
|
2
|
+
import { componentSpecs } from "./entries/specs";
|
|
3
|
+
export { componentSpecs };
|
|
4
|
+
export declare const publicComponentTypes: string[];
|
|
5
|
+
export declare function getComponentSpec(type: string): ComponentSpec | undefined;
|
|
6
|
+
export declare function hashSpecText(source: string): string;
|
|
7
|
+
export declare function componentSpecTextKey(type: string, field: "title" | "summary" | "description"): string;
|
|
8
|
+
export declare function componentPropTextKey(type: string, prop: string): string;
|
|
9
|
+
export declare function componentChildrenTextKey(type: string): string;
|
|
10
|
+
export declare function localizeComponentSpec(spec: ComponentSpec, locale?: string, overlay?: ComponentSpecLocaleOverlay): LocalizedComponentSpec;
|
|
11
|
+
export declare function localizeComponentSpecs(locale?: string, overlay?: ComponentSpecLocaleOverlay): LocalizedComponentSpec[];
|
|
12
|
+
export declare function getLocalizedComponentSpec(type: string, locale?: string, overlay?: ComponentSpecLocaleOverlay): LocalizedComponentSpec | undefined;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ComponentStateMode, SlexExpression } from "../engine/types";
|
|
2
|
+
export type ComponentSpecStatus = "ready" | "draft" | "experimental" | "deprecated";
|
|
3
|
+
export type ComponentSpecCategory = "Layout" | "Content" | "Display" | "Action" | "Input" | "Navigation" | "Disclosure" | "Feedback" | "Data" | "Tooling" | "Component";
|
|
4
|
+
export type PropSpec = {
|
|
5
|
+
type: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
default?: unknown;
|
|
8
|
+
dynamic?: boolean;
|
|
9
|
+
values?: readonly string[];
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
export type ChildrenSpec = {
|
|
13
|
+
allowed: boolean;
|
|
14
|
+
description?: string;
|
|
15
|
+
};
|
|
16
|
+
export type ComponentExampleSpec = {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
source: SlexExpression;
|
|
21
|
+
};
|
|
22
|
+
export type ComponentDocsSpec = {
|
|
23
|
+
href: string;
|
|
24
|
+
anchors?: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
export type ComponentSpec = {
|
|
27
|
+
type: string;
|
|
28
|
+
category: ComponentSpecCategory;
|
|
29
|
+
status: ComponentSpecStatus;
|
|
30
|
+
state: ComponentStateMode;
|
|
31
|
+
since: string;
|
|
32
|
+
title: string;
|
|
33
|
+
summary: string;
|
|
34
|
+
description: string;
|
|
35
|
+
props: Record<string, PropSpec>;
|
|
36
|
+
children: ChildrenSpec;
|
|
37
|
+
examples: ComponentExampleSpec[];
|
|
38
|
+
docs: ComponentDocsSpec;
|
|
39
|
+
};
|
|
40
|
+
export type ComponentSpecLocaleEntry = {
|
|
41
|
+
source: string;
|
|
42
|
+
sourceHash: string;
|
|
43
|
+
translation: string;
|
|
44
|
+
};
|
|
45
|
+
export type ComponentSpecLocaleOverlay = {
|
|
46
|
+
locale: string;
|
|
47
|
+
entries: Record<string, ComponentSpecLocaleEntry>;
|
|
48
|
+
};
|
|
49
|
+
export type LocalizedText = {
|
|
50
|
+
value: string;
|
|
51
|
+
source: string;
|
|
52
|
+
key: string;
|
|
53
|
+
stale: boolean;
|
|
54
|
+
missing: boolean;
|
|
55
|
+
};
|
|
56
|
+
export type LocalizedPropSpec = Omit<PropSpec, "description"> & {
|
|
57
|
+
description: string;
|
|
58
|
+
descriptionMeta: LocalizedText;
|
|
59
|
+
};
|
|
60
|
+
export type LocalizedChildrenSpec = Omit<ChildrenSpec, "description"> & {
|
|
61
|
+
description?: string;
|
|
62
|
+
descriptionMeta?: LocalizedText;
|
|
63
|
+
};
|
|
64
|
+
export type LocalizedComponentSpec = Omit<ComponentSpec, "title" | "summary" | "description" | "props" | "children"> & {
|
|
65
|
+
locale: string;
|
|
66
|
+
title: string;
|
|
67
|
+
summary: string;
|
|
68
|
+
description: string;
|
|
69
|
+
titleMeta: LocalizedText;
|
|
70
|
+
summaryMeta: LocalizedText;
|
|
71
|
+
descriptionMeta: LocalizedText;
|
|
72
|
+
props: Record<string, LocalizedPropSpec>;
|
|
73
|
+
children: LocalizedChildrenSpec;
|
|
74
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RenderContext } from "../../engine/types";
|
|
2
|
+
type Item = {
|
|
3
|
+
label?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
content?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare function formatDisplayNumber(value: number): string;
|
|
11
|
+
export declare function text(value: unknown, fallback?: string): string;
|
|
12
|
+
export declare function label(ctx: RenderContext, key: string, value: unknown, fallback?: string): string;
|
|
13
|
+
export declare function bool(value: unknown): boolean;
|
|
14
|
+
export declare function list(value: unknown): Item[];
|
|
15
|
+
export declare function rows(value: unknown): unknown[];
|
|
16
|
+
export declare function objects(value: unknown): Record<string, unknown>[];
|
|
17
|
+
export declare function itemLabel(item: unknown): string;
|
|
18
|
+
export declare function itemDescription(item: unknown): string;
|
|
19
|
+
export declare function readColumns(value: unknown): string[];
|
|
20
|
+
export declare function readColumnLabel(column: unknown, fallback: string): string;
|
|
21
|
+
export declare function readCell(row: unknown, column: string): string;
|
|
22
|
+
export declare function catalogItems(value: unknown): Record<string, unknown>[];
|
|
23
|
+
export declare function catalogGroups(value: unknown): Array<{
|
|
24
|
+
label: string;
|
|
25
|
+
items: Record<string, unknown>[];
|
|
26
|
+
}>;
|
|
27
|
+
export declare function renderChildren(node: HTMLElement, ctx: RenderContext): {
|
|
28
|
+
destroy(): void;
|
|
29
|
+
};
|
|
30
|
+
export declare function emit(ctx: RenderContext, event: string, data?: unknown): void;
|
|
31
|
+
export declare function formatScriptValue(value: unknown, indent?: number): string;
|
|
32
|
+
export declare function stringifySource(source: unknown): string;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type BalancedColumnsInput = {
|
|
2
|
+
itemCount: number;
|
|
3
|
+
containerWidth: number;
|
|
4
|
+
targetTileWidth?: number;
|
|
5
|
+
gap?: number;
|
|
6
|
+
};
|
|
7
|
+
type BalancedTileLayout = {
|
|
8
|
+
columns: number;
|
|
9
|
+
tracks: number;
|
|
10
|
+
spans: number[];
|
|
11
|
+
};
|
|
12
|
+
export declare function chooseBalancedColumns({ itemCount, containerWidth, targetTileWidth, gap, }: BalancedColumnsInput): number;
|
|
13
|
+
export declare function createBalancedTileLayout(itemCount: number, columns: number): BalancedTileLayout;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Component } from "svelte";
|
|
2
|
+
import type { RenderContext } from "../../engine/types";
|
|
3
|
+
export type PropValues = Record<string, unknown>;
|
|
4
|
+
export type PropStore = {
|
|
5
|
+
subscribe(run: (value: PropValues) => void): () => void;
|
|
6
|
+
};
|
|
7
|
+
export type SvelteComponentProps = {
|
|
8
|
+
componentName: string;
|
|
9
|
+
ctx: RenderContext;
|
|
10
|
+
props: PropStore;
|
|
11
|
+
};
|
|
12
|
+
export type SvelteBuiltinComponent = Component<SvelteComponentProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { registerAll, registerSvelteComponent, registerSubset } from "./components/index";
|
|
2
|
+
declare const registerAllApi: typeof registerAll;
|
|
3
|
+
declare const registerSvelteComponentApi: typeof registerSvelteComponent;
|
|
4
|
+
declare const registerSubsetApi: typeof registerSubset;
|
|
5
|
+
export { registerAllApi as registerAll, registerSvelteComponentApi as registerSvelteComponent, registerSubsetApi as registerSubset, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Cleanup = () => void;
|
|
2
|
+
type Subscriber<T> = (value: T) => void;
|
|
3
|
+
type FlushDom = () => void;
|
|
4
|
+
export type ReadableAccessor<T> = (() => T) & {
|
|
5
|
+
subscribe(run: Subscriber<T>): Cleanup;
|
|
6
|
+
};
|
|
7
|
+
export declare function configureComponentScope(options: {
|
|
8
|
+
flush?: FlushDom;
|
|
9
|
+
}): void;
|
|
10
|
+
export declare function createComponentAccessor<T>(read: () => T): ReadableAccessor<T>;
|
|
11
|
+
export declare function renderComponent(render: () => HTMLElement | void): HTMLElement | null;
|
|
12
|
+
export declare function attachComponentDisposer(el: HTMLElement, dispose: Cleanup): void;
|
|
13
|
+
export declare function disposeComponent(el: HTMLElement): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentState, ComponentStateMap, ComponentTypeMap, ForContext, LayoutNode } from "./types";
|
|
2
|
+
export declare function publicComponentState(name: string, state: ComponentState, componentTypes: ComponentTypeMap): ComponentState;
|
|
3
|
+
export declare function createGProxy(g: Record<string, unknown>, components: ComponentStateMap, componentTypes: ComponentTypeMap): Record<string, unknown>;
|
|
4
|
+
export declare function ensureComponentState(name: string, type: string, components: ComponentStateMap, componentTypes: ComponentTypeMap): ComponentState;
|
|
5
|
+
export declare function syncComponentProps(type: string, name: string, props: Record<string, unknown>, components: ComponentStateMap, componentTypes: ComponentTypeMap): ComponentState | undefined;
|
|
6
|
+
export declare function bindInputStateProps(type: string, state: ComponentState | undefined, props: Record<string, unknown>): void;
|
|
7
|
+
export declare function applyComponentEventState(type: string, name: string, data: unknown, components: ComponentStateMap, componentTypes: ComponentTypeMap): void;
|
|
8
|
+
export declare function prepareComponentStates(layout: LayoutNode, components: ComponentStateMap, componentTypes: ComponentTypeMap, ns: string): void;
|
|
9
|
+
export declare function buildComponentEvalContext(g: Record<string, unknown>, components: ComponentStateMap, componentTypes: ComponentTypeMap, api?: Record<string, unknown>, forCtx?: ForContext): Record<string, unknown>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type SlexKitSourceDiagnostic = {
|
|
2
|
+
message: string;
|
|
3
|
+
line: number;
|
|
4
|
+
column: number;
|
|
5
|
+
detail?: string;
|
|
6
|
+
excerpt: string;
|
|
7
|
+
};
|
|
8
|
+
export type SlexKitParseResult = {
|
|
9
|
+
ok: true;
|
|
10
|
+
value: unknown;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
error: SlexKitSyntaxError;
|
|
14
|
+
diagnostic: SlexKitSourceDiagnostic;
|
|
15
|
+
};
|
|
16
|
+
export declare class SlexKitSyntaxError extends SyntaxError {
|
|
17
|
+
diagnostic: SlexKitSourceDiagnostic;
|
|
18
|
+
constructor(diagnostic: SlexKitSourceDiagnostic);
|
|
19
|
+
}
|
|
20
|
+
export declare function formatSlexKitDiagnostic(diagnostic: SlexKitSourceDiagnostic): string;
|
|
21
|
+
export declare function diagnoseSlexKitSource(source: string, error: unknown): SlexKitSourceDiagnostic;
|
|
22
|
+
export declare function parseSlexSource(source: string): SlexKitParseResult;
|
|
23
|
+
/** @deprecated Use parseSlexSource instead. */
|
|
24
|
+
export declare const parseSlexKitDsl: typeof parseSlexSource;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type EngineeringNumberResult = {
|
|
2
|
+
raw: string;
|
|
3
|
+
number: number | null;
|
|
4
|
+
valid: boolean;
|
|
5
|
+
prefix: string;
|
|
6
|
+
unit: string;
|
|
7
|
+
normalized: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function parseEngineeringNumber(input: unknown): EngineeringNumberResult;
|
|
11
|
+
export declare function isEngineeringNumberResult(value: unknown): value is EngineeringNumberResult;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const SKIP_EAGER_TRACK: unique symbol;
|
|
2
|
+
export declare const EAGER_TRACK_TARGET: unique symbol;
|
|
3
|
+
export declare function clearEvalCache(ns: string): void;
|
|
4
|
+
export declare function evalRead(expr: string, context: Record<string, unknown>, ns?: string, path?: string): unknown;
|
|
5
|
+
export declare function execWrite(stmt: string, context: Record<string, unknown>, ns?: string, path?: string): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SlexExpression, MountOptions, ThemeMode } from "./types";
|
|
2
|
+
import type { SecureMountOptions } from "./secure-runtime";
|
|
3
|
+
export { register, getRenderer } from "./registry";
|
|
4
|
+
export { diagnoseSlexKitSource, SlexKitSyntaxError, formatSlexKitDiagnostic, parseSlexSource, parseSlexKitDsl, } from "./diagnostics";
|
|
5
|
+
export type { SlexKitParseResult, SlexKitSourceDiagnostic } from "./diagnostics";
|
|
6
|
+
export type { ComponentRegistrationOptions, ComponentRenderer, ComponentStateMode, MountOptions, RenderContext, SlexExpression, ThemeMode,
|
|
7
|
+
/** @deprecated Use SlexExpression instead. */
|
|
8
|
+
DSL, } from "./types";
|
|
9
|
+
export { createSecureRuntime, SlexKitRuntimeError, serializeRuntimeError, } from "./secure-runtime";
|
|
10
|
+
export { createSlexKitMarkdownRuntimeHost, getSlexKitMarkdownRuntimeHost, installSlexKitMarkdownRuntimeHost, } from "./markdown-runtime";
|
|
11
|
+
export type { SlexKitMarkdownBlock, SlexKitMarkdownRuntimeHost, SlexKitMarkdownRuntimeMode, SlexKitMarkdownRuntimeOptions, } from "./markdown-runtime";
|
|
12
|
+
export type { SlexKitRuntimeApi, HostFetchRequest, HostRuntimeAdapter, HostRuntimePolicy, NetworkOptions, NetworkResult, RafId, RuntimeCanvasContext, RuntimeCanvasContextId, RuntimeErrorEvent, RuntimeErrorKind, RuntimeNetworkLogEvent, SandboxSlotSizeMessage, SandboxSlotsMessage, SandboxFetchRequestMessage, SandboxFetchResponseMessage, SandboxHostMessage, SandboxMountMessage, SandboxRunnerMessage, SandboxStatusMessage, SecureFrameOptions, SecureArtifactSlot, SecureMountOptions, SecureRuntimeHandle, SerializedRuntimeError, TimerId, } from "./secure-runtime";
|
|
13
|
+
export declare function setSlexKitRuntimeUrl(url: string | undefined): void;
|
|
14
|
+
export declare function getSlexKitRuntimeUrl(): string | undefined;
|
|
15
|
+
export declare function mount(input: SlexExpression | string, container: HTMLElement, options?: MountOptions): () => void;
|
|
16
|
+
export declare function disposeNamespace(namespace: string): void;
|
|
17
|
+
export declare function mountSecureArtifact(input: SlexExpression | string, container: HTMLElement, options: SecureMountOptions): () => void;
|
|
18
|
+
export declare function ingest(input: SlexExpression | string): boolean;
|
|
19
|
+
export type BootOptions = {
|
|
20
|
+
selector?: string;
|
|
21
|
+
sourceControls?: boolean;
|
|
22
|
+
theme?: ThemeMode;
|
|
23
|
+
dir?: MountOptions["dir"];
|
|
24
|
+
labels?: MountOptions["labels"];
|
|
25
|
+
};
|
|
26
|
+
export declare function boot(options?: BootOptions): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SlexExpression, MountOptions, ThemeMode } from "./types";
|
|
2
|
+
import type { HostRuntimeAdapter, HostRuntimePolicy, SecureFrameOptions } from "./secure-runtime";
|
|
3
|
+
export type SlexKitMarkdownRuntimeMode = "trusted" | "secure";
|
|
4
|
+
export type SlexKitMarkdownRuntimeOptions = {
|
|
5
|
+
mode?: SlexKitMarkdownRuntimeMode;
|
|
6
|
+
policy?: HostRuntimePolicy;
|
|
7
|
+
hostAdapter?: HostRuntimeAdapter;
|
|
8
|
+
secureFrame?: boolean | SecureFrameOptions;
|
|
9
|
+
theme?: ThemeMode;
|
|
10
|
+
dir?: MountOptions["dir"];
|
|
11
|
+
labels?: MountOptions["labels"];
|
|
12
|
+
};
|
|
13
|
+
export type SlexKitMarkdownBlock = {
|
|
14
|
+
artifactId?: string;
|
|
15
|
+
blockId?: string;
|
|
16
|
+
source: SlexExpression | string;
|
|
17
|
+
container: HTMLElement;
|
|
18
|
+
stateOnly?: boolean;
|
|
19
|
+
theme?: ThemeMode;
|
|
20
|
+
dir?: MountOptions["dir"];
|
|
21
|
+
labels?: MountOptions["labels"];
|
|
22
|
+
};
|
|
23
|
+
export type SlexKitMarkdownRuntimeHost = {
|
|
24
|
+
configure(options: Partial<SlexKitMarkdownRuntimeOptions>): void;
|
|
25
|
+
getMode(): SlexKitMarkdownRuntimeMode;
|
|
26
|
+
mountBlock(block: SlexKitMarkdownBlock): () => void;
|
|
27
|
+
disposeBlock(container: HTMLElement): void;
|
|
28
|
+
disposeArtifact(artifactId: string): void;
|
|
29
|
+
disposeAll(): void;
|
|
30
|
+
};
|
|
31
|
+
export declare function createSlexKitMarkdownRuntimeHost(initialOptions?: SlexKitMarkdownRuntimeOptions): SlexKitMarkdownRuntimeHost;
|
|
32
|
+
export declare function installSlexKitMarkdownRuntimeHost(options?: SlexKitMarkdownRuntimeOptions): SlexKitMarkdownRuntimeHost;
|
|
33
|
+
export declare function getSlexKitMarkdownRuntimeHost(): SlexKitMarkdownRuntimeHost;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deepMerge(target: Record<string, unknown>, source: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type Cleanup = () => void;
|
|
2
|
+
export declare function createReactiveState<T extends object>(value: T): T;
|
|
3
|
+
export declare function asReactiveValue<T>(value: T, owner: unknown): T;
|
|
4
|
+
export declare function trackReactiveValue(value: unknown): void;
|
|
5
|
+
export declare function createRoot<T>(fn: (dispose: Cleanup) => T): T;
|
|
6
|
+
export declare function createEffect(fn: () => void): Cleanup;
|
|
7
|
+
export declare function createMemo<T>(fn: () => T): () => T;
|
|
8
|
+
export declare function createSignal<T>(initial: T): [() => T, (next: T) => void];
|
|
9
|
+
export declare function onCleanup(cleanup: Cleanup): void;
|
|
10
|
+
export declare function batch<T>(fn: () => T): T;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentRegistrationOptions, ComponentRenderer, ComponentStateMode } from "./types";
|
|
2
|
+
export declare function register(type: string, renderFn: ComponentRenderer, options?: ComponentRegistrationOptions): void;
|
|
3
|
+
export declare function getRenderer(type: string): ComponentRenderer | undefined;
|
|
4
|
+
export declare function getComponentStateMode(type: string): ComponentStateMode;
|