ziko 0.50.2 → 0.51.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.
- package/dist/ziko.js +1515 -1398
- package/dist/ziko.mjs +1515 -1398
- package/package.json +1 -1
- package/src/__helpers__/checkers/index.js +1 -0
- package/src/data/converter/csv.js +1 -1
- package/src/events/binders/coordinates-based-event.js +25 -0
- package/src/events/binders/index.js +11 -6
- package/src/events/customizers/normalise-coordinates.js +0 -0
- package/src/events/details-setter/index.js +3 -1
- package/src/events/details-setter/mouse.js +35 -0
- package/src/events/details-setter/pointer.js +33 -31
- package/src/events/details-setter/touch.js +37 -0
- package/src/math/complex/index.js +2 -3
- package/src/math/discret/Conversion/index.js +1 -1
- package/src/math/discret/Logic/index.js +1 -1
- package/src/math/functions/index.js +8 -9
- package/src/math/matrix/helpers/det.js +36 -0
- package/src/math/matrix/helpers/index.js +3 -0
- package/src/math/matrix/helpers/inverse.js +52 -0
- package/src/math/matrix/helpers/stack.js +24 -0
- package/src/math/matrix/index.js +1 -1
- package/src/math/matrix/matrix.js +601 -0
- package/src/math/random/index.js +88 -92
- package/src/math/signal/functions.js +23 -25
- package/src/math/utils/arithmetic.js +15 -17
- package/src/math/utils/mapfun.js +3 -7
- package/src/router/file-based-router/index.js +46 -0
- package/src/router/index.js +2 -0
- package/src/router/utils/dynamic-routes-parser.js +76 -0
- package/src/router/utils/get-root.js +16 -0
- package/src/router/utils/index.js +5 -0
- package/src/router/utils/normalize-path.js +17 -0
- package/src/router/utils/routes-grouper.js +22 -0
- package/src/router/utils/routes-matcher.js +60 -0
- package/types/index.d.ts +1 -0
- package/types/router/file-based-router/index.d.ts +20 -0
- package/types/router/index.d.ts +2 -0
- package/types/router/utils/dynamic-routes-parser.d.ts +14 -0
- package/types/router/utils/get-root.d.ts +11 -0
- package/types/router/utils/index.d.ts +5 -0
- package/types/router/utils/normalize-path.d.ts +15 -0
- package/types/router/utils/routes-grouper.d.ts +29 -0
- package/types/router/utils/routes-matcher.d.ts +1 -0
- package/src/math/matrix/Matrix.js +0 -675
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// createSPAFileBasedRouter.d.ts
|
|
2
|
+
|
|
3
|
+
import { UIElement } from '../../../src/ui/constructors/UIElement.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a SPA (Single Page Application) file-based router.
|
|
7
|
+
* Automatically loads and mounts the component corresponding to the current path.
|
|
8
|
+
* Supports dynamic routes and parameter extraction.
|
|
9
|
+
*
|
|
10
|
+
* @param pages - An object mapping route paths to async module functions that return a component.
|
|
11
|
+
* Example: { "/user/[id]": () => import("./pages/user/[id].js") }
|
|
12
|
+
* @param target - Optional DOM element to mount the component. Defaults to `document.body`.
|
|
13
|
+
*/
|
|
14
|
+
export function createSPAFileBasedRouter(
|
|
15
|
+
pages: Record<
|
|
16
|
+
string,
|
|
17
|
+
() => Promise<{ default: (param? : Record<string, string>) => UIElement }>
|
|
18
|
+
>,
|
|
19
|
+
target?: HTMLElement | UIElement
|
|
20
|
+
): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// dynamic_routes_parser.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Parses a route according to a dynamic mask and returns extracted parameters.
|
|
5
|
+
*
|
|
6
|
+
* @param mask - The dynamic route mask (e.g., "/user/[id]+", "/blog/[...slug]").
|
|
7
|
+
* @param route - The actual route to parse (e.g., "/user/42", "/blog/2025/oct/post").
|
|
8
|
+
* @returns An object mapping parameter names to their corresponding values.
|
|
9
|
+
* Returns an empty object if the route does not match the mask.
|
|
10
|
+
*/
|
|
11
|
+
export declare function dynamic_routes_parser(
|
|
12
|
+
mask: string,
|
|
13
|
+
route: string
|
|
14
|
+
): Record<string, string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// get_root.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Finds the common root path among an array of paths.
|
|
5
|
+
* Dynamic segments (e.g., `[id]`) are considered as matching any segment.
|
|
6
|
+
*
|
|
7
|
+
* @param paths - An array of route paths (e.g., ["/user/42", "/user/99"]).
|
|
8
|
+
* @returns The common root path as a string (e.g., "/user/").
|
|
9
|
+
* Returns an empty string if no common root exists.
|
|
10
|
+
*/
|
|
11
|
+
export declare function get_root(paths: string[]): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// normalize_path.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Normalizes a file path into a route path.
|
|
5
|
+
*
|
|
6
|
+
* @param inputPath - The file path to normalize (e.g., "./src/pages/user/[id].ts").
|
|
7
|
+
* @param root - The root directory to consider as the base (default: "./src/pages").
|
|
8
|
+
* @param extensions - Array of valid file extensions (default: ["js", "ts"]).
|
|
9
|
+
* @returns A normalized route path (e.g., "/user/[id]") or an empty string if it cannot be normalized.
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalize_path(
|
|
12
|
+
inputPath: string,
|
|
13
|
+
root?: string,
|
|
14
|
+
extensions?: string[]
|
|
15
|
+
): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// routes_utils.d.ts
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a route path is dynamic.
|
|
5
|
+
* Dynamic segments include:
|
|
6
|
+
* - Parameters like "[id]"
|
|
7
|
+
* - Catch-all segments like "[...slug]"
|
|
8
|
+
* - Optional segments like "[id]+"
|
|
9
|
+
*
|
|
10
|
+
* @param path - The route path to check.
|
|
11
|
+
* @returns `true` if the path is dynamic, otherwise `false`.
|
|
12
|
+
*/
|
|
13
|
+
export function is_dynamic(path: string): boolean;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Groups routes into static and dynamic categories.
|
|
17
|
+
* Throws an error if an optional parameter appears anywhere but the end of the path.
|
|
18
|
+
*
|
|
19
|
+
* @param routeMap - An object mapping route paths to their handlers/values.
|
|
20
|
+
* @returns An object with two properties:
|
|
21
|
+
* - `static`: Routes with no dynamic segments.
|
|
22
|
+
* - `dynamic`: Routes with dynamic segments.
|
|
23
|
+
*/
|
|
24
|
+
export function routes_grouper<T>(
|
|
25
|
+
routeMap: Record<string, T>
|
|
26
|
+
): {
|
|
27
|
+
static: Record<string, T>;
|
|
28
|
+
dynamic: Record<string, T>;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function routes_matcher(mask: string, route: string): boolean;
|