@plurid/plurid-engine 0.0.0-0 → 0.0.0-11

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 (76) hide show
  1. package/distribution/functions/index.d.ts +2 -0
  2. package/distribution/functions/navigate/index.d.ts +1 -0
  3. package/distribution/functions/template/index.d.ts +1 -0
  4. package/distribution/index.d.ts +1 -0
  5. package/distribution/index.es.js +2602 -2966
  6. package/distribution/index.es.js.map +1 -1
  7. package/distribution/index.js +2688 -3035
  8. package/distribution/index.js.map +1 -1
  9. package/distribution/modules/{setup/general → general}/configuration/index.d.ts +0 -0
  10. package/distribution/modules/general/index.d.ts +3 -0
  11. package/distribution/modules/{setup/general → general}/tree/index.d.ts +1 -1
  12. package/distribution/modules/index.d.ts +8 -9
  13. package/distribution/modules/interaction/direction/index.d.ts +2 -6
  14. package/distribution/modules/interaction/index.d.ts +5 -0
  15. package/distribution/modules/interaction/mathematics/transform/general/index.d.ts +9 -0
  16. package/distribution/modules/interaction/mathematics/transform/index.d.ts +3 -69
  17. package/distribution/modules/interaction/mathematics/transform/matrix3d/index.d.ts +69 -0
  18. package/distribution/modules/{setup/internationalization → internationalization}/index.d.ts +0 -0
  19. package/distribution/modules/planes/index.d.ts +2 -0
  20. package/distribution/modules/planes/logic/index.d.ts +6 -0
  21. package/distribution/modules/planes/registrar/index.d.ts +3 -0
  22. package/distribution/modules/planes/registrar/object.d.ts +14 -0
  23. package/distribution/modules/planes/registrar/utilities.d.ts +6 -0
  24. package/distribution/modules/routing/IsoMatcher/index.d.ts +44 -0
  25. package/distribution/modules/{setup/router → routing}/Parser/index.d.ts +3 -3
  26. package/distribution/modules/{setup/router → routing}/Parser/interfaces.d.ts +10 -2
  27. package/distribution/modules/{setup/router → routing}/Parser/logic.d.ts +0 -0
  28. package/distribution/modules/routing/index.d.ts +6 -0
  29. package/distribution/modules/routing/logic/general/index.d.ts +8 -0
  30. package/distribution/modules/routing/logic/index.d.ts +3 -0
  31. package/distribution/modules/{setup/router → routing/logic}/utilities/index.d.ts +10 -1
  32. package/distribution/modules/routing/logic/validity/index.d.ts +3 -0
  33. package/distribution/modules/{setup/space → space}/index.d.ts +0 -0
  34. package/distribution/modules/{setup/space → space}/layout/column.d.ts +0 -0
  35. package/distribution/modules/{setup/space → space}/layout/faceToFace.d.ts +0 -0
  36. package/distribution/modules/{setup/space → space}/layout/index.d.ts +0 -0
  37. package/distribution/modules/{setup/space → space}/layout/row.d.ts +0 -0
  38. package/distribution/modules/{setup/space → space}/layout/sheaves.d.ts +0 -0
  39. package/distribution/modules/{setup/space → space}/layout/zigZag.d.ts +0 -0
  40. package/distribution/modules/{setup/space → space}/location/index.d.ts +0 -0
  41. package/distribution/modules/{setup/space → space}/location/logic.d.ts +1 -1
  42. package/distribution/modules/{setup/space → space}/tree/index.d.ts +0 -0
  43. package/distribution/modules/{setup/space → space}/tree/logic.d.ts +12 -8
  44. package/distribution/modules/space/tree/object.d.ts +13 -0
  45. package/distribution/modules/{setup/space → space}/utilities/index.d.ts +0 -0
  46. package/distribution/modules/{setup/space → space}/view/index.d.ts +0 -0
  47. package/distribution/modules/{setup/space → space}/view/logic.d.ts +0 -0
  48. package/distribution/modules/state/compute/index.d.ts +3 -0
  49. package/distribution/modules/state/compute/space/index.d.ts +3 -0
  50. package/distribution/modules/state/compute/themes/index.d.ts +3 -0
  51. package/distribution/modules/state/index.d.ts +3 -0
  52. package/distribution/modules/state/local/index.d.ts +3 -0
  53. package/package.json +32 -31
  54. package/distribution/modules/interaction/mathematics/matrix/__specs__/matrix.spec.d.ts +0 -1
  55. package/distribution/modules/interaction/mathematics/quaternion/__specs__/quaternion.spec.d.ts +0 -1
  56. package/distribution/modules/interaction/mathematics/transform/__specs__/transform.spec.d.ts +0 -1
  57. package/distribution/modules/setup/general/helpers/identified.d.ts +0 -1
  58. package/distribution/modules/setup/general/helpers/index.d.ts +0 -2
  59. package/distribution/modules/setup/general/helpers/indexed.d.ts +0 -7
  60. package/distribution/modules/setup/general/index.d.ts +0 -7
  61. package/distribution/modules/setup/general/paths/index.d.ts +0 -4
  62. package/distribution/modules/setup/general/planes/index.d.ts +0 -4
  63. package/distribution/modules/setup/general/universes/index.d.ts +0 -21
  64. package/distribution/modules/setup/router/Matcher/__specs__/index.d.ts +0 -1
  65. package/distribution/modules/setup/router/Matcher/index.d.ts +0 -15
  66. package/distribution/modules/setup/router/Matcher/interfaces.d.ts +0 -12
  67. package/distribution/modules/setup/router/Matcher/logic.d.ts +0 -3
  68. package/distribution/modules/setup/router/Router/__specs__/index.d.ts +0 -1
  69. package/distribution/modules/setup/router/Router/index.d.ts +0 -28
  70. package/distribution/modules/setup/router/Router/interfaces.d.ts +0 -8
  71. package/distribution/modules/setup/router/URLRouter/data.d.ts +0 -27
  72. package/distribution/modules/setup/router/URLRouter/index.d.ts +0 -8
  73. package/distribution/modules/setup/router/URLRouter/logic.d.ts +0 -12
  74. package/distribution/modules/setup/router/index.d.ts +0 -11
  75. package/distribution/modules/setup/router/interfaces.d.ts +0 -3
  76. package/distribution/modules/setup/space/tree/object.d.ts +0 -13
@@ -0,0 +1,3 @@
1
+ import * as configuration from './configuration';
2
+ import * as tree from './tree';
3
+ export { configuration, tree, };
@@ -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, documentPlane: PluridInternalStatePlane) => TreePlane;
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,10 +1,9 @@
1
- import * as direction from './interaction/direction';
2
- import internatiolate from './setup/internationalization';
3
- import * as general from './setup/general';
4
- import * as matrix from './interaction/mathematics/matrix';
5
- import * as quaternion from './interaction/mathematics/quaternion';
6
- import * as router from './setup/router';
7
- import * as transform from './interaction/mathematics/transform';
8
- import * as space from './setup/space';
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';
9
8
  import * as utilities from './utilities';
10
- export { direction, internatiolate, general, matrix, quaternion, router, transform, space, utilities, };
9
+ export { general, interaction, internatiolate, planes, routing, space, state, utilities, };
@@ -1,6 +1,2 @@
1
- interface Deltas {
2
- deltaX: number;
3
- deltaY: number;
4
- }
5
- export declare const getWheelDirection: (deltas: Deltas, ABSTHRESHOLD?: number, THRESHOLD?: number) => string;
6
- export {};
1
+ import { WheelDeltas } from '@plurid/plurid-data';
2
+ export declare const getWheelDirection: (deltas: WheelDeltas, ABSTHRESHOLD?: number, THRESHOLD?: number) => string;
@@ -0,0 +1,5 @@
1
+ import * as direction from './direction';
2
+ import * as matrix from './mathematics/matrix';
3
+ import * as quaternion from './mathematics/quaternion';
4
+ import * as transform from './mathematics/transform';
5
+ export { direction, matrix, quaternion, transform, };
@@ -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
- * 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 {};
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 {};
@@ -0,0 +1,2 @@
1
+ export * from './logic';
2
+ export * from './registrar';
@@ -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) => any;
@@ -0,0 +1,3 @@
1
+ import Registrar from './object';
2
+ export * from './utilities';
3
+ export { Registrar, };
@@ -0,0 +1,14 @@
1
+ import { PluridPlane, RegisteredPluridPlane, PluridPlanesRegistrar as IPluridPlanesRegistrar } from '@plurid/plurid-data';
2
+ /**
3
+ * The planes registrar can be stored in-memory (server-side)
4
+ * or on the `window.__pluridPlanesRegistrar__` object (browser-side).
5
+ */
6
+ declare class PluridPlanesRegistrar<C> implements IPluridPlanesRegistrar<C> {
7
+ private isoMatcher;
8
+ constructor(planes?: PluridPlane<C>[]);
9
+ register(planes: PluridPlane<C>[]): void;
10
+ identify(): string[];
11
+ get(route: string): RegisteredPluridPlane<C> | undefined;
12
+ getAll(): Map<any, any>;
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
2
  import { ParserPartialOptions, ParserResponse } from './interfaces';
3
- export default class Parser<T> {
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, options?: ParserPartialOptions);
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>;
@@ -0,0 +1,6 @@
1
+ import IsoMatcher from './IsoMatcher';
2
+ import RouteParser from './Parser';
3
+ import { extractQuery } from './Parser/logic';
4
+ export * from './Parser/interfaces';
5
+ export * from './logic';
6
+ export { IsoMatcher, RouteParser, extractQuery, };
@@ -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 | undefined, 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;
@@ -0,0 +1,3 @@
1
+ export * from './general';
2
+ export * from './validity';
3
+ export * from './utilities';
@@ -1,5 +1,5 @@
1
1
  import { Indexed, PluridRoute, RouteDivisions } from '@plurid/plurid-data';
2
- export declare const mapPathsToRoutes: <T, V>(paths: Indexed<string>, view: V) => PluridRoute[];
2
+ export declare const mapPathsToRoutes: <C, V>(paths: Indexed<string>, view: V) => PluridRoute<C>[];
3
3
  export declare const pluridLinkPathDivider: (route: string) => RouteDivisions;
4
4
  /**
5
5
  * Given a partial `route`, e.g. `/route`, or `://cluster://route`,
@@ -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 | undefined) => boolean;
3
+ export declare const checkValidPath: <C>(validationParameters: Record<string, PluridRouteParameter> | undefined, parameters: Indexed<string>) => boolean;
@@ -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, index: number) => number;
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  /** interfaces */
3
- PluridView, PluridConfiguration, RegisteredPluridPlane, TreePlane, LinkCoordinates, PathParameters } from '@plurid/plurid-data';
3
+ PluridView, PluridApplicationView, PluridConfiguration, RegisteredPluridPlane, TreePlane, LinkCoordinates, PathParameters } from '@plurid/plurid-data';
4
4
  /**
5
5
  * Given a view resolve it to an absolute view
6
6
  * and compute a TreePlane if there is a RegisteredPluridPlane
@@ -8,7 +8,7 @@ PluridView, PluridConfiguration, RegisteredPluridPlane, TreePlane, LinkCoordinat
8
8
  *
9
9
  * @param view
10
10
  */
11
- export declare const resolveViewItem: (planes: Map<string, RegisteredPluridPlane>, view: string | PluridView, configuration: PluridConfiguration) => TreePlane | undefined;
11
+ export declare const resolveViewItem: <C>(planes: Map<string, RegisteredPluridPlane<C>>, view: string | PluridView, configuration: PluridConfiguration) => TreePlane | undefined;
12
12
  /**
13
13
  * Compute the space based on the layout.
14
14
  * If there is no configuration.space.layout, it uses the default '2 COLUMNS' layout.
@@ -16,18 +16,22 @@ export declare const resolveViewItem: (planes: Map<string, RegisteredPluridPlane
16
16
  * @param planes
17
17
  * @param configuration
18
18
  */
19
- export declare const computeSpaceTree: (planes: Map<string, RegisteredPluridPlane>, view: string[] | PluridView[], configuration: PluridConfiguration) => TreePlane[];
19
+ export declare const computeSpaceTree: <C>(planes: Map<string, RegisteredPluridPlane<C>>, view: PluridApplicationView, configuration: PluridConfiguration) => TreePlane[];
20
20
  export declare const isParametric: (viewRoute: string, planeRoute: string) => boolean;
21
21
  export declare const matchForParameters: (viewRoute: string, planeRoute: string) => void;
22
- export declare const assignPagesFromView: (planes: TreePlane[], view?: string[] | PluridView[] | undefined) => TreePlane[];
22
+ export declare const assignPagesFromView: (planes: TreePlane[], view?: PluridApplicationView | undefined) => TreePlane[];
23
23
  export declare const updateTreePlane: (tree: TreePlane[], updatedPage: TreePlane) => TreePlane[];
24
- export declare const updateTreeWithNewPlane: (planeRoute: string, parentPlaneID: string, linkCoordinates: LinkCoordinates, tree: TreePlane[], planesRegistry: Map<string, RegisteredPluridPlane>, configuration: PluridConfiguration) => UpdatedTreeWithNewPlane;
25
- interface UpdatedTreeWithNewPlane {
24
+ export interface UpdatedTreeWithNewPlane {
26
25
  pluridPlaneID: string;
27
26
  updatedTree: TreePlane[];
27
+ updatedTreePlane?: TreePlane;
28
28
  }
29
+ export declare const updateTreeWithNewPlane: <C>(planeRoute: string, parentPlaneID: string, linkCoordinates: LinkCoordinates, tree: TreePlane[], planesRegistry: Map<string, RegisteredPluridPlane<C>>, configuration: PluridConfiguration) => UpdatedTreeWithNewPlane;
29
30
  export declare const updateTreeWithNewPage: (tree: TreePlane[], treePageParentPlaneID: string, pagePath: string, pageID: string, linkCoordinates: LinkCoordinates, parameters?: PathParameters | undefined) => UpdatedTreeWithNewPlane;
30
31
  export declare const removePageFromTree: (tree: TreePlane[], pluridPlaneID: string) => TreePlane[];
31
32
  export declare const toggleChildren: (children: TreePlane[]) => TreePlane[];
32
- export declare const togglePlaneFromTree: (tree: TreePlane[], pluridPlaneID: string) => TreePlane[];
33
- export {};
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,13 @@
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
+ constructor(data: TreeData<C>);
12
+ compute(): TreePlane[];
13
+ }
@@ -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, };
@@ -0,0 +1,3 @@
1
+ import { PluridConfiguration, PluridStateThemes, PluridState } from '@plurid/plurid-data';
2
+ declare const resolveThemes: (configuration: PluridConfiguration, precomputedState: Partial<PluridState> | undefined) => PluridStateThemes;
3
+ export { resolveThemes, };
@@ -0,0 +1,3 @@
1
+ import compute from './compute';
2
+ import * as local from './local';
3
+ export { compute, local, };
@@ -0,0 +1,3 @@
1
+ import { PluridState } from '@plurid/plurid-data';
2
+ declare const load: (id: string | undefined, useLocalStorage: boolean | undefined) => PluridState | undefined;
3
+ export { load, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurid/plurid-engine",
3
- "version": "0.0.0-0",
3
+ "version": "0.0.0-11",
4
4
  "description": "Plurid Engine and Utility Functions",
5
5
  "keywords": [
6
6
  "plurid",
@@ -32,17 +32,18 @@
32
32
  "npm": ">=6"
33
33
  },
34
34
  "scripts": {
35
- "clean": "rm -rf ./distribution",
35
+ "clean": "rimraf ./distribution",
36
36
  "clean.tests": "find ./distribution -type d -name \"__tests__\" -prune -exec rm -rf {} +",
37
37
  "clean.performance": "find ./distribution -type d -name \"__performance__\" -prune -exec rm -rf {} +",
38
38
  "test": "jest ./source --config ./configurations/jest.config.js --rootDir ./",
39
+ "test.suite": "jest -c configurations/jest.config.js",
39
40
  "lint": "eslint -c ./configurations/.eslintrc.js ./source --ext .ts,.tsx",
40
- "start": "yarn clean && rollup -c ./scripts/rollup.config.js -w --environment ENV_MODE:local",
41
- "build.local": "yarn clean && rollup -c ./scripts/rollup.config.js --environment ENV_MODE:local",
42
- "build.development": "yarn clean && rollup -c ./scripts/rollup.config.js --environment ENV_MODE:development",
43
- "build.production": "yarn clean && rollup -c ./scripts/rollup.config.js --environment ENV_MODE:production",
44
- "build": "yarn lint && yarn test && yarn build.production && yarn clean.tests && yarn clean.performance",
45
- "prepublishOnly": "yarn build"
41
+ "start": "pnpm clean && rollup -c ./scripts/rollup.config.js -w --environment ENV_MODE:local",
42
+ "build.local": "pnpm clean && rollup -c ./scripts/rollup.config.js --environment ENV_MODE:local",
43
+ "build.development": "pnpm clean && rollup -c ./scripts/rollup.config.js --environment ENV_MODE:development",
44
+ "build.production": "pnpm clean && rollup -c ./scripts/rollup.config.js --environment ENV_MODE:production",
45
+ "build": "pnpm lint && pnpm test && pnpm build.production && pnpm clean.tests && pnpm clean.performance",
46
+ "prepublishOnly": "pnpm build"
46
47
  },
47
48
  "peerDependencies": {
48
49
  "@plurid/plurid-data": "*",
@@ -50,29 +51,29 @@
50
51
  "@plurid/plurid-themes": "*"
51
52
  },
52
53
  "devDependencies": {
53
- "@plurid/plurid-data": "0.0.0-0",
54
- "@plurid/plurid-functions": "0.0.0-0",
55
- "@plurid/plurid-pubsub": "0.0.0-0",
56
- "@plurid/plurid-themes": "0.0.0-0",
57
- "@rollup/plugin-commonjs": "^17.0.0",
58
- "@types/jest": "^26.0.18",
59
- "@types/lodash.camelcase": "^4.3.6",
60
- "@types/node": "^14.14.12",
61
- "@types/react": "^17.0.0",
62
- "@types/rollup-plugin-sourcemaps": "^0.4.2",
63
- "@typescript-eslint/eslint-plugin": "^4.9.1",
64
- "@typescript-eslint/parser": "^4.9.1",
65
- "coveralls": "^3.1.0",
66
- "eslint": "^7.15.0",
67
- "jest": "^26.6.3",
68
- "jest-config": "^26.6.3",
69
- "lodash.camelcase": "^4.3.0",
70
- "react": "^17.0.1",
71
- "rollup": "^2.34.2",
54
+ "@plurid/plurid-data": "0.0.0-12",
55
+ "@plurid/plurid-functions": "0.0.0-22",
56
+ "@plurid/plurid-pubsub": "0.0.0-6",
57
+ "@plurid/plurid-themes": "0.0.0-2",
58
+ "@rollup/plugin-commonjs": "^21.1.0",
59
+ "@types/jest": "^27.4.1",
60
+ "@types/node": "^17.0.24",
61
+ "@typescript-eslint/eslint-plugin": "^5.19.0",
62
+ "@typescript-eslint/parser": "^5.19.0",
63
+ "@zerollup/ts-transform-paths": "^1.7.18",
64
+ "coveralls": "^3.1.1",
65
+ "eslint": "^8.13.0",
66
+ "jest": "^27.5.1",
67
+ "jest-config": "^27.5.1",
68
+ "rimraf": "^3.0.2",
69
+ "rollup": "^2.70.2",
72
70
  "rollup-plugin-sourcemaps": "^0.6.3",
73
- "rollup-plugin-typescript2": "^0.29.0",
74
- "ts-jest": "^26.4.4",
75
- "ts-node": "^9.1.1",
76
- "typescript": "^4.1.2"
71
+ "rollup-plugin-terser": "^7.0.2",
72
+ "rollup-plugin-typescript2": "^0.31.2",
73
+ "ts-jest": "^27.1.4",
74
+ "ts-node": "^10.7.0",
75
+ "ttypescript": "^1.5.13",
76
+ "typescript": "^4.6.3",
77
+ "typescript-transform-paths": "^3.3.1"
77
78
  }
78
79
  }