@kubuild/renderer 0.0.1 → 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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/dist/action-dispatcher.d.ts +42 -0
  4. package/dist/action-dispatcher.d.ts.map +1 -0
  5. package/dist/action-runners/api-request.d.ts +77 -0
  6. package/dist/action-runners/api-request.d.ts.map +1 -0
  7. package/dist/action-runners/index.d.ts +24 -0
  8. package/dist/action-runners/index.d.ts.map +1 -0
  9. package/dist/action-runners/modal-manager.d.ts +68 -0
  10. package/dist/action-runners/modal-manager.d.ts.map +1 -0
  11. package/dist/action-runners/navigation-utils.d.ts +49 -0
  12. package/dist/action-runners/navigation-utils.d.ts.map +1 -0
  13. package/dist/action-runners/toast-container.d.ts +20 -0
  14. package/dist/action-runners/toast-container.d.ts.map +1 -0
  15. package/dist/action-runners/toast-manager.d.ts +74 -0
  16. package/dist/action-runners/toast-manager.d.ts.map +1 -0
  17. package/dist/action-runners/ui-feedback.d.ts +33 -0
  18. package/dist/action-runners/ui-feedback.d.ts.map +1 -0
  19. package/dist/animation.d.ts +26 -0
  20. package/dist/animation.d.ts.map +1 -0
  21. package/dist/code-generator.d.ts +47 -0
  22. package/dist/code-generator.d.ts.map +1 -0
  23. package/dist/error-boundary.d.ts +2 -0
  24. package/dist/error-boundary.d.ts.map +1 -1
  25. package/dist/form-context.d.ts +114 -0
  26. package/dist/form-context.d.ts.map +1 -0
  27. package/dist/index.cjs +184 -2044
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.ts +7 -0
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +184 -1990
  32. package/dist/index.js.map +1 -1
  33. package/dist/nodes/editable-text.d.ts +15 -0
  34. package/dist/nodes/editable-text.d.ts.map +1 -0
  35. package/dist/nodes/form-nodes.d.ts +153 -0
  36. package/dist/nodes/form-nodes.d.ts.map +1 -0
  37. package/dist/nodes/html-embed.d.ts +15 -0
  38. package/dist/nodes/html-embed.d.ts.map +1 -0
  39. package/dist/nodes/index.d.ts +5 -0
  40. package/dist/nodes/index.d.ts.map +1 -0
  41. package/dist/nodes/media-utils.d.ts +17 -0
  42. package/dist/nodes/media-utils.d.ts.map +1 -0
  43. package/dist/preview-adapter.d.ts +1 -1
  44. package/dist/preview-adapter.d.ts.map +1 -1
  45. package/dist/renderer.d.ts +4 -24
  46. package/dist/renderer.d.ts.map +1 -1
  47. package/dist/renderers/index.d.ts +2 -0
  48. package/dist/renderers/index.d.ts.map +1 -0
  49. package/dist/renderers/render-node-content.d.ts +66 -0
  50. package/dist/renderers/render-node-content.d.ts.map +1 -0
  51. package/dist/styles.d.ts +8 -3
  52. package/dist/styles.d.ts.map +1 -1
  53. package/package.json +13 -14
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kustora
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # @kubuild/renderer
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@kubuild/renderer.svg)](https://www.npmjs.com/package/@kubuild/renderer)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue)](https://www.typescriptlang.org/)
6
+
7
+ Pure recursive React renderer for **KUBUILD** page documents with Action Dispatcher, built-in action runners (API requests, modals, toasts, navigation), form runtime context, and CSS style compiler.
8
+
9
+ ---
10
+
11
+ ## 📦 Installation
12
+
13
+ ```bash
14
+ # Using pnpm (recommended)
15
+ pnpm add @kubuild/renderer @kubuild/components @kubuild/core @kubuild/schema react react-dom
16
+
17
+ # Using npm
18
+ npm install @kubuild/renderer @kubuild/components @kubuild/core @kubuild/schema react react-dom
19
+
20
+ # Using yarn
21
+ yarn add @kubuild/renderer @kubuild/components @kubuild/core @kubuild/schema react react-dom
22
+ ```
23
+
24
+ ---
25
+
26
+ ## ✨ Features
27
+
28
+ - **Pure Recursive React Renderer**: High-performance `<Renderer />` component that walks the document node tree recursively and renders React elements.
29
+ - **Action Dispatcher & Built-in Action Runners**:
30
+ - `apiRequest`: Performs HTTP requests with URL parameters, headers, method, body interpolation, and success/error branching.
31
+ - `showToast`: Renders toast notifications (success, error, warning, info) via `ToastContainer`.
32
+ - `openModal` / `closeModal`: Triggers modal dialogs with focus trap and backdrop handlers.
33
+ - `navigate`: Client-side or browser redirects with URL interpolation.
34
+ - `custom`: Extensible hooks for application-specific action handlers.
35
+ - **Form Runtime Context**: `FormRuntimeProvider` and `useFormRuntime` for state management, field binding, live validation, and submission handling.
36
+ - **Dynamic CSS & Animations**: Computes responsive styles across breakpoints (desktop, tablet, mobile), hover/focus pseudo-states, and keyframe animations.
37
+ - **Security & XSS Defense**: Sanitizes dangerous `javascript:`, `data:text/html` URLs and prevents CSS injection.
38
+ - **Code Generator**: Compiles KUBUILD document trees into production-ready standalone React JSX and Tailwind CSS code.
39
+
40
+ ---
41
+
42
+ ## 🚀 Quick Usage
43
+
44
+ ### Rendering a Page Document
45
+
46
+ ```tsx
47
+ import React from 'react';
48
+ import { Renderer } from '@kubuild/renderer';
49
+ import type { PageDocument } from '@kubuild/schema';
50
+
51
+ interface PageViewerProps {
52
+ document: PageDocument;
53
+ }
54
+
55
+ export const PageViewer: React.FC<PageViewerProps> = ({ document }) => {
56
+ return (
57
+ <div className="page-container">
58
+ <Renderer
59
+ document={document}
60
+ onAction={(action, context) => {
61
+ console.log('Action triggered:', action.name, context);
62
+ }}
63
+ />
64
+ </div>
65
+ );
66
+ };
67
+ ```
68
+
69
+ ### Rendering with Toast Feedback & Action Dispatcher
70
+
71
+ ```tsx
72
+ import React from 'react';
73
+ import { Renderer, ToastContainer } from '@kubuild/renderer';
74
+ import type { PageDocument } from '@kubuild/schema';
75
+
76
+ export const InteractiveApp: React.FC<{ doc: PageDocument }> = ({ doc }) => {
77
+ return (
78
+ <>
79
+ <Renderer document={doc} />
80
+ {/* Toast container renders feedback notifications triggered by actions */}
81
+ <ToastContainer position="top-right" />
82
+ </>
83
+ );
84
+ };
85
+ ```
86
+
87
+ ### Generating Standalone React Code
88
+
89
+ ```typescript
90
+ import { generateReactCode } from '@kubuild/renderer';
91
+ import type { PageDocument } from '@kubuild/schema';
92
+
93
+ const tsxCode: string = generateReactCode(pageDocument.document, {
94
+ framework: 'react',
95
+ styling: 'tailwind'
96
+ });
97
+
98
+ console.log(tsxCode);
99
+ ```
100
+
101
+ ---
102
+
103
+ ## 📄 License
104
+
105
+ MIT © [KUBUILD](https://github.com/kustora/kubuild)
@@ -0,0 +1,42 @@
1
+ import type { PageDocument, Node, ActionTriggerType } from '@kubuild/schema';
2
+ import { ActionPipelineExecutor, type Diagnostic } from '@kubuild/core';
3
+ import type { RenderContext } from './render-context';
4
+ import type { FormRuntimeContextValue } from './form-context';
5
+ /**
6
+ * Options for executing node action pipelines.
7
+ */
8
+ export interface ExecuteNodeActionsOptions {
9
+ node: Node;
10
+ trigger: ActionTriggerType | string;
11
+ document?: PageDocument;
12
+ context?: RenderContext;
13
+ formContext?: FormRuntimeContextValue | null;
14
+ extraContext?: Record<string, unknown>;
15
+ onDiagnostic?: (diagnostic: Diagnostic) => void;
16
+ onActionDispatch?: (actionType: string, payload: Record<string, unknown> | undefined, nodeId: string) => void;
17
+ executor?: ActionPipelineExecutor;
18
+ }
19
+ /**
20
+ * Execution outcome from executeNodeActions.
21
+ */
22
+ export interface NodeActionExecutionOutcome {
23
+ executed: boolean;
24
+ success: boolean;
25
+ error?: unknown;
26
+ }
27
+ /**
28
+ * Executes all action pipelines defined on a node that match a specific trigger.
29
+ */
30
+ export declare function executeNodeActions(options: ExecuteNodeActionsOptions): Promise<NodeActionExecutionOutcome>;
31
+ /**
32
+ * Hook to execute `load` lifecycle action pipelines on component mount.
33
+ */
34
+ export declare function useNodeLoadActions(node: Node, options: {
35
+ document?: PageDocument;
36
+ context?: RenderContext;
37
+ formContext?: FormRuntimeContextValue | null;
38
+ onDiagnostic?: (diagnostic: Diagnostic) => void;
39
+ onActionDispatch?: (actionType: string, payload: Record<string, unknown> | undefined, nodeId: string) => void;
40
+ mode?: 'editor' | 'runtime';
41
+ }): void;
42
+ //# sourceMappingURL=action-dispatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../src/action-dispatcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,EAAkB,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAG9D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,KACX,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,0BAA0B,CAAC,CA6ErC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IACP,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAC7C,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAC;IAChD,gBAAgB,CAAC,EAAE,CACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,MAAM,EAAE,MAAM,KACX,IAAI,CAAC;IACV,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC7B,GACA,IAAI,CA2CN"}
@@ -0,0 +1,77 @@
1
+ import { type PipelineStepHandler } from '@kubuild/core';
2
+ /**
3
+ * Standard API Request Response representation.
4
+ */
5
+ export interface ApiRequestResponse<T = unknown> {
6
+ ok: boolean;
7
+ status: number;
8
+ statusText: string;
9
+ headers: Record<string, string>;
10
+ data: T;
11
+ body: T;
12
+ url: string;
13
+ }
14
+ /**
15
+ * Details passed to ApiRequestError.
16
+ */
17
+ export interface ApiRequestErrorDetails {
18
+ status?: number;
19
+ statusText?: string;
20
+ url?: string;
21
+ method?: string;
22
+ data?: unknown;
23
+ headers?: Record<string, string>;
24
+ response?: ApiRequestResponse;
25
+ isTimeout?: boolean;
26
+ isCancelled?: boolean;
27
+ isNetworkError?: boolean;
28
+ stepId?: string;
29
+ cause?: unknown;
30
+ }
31
+ /**
32
+ * Custom Error thrown when an API request fails, times out, or returns a non-2xx status code.
33
+ */
34
+ export declare class ApiRequestError extends Error {
35
+ readonly status?: number;
36
+ readonly statusText?: string;
37
+ readonly url?: string;
38
+ readonly method?: string;
39
+ readonly data?: unknown;
40
+ readonly headers?: Record<string, string>;
41
+ readonly response?: ApiRequestResponse;
42
+ readonly isTimeout: boolean;
43
+ readonly isCancelled: boolean;
44
+ readonly isNetworkError: boolean;
45
+ readonly stepId?: string;
46
+ readonly cause?: unknown;
47
+ constructor(message: string, details?: ApiRequestErrorDetails);
48
+ }
49
+ /**
50
+ * Options for configuring API Request Action Runner.
51
+ */
52
+ export interface ApiRequestRunnerOptions {
53
+ fetchFn?: typeof fetch;
54
+ defaultTimeout?: number;
55
+ baseUrl?: string;
56
+ headers?: Record<string, string>;
57
+ }
58
+ /**
59
+ * Builds and validates the final API request URL with query parameters.
60
+ */
61
+ export declare function buildApiUrl(rawUrl: string, queryParams?: Record<string, unknown>, baseUrl?: string): string;
62
+ /**
63
+ * Prepares the request body and normalizes headers based on body payload and body format.
64
+ */
65
+ export declare function prepareRequestBody(method: string, body: unknown, bodyFormat?: string, headers?: Record<string, string>): {
66
+ body: BodyInit | undefined;
67
+ headers: Record<string, string>;
68
+ };
69
+ /**
70
+ * Creates an API Request Step Handler configured with custom options or default settings.
71
+ */
72
+ export declare function createApiRequestHandler(options?: ApiRequestRunnerOptions): PipelineStepHandler;
73
+ /**
74
+ * Default built-in API Request Runner instance.
75
+ */
76
+ export declare const apiRequestRunner: PipelineStepHandler;
77
+ //# sourceMappingURL=api-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-request.d.ts","sourceRoot":"","sources":["../../src/action-runners/api-request.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,24 @@
1
+ import type { ActionPipelineExecutor, PipelineStepHandler } from '@kubuild/core';
2
+ import { type ApiRequestRunnerOptions } from './api-request';
3
+ export * from './api-request';
4
+ export * from './toast-manager';
5
+ export * from './toast-container';
6
+ export * from './modal-manager';
7
+ export * from './ui-feedback';
8
+ export * from './navigation-utils';
9
+ /**
10
+ * Options for configuring built-in action runners.
11
+ */
12
+ export interface ActionRunnerFactoryOptions {
13
+ apiRequest?: ApiRequestRunnerOptions;
14
+ handlers?: Record<string, PipelineStepHandler>;
15
+ }
16
+ /**
17
+ * Creates a map of all default built-in action runners for `@kubuild/renderer`.
18
+ */
19
+ export declare function createDefaultActionRunners(options?: ActionRunnerFactoryOptions): Record<string, PipelineStepHandler>;
20
+ /**
21
+ * Registers default built-in action runners onto an ActionPipelineExecutor instance.
22
+ */
23
+ export declare function registerDefaultActionRunners(executor: ActionPipelineExecutor, options?: ActionRunnerFactoryOptions): ActionPipelineExecutor;
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/action-runners/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,eAAe,CAAC;AAIvB,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AAEnC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;CAChD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,CAAC,EAAE,0BAA0B,GACnC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAerC;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE,0BAA0B,GACnC,sBAAsB,CAQxB"}
@@ -0,0 +1,68 @@
1
+ export type ModalState = Record<string, boolean>;
2
+ export type ModalListener = (modals: ModalState) => void;
3
+ /**
4
+ * ModalManager manages visibility state of modals, stack ordering, and custom events.
5
+ */
6
+ export declare class ModalManager {
7
+ private modals;
8
+ private activeStack;
9
+ private listeners;
10
+ /**
11
+ * Opens a modal dialog by ID.
12
+ */
13
+ openModal(modalId: string): void;
14
+ /**
15
+ * Closes a modal dialog by ID or closes the topmost modal if no ID is specified.
16
+ */
17
+ closeModal(modalId?: string): void;
18
+ /**
19
+ * Toggles visibility state of a modal.
20
+ */
21
+ toggleModal(modalId: string): boolean;
22
+ /**
23
+ * Checks whether a modal is currently open.
24
+ */
25
+ isModalOpen(modalId: string): boolean;
26
+ /**
27
+ * Returns a snapshot map of all modal states.
28
+ */
29
+ getState(): ModalState;
30
+ /**
31
+ * Returns list of currently open modal IDs in stack order.
32
+ */
33
+ getActiveModals(): string[];
34
+ /**
35
+ * Resets all modal states to closed.
36
+ */
37
+ reset(): void;
38
+ /**
39
+ * Subscribes a listener to modal state changes.
40
+ */
41
+ subscribe(listener: ModalListener): () => void;
42
+ private notify;
43
+ }
44
+ /**
45
+ * Singleton ModalManager instance.
46
+ */
47
+ export declare const modalManager: ModalManager;
48
+ /**
49
+ * React hook to observe and manipulate a single modal dialog state.
50
+ */
51
+ export declare function useModal(modalId: string, manager?: ModalManager): {
52
+ isOpen: boolean;
53
+ open: () => void;
54
+ close: () => void;
55
+ toggle: () => boolean;
56
+ };
57
+ /**
58
+ * React hook to observe and manage all modal dialogs.
59
+ */
60
+ export declare function useModals(manager?: ModalManager): {
61
+ modals: ModalState;
62
+ activeModals: string[];
63
+ isOpen: (modalId: string) => boolean;
64
+ openModal: (modalId: string) => void;
65
+ closeModal: (modalId?: string) => void;
66
+ toggleModal: (modalId: string) => boolean;
67
+ };
68
+ //# sourceMappingURL=modal-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-manager.d.ts","sourceRoot":"","sources":["../../src/action-runners/modal-manager.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;AAEzD;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,SAAS,CAA4B;IAE7C;;OAEG;IACI,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAwBvC;;OAEG;IACI,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IA4CzC;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAW5C;;OAEG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAK5C;;OAEG;IACI,QAAQ,IAAI,UAAU;IAQ7B;;OAEG;IACI,eAAe,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACI,KAAK,IAAI,IAAI;IAMpB;;OAEG;IACI,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI;IAOrD,OAAO,CAAC,MAAM;CAUf;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C;;GAEG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,YAA2B,GACnC;IACD,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,OAAO,CAAC;CACvB,CAeA;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,YAA2B,GAAG;IAC/D,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;CAC3C,CAkBA"}
@@ -0,0 +1,49 @@
1
+ import { type PipelineStepHandler } from '@kubuild/core';
2
+ /**
3
+ * Result returned by navigate runner.
4
+ */
5
+ export interface NavigateResult {
6
+ url: string;
7
+ target?: string;
8
+ replace?: boolean;
9
+ scroll?: boolean;
10
+ behavior?: 'smooth' | 'auto';
11
+ navigated: boolean;
12
+ isAnchor: boolean;
13
+ }
14
+ /**
15
+ * Result returned by copy_clipboard runner.
16
+ */
17
+ export interface CopyClipboardResult {
18
+ text: string;
19
+ copied: boolean;
20
+ }
21
+ /**
22
+ * Result returned by reset_form runner.
23
+ */
24
+ export interface ResetFormResult {
25
+ formId?: string;
26
+ reset: boolean;
27
+ }
28
+ /**
29
+ * Helper to copy text to clipboard with legacy fallback.
30
+ */
31
+ export declare function copyToClipboard(text: string, options?: {
32
+ copyFn?: (text: string) => Promise<void> | void;
33
+ }): Promise<boolean>;
34
+ /**
35
+ * Action Runner for `navigate`.
36
+ * Supports external redirects, target windows (_blank), SPA navigate hooks, and smooth anchor scrolling (#id).
37
+ */
38
+ export declare const navigateRunner: PipelineStepHandler;
39
+ /**
40
+ * Action Runner for `copy_clipboard`.
41
+ * Copies string or variable payload to user clipboard with fallback and optional toast notification.
42
+ */
43
+ export declare const copyClipboardRunner: PipelineStepHandler;
44
+ /**
45
+ * Action Runner for `reset_form`.
46
+ * Resets form context values and DOM form elements to default state.
47
+ */
48
+ export declare const resetFormRunner: PipelineStepHandler;
49
+ //# sourceMappingURL=navigation-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-utils.d.ts","sourceRoot":"","sources":["../../src/action-runners/navigation-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGxF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAAE,GAC5D,OAAO,CAAC,OAAO,CAAC,CA0ClB;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,mBA8G5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAwCjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,mBAqC7B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { type ToastItem, type ToastPosition, type ToastManager as ToastManagerClass } from './toast-manager';
3
+ export interface ToastContainerProps {
4
+ manager?: ToastManagerClass;
5
+ position?: ToastPosition;
6
+ className?: string;
7
+ maxVisible?: number;
8
+ }
9
+ /**
10
+ * Single Toast Item component rendering an alert card.
11
+ */
12
+ export declare const ToastCard: React.FC<{
13
+ toast: ToastItem;
14
+ }>;
15
+ /**
16
+ * Built-in responsive Toast Container component.
17
+ * Renders floating toasts with smooth animations and auto-dismiss capabilities.
18
+ */
19
+ export declare const ToastContainer: React.FC<ToastContainerProps>;
20
+ //# sourceMappingURL=toast-container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-container.d.ts","sourceRoot":"","sources":["../../src/action-runners/toast-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,YAAY,IAAI,iBAAiB,EACvC,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkFD;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CA8EpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6ExD,CAAC"}
@@ -0,0 +1,74 @@
1
+ export type ToastType = 'success' | 'error' | 'warning' | 'info';
2
+ export type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
3
+ /**
4
+ * Configuration options for spawning a toast notification.
5
+ */
6
+ export interface ToastOptions {
7
+ message: string;
8
+ type?: ToastType;
9
+ variant?: ToastType;
10
+ title?: string;
11
+ duration?: number;
12
+ position?: ToastPosition;
13
+ dismissible?: boolean;
14
+ id?: string;
15
+ }
16
+ /**
17
+ * Internal active toast item structure.
18
+ */
19
+ export interface ToastItem {
20
+ id: string;
21
+ type: ToastType;
22
+ message: string;
23
+ title?: string;
24
+ duration: number;
25
+ position: ToastPosition;
26
+ dismissible: boolean;
27
+ createdAt: number;
28
+ dismiss: () => void;
29
+ }
30
+ type ToastListener = (toasts: ToastItem[]) => void;
31
+ /**
32
+ * ToastManager manages reactive toast state, timers, and event subscriptions.
33
+ */
34
+ export declare class ToastManager {
35
+ private toasts;
36
+ private listeners;
37
+ private timers;
38
+ /**
39
+ * Spawns a new toast notification.
40
+ */
41
+ showToast(options: ToastOptions | string): ToastItem;
42
+ /**
43
+ * Dismisses a single toast by ID.
44
+ */
45
+ dismissToast(id: string): void;
46
+ /**
47
+ * Clears all active toasts.
48
+ */
49
+ clearToasts(): void;
50
+ /**
51
+ * Returns current active toasts.
52
+ */
53
+ getToasts(): ToastItem[];
54
+ /**
55
+ * Subscribes a listener to toast state changes.
56
+ */
57
+ subscribe(listener: ToastListener): () => void;
58
+ private notify;
59
+ }
60
+ /**
61
+ * Singleton ToastManager instance for global toast handling.
62
+ */
63
+ export declare const toastManager: ToastManager;
64
+ /**
65
+ * React hook to observe and trigger toast notifications.
66
+ */
67
+ export declare function useToasts(manager?: ToastManager): {
68
+ toasts: ToastItem[];
69
+ showToast: (options: ToastOptions | string) => ToastItem;
70
+ dismissToast: (id: string) => void;
71
+ clearToasts: () => void;
72
+ };
73
+ export {};
74
+ //# sourceMappingURL=toast-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-manager.d.ts","sourceRoot":"","sources":["../../src/action-runners/toast-manager.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,YAAY,GACZ,eAAe,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;AAInD;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,MAAM,CAAoD;IAElE;;OAEG;IACI,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS;IA2C3D;;OAEG;IACI,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAcrC;;OAEG;IACI,WAAW,IAAI,IAAI;IAS1B;;OAEG;IACI,SAAS,IAAI,SAAS,EAAE;IAI/B;;OAEG;IACI,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,IAAI;IAOrD,OAAO,CAAC,MAAM;CAUf;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,YAA2B,GAAG;IAC/D,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,KAAK,SAAS,CAAC;IACzD,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAgBA"}
@@ -0,0 +1,33 @@
1
+ import { type PipelineStepHandler } from '@kubuild/core';
2
+ import { type ToastType, type ToastPosition } from './toast-manager';
3
+ /**
4
+ * Result returned by show_toast runner.
5
+ */
6
+ export interface ShowToastResult {
7
+ id: string;
8
+ message: string;
9
+ type: ToastType;
10
+ title?: string;
11
+ duration: number;
12
+ position: ToastPosition;
13
+ }
14
+ /**
15
+ * Result returned by open_modal or close_modal runner.
16
+ */
17
+ export interface ModalActionResult {
18
+ modalId: string;
19
+ open: boolean;
20
+ }
21
+ /**
22
+ * Action Runner for `show_toast`.
23
+ */
24
+ export declare const showToastRunner: PipelineStepHandler;
25
+ /**
26
+ * Action Runner for `open_modal`.
27
+ */
28
+ export declare const openModalRunner: PipelineStepHandler;
29
+ /**
30
+ * Action Runner for `close_modal`.
31
+ */
32
+ export declare const closeModalRunner: PipelineStepHandler;
33
+ //# sourceMappingURL=ui-feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-feedback.d.ts","sourceRoot":"","sources":["../../src/action-runners/ui-feedback.ts"],"names":[],"mappings":"AACA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAmC,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGtG;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,mBAqC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,mBAkC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,mBAqC9B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { PageDocument, AnimationConfig } from '@kubuild/schema';
2
+ /**
3
+ * Standard Keyframes for Entrance, Scroll, and Continuous Loop Animations (STORA-263, STORA-264)
4
+ */
5
+ export declare const ANIMATION_KEYFRAMES_CSS: string;
6
+ /**
7
+ * Generate CSS rules for Hover Micro-Interactions (STORA-264)
8
+ */
9
+ export declare function getHoverEffectCss(nodeId: string, hoverEffect: string): string[];
10
+ /**
11
+ * Generate CSS rules for Continuous Loop Effects (STORA-264)
12
+ */
13
+ export declare function getLoopEffectCss(nodeId: string, loopEffect: string): string[];
14
+ /**
15
+ * Generate CSS rules for Entrance / Scroll Animations (STORA-263)
16
+ */
17
+ export declare function getEntranceAnimationCss(nodeId: string, anim: AnimationConfig): string[];
18
+ /**
19
+ * Walk the document and collect all compiled CSS rules for animations, hover micro-interactions, and loop effects.
20
+ */
21
+ export declare function collectAnimationStylesCss(document: PageDocument | undefined | null): string;
22
+ /**
23
+ * Replay CSS animation on a specific DOM element by node ID (STORA-262)
24
+ */
25
+ export declare function replayNodeAnimation(nodeId: string, rootElement?: HTMLElement | Document | null): boolean;
26
+ //# sourceMappingURL=animation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../src/animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAQ,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,uBAAuB,QA4E5B,CAAC;AAST;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAkC/E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAmC7E;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM,EAAE,CAUvF;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CA6B3F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,CAgBxG"}
@@ -0,0 +1,47 @@
1
+ import { PageDocument, Node } from '@kubuild/schema';
2
+ export interface GenerateHtmlOptions {
3
+ /**
4
+ * Whether to include internal node ID classes (`kb-node-{id}`).
5
+ * Defaults to true so generated CSS matches HTML elements.
6
+ */
7
+ includeNodeClasses?: boolean;
8
+ /**
9
+ * Indentation width in spaces. Defaults to 2.
10
+ */
11
+ indentSize?: number;
12
+ /**
13
+ * Root tag for the page container ('main' | 'div'). Defaults to 'main'.
14
+ */
15
+ rootTag?: 'main' | 'div';
16
+ }
17
+ export interface GenerateCssOptions {
18
+ /**
19
+ * Whether to include the baseline CSS reset. Defaults to true.
20
+ */
21
+ includeReset?: boolean;
22
+ /**
23
+ * Custom CSS class prefix for node selectors. Defaults to 'kb-node-'.
24
+ */
25
+ classPrefix?: string;
26
+ }
27
+ export interface StandaloneHtmlOptions {
28
+ htmlOptions?: GenerateHtmlOptions;
29
+ cssOptions?: GenerateCssOptions;
30
+ /** Custom language attribute for <html>. Defaults to 'en'. */
31
+ lang?: string;
32
+ }
33
+ /**
34
+ * Generates a clean, formatted semantic HTML string for a PageDocument or Node.
35
+ */
36
+ export declare function generateSemanticHtml(docOrNode: PageDocument | Node, options?: GenerateHtmlOptions): string;
37
+ /**
38
+ * Generates structured, readable CSS for the given document, compiling
39
+ * base styles, responsive breakpoints (tablet/mobile), and pseudo-classes.
40
+ */
41
+ export declare function generateDocumentCss(docOrNode: PageDocument | Node, options?: GenerateCssOptions): string;
42
+ /**
43
+ * Generates a complete, standalone, production-ready HTML document string
44
+ * with metadata, responsive viewport tags, embedded stylesheet, and semantic body markup.
45
+ */
46
+ export declare function generateStandaloneHtml(doc: PageDocument, options?: StandaloneHtmlOptions): string;
47
+ //# sourceMappingURL=code-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-generator.d.ts","sourceRoot":"","sources":["../src/code-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIrD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA4ZD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,YAAY,GAAG,IAAI,EAC9B,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAIR;AAiBD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,YAAY,GAAG,IAAI,EAC9B,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAgGR;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,YAAY,EACjB,OAAO,GAAE,qBAA0B,GAClC,MAAM,CA0BR"}
@@ -1,10 +1,12 @@
1
1
  import { Component, ErrorInfo, ReactNode } from 'react';
2
+ import type { Diagnostic } from './render-context';
2
3
  export interface ComponentErrorBoundaryProps {
3
4
  nodeId: string;
4
5
  componentType: string;
5
6
  mode?: 'editor' | 'runtime';
6
7
  children: ReactNode;
7
8
  onError?: (error: Error, info: ErrorInfo) => void;
9
+ onDiagnostic?: (diagnostic: Diagnostic) => void;
8
10
  }
9
11
  interface ComponentErrorBoundaryState {
10
12
  hasError: boolean;