cradova 3.4.2 → 3.5.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.
@@ -1,9 +1,9 @@
1
- import { type browserPageType, type CradovaPageType } from "./types";
1
+ import { type browserPageType, type CradovaPageType } from "./types.js";
2
2
  /**
3
3
  * Cradova event
4
4
  */
5
5
  declare class cradovaEvent {
6
- static refid: number;
6
+ static compId: number;
7
7
  /**
8
8
  * the events runs only once and removed.
9
9
  * these event are call and removed once when when a comp is rendered to the dom
@@ -46,7 +46,6 @@ export declare class Comp<Prop extends Record<string, any> = any> {
46
46
  subData: Prop | null;
47
47
  _state: Prop[];
48
48
  _state_index: number;
49
- test?: string;
50
49
  constructor(component: (this: Comp<Prop>) => HTMLElement);
51
50
  preRender(): void;
52
51
  /**
@@ -56,7 +55,7 @@ export declare class Comp<Prop extends Record<string, any> = any> {
56
55
  * @param data
57
56
  * @returns () => HTMLElement
58
57
  */
59
- render(): any;
58
+ render(): HTMLElement;
60
59
  _effect(fn: () => Promise<void> | void): void;
61
60
  private effector;
62
61
  /**
@@ -126,13 +125,13 @@ export declare class Page {
126
125
  */
127
126
  _html: (this: Page) => HTMLElement;
128
127
  private _template;
129
- private _callBack;
130
- private _deCallBack;
131
128
  private _dropped;
132
- constructor(cradova_page_initials: CradovaPageType);
133
- onActivate(cb: () => Promise<void> | void): void;
134
- onDeactivate(cb: () => Promise<void> | void): void;
135
- _deActivate(): Promise<void>;
129
+ private _snapshot;
130
+ private _snapshot_html?;
131
+ _deCB?: () => Promise<void> | void;
132
+ constructor(pageParams: CradovaPageType);
133
+ private _takeSnapShot;
134
+ set onDeactivate(cb: () => Promise<void> | void);
136
135
  drop(state?: boolean): boolean | undefined;
137
136
  _activate(): Promise<void>;
138
137
  }
@@ -152,22 +151,14 @@ export declare class Router {
152
151
  * accepts an object containing pat and page
153
152
  */
154
153
  static BrowserRoutes(obj: Record<string, browserPageType<Page | unknown>>): void;
155
- /**
156
- Go back in Navigation history
157
- */
158
- static back(): void;
159
- /**
160
- Go forward in Navigation history
161
- */
162
- static forward(): void;
163
154
  /**
164
155
  Pause navigation
165
156
  */
166
- static pauseNaviagtion(): void;
157
+ static pauseNavigation(): void;
167
158
  /**
168
159
  resume navigation
169
160
  */
170
- static resumeNaviagtion(): void;
161
+ static resumeNavigation(): void;
171
162
  /**
172
163
  * Cradova Router
173
164
  * ------
@@ -189,13 +180,6 @@ export declare class Router {
189
180
  * @param page
190
181
  */
191
182
  static setLoadingPage(page: Page): void;
192
- /** cradova router
193
- * ---
194
- * Listen for navigation events
195
- *
196
- * @param callback () => void
197
- */
198
- static onPageEvent(callback: () => void): void;
199
183
  /**
200
184
  * Cradova Router
201
185
  * ------
@@ -1,13 +1,8 @@
1
- import { type VJS_params_TYPE } from "./types";
1
+ import { type VJS_params_TYPE } from "./types.js";
2
2
  export declare const a: (...Children_and_Properties: VJS_params_TYPE<HTMLAnchorElement>) => HTMLAnchorElement;
3
3
  export declare const audio: (...Children_and_Properties: VJS_params_TYPE<HTMLAudioElement>) => HTMLAudioElement;
4
- export declare const br: (...Children_and_Properties: VJS_params_TYPE<HTMLBRElement>) => HTMLBRElement;
5
4
  export declare const button: (...Children_and_Properties: VJS_params_TYPE<HTMLButtonElement>) => HTMLButtonElement;
6
5
  export declare const canvas: (...Children_and_Properties: VJS_params_TYPE<HTMLCanvasElement>) => HTMLCanvasElement;
7
- export declare const caption: (...Children_and_Properties: VJS_params_TYPE<HTMLTableCaptionElement>) => HTMLTableCaptionElement;
8
- export declare const datalist: (...Children_and_Properties: VJS_params_TYPE<HTMLDataListElement>) => HTMLDataListElement;
9
- export declare const details: (...Children_and_Properties: VJS_params_TYPE<HTMLDetailsElement>) => HTMLDetailsElement;
10
- export declare const dialog: (...Children_and_Properties: VJS_params_TYPE<HTMLDialogElement>) => HTMLDialogElement;
11
6
  export declare const div: (...Children_and_Properties: VJS_params_TYPE<HTMLDivElement>) => HTMLDivElement;
12
7
  export declare const footer: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
13
8
  export declare const form: (...Children_and_Properties: VJS_params_TYPE<HTMLFormElement>) => HTMLFormElement;
@@ -17,9 +12,7 @@ export declare const h3: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadin
17
12
  export declare const h4: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
18
13
  export declare const h5: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
19
14
  export declare const h6: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadingElement>) => HTMLHeadingElement;
20
- export declare const head: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>) => HTMLHeadElement;
21
15
  export declare const header: (...Children_and_Properties: VJS_params_TYPE<HTMLHeadElement>) => HTMLHeadElement;
22
- export declare const hr: (...Children_and_Properties: VJS_params_TYPE<HTMLHRElement>) => HTMLHRElement;
23
16
  export declare const i: (...Children_and_Properties: VJS_params_TYPE<HTMLLIElement>) => HTMLLIElement;
24
17
  export declare const iframe: (...Children_and_Properties: VJS_params_TYPE<HTMLIFrameElement>) => HTMLIFrameElement;
25
18
  export declare const img: (...Children_and_Properties: VJS_params_TYPE<HTMLImageElement>) => HTMLImageElement;
@@ -32,22 +25,11 @@ export declare const ol: (...Children_and_Properties: VJS_params_TYPE<HTMLOListE
32
25
  export declare const optgroup: (...Children_and_Properties: VJS_params_TYPE<HTMLOptGroupElement>) => HTMLOptGroupElement;
33
26
  export declare const option: (...Children_and_Properties: VJS_params_TYPE<HTMLOptionElement>) => HTMLOptionElement;
34
27
  export declare const p: (...Children_and_Properties: VJS_params_TYPE<HTMLParagraphElement>) => HTMLParagraphElement;
35
- export declare const progress: (...Children_and_Properties: VJS_params_TYPE<HTMLProgressElement>) => HTMLProgressElement;
36
- export declare const q: (...Children_and_Properties: VJS_params_TYPE<HTMLQuoteElement>) => HTMLQuoteElement;
37
28
  export declare const section: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
38
29
  export declare const select: (...Children_and_Properties: VJS_params_TYPE<HTMLSelectElement>) => HTMLSelectElement;
39
30
  export declare const source: (...Children_and_Properties: VJS_params_TYPE<HTMLSourceElement>) => HTMLSourceElement;
40
31
  export declare const span: (...Children_and_Properties: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
41
- export declare const strong: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
42
- export declare const summary: (...Children_and_Properties: VJS_params_TYPE<HTMLElement>) => HTMLElement;
43
- export declare const table: (...Children_and_Properties: VJS_params_TYPE<HTMLTableElement>) => HTMLTableElement;
44
- export declare const tbody: (...Children_and_Properties: VJS_params_TYPE<HTMLTableColElement>) => HTMLTableColElement;
45
- export declare const td: (...Children_and_Properties: VJS_params_TYPE<HTMLTableCellElement>) => HTMLTableCellElement;
46
32
  export declare const textarea: (...Children_and_Properties: VJS_params_TYPE<HTMLTextAreaElement>) => HTMLTextAreaElement;
47
- export declare const th: (...Children_and_Properties: VJS_params_TYPE<HTMLTableSectionElement>) => HTMLTableSectionElement;
48
- export declare const title: (...Children_and_Properties: VJS_params_TYPE<HTMLTitleElement>) => HTMLTitleElement;
49
- export declare const tr: (...Children_and_Properties: VJS_params_TYPE<HTMLTableRowElement>) => HTMLTableRowElement;
50
- export declare const u: (...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>) => HTMLUListElement;
51
33
  export declare const ul: (...Children_and_Properties: VJS_params_TYPE<HTMLUListElement>) => HTMLUListElement;
52
34
  export declare const video: (...Children_and_Properties: VJS_params_TYPE<HTMLVideoElement>) => HTMLVideoElement;
53
35
  export declare const svg: (svg: string, properties?: VJS_params_TYPE<HTMLSpanElement>) => HTMLSpanElement;
@@ -1,5 +1,5 @@
1
- import { type VJS_params_TYPE } from "./types";
2
- import { Comp } from "./classes";
1
+ import { type VJS_params_TYPE } from "./types.js";
2
+ import { Comp } from "./classes.js";
3
3
  /**
4
4
  * Cradova
5
5
  * ---
@@ -1,5 +1,5 @@
1
1
  import * as CSS from "csstype";
2
- import { Comp, Page } from "./classes";
2
+ import { Comp, Page } from "./classes.js";
3
3
  type DataAttributes = {
4
4
  [key: `data-${string}`]: string;
5
5
  };
@@ -24,13 +24,13 @@ type Attributes = {
24
24
  required?: string;
25
25
  frameBorder?: string;
26
26
  placeholder?: string;
27
- reference?: [any, string];
27
+ ref?: [any, string];
28
28
  autocomplete?: string;
29
29
  style?: CSS.Properties;
30
30
  recall?: (P: any) => void;
31
31
  onmount?: (this: HTMLElement & Attributes) => void;
32
32
  };
33
- export type VJS_params_TYPE<E extends HTMLElement> = (Comp | Comp[] | string | undefined | HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | Attributes | (() => HTMLElement) | Partial<Attributes> | Partial<E> | Record<string, (this: E) => void> | Partial<DataAttributes> | Partial<AriaAttributes> | CSS.Properties<string | number>)[];
33
+ export type VJS_params_TYPE<E extends HTMLElement> = (Comp | Comp[] | string | undefined | HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | Attributes | Partial<Attributes> | (() => HTMLElement) | Partial<E> | Record<string, (this: E) => void> | Partial<DataAttributes> | Partial<AriaAttributes> | CSS.Properties<string | number>)[];
34
34
  export interface RouterRouteObject {
35
35
  _html: ((this: Page, data?: unknown) => HTMLElement | DocumentFragment) | HTMLElement | DocumentFragment;
36
36
  _delegatedRoutes: number | boolean;
@@ -66,6 +66,16 @@ export type CradovaPageType = {
66
66
  * .
67
67
  */
68
68
  template: (this: Page) => HTMLElement;
69
+ /**
70
+ * Cradova page
71
+ * ---
72
+ * a snapshot is the initial render of a page.
73
+ * snapshot isolation allows for good SEO guarantee with the flexibility of client based rendering
74
+ * the origin server should accept post requesting to save a snapshot of this page for future use.
75
+ * the origin server should respond with the snapshot for future request to the page url
76
+ * the origin server should implement suitable mechanisms to invalidate it's caches
77
+ */
78
+ snapshotIsolation?: boolean;
69
79
  };
70
80
  export type browserPageType<importType = Page> = importType | Promise<importType> | (() => Promise<importType>);
71
81
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cradova",
3
- "version": "3.4.2",
3
+ "version": "3.5.1",
4
4
  "description": "Build Powerful ⚡ Web Apps with Ease",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -11,21 +11,18 @@
11
11
  ],
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "git+https://github.com/FridayCandour/cradova.git"
14
+ "url": "git+https://github.com/Uieddbook/cradova.git"
15
15
  },
16
16
  "scripts": {
17
17
  "compile": "bun bundle.ts",
18
- "pub:patch": " git add . && git commit -m 'new version' && bun bundle.ts && npm version patch && npm publish && git push && git push --tags",
19
18
  "lint": "eslint . --fix"
20
19
  },
21
20
  "keywords": [
22
21
  "PWA",
23
22
  "webapp",
24
- "parallel rendering",
25
- "conditionals",
26
- "prerendering",
23
+ "SPA",
27
24
  "Comps",
28
- "createSignal",
25
+ "Signal",
29
26
  "VJS",
30
27
  "vjs specification",
31
28
  "cradova"
@@ -48,25 +45,13 @@
48
45
  {
49
46
  "name": "friday candour",
50
47
  "url": "https://www.t.me/procal"
51
- },
52
- {
53
- "name": "Thomas",
54
- "url": "https://github.com/trgwii"
55
48
  }
56
49
  ],
57
50
  "license": "Apache-2.0",
58
51
  "bugs": {
59
- "url": "https://github.com/FridayCandour/cradova/issues"
60
- },
61
- "homepage": "https://github.com/FridayCandour/cradova",
62
- "devDependencies": {
63
- "@typescript-eslint/eslint-plugin": "^5.47.0",
64
- "@typescript-eslint/parser": "^5.47.0",
65
- "eslint": "^8.30.0",
66
- "eslint-config-prettier": "^8.5.0",
67
- "eslint-plugin-prettier": "^4.2.1",
68
- "prettier": "^2.8.1"
52
+ "url": "https://github.com/Uiedbook/cradova/issues"
69
53
  },
54
+ "homepage": "https://github.com/Uiedbook/cradova",
70
55
  "dependencies": {
71
56
  "csstype": "^3.1.2"
72
57
  }