ziko 0.0.28 → 0.0.30

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 (52) hide show
  1. package/dist/ziko.cjs +18 -174
  2. package/dist/ziko.js +18 -174
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +18 -173
  5. package/package.json +24 -3
  6. package/src/__helpers__/index.js +6 -6
  7. package/src/app/index.js +10 -10
  8. package/src/app/json-style-sheet.js +1 -1
  9. package/src/app/routes.js +0 -1
  10. package/src/app/spa-file-based-routing.js +2 -2
  11. package/src/app/spa.js +3 -3
  12. package/src/app/ziko-app.js +1 -1
  13. package/src/{reactivity/events-exp → events}/__ZikoEvent__.js +4 -3
  14. package/src/{reactivity/events-exp → events}/click.js +2 -3
  15. package/src/events/clipboard.js +16 -0
  16. package/src/events/custom-event.js +0 -0
  17. package/src/events/drag.js +16 -0
  18. package/src/events/focus.js +16 -0
  19. package/src/events/hash.js +16 -0
  20. package/src/events/index.d.ts +3 -0
  21. package/src/events/index.js +15 -0
  22. package/src/{reactivity/events-exp → events}/key.js +2 -2
  23. package/src/events/mouse.js +16 -0
  24. package/src/{reactivity/events-exp → events}/pointer.js +3 -4
  25. package/src/events/touch.js +16 -0
  26. package/src/events/types/__Shared__.d.ts +148 -0
  27. package/src/events/types/clipboard.d.ts +20 -0
  28. package/src/events/types/focus.d.ts +19 -0
  29. package/src/events/types/pointer.d.ts +45 -0
  30. package/src/events/wheel.js +16 -0
  31. package/src/index.js +14 -14
  32. package/src/reactivity/index.js +0 -3
  33. package/src/ui/elements/embaded/html.js +1 -1
  34. package/src/ui/elements/embaded/youtube.js +2 -2
  35. package/src/ui/elements/grid/index.js +1 -1
  36. package/src/ui/index.js +21 -19
  37. package/src/ui/tags/index.d.ts +144 -0
  38. package/src/ui/tags/index.js +21 -0
  39. package/src/_global (To Be Removed )/_themes/dark.js +0 -885
  40. package/src/_global (To Be Removed )/_themes/index.js +0 -11
  41. package/src/_global (To Be Removed )/_themes/light.js +0 -255
  42. package/src/_global (To Be Removed )/app/index.js +0 -46
  43. package/src/_global (To Be Removed )/component/index.js +0 -38
  44. package/src/_global (To Be Removed )/globals/index.js +0 -20
  45. package/src/_global (To Be Removed )/index.js +0 -4
  46. package/src/_global (To Be Removed )/params/index.js +0 -40
  47. package/src/_global (To Be Removed )/router/index.js +0 -67
  48. package/src/_global (To Be Removed )/seo/index.js +0 -43
  49. package/src/_global (To Be Removed )/style/index.js +0 -1
  50. package/src/reactivity/events-exp/index.js +0 -5
  51. /package/src/{reactivity/events-exp → events}/__Events__.js +0 -0
  52. /package/src/{reactivity/events-exp → events}/utils.js +0 -0
@@ -0,0 +1,148 @@
1
+ export type EventCustomizer = ((this: __ZikoEvent__) => void) | ((ctx: __ZikoEvent__) => void);
2
+
3
+ export type EventMethodesBinder<
4
+ EventKeys extends string,
5
+ InstanceType
6
+ > = {
7
+ [K in EventKeys as `on${K}`]: (...callbacks: ((ctx: InstanceType) => void)[]) => InstanceType
8
+ };
9
+
10
+ export type Callback<InstanceType> = (ctx: InstanceType) => void;
11
+
12
+ export interface ZikoEventStream {
13
+ enabled: Record<string, boolean>;
14
+ clear: Record<string, boolean>;
15
+ history: Record<string, any[]>;
16
+ t0?: number;
17
+ }
18
+
19
+ export interface ZikoEventCache {
20
+ currentEvent: string | null;
21
+ event: Event | null;
22
+ options: Record<string, AddEventListenerOptions>;
23
+ preventDefault: Record<string, boolean>;
24
+ stopPropagation: Record<string, boolean>;
25
+ stopImmediatePropagation: Record<string, boolean>;
26
+ event_flow: Record<string, unknown>;
27
+ paused: Record<string, boolean>;
28
+ stream: ZikoEventStream;
29
+ callbacks: Record<string, ((e: any) => void)[]>;
30
+ __controllers__: Record<string, (e: Event) => void>;
31
+ }
32
+
33
+ export declare class __ZikoEvent__ {
34
+ constructor(
35
+ target: any,
36
+ Events: string[],
37
+ details_setter?: (this: __ZikoEvent__) => void,
38
+ customizer?: EventCustomizer
39
+ );
40
+
41
+ target: any;
42
+ cache: ZikoEventCache;
43
+
44
+ get targetElement(): HTMLElement | null;
45
+ get isParent(): boolean;
46
+ get item(): any;
47
+ get currentEvent(): string | null;
48
+ get event(): Event | null;
49
+
50
+ setTarget(UI: any): this;
51
+
52
+ preventDefault(
53
+ overrides?: Partial<Record<string, boolean>>,
54
+ defaultValue?: boolean | "default"
55
+ ): this;
56
+
57
+ stopPropagation(
58
+ overrides?: Partial<Record<string, boolean>>,
59
+ defaultValue?: boolean | "default"
60
+ ): this;
61
+
62
+ stopImmediatePropagation(
63
+ overrides?: Partial<Record<string, boolean>>,
64
+ defaultValue?: boolean | "default"
65
+ ): this;
66
+
67
+ setEventOptions(
68
+ event: string,
69
+ options: AddEventListenerOptions
70
+ ): this;
71
+
72
+ pause(
73
+ overrides?: Partial<Record<string, boolean>>,
74
+ defaultValue?: boolean | "default"
75
+ ): this;
76
+
77
+ resume(
78
+ overrides?: Partial<Record<string, boolean>>,
79
+ defaultValue?: boolean | "default"
80
+ ): this;
81
+
82
+ stream(
83
+ overrides?: Partial<Record<string, boolean>>,
84
+ defaultValue?: boolean | "default"
85
+ ): this;
86
+
87
+ clear(): this;
88
+
89
+ dispose(
90
+ overrides?: Partial<Record<string, boolean>>,
91
+ defaultValue?: boolean | "default"
92
+ ): this;
93
+
94
+ // Internal
95
+ protected __handle(
96
+ event: string,
97
+ handler: EventListenerOrEventListenerObject,
98
+ options?: AddEventListenerOptions,
99
+ dispose?: any
100
+ ): this;
101
+
102
+ protected __onEvent(
103
+ event: string,
104
+ options?: AddEventListenerOptions,
105
+ dispose?: any,
106
+ ...callbacks: ((ctx: this) => void)[]
107
+ ): this;
108
+ }
109
+ // export type ClickEventKeys =
110
+ // | 'Click'
111
+ // | 'DblClick';
112
+
113
+ // export type PointerEventKeys =
114
+ // | 'PtrMove'
115
+ // | 'PtrDown'
116
+ // | 'PtrUp'
117
+ // | 'PtrLeave'
118
+ // | 'PtrEnter'
119
+ // | 'PtrOut'
120
+ // | 'PtrCancel'
121
+
122
+ // export type MouseEventKeys =
123
+ // | 'MouseMove'
124
+ // | 'MouseDown';
125
+ // export type TouchEventKeys =
126
+ // | 'ToucMove'
127
+ // | 'ToucDown';
128
+ // export type KeyEventKeys =
129
+ // | 'keyDown'
130
+ // | 'keyPress'
131
+ // | 'keyUs';
132
+ // export type ClipboardEventKeys =
133
+ // | 'Copy'
134
+ // | 'Cut'
135
+ // | 'Paste';
136
+ // export type FocusEventKeys =
137
+ // | 'focus'
138
+ // | 'blur';
139
+ // export type DragEventKeys =
140
+ // | 'Drag'
141
+ // | 'DragStart'
142
+ // | 'DragEnd'
143
+ // | 'Drop';
144
+ // export type MediaEventKeys =
145
+ // | '__';
146
+ // export type HashEventKeys =
147
+ // | 'HashChange'
148
+
@@ -0,0 +1,20 @@
1
+ import { __ZikoEvent__ } from "../__ZikoEvent__.js";
2
+ import type { Callback, ClipboardEventKeys } from './__Shared__.js';
3
+ import { ZikoUIElement } from "../../ui/index.js";
4
+
5
+ declare class ZikoEventClipboard extends __ZikoEvent__ {
6
+ constructor(target: any, customizer?: Function);
7
+
8
+ // Explicitly declare the dynamic methods to get editor support
9
+ onCopy(...callbacks: Callback<ZikoEventClipboard>[]): this;
10
+ onCut(...callbacks: Callback<ZikoEventClipboard>[]): this;
11
+ onPaste(...callbacks: Callback<ZikoEventClipboard>[]): this;
12
+
13
+ }
14
+
15
+ declare const bindClipboardEvent: (target: ZikoUIElement, customizer?: Function) => ZikoEventClipboard;
16
+
17
+ export {
18
+ ZikoEventClipboard,
19
+ bindClipboardEvent,
20
+ };
@@ -0,0 +1,19 @@
1
+ import { __ZikoEvent__ } from "../__ZikoEvent__.js";
2
+ import type { Callback } from './__Shared__.js';
3
+ import { ZikoUIElement } from "../../ui/index.js";
4
+
5
+ declare class ZikoEventFocus extends __ZikoEvent__ {
6
+ constructor(target: any, customizer?: Function);
7
+
8
+ // Explicitly declare the dynamic methods to get editor support
9
+ onFocus(...callbacks: Callback<ZikoEventFocus>[]): this;
10
+ onBlur(...callbacks: Callback<ZikoEventFocus>[]): this;
11
+
12
+ }
13
+
14
+ declare const bindFocusEvent: (target: ZikoUIElement, customizer?: Function) => ZikoEventFocus;
15
+
16
+ export {
17
+ ZikoEventFocus,
18
+ bindFocusEvent,
19
+ };
@@ -0,0 +1,45 @@
1
+ import { __ZikoEvent__ } from "../__ZikoEvent__.js";
2
+ import type { EventMethodesBinder, Callback, PointerEventKeys } from './__Shared__.js';
3
+ import { ZikoUIElement } from "../../ui/index.js";
4
+
5
+ type PointerEventMethodesBinder = EventMethodesBinder<PointerEventKeys, ZikoEventPointer>;
6
+
7
+ declare class ZikoEventPointer extends __ZikoEvent__ implements PointerEventMethodesBinder {
8
+ constructor(target: any, customizer?: Function);
9
+
10
+ isDown: boolean;
11
+
12
+ dx?: number;
13
+ dy?: number;
14
+
15
+ mx?: number;
16
+ my?: number;
17
+ isMoving?: boolean;
18
+
19
+ ux?: number;
20
+ uy?: number;
21
+
22
+ swippe?: {
23
+ h: "left" | "right" | "none";
24
+ v: "top" | "bottom" | "none";
25
+ delta_x: number;
26
+ delta_y: number;
27
+ };
28
+
29
+ // Explicitly declare the dynamic methods to get editor support
30
+ onPtrMove(...callbacks: Callback<ZikoEventPointer>[]): this;
31
+ onPtrDown(...callbacks: Callback<ZikoEventPointer>[]): this;
32
+ onPtrUp(...callbacks: Callback<ZikoEventPointer>[]): this;
33
+ onPtrLeave(...callbacks: Callback<ZikoEventPointer>[]): this;
34
+ onPtrEnter(...callbacks: Callback<ZikoEventPointer>[]): this;
35
+ onPtrOut(...callbacks: Callback<ZikoEventPointer>[]): this;
36
+ onPtrCancel(...callbacks: Callback<ZikoEventPointer>[]): this;
37
+
38
+ }
39
+
40
+ declare const bindPointerEvent: (target: ZikoUIElement, customizer?: Function) => ZikoEventPointer;
41
+
42
+ export {
43
+ ZikoEventPointer,
44
+ bindPointerEvent,
45
+ };
@@ -0,0 +1,16 @@
1
+ import { __ZikoEvent__ } from "./__ZikoEvent__.js";
2
+ import { Events } from "./__Events__.js";
3
+ class ZikoEventWheel extends __ZikoEvent__{
4
+ constructor(target, customizer){
5
+ super(target, Events.Wheel, details_setter, customizer)
6
+ }
7
+ }
8
+ function details_setter(){
9
+
10
+ }
11
+ const bindWheelEvent = (target, customizer) => new ZikoEventWheel(target, customizer)
12
+
13
+ export{
14
+ bindWheelEvent,
15
+ ZikoEventWheel
16
+ }
package/src/index.js CHANGED
@@ -1,19 +1,19 @@
1
- import { __ExtractAll__,__RemoveAll__ } from "./__helpers__";
2
- import Math from "./math";
3
- import UI from "./ui";
4
- import Time from "./time";
5
- import Data from "./data";
6
- import Reactivity from "./reactivity";
7
- import Graphics from "./graphics";
1
+ import { __ExtractAll__,__RemoveAll__ } from "./__helpers__/index.js";
2
+ import Math from "./math/index.js";
3
+ import UI from "./ui/index.js";
4
+ import Time from "./time/index.js";
5
+ import Data from "./data/index.js";
6
+ import Reactivity from "./reactivity/index.js";
7
+ import Graphics from "./graphics/index.js";
8
8
  import App,{__UI__,__HYDRATION_MAP__, __Config__, __CACHE__, defineParamsGetter} from "./app";
9
9
 
10
- export * from "./math";
11
- export * from "./ui";
12
- export * from "./time";
13
- export * from "./data";
14
- export * from "./reactivity"
15
- export * from "./graphics";
16
- export * from "./app";
10
+ export * from "./math/index.js";
11
+ export * from "./ui/index.js";
12
+ export * from "./time/index.js";
13
+ export * from "./data/index.js";
14
+ export * from "./reactivity/index.js"
15
+ export * from "./graphics/index.js";
16
+ export * from "./app/index.js";
17
17
 
18
18
  [
19
19
  App,
@@ -1,15 +1,12 @@
1
1
  import * as Events from "./events";
2
2
  import * as Observer from "./observer"
3
3
  import * as Hooks from "./hooks"
4
- import * as EventsExp from "./events-exp"
5
4
  const Reactivity={
6
5
  ...Events,
7
6
  ...Observer,
8
7
  ...Hooks,
9
- ...EventsExp,
10
8
  }
11
9
  export * from "./events";
12
10
  export * from "./observer";
13
11
  export * from "./hooks";
14
- export * from "./events-exp";
15
12
  export default Reactivity;
@@ -1,4 +1,4 @@
1
- import ZikoUIElement from "../ZikoUIElement";
1
+ import ZikoUIElement from "../ZikoUIElement.js";
2
2
 
3
3
  class ZikoUIHtmlViewer extends ZikoUIElement{
4
4
  constructor(src, title){
@@ -1,5 +1,5 @@
1
- import ZikoUIElement from "../ZikoUIElement";
2
- import { Str } from "../../../../data";
1
+ import ZikoUIElement from "../ZikoUIElement.js";
2
+ import { Str } from "../../../../data.js";
3
3
  class ZikoUIYoutubePlayer extends ZikoUIElement{
4
4
  constructor(src, title){
5
5
  super("iframe", "YoutubePlayer");
@@ -1,4 +1,4 @@
1
- import ZikoUIElement from "../ZikoUIElement"
1
+ import ZikoUIElement from "../ZikoUIElement.js"
2
2
  class ZikoUIGrid extends ZikoUIElement {
3
3
  constructor(tag ="div", w = "50vw", h = "50vh") {
4
4
  super(tag,"Grid");
package/src/ui/index.js CHANGED
@@ -1,24 +1,26 @@
1
- export * from "./elements/text";
2
- export * from "./elements/list";
3
- export * from "./elements/io";
4
- export * from "./elements/media";
5
- export * from "./elements/table";
6
- export * from "./elements/semantic";
7
- export * from "./elements/misc";
8
- export * from "./elements/flex";
9
- export * from "./elements/grid";
1
+ export * from "./elements/text/index.js";
2
+ export * from "./elements/list/index.js";
3
+ export * from "./elements/io/index.js";
4
+ export * from "./elements/media/index.js";
5
+ export * from "./elements/table/index.js";
6
+ export * from "./elements/semantic/index.js";
7
+ export * from "./elements/misc/index.js";
8
+ export * from "./elements/flex/index.js";
9
+ export * from "./elements/grid/index.js";
10
+ export * from "./tags/index.js"
10
11
 
11
- import * as Text from "./elements/text";
12
- import * as List from "./elements/list";
13
- import * as Io from "./elements/io";
14
- import * as Media from "./elements/media";
15
- import * as Table from "./elements/table";
16
- import * as Semantic from "./elements/semantic";
17
- import * as Misc from "./elements/misc";
18
- import * as Flex from "./elements/flex";
19
- import * as Grid from "./elements/grid";
12
+ import * as Text from "./elements/text/index.js";
13
+ import * as List from "./elements/list/index.js";
14
+ import * as Io from "./elements/io/index.js";
15
+ import * as Media from "./elements/media/index.js";
16
+ import * as Table from "./elements/table/index.js";
17
+ import * as Semantic from "./elements/semantic/index.js";
18
+ import * as Misc from "./elements/misc/index.js";
19
+ import * as Flex from "./elements/flex/index.js";
20
+ import * as Grid from "./elements/grid/index.js";
20
21
 
21
- import ZikoUIElement from "./elements/ZikoUIElement";
22
+
23
+ import ZikoUIElement from "./elements/ZikoUIElement.js";
22
24
 
23
25
  export{
24
26
  ZikoUIElement
@@ -0,0 +1,144 @@
1
+ import ZikoUIElement from "../elements/ZikoUIElement.js";
2
+ interface HtmlTags {
3
+ a: ZikoUIElement;
4
+ abbr: ZikoUIElement;
5
+ address: ZikoUIElement;
6
+ area: ZikoUIElement;
7
+ article: ZikoUIElement;
8
+ aside: ZikoUIElement;
9
+ audio: ZikoUIElement;
10
+ b: ZikoUIElement;
11
+ base: ZikoUIElement;
12
+ bdi: ZikoUIElement;
13
+ bdo: ZikoUIElement;
14
+ blockquote: ZikoUIElement;
15
+ body: ZikoUIElement;
16
+ br: ZikoUIElement;
17
+ button: ZikoUIElement;
18
+ canvas: ZikoUIElement;
19
+ caption: ZikoUIElement;
20
+ cite: ZikoUIElement;
21
+ code: ZikoUIElement;
22
+ col: ZikoUIElement;
23
+ colgroup: ZikoUIElement;
24
+ data: ZikoUIElement;
25
+ datalist: ZikoUIElement;
26
+ dd: ZikoUIElement;
27
+ del: ZikoUIElement;
28
+ details: ZikoUIElement;
29
+ dfn: ZikoUIElement;
30
+ dialog: ZikoUIElement;
31
+ div: ZikoUIElement;
32
+ dl: ZikoUIElement;
33
+ dt: ZikoUIElement;
34
+ em: ZikoUIElement;
35
+ embed: ZikoUIElement;
36
+ fieldset: ZikoUIElement;
37
+ figcaption: ZikoUIElement;
38
+ figure: ZikoUIElement;
39
+ footer: ZikoUIElement;
40
+ form: ZikoUIElement;
41
+ h1: ZikoUIElement;
42
+ h2: ZikoUIElement;
43
+ h3: ZikoUIElement;
44
+ h4: ZikoUIElement;
45
+ h5: ZikoUIElement;
46
+ h6: ZikoUIElement;
47
+ head: ZikoUIElement;
48
+ header: ZikoUIElement;
49
+ hgroup: ZikoUIElement;
50
+ hr: ZikoUIElement;
51
+ html: ZikoUIElement;
52
+ i: ZikoUIElement;
53
+ iframe: ZikoUIElement;
54
+ img: ZikoUIElement;
55
+ input: ZikoUIElement;
56
+ ins: ZikoUIElement;
57
+ kbd: ZikoUIElement;
58
+ label: ZikoUIElement;
59
+ legend: ZikoUIElement;
60
+ li: ZikoUIElement;
61
+ link: ZikoUIElement;
62
+ main: ZikoUIElement;
63
+ map: ZikoUIElement;
64
+ mark: ZikoUIElement;
65
+ meta: ZikoUIElement;
66
+ meter: ZikoUIElement;
67
+ nav: ZikoUIElement;
68
+ noscript: ZikoUIElement;
69
+ object: ZikoUIElement;
70
+ ol: ZikoUIElement;
71
+ optgroup: ZikoUIElement;
72
+ option: ZikoUIElement;
73
+ output: ZikoUIElement;
74
+ p: ZikoUIElement;
75
+ param: ZikoUIElement;
76
+ picture: ZikoUIElement;
77
+ pre: ZikoUIElement;
78
+ progress: ZikoUIElement;
79
+ q: ZikoUIElement;
80
+ rp: ZikoUIElement;
81
+ rt: ZikoUIElement;
82
+ ruby: ZikoUIElement;
83
+ s: ZikoUIElement;
84
+ samp: ZikoUIElement;
85
+ script: ZikoUIElement;
86
+ section: ZikoUIElement;
87
+ select: ZikoUIElement;
88
+ small: ZikoUIElement;
89
+ source: ZikoUIElement;
90
+ span: ZikoUIElement;
91
+ strong: ZikoUIElement;
92
+ style: ZikoUIElement;
93
+ sub: ZikoUIElement;
94
+ summary: ZikoUIElement;
95
+ sup: ZikoUIElement;
96
+ table: ZikoUIElement;
97
+ tbody: ZikoUIElement;
98
+ td: ZikoUIElement;
99
+ template: ZikoUIElement;
100
+ textarea: ZikoUIElement;
101
+ tfoot: ZikoUIElement;
102
+ th: ZikoUIElement;
103
+ thead: ZikoUIElement;
104
+ time: ZikoUIElement;
105
+ title: ZikoUIElement;
106
+ tr: ZikoUIElement;
107
+ track: ZikoUIElement;
108
+ u: ZikoUIElement;
109
+ ul: ZikoUIElement;
110
+ var: ZikoUIElement;
111
+ video: ZikoUIElement;
112
+ wbr: ZikoUIElement;
113
+ }
114
+
115
+ interface SvgTags {
116
+ svg: ZikoUIElement;
117
+ circle: ZikoUIElement;
118
+ rect: ZikoUIElement;
119
+ line: ZikoUIElement;
120
+ path: ZikoUIElement;
121
+ g: ZikoUIElement;
122
+ text: ZikoUIElement;
123
+ //...
124
+ }
125
+
126
+ interface MathTags {
127
+ math: ZikoUIElement;
128
+ mrow: ZikoUIElement;
129
+ mi: ZikoUIElement;
130
+ mo: ZikoUIElement;
131
+ mn: ZikoUIElement;
132
+ ms: ZikoUIElement;
133
+ //...
134
+ }
135
+
136
+ export type Tags = HtmlTags & SvgTags & MathTags & {
137
+ [key: string]: ZikoUIElement;
138
+ };
139
+
140
+ declare const tags: Tags;
141
+
142
+ export {
143
+ tags
144
+ };
@@ -0,0 +1,21 @@
1
+ import ZikoUIElement from "../elements/ZikoUIElement.js";
2
+ const tags = new Proxy({}, {
3
+ get(target, prop) {
4
+ if (typeof prop !== 'string') return undefined;
5
+ let tag = prop.replaceAll("_","-").toLowerCase();
6
+ switch(tag){
7
+ case "html" : globalThis?.document?.createElement("html")
8
+ case "head" :
9
+ case "style" :
10
+ case "link" :
11
+ case "meta" :
12
+ case "srcipt":
13
+ case "body" : return null; break;
14
+ default : return new ZikoUIElement(tag);
15
+ }
16
+ }
17
+ });
18
+
19
+ export {
20
+ tags
21
+ }