nuclo 0.2.30 → 0.2.31
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/package.json +1 -1
- package/dist/Element-C3mU75-a.mjs +0 -2
- package/dist/Element-C3mU75-a.mjs.map +0 -1
- package/dist/bootstrap.d.ts +0 -5
- package/dist/bootstrap.d.ts.map +0 -1
- package/dist/element/attributes.d.ts +0 -6
- package/dist/element/attributes.d.ts.map +0 -1
- package/dist/element/class-name.d.ts +0 -6
- package/dist/element/class-name.d.ts.map +0 -1
- package/dist/element/event-attributes.d.ts +0 -5
- package/dist/element/event-attributes.d.ts.map +0 -1
- package/dist/element/events.d.ts +0 -35
- package/dist/element/events.d.ts.map +0 -1
- package/dist/element/factory-meta.d.ts +0 -25
- package/dist/element/factory-meta.d.ts.map +0 -1
- package/dist/element/factory.d.ts +0 -32
- package/dist/element/factory.d.ts.map +0 -1
- package/dist/element/inline-style.d.ts +0 -9
- package/dist/element/inline-style.d.ts.map +0 -1
- package/dist/element/modifiers.d.ts +0 -11
- package/dist/element/modifiers.d.ts.map +0 -1
- package/dist/element/tags.d.ts +0 -5
- package/dist/element/tags.d.ts.map +0 -1
- package/dist/hydration.d.ts +0 -73
- package/dist/hydration.d.ts.map +0 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.d.ts.map +0 -1
- package/dist/list/index.d.ts +0 -7
- package/dist/list/index.d.ts.map +0 -1
- package/dist/list/runtime.d.ts +0 -6
- package/dist/list/runtime.d.ts.map +0 -1
- package/dist/list/template.d.ts +0 -113
- package/dist/list/template.d.ts.map +0 -1
- package/dist/list/types.d.ts +0 -57
- package/dist/list/types.d.ts.map +0 -1
- package/dist/nuclo.cjs +0 -2
- package/dist/nuclo.cjs.map +0 -1
- package/dist/nuclo.mjs +0 -2
- package/dist/nuclo.mjs.map +0 -1
- package/dist/nuclo.umd.js +0 -2
- package/dist/nuclo.umd.js.map +0 -1
- package/dist/polyfill/Document.d.ts +0 -19
- package/dist/polyfill/Document.d.ts.map +0 -1
- package/dist/polyfill/Element.d.ts +0 -48
- package/dist/polyfill/Element.d.ts.map +0 -1
- package/dist/polyfill/Event.d.ts +0 -43
- package/dist/polyfill/Event.d.ts.map +0 -1
- package/dist/polyfill/Node.d.ts +0 -13
- package/dist/polyfill/Node.d.ts.map +0 -1
- package/dist/polyfill/Text.d.ts +0 -11
- package/dist/polyfill/Text.d.ts.map +0 -1
- package/dist/polyfill/index.d.ts +0 -24
- package/dist/polyfill/index.d.ts.map +0 -1
- package/dist/polyfill/nuclo.polyfill.mjs +0 -2
- package/dist/polyfill/nuclo.polyfill.mjs.map +0 -1
- package/dist/render.d.ts +0 -33
- package/dist/render.d.ts.map +0 -1
- package/dist/shared/conditions.d.ts +0 -4
- package/dist/shared/conditions.d.ts.map +0 -1
- package/dist/shared/dom.d.ts +0 -69
- package/dist/shared/dom.d.ts.map +0 -1
- package/dist/shared/environment.d.ts +0 -5
- package/dist/shared/environment.d.ts.map +0 -1
- package/dist/shared/errors.d.ts +0 -2
- package/dist/shared/errors.d.ts.map +0 -1
- package/dist/shared/renderables.d.ts +0 -4
- package/dist/shared/renderables.d.ts.map +0 -1
- package/dist/shared/strings.d.ts +0 -19
- package/dist/shared/strings.d.ts.map +0 -1
- package/dist/shared/type-guards.d.ts +0 -16
- package/dist/shared/type-guards.d.ts.map +0 -1
- package/dist/ssr/index.d.ts +0 -19
- package/dist/ssr/index.d.ts.map +0 -1
- package/dist/ssr/nuclo.ssr.mjs +0 -2
- package/dist/ssr/nuclo.ssr.mjs.map +0 -1
- package/dist/ssr/render-to-string.d.ts +0 -41
- package/dist/ssr/render-to-string.d.ts.map +0 -1
- package/dist/style/css.d.ts +0 -26
- package/dist/style/css.d.ts.map +0 -1
- package/dist/style/engine.d.ts +0 -74
- package/dist/style/engine.d.ts.map +0 -1
- package/dist/style/index.d.ts +0 -3
- package/dist/style/index.d.ts.map +0 -1
- package/dist/update/conditional.d.ts +0 -3
- package/dist/update/conditional.d.ts.map +0 -1
- package/dist/update/reactive-attributes.d.ts +0 -45
- package/dist/update/reactive-attributes.d.ts.map +0 -1
- package/dist/update/reactive-text.d.ts +0 -38
- package/dist/update/reactive-text.d.ts.map +0 -1
- package/dist/update/registry.d.ts +0 -116
- package/dist/update/registry.d.ts.map +0 -1
- package/dist/update/scope.d.ts +0 -7
- package/dist/update/scope.d.ts.map +0 -1
- package/dist/update/update.d.ts +0 -4
- package/dist/update/update.d.ts.map +0 -1
- package/dist/when/builder.d.ts +0 -16
- package/dist/when/builder.d.ts.map +0 -1
- package/dist/when/index.d.ts +0 -44
- package/dist/when/index.d.ts.map +0 -1
- package/dist/when/runtime.d.ts +0 -59
- 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":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AAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAO9C;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAExC;IAED,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAKlC;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElC;IAED,YAAY,CAAC,CAAC,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,aAAa,EAAE,IAAI,GAAG,IAAI,GAAG,CAAC,CA2BtE;IAED,WAAW,CAAC,CAAC,SAAS,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAevC;IAED,YAAY,CAAC,CAAC,SAAS,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAkB3D;IAED,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAM5D;IAED,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAK/D;IAED,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAgBnC;IAED,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAa9C;IAED,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,kBAAkB;IAmB1B,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAetD;IAED,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,qBAAqB;CAU9B"}
|
package/dist/polyfill/Event.d.ts
DELETED
|
@@ -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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,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAE3F;CACF;AAGD,eAAO,MAAM,KAAK;;;;;;;CAAiC,CAAC;AACpD,eAAO,MAAM,WAAW;;;CAA6C,CAAC"}
|
package/dist/polyfill/Node.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base Node class for instanceof checks 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"}
|
package/dist/polyfill/Text.d.ts
DELETED
|
@@ -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"}
|
package/dist/polyfill/index.d.ts
DELETED
|
@@ -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"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"../Element-C3mU75-a.mjs";var n=class{nodeType=3;nodeName=`#text`;data;textContent;parentNode=null;constructor(e){this.data=e,this.textContent=e}get nodeValue(){return this.data}set nodeValue(e){this.data=e,this.textContent=e}},r=class{nodeType=11;nodeName=`#document-fragment`;childNodes=[];children=[];textContent=``;get firstChild(){return this.childNodes.length>0?this.childNodes[0]:null}get lastChild(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}appendChild(e){return this.childNodes.push(e),e.nodeType===1&&this.children.push(e),e.parentNode=this,e}insertBefore(e,t){if(!t)return this.appendChild(e);let n=this.childNodes.indexOf(t);if(n!==-1&&(this.childNodes.splice(n,0,e),e.nodeType===1)){let n=this.children.indexOf(t);n!==-1&&this.children.splice(n,0,e)}return e.parentNode=this,e}removeChild(e){let t=this.childNodes.indexOf(e);if(t!==-1&&this.childNodes.splice(t,1),e.nodeType===1){let t=this.children.indexOf(e);t!==-1&&this.children.splice(t,1)}return e.parentNode=null,e}replaceChild(e,t){let n=this.childNodes.indexOf(t);if(n!==-1&&(this.childNodes[n]=e,t.nodeType===1&&e.nodeType===1)){let n=this.children.indexOf(t);n!==-1&&(this.children[n]=e)}return e.parentNode=this,t.parentNode=null,e}querySelector(){return null}querySelectorAll(){return[]}},i=class{head;body;_listeners;constructor(){this.head=new t(`head`),this.body=new t(`body`),this._listeners=new Map}createElement(e,n){return new t(e)}createElementNS(e,n,r){let i=new t(n);return i.namespaceURI=e,i}createTextNode(e){return new n(e)}createComment(e){return{nodeType:8,nodeName:`#comment`,data:e,textContent:e,nodeValue:e,parentNode:null,nextSibling:null,previousSibling:null}}createDocumentFragment(){return new r}querySelector(e){if(e.startsWith(`#`)){let t=e.slice(1);if(t===`nuclo-styles`&&this.head.children){for(let e of this.head.children)if(e.id===t)return e}}return null}querySelectorAll(e){return[]}addEventListener(e,t,n){this._listeners.has(e)||this._listeners.set(e,new Map),this._listeners.get(e).set(t,{listener:t,options:n})}removeEventListener(e,t,n){let r=this._listeners.get(e);r&&(r.delete(t),r.size===0&&this._listeners.delete(e))}dispatchEvent(e){let t=this._listeners.get(e.type);if(t){let n=Array.from(t.values());for(let t=0;t<n.length;t++){let{listener:r}=n[t];try{r(e)}catch(e){console.error(`Error in event listener:`,e)}}}return!0}contains(e){return!1}};const a=globalThis.document||new i;var o=class{type;bubbles;cancelable;composed;currentTarget=null;defaultPrevented=!1;eventPhase=0;isTrusted=!1;target=null;timeStamp;AT_TARGET=2;BUBBLING_PHASE=3;CAPTURING_PHASE=1;NONE=0;returnValue=!0;srcElement=null;cancelBubble=!1;constructor(e,t){this.type=e,this.bubbles=t?.bubbles||!1,this.cancelable=t?.cancelable||!1,this.composed=t?.composed||!1,this.timeStamp=Date.now()}composedPath(){return[]}initEvent(e,t,n){}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}stopImmediatePropagation(){this.cancelBubble=!0}stopPropagation(){this.cancelBubble=!0}},s=class extends o{detail;constructor(e,t){super(e,t),this.detail=t?.detail}initCustomEvent(e,t,n,r){}};const c=globalThis.Event||o,l=globalThis.CustomEvent||s,u=e,d=t,f=t;if(typeof window>`u`&&typeof globalThis<`u`){let n=globalThis;n.document||=a,n.Event||=c,n.CustomEvent||=l,n.Node||=e,n.Element||=t,n.HTMLElement||=t}export{l as CustomEvent,d as Element,c as Event,f as HTMLElement,u as Node,s as NucloCustomEvent,i as NucloDocument,t as NucloElement,o as NucloEvent,e as NucloNode,n as NucloText,a as document};
|
|
2
|
-
//# sourceMappingURL=nuclo.polyfill.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nuclo.polyfill.mjs","names":[],"sources":["../../src/polyfill/Text.ts","../../src/polyfill/Document.ts","../../src/polyfill/Event.ts","../../src/polyfill/index.ts"],"sourcesContent":["export class NucloText {\n nodeType = 3; // Node.TEXT_NODE\n nodeName = '#text';\n data: string;\n textContent: string;\n parentNode: unknown = null;\n \n constructor(data: string) {\n this.data = data;\n this.textContent = data;\n }\n \n get nodeValue(): string {\n return this.data;\n }\n \n set nodeValue(value: string) {\n this.data = value;\n this.textContent = value;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NucloElement } from './Element';\nimport { NucloText } from './Text';\n\n/**\n * Lightweight DocumentFragment for SSR — prototype methods instead of per-instance closures.\n */\nclass SSRDocumentFragment {\n nodeType: number = 11;\n nodeName: string = '#document-fragment';\n childNodes: Node[] = [];\n children: Element[] = [];\n textContent: string = '';\n\n get firstChild(): Node | null {\n return this.childNodes.length > 0 ? this.childNodes[0] : null;\n }\n\n get lastChild(): Node | null {\n return this.childNodes.length > 0 ? this.childNodes[this.childNodes.length - 1] : null;\n }\n\n appendChild<T extends Node>(child: T): T {\n this.childNodes.push(child);\n if ((child as any).nodeType === 1) {\n this.children.push(child as unknown as Element);\n }\n (child as any).parentNode = this;\n return child;\n }\n\n insertBefore<T extends Node>(newNode: T, refNode: Node | null): T {\n if (!refNode) return this.appendChild(newNode);\n const index = this.childNodes.indexOf(refNode);\n if (index !== -1) {\n this.childNodes.splice(index, 0, newNode);\n if ((newNode as any).nodeType === 1) {\n const elementIndex = this.children.indexOf(refNode as Element);\n if (elementIndex !== -1) {\n this.children.splice(elementIndex, 0, newNode as unknown as Element);\n }\n }\n }\n (newNode as any).parentNode = this;\n return newNode;\n }\n\n removeChild<T extends Node>(child: T): T {\n const index = this.childNodes.indexOf(child);\n if (index !== -1) this.childNodes.splice(index, 1);\n if ((child as any).nodeType === 1) {\n const elementIndex = this.children.indexOf(child as unknown as Element);\n if (elementIndex !== -1) this.children.splice(elementIndex, 1);\n }\n (child as any).parentNode = null;\n return child;\n }\n\n replaceChild<T extends Node>(newChild: T, oldChild: Node): T {\n const index = this.childNodes.indexOf(oldChild);\n if (index !== -1) {\n this.childNodes[index] = newChild;\n if ((oldChild as any).nodeType === 1 && (newChild as any).nodeType === 1) {\n const elementIndex = this.children.indexOf(oldChild as Element);\n if (elementIndex !== -1) {\n this.children[elementIndex] = newChild as unknown as Element;\n }\n }\n }\n (newChild as any).parentNode = this;\n (oldChild as any).parentNode = null;\n return newChild;\n }\n\n querySelector(): null { return null; }\n querySelectorAll(): NodeListOf<Element> { return [] as unknown as NodeListOf<Element>; }\n}\n\nexport class NucloDocument {\n head: ExpandedElement;\n body: ExpandedElement;\n private _listeners: Map<string, Map<EventListener, { listener: EventListener; options?: boolean | AddEventListenerOptions }>>;\n \n constructor() {\n this.head = new NucloElement('head') as unknown as ExpandedElement;\n this.body = new NucloElement('body') as unknown as ExpandedElement;\n this._listeners = new Map();\n }\n \n createElement(tagName: string, _options?: unknown): ExpandedElement {\n return new NucloElement(tagName) as unknown as ExpandedElement;\n }\n \n createElementNS(namespace: string, tagName: string, _options?: unknown): ExpandedElement {\n const element = new NucloElement(tagName) as unknown as ExpandedElement;\n (element as any).namespaceURI = namespace;\n return element;\n }\n \n createTextNode(data: string): Text {\n return new NucloText(data) as unknown as Text;\n }\n \n createComment(data: string): Comment {\n const comment = {\n nodeType: 8,\n nodeName: '#comment',\n data,\n textContent: data,\n nodeValue: data,\n parentNode: null,\n nextSibling: null,\n previousSibling: null\n };\n return comment as unknown as Comment;\n }\n \n createDocumentFragment(): DocumentFragment {\n return new SSRDocumentFragment() as unknown as DocumentFragment;\n }\n \n querySelector(selector: string): Element | null {\n // Simple implementation - only supports ID selector for #nuclo-styles\n if (selector.startsWith('#')) {\n const id = selector.slice(1);\n if (id === 'nuclo-styles' && this.head.children) {\n for (const child of this.head.children) {\n if ((child as any).id === id) {\n return child as unknown as Element;\n }\n }\n }\n }\n return null;\n }\n \n querySelectorAll(_selector: string): NodeListOf<Element> {\n return [] as unknown as NodeListOf<Element>;\n }\n \n addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void {\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Map());\n }\n const listenersMap = this._listeners.get(type)!;\n listenersMap.set(listener, { listener, options });\n }\n \n removeEventListener(type: string, listener: EventListener, _options?: boolean | AddEventListenerOptions): void {\n const listeners = this._listeners.get(type);\n if (listeners) {\n listeners.delete(listener);\n // Clean up empty maps to prevent memory leaks\n if (listeners.size === 0) {\n this._listeners.delete(type);\n }\n }\n }\n \n dispatchEvent(event: Event): boolean {\n const listeners = this._listeners.get(event.type);\n if (listeners) {\n // Create a copy to avoid issues if listeners are modified during dispatch\n const listenersCopy = Array.from(listeners.values());\n for (let i = 0; i < listenersCopy.length; i++) {\n const { listener } = listenersCopy[i];\n try {\n listener(event);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error in event listener:', error);\n }\n }\n }\n return true;\n }\n \n contains(_node: Node): boolean {\n return false;\n }\n}\n\nexport const document = globalThis.document || new NucloDocument();","/* eslint-disable @typescript-eslint/no-explicit-any */\nexport class NucloEvent implements Event {\n type: string;\n bubbles: boolean;\n cancelable: boolean;\n composed: boolean;\n currentTarget: EventTarget | null = null;\n defaultPrevented: boolean = false;\n eventPhase: number = 0;\n isTrusted: boolean = false;\n target: EventTarget | null = null;\n timeStamp: number;\n readonly AT_TARGET = 2;\n readonly BUBBLING_PHASE = 3;\n readonly CAPTURING_PHASE = 1;\n readonly NONE = 0;\n returnValue: boolean = true;\n srcElement: EventTarget | null = null;\n cancelBubble: boolean = false;\n \n constructor(type: string, eventInitDict?: EventInit) {\n this.type = type;\n this.bubbles = eventInitDict?.bubbles || false;\n this.cancelable = eventInitDict?.cancelable || false;\n this.composed = eventInitDict?.composed || false;\n this.timeStamp = Date.now();\n }\n \n composedPath(): EventTarget[] {\n return [];\n }\n \n initEvent(_type: string, _bubbles?: boolean, _cancelable?: boolean): void {\n // Legacy method - no-op\n }\n \n preventDefault(): void {\n if (this.cancelable) {\n this.defaultPrevented = true;\n }\n }\n \n stopImmediatePropagation(): void {\n this.cancelBubble = true;\n }\n \n stopPropagation(): void {\n this.cancelBubble = true;\n }\n}\n\nexport class NucloCustomEvent<T = any> extends NucloEvent implements CustomEvent<T> {\n detail: T;\n \n constructor(type: string, eventInitDict?: CustomEventInit<T>) {\n super(type, eventInitDict);\n this.detail = eventInitDict?.detail as T;\n }\n \n initCustomEvent(_type: string, _bubbles?: boolean, _cancelable?: boolean, _detail?: T): void {\n // Legacy method - no-op\n }\n}\n\n// Export polyfills if browser globals don't exist\nexport const Event = globalThis.Event || NucloEvent;\nexport const CustomEvent = globalThis.CustomEvent || NucloCustomEvent;\n","/**\n * Polyfills for Node.js environments\n * \n * This module provides minimal browser API polyfills to allow Nuclo to run in Node.js\n * for server-side rendering (SSR) scenarios.\n * \n * To use in Node.js:\n * ```typescript\n * import 'nuclo/polyfill';\n * // or\n * import { document, Event, CustomEvent } from 'nuclo/polyfill';\n * ```\n */\n\nexport { NucloDocument, document } from './Document';\nexport { NucloElement } from './Element';\nexport { NucloText } from './Text';\nexport { NucloEvent, NucloCustomEvent, Event, CustomEvent } from './Event';\nexport { NucloNode } from './Node';\n\n// Import for local use\nimport { NucloElement } from './Element';\nimport { NucloNode } from './Node';\nimport { document } from './Document';\nimport { Event, CustomEvent } from './Event';\n\nexport const Node = NucloNode;\nexport const Element = NucloElement;\nexport const HTMLElement = NucloElement;\n\n// Auto-apply polyfills to globalThis if in Node environment (synchronous — no top-level await)\nif (typeof window === 'undefined' && typeof globalThis !== 'undefined') {\n interface GlobalWithPolyfills {\n document?: typeof document;\n Event?: typeof Event;\n CustomEvent?: typeof CustomEvent;\n Node?: typeof NucloNode;\n Element?: typeof NucloElement;\n HTMLElement?: typeof NucloElement;\n }\n\n const g = globalThis as unknown as GlobalWithPolyfills;\n\n if (!g.document) g.document = document;\n if (!g.Event) g.Event = Event;\n if (!g.CustomEvent) g.CustomEvent = CustomEvent;\n if (!g.Node) g.Node = NucloNode;\n if (!g.Element) g.Element = NucloElement;\n if (!g.HTMLElement) g.HTMLElement = NucloElement;\n}\n"],"mappings":"8CAAA,IAAa,EAAb,KAAuB,CACrB,SAAW,EACX,SAAW,QACX,KACA,YACA,WAAsB,KAEtB,YAAY,EAAc,CACxB,KAAK,KAAO,EACZ,KAAK,YAAc,CACrB,CAEA,IAAI,WAAoB,CACtB,OAAO,KAAK,IACd,CAEA,IAAI,UAAU,EAAe,CAC3B,KAAK,KAAO,EACZ,KAAK,YAAc,CACrB,CACF,ECbM,EAAN,KAA0B,CACxB,SAAmB,GACnB,SAAmB,qBACnB,WAAqB,CAAC,EACtB,SAAsB,CAAC,EACvB,YAAsB,GAEtB,IAAI,YAA0B,CAC5B,OAAO,KAAK,WAAW,OAAS,EAAI,KAAK,WAAW,GAAK,IAC3D,CAEA,IAAI,WAAyB,CAC3B,OAAO,KAAK,WAAW,OAAS,EAAI,KAAK,WAAW,KAAK,WAAW,OAAS,GAAK,IACpF,CAEA,YAA4B,EAAa,CAMvC,OALA,KAAK,WAAW,KAAK,CAAK,EACrB,EAAc,WAAa,GAC9B,KAAK,SAAS,KAAK,CAA2B,EAEhD,EAAe,WAAa,KACrB,CACT,CAEA,aAA6B,EAAY,EAAyB,CAChE,GAAI,CAAC,EAAS,OAAO,KAAK,YAAY,CAAO,EAC7C,IAAM,EAAQ,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ent 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
|
package/dist/render.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAGA;;;;;;;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,CAK3B;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,CA4B3B"}
|
|
@@ -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"}
|
package/dist/shared/dom.d.ts
DELETED
|
@@ -1,69 +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
|
-
export declare function safeRemoveChild(child: Node): boolean;
|
|
24
|
-
export declare function createComment(text: string): Comment | null;
|
|
25
|
-
export declare function createConditionalComment(tagName: string, suffix?: string): Comment | null;
|
|
26
|
-
export declare function createMarkerPair(prefix: string, id: number | string): {
|
|
27
|
-
start: Comment;
|
|
28
|
-
end: Comment;
|
|
29
|
-
};
|
|
30
|
-
export declare function clearBetweenMarkers(startMarker: Comment, endMarker: Comment): void;
|
|
31
|
-
export declare function insertNodesBefore(nodes: Node[], referenceNode: Node): void;
|
|
32
|
-
export declare function appendChildren(parent: Element | Node, ...children: Array<Element | Node | string | null | undefined>): Element | Node;
|
|
33
|
-
export declare function isNodeConnected(node: Node | null | undefined): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Safely replaces an old node with a new node in the DOM.
|
|
36
|
-
* Returns true on success, false on failure (and logs the error).
|
|
37
|
-
*/
|
|
38
|
-
export declare function replaceNodeSafely(oldNode: Node, newNode: Node): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Safely casts an Element-like object to Node & ParentNode interface.
|
|
41
|
-
* This is a common pattern needed when working with DOM manipulation.
|
|
42
|
-
*
|
|
43
|
-
* @param element - The element to cast
|
|
44
|
-
* @returns The element typed as Node & ParentNode
|
|
45
|
-
*/
|
|
46
|
-
export declare function asParentNode<T extends Element | object>(element: T): Node & ParentNode;
|
|
47
|
-
/**
|
|
48
|
-
* Creates a scoped DOM insertion context that temporarily redirects appendChild
|
|
49
|
-
* to insertBefore at a specific reference node. This is useful for inserting
|
|
50
|
-
* content at specific positions in the DOM tree.
|
|
51
|
-
*
|
|
52
|
-
* @param host - The host element
|
|
53
|
-
* @param referenceNode - The node before which new nodes should be inserted
|
|
54
|
-
* @param callback - Function to execute with the scoped context
|
|
55
|
-
* @returns The result of the callback
|
|
56
|
-
*/
|
|
57
|
-
export declare function withScopedInsertion<T, THost extends Element | object>(host: THost, referenceNode: Node, callback: () => T): T;
|
|
58
|
-
/**
|
|
59
|
-
* Type-safe wrapper for setting CSS style properties.
|
|
60
|
-
* Provides better error handling than direct CSSStyleDeclaration access.
|
|
61
|
-
* Supports both camelCase and kebab-case property names.
|
|
62
|
-
*
|
|
63
|
-
* @param element - The element to apply styles to
|
|
64
|
-
* @param property - The CSS property name (camelCase or kebab-case)
|
|
65
|
-
* @param value - The value to set (string, number, or null to remove)
|
|
66
|
-
* @returns true if the style was applied successfully, false otherwise
|
|
67
|
-
*/
|
|
68
|
-
export declare function setStyleProperty(element: HTMLElement, property: string, value: string | number | null): boolean;
|
|
69
|
-
//# sourceMappingURL=dom.d.ts.map
|
package/dist/shared/dom.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/shared/dom.ts"],"names":[],"mappings":"AAIA,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;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,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,CAiBH;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 +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"}
|
package/dist/shared/errors.d.ts
DELETED
|
@@ -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"}
|
package/dist/shared/strings.d.ts
DELETED
|
@@ -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"}
|
package/dist/ssr/index.d.ts
DELETED
|
@@ -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
|
package/dist/ssr/index.d.ts.map
DELETED
|
@@ -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"}
|
package/dist/ssr/nuclo.ssr.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"../Element-C3mU75-a.mjs";function t(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n>=65&&n<=90)break}if(t===e.length)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e.charCodeAt(r);t>=65&&t<=90?(r>0&&(n+=`-`),n+=String.fromCharCode(t+32)):n+=e[r]}return n}const n=/[&<>"']/,r=/[&<>]/;function i(e){let t=n.exec(e);if(!t)return e;let r=``,i=0;for(let n=t.index;n<e.length;n++){let t;switch(e.charCodeAt(n)){case 38:t=`&`;break;case 60:t=`<`;break;case 62:t=`>`;break;case 34:t=`"`;break;case 39:t=`'`;break;default:continue}r+=e.slice(i,n)+t,i=n+1}return r+e.slice(i)}function a(e){let t=r.exec(e);if(!t)return e;let n=``,i=0;for(let r=t.index;r<e.length;r++){let t;switch(e.charCodeAt(r)){case 38:t=`&`;break;case 60:t=`<`;break;case 62:t=`>`;break;default:continue}n+=e.slice(i,r)+t,i=r+1}return n+e.slice(i)}const o=new Set;typeof FinalizationRegistry<`u`&&new FinalizationRegistry(e=>{o.delete(e)});function s(e){return globalThis.document?document.createElement(e):null}let c=!1;function l(e){let t=c;c=!0;try{return e()}finally{c=t}}const u=new Set(`viewBox.preserveAspectRatio.markerWidth.markerHeight.gradientTransform.patternTransform.clipPathUnits.gradientUnits.patternUnits.pathLength.refX.refY.stdDeviation.baseFrequency.numOctaves.kernelMatrix.tableValues.targetX.targetY.specularExponent.specularConstant.diffuseConstant.surfaceScale.xChannelSelector.yChannelSelector.edgeMode.stitchTiles.spreadMethod.patternContentUnits.markerUnits.startOffset.textLength.lengthAdjust`.split(`.`)),d=new Set([`allowfullscreen`,`async`,`autofocus`,`autoplay`,`checked`,`controls`,`default`,`defer`,`disabled`,`formnovalidate`,`hidden`,`ismap`,`loop`,`multiple`,`muted`,`nomodule`,`novalidate`,`open`,`readonly`,`required`,`reversed`,`selected`]);function f(e,n){if(n==null||n===!1)return``;if(n===!0)return` ${e}`;if(d.has(e)){if(n===`false`)return``;if(n===`true`||n===``||n===e)return` ${e}`}if(e===`style`&&typeof n==`object`){let e=``;for(let r in n){let i=n[r];i!=null&&i!==``&&(e+=(e?` `:``)+t(r)+`: `+String(i)+`;`)}return e?` style="${i(e)}"`:``}return` ${e}="${i(String(n))}"`}function p(e,n){let r=``;if(n){let n=e,a=n._attributes;n.id&&!a?.has(`id`)&&(r+=f(`id`,n.id)),n.className&&!a?.has(`class`)&&(r+=f(`class`,n.className));let o=n._style;if(!a?.has(`style`)&&o){let e=o.cssText||``;if(e){let n=e.split(`;`).map(e=>e.trim()).filter(Boolean).map(e=>{let n=e.indexOf(`:`);if(n===-1)return e;let r=e.slice(0,n).trim(),i=e.slice(n+1).trim();return i?`${t(r)}: ${i};`:``}).filter(Boolean).join(` `);n&&(r+=` style="${i(n)}"`)}}if(a)for(let[e,n]of a){let i=u.has(e)?e:t(e);r+=f(i,n)}return r}if(e.attributes&&e.attributes.length)for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t];n&&n.name&&(r+=f(n.name,n.value))}return r}const m=Object.assign(Object.create(null),{area:1,base:1,br:1,col:1,embed:1,hr:1,img:1,input:1,link:1,meta:1,param:1,source:1,track:1,wbr:1,script:2,style:2});function h(e,t){return t.replace(RegExp(`</(`+e+`)`,`gi`),`<\\/$1`)}function g(e){if(`tagName`in e&&`children`in e){let t=e.children;if(Array.isArray(t))return t}if(`childNodes`in e){let t=e.childNodes;if(t&&(Array.isArray(t)||t.length!==void 0))return t}return[]}function _(t){if(t.nodeType===3)return a(t.textContent||``);if(t.nodeType===8)return`<!--${t.textContent||``}-->`;if(t.nodeType===1){let n=t,r=n.tagName,i=Array.isArray(n.children),o=n instanceof e?r:r.toLowerCase(),s=p(n,i),c=m[o];if(c===1)return`<${o}${s} />`;let l=i?n.children:g(n);if(c===2){let e=``,n=l;if(n&&n.length>0)for(let t=0;t<n.length;t++){let r=n[t];r&&r.nodeType===3&&(e+=r.textContent||``)}else{let n=t.textContent;typeof n==`string`&&(e=n)}return`<${o}${s}>${h(o,e)}</${o}>`}let u=``;if(l&&l.length>0)for(let e=0;e<l.length;e++){let t=l[e];t&&(u+=_(t))}else{let e=t.textContent;typeof e==`string`&&e&&(u=a(e))}return`<${o}${s}>${u}</${o}>`}if(t.nodeType===11){let e=``,n=g(t);if(n&&n.length>0)for(let t=0;t<n.length;t++){let r=n[t];r&&(e+=_(r))}return e}return``}function v(e){if(!e)return``;if(typeof e==`function`)try{let t=l(()=>{let t=s(`div`);if(!t)throw Error(`Document is not available. Make sure polyfills are loaded.`);return e(t,0)});return t&&typeof t==`object`&&`nodeType`in t?_(t):``}catch(e){return console.error(`Error rendering component to string:`,e),``}return`nodeType`in e?_(e):``}function y(e){return e.map(e=>v(e))}function b(e,t=`div`,n={}){let r=v(e);return`<${t}${Object.entries(n).map(([e,t])=>f(e,t)).join(``)}>${r}</${t}>`}function x(){return{ssrCollector:null,atomCache:new Map,atomMeta:new Map,rawKeys:new Set,baseRules:[],queryRules:new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:new Map,externalRules:null,hasExternalGroups:!1}}const S=Symbol.for(`nuclo.style.engine.v1`),C=globalThis,w=C[S]??(C[S]=x());function T(e){w.ssrCollector=e}function E(){if(w.cssTextCache!==null)return w.cssTextCache;let e=w.baseRules.join(``);for(let[t,n]of w.queryRules)n.length>0&&(e+=t+`{`+n.join(``)+`}`);return w.cssTextCache=e,e}export{E as getCssText,y as renderManyToString,v as renderToString,b as renderToStringWithContainer,T as setSSRCollector};
|
|
2
|
-
//# sourceMappingURL=nuclo.ssr.mjs.map
|