@kubuild/renderer 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/animation.d.ts +26 -0
- package/dist/animation.d.ts.map +1 -0
- package/dist/code-generator.d.ts +47 -0
- package/dist/code-generator.d.ts.map +1 -0
- package/dist/error-boundary.d.ts.map +1 -1
- package/dist/index.cjs +751 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +741 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44754 -0
- package/dist/index.mjs.map +1 -0
- package/dist/renderer.d.ts.map +1 -1
- package/dist/styles.d.ts +8 -3
- package/dist/styles.d.ts.map +1 -1
- 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.
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../src/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../src/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG/D,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACnD;AAED,UAAU,2BAA2B;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,qBAAa,sBAAuB,SAAQ,SAAS,CACnD,2BAA2B,EAC3B,2BAA2B,CAC5B;gBACa,KAAK,EAAE,2BAA2B;IAK9C,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,2BAA2B;IAI1E,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IAM3D,MAAM,IAAI,SAAS;CA8CpB"}
|