@neuralfog/elemix 0.5.3 → 0.5.4
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/dist/src/utilities.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Ref<Value> = {
|
|
2
2
|
value?: Value;
|
|
3
3
|
};
|
|
4
|
+
export declare const ref: <Value>(value?: Value | undefined) => Ref<Value>;
|
|
4
5
|
export declare const fastUID: () => string;
|
|
5
6
|
export declare function render(): Promise<boolean>;
|
|
6
7
|
export declare const camelToKebabCase: (input: string) => string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Component } from '../../src/component/Component';
|
|
2
2
|
import { type Template } from '../../src/types';
|
|
3
3
|
export declare class RefApp extends Component {
|
|
4
|
-
ref:
|
|
5
|
-
value?: unknown;
|
|
6
|
-
};
|
|
4
|
+
ref: import("../../utilities").Ref<unknown>;
|
|
7
5
|
template: () => Template;
|
|
8
6
|
}
|
|
@@ -2,9 +2,7 @@ import { Component } from '../../src/component/Component';
|
|
|
2
2
|
import { type Template } from '../../src/types';
|
|
3
3
|
export declare class ViewModelBindingApp extends Component {
|
|
4
4
|
state: {
|
|
5
|
-
input:
|
|
6
|
-
value?: string | undefined;
|
|
7
|
-
};
|
|
5
|
+
input: import("../../utilities").Ref<string>;
|
|
8
6
|
};
|
|
9
7
|
template: () => Template;
|
|
10
8
|
}
|
|
@@ -17,9 +17,7 @@ export declare class OtpLikeStructure extends Component {
|
|
|
17
17
|
state: {
|
|
18
18
|
digits: Digit[];
|
|
19
19
|
};
|
|
20
|
-
inputRefs:
|
|
21
|
-
value?: HTMLInputElement | undefined;
|
|
22
|
-
}[];
|
|
20
|
+
inputRefs: import("../../../utilities").Ref<HTMLInputElement>[];
|
|
23
21
|
private onInput;
|
|
24
22
|
private onKeyDown;
|
|
25
23
|
private onBeforeInput;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),t=new Set(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),n=e=>!t.has(e.tagName.toLowerCase()),r=e=>{for(let t of Array.from(e.childNodes))if(t.nodeType===1&&n(t))return!0;return!1},i=e=>e.nodeType===3&&!(e.nodeValue??``).trim(),a=new Set([`allowfullscreen`,`async`,`autofocus`,`autoplay`,`checked`,`controls`,`default`,`defer`,`disabled`,`formnovalidate`,`hidden`,`inert`,`ismap`,`itemscope`,`loop`,`multiple`,`muted`,`nomodule`,`novalidate`,`open`,`playsinline`,`readonly`,`required`,`reversed`,`selected`]),o=e=>e.replace(/&/g,`&`).replace(/"/g,`"`),s=e=>{let t=``;for(let n of Array.from(e.attributes))n.value===``&&a.has(n.name)?t+=` ${n.name}`:t+=` ${n.name}="${o(n.value)}"`;return t},c=(e,t,n)=>{let r=t+n;for(;r>=0&&r<e.length;){let t=e[r];if(t.nodeType===8){r+=n;continue}if(t.nodeType===3){if((t.nodeValue??``).replace(/\s+/g,` `).trim())return t;r+=n;continue}return t}return null},l=t=>{let n=Array.from(t),r=``;for(let t=0;t<n.length;t++){let i=n[t];if(i.nodeType===3){let e=(i.nodeValue??``).replace(/\s+/g,` `),a=c(n,t,-1),o=c(n,t,1);if((!a||a.nodeType!==3)&&(e=e.replace(/^ /,``)),(!o||o.nodeType!==3)&&(e=e.replace(/ $/,``)),e===``)continue;r+=e}else if(i.nodeType===8)r+=`<!--${i.nodeValue}-->`;else if(i.nodeType===1){let t=i,n=t.tagName.toLowerCase(),a=s(t);if(e.has(n))r+=`<${n}${a}>`;else{let e=l(Array.from(t.childNodes));r+=`<${n}${a}>${e}</${n}>`}}}return r},u=(t,a)=>{let o=t.tagName.toLowerCase(),c=s(t);if(e.has(o))return`<${o}${c}>`;if(!r(t))return`<${o}${c}>${l(Array.from(t.childNodes))}</${o}>`;let d=` `.repeat(a+1),f=` `.repeat(a),p=`<${o}${c}>`,m=[],h=()=>{m.length!==0&&(p+=l(m),m.length=0)};for(let e of Array.from(t.childNodes))i(e)||(e.nodeType===1&&n(e)?(h(),p+=`\n${d}${u(e,a+1)}`):m.push(e));return h(),p+=`\n${f}</${o}>`,p},d=e=>{let t=new DOMParser().parseFromString(e,`text/html`),n=`
|
|
2
|
+
`;for(let e of Array.from(t.body.childNodes))if(!i(e)){if(e.nodeType===1)n+=`${u(e,0)}\n`;else if(e.nodeType===8)n+=`<!--${e.nodeValue}-->\n`;else if(e.nodeType===3){let t=e.nodeValue??``;t.trim()&&(n+=`${t}\n`)}}return n},f=e=>{if(!e)return``;if(e.nodeType===3&&e.textContent)return e.textContent.trim();if(e.nodeType!==1)return``;let t=``,n=e.cloneNode();if(e.shadowRoot&&(t+=`
|
|
2
3
|
<!-- #shadowroot -->
|
|
3
|
-
`),e=e.shadowRoot||e,e.children.length)for(let n of e.childNodes)n.assignedNodes?n.assignedNodes()[0]?n.nodeName.includes(`-`)?t+=`\n${
|
|
4
|
+
`),e=e.shadowRoot||e,e.children.length)for(let n of e.childNodes)n.assignedNodes?n.assignedNodes()[0]?n.nodeName.includes(`-`)?t+=`\n${f(n.assignedNodes()[0])}\n`:t+=f(n.assignedNodes()[0]):n.nodeName.includes(`-`)?t+=`\n${n.innerHTML}\n`:t+=n.innerHTML:n.nodeName.includes(`-`)?t+=`\n${f(n)}\n`:t+=f(n);else t=e.innerHTML;return n.innerHTML=t,n.outerHTML},p=e=>d(f(e));exports.HTML=p;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuralfog/elemix",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "brownhounds",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,18 +34,6 @@
|
|
|
34
34
|
"lint:fix": "biome format --write && biome lint --fix",
|
|
35
35
|
"release": "npm run clean && npm run build && npm publish --access public"
|
|
36
36
|
},
|
|
37
|
-
"peerDependencies": {
|
|
38
|
-
"rehype-format": "5.0.1",
|
|
39
|
-
"rehype-parse": "9.0.1",
|
|
40
|
-
"rehype-stringify": "10.0.1",
|
|
41
|
-
"unified": "11.0.5"
|
|
42
|
-
},
|
|
43
|
-
"peerDependenciesMeta": {
|
|
44
|
-
"rehype-format": { "optional": true },
|
|
45
|
-
"rehype-parse": { "optional": true },
|
|
46
|
-
"rehype-stringify": { "optional": true },
|
|
47
|
-
"unified": { "optional": true }
|
|
48
|
-
},
|
|
49
37
|
"devDependencies": {
|
|
50
38
|
"@neuralfog/biome-config": "0.1.2",
|
|
51
39
|
"@neuralfog/ts-config": "0.1.2",
|
|
@@ -54,11 +42,7 @@
|
|
|
54
42
|
"@vitest/ui": "4.1.7",
|
|
55
43
|
"esbuild": "0.28.0",
|
|
56
44
|
"jsdom": "29.1.1",
|
|
57
|
-
"rehype-format": "5.0.1",
|
|
58
|
-
"rehype-parse": "9.0.1",
|
|
59
|
-
"rehype-stringify": "10.0.1",
|
|
60
45
|
"typescript": "6.0.3",
|
|
61
|
-
"unified": "11.0.5",
|
|
62
46
|
"vite": "8.0.14",
|
|
63
47
|
"vitest": "4.1.7"
|
|
64
48
|
}
|