nuclo 0.2.35 → 0.2.37

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 (118) hide show
  1. package/dist/Element-DLSdmoqX.mjs +2 -0
  2. package/dist/Element-DLSdmoqX.mjs.map +1 -0
  3. package/dist/Element-DfxBbUgD.cjs +2 -0
  4. package/dist/Element-DfxBbUgD.cjs.map +1 -0
  5. package/dist/nuclo.cjs +1 -1
  6. package/dist/nuclo.cjs.map +1 -1
  7. package/dist/nuclo.mjs +1 -1
  8. package/dist/nuclo.mjs.map +1 -1
  9. package/dist/polyfill/nuclo.polyfill.cjs +1 -1
  10. package/dist/polyfill/nuclo.polyfill.cjs.map +1 -1
  11. package/dist/polyfill/nuclo.polyfill.mjs +1 -1
  12. package/dist/polyfill/nuclo.polyfill.mjs.map +1 -1
  13. package/dist/ssr/nuclo.ssr.cjs +1 -1
  14. package/dist/ssr/nuclo.ssr.cjs.map +1 -1
  15. package/dist/ssr/nuclo.ssr.mjs +1 -1
  16. package/dist/ssr/nuclo.ssr.mjs.map +1 -1
  17. package/package.json +4 -20
  18. package/types/core/base.d.ts +1 -4
  19. package/types/features/list.d.ts +0 -1
  20. package/types/index.d.ts +0 -53
  21. package/types/polyfill.d.ts +9 -44
  22. package/types/ssr.d.ts +0 -6
  23. package/dist/Element-BUdteOsZ.cjs +0 -2
  24. package/dist/Element-BUdteOsZ.cjs.map +0 -1
  25. package/dist/Element-Djosl17E.mjs +0 -2
  26. package/dist/Element-Djosl17E.mjs.map +0 -1
  27. package/dist/bootstrap.d.ts +0 -5
  28. package/dist/bootstrap.d.ts.map +0 -1
  29. package/dist/element/attributes.d.ts +0 -6
  30. package/dist/element/attributes.d.ts.map +0 -1
  31. package/dist/element/class-name.d.ts +0 -6
  32. package/dist/element/class-name.d.ts.map +0 -1
  33. package/dist/element/event-attributes.d.ts +0 -5
  34. package/dist/element/event-attributes.d.ts.map +0 -1
  35. package/dist/element/events.d.ts +0 -46
  36. package/dist/element/events.d.ts.map +0 -1
  37. package/dist/element/factory-meta.d.ts +0 -27
  38. package/dist/element/factory-meta.d.ts.map +0 -1
  39. package/dist/element/factory.d.ts +0 -32
  40. package/dist/element/factory.d.ts.map +0 -1
  41. package/dist/element/inline-style.d.ts +0 -9
  42. package/dist/element/inline-style.d.ts.map +0 -1
  43. package/dist/element/lifecycle.d.ts +0 -106
  44. package/dist/element/lifecycle.d.ts.map +0 -1
  45. package/dist/element/modifiers.d.ts +0 -11
  46. package/dist/element/modifiers.d.ts.map +0 -1
  47. package/dist/element/tags.d.ts +0 -5
  48. package/dist/element/tags.d.ts.map +0 -1
  49. package/dist/hydration.d.ts +0 -73
  50. package/dist/hydration.d.ts.map +0 -1
  51. package/dist/index.d.ts +0 -17
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/list/index.d.ts +0 -7
  54. package/dist/list/index.d.ts.map +0 -1
  55. package/dist/list/runtime.d.ts +0 -6
  56. package/dist/list/runtime.d.ts.map +0 -1
  57. package/dist/list/template.d.ts +0 -113
  58. package/dist/list/template.d.ts.map +0 -1
  59. package/dist/list/types.d.ts +0 -57
  60. package/dist/list/types.d.ts.map +0 -1
  61. package/dist/nuclo.umd.js +0 -2
  62. package/dist/nuclo.umd.js.map +0 -1
  63. package/dist/polyfill/Document.d.ts +0 -19
  64. package/dist/polyfill/Document.d.ts.map +0 -1
  65. package/dist/polyfill/Element.d.ts +0 -48
  66. package/dist/polyfill/Element.d.ts.map +0 -1
  67. package/dist/polyfill/Event.d.ts +0 -43
  68. package/dist/polyfill/Event.d.ts.map +0 -1
  69. package/dist/polyfill/Node.d.ts +0 -13
  70. package/dist/polyfill/Node.d.ts.map +0 -1
  71. package/dist/polyfill/Text.d.ts +0 -11
  72. package/dist/polyfill/Text.d.ts.map +0 -1
  73. package/dist/polyfill/index.d.ts +0 -24
  74. package/dist/polyfill/index.d.ts.map +0 -1
  75. package/dist/render.d.ts +0 -33
  76. package/dist/render.d.ts.map +0 -1
  77. package/dist/shared/conditions.d.ts +0 -4
  78. package/dist/shared/conditions.d.ts.map +0 -1
  79. package/dist/shared/dom.d.ts +0 -80
  80. package/dist/shared/dom.d.ts.map +0 -1
  81. package/dist/shared/environment.d.ts +0 -5
  82. package/dist/shared/environment.d.ts.map +0 -1
  83. package/dist/shared/errors.d.ts +0 -2
  84. package/dist/shared/errors.d.ts.map +0 -1
  85. package/dist/shared/renderables.d.ts +0 -4
  86. package/dist/shared/renderables.d.ts.map +0 -1
  87. package/dist/shared/strings.d.ts +0 -19
  88. package/dist/shared/strings.d.ts.map +0 -1
  89. package/dist/shared/type-guards.d.ts +0 -16
  90. package/dist/shared/type-guards.d.ts.map +0 -1
  91. package/dist/ssr/index.d.ts +0 -19
  92. package/dist/ssr/index.d.ts.map +0 -1
  93. package/dist/ssr/render-to-string.d.ts +0 -41
  94. package/dist/ssr/render-to-string.d.ts.map +0 -1
  95. package/dist/style/css.d.ts +0 -26
  96. package/dist/style/css.d.ts.map +0 -1
  97. package/dist/style/engine.d.ts +0 -94
  98. package/dist/style/engine.d.ts.map +0 -1
  99. package/dist/style/index.d.ts +0 -3
  100. package/dist/style/index.d.ts.map +0 -1
  101. package/dist/update/conditional.d.ts +0 -3
  102. package/dist/update/conditional.d.ts.map +0 -1
  103. package/dist/update/reactive-attributes.d.ts +0 -45
  104. package/dist/update/reactive-attributes.d.ts.map +0 -1
  105. package/dist/update/reactive-text.d.ts +0 -38
  106. package/dist/update/reactive-text.d.ts.map +0 -1
  107. package/dist/update/registry.d.ts +0 -116
  108. package/dist/update/registry.d.ts.map +0 -1
  109. package/dist/update/scope.d.ts +0 -7
  110. package/dist/update/scope.d.ts.map +0 -1
  111. package/dist/update/update.d.ts +0 -4
  112. package/dist/update/update.d.ts.map +0 -1
  113. package/dist/when/builder.d.ts +0 -16
  114. package/dist/when/builder.d.ts.map +0 -1
  115. package/dist/when/index.d.ts +0 -44
  116. package/dist/when/index.d.ts.map +0 -1
  117. package/dist/when/runtime.d.ts +0 -59
  118. package/dist/when/runtime.d.ts.map +0 -1
@@ -1,19 +0,0 @@
1
- export declare class NucloDocument {
2
- head: ExpandedElement;
3
- body: ExpandedElement;
4
- private _listeners;
5
- constructor();
6
- createElement(tagName: string, _options?: unknown): ExpandedElement;
7
- createElementNS(namespace: string, tagName: string, _options?: unknown): ExpandedElement;
8
- createTextNode(data: string): Text;
9
- createComment(data: string): Comment;
10
- createDocumentFragment(): DocumentFragment;
11
- querySelector(selector: string): Element | null;
12
- querySelectorAll(_selector: string): NodeListOf<Element>;
13
- addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
14
- removeEventListener(type: string, listener: EventListener, _options?: boolean | AddEventListenerOptions): void;
15
- dispatchEvent(event: Event): boolean;
16
- contains(_node: Node): boolean;
17
- }
18
- export declare const document: Document;
19
- //# sourceMappingURL=Document.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Document.d.ts","sourceRoot":"","sources":["../../src/polyfill/Document.ts"],"names":[],"mappings":"AA8EA,qBAAa,aAAa;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,CAAC,UAAU,CAA4G;IAE9H,cAIC;IAED,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,eAAe,CAElE;IAED,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,eAAe,CAIvF;IAED,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEjC;IAED,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAYnC;IAED,sBAAsB,IAAI,gBAAgB,CAEzC;IAED,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAa9C;IAED,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAEvD;IAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAMzG;IAED,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAS7G;IAED,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAgBnC;IAED,QAAQ,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAE7B;CACF;AAED,eAAO,MAAM,QAAQ,UAA6C,CAAC"}
@@ -1,48 +0,0 @@
1
- import { NucloNode } from './Node';
2
- export declare class NucloElement extends NucloNode {
3
- tagName: string;
4
- children: unknown[];
5
- className: string;
6
- textContent: string;
7
- private _innerHTML;
8
- parentNode: unknown;
9
- rawMods?: unknown[];
10
- mods?: unknown[];
11
- id: string;
12
- namespaceURI?: string;
13
- sheet?: CSSStyleSheet | null;
14
- private _listeners;
15
- private _style?;
16
- private _classList?;
17
- private _attributes?;
18
- get attributes(): Map<string, string>;
19
- set attributes(value: Map<string, string>);
20
- get style(): CSSStyleDeclaration;
21
- set style(value: CSSStyleDeclaration);
22
- get classList(): DOMTokenList;
23
- set classList(value: DOMTokenList);
24
- get innerHTML(): string;
25
- set innerHTML(value: string);
26
- private serializeChildren;
27
- private serializeElement;
28
- constructor(tagName: string);
29
- appendChild<T extends Node>(child: T): T;
30
- setAttribute(name: string, value: string): void;
31
- getAttribute(name: string): string | null;
32
- removeAttribute(name: string): void;
33
- hasAttribute(name: string): boolean;
34
- insertBefore<T extends Node>(newNode: T, referenceNode: Node | null): T;
35
- removeChild<T extends Node>(child: T): T;
36
- replaceChild<T extends Node>(newChild: Node, oldChild: T): T;
37
- addEventListener(type: string, listener: EventListener): void;
38
- removeEventListener(type: string, listener: EventListener): void;
39
- dispatchEvent(event: Event): boolean;
40
- querySelector(selector: string): Element | null;
41
- private querySelectorById;
42
- private querySelectorByClass;
43
- private querySelectorByTag;
44
- querySelectorAll(selector: string): NodeListOf<Element>;
45
- private querySelectorAllByClass;
46
- private querySelectorAllByTag;
47
- }
48
- //# sourceMappingURL=Element.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../../src/polyfill/Element.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAqGnC,qBAAa,YAAa,SAAQ,SAAS;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAM;IACvB,WAAW,EAAE,MAAM,CAAM;IACzB,OAAO,CAAC,UAAU,CAAc;IAChC,UAAU,EAAE,OAAO,CAAQ;IAC3B,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,EAAE,EAAE,MAAM,CAAM;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAyC;IAO3D,OAAO,CAAC,MAAM,CAAC,CAAsB;IACrC,OAAO,CAAC,UAAU,CAAC,CAAe;IAOlC,OAAO,CAAC,WAAW,CAAC,CAAsB;IAE1C,IAAI,UAAU,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAEpC;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAExC;IAED,IAAI,KAAK,IAAI,mBAAmB,CAE/B;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,mBAAmB,EAEnC;IAED,IAAI,SAAS,IAAI,YAAY,CAE5B;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,CA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AO,CAAC,qBAAqB;CAU9B"}
@@ -1,43 +0,0 @@
1
- export declare class NucloEvent implements Event {
2
- type: string;
3
- bubbles: boolean;
4
- cancelable: boolean;
5
- composed: boolean;
6
- currentTarget: EventTarget | null;
7
- defaultPrevented: boolean;
8
- eventPhase: number;
9
- isTrusted: boolean;
10
- target: EventTarget | null;
11
- timeStamp: number;
12
- readonly AT_TARGET = 2;
13
- readonly BUBBLING_PHASE = 3;
14
- readonly CAPTURING_PHASE = 1;
15
- readonly NONE = 0;
16
- returnValue: boolean;
17
- srcElement: EventTarget | null;
18
- cancelBubble: boolean;
19
- constructor(type: string, eventInitDict?: EventInit);
20
- composedPath(): EventTarget[];
21
- initEvent(_type: string, _bubbles?: boolean, _cancelable?: boolean): void;
22
- preventDefault(): void;
23
- stopImmediatePropagation(): void;
24
- stopPropagation(): void;
25
- }
26
- export declare class NucloCustomEvent<T = any> extends NucloEvent implements CustomEvent<T> {
27
- detail: T;
28
- constructor(type: string, eventInitDict?: CustomEventInit<T>);
29
- initCustomEvent(_type: string, _bubbles?: boolean, _cancelable?: boolean, _detail?: T): void;
30
- }
31
- export declare const Event: {
32
- new (type: string, eventInitDict?: EventInit): Event;
33
- prototype: Event;
34
- readonly NONE: 0;
35
- readonly CAPTURING_PHASE: 1;
36
- readonly AT_TARGET: 2;
37
- readonly BUBBLING_PHASE: 3;
38
- };
39
- export declare const CustomEvent: {
40
- new <T>(type: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
41
- prototype: CustomEvent;
42
- };
43
- //# sourceMappingURL=Event.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../src/polyfill/Event.ts"],"names":[],"mappings":"AACA,qBAAa,UAAW,YAAW,KAAK;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,WA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in Node.js polyfill
3
- */
4
- export declare class NucloNode {
5
- nodeType: number;
6
- nodeName: string;
7
- nodeValue: string | null;
8
- parentNode: unknown;
9
- _childNodes: Node[] | null;
10
- textContent: string;
11
- get childNodes(): NodeListOf<ChildNode>;
12
- }
13
- //# sourceMappingURL=Node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../src/polyfill/Node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAS;IACpB,QAAQ,EAAE,MAAM,CAAK;IACrB,QAAQ,EAAE,MAAM,CAAM;IACtB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChC,UAAU,EAAE,OAAO,CAAQ;IAC3B,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI,CAAQ;IAClC,WAAW,EAAE,MAAM,CAAM;IAEzB,IAAI,UAAU,IAAI,UAAU,CAAC,SAAS,CAAC,CAgCtC;CACF"}
@@ -1,11 +0,0 @@
1
- export declare class NucloText {
2
- nodeType: number;
3
- nodeName: string;
4
- data: string;
5
- textContent: string;
6
- parentNode: unknown;
7
- constructor(data: string);
8
- get nodeValue(): string;
9
- set nodeValue(value: string);
10
- }
11
- //# sourceMappingURL=Text.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/polyfill/Text.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IACpB,QAAQ,SAAK;IACb,QAAQ,SAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAQ;IAE3B,YAAY,IAAI,EAAE,MAAM,EAGvB;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAG1B;CACF"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Polyfills for Node.js environments
3
- *
4
- * This module provides minimal browser API polyfills to allow Nuclo to run in Node.js
5
- * for server-side rendering (SSR) scenarios.
6
- *
7
- * To use in Node.js:
8
- * ```typescript
9
- * import 'nuclo/polyfill';
10
- * // or
11
- * import { document, Event, CustomEvent } from 'nuclo/polyfill';
12
- * ```
13
- */
14
- export { NucloDocument, document } from './Document';
15
- export { NucloElement } from './Element';
16
- export { NucloText } from './Text';
17
- export { NucloEvent, NucloCustomEvent, Event, CustomEvent } from './Event';
18
- export { NucloNode } from './Node';
19
- import { NucloElement } from './Element';
20
- import { NucloNode } from './Node';
21
- export declare const Node: typeof NucloNode;
22
- export declare const Element: typeof NucloElement;
23
- export declare const HTMLElement: typeof NucloElement;
24
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/polyfill/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAInC,eAAO,MAAM,IAAI,kBAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,qBAAe,CAAC;AACpC,eAAO,MAAM,WAAW,qBAAe,CAAC"}
package/dist/render.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * Renders a NodeModFn to a parent element by calling it and appending the result.
3
- *
4
- * @param nodeModFn The NodeModFn to render (created by tag builders like div(), h1(), etc.)
5
- * @param parent The parent element to render into (defaults to document.body)
6
- * @param index The index to pass to the NodeModFn (defaults to 0)
7
- * @returns The rendered element
8
- */
9
- export declare function render<TTagName extends ElementTagName = ElementTagName>(nodeModFn: NodeModFn<TTagName>, parent?: Element, index?: number): ExpandedElement<TTagName>;
10
- /**
11
- * Hydrates an existing server-rendered DOM tree by walking it in parallel with
12
- * the component tree, reusing existing nodes and re-attaching reactivity.
13
- *
14
- * Instead of clearing the container and creating new DOM nodes (like render()),
15
- * hydrate() claims existing nodes from the SSR output and registers reactive
16
- * text nodes, attributes, event listeners, list runtimes, and when runtimes
17
- * on them.
18
- *
19
- * @param nodeModFn The NodeModFn to hydrate (same component used for SSR)
20
- * @param parent The parent element containing the SSR HTML (defaults to document.body)
21
- * @returns The hydrated root element
22
- *
23
- * @example
24
- * ```ts
25
- * // Server: const html = renderToString(div(h1("Hello")));
26
- * // Client:
27
- * const app = document.getElementById("app")!;
28
- * // app.innerHTML already contains the SSR HTML
29
- * hydrate(div(h1("Hello")), app);
30
- * ```
31
- */
32
- export declare function hydrate<TTagName extends ElementTagName = ElementTagName>(nodeModFn: NodeModFn<TTagName>, parent?: Element): ExpandedElement<TTagName>;
33
- //# sourceMappingURL=render.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,EACrE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC9B,MAAM,CAAC,EAAE,OAAO,EAChB,KAAK,GAAE,MAAU,GAChB,eAAe,CAAC,QAAQ,CAAC,CAQ3B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,OAAO,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,EACtE,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC9B,MAAM,CAAC,EAAE,OAAO,GACf,eAAe,CAAC,QAAQ,CAAC,CAqC3B"}
@@ -1,4 +0,0 @@
1
- export type ConditionInput = boolean | (() => boolean);
2
- export declare function runCondition(condition: () => boolean, onError?: (error: unknown) => void): boolean;
3
- export declare function resolveCondition(value: ConditionInput, onError?: (error: unknown) => void): boolean;
4
- //# sourceMappingURL=conditions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/shared/conditions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC;AAEvD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MAAM,OAAO,EACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACjC,OAAO,CAUT;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GACjC,OAAO,CAET"}
@@ -1,80 +0,0 @@
1
- export declare const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
2
- /**
3
- * Creates an HTML element.
4
- * Wrapper for document.createElement with type safety.
5
- */
6
- export declare function createElement<K extends keyof HTMLElementTagNameMap>(tagName: K): HTMLElementTagNameMap[K] | null;
7
- export declare function createElement(tagName: string): ExpandedElement | null;
8
- /**
9
- * Creates an element in the given namespace (typically for SVG elements).
10
- * Wrapper for document.createElementNS with type safety.
11
- */
12
- export declare function createElementNS(namespace: string, tagName: string): ExpandedElement | null;
13
- /**
14
- * Creates a text node with the given content.
15
- * Wrapper for document.createTextNode.
16
- */
17
- export declare function createTextNode(text: string): Text | null;
18
- /**
19
- * Creates a document fragment.
20
- * Wrapper for document.createDocumentFragment.
21
- */
22
- export declare function createDocumentFragment(): DocumentFragment | null;
23
- /**
24
- * Fires onDestroy for a subtree that a fast removal path (list()'s bulk
25
- * clear/replace, the single-element when()/else() swap) is about to drop
26
- * without walking through cleanupNodeTree()/safeRemoveChild(). Short-circuits
27
- * to a single comparison when nothing on the page has ever registered a
28
- * lifecycle callback — the common case — so those fast paths stay fast.
29
- *
30
- * Same post-order (children, then self) as cleanupNodeTree() above, for the
31
- * same reason — see the comment there.
32
- */
33
- export declare function disposeLifecyclesInSubtree(node: Node): void;
34
- export declare function safeRemoveChild(child: Node): boolean;
35
- export declare function createComment(text: string): Comment | null;
36
- export declare function createConditionalComment(tagName: string, suffix?: string): Comment | null;
37
- export declare function createMarkerPair(prefix: string, id: number | string): {
38
- start: Comment;
39
- end: Comment;
40
- };
41
- export declare function clearBetweenMarkers(startMarker: Comment, endMarker: Comment): void;
42
- export declare function insertNodesBefore(nodes: Node[], referenceNode: Node): void;
43
- export declare function appendChildren(parent: Element | Node, ...children: Array<Element | Node | string | null | undefined>): Element | Node;
44
- export declare function isNodeConnected(node: Node | null | undefined): boolean;
45
- /**
46
- * Safely replaces an old node with a new node in the DOM.
47
- * Returns true on success, false on failure (and logs the error).
48
- */
49
- export declare function replaceNodeSafely(oldNode: Node, newNode: Node): boolean;
50
- /**
51
- * Safely casts an Element-like object to Node & ParentNode interface.
52
- * This is a common pattern needed when working with DOM manipulation.
53
- *
54
- * @param element - The element to cast
55
- * @returns The element typed as Node & ParentNode
56
- */
57
- export declare function asParentNode<T extends Element | object>(element: T): Node & ParentNode;
58
- /**
59
- * Creates a scoped DOM insertion context that temporarily redirects appendChild
60
- * to insertBefore at a specific reference node. This is useful for inserting
61
- * content at specific positions in the DOM tree.
62
- *
63
- * @param host - The host element
64
- * @param referenceNode - The node before which new nodes should be inserted
65
- * @param callback - Function to execute with the scoped context
66
- * @returns The result of the callback
67
- */
68
- export declare function withScopedInsertion<T, THost extends Element | object>(host: THost, referenceNode: Node, callback: () => T): T;
69
- /**
70
- * Type-safe wrapper for setting CSS style properties.
71
- * Provides better error handling than direct CSSStyleDeclaration access.
72
- * Supports both camelCase and kebab-case property names.
73
- *
74
- * @param element - The element to apply styles to
75
- * @param property - The CSS property name (camelCase or kebab-case)
76
- * @param value - The value to set (string, number, or null to remove)
77
- * @returns true if the style was applied successfully, false otherwise
78
- */
79
- export declare function setStyleProperty(element: HTMLElement, property: string, value: string | number | null): boolean;
80
- //# sourceMappingURL=dom.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/shared/dom.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,+BAA+B,CAAC;AAE1D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,qBAAqB,EACjE,OAAO,EAAE,CAAC,GACT,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AACnC,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;AAKvE;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,eAAe,GAAG,IAAI,CAExB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAExD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,GAAG,IAAI,CAEhE;AA0DD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAS3D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAYpD;AAYD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAE1D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAW,GAAG,OAAO,GAAG,IAAI,CAE3F;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAMtG;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAOlF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAO1E;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,GAAG,IAAI,EACtB,GAAG,QAAQ,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAC7D,OAAO,GAAG,IAAI,CAwBhB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CASvE;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,UAAU,CAEtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,SAAS,OAAO,GAAG,MAAM,EACnE,IAAI,EAAE,KAAK,EACX,aAAa,EAAE,IAAI,EACnB,QAAQ,EAAE,MAAM,CAAC,GAChB,CAAC,CAkBH;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAC5B,OAAO,CAgBT"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Simplified environment detection - minimal overhead for smaller bundle size
3
- */
4
- export declare const isBrowser: boolean;
5
- //# sourceMappingURL=environment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/shared/environment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,SAAS,SAAmE,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function logError(message: string, error?: Error | unknown): void;
2
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,IAAI,CAKvE"}
@@ -1,4 +0,0 @@
1
- type RenderableInput<TTagName extends ElementTagName = ElementTagName> = NodeModFn<TTagName> | DetachedExpandedElementFactory<TTagName> | DetachedSVGElementFactory | SVGElementModifierFn | ExpandedElement<TTagName> | SVGElement | Node | null | undefined;
2
- export declare function resolveRenderable<TTagName extends ElementTagName = ElementTagName>(result: RenderableInput<TTagName>, host: ExpandedElement<TTagName>, index: number): ExpandedElement<TTagName> | null;
3
- export {};
4
- //# sourceMappingURL=renderables.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderables.d.ts","sourceRoot":"","sources":["../../src/shared/renderables.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,IACjE,SAAS,CAAC,QAAQ,CAAC,GACnB,8BAA8B,CAAC,QAAQ,CAAC,GACxC,yBAAyB,GACzB,oBAAoB,GACpB,eAAe,CAAC,QAAQ,CAAC,GACzB,UAAU,GACV,IAAI,GACJ,IAAI,GACJ,SAAS,CAAC;AAEd,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,cAAc,GAAG,cAAc,EAChF,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,EACjC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC,EAC/B,KAAK,EAAE,MAAM,GACZ,eAAe,CAAC,QAAQ,CAAC,GAAG,IAAI,CAclC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * String utility functions
3
- */
4
- /**
5
- * Converts camelCase to kebab-case (optimized for performance)
6
- * Uses direct character code manipulation for maximum speed
7
- * @example camelToKebab('backgroundColor') => 'background-color'
8
- */
9
- export declare function camelToKebab(str: string): string;
10
- /**
11
- * Escapes HTML special characters in attribute values (includes " and ')
12
- */
13
- export declare function escapeHtml(text: string): string;
14
- /**
15
- * Escapes HTML special characters in text node content.
16
- * Only &, < and > need escaping — quotes are safe inside text nodes.
17
- */
18
- export declare function escapeText(text: string): string;
19
- //# sourceMappingURL=strings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/shared/strings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqBhD;AAKD;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB/C;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkB/C"}
@@ -1,16 +0,0 @@
1
- export declare function isPrimitive(value: unknown): value is Primitive;
2
- export declare function isNode<T>(value: T): value is T & Node;
3
- export declare function isObject(value: unknown): value is object;
4
- export declare function isTagLike<T>(value: T): value is T & {
5
- tagName?: string;
6
- };
7
- export declare function isBoolean(value: unknown): value is boolean;
8
- /**
9
- * Narrows `value` to a callable. The generic `<T extends Function>` is intentionally
10
- * removed: it allowed callers to assert any specific function signature via the type
11
- * parameter without a runtime check, which is unsafe. Use explicit casts at call sites
12
- * when a more specific signature is needed.
13
- */
14
- export declare function isFunction(value: unknown): value is (...args: unknown[]) => unknown;
15
- export declare function isZeroArityFunction(value: unknown): value is () => unknown;
16
- //# sourceMappingURL=type-guards.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../src/shared/type-guards.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,CAKrD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAExE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAEnF;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,OAAO,CAE1E"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Server-Side Rendering (SSR) entry point for Nuclo
3
- *
4
- * This module provides utilities for rendering Nuclo components to HTML strings
5
- * in Node.js environments for server-side rendering.
6
- *
7
- * @example
8
- * ```ts
9
- * import { renderToString } from 'nuclo/ssr';
10
- * import '../polyfill'; // Load polyfills for Node.js
11
- * import { div } from 'nuclo';
12
- *
13
- * const html = renderToString(div("Hello, World!"));
14
- * console.log(html); // '<div>Hello, World!</div>'
15
- * ```
16
- */
17
- export { renderToString, renderManyToString, renderToStringWithContainer } from './render-to-string';
18
- export { setSSRCollector, getCssText } from '../style/engine';
19
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ssr/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,41 +0,0 @@
1
- /**
2
- * Server-Side Rendering (SSR) utilities for Nuclo
3
- * Renders Nuclo components to HTML strings in Node.js environment
4
- */
5
- type RenderableInput = NodeModFn<ElementTagName> | Element | Node | null | undefined;
6
- /**
7
- * Renders a Nuclo component to an HTML string for server-side rendering
8
- *
9
- * @param input - A Nuclo component function, DOM element, or node
10
- * @returns HTML string representation of the component
11
- *
12
- * @example
13
- * ```ts
14
- * import { renderToString } from 'nuclo/ssr';
15
- * import { div } from 'nuclo';
16
- *
17
- * const html = renderToString(
18
- * div("Hello, World!")
19
- * );
20
- * // Returns: '<div>Hello, World!</div>'
21
- * ```
22
- */
23
- export declare function renderToString(input: RenderableInput): string;
24
- /**
25
- * Renders multiple Nuclo components to HTML strings
26
- *
27
- * @param inputs - Array of Nuclo components
28
- * @returns Array of HTML strings
29
- */
30
- export declare function renderManyToString(inputs: RenderableInput[]): string[];
31
- /**
32
- * Renders a Nuclo component and wraps it in a container element
33
- *
34
- * @param input - A Nuclo component
35
- * @param containerTag - The tag name for the container (default: 'div')
36
- * @param containerAttrs - Attributes for the container element
37
- * @returns HTML string with container wrapper
38
- */
39
- export declare function renderToStringWithContainer(input: RenderableInput, containerTag?: string, containerAttrs?: Record<string, string>): string;
40
- export {};
41
- //# sourceMappingURL=render-to-string.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-to-string.d.ts","sourceRoot":"","sources":["../../src/ssr/render-to-string.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,KAAK,eAAe,GAChB,SAAS,CAAC,cAAc,CAAC,GACzB,OAAO,GACP,IAAI,GACJ,IAAI,GACJ,SAAS,CAAC;AAySd;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CA0B7D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,EAAE,CAEtE;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,eAAe,EACtB,YAAY,GAAE,MAAc,EAC5B,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAC1C,MAAM,CAOR"}
@@ -1,26 +0,0 @@
1
- import type { ClassInput, CssInstance, FlatStyle, KeyframeFrames, Style, StyleResult, ThemeConfig, VariantDefinitions, VariantsConfig, VariantsFn } from "../../types/style";
2
- export type { ClassInput, CssInstance, CSSProperties, FlatStyle, KeyframeFrames, KeyframeStop, Pseudo, Size, Style, StyleResult, ThemeConfig, VariantDefinitions, VariantProps, VariantsConfig, VariantsFn, } from "../../types/style";
3
- /**
4
- * Compose class lists with exact conflict resolution: when two inputs style
5
- * the same (query, selector-suffix) context, their declaration blocks merge
6
- * with the later input winning per property — the merged block gets its own
7
- * content-addressed class, so `cx(base, active)` keeps every base property
8
- * the active style doesn't override. Works because the engine remembers what
9
- * every class it minted means. Unknown external classes pass through as-is.
10
- * Nested arrays are flattened, so `cx([a, cond && b], c)` composes the same
11
- * as `cx(a, cond && b, c)`.
12
- */
13
- export declare function cx(...inputs: ClassInput[]): StyleResult;
14
- export declare function createCss<const T extends ThemeConfig>(theme?: T): CssInstance<T>;
15
- /** Themeless css() — full property/variant typing, no tokens or screens. */
16
- export declare const css: {
17
- (style: Style<object>): StyleResult;
18
- (name: string, style: Style<object>): StyleResult;
19
- };
20
- /** Themeless variants() recipe helper. */
21
- export declare const variants: <const V extends VariantDefinitions<object>>(config: VariantsConfig<object, V>) => VariantsFn<V>;
22
- /** Themeless keyframes() helper. */
23
- export declare const keyframes: (frames: KeyframeFrames<object>) => string;
24
- /** Themeless globalStyle() helper. */
25
- export declare const globalStyle: (selector: string, style: FlatStyle<object>) => void;
26
- //# sourceMappingURL=css.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"css.d.ts","sourceRoot":"","s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,MAAM,CAAC,KAAK,IACxB,CAAC"}
@@ -1,94 +0,0 @@
1
- /**
2
- * Shared generated-CSS engine state.
3
- *
4
- * One stylesheet, one rule registry, shared by every `createCss` instance so
5
- * identical declarations dedupe globally and cascade order stays deterministic:
6
- * base rules first (insertion order), then one grouping rule per at-rule query
7
- * in registration order (theme `screens` order).
8
- *
9
- * Browser: rules are injected through CSSOM with O(1) appends — no rescans.
10
- * SSR: rules accumulate in the registry; `getCssText()` serializes them.
11
- *
12
- * The state below lives on `globalThis`, keyed by a `Symbol.for(...)` (the
13
- * global symbol registry, shared by every realm-local copy of this module).
14
- * `nuclo` publishes `.`, `./ssr`, and `./polyfill` as independently built
15
- * bundle files (see tsdown.config.ts) — a consumer that resolves them
16
- * through normal package resolution (any bundler/runtime that doesn't
17
- * alias every subpath to this same source file) loads two or three
18
- * separate copies of this module, each with its own module-scope
19
- * variables. Without a realm-wide singleton, `css()` (from `nuclo`) would
20
- * mint rules into one copy's registry while `getCssText()`/
21
- * `setSSRCollector()` (from `nuclo/ssr`) read an entirely different,
22
- * always-empty one — SSR output would render the right classes with no
23
- * matching CSS at all. Storing the registry on `globalThis` instead makes
24
- * every copy of this module share the same state regardless of how many
25
- * times it ends up bundled.
26
- *
27
- * The registry never shrinks on its own: atomCache/atomMeta/rawKeys/
28
- * baseRules/queryRules retain every rule for the life of the process —
29
- * content-addressed dedup needs a durable record of what each class means,
30
- * and the engine has no way to know whether a minted class still backs a
31
- * live DOM node (it's deliberately decoupled from element/list lifecycle),
32
- * so it can't safely evict. Only resetStyles() (a manual test helper)
33
- * clears it. This is fine for the intended use — a bounded design-token
34
- * vocabulary — but a caller piping truly per-instance dynamic values
35
- * through css({ raw: {...} }) (e.g. per-row data in a list) mints one
36
- * permanent class per unique value; prefer the `style` prop
37
- * (element/inline-style.ts) for values that vary per instance rather than
38
- * per design token. See test/style/registry-growth.test.ts.
39
- */
40
- type SSRCollector = (rule: string) => void;
41
- export interface BlockMeta {
42
- readonly query: string | undefined;
43
- readonly suffix: string;
44
- readonly decls: ReadonlyArray<readonly [string, string]>;
45
- /** Author-supplied identity from `css(name, …)`; inherited by cx() merges. */
46
- readonly name: string | undefined;
47
- }
48
- export declare function setSSRCollector(fn: SSRCollector | null): void;
49
- /** Pre-register at-rule queries so their cascade order follows theme order. */
50
- export declare function registerQueries(queries: Iterable<string>): void;
51
- /**
52
- * Returns the live stylesheet, (re)binding when the document changes — e.g.
53
- * fresh jsdom documents between tests. Rebinding replays the whole registry,
54
- * which replaces v1's per-call classExistsInDOM() DOM scans with a single
55
- * replay per document.
56
- */
57
- export declare function ensureSheet(): CSSStyleSheet | null;
58
- /**
59
- * Content-addressed ~42-bit hash (two interleaved FNV-1a style passes). Class
60
- * names must match between server and client for SSR hydration, so a counter
61
- * is not an option; 42 bits keeps collision odds low (~1e-5 at 10k
62
- * unique declaration blocks).
63
- */
64
- export declare function hash(input: string): string;
65
- export declare function expandAmpersands(input: string, replacement: string): string;
66
- /**
67
- * One class per (query, selector-suffix) — every declaration that shares that
68
- * context compiles into a single rule under a single generated class name,
69
- * rather than one class per individual property. Pass `name` to give the
70
- * style a stable, readable identity (see mintBlock).
71
- */
72
- export declare function atomBlock(query: string | undefined, suffix: string, decls: ReadonlyArray<readonly [string, string]>, name?: string, exactName?: boolean): string;
73
- /**
74
- * Merge two same-context generated classes into one: `second`'s declarations
75
- * override `first`'s per exact property (shorthand/longhand interplay is left
76
- * to CSS order), and the combined block mints its own content-addressed class
77
- * — so cx(base, override) keeps base's untouched properties instead of
78
- * dropping the whole base class. Deterministic: the same pair always yields
79
- * the same class name, on server and client alike. A named base passes its
80
- * name down as a prefix, so `cx(appRoot, active)` reads as `app-root-1a2b3c`.
81
- */
82
- export declare function mergeBlocks(first: string, second: string): string;
83
- /** Conflict key (query|suffix) for a generated class — lets cx() group classes by selector context. */
84
- export declare function conflictKeyOf(className: string): string | undefined;
85
- /** Current registry generation, used to invalidate per-instance WeakMap hits after resetStyles(). */
86
- export declare function getStyleEpoch(): number;
87
- /** Register a non-atomic rule (keyframes, global styles) once per dedupe key. */
88
- export declare function addRawRule(dedupeKey: string, rule: string): void;
89
- /** All generated CSS — base rules first, then at-rule groups in registration order. */
90
- export declare function getCssText(): string;
91
- /** Clear all engine state (test helper). Removes the injected style element. */
92
- export declare function resetStyles(): void;
93
- export {};
94
- //# sourceMappingURL=engine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/style/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAIH,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAE3C,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAkED,wBAAgB,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI,CAG7D;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAK/D;AAkJD;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,aAAa,GAAG,IAAI,CAoDlD;AA+BD;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS1C;AAWD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAsB3E;AAkGD;;;;;GAKG;AACH,wBAAgB,SAAS,CACxB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAC/C,IAAI,CAAC,EAAE,MAAM,EACb,SAAS,UAAQ,GACf,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAYjE;AAED,uGAAuG;AACvG,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAInE;AAED,qGAAqG;AACrG,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAQhE;AAED,uFAAuF;AACvF,wBAAgB,UAAU,IAAI,MAAM,CASnC;AAED,gFAAgF;AAChF,wBAAgB,WAAW,IAAI,IAAI,CAkBlC"}
@@ -1,3 +0,0 @@
1
- export { createCss, css, cx, variants, keyframes, globalStyle, type ClassInput, type CssInstance, type CSSProperties, type FlatStyle, type KeyframeFrames, type KeyframeStop, type Size, type Style, type StyleResult, type ThemeConfig, type VariantDefinitions, type VariantProps, type VariantsConfig, type VariantsFn, } from "./css";
2
- export { getCssText, resetStyles, setSSRCollector } from "./engine";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/style/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EACT,GAAG,EACH,EAAE,EACF,QAAQ,EACR,SAAS,EACT,WAAW,EACX,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,GACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { UpdateScope } from "./scope";
2
- export declare function updateConditionalElements(scope?: UpdateScope): void;
3
- //# sourceMappingURL=conditional.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../src/update/conditional.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAuD3C,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAiBnE"}