ziko 0.0.5 → 0.0.7

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 (236) hide show
  1. package/README.md +171 -182
  2. package/dist/ziko.cjs +10022 -9853
  3. package/dist/ziko.js +10023 -9854
  4. package/dist/ziko.min.js +2 -2
  5. package/dist/ziko.mjs +10021 -9853
  6. package/package.json +12 -4
  7. package/starter/bin/index.js +11 -0
  8. package/wrapper/react/README.md +26 -0
  9. package/wrapper/react/index.jsx +7 -1
  10. package/wrapper/svelte/ZikoUI.svelte +15 -0
  11. package/wrapper/vue/ZikoUI.vue +8 -2
  12. package/core/App/Accessibility/index.js +0 -0
  13. package/core/App/Globals/__Target__.js +0 -3
  14. package/core/App/Globals/__UI__.js +0 -38
  15. package/core/App/Globals/__init__.js +0 -8
  16. package/core/App/Globals/index.js +0 -18
  17. package/core/App/Router/index.js +0 -40
  18. package/core/App/Seo/index.js +0 -43
  19. package/core/App/Themes/dark.js +0 -885
  20. package/core/App/Themes/index.js +0 -11
  21. package/core/App/Themes/light.js +0 -255
  22. package/core/App/app.js +0 -46
  23. package/core/App/index.js +0 -12
  24. package/core/Data/Api/fetchdom.js +0 -14
  25. package/core/Data/Api/index.js +0 -4
  26. package/core/Data/Api/preload.js +0 -11
  27. package/core/Data/Converter/canvas.js +0 -25
  28. package/core/Data/Converter/csv.js +0 -33
  29. package/core/Data/Converter/index.js +0 -25
  30. package/core/Data/Converter/json.js +0 -80
  31. package/core/Data/Converter/markdown.js +0 -83
  32. package/core/Data/Converter/svg.js +0 -11
  33. package/core/Data/Parser/markdown.js +0 -0
  34. package/core/Data/Parser/xml.js +0 -47
  35. package/core/Data/Strings/index.js +0 -26
  36. package/core/Data/decorators.js +0 -0
  37. package/core/Data/index.js +0 -64
  38. package/core/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  39. package/core/Graphics/Canvas/Elements/Basic/image.js +0 -0
  40. package/core/Graphics/Canvas/Elements/Basic/line.js +0 -26
  41. package/core/Graphics/Canvas/Elements/Basic/path.js +0 -0
  42. package/core/Graphics/Canvas/Elements/Basic/points.js +0 -48
  43. package/core/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  44. package/core/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  45. package/core/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  46. package/core/Graphics/Canvas/Elements/Basic/text.js +0 -0
  47. package/core/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  48. package/core/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  49. package/core/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  50. package/core/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  51. package/core/Graphics/Canvas/Elements/Element.js +0 -115
  52. package/core/Graphics/Canvas/Elements/Groupe.js +0 -0
  53. package/core/Graphics/Canvas/Elements/grid.js +0 -0
  54. package/core/Graphics/Canvas/Elements/index.js +0 -13
  55. package/core/Graphics/Canvas/Filter/index.js +0 -0
  56. package/core/Graphics/Canvas/Paint/index.js +0 -0
  57. package/core/Graphics/Canvas/Utils/color.js +0 -8
  58. package/core/Graphics/Canvas/Utils/floodFill.js +0 -58
  59. package/core/Graphics/Canvas/_canvas_offscreen +0 -0
  60. package/core/Graphics/Canvas/canvas.js +0 -189
  61. package/core/Graphics/Canvas/index.js +0 -15
  62. package/core/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  63. package/core/Graphics/Svg/Elements/circle.js +0 -34
  64. package/core/Graphics/Svg/Elements/ellipse.js +0 -29
  65. package/core/Graphics/Svg/Elements/foreignObject.js +0 -46
  66. package/core/Graphics/Svg/Elements/grid.js +0 -9
  67. package/core/Graphics/Svg/Elements/groupe.js +0 -29
  68. package/core/Graphics/Svg/Elements/image.js +0 -33
  69. package/core/Graphics/Svg/Elements/line.js +0 -29
  70. package/core/Graphics/Svg/Elements/path.js +0 -59
  71. package/core/Graphics/Svg/Elements/polygon.js +0 -31
  72. package/core/Graphics/Svg/Elements/polyline.js +0 -4
  73. package/core/Graphics/Svg/Elements/rect.js +0 -43
  74. package/core/Graphics/Svg/Elements/text.js +0 -26
  75. package/core/Graphics/Svg/index.js +0 -1
  76. package/core/Graphics/Svg/svg.js +0 -117
  77. package/core/Graphics/index.js +0 -61
  78. package/core/Math/Calculus/Special Functions/bessel.js +0 -31
  79. package/core/Math/Calculus/Special Functions/beta.js +0 -38
  80. package/core/Math/Calculus/Special Functions/gamma.js +0 -30
  81. package/core/Math/Calculus/Special Functions/index.js +0 -4
  82. package/core/Math/Calculus/index.js +0 -1
  83. package/core/Math/Complex/Fractals/julia.js +0 -0
  84. package/core/Math/Complex/index.js +0 -191
  85. package/core/Math/Discret/Combinaison/index.js +0 -34
  86. package/core/Math/Discret/Conversion/index.js +0 -86
  87. package/core/Math/Discret/Logic/index.js +0 -46
  88. package/core/Math/Discret/Permutation/index.js +0 -31
  89. package/core/Math/Discret/Set/index.js +0 -2
  90. package/core/Math/Discret/Set/powerSet.js +0 -15
  91. package/core/Math/Discret/Set/subSet.js +0 -10
  92. package/core/Math/Discret/index.js +0 -23
  93. package/core/Math/Functions/index.js +0 -182
  94. package/core/Math/Matrix/Decomposition.js +0 -90
  95. package/core/Math/Matrix/LinearSystem.js +0 -10
  96. package/core/Math/Matrix/Matrix.js +0 -712
  97. package/core/Math/Matrix/index.js +0 -3
  98. package/core/Math/Numeric/index.js +0 -0
  99. package/core/Math/Random/index.js +0 -173
  100. package/core/Math/Signal/__np.py.txt +0 -40
  101. package/core/Math/Signal/conv.js +0 -175
  102. package/core/Math/Signal/fft.js +0 -55
  103. package/core/Math/Signal/filter.js +0 -39
  104. package/core/Math/Signal/functions.js +0 -146
  105. package/core/Math/Signal/index.js +0 -110
  106. package/core/Math/Statistics/Functions/index.js +0 -100
  107. package/core/Math/Statistics/index.js +0 -16
  108. package/core/Math/Utils/arithmetic.js +0 -139
  109. package/core/Math/Utils/checkers.js +0 -11
  110. package/core/Math/Utils/comparaison.js +0 -1
  111. package/core/Math/Utils/conversions.js +0 -7
  112. package/core/Math/Utils/discret.js +0 -28
  113. package/core/Math/Utils/index.js +0 -102
  114. package/core/Math/Utils/mapfun.js +0 -43
  115. package/core/Math/absract.js +0 -1
  116. package/core/Math/const.js +0 -3
  117. package/core/Math/index.js +0 -193
  118. package/core/Reactivity/Events/Global/Click.js +0 -56
  119. package/core/Reactivity/Events/Global/Clipboard.js +0 -84
  120. package/core/Reactivity/Events/Global/CustomEvent.js +0 -53
  121. package/core/Reactivity/Events/Global/Drag.js +0 -137
  122. package/core/Reactivity/Events/Global/Focus.js +0 -56
  123. package/core/Reactivity/Events/Global/Key.js +0 -104
  124. package/core/Reactivity/Events/Global/Mouse.js +0 -230
  125. package/core/Reactivity/Events/Global/Pointer.js +0 -214
  126. package/core/Reactivity/Events/Global/Touch.js +0 -0
  127. package/core/Reactivity/Events/Global/Wheel.js +0 -44
  128. package/core/Reactivity/Events/Partiel/Hash.js +0 -44
  129. package/core/Reactivity/Events/Partiel/Input.js +0 -59
  130. package/core/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  131. package/core/Reactivity/Events/ZikoEvent.js +0 -91
  132. package/core/Reactivity/Events/index.js +0 -60
  133. package/core/Reactivity/Observer/index.js +0 -3
  134. package/core/Reactivity/Observer/intersection.js +0 -40
  135. package/core/Reactivity/Observer/mutation.js +0 -90
  136. package/core/Reactivity/Observer/resize.js +0 -47
  137. package/core/Reactivity/Use/Contexte/index.js +0 -1
  138. package/core/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  139. package/core/Reactivity/Use/Decorators/index.js +0 -4
  140. package/core/Reactivity/Use/Interactions/index.js +0 -4
  141. package/core/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  142. package/core/Reactivity/Use/Interactions/useChannel.js +0 -50
  143. package/core/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  144. package/core/Reactivity/Use/Interactions/useSerial.js +0 -0
  145. package/core/Reactivity/Use/Interactions/useThread.js +0 -44
  146. package/core/Reactivity/Use/Interactions/useUsb.js +0 -0
  147. package/core/Reactivity/Use/Sensors/index.js +0 -2
  148. package/core/Reactivity/Use/Sensors/useBattery.js +0 -36
  149. package/core/Reactivity/Use/Sensors/useCamera.js +0 -0
  150. package/core/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  151. package/core/Reactivity/Use/Sensors/useMicro.js +0 -0
  152. package/core/Reactivity/Use/Sensors/useOrientation.js +0 -0
  153. package/core/Reactivity/Use/Storage/index.js +0 -1
  154. package/core/Reactivity/Use/Storage/useCookie.js +0 -0
  155. package/core/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  156. package/core/Reactivity/Use/Storage/useStorage.js +0 -74
  157. package/core/Reactivity/Use/UI/index.js +0 -4
  158. package/core/Reactivity/Use/UI/useCssLink.js +0 -0
  159. package/core/Reactivity/Use/UI/useCssText.js +0 -21
  160. package/core/Reactivity/Use/UI/useFavIcon.js +0 -38
  161. package/core/Reactivity/Use/UI/useLinearGradient.js +0 -0
  162. package/core/Reactivity/Use/UI/useMediaQuery.js +0 -1
  163. package/core/Reactivity/Use/UI/useRadialGradient.js +0 -0
  164. package/core/Reactivity/Use/UI/useStyle.js +0 -54
  165. package/core/Reactivity/Use/UI/useTheme.js +0 -62
  166. package/core/Reactivity/Use/UI/useTitle.js +0 -30
  167. package/core/Reactivity/Use/index.js +0 -82
  168. package/core/Reactivity/Use/todo.md +0 -26
  169. package/core/Reactivity/index.js +0 -3
  170. package/core/Time/animation.js +0 -76
  171. package/core/Time/index.js +0 -54
  172. package/core/Time/loop.js +0 -83
  173. package/core/Time/utils/decorators.js +0 -17
  174. package/core/Time/utils/ease.js +0 -144
  175. package/core/Time/utils/index.js +0 -18
  176. package/core/Time/utils/performance.js +0 -16
  177. package/core/Time/utils/ui.js +0 -26
  178. package/core/UI/CustomElement/Elements/Accordion/index.js +0 -62
  179. package/core/UI/CustomElement/Elements/Carousel/index.js +0 -47
  180. package/core/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  181. package/core/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  182. package/core/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  183. package/core/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  184. package/core/UI/CustomElement/Elements/Columns.js +0 -1
  185. package/core/UI/CustomElement/Elements/FAB.js +0 -0
  186. package/core/UI/CustomElement/Elements/Menu.js +0 -0
  187. package/core/UI/CustomElement/Elements/Notification.js +0 -0
  188. package/core/UI/CustomElement/Elements/Popover.js +0 -0
  189. package/core/UI/CustomElement/Elements/Popup.js +0 -0
  190. package/core/UI/CustomElement/Elements/Swipper.js +0 -4
  191. package/core/UI/CustomElement/Elements/Tabs/index.js +0 -111
  192. package/core/UI/CustomElement/Elements/Timeline.js +0 -0
  193. package/core/UI/CustomElement/Elements/Toast.js +0 -0
  194. package/core/UI/CustomElement/Elements/Treeview.js +0 -0
  195. package/core/UI/CustomElement/Elements/index.js +0 -4
  196. package/core/UI/CustomElement/Flex.js +0 -97
  197. package/core/UI/CustomElement/Grid.js +0 -30
  198. package/core/UI/CustomElement/index.js +0 -3
  199. package/core/UI/Embaded/index.js +0 -1
  200. package/core/UI/Inputs/Primitives/btn.js +0 -30
  201. package/core/UI/Inputs/Primitives/elements.js +0 -28
  202. package/core/UI/Inputs/Primitives/inputs.js +0 -324
  203. package/core/UI/Inputs/Primitives/select.js +0 -14
  204. package/core/UI/Inputs/Primitives/textarea.js +0 -15
  205. package/core/UI/Inputs/camera.js +0 -23
  206. package/core/UI/Inputs/index.js +0 -20
  207. package/core/UI/List/elements.js +0 -0
  208. package/core/UI/List/index.js +0 -127
  209. package/core/UI/Media/Audio/index.js +0 -38
  210. package/core/UI/Media/Image/figure.js +0 -16
  211. package/core/UI/Media/Image/image.js +0 -33
  212. package/core/UI/Media/Image/index.js +0 -2
  213. package/core/UI/Media/Video/index.js +0 -49
  214. package/core/UI/Media/index.js +0 -3
  215. package/core/UI/Misc/index.js +0 -45
  216. package/core/UI/Semantic/index.js +0 -61
  217. package/core/UI/Style/index.js +0 -499
  218. package/core/UI/Table/elements.js +0 -94
  219. package/core/UI/Table/index.js +0 -3
  220. package/core/UI/Table/table.js +0 -112
  221. package/core/UI/Table/utils.js +0 -12
  222. package/core/UI/Text/heading.js +0 -34
  223. package/core/UI/Text/index.js +0 -3
  224. package/core/UI/Text/p.js +0 -36
  225. package/core/UI/Text/pre.js +0 -0
  226. package/core/UI/Text/text.js +0 -65
  227. package/core/UI/Utils/index.js +0 -70
  228. package/core/UI/ZikoUIElement.js +0 -503
  229. package/core/UI/index.js +0 -154
  230. package/core/__proto__/Array.js +0 -74
  231. package/core/__proto__/Function.js +0 -0
  232. package/core/__proto__/Number.js +0 -76
  233. package/core/__proto__/Object.js +0 -0
  234. package/core/__proto__/String.js +0 -0
  235. package/core/index.js +0 -72
  236. package/wrapper/react/readme.md +0 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "a versatile JavaScript library offering a rich set of UI components, advanced mathematical utilities,Reactivity,animations,client side routing and graphics capabilities",
5
5
  "keywords": [
6
6
  "Zikojs",
@@ -15,8 +15,7 @@
15
15
  "Single Page Application"
16
16
  ],
17
17
  "type": "module",
18
- "source": "core/index.js",
19
- "main": "dist/ziko.cjs",
18
+ "main": "dist/ziko.mjs",
20
19
  "module": "dist/ziko.mjs",
21
20
  "unpkg": "dist/ziko.min.js",
22
21
  "files": [
@@ -29,11 +28,20 @@
29
28
  ".": {
30
29
  "import": "./dist/ziko.mjs",
31
30
  "require": "./dist/ziko.cjs"
31
+ },
32
+ "./A": {
33
+ "import": "./src/A/index.js"
34
+ },
35
+ "./react": {
36
+ "import": "./wrapper/react/index.jsx"
32
37
  }
33
38
  },
39
+ "bin": {
40
+ "create-ziko-app": "starter/bin/index.js"
41
+ },
34
42
  "scripts": {
35
43
  "test": "node --watch test/index.js",
36
- "test-link":"node _link/index.js",
44
+ "test-link": "node _link/index.js",
37
45
  "lint": "eslint src/*/*/*",
38
46
  "dev": "rollup -c rollup.config.js -w",
39
47
  "build": "rollup -c rollup.config.js"
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import path from "path"
3
+ import { fileURLToPath } from 'node:url';
4
+ import { createFolder,copyFolder , runCommand } from "./utils/commands.js";
5
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
+ const TEMPLATE = path.join(__dirname,"../template");
7
+ const PROJECT_TITLE = process.argv[2]||"zikojs-project";
8
+ createFolder(PROJECT_TITLE);
9
+ copyFolder(TEMPLATE,path.join(process.cwd(),PROJECT_TITLE));
10
+ runCommand(`cd ${PROJECT_TITLE} && npm install`);
11
+
@@ -0,0 +1,26 @@
1
+ # Overview
2
+ react-ziko is a tool designed for rendering [ziko](https://github.com/zakarialaoui10/ziko.js) elements within a React application.
3
+
4
+ # Install
5
+ ```bash
6
+ npm i react-ziko
7
+ ```
8
+ # Usage
9
+ ```jsx
10
+ import ZikoUI from "react-ziko";
11
+ import { text } from "ziko";
12
+ const ui = text("Hello World").style({
13
+ color:"darkblue"
14
+ });
15
+ export default function App() {
16
+ return (
17
+ <main>
18
+ <ZikoUI ui={ui.render(false)} />
19
+ </main>
20
+ );
21
+ }
22
+
23
+ ```
24
+ # Dependencies
25
+ - [React](https://react.dev/) :
26
+ - [Zikojs](https://github.com/zakarialaoui10/ziko.js) :
@@ -1,9 +1,15 @@
1
1
  import React, { useRef, useEffect } from "react";
2
2
  import {ZikoUIElement} from "ziko";
3
+ /**
4
+ * A React component for rendering ZikoUIElement.
5
+ * @param {Object} props - Component props.
6
+ * @param {ZikoUIElement} props.ui - The ZikoUIElement to render.
7
+ * @returns {JSX.Element} JSX representation of the ZikoUI component.
8
+ */
3
9
  function ZikoUI({ ui }) {
4
10
  const containerRef = useRef(null);
5
11
  useEffect(() => {
6
- console.log(globalThis.__ZikoConfig__)
12
+ globalThis.__Ziko__.__Config__.setDefault({render:false})
7
13
  if (containerRef.current && ui && ui instanceof ZikoUIElement) {
8
14
  containerRef.current.innerHTML = "";
9
15
  containerRef.current.appendChild(ui.element);
@@ -0,0 +1,15 @@
1
+ <ziko-ui bind:this={containerRef} data-engine="ziko"></ziko-ui>
2
+
3
+ <script>
4
+ import { onMount } from 'svelte';
5
+ import {ZikoUIElement} from "ziko";
6
+ let containerRef;
7
+
8
+ onMount(() => {
9
+ if (containerRef && ui instanceof ZikoUIElement) {
10
+ containerRef.innerHTML = "";
11
+ containerRef.appendChild(ui.element);
12
+ }
13
+ });
14
+ export let ui;
15
+ </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div ref="containerRef" data-engine="ziko">Test</div>
2
+ <ziko-ui ref="containerRef" data-engine="ziko"></ziko-ui>
3
3
  </template>
4
4
  <script>
5
5
  import {ZikoUIElement} from "ziko"
@@ -8,10 +8,16 @@ export default {
8
8
  ui: Object
9
9
  },
10
10
  mounted() {
11
+ //globalThis.__Ziko__.__Config__.setDefault({render:false})
11
12
  if (this.$refs.containerRef && this.ui instanceof ZikoUIElement) {
12
13
  this.$refs.containerRef.innerHTML = "";
13
- this.$refs.containerRef.appendChild(this.ui.element);
14
+ this.$refs.containerRef.appendChild(this.ui.render(false).element);
14
15
  }
15
16
  }
16
17
  };
17
18
  </script>
19
+ <style scoped>
20
+ ziko-ui{
21
+ display:block;
22
+ }
23
+ </style>
File without changes
@@ -1,3 +0,0 @@
1
- var __Target__=null;
2
- if(globalThis?.document?.body)__Target__=document.body;
3
- export { __Target__}
@@ -1,38 +0,0 @@
1
- const __UI__={
2
- text:[],
3
- p:[],
4
- pre:[],
5
- h1:[],
6
- h2:[],
7
- h3:[],
8
- h4:[],
9
- h5:[],
10
- h6:[],
11
- br:[],
12
- hr:[],
13
- btn:[],
14
- ol:[],
15
- ul:[],
16
- image:[],
17
- video:[],
18
- audio:[],
19
- Article:[],
20
- Main:[],
21
- Section:[],
22
- Aside:[],
23
- Nav:[],
24
- Header:[],
25
- Footer:[],
26
- Flex:[],
27
- FlexMain:[],
28
- FlexNav:[],
29
- FlexHeader:[],
30
- FlexFooter:[],
31
- FlexSection:[],
32
- FLexArticle:[],
33
- FlexAside:[],
34
- Table:[],
35
- Svg:[],
36
- Canvas:[]
37
- }
38
- export { __UI__ };
@@ -1,8 +0,0 @@
1
- const __init__=()=>document.documentElement.setAttribute("data-engine","zikojs");
2
- // if(globalThis?.document){
3
- // document.addEventListener("DOMContentLoaded", __init__);
4
- // document.removeEventListener("DOMContentLoaded", __init__);
5
- // }
6
- export {
7
- __init__
8
- }
@@ -1,18 +0,0 @@
1
- // var __Target__=null;
2
- // if(globalThis?.document?.body)__Target__=document.body;
3
- const __ZikoConfig__={
4
- default:{
5
- target:null,
6
- render:true
7
- },
8
- setDefault:function(pairs){
9
- const keys=Object.keys(pairs);
10
- const values=Object.values(pairs);
11
- for(let i=0;i<keys.length;i++)this.default[keys[i]]=values[i];
12
- },
13
- init:()=>document.documentElement.setAttribute("data-engine","zikojs")
14
- }
15
- export * from "./__init__";
16
- export * from "./__Target__";
17
- export * from "./__UI__";
18
- export {__ZikoConfig__}
@@ -1,40 +0,0 @@
1
- import { text } from "../../UI/Text";
2
- class ZikoSPA{
3
- constructor(root_UI,routes){
4
- this.root_UI=root_UI;
5
- this.routes=new Map([
6
- [404,text("Error 404")],
7
- ...Object.entries(routes)
8
- ]);
9
- this.patterns=new Map();
10
- this.maintain();
11
- window.onpopstate = this.render(location.pathname);
12
-
13
- }
14
- get(path,wrapper){
15
- (path instanceof RegExp)
16
- ? this.patterns.set(path,wrapper)
17
- : this.routes.set(path,wrapper);
18
- this.maintain();
19
- return this;
20
- }
21
- maintain(){
22
- this.root_UI.append(...this.routes.values());
23
- [...this.routes.values()].map(n=>n.render(false));
24
- this.render(location.pathname)
25
- return this;
26
- }
27
- render(path){
28
- if(this.routes.get(path))this.routes.get(path).render(true);
29
- else{
30
- const key=[...this.patterns.keys()].find(pattern=>pattern.test(path))
31
- if(key)this.patterns.get(key)(path);
32
- else this.routes.get(404).render(true)
33
- }
34
- window.history.pushState({}, "", path);
35
- return this;
36
- }
37
- }
38
- const SPA=(root_UI,routes,patterns)=>new ZikoSPA(root_UI,routes,patterns);
39
-
40
- export {SPA}
@@ -1,43 +0,0 @@
1
- class ZikoSeo{
2
- constructor(app){
3
- this.app=app;
4
- this.meta={};
5
- this.#setMeta("generator","zikojs")
6
- }
7
- #setMeta(key,value){
8
- const meta=document.querySelector(`meta[name=${key}]`);
9
- this.meta=meta?meta:document.createElement("meta");
10
- this.meta.setAttribute("name",key);
11
- this.meta.setAttribute("content",value);
12
- if(!meta)this.app.head.append(this.meta);
13
- return this;
14
- }
15
- charset(charset="utf-8"){
16
- const meta=document.querySelector("meta[charset]");
17
- this.meta=meta?meta:document.createElement("meta");
18
- this.meta.setAttribute("charset",charset);
19
- if(!meta)this.app.head.append(this.meta);
20
- return this;
21
- }
22
- description(description){
23
- this.#setMeta("description",description);
24
- return this;
25
- }
26
- viewport(viewport="width=device-width, initial-scale=1.0"){
27
- this.#setMeta("viewport",viewport);
28
- return this;
29
- }
30
- keywords(...keywords){
31
- keywords.push("zikojs");
32
- keywords=[...new Set(keywords)].join(", ");
33
- this.#setMeta("keywords",keywords);
34
- return this;
35
- }
36
- author(name="",email=""){
37
- const author=[name,email].join(", ");
38
- this.#setMeta("author",author);
39
- return this;
40
- }
41
- }
42
- const Seo=(app)=>new ZikoSeo(app);
43
- export{Seo}