ziko 0.68.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/dom/tags/index.d.ts +28 -0
- package/src/{ui → dom}/tags/index.js +0 -11
- package/src/ui/tags/index.d.ts.txt +0 -144
- /package/src/{ui → dom}/constructors/UIElement.js +0 -0
- /package/src/{ui → dom}/constructors/UIElementCore.d.ts +0 -0
- /package/src/{ui → dom}/constructors/UIElementCore.js +0 -0
- /package/src/{ui → dom}/constructors/UINode.d.ts +0 -0
- /package/src/{ui → dom}/constructors/UINode.js +0 -0
- /package/src/{ui → dom}/constructors/mixins/attrs.js +0 -0
- /package/src/{ui → dom}/constructors/mixins/dom.js +0 -0
- /package/src/{ui → dom}/constructors/mixins/index.js +0 -0
- /package/src/{ui → dom}/constructors/mixins/indexing.js +0 -0
- /package/src/{ui → dom}/constructors/mixins/lifecycle.js +0 -0
- /package/src/{ui → dom}/constructors/mixins/style.js +0 -0
- /package/src/{ui → dom}/flex/index.js +0 -0
- /package/src/{ui → dom}/flex/utils/index.js +0 -0
- /package/src/{ui → dom}/graphics/canvas.js +0 -0
- /package/src/{ui → dom}/graphics/index.js +0 -0
- /package/src/{ui → dom}/graphics/svg.js +0 -0
- /package/src/{ui → dom}/grid/index.js +0 -0
- /package/src/{ui → dom}/index.js +0 -0
- /package/src/{ui → dom}/logic/index.js +0 -0
- /package/src/{ui → dom}/logic/switch/index.js +0 -0
- /package/src/{ui → dom}/mini/UIElement.js +0 -0
- /package/src/{ui → dom}/suspense/index.js +0 -0
- /package/src/{ui → dom}/tags/tags-list.js +0 -0
- /package/src/{ui → dom}/text/index.js +0 -0
- /package/src/{ui → dom}/utils/getters.js +0 -0
- /package/src/{ui → dom}/utils/index.js +0 -0
- /package/src/{ui → dom}/view/index.js +0 -0
- /package/src/{ui → dom}/web-component/index.d.ts +0 -0
- /package/src/{ui → dom}/web-component/index.js +0 -0
- /package/src/{ui → dom}/wrappers/html/index.js +0 -0
- /package/src/{ui → dom}/wrappers/index.js +0 -0
- /package/src/{ui → dom}/wrappers/svg/index.js +0 -0
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ const Hello = name => p(
|
|
|
81
81
|
```
|
|
82
82
|
- 🔄 Built in State Mangement :
|
|
83
83
|
```js
|
|
84
|
-
import { tags } from 'ziko/
|
|
84
|
+
import { tags } from 'ziko/dom'
|
|
85
85
|
import {useState, useDerived} from 'ziko/hooks'
|
|
86
86
|
const [timer, setTimer] = useState(0);
|
|
87
87
|
const converToHMS = seconds => `${Math.floor(seconds / 3600)} : ${Math.floor((seconds % 3600) / 60)} : ${seconds % 60} `
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziko",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"front-end",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UIElement } from "../constructors/UIElement.js";
|
|
2
|
+
import { UINode } from "../constructors/UINode.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* All valid DOM tag names (HTML + SVG + MathML)
|
|
6
|
+
*/
|
|
7
|
+
type NativeTagNames =
|
|
8
|
+
| keyof HTMLElementTagNameMap
|
|
9
|
+
| keyof SVGElementTagNameMap
|
|
10
|
+
| keyof MathMLElementTagNameMap;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Tags that should return UINode instead of UIElement
|
|
14
|
+
*/
|
|
15
|
+
type NodeTags = "html" | "head" | "body" | "style" | "title" | "meta" | "link" | "base";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Map native tags:
|
|
19
|
+
* - html | body | style → UINode
|
|
20
|
+
* - everything else → UIElement
|
|
21
|
+
*/
|
|
22
|
+
export type Tags = {
|
|
23
|
+
[K in NativeTagNames]: K extends NodeTags ? UINode : UIElement;
|
|
24
|
+
} & {
|
|
25
|
+
[key: `${string}-${string}` | `${string}_${string}`]: UIElement; // custom elements default to UIElement
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare const tags: Tags;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import {UIElement} from "../constructors/UIElement.js";
|
|
2
2
|
import { HTMLTags, SVGTags, MathMLTags } from "./tags-list.js";
|
|
3
|
-
// import { isStateGetter } from "../../hooks/use-state.js";
|
|
4
|
-
const _h=(tag, type, attributes, ...children)=>{
|
|
5
|
-
const { name, style, ...attrs } = attributes;
|
|
6
|
-
let element = new UIElement(tag, name, type);
|
|
7
|
-
style && element.style(style);
|
|
8
|
-
attrs && element.setAttr(attrs);
|
|
9
|
-
children && element.append(...children);
|
|
10
|
-
return element;
|
|
11
|
-
}
|
|
12
|
-
// const h=(tag, attributes = {}, ...children)=> _h(tag, "html", attributes, ...children);
|
|
13
|
-
// const s=(tag, attributes = {}, ...children)=> _h(tag, "svg", attributes, ...children);
|
|
14
3
|
|
|
15
4
|
const tags = new Proxy({}, {
|
|
16
5
|
get(target, prop) {
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import {UIElement} from "../elements/UIElement.js";
|
|
2
|
-
interface HtmlTags {
|
|
3
|
-
a: UIElement;
|
|
4
|
-
abbr: UIElement;
|
|
5
|
-
address: UIElement;
|
|
6
|
-
area: UIElement;
|
|
7
|
-
article: UIElement;
|
|
8
|
-
aside: UIElement;
|
|
9
|
-
audio: UIElement;
|
|
10
|
-
b: UIElement;
|
|
11
|
-
base: UIElement;
|
|
12
|
-
bdi: UIElement;
|
|
13
|
-
bdo: UIElement;
|
|
14
|
-
blockquote: UIElement;
|
|
15
|
-
body: UIElement;
|
|
16
|
-
br: UIElement;
|
|
17
|
-
button: UIElement;
|
|
18
|
-
canvas: UIElement;
|
|
19
|
-
caption: UIElement;
|
|
20
|
-
cite: UIElement;
|
|
21
|
-
code: UIElement;
|
|
22
|
-
col: UIElement;
|
|
23
|
-
colgroup: UIElement;
|
|
24
|
-
data: UIElement;
|
|
25
|
-
datalist: UIElement;
|
|
26
|
-
dd: UIElement;
|
|
27
|
-
del: UIElement;
|
|
28
|
-
details: UIElement;
|
|
29
|
-
dfn: UIElement;
|
|
30
|
-
dialog: UIElement;
|
|
31
|
-
div: UIElement;
|
|
32
|
-
dl: UIElement;
|
|
33
|
-
dt: UIElement;
|
|
34
|
-
em: UIElement;
|
|
35
|
-
embed: UIElement;
|
|
36
|
-
fieldset: UIElement;
|
|
37
|
-
figcaption: UIElement;
|
|
38
|
-
figure: UIElement;
|
|
39
|
-
footer: UIElement;
|
|
40
|
-
form: UIElement;
|
|
41
|
-
h1: UIElement;
|
|
42
|
-
h2: UIElement;
|
|
43
|
-
h3: UIElement;
|
|
44
|
-
h4: UIElement;
|
|
45
|
-
h5: UIElement;
|
|
46
|
-
h6: UIElement;
|
|
47
|
-
head: UIElement;
|
|
48
|
-
header: UIElement;
|
|
49
|
-
hgroup: UIElement;
|
|
50
|
-
hr: UIElement;
|
|
51
|
-
html: UIElement;
|
|
52
|
-
i: UIElement;
|
|
53
|
-
iframe: UIElement;
|
|
54
|
-
img: UIElement;
|
|
55
|
-
input: UIElement;
|
|
56
|
-
ins: UIElement;
|
|
57
|
-
kbd: UIElement;
|
|
58
|
-
label: UIElement;
|
|
59
|
-
legend: UIElement;
|
|
60
|
-
li: UIElement;
|
|
61
|
-
link: UIElement;
|
|
62
|
-
main: UIElement;
|
|
63
|
-
map: UIElement;
|
|
64
|
-
mark: UIElement;
|
|
65
|
-
meta: UIElement;
|
|
66
|
-
meter: UIElement;
|
|
67
|
-
nav: UIElement;
|
|
68
|
-
noscript: UIElement;
|
|
69
|
-
object: UIElement;
|
|
70
|
-
ol: UIElement;
|
|
71
|
-
optgroup: UIElement;
|
|
72
|
-
option: UIElement;
|
|
73
|
-
output: UIElement;
|
|
74
|
-
p: UIElement;
|
|
75
|
-
param: UIElement;
|
|
76
|
-
picture: UIElement;
|
|
77
|
-
pre: UIElement;
|
|
78
|
-
progress: UIElement;
|
|
79
|
-
q: UIElement;
|
|
80
|
-
rp: UIElement;
|
|
81
|
-
rt: UIElement;
|
|
82
|
-
ruby: UIElement;
|
|
83
|
-
s: UIElement;
|
|
84
|
-
samp: UIElement;
|
|
85
|
-
script: UIElement;
|
|
86
|
-
section: UIElement;
|
|
87
|
-
select: UIElement;
|
|
88
|
-
small: UIElement;
|
|
89
|
-
source: UIElement;
|
|
90
|
-
span: UIElement;
|
|
91
|
-
strong: UIElement;
|
|
92
|
-
style: UIElement;
|
|
93
|
-
sub: UIElement;
|
|
94
|
-
summary: UIElement;
|
|
95
|
-
sup: UIElement;
|
|
96
|
-
table: UIElement;
|
|
97
|
-
tbody: UIElement;
|
|
98
|
-
td: UIElement;
|
|
99
|
-
template: UIElement;
|
|
100
|
-
textarea: UIElement;
|
|
101
|
-
tfoot: UIElement;
|
|
102
|
-
th: UIElement;
|
|
103
|
-
thead: UIElement;
|
|
104
|
-
time: UIElement;
|
|
105
|
-
title: UIElement;
|
|
106
|
-
tr: UIElement;
|
|
107
|
-
track: UIElement;
|
|
108
|
-
u: UIElement;
|
|
109
|
-
ul: UIElement;
|
|
110
|
-
var: UIElement;
|
|
111
|
-
video: UIElement;
|
|
112
|
-
wbr: UIElement;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
interface SvgTags {
|
|
116
|
-
svg: UIElement;
|
|
117
|
-
circle: UIElement;
|
|
118
|
-
rect: UIElement;
|
|
119
|
-
line: UIElement;
|
|
120
|
-
path: UIElement;
|
|
121
|
-
g: UIElement;
|
|
122
|
-
text: UIElement;
|
|
123
|
-
//...
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
interface MathTags {
|
|
127
|
-
math: UIElement;
|
|
128
|
-
mrow: UIElement;
|
|
129
|
-
mi: UIElement;
|
|
130
|
-
mo: UIElement;
|
|
131
|
-
mn: UIElement;
|
|
132
|
-
ms: UIElement;
|
|
133
|
-
//...
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export type Tags = HtmlTags & SvgTags & MathTags & {
|
|
137
|
-
[key: string]: UIElement;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
declare const tags: Tags;
|
|
141
|
-
|
|
142
|
-
export {
|
|
143
|
-
tags
|
|
144
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/{ui → dom}/index.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|