@lexriver/dome 1.5.11 → 2.0.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.
Files changed (48) hide show
  1. package/README.md +10 -4
  2. package/out/{AnimatedArray.d.ts → src/AnimatedArray.d.mts} +29 -29
  3. package/out/{AnimatedArray.js → src/AnimatedArray.mjs} +52 -51
  4. package/out/{AnimatedTable.d.ts → src/AnimatedTable.d.mts} +38 -38
  5. package/out/{AnimatedTable.js → src/AnimatedTable.mjs} +88 -91
  6. package/out/{AnimatedText.d.ts → src/AnimatedText.d.mts} +13 -13
  7. package/out/{AnimatedText.js → src/AnimatedText.mjs} +24 -24
  8. package/out/{Animation.d.ts → src/Animation.d.mts} +4 -4
  9. package/out/{temp-test.d.ts → src/Animation.mjs} +1 -1
  10. package/out/{Dome.d.ts → src/Dome.d.mts} +9 -9
  11. package/out/{Dome.js → src/Dome.mjs} +291 -295
  12. package/out/{DomeComponent.d.ts → src/DomeComponent.d.mts} +22 -19
  13. package/out/{DomeComponent.js → src/DomeComponent.mjs} +47 -44
  14. package/out/{DomeManipulator.d.ts → src/DomeManipulator.d.mts} +48 -48
  15. package/out/{DomeManipulator.js → src/DomeManipulator.mjs} +329 -329
  16. package/out/src/DomeRouter.console-test.d.mts +1 -0
  17. package/out/{DomeRouter.console-test.js → src/DomeRouter.console-test.mjs} +44 -44
  18. package/out/{DomeRouter.d.ts → src/DomeRouter.d.mts} +32 -30
  19. package/out/{DomeRouter.js → src/DomeRouter.mjs} +249 -237
  20. package/out/{LongestCommonSubsequence.d.ts → src/LongestCommonSubsequence.d.mts} +15 -15
  21. package/out/{LongestCommonSubsequence.js → src/LongestCommonSubsequence.mjs} +164 -164
  22. package/out/src/index.d.mts +11 -0
  23. package/out/src/index.mjs +11 -0
  24. package/out/src/temp-test.d.mts +1 -0
  25. package/out/{temp-test.js → src/temp-test.mjs} +20 -20
  26. package/out/vitest.config.d.ts +2 -0
  27. package/out/vitest.config.js +9 -0
  28. package/package.json +16 -14
  29. package/src/{AnimatedArray.ts → AnimatedArray.mts} +3 -3
  30. package/src/{AnimatedTable.ts → AnimatedTable.mts} +6 -6
  31. package/src/{AnimatedText.ts → AnimatedText.mts} +4 -4
  32. package/src/{Animation.ts → Animation.mts} +0 -0
  33. package/src/{Dome.ts → Dome.mts} +7 -11
  34. package/src/{DomeComponent.ts → DomeComponent.mts} +3 -3
  35. package/src/{DomeManipulator.ts → DomeManipulator.mts} +5 -5
  36. package/src/{DomeRouter.console-test.ts → DomeRouter.console-test.mts} +0 -0
  37. package/src/{DomeRouter.ts → DomeRouter.mts} +20 -6
  38. package/src/{LongestCommonSubsequence.ts → LongestCommonSubsequence.mts} +0 -0
  39. package/src/index.mts +12 -0
  40. package/src/{temp-test.ts → temp-test.mts} +1 -1
  41. package/tsconfig.json +57 -60
  42. package/vitest.config.ts +10 -0
  43. package/jest.config.js +0 -22
  44. package/out/Animation.js +0 -0
  45. package/out/DomeRouter.console-test.d.ts +0 -0
  46. package/out/index.d.ts +0 -12
  47. package/out/index.js +0 -14
  48. package/src/index.ts +0 -14
@@ -0,0 +1 @@
1
+ export {};
@@ -1,44 +1,44 @@
1
- "use strict";
2
- // //import { DomeRouter } from "./DomeRouter"
3
- // function getRouteSlices(route:string){
4
- // return route.split('/').filter(x => x.length>0)
5
- // }
6
- // function checkUrlMatchRouteAndGetParameters(url:string, route:string, exactMatch:boolean = true):Map<string,string>|undefined{
7
- // // this function is purely for export
8
- // const urlSlices = getRouteSlices(url)
9
- // const routeSlices = getRouteSlices(route)
10
- // if(exactMatch && routeSlices.length !== urlSlices.length) return undefined
11
- // // all routeSlices must match for !exactMatch
12
- // const extractedParameters = new Map<string,string>()
13
- // for(let i=0;i<routeSlices.length;i++){
14
- // let cRouteSlice = routeSlices[i]
15
- // let cUrlSlice = urlSlices[i] // could be undefined
16
- // //console.info('\t\t cRouteSlice=', cRouteSlice, 'cUrlSlice=', cUrlSlice)
17
- // if(cRouteSlice.startsWith(':')){
18
- // // we have a param name
19
- // if(cUrlSlice === undefined){
20
- // return undefined
21
- // }
22
- // // we have some variable, save it
23
- // extractedParameters.set(cRouteSlice.substring(1), cUrlSlice)
24
- // } else {
25
- // // no param name
26
- // if(cRouteSlice !== cUrlSlice){
27
- // return undefined
28
- // }
29
- // }
30
- // }
31
- // return extractedParameters
32
- // }
33
- // DomeRouter.onRoute('/', true, ()=>{ console.log('exact /')})
34
- // DomeRouter.onRoute('/', false, ()=>{ console.log('notexact /')})
35
- // DomeRouter.onRoute('/test', true, ()=>{ console.log('exact /test')})
36
- // DomeRouter.onRoute('/test/:id', true, (p)=>{ console.log('exact /test/:id', 'params=', p)})
37
- // DomeRouter.onRoute('/test/:id', false, (p)=>{ console.log('notexact /test/:id', 'params=', p)})
38
- // DomeRouter.onRoute('/test', false, ()=>{ console.log('notexact /test')})
39
- // DomeRouter.onRoute('/test/:id/:id2', true, (p)=>{ console.log('exact /test/:id/:id2', 'params=', p)})
40
- // let testRoute = '//test/34/st'
41
- // console.log('** testing route:', testRoute)
42
- // DomeRouter.execute(testRoute)
43
- // //expect(!true).toBeTruthy()
44
- //console.log(checkUrlMatchRouteAndGetParameters('/get-product/123', '/get-product/:id/:id2', false))
1
+ // //import { DomeRouter } from "./DomeRouter"
2
+ // function getRouteSlices(route:string){
3
+ // return route.split('/').filter(x => x.length>0)
4
+ // }
5
+ export {};
6
+ // function checkUrlMatchRouteAndGetParameters(url:string, route:string, exactMatch:boolean = true):Map<string,string>|undefined{
7
+ // // this function is purely for export
8
+ // const urlSlices = getRouteSlices(url)
9
+ // const routeSlices = getRouteSlices(route)
10
+ // if(exactMatch && routeSlices.length !== urlSlices.length) return undefined
11
+ // // all routeSlices must match for !exactMatch
12
+ // const extractedParameters = new Map<string,string>()
13
+ // for(let i=0;i<routeSlices.length;i++){
14
+ // let cRouteSlice = routeSlices[i]
15
+ // let cUrlSlice = urlSlices[i] // could be undefined
16
+ // //console.info('\t\t cRouteSlice=', cRouteSlice, 'cUrlSlice=', cUrlSlice)
17
+ // if(cRouteSlice.startsWith(':')){
18
+ // // we have a param name
19
+ // if(cUrlSlice === undefined){
20
+ // return undefined
21
+ // }
22
+ // // we have some variable, save it
23
+ // extractedParameters.set(cRouteSlice.substring(1), cUrlSlice)
24
+ // } else {
25
+ // // no param name
26
+ // if(cRouteSlice !== cUrlSlice){
27
+ // return undefined
28
+ // }
29
+ // }
30
+ // }
31
+ // return extractedParameters
32
+ // }
33
+ // DomeRouter.onRoute('/', true, ()=>{ console.log('exact /')})
34
+ // DomeRouter.onRoute('/', false, ()=>{ console.log('notexact /')})
35
+ // DomeRouter.onRoute('/test', true, ()=>{ console.log('exact /test')})
36
+ // DomeRouter.onRoute('/test/:id', true, (p)=>{ console.log('exact /test/:id', 'params=', p)})
37
+ // DomeRouter.onRoute('/test/:id', false, (p)=>{ console.log('notexact /test/:id', 'params=', p)})
38
+ // DomeRouter.onRoute('/test', false, ()=>{ console.log('notexact /test')})
39
+ // DomeRouter.onRoute('/test/:id/:id2', true, (p)=>{ console.log('exact /test/:id/:id2', 'params=', p)})
40
+ // let testRoute = '//test/34/st'
41
+ // console.log('** testing route:', testRoute)
42
+ // DomeRouter.execute(testRoute)
43
+ // //expect(!true).toBeTruthy()
44
+ //console.log(checkUrlMatchRouteAndGetParameters('/get-product/123', '/get-product/:id/:id2', false))
@@ -1,30 +1,32 @@
1
- export declare type RouteAction = (params: {
2
- [key: string]: string;
3
- }, url: string, scrollToPreviousPositionAsync: () => Promise<void>) => void | Promise<void>;
4
- export declare module DomeRouter {
5
- let maxHistoryUrlsCount: number;
6
- function navigate(url: string): void;
7
- function goBack(): void;
8
- function goForward(): void;
9
- function changeUrl(url: string): void;
10
- function getCurrentUrl(): string;
11
- /**
12
- * get previous page url navigated by router
13
- * @param previousPageIndex 0=previousPage, 1=previousPage-1, etc
14
- */
15
- function getPreviousPageUrl(previousPageIndex?: number): string | undefined;
16
- function resolveUrl(url?: string, addToHistory?: boolean): void;
17
- function onRoute(route: string, exactMatch: boolean, action: RouteAction): void;
18
- function onNotFound(action: () => void): void;
19
- /**
20
- * Check if url matched route.
21
- * example: /get-product/445345, /get-product/:productId, true ==> Map([productId:445345])
22
- * example: /get-product/123, /another-route, true ==> undefined
23
- * example: /articles, /articles, true ==> Map()
24
- * example: /articles/some-article, /articles, false ==> Map()
25
- * @param url
26
- * @param route
27
- * @param exactMatch
28
- */
29
- function checkUrlMatchRouteAndGetParameters(url: string, route: string, exactMatch?: boolean): Object | undefined;
30
- }
1
+ export type RouteAction = (params: {
2
+ [key: string]: string | number;
3
+ }, url: string, scrollToPreviousPositionAsync: () => Promise<void>, query: {
4
+ [key: string]: string;
5
+ }) => void | Promise<void>;
6
+ export declare namespace DomeRouter {
7
+ let maxHistoryUrlsCount: number;
8
+ function navigate(url: string): void;
9
+ function goBack(): void;
10
+ function goForward(): void;
11
+ function changeUrl(url: string): void;
12
+ function getCurrentUrl(): string;
13
+ /**
14
+ * get previous page url navigated by router
15
+ * @param previousPageIndex 0=previousPage, 1=previousPage-1, etc
16
+ */
17
+ function getPreviousPageUrl(previousPageIndex?: number): string | undefined;
18
+ function resolveUrl(url?: string, addToHistory?: boolean): void;
19
+ function onRoute(route: string, exactMatch: boolean, action: RouteAction): void;
20
+ function onNotFound(action: () => void): void;
21
+ /**
22
+ * Check if url matched route.
23
+ * example: /get-product/445345, /get-product/:productId, true ==> Map([productId:445345])
24
+ * example: /get-product/123, /another-route, true ==> undefined
25
+ * example: /articles, /articles, true ==> Map()
26
+ * example: /articles/some-article, /articles, false ==> Map()
27
+ * @param url
28
+ * @param route
29
+ * @param exactMatch
30
+ */
31
+ function checkUrlMatchRouteAndGetParameters(url: string, route: string, exactMatch?: boolean): Object | undefined;
32
+ }