@plurid/plurid-engine 0.0.0-1 → 0.0.0-12
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/distribution/functions/index.d.ts +2 -0
- package/distribution/functions/navigate/index.d.ts +1 -0
- package/distribution/functions/template/index.d.ts +1 -0
- package/distribution/index.d.ts +2 -2
- package/distribution/index.es.js +893 -858
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +876 -851
- package/distribution/index.js.map +1 -1
- package/distribution/modules/general/configuration/index.d.ts +2 -0
- package/distribution/modules/general/index.d.ts +3 -0
- package/distribution/modules/{setup/general → general}/tree/index.d.ts +1 -1
- package/distribution/modules/index.d.ts +9 -12
- package/distribution/modules/interaction/direction/index.d.ts +1 -1
- package/distribution/modules/interaction/index.d.ts +5 -0
- package/distribution/modules/interaction/mathematics/transform/general/index.d.ts +9 -0
- package/distribution/modules/interaction/mathematics/transform/index.d.ts +3 -69
- package/distribution/modules/interaction/mathematics/transform/matrix3d/index.d.ts +69 -0
- package/distribution/modules/{setup/internationalization → internationalization}/index.d.ts +0 -0
- package/distribution/modules/planes/index.d.ts +2 -0
- package/distribution/modules/planes/logic/index.d.ts +6 -0
- package/distribution/modules/planes/registrar/index.d.ts +3 -0
- package/distribution/modules/{setup/objects/PlanesRegistrar → planes/registrar}/object.d.ts +6 -5
- package/distribution/modules/planes/registrar/utilities.d.ts +6 -0
- package/distribution/modules/routing/IsoMatcher/index.d.ts +44 -0
- package/distribution/modules/{setup/router → routing}/Parser/index.d.ts +4 -4
- package/distribution/modules/{setup/router → routing}/Parser/interfaces.d.ts +10 -2
- package/distribution/modules/{setup/router → routing}/Parser/logic.d.ts +2 -2
- package/distribution/modules/routing/index.d.ts +6 -0
- package/distribution/modules/routing/logic/general/index.d.ts +8 -0
- package/distribution/modules/routing/logic/index.d.ts +3 -0
- package/distribution/modules/{setup/router → routing/logic}/utilities/index.d.ts +11 -2
- package/distribution/modules/routing/logic/validity/index.d.ts +3 -0
- package/distribution/modules/space/index.d.ts +6 -0
- package/distribution/modules/{setup/space → space}/layout/column.d.ts +1 -1
- package/distribution/modules/{setup/space → space}/layout/faceToFace.d.ts +0 -0
- package/distribution/modules/space/layout/index.d.ts +6 -0
- package/distribution/modules/{setup/space → space}/layout/row.d.ts +1 -1
- package/distribution/modules/{setup/space → space}/layout/sheaves.d.ts +0 -0
- package/distribution/modules/{setup/space → space}/layout/zigZag.d.ts +0 -0
- package/distribution/modules/{setup/space → space}/location/index.d.ts +1 -1
- package/distribution/modules/{setup/space → space}/location/logic.d.ts +1 -1
- package/distribution/modules/space/tree/index.d.ts +3 -0
- package/distribution/modules/space/tree/logic.d.ts +37 -0
- package/distribution/modules/space/tree/object.d.ts +14 -0
- package/distribution/modules/{setup/space → space}/utilities/index.d.ts +0 -0
- package/distribution/modules/{setup/space → space}/view/index.d.ts +1 -1
- package/distribution/modules/{setup/space → space}/view/logic.d.ts +0 -0
- package/distribution/modules/state/compute/index.d.ts +3 -0
- package/distribution/modules/state/compute/space/index.d.ts +3 -0
- package/distribution/modules/{setup/state → state}/compute/themes/index.d.ts +0 -0
- package/distribution/modules/state/index.d.ts +3 -0
- package/distribution/modules/{setup/state → state}/local/index.d.ts +0 -0
- package/package.json +31 -31
- package/distribution/data/constants/index.d.ts +0 -1
- package/distribution/data/interfaces/index.d.ts +0 -4
- package/distribution/modules/setup/general/configuration/index.d.ts +0 -2
- package/distribution/modules/setup/general/helpers/identified.d.ts +0 -1
- package/distribution/modules/setup/general/helpers/index.d.ts +0 -2
- package/distribution/modules/setup/general/helpers/indexed.d.ts +0 -6
- package/distribution/modules/setup/general/index.d.ts +0 -7
- package/distribution/modules/setup/general/paths/index.d.ts +0 -8
- package/distribution/modules/setup/general/planes/index.d.ts +0 -4
- package/distribution/modules/setup/general/universes/index.d.ts +0 -21
- package/distribution/modules/setup/objects/PlanesRegistrar/index.d.ts +0 -3
- package/distribution/modules/setup/objects/PlanesRegistrar/utilities.d.ts +0 -6
- package/distribution/modules/setup/router/Matcher/index.d.ts +0 -15
- package/distribution/modules/setup/router/Matcher/interfaces.d.ts +0 -12
- package/distribution/modules/setup/router/Matcher/logic.d.ts +0 -4
- package/distribution/modules/setup/router/Router/index.d.ts +0 -28
- package/distribution/modules/setup/router/Router/interfaces.d.ts +0 -8
- package/distribution/modules/setup/router/URLRouter/data.d.ts +0 -27
- package/distribution/modules/setup/router/URLRouter/index.d.ts +0 -8
- package/distribution/modules/setup/router/URLRouter/logic.d.ts +0 -12
- package/distribution/modules/setup/router/index.d.ts +0 -11
- package/distribution/modules/setup/router/interfaces.d.ts +0 -3
- package/distribution/modules/setup/space/index.d.ts +0 -6
- package/distribution/modules/setup/space/layout/index.d.ts +0 -6
- package/distribution/modules/setup/space/tree/index.d.ts +0 -3
- package/distribution/modules/setup/space/tree/logic.d.ts +0 -33
- package/distribution/modules/setup/space/tree/object.d.ts +0 -13
- package/distribution/modules/setup/state/compute/index.d.ts +0 -3
- package/distribution/modules/setup/state/compute/space/index.d.ts +0 -3
- package/distribution/modules/setup/state/index.d.ts +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
/** interfaces */
|
|
3
3
|
PluridInternalContextPlane, PluridInternalStatePlane, TreePlane, LinkCoordinates } from '@plurid/plurid-data';
|
|
4
|
-
export declare const createTreePlane: (contextPlane: PluridInternalContextPlane
|
|
4
|
+
export declare const createTreePlane: <C>(contextPlane: PluridInternalContextPlane<C>, documentPlane: PluridInternalStatePlane) => TreePlane;
|
|
5
5
|
export declare const updateTreePlane: (tree: TreePlane[], page: TreePlane) => TreePlane[];
|
|
6
6
|
export declare const updateTreeByPlaneIDWithLinkCoordinates: (tree: TreePlane[], planeID: string, linkCoordinates: LinkCoordinates) => TreePlane[];
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
|
|
10
|
-
import * as utilities from "./utilities/index";
|
|
11
|
-
export { direction, internatiolate, general, matrix, quaternion, router, transform, space, state, utilities, };
|
|
12
|
-
export * from "./setup/objects/PlanesRegistrar/index";
|
|
1
|
+
import * as general from './general';
|
|
2
|
+
import * as interaction from './interaction';
|
|
3
|
+
import internatiolate from './internationalization';
|
|
4
|
+
import * as planes from './planes';
|
|
5
|
+
import * as routing from './routing';
|
|
6
|
+
import * as space from './space';
|
|
7
|
+
import * as state from './state';
|
|
8
|
+
import * as utilities from './utilities';
|
|
9
|
+
export { general, interaction, internatiolate, planes, routing, space, state, utilities, };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { WheelDeltas } from
|
|
1
|
+
import { WheelDeltas } from '@plurid/plurid-data';
|
|
2
2
|
export declare const getWheelDirection: (deltas: WheelDeltas, ABSTHRESHOLD?: number, THRESHOLD?: number) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare type Matrix = number[][];
|
|
2
|
+
export declare const multiplyMatrices: (m1: Matrix, m2: Matrix) => Matrix;
|
|
3
|
+
export declare const arrayToMatrix: (array: number[]) => Matrix;
|
|
4
|
+
export declare const matrixToArray: (matrix: Matrix) => number[];
|
|
5
|
+
export declare const printMatrix: (matrix: Matrix, name: string) => void;
|
|
6
|
+
export declare const rotateXMatrix: (angle: number) => Matrix;
|
|
7
|
+
export declare const rotateYMatrix: (angle: number) => Matrix;
|
|
8
|
+
export declare const rotateZMatrix: (angle: number) => Matrix;
|
|
9
|
+
export declare const translateMatrix: (x?: number, y?: number, z?: number) => Matrix;
|
|
@@ -1,69 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
* @param matrix3d CSS string obtained from
|
|
5
|
-
* window
|
|
6
|
-
* .getComputedStyle(element)
|
|
7
|
-
* .getPropertyValue('transform').
|
|
8
|
-
* @returns Numbers array.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getMatrixValues(matrix3d: string): number[];
|
|
11
|
-
/**
|
|
12
|
-
* Extracts the rotation matrix from the matrix3d CSS string.
|
|
13
|
-
*
|
|
14
|
-
* @param matrix3d CSS string obtained from
|
|
15
|
-
* window
|
|
16
|
-
* .getComputedStyle(element)
|
|
17
|
-
* .getPropertyValue("transform").
|
|
18
|
-
* @returns Rotation matrix.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getRotationMatrix(matrix3d: string): number[];
|
|
21
|
-
/**
|
|
22
|
-
* Extracts the translation matrix from the matrix3d CSS string.
|
|
23
|
-
*
|
|
24
|
-
* @param matrix3d CSS string obtained from
|
|
25
|
-
* window
|
|
26
|
-
* .getComputedStyle(element)
|
|
27
|
-
* .getPropertyValue("transform").
|
|
28
|
-
* @returns Translation matrix.
|
|
29
|
-
*/
|
|
30
|
-
export declare function getTranslationMatrix(matrix3d: string): number[];
|
|
31
|
-
/**
|
|
32
|
-
* Extracts the scalation value from the matrix3d CSS string.
|
|
33
|
-
*
|
|
34
|
-
* @param matrix3d CSS string obtained from
|
|
35
|
-
* window
|
|
36
|
-
* .getComputedStyle(element)
|
|
37
|
-
* .getPropertyValue("transform").
|
|
38
|
-
* @returns Scalation value.
|
|
39
|
-
*/
|
|
40
|
-
export declare function getScalationValue(matrix3d: string): number;
|
|
41
|
-
/**
|
|
42
|
-
* Returns a a matrix3d CSS string.
|
|
43
|
-
*
|
|
44
|
-
* @param rotationMatrix
|
|
45
|
-
* @param translationMatrix
|
|
46
|
-
* @param scalationMatrix
|
|
47
|
-
* @returns matrix3d CSS string.
|
|
48
|
-
*/
|
|
49
|
-
export declare function setTransform(rotationMatrix: number[], translationMatrix: number[], scalationMatrix: number[]): string;
|
|
50
|
-
interface RotationValues {
|
|
51
|
-
rotateX: number;
|
|
52
|
-
rotateY: number;
|
|
53
|
-
rotateZ: number;
|
|
54
|
-
}
|
|
55
|
-
export declare function getTransformRotate(matrix3d: string): RotationValues;
|
|
56
|
-
interface TranslationValues {
|
|
57
|
-
translateX: number;
|
|
58
|
-
translateY: number;
|
|
59
|
-
translateZ: number;
|
|
60
|
-
}
|
|
61
|
-
export declare function getTransformTranslate(matrix3d: string): TranslationValues;
|
|
62
|
-
interface ScalationValue {
|
|
63
|
-
scale: number;
|
|
64
|
-
}
|
|
65
|
-
export declare function getTransformScale(matrix3d: string): ScalationValue;
|
|
66
|
-
export declare function rotatePlurid(matrix3d: string, direction?: string, angleIncrement?: number): string;
|
|
67
|
-
export declare function translatePlurid(matrix3d: string, direction?: string, linearIncrement?: number): string;
|
|
68
|
-
export declare function scalePlurid(matrix3d: string, direction?: string, scaleIncrement?: number): string;
|
|
69
|
-
export {};
|
|
1
|
+
import * as general from './general';
|
|
2
|
+
import * as matrix3d from './matrix3d';
|
|
3
|
+
export { general, matrix3d, };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts the CSS string matrix3d into an array of numbers.
|
|
3
|
+
*
|
|
4
|
+
* @param matrix3d CSS string obtained from
|
|
5
|
+
* window
|
|
6
|
+
* .getComputedStyle(element)
|
|
7
|
+
* .getPropertyValue('transform').
|
|
8
|
+
* @returns Numbers array.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getMatrixValues(matrix3d: string): number[];
|
|
11
|
+
/**
|
|
12
|
+
* Extracts the rotation matrix from the matrix3d CSS string.
|
|
13
|
+
*
|
|
14
|
+
* @param matrix3d CSS string obtained from
|
|
15
|
+
* window
|
|
16
|
+
* .getComputedStyle(element)
|
|
17
|
+
* .getPropertyValue("transform").
|
|
18
|
+
* @returns Rotation matrix.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getRotationMatrix(matrix3d: string): number[];
|
|
21
|
+
/**
|
|
22
|
+
* Extracts the translation matrix from the matrix3d CSS string.
|
|
23
|
+
*
|
|
24
|
+
* @param matrix3d CSS string obtained from
|
|
25
|
+
* window
|
|
26
|
+
* .getComputedStyle(element)
|
|
27
|
+
* .getPropertyValue("transform").
|
|
28
|
+
* @returns Translation matrix.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getTranslationMatrix(matrix3d: string): number[];
|
|
31
|
+
/**
|
|
32
|
+
* Extracts the scalation value from the matrix3d CSS string.
|
|
33
|
+
*
|
|
34
|
+
* @param matrix3d CSS string obtained from
|
|
35
|
+
* window
|
|
36
|
+
* .getComputedStyle(element)
|
|
37
|
+
* .getPropertyValue("transform").
|
|
38
|
+
* @returns Scalation value.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getScalationValue(matrix3d: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* Returns a a matrix3d CSS string.
|
|
43
|
+
*
|
|
44
|
+
* @param rotationMatrix
|
|
45
|
+
* @param translationMatrix
|
|
46
|
+
* @param scalationMatrix
|
|
47
|
+
* @returns matrix3d CSS string.
|
|
48
|
+
*/
|
|
49
|
+
export declare function setTransform(rotationMatrix: number[], translationMatrix: number[], scalationMatrix: number[]): string;
|
|
50
|
+
interface RotationValues {
|
|
51
|
+
rotateX: number;
|
|
52
|
+
rotateY: number;
|
|
53
|
+
rotateZ: number;
|
|
54
|
+
}
|
|
55
|
+
export declare function getTransformRotate(matrix3d: string): RotationValues;
|
|
56
|
+
interface TranslationValues {
|
|
57
|
+
translateX: number;
|
|
58
|
+
translateY: number;
|
|
59
|
+
translateZ: number;
|
|
60
|
+
}
|
|
61
|
+
export declare function getTransformTranslate(matrix3d: string): TranslationValues;
|
|
62
|
+
interface ScalationValue {
|
|
63
|
+
scale: number;
|
|
64
|
+
}
|
|
65
|
+
export declare function getTransformScale(matrix3d: string): ScalationValue;
|
|
66
|
+
export declare function rotatePlurid(matrix3d: string, direction?: string, angleIncrement?: number): string;
|
|
67
|
+
export declare function translatePlurid(matrix3d: string, direction?: string, linearIncrement?: number): string;
|
|
68
|
+
export declare function scalePlurid(matrix3d: string, direction?: string, scaleIncrement?: number): string;
|
|
69
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluridPlane, PluridPlaneObject, PluridRoutePlane, PluridRoutePlaneObject, PluridInternalStatePlane, PluridInternalContextPlane } from '@plurid/plurid-data';
|
|
2
|
+
export declare const resolvePluridPlaneData: <C>(plane: PluridPlane<C>) => PluridPlaneObject<C>;
|
|
3
|
+
export declare const resolvePluridRoutePlaneData: <C>(plane: PluridRoutePlane<C>) => PluridRoutePlaneObject<C>;
|
|
4
|
+
export declare const createInternalStatePlane: <C>(plane: PluridPlane<C>) => PluridInternalStatePlane;
|
|
5
|
+
export declare const createInternalContextPlane: <C>(plane: PluridPlane<C>) => PluridInternalContextPlane<C>;
|
|
6
|
+
export declare const getPluridPlaneIDByData: (element: HTMLElement | null) => string;
|
|
@@ -3,11 +3,12 @@ import { PluridPlane, RegisteredPluridPlane, PluridPlanesRegistrar as IPluridPla
|
|
|
3
3
|
* The planes registrar can be stored in-memory (server-side)
|
|
4
4
|
* or on the `window.__pluridPlanesRegistrar__` object (browser-side).
|
|
5
5
|
*/
|
|
6
|
-
declare class PluridPlanesRegistrar implements IPluridPlanesRegistrar {
|
|
7
|
-
private
|
|
8
|
-
|
|
6
|
+
declare class PluridPlanesRegistrar<C> implements IPluridPlanesRegistrar<C> {
|
|
7
|
+
private isoMatcher;
|
|
8
|
+
constructor(planes?: PluridPlane<C>[]);
|
|
9
|
+
register(planes: PluridPlane<C>[]): void;
|
|
9
10
|
identify(): string[];
|
|
10
|
-
get(route: string): RegisteredPluridPlane | undefined;
|
|
11
|
-
getAll(): Map<
|
|
11
|
+
get(route: string): RegisteredPluridPlane<C> | undefined;
|
|
12
|
+
getAll(): Map<any, any>;
|
|
12
13
|
}
|
|
13
14
|
export default PluridPlanesRegistrar;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluridPlane, PluridPlanesRegistrar as IPluridPlanesRegistrar } from '@plurid/plurid-data';
|
|
2
|
+
declare const registerPlanes: <C>(planes?: PluridPlane<C>[] | undefined, planesRegistrar?: IPluridPlanesRegistrar<C> | undefined) => void;
|
|
3
|
+
declare const getPlanesRegistrar: <C>(planesRegistrar: IPluridPlanesRegistrar<C> | undefined) => IPluridPlanesRegistrar<C> | undefined;
|
|
4
|
+
declare const getRegisteredPlanes: <C>(planesRegistrar: IPluridPlanesRegistrar<C> | undefined) => Map<any, any>;
|
|
5
|
+
declare const getRegisteredPlane: <C>(route: string, planesRegistrar: IPluridPlanesRegistrar<C> | undefined) => import("@plurid/plurid-data").RegisteredPluridPlane<C> | undefined;
|
|
6
|
+
export { registerPlanes, getPlanesRegistrar, getRegisteredPlanes, getRegisteredPlane, };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IsoMatcherData, IsoMatcherIndexedPlane, IsoMatcherPlaneResult, IsoMatcherRouteResult } from '@plurid/plurid-data';
|
|
2
|
+
/**
|
|
3
|
+
* The `IsoMatcher` gathers all the known information about `routes` and `planes`
|
|
4
|
+
* and matches client-side or server-side, in-browser or in-plurid.
|
|
5
|
+
*/
|
|
6
|
+
declare class IsoMatcher<C> {
|
|
7
|
+
private origin;
|
|
8
|
+
private routesIndex;
|
|
9
|
+
private planesIndex;
|
|
10
|
+
private routesKeys;
|
|
11
|
+
private planesKeys;
|
|
12
|
+
constructor(data: IsoMatcherData<C>, origin?: string);
|
|
13
|
+
/**
|
|
14
|
+
* Matches a `path` with a known `route` or `plane`,
|
|
15
|
+
* based on the strategy imposed by the `context`.
|
|
16
|
+
*
|
|
17
|
+
* @param path
|
|
18
|
+
* @param context
|
|
19
|
+
*/
|
|
20
|
+
match(path: string, context: 'route'): IsoMatcherRouteResult<C> | undefined;
|
|
21
|
+
match(path: string): IsoMatcherPlaneResult<C> | undefined;
|
|
22
|
+
match(path: string, context: 'plane'): IsoMatcherPlaneResult<C> | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Dynammically update the planes and routes indexes.
|
|
25
|
+
*
|
|
26
|
+
* @param data
|
|
27
|
+
*/
|
|
28
|
+
index(data: IsoMatcherData<C>): void;
|
|
29
|
+
/**
|
|
30
|
+
* Clear all data.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
clear(): void;
|
|
34
|
+
getPlanesIndex(): Map<string, IsoMatcherIndexedPlane<C>>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a common data structure able to match and route accordingly.
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
private updateIndexes;
|
|
40
|
+
private indexPlanes;
|
|
41
|
+
private matchPlane;
|
|
42
|
+
private matchRoute;
|
|
43
|
+
}
|
|
44
|
+
export default IsoMatcher;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PluridRoute } from '@plurid/plurid-data';
|
|
2
|
-
import { ParserPartialOptions, ParserResponse } from
|
|
3
|
-
export default class Parser<
|
|
2
|
+
import { ParserPartialOptions, ParserResponse } from './interfaces';
|
|
3
|
+
export default class Parser<C> {
|
|
4
4
|
/** properties */
|
|
5
5
|
private location;
|
|
6
6
|
private path;
|
|
7
7
|
private options;
|
|
8
8
|
/** constructor */
|
|
9
|
-
constructor(location: string, path: PluridRoute
|
|
9
|
+
constructor(location: string, path: PluridRoute<C>, options?: ParserPartialOptions);
|
|
10
10
|
/** private */
|
|
11
11
|
private handleOptions;
|
|
12
12
|
private extractPathname;
|
|
@@ -17,5 +17,5 @@ export default class Parser<T> {
|
|
|
17
17
|
/**
|
|
18
18
|
* Extract pathname, parameters, query, and fragment, if available.
|
|
19
19
|
*/
|
|
20
|
-
extract(): ParserResponse
|
|
20
|
+
extract(): ParserResponse<C>;
|
|
21
21
|
}
|
|
@@ -6,8 +6,8 @@ export interface ParserOptions {
|
|
|
6
6
|
*/
|
|
7
7
|
fragment: boolean;
|
|
8
8
|
}
|
|
9
|
-
export interface ParserResponse {
|
|
10
|
-
path: PluridRoute
|
|
9
|
+
export interface ParserResponse<C> {
|
|
10
|
+
path: PluridRoute<C>;
|
|
11
11
|
pathname: string;
|
|
12
12
|
elements: string[];
|
|
13
13
|
match: boolean;
|
|
@@ -16,6 +16,14 @@ export interface ParserResponse {
|
|
|
16
16
|
fragments: PluridRouteFragments;
|
|
17
17
|
route: string;
|
|
18
18
|
}
|
|
19
|
+
export interface MatcherResponse<C> {
|
|
20
|
+
path: PluridRoute<C>;
|
|
21
|
+
pathname: string;
|
|
22
|
+
parameters: Record<string, string>;
|
|
23
|
+
query: Record<string, string>;
|
|
24
|
+
fragments: PluridRouteFragments;
|
|
25
|
+
route: string;
|
|
26
|
+
}
|
|
19
27
|
export interface ParserParametersAndMatch {
|
|
20
28
|
match: boolean;
|
|
21
29
|
parameters: Indexed<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Indexed, PluridRouteFragments, PluridRouteFragmentElement, PluridRouteFragmentText } from '@plurid/plurid-data';
|
|
2
|
-
import { ParserParametersAndMatch } from
|
|
2
|
+
import { ParserParametersAndMatch } from './interfaces';
|
|
3
3
|
export declare const extractPathname: (location: string) => string;
|
|
4
4
|
/**
|
|
5
5
|
* Extracts the parameters names from a `route`.
|
|
@@ -63,6 +63,6 @@ export declare const splitPath: (path: string) => string[];
|
|
|
63
63
|
* @param path
|
|
64
64
|
*/
|
|
65
65
|
export declare const extractQuery: (path: string) => Indexed<string>;
|
|
66
|
-
export declare const extractFragments: (location?: string
|
|
66
|
+
export declare const extractFragments: (location?: string) => PluridRouteFragments;
|
|
67
67
|
export declare const parseFragment: (fragment: string) => PluridRouteFragmentText | PluridRouteFragmentElement | undefined;
|
|
68
68
|
export declare const extractOccurence: (occurence: string | undefined) => number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const stringInsertInitial: (value: string, insert: string) => string;
|
|
2
|
+
export declare const stringRemoveTrailing: (value: string, trail: string) => string;
|
|
3
|
+
export declare const cleanupPath: (value: string) => string;
|
|
4
|
+
export declare const computePlaneAddress: (plane: string, route?: string, origin?: string) => string;
|
|
5
|
+
export declare const isAbsolutePlane: (value: string) => boolean;
|
|
6
|
+
export declare const checkPlaneAddressType: (value: string) => "pttp" | "https" | "http" | "relative";
|
|
7
|
+
export declare const removeTrailingSlash: (value: string) => string;
|
|
8
|
+
export declare const cleanPathValue: (value: string) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Indexed, PluridRoute, RouteDivisions } from '@plurid/plurid-data';
|
|
2
|
-
export declare const mapPathsToRoutes: <
|
|
2
|
+
export declare const mapPathsToRoutes: <C, V>(paths: Indexed<string>, view: V) => PluridRoute<C, any>[];
|
|
3
3
|
export declare const pluridLinkPathDivider: (route: string) => RouteDivisions;
|
|
4
4
|
/**
|
|
5
5
|
* Given a partial `route`, e.g. `/route`, or `://cluster://route`,
|
|
@@ -8,7 +8,7 @@ export declare const pluridLinkPathDivider: (route: string) => RouteDivisions;
|
|
|
8
8
|
*
|
|
9
9
|
* @param path
|
|
10
10
|
*/
|
|
11
|
-
export declare const resolveRoute: (route: string, protocol?: string
|
|
11
|
+
export declare const resolveRoute: (route: string, protocol?: string, host?: string) => {
|
|
12
12
|
protocol: string;
|
|
13
13
|
host: import("@plurid/plurid-data").RouteHostDivision;
|
|
14
14
|
path: import("@plurid/plurid-data").RoutePathDivision;
|
|
@@ -17,4 +17,13 @@ export declare const resolveRoute: (route: string, protocol?: string | undefined
|
|
|
17
17
|
cluster: import("@plurid/plurid-data").RouteClusterDivision;
|
|
18
18
|
plane: import("@plurid/plurid-data").RoutePlaneDivision;
|
|
19
19
|
route: string;
|
|
20
|
+
} | {
|
|
21
|
+
protocol: string;
|
|
22
|
+
host: string;
|
|
23
|
+
path: import("@plurid/plurid-data").RoutePathDivision;
|
|
24
|
+
space: string;
|
|
25
|
+
universe: string;
|
|
26
|
+
cluster: string;
|
|
27
|
+
plane: string;
|
|
28
|
+
route: string;
|
|
20
29
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CompareType, Indexed, PluridRouteParameter } from '@plurid/plurid-data';
|
|
2
|
+
export declare const checkParameterLength: (parameter: string, length: number, compareType?: CompareType) => boolean;
|
|
3
|
+
export declare const checkValidPath: <C>(validationParameters: Record<string, PluridRouteParameter> | undefined, parameters: Indexed<string>) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluridConfiguration, TreePlane } from '@plurid/plurid-data';
|
|
2
|
-
declare const computeColumnLayout: (roots: TreePlane[], columns?: number, columnLength?: number
|
|
2
|
+
declare const computeColumnLayout: (roots: TreePlane[], columns?: number, columnLength?: number, gap?: number, configuration?: PluridConfiguration) => TreePlane[];
|
|
3
3
|
export default computeColumnLayout;
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import computeColumnLayout from './column';
|
|
2
|
+
import computeRowLayout from './row';
|
|
3
|
+
import computeFaceToFaceLayout from './faceToFace';
|
|
4
|
+
import computeSheavesLayout from './sheaves';
|
|
5
|
+
import computeZigZagLayout from './zigZag';
|
|
6
|
+
export { computeColumnLayout, computeRowLayout, computeFaceToFaceLayout, computeSheavesLayout, computeZigZagLayout, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluridConfiguration, TreePlane } from '@plurid/plurid-data';
|
|
2
|
-
declare const computeRowLayout: (roots: TreePlane[], rows?: number, rowLength?: number
|
|
2
|
+
declare const computeRowLayout: (roots: TreePlane[], rows?: number, rowLength?: number, gap?: number, configuration?: PluridConfiguration) => TreePlane[];
|
|
3
3
|
export default computeRowLayout;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { computePath, computePluridPlaneLocation, recomputeChildrenLocation } from
|
|
1
|
+
import { computePath, computePluridPlaneLocation, recomputeChildrenLocation } from './logic';
|
|
2
2
|
export { computePath, computePluridPlaneLocation, recomputeChildrenLocation, };
|
|
@@ -12,7 +12,7 @@ export declare const recomputeChildrenLocation: (page: TreePlane) => TreePlane[]
|
|
|
12
12
|
* @param root
|
|
13
13
|
* @param index
|
|
14
14
|
*/
|
|
15
|
-
export declare const computeRootLocationX: (configuration: PluridConfiguration | undefined, root: PluridPlane
|
|
15
|
+
export declare const computeRootLocationX: <C>(configuration: PluridConfiguration | undefined, root: PluridPlane<C>, index: number) => number;
|
|
16
16
|
export declare const computeSpaceLocation: (configuration: PluridConfiguration) => SpaceLocation;
|
|
17
17
|
/**
|
|
18
18
|
* Based on the specified camera, compute the X translation
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
/** interfaces */
|
|
3
|
+
PluridView, PluridApplicationView, PluridConfiguration, RegisteredPluridPlane, TreePlane, LinkCoordinates, PathParameters } from '@plurid/plurid-data';
|
|
4
|
+
/**
|
|
5
|
+
* Given a view resolve it to an absolute view
|
|
6
|
+
* and compute a TreePlane if there is a RegisteredPluridPlane
|
|
7
|
+
* for that absolute view.
|
|
8
|
+
*
|
|
9
|
+
* @param view
|
|
10
|
+
*/
|
|
11
|
+
export declare const resolveViewItem: <C>(planes: Map<string, RegisteredPluridPlane<C>>, view: string | PluridView, configuration: PluridConfiguration, origin?: string) => TreePlane | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Compute the space based on the layout.
|
|
14
|
+
* If there is no configuration.space.layout, it uses the default '2 COLUMNS' layout.
|
|
15
|
+
*
|
|
16
|
+
* @param planes
|
|
17
|
+
* @param configuration
|
|
18
|
+
*/
|
|
19
|
+
export declare const computeSpaceTree: <C>(planes: Map<string, RegisteredPluridPlane<C>>, view: PluridApplicationView, configuration: PluridConfiguration, origin?: string) => TreePlane[];
|
|
20
|
+
export declare const isParametric: (viewRoute: string, planeRoute: string) => boolean;
|
|
21
|
+
export declare const matchForParameters: (viewRoute: string, planeRoute: string) => void;
|
|
22
|
+
export declare const assignPagesFromView: (planes: TreePlane[], view?: PluridApplicationView) => TreePlane[];
|
|
23
|
+
export declare const updateTreePlane: (tree: TreePlane[], updatedPage: TreePlane) => TreePlane[];
|
|
24
|
+
export interface UpdatedTreeWithNewPlane {
|
|
25
|
+
pluridPlaneID: string;
|
|
26
|
+
updatedTree: TreePlane[];
|
|
27
|
+
updatedTreePlane?: TreePlane;
|
|
28
|
+
}
|
|
29
|
+
export declare const updateTreeWithNewPlane: <C>(planeRoute: string, parentPlaneID: string, linkCoordinates: LinkCoordinates, tree: TreePlane[], planesRegistry: Map<string, RegisteredPluridPlane<C>>, configuration: PluridConfiguration) => UpdatedTreeWithNewPlane;
|
|
30
|
+
export declare const updateTreeWithNewPage: (tree: TreePlane[], treePageParentPlaneID: string, pagePath: string, pageID: string, linkCoordinates: LinkCoordinates, parameters?: PathParameters) => UpdatedTreeWithNewPlane;
|
|
31
|
+
export declare const removePageFromTree: (tree: TreePlane[], pluridPlaneID: string) => TreePlane[];
|
|
32
|
+
export declare const toggleChildren: (children: TreePlane[]) => TreePlane[];
|
|
33
|
+
export interface TogglePlaneFromTree {
|
|
34
|
+
updatedTree: TreePlane[];
|
|
35
|
+
updatedPlane: TreePlane | undefined;
|
|
36
|
+
}
|
|
37
|
+
export declare const togglePlaneFromTree: (tree: TreePlane[], pluridPlaneID: string) => TogglePlaneFromTree;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TreePlane, RegisteredPluridPlane, PluridConfiguration, PluridApplicationView, PluridCluster } from '@plurid/plurid-data';
|
|
2
|
+
export interface TreeData<C> {
|
|
3
|
+
planes: Map<string, RegisteredPluridPlane<C>>;
|
|
4
|
+
view: PluridApplicationView;
|
|
5
|
+
configuration: PluridConfiguration;
|
|
6
|
+
clusters?: PluridCluster<C>[];
|
|
7
|
+
previousTree?: TreePlane[];
|
|
8
|
+
}
|
|
9
|
+
export default class Tree<C> {
|
|
10
|
+
private data;
|
|
11
|
+
private origin;
|
|
12
|
+
constructor(data: TreeData<C>, origin?: string);
|
|
13
|
+
compute(): TreePlane[];
|
|
14
|
+
}
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { computeViewTree, computeCulledView, checkPageInView } from
|
|
1
|
+
import { computeViewTree, computeCulledView, checkPageInView } from './logic';
|
|
2
2
|
export { computeViewTree, computeCulledView, checkPageInView, };
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PluridApplicationView, PluridConfiguration, PluridPlanesRegistrar as IPluridPlanesRegistrar, PluridState, PluridMetastateState, RecursivePartial } from '@plurid/plurid-data';
|
|
2
|
+
declare const compute: <C>(view: PluridApplicationView, configuration: RecursivePartial<PluridConfiguration> | undefined, planesRegistrar: IPluridPlanesRegistrar<C> | undefined, currentState: PluridState | undefined, localState: PluridState | undefined, precomputedState: Partial<PluridState> | undefined, contextState: PluridMetastateState | undefined) => PluridState;
|
|
3
|
+
export default compute;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PluridApplicationView, PluridConfiguration, PluridPlanesRegistrar as IPluridPlanesRegistrar, PluridState, PluridMetastateState, PluridStateSpace } from '@plurid/plurid-data';
|
|
2
|
+
declare const resolveSpace: <C>(view: PluridApplicationView, configuration: PluridConfiguration, planesRegistrar: IPluridPlanesRegistrar<C> | undefined, currentState: PluridState | undefined, localState: PluridState | undefined, precomputedState: Partial<PluridState> | undefined, contextState: PluridMetastateState | undefined) => PluridStateSpace;
|
|
3
|
+
export { resolveSpace, };
|
|
File without changes
|
|
File without changes
|