@geektech/tsone 0.1.0 → 0.2.1
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/README-zh.md +26 -7
- package/README.md +29 -7
- package/dist/dom/index.d.ts +534 -0
- package/dist/dom/index.js +2181 -0
- package/dist/dom/index.js.map +10 -0
- package/dist/{index-wv9gyjqt.js → index-1x4ectvr.js} +346 -5
- package/dist/{index-wv9gyjqt.js.map → index-1x4ectvr.js.map} +6 -4
- package/dist/{index-8wjswsye.js → index-ffzday7h.js} +31 -3
- package/dist/{index-8wjswsye.js.map → index-ffzday7h.js.map} +5 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +91 -430
- package/dist/index.js.map +4 -6
- package/dist/router/index.js +7 -7
- package/dist/router/index.js.map +1 -1
- package/dist/style/index.js +5 -7
- package/dist/style/index.js.map +1 -1
- package/package.json +10 -1
- package/dist/index-vpx80nq5.js +0 -32
- package/dist/index-vpx80nq5.js.map +0 -10
package/dist/style/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
StyleManager,
|
|
2
3
|
renderStyleSheet
|
|
3
|
-
} from "../index-
|
|
4
|
-
import {
|
|
5
|
-
StyleManager
|
|
6
|
-
} from "../index-8wjswsye.js";
|
|
4
|
+
} from "../index-ffzday7h.js";
|
|
7
5
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
StyleManager,
|
|
7
|
+
renderStyleSheet
|
|
10
8
|
};
|
|
11
9
|
|
|
12
|
-
//# debugId=
|
|
10
|
+
//# debugId=AF05CF14C261411864756E2164756E21
|
|
13
11
|
//# sourceMappingURL=index.js.map
|
package/dist/style/index.js.map
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geektech/tsone",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "TSone 是轻量级纯 TypeScript 前端框架,提供响应式系统、类组件、策略化渲染和路由功能",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"./style": {
|
|
19
19
|
"import": "./dist/style/index.js",
|
|
20
20
|
"types": "./dist/style/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./dom": {
|
|
23
|
+
"import": "./dist/dom/index.js",
|
|
24
|
+
"types": "./dist/dom/index.d.ts"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"scripts": {
|
|
@@ -39,6 +43,11 @@
|
|
|
39
43
|
"router"
|
|
40
44
|
],
|
|
41
45
|
"author": "Jimmie Max(Qianyu)",
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/geektech-team/tsone.git",
|
|
49
|
+
"directory": "packages/tsone"
|
|
50
|
+
},
|
|
42
51
|
"license": "MIT",
|
|
43
52
|
"engines": {
|
|
44
53
|
"bun": ">=1.3.0"
|
package/dist/index-vpx80nq5.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// lib/style/sheet.ts
|
|
2
|
-
function renderStyleSheet(styles) {
|
|
3
|
-
return styles.map((entry) => renderStyleEntry(entry)).join(`
|
|
4
|
-
|
|
5
|
-
`);
|
|
6
|
-
}
|
|
7
|
-
function renderStyleEntry(entry, indent = "") {
|
|
8
|
-
if ("atRule" in entry) {
|
|
9
|
-
const rules = entry.rules.map((rule) => renderStyleEntry(rule, `${indent} `)).join(`
|
|
10
|
-
|
|
11
|
-
`);
|
|
12
|
-
return `${indent}${entry.atRule} {
|
|
13
|
-
${rules}
|
|
14
|
-
${indent}}`;
|
|
15
|
-
}
|
|
16
|
-
const declarations = Object.entries(entry.properties).map(([property, value]) => `${indent} ${toCssProperty(property)}: ${String(value)};`).join(`
|
|
17
|
-
`);
|
|
18
|
-
return `${indent}${entry.selector} {
|
|
19
|
-
${declarations}
|
|
20
|
-
${indent}}`;
|
|
21
|
-
}
|
|
22
|
-
function toCssProperty(property) {
|
|
23
|
-
if (property.startsWith("--") || property.includes("-")) {
|
|
24
|
-
return property;
|
|
25
|
-
}
|
|
26
|
-
return property.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { renderStyleSheet };
|
|
30
|
-
|
|
31
|
-
//# debugId=61B1187B7ADC17DB64756E2164756E21
|
|
32
|
-
//# sourceMappingURL=index-vpx80nq5.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../lib/style/sheet.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"export type StyleValue = string | number;\n\nexport type StyleProperties = Record<string, StyleValue>;\n\nexport interface StyleRule {\n selector: string;\n properties: StyleProperties;\n}\n\nexport interface StyleAtRule {\n atRule: string;\n rules: StyleRule[];\n}\n\nexport type StyleSheetEntry = StyleRule | StyleAtRule;\n\nexport type StyleSheet = StyleSheetEntry[];\n\nexport function renderStyleSheet(styles: StyleSheet): string {\n return styles.map((entry) => renderStyleEntry(entry)).join('\\n\\n');\n}\n\nfunction renderStyleEntry(entry: StyleSheetEntry, indent = ''): string {\n if ('atRule' in entry) {\n const rules = entry.rules\n .map((rule) => renderStyleEntry(rule, `${indent} `))\n .join('\\n\\n');\n\n return `${indent}${entry.atRule} {\\n${rules}\\n${indent}}`;\n }\n\n const declarations = Object.entries(entry.properties)\n .map(\n ([property, value]) =>\n `${indent} ${toCssProperty(property)}: ${String(value)};`\n )\n .join('\\n');\n\n return `${indent}${entry.selector} {\\n${declarations}\\n${indent}}`;\n}\n\nfunction toCssProperty(property: string): string {\n if (property.startsWith('--') || property.includes('-')) {\n return property;\n }\n\n return property.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": ";AAkBO,SAAS,gBAAgB,CAAC,QAA4B;AAAA,EAC3D,OAAO,OAAO,IAAI,CAAC,UAAU,iBAAiB,KAAK,CAAC,EAAE,KAAK;AAAA;AAAA,CAAM;AAAA;AAGnE,SAAS,gBAAgB,CAAC,OAAwB,SAAS,IAAY;AAAA,EACrE,IAAI,YAAY,OAAO;AAAA,IACrB,MAAM,QAAQ,MAAM,MACjB,IAAI,CAAC,SAAS,iBAAiB,MAAM,GAAG,UAAU,CAAC,EACnD,KAAK;AAAA;AAAA,CAAM;AAAA,IAEd,OAAO,GAAG,SAAS,MAAM;AAAA,EAAa;AAAA,EAAU;AAAA,EAClD;AAAA,EAEA,MAAM,eAAe,OAAO,QAAQ,MAAM,UAAU,EACjD,IACC,EAAE,UAAU,WACV,GAAG,WAAW,cAAc,QAAQ,MAAM,OAAO,KAAK,IAC1D,EACC,KAAK;AAAA,CAAI;AAAA,EAEZ,OAAO,GAAG,SAAS,MAAM;AAAA,EAAe;AAAA,EAAiB;AAAA;AAG3D,SAAS,aAAa,CAAC,UAA0B;AAAA,EAC/C,IAAI,SAAS,WAAW,IAAI,KAAK,SAAS,SAAS,GAAG,GAAG;AAAA,IACvD,OAAO;AAAA,EACT;AAAA,EAEA,OAAO,SAAS,QAAQ,UAAU,CAAC,UAAU,IAAI,MAAM,YAAY,GAAG;AAAA;",
|
|
8
|
-
"debugId": "61B1187B7ADC17DB64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|