@plurid/plurid-data 0.0.0-2 → 0.0.0-20
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/constants/compare/index.d.ts +1 -1
- package/distribution/constants/configuration/index.d.ts +1 -1
- package/distribution/constants/defaults/index.d.ts +3 -0
- package/distribution/constants/general/index.d.ts +6 -0
- package/distribution/constants/index.d.ts +13 -11
- package/distribution/constants/internationalization/chinese/index.d.ts +1 -1
- package/distribution/constants/internationalization/english/index.d.ts +1 -1
- package/distribution/constants/internationalization/fields.d.ts +82 -2
- package/distribution/constants/internationalization/french/index.d.ts +1 -1
- package/distribution/constants/internationalization/german/index.d.ts +1 -1
- package/distribution/constants/internationalization/hindi/index.d.ts +1 -1
- package/distribution/constants/internationalization/index.d.ts +93 -12
- package/distribution/constants/internationalization/italian/index.d.ts +1 -1
- package/distribution/constants/internationalization/japanese/index.d.ts +1 -1
- package/distribution/constants/internationalization/languages.d.ts +1 -1
- package/distribution/constants/internationalization/romanian/index.d.ts +1 -1
- package/distribution/constants/internationalization/russian/index.d.ts +1 -1
- package/distribution/constants/internationalization/spanish/index.d.ts +1 -1
- package/distribution/constants/keys/index.d.ts +1 -1
- package/distribution/constants/protocols/index.d.ts +9 -0
- package/distribution/constants/pubsub/index.d.ts +38 -30
- package/distribution/constants/shortcuts/index.d.ts +2 -2
- package/distribution/constants/space/index.d.ts +1 -0
- package/distribution/constants/tree/index.d.ts +1 -1
- package/distribution/enumerations/general/index.d.ts +10 -1
- package/distribution/enumerations/index.d.ts +1 -1
- package/distribution/index.d.ts +3 -3
- package/distribution/index.es.js +231 -2
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +250 -1
- package/distribution/index.js.map +1 -1
- package/distribution/interfaces/external/application/index.d.ts +52 -14
- package/distribution/interfaces/external/component/index.d.ts +20 -39
- package/distribution/interfaces/external/configuration/index.d.ts +19 -8
- package/distribution/interfaces/external/configurator/index.d.ts +3 -4
- package/distribution/interfaces/external/index.d.ts +17 -16
- package/distribution/interfaces/external/internationalization/index.d.ts +15 -0
- package/distribution/interfaces/external/link/index.d.ts +5 -7
- package/distribution/interfaces/external/metastate/index.d.ts +1 -1
- package/distribution/interfaces/external/plane/index.d.ts +31 -26
- package/distribution/interfaces/external/pubsub/index.d.ts +4 -5
- package/distribution/interfaces/external/pubsub/message.d.ts +103 -9
- package/distribution/interfaces/external/registrar/index.d.ts +5 -5
- package/distribution/interfaces/external/router/fragment/index.d.ts +18 -0
- package/distribution/interfaces/external/router/index.d.ts +27 -208
- package/distribution/interfaces/external/router/multispace/index.d.ts +14 -0
- package/distribution/interfaces/external/router/preserve/index.d.ts +70 -0
- package/distribution/interfaces/external/router/route/index.d.ts +171 -0
- package/distribution/interfaces/external/routing/index.d.ts +58 -0
- package/distribution/interfaces/external/universe/index.d.ts +5 -22
- package/distribution/interfaces/external/window/index.d.ts +3 -3
- package/distribution/interfaces/index.d.ts +3 -3
- package/distribution/interfaces/internal/context/index.d.ts +12 -5
- package/distribution/interfaces/internal/index.d.ts +5 -7
- package/distribution/interfaces/internal/shortcuts/index.d.ts +1 -1
- package/distribution/interfaces/internal/state/index.d.ts +11 -7
- package/distribution/interfaces/internal/transform/index.d.ts +9 -0
- package/distribution/interfaces/internal/tree/index.d.ts +1 -1
- package/package.json +16 -16
- package/distribution/interfaces/external/cluster/index.d.ts +0 -9
- package/distribution/interfaces/internal/internationalization/index.d.ts +0 -157
- package/distribution/interfaces/internal/plane/index.d.ts +0 -10
- package/distribution/interfaces/internal/universe/index.d.ts +0 -27
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { PluridState } from
|
|
2
|
-
import { PluridPlane, PluridPlaneContext } from
|
|
3
|
-
import {
|
|
4
|
-
import { PluridView } from
|
|
5
|
-
import { PluridPartialConfiguration } from
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
export interface PluridApplication {
|
|
1
|
+
import { PluridState } from '../../internal/state';
|
|
2
|
+
import { PluridPlane, PluridPlaneContext } from '../plane';
|
|
3
|
+
import { PluridUniverse } from '../universe';
|
|
4
|
+
import { PluridView } from '../view';
|
|
5
|
+
import { PluridPartialConfiguration } from '../configuration';
|
|
6
|
+
import { PluridPubSub } from '../pubsub';
|
|
7
|
+
import { PluridPlanesRegistrar } from '../registrar';
|
|
8
|
+
import { IsoMatcherRouteResult } from '../routing';
|
|
9
|
+
export interface PluridApplication<C> {
|
|
10
10
|
id?: string;
|
|
11
|
-
indexedPlanes?: Map<string, IndexedPluridPlane>;
|
|
12
11
|
planesProperties?: Map<string, any>;
|
|
13
12
|
/**
|
|
14
13
|
* The planes which will be rendered by the `PluridApplication`.
|
|
15
14
|
*/
|
|
16
|
-
planes?: PluridPlane[];
|
|
15
|
+
planes?: PluridPlane<C>[];
|
|
17
16
|
/**
|
|
18
17
|
* Optional context for the plane to have access to.
|
|
19
18
|
*/
|
|
@@ -26,11 +25,34 @@ export interface PluridApplication {
|
|
|
26
25
|
* Routes of the planes in view on the initial rendering.
|
|
27
26
|
*/
|
|
28
27
|
view: PluridApplicationView;
|
|
28
|
+
/**
|
|
29
|
+
* Center the view on a plane from `view`.
|
|
30
|
+
*/
|
|
31
|
+
centerView?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The hostname of the server exposed to the internet, e.g. `example.com`,
|
|
34
|
+
* to be used in plurid plane links.
|
|
35
|
+
*/
|
|
36
|
+
hostname?: string;
|
|
37
|
+
/**
|
|
38
|
+
* A `PluridApplication` must be either planes or universes based.
|
|
39
|
+
*
|
|
40
|
+
* A `PluridUniverse` is a collection of `PluridPlane`s.
|
|
41
|
+
*/
|
|
42
|
+
universes?: PluridUniverse<C>[];
|
|
29
43
|
/**
|
|
30
44
|
* Show or not the default Plane Not Found component, or pass a custom component.
|
|
45
|
+
*
|
|
46
|
+
* Default `true`.
|
|
47
|
+
*/
|
|
48
|
+
planeNotFound?: boolean | C;
|
|
49
|
+
/**
|
|
50
|
+
* Use or not Plurid Plane Error Boundary and show the default Plurid Plane Render Error component,
|
|
51
|
+
* or pass a custom component.
|
|
52
|
+
*
|
|
31
53
|
* Default `true`.
|
|
32
54
|
*/
|
|
33
|
-
|
|
55
|
+
planeRenderError?: boolean | C;
|
|
34
56
|
/**
|
|
35
57
|
* Application-wide partial configuration.
|
|
36
58
|
*/
|
|
@@ -44,14 +66,30 @@ export interface PluridApplication {
|
|
|
44
66
|
*/
|
|
45
67
|
static?: boolean;
|
|
46
68
|
precomputedState?: Partial<PluridState>;
|
|
47
|
-
planesRegistrar?: PluridPlanesRegistrar
|
|
69
|
+
planesRegistrar?: PluridPlanesRegistrar<C>;
|
|
48
70
|
/**
|
|
49
71
|
* Save plurid application state to local storage,
|
|
50
72
|
* and load from local storage at startup.
|
|
51
73
|
*
|
|
52
74
|
* If multiple plurid applications run on the same origin,
|
|
53
75
|
* use the `id` property to differentiate between states.
|
|
76
|
+
*
|
|
77
|
+
* `LocalStorageUsage` differentiates between multiple local storages:
|
|
78
|
+
* for view, for user interface configuration.
|
|
54
79
|
*/
|
|
55
80
|
useLocalStorage?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Replace the internal plurid plane with a custom implementation.
|
|
83
|
+
*/
|
|
84
|
+
customPlane?: C;
|
|
85
|
+
matchedRoute?: IsoMatcherRouteResult<C>;
|
|
86
|
+
/**
|
|
87
|
+
* Used to identify the space if using `multispace`.
|
|
88
|
+
*/
|
|
89
|
+
space?: string;
|
|
90
|
+
}
|
|
91
|
+
export declare type PluridApplicationView = (string | PluridView)[];
|
|
92
|
+
export interface LocalStorageUsage {
|
|
93
|
+
view: boolean;
|
|
94
|
+
ui: boolean;
|
|
56
95
|
}
|
|
57
|
-
export declare type PluridApplicationView = string[] | PluridView[];
|
|
@@ -1,45 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* The `properties` will be passed to the `element` at runtime.
|
|
7
|
-
*/
|
|
8
|
-
properties?: Record<string, any>;
|
|
1
|
+
import { PluridRouteFragments } from '../router';
|
|
2
|
+
import { PluridPubSub } from '../pubsub';
|
|
3
|
+
export declare type ComponentWithPlurid<T, W> = T & WithPluridComponentProperty<W>;
|
|
4
|
+
export interface WithPluridComponentProperty<W> {
|
|
5
|
+
plurid: W;
|
|
9
6
|
}
|
|
10
|
-
export declare type
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
export declare type PlaneComponentWithPluridProperty<T> = ComponentWithPlurid<T, PluridPlaneComponentProperty>;
|
|
8
|
+
export declare type RouteComponentWithPluridProperty<T> = ComponentWithPlurid<T, PluridRouteComponentProperty>;
|
|
9
|
+
export interface PluridPlaneComponentProperty {
|
|
10
|
+
route: PluridRouteComponentProperty;
|
|
11
|
+
plane: PluridPlaneComponentPropertyPlane;
|
|
12
|
+
pubSub: PluridPubSub;
|
|
15
13
|
}
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
element: React.FC<ReactComponentWithPlurid<any>>;
|
|
23
|
-
}
|
|
24
|
-
export declare type ReactComponentWithPlurid<T> = T & WithPluridComponentProperty;
|
|
25
|
-
export interface WithPluridComponentProperty {
|
|
26
|
-
plurid: PluridComponentProperty;
|
|
27
|
-
}
|
|
28
|
-
export interface PluridComponentProperty {
|
|
29
|
-
metadata: PluridComponentPropertyMetadata;
|
|
30
|
-
route: PluridComponentPropertyRoute;
|
|
31
|
-
}
|
|
32
|
-
export interface PluridComponentPropertyMetadata {
|
|
14
|
+
export interface PluridPlaneComponentPropertyPlane {
|
|
15
|
+
value: string;
|
|
16
|
+
parameters: Record<string, string>;
|
|
17
|
+
query: Record<string, string>;
|
|
18
|
+
fragments: PluridRouteFragments;
|
|
33
19
|
planeID: string;
|
|
34
20
|
parentPlaneID?: string;
|
|
35
21
|
}
|
|
36
|
-
export interface
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
space: RouteDivision;
|
|
41
|
-
universe: RouteDivision;
|
|
42
|
-
cluster: RouteDivision;
|
|
43
|
-
plane: RoutePlaneDivision;
|
|
22
|
+
export interface PluridRouteComponentProperty {
|
|
23
|
+
value: string;
|
|
24
|
+
parameters: Record<string, string>;
|
|
25
|
+
query: Record<string, string>;
|
|
44
26
|
}
|
|
45
|
-
export declare type PluridComponent = PluridComponentElementQL | PluridComponentReact;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Theme, ThemeName } from '@plurid/plurid-themes';
|
|
2
2
|
import { SIZES, TRANSFORM_MODES, TRANSFORM_TOUCHES, TOOLBAR_DRAWERS } from "../../../enumerations/index";
|
|
3
|
-
import { RecursivePartial } from "../../helpers
|
|
4
|
-
import { PluridLayout } from
|
|
5
|
-
import { InternationalizationLanguageType } from
|
|
3
|
+
import { RecursivePartial } from "../../helpers";
|
|
4
|
+
import { PluridLayout } from '../layout';
|
|
5
|
+
import { InternationalizationLanguageType } from '../internationalization';
|
|
6
6
|
export declare type PluridPartialConfiguration = RecursivePartial<PluridConfiguration>;
|
|
7
7
|
export interface PluridConfiguration {
|
|
8
8
|
global: PluridConfigurationGlobal;
|
|
@@ -21,7 +21,7 @@ export interface PluridConfigurationGlobal {
|
|
|
21
21
|
* A theme name based on plurid themes, https://meta.plurid.com/themes,
|
|
22
22
|
* or specific theme names/objects for `general` and for the `interaction` elements.
|
|
23
23
|
*/
|
|
24
|
-
theme:
|
|
24
|
+
theme: ThemeName | PluridConfigurationTheme;
|
|
25
25
|
/**
|
|
26
26
|
* Supported languages:
|
|
27
27
|
*
|
|
@@ -56,8 +56,8 @@ export interface PluridConfigurationGlobal {
|
|
|
56
56
|
render: 'plurid' | 'legacy';
|
|
57
57
|
}
|
|
58
58
|
export interface PluridConfigurationTheme {
|
|
59
|
-
general:
|
|
60
|
-
interaction:
|
|
59
|
+
general: ThemeName | Theme;
|
|
60
|
+
interaction: ThemeName | Theme;
|
|
61
61
|
}
|
|
62
62
|
export interface PluridConfigurationSpace {
|
|
63
63
|
layout: PluridLayout;
|
|
@@ -95,6 +95,12 @@ export interface PluridConfigurationSpace {
|
|
|
95
95
|
transformTouch: keyof typeof TRANSFORM_TOUCHES;
|
|
96
96
|
firstPerson: boolean;
|
|
97
97
|
cullingDistance: number;
|
|
98
|
+
/**
|
|
99
|
+
* Time for the planes to fade in, in milliseconds.
|
|
100
|
+
*
|
|
101
|
+
* Default 1500
|
|
102
|
+
*/
|
|
103
|
+
fadeInTime: number;
|
|
98
104
|
}
|
|
99
105
|
export interface PluridConfigurationSpaceTransformOrigin {
|
|
100
106
|
show: boolean;
|
|
@@ -121,7 +127,8 @@ export interface PluridConfigurationElementsToolbar {
|
|
|
121
127
|
conceal: boolean;
|
|
122
128
|
transformIcons: boolean;
|
|
123
129
|
transformButtons: boolean;
|
|
124
|
-
|
|
130
|
+
drawers: (keyof typeof TOOLBAR_DRAWERS)[];
|
|
131
|
+
toggledDrawers: (keyof typeof TOOLBAR_DRAWERS)[];
|
|
125
132
|
}
|
|
126
133
|
export interface PluridConfigurationElementsViewcube {
|
|
127
134
|
show: boolean;
|
|
@@ -151,6 +158,10 @@ export interface PluridConfigurationElementsPlane {
|
|
|
151
158
|
}
|
|
152
159
|
export interface PluridConfigurationElementsPlaneControls {
|
|
153
160
|
show: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Show plane title.
|
|
163
|
+
*/
|
|
164
|
+
title: boolean;
|
|
154
165
|
pathbar: PluridConfigurationElementsPlaneControlsPathbar;
|
|
155
166
|
}
|
|
156
167
|
export interface PluridConfigurationElementsPlaneControlsPathbar {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import PluridPubSub from '@plurid/plurid-pubsub';
|
|
1
|
+
import { PluridPubSub } from '../pubsub';
|
|
3
2
|
export interface PluridApplicationConfiguratorProperties {
|
|
4
3
|
/**
|
|
5
4
|
* Publish/Subscribe bus based on `@plurid/plurid-pubsub`.
|
|
6
5
|
*/
|
|
7
6
|
pubsub?: PluridPubSub;
|
|
8
7
|
}
|
|
9
|
-
export interface PluridPlaneConfiguratorProperties {
|
|
8
|
+
export interface PluridPlaneConfiguratorProperties<S> {
|
|
10
9
|
theme: string;
|
|
11
|
-
style:
|
|
10
|
+
style: S;
|
|
12
11
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
1
|
+
export * from './application';
|
|
2
|
+
export * from './compare';
|
|
3
|
+
export * from './component';
|
|
4
|
+
export * from './configuration';
|
|
5
|
+
export * from './internationalization';
|
|
6
|
+
export * from './keys';
|
|
7
|
+
export * from './layout';
|
|
8
|
+
export * from './link';
|
|
9
|
+
export * from './metastate';
|
|
10
|
+
export * from './plane';
|
|
11
|
+
export * from './pubsub';
|
|
12
|
+
export * from './registrar';
|
|
13
|
+
export * from './router';
|
|
14
|
+
export * from './routing';
|
|
15
|
+
export * from './universe';
|
|
16
|
+
export * from './view';
|
|
17
|
+
export * from './window';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import internationalizationFields from "../../../constants/internationalization/fields";
|
|
2
|
+
export declare type InternationalizationChinese = 'chinese';
|
|
3
|
+
export declare type InternationalizationEnglish = 'english';
|
|
4
|
+
export declare type InternationalizationFrench = 'french';
|
|
5
|
+
export declare type InternationalizationGerman = 'german';
|
|
6
|
+
export declare type InternationalizationHindi = 'hindi';
|
|
7
|
+
export declare type InternationalizationItalian = 'italian';
|
|
8
|
+
export declare type InternationalizationJapanese = 'japanese';
|
|
9
|
+
export declare type InternationalizationRomanian = 'romanian';
|
|
10
|
+
export declare type InternationalizationRussian = 'russian';
|
|
11
|
+
export declare type InternationalizationSpanish = 'spanish';
|
|
12
|
+
export declare type InternationalizationLanguageType = InternationalizationChinese | InternationalizationEnglish | InternationalizationFrench | InternationalizationGerman | InternationalizationHindi | InternationalizationItalian | InternationalizationJapanese | InternationalizationRomanian | InternationalizationRussian | InternationalizationSpanish;
|
|
13
|
+
export declare type InternationalizationFields = typeof internationalizationFields;
|
|
14
|
+
export declare type InternationalizationFieldType = keyof InternationalizationFields;
|
|
15
|
+
export declare type Internationalization = Record<InternationalizationFieldType, string>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { PluridComponent } from "../component/index";
|
|
3
|
-
export interface PluridLink {
|
|
1
|
+
export interface PluridLink<C, S, M> {
|
|
4
2
|
/**
|
|
5
3
|
* The route of the plane.
|
|
6
4
|
*
|
|
@@ -117,17 +115,17 @@ export interface PluridLink {
|
|
|
117
115
|
/**
|
|
118
116
|
* Execute function at click (onClick Event).
|
|
119
117
|
*/
|
|
120
|
-
atClick?: (event?: MouseEvent |
|
|
118
|
+
atClick?: (event?: MouseEvent | M) => void;
|
|
121
119
|
/**
|
|
122
120
|
* Show or not the default Not Found component, or pass a custom component
|
|
123
121
|
*/
|
|
124
|
-
notFound?: boolean |
|
|
122
|
+
notFound?: boolean | C;
|
|
125
123
|
preview?: boolean;
|
|
126
124
|
previewFadeIn?: number;
|
|
127
125
|
previewFadeOut?: number;
|
|
128
126
|
previewOffsetX?: number;
|
|
129
127
|
previewOffsetY?: number;
|
|
130
|
-
previewComponent?:
|
|
131
|
-
style?:
|
|
128
|
+
previewComponent?: C;
|
|
129
|
+
style?: S;
|
|
132
130
|
className?: string;
|
|
133
131
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluridState } from
|
|
1
|
+
import { PluridState } from '../../internal/state';
|
|
2
2
|
export declare type PluridMetastateState = Pick<PluridState, 'configuration' | 'space' | 'ui'>;
|
|
3
3
|
export interface PluridMetastate {
|
|
4
4
|
states: Record<string, PluridMetastateState>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface PluridPlane {
|
|
1
|
+
import { PluridRouteParameter, PluridRouteFragments } from '../router';
|
|
2
|
+
export interface PluridPlaneOptions {
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Constraints for the parameters.
|
|
6
5
|
*/
|
|
7
|
-
|
|
6
|
+
parameters?: Record<string, PluridRouteParameter>;
|
|
7
|
+
}
|
|
8
|
+
export interface PluridPlaneObject<C> extends PluridPlaneOptions {
|
|
8
9
|
/**
|
|
9
10
|
* Route to the plane, e.g. `/plane-1`. By convention, it starts with an '/'.
|
|
10
11
|
*
|
|
@@ -33,32 +34,36 @@ export interface PluridPlane {
|
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
35
36
|
route: string;
|
|
37
|
+
/**
|
|
38
|
+
* Component to be rendered in the PluridPlane.
|
|
39
|
+
*/
|
|
40
|
+
component: C;
|
|
36
41
|
}
|
|
37
|
-
export declare type
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
export declare type PluridPlaneTuple<C> = [
|
|
43
|
+
/**
|
|
44
|
+
* See `PluridPlaneObject<C>.route`.
|
|
45
|
+
*/
|
|
46
|
+
route: string,
|
|
47
|
+
/**
|
|
48
|
+
* See `PluridPlaneObject<C>.component`.
|
|
49
|
+
*/
|
|
50
|
+
component: C,
|
|
51
|
+
/**
|
|
52
|
+
* See `PluridPlaneOptions`.
|
|
53
|
+
*/
|
|
54
|
+
options?: PluridPlaneOptions
|
|
55
|
+
];
|
|
56
|
+
export declare type PluridPlane<C> = PluridPlaneObject<C> | PluridPlaneTuple<C>;
|
|
57
|
+
export declare type PluridPlaneContext<T> = any;
|
|
49
58
|
export interface RouteSegment {
|
|
50
59
|
[key: string]: any;
|
|
51
60
|
}
|
|
52
|
-
export interface RegisteredPluridPlane {
|
|
61
|
+
export interface RegisteredPluridPlane<C> {
|
|
53
62
|
route: {
|
|
54
|
-
protocol: RouteSegment;
|
|
55
|
-
host: RouteSegment;
|
|
56
|
-
path: RouteSegment;
|
|
57
|
-
space: RouteSegment;
|
|
58
|
-
universe: RouteSegment;
|
|
59
|
-
cluster: RouteSegment;
|
|
60
|
-
plane: RouteSegment;
|
|
61
63
|
absolute: string;
|
|
64
|
+
fragments: PluridRouteFragments;
|
|
65
|
+
parameters: Record<string, string>;
|
|
66
|
+
query: Record<string, string>;
|
|
62
67
|
};
|
|
63
|
-
component:
|
|
68
|
+
component: C;
|
|
64
69
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export * from "./message";
|
|
1
|
+
import { PluridPubSubPublishMessage, PluridPubSubSubscribeMessage } from './message';
|
|
2
|
+
export * from './message';
|
|
4
3
|
export interface PluridPubSubOptions {
|
|
5
4
|
debug?: boolean;
|
|
6
5
|
}
|
|
7
6
|
export interface PluridPubSub {
|
|
8
7
|
publish(message: PluridPubSubPublishMessage): void;
|
|
9
|
-
subscribe(message: PluridPubSubSubscribeMessage):
|
|
10
|
-
unsubscribe(
|
|
8
|
+
subscribe(message: PluridPubSubSubscribeMessage): string;
|
|
9
|
+
unsubscribe(selector: string): boolean;
|
|
11
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { PLURID_PUBSUB_TOPIC } from "../../../constants/pubsub
|
|
1
|
+
import { PLURID_PUBSUB_TOPIC } from "../../../constants/pubsub";
|
|
2
|
+
import { PluridPartialConfiguration } from "../configuration";
|
|
2
3
|
export declare type PluridPubSubCallback<D = any> = (data: D) => void;
|
|
3
4
|
export interface PluridPubSubDataValueNumber {
|
|
4
5
|
value: number;
|
|
@@ -8,15 +9,15 @@ export interface PluridPubSubDataValueString {
|
|
|
8
9
|
}
|
|
9
10
|
export interface PluridPubSubPublishMessageConfiguration {
|
|
10
11
|
topic: typeof PLURID_PUBSUB_TOPIC.CONFIGURATION;
|
|
11
|
-
data:
|
|
12
|
+
data: PluridPartialConfiguration;
|
|
12
13
|
}
|
|
13
14
|
export interface PluridPubSubSubscribeMessageConfiguration {
|
|
14
15
|
topic: typeof PLURID_PUBSUB_TOPIC.CONFIGURATION;
|
|
15
|
-
callback: PluridPubSubCallback<
|
|
16
|
+
callback: PluridPubSubCallback<PluridPartialConfiguration>;
|
|
16
17
|
}
|
|
17
18
|
export interface PluridPubSubPublishMessageSpaceAnimatedTransform {
|
|
18
19
|
topic: typeof PLURID_PUBSUB_TOPIC.SPACE_ANIMATED_TRANSFORM;
|
|
19
|
-
data
|
|
20
|
+
data?: any;
|
|
20
21
|
}
|
|
21
22
|
export interface PluridPubSubSubscribeMessageSpaceAnimatedTransform {
|
|
22
23
|
topic: typeof PLURID_PUBSUB_TOPIC.SPACE_ANIMATED_TRANSFORM;
|
|
@@ -190,13 +191,25 @@ export interface PluridPubSubSubscribeMessageSpaceScaleWith {
|
|
|
190
191
|
topic: typeof PLURID_PUBSUB_TOPIC.SPACE_SCALE_WITH;
|
|
191
192
|
callback: PluridPubSubCallback<PluridPubSubDataValueNumber>;
|
|
192
193
|
}
|
|
194
|
+
export interface SpaceTransform {
|
|
195
|
+
rotationX: number;
|
|
196
|
+
rotationY: number;
|
|
197
|
+
translationX: number;
|
|
198
|
+
translationY: number;
|
|
199
|
+
translationZ: number;
|
|
200
|
+
scale: number;
|
|
201
|
+
}
|
|
202
|
+
export interface PluridPubSubMessageSpaceTransformData {
|
|
203
|
+
value: Partial<SpaceTransform>;
|
|
204
|
+
internal?: boolean;
|
|
205
|
+
}
|
|
193
206
|
export interface PluridPubSubPublishMessageSpaceTransform {
|
|
194
207
|
topic: typeof PLURID_PUBSUB_TOPIC.SPACE_TRANSFORM;
|
|
195
|
-
data
|
|
208
|
+
data?: PluridPubSubMessageSpaceTransformData;
|
|
196
209
|
}
|
|
197
210
|
export interface PluridPubSubSubscribeMessageSpaceTransform {
|
|
198
211
|
topic: typeof PLURID_PUBSUB_TOPIC.SPACE_TRANSFORM;
|
|
199
|
-
callback: PluridPubSubCallback<
|
|
212
|
+
callback: PluridPubSubCallback<PluridPubSubMessageSpaceTransformData>;
|
|
200
213
|
}
|
|
201
214
|
export interface PluridPubSubMessageViewAddPlaneData {
|
|
202
215
|
plane: string;
|
|
@@ -211,7 +224,7 @@ export interface PluridPubSubSubscribeMessageViewAddPlane {
|
|
|
211
224
|
}
|
|
212
225
|
export interface PluridPubSubPublishMessageViewSetPlanes {
|
|
213
226
|
topic: typeof PLURID_PUBSUB_TOPIC.VIEW_SET_PLANES;
|
|
214
|
-
data
|
|
227
|
+
data?: any;
|
|
215
228
|
}
|
|
216
229
|
export interface PluridPubSubSubscribeMessageViewSetPlanes {
|
|
217
230
|
topic: typeof PLURID_PUBSUB_TOPIC.VIEW_SET_PLANES;
|
|
@@ -228,5 +241,86 @@ export interface PluridPubSubSubscribeMessageViewRemovePlane {
|
|
|
228
241
|
topic: typeof PLURID_PUBSUB_TOPIC.VIEW_REMOVE_PLANE;
|
|
229
242
|
callback: PluridPubSubCallback<PluridPubSubMessageViewRemovePlaneData>;
|
|
230
243
|
}
|
|
231
|
-
export
|
|
232
|
-
|
|
244
|
+
export interface PluridPubSubMessageNavigateToPlane {
|
|
245
|
+
id: string;
|
|
246
|
+
}
|
|
247
|
+
export interface PluridPubSubPublishMessageNavigateToPlane {
|
|
248
|
+
topic: typeof PLURID_PUBSUB_TOPIC.NAVIGATE_TO_PLANE;
|
|
249
|
+
data: PluridPubSubMessageNavigateToPlane;
|
|
250
|
+
}
|
|
251
|
+
export interface PluridPubSubSubscribeMessageNavigateToPlane {
|
|
252
|
+
topic: typeof PLURID_PUBSUB_TOPIC.NAVIGATE_TO_PLANE;
|
|
253
|
+
callback: PluridPubSubCallback<PluridPubSubMessageNavigateToPlane>;
|
|
254
|
+
}
|
|
255
|
+
export interface PluridPubSubMessageRefreshPlane {
|
|
256
|
+
id: string;
|
|
257
|
+
}
|
|
258
|
+
export interface PluridPubSubPublishMessageRefreshPlane {
|
|
259
|
+
topic: typeof PLURID_PUBSUB_TOPIC.REFRESH_PLANE;
|
|
260
|
+
data: PluridPubSubMessageRefreshPlane;
|
|
261
|
+
}
|
|
262
|
+
export interface PluridPubSubSubscribeMessageRefreshPlane {
|
|
263
|
+
topic: typeof PLURID_PUBSUB_TOPIC.REFRESH_PLANE;
|
|
264
|
+
callback: PluridPubSubCallback<PluridPubSubMessageRefreshPlane>;
|
|
265
|
+
}
|
|
266
|
+
export interface PluridPubSubMessageIsolatePlane {
|
|
267
|
+
id: string;
|
|
268
|
+
}
|
|
269
|
+
export interface PluridPubSubPublishMessageIsolatePlane {
|
|
270
|
+
topic: typeof PLURID_PUBSUB_TOPIC.ISOLATE_PLANE;
|
|
271
|
+
data: PluridPubSubMessageIsolatePlane;
|
|
272
|
+
}
|
|
273
|
+
export interface PluridPubSubSubscribeMessageIsolatePlane {
|
|
274
|
+
topic: typeof PLURID_PUBSUB_TOPIC.ISOLATE_PLANE;
|
|
275
|
+
callback: PluridPubSubCallback<PluridPubSubMessageIsolatePlane>;
|
|
276
|
+
}
|
|
277
|
+
export interface PluridPubSubPublishMessageOpenClosedPlane {
|
|
278
|
+
topic: typeof PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE;
|
|
279
|
+
data?: any;
|
|
280
|
+
}
|
|
281
|
+
export interface PluridPubSubSubscribeMessageOpenClosedPlane {
|
|
282
|
+
topic: typeof PLURID_PUBSUB_TOPIC.OPEN_CLOSED_PLANE;
|
|
283
|
+
callback: PluridPubSubCallback<any>;
|
|
284
|
+
}
|
|
285
|
+
export interface PluridPubSubMessageClosePlane {
|
|
286
|
+
id: string;
|
|
287
|
+
}
|
|
288
|
+
export interface PluridPubSubPublishMessageClosePlane {
|
|
289
|
+
topic: typeof PLURID_PUBSUB_TOPIC.CLOSE_PLANE;
|
|
290
|
+
data: PluridPubSubMessageClosePlane;
|
|
291
|
+
}
|
|
292
|
+
export interface PluridPubSubSubscribeMessageClosePlane {
|
|
293
|
+
topic: typeof PLURID_PUBSUB_TOPIC.CLOSE_PLANE;
|
|
294
|
+
callback: PluridPubSubCallback<PluridPubSubMessageClosePlane>;
|
|
295
|
+
}
|
|
296
|
+
export interface PluridPubSubPublishMessagePreviousRoot {
|
|
297
|
+
topic: typeof PLURID_PUBSUB_TOPIC.PREVIOUS_ROOT;
|
|
298
|
+
data?: any;
|
|
299
|
+
}
|
|
300
|
+
export interface PluridPubSubSubscribeMessagePreviousRoot {
|
|
301
|
+
topic: typeof PLURID_PUBSUB_TOPIC.PREVIOUS_ROOT;
|
|
302
|
+
callback: PluridPubSubCallback<any>;
|
|
303
|
+
}
|
|
304
|
+
export interface PluridPubSubPublishMessageNextRoot {
|
|
305
|
+
topic: typeof PLURID_PUBSUB_TOPIC.NEXT_ROOT;
|
|
306
|
+
data?: any;
|
|
307
|
+
}
|
|
308
|
+
export interface PluridPubSubSubscribeMessageNextRoot {
|
|
309
|
+
topic: typeof PLURID_PUBSUB_TOPIC.NEXT_ROOT;
|
|
310
|
+
callback: PluridPubSubCallback<any>;
|
|
311
|
+
}
|
|
312
|
+
export declare type PluridPubSubMessageNavigateToRoot = {
|
|
313
|
+
index: number;
|
|
314
|
+
} | {
|
|
315
|
+
id: string;
|
|
316
|
+
};
|
|
317
|
+
export interface PluridPubSubPublishMessageNavigateToRoot {
|
|
318
|
+
topic: typeof PLURID_PUBSUB_TOPIC.NAVIGATE_TO_ROOT;
|
|
319
|
+
data: PluridPubSubMessageNavigateToRoot;
|
|
320
|
+
}
|
|
321
|
+
export interface PluridPubSubSubscribeMessageNavigateToRoot {
|
|
322
|
+
topic: typeof PLURID_PUBSUB_TOPIC.NAVIGATE_TO_ROOT;
|
|
323
|
+
callback: PluridPubSubCallback<PluridPubSubMessageNavigateToRoot>;
|
|
324
|
+
}
|
|
325
|
+
export declare type PluridPubSubPublishMessage = PluridPubSubPublishMessageConfiguration | PluridPubSubPublishMessageSpaceAnimatedTransform | PluridPubSubPublishMessageSpaceRotateUp | PluridPubSubPublishMessageSpaceRotateDown | PluridPubSubPublishMessageSpaceRotateLeft | PluridPubSubPublishMessageSpaceRotateRight | PluridPubSubPublishMessageSpaceRotateXWith | PluridPubSubPublishMessageSpaceRotateYWith | PluridPubSubPublishMessageSpaceRotateXTo | PluridPubSubPublishMessageSpaceRotateYTo | PluridPubSubPublishMessageSpaceTranslateUp | PluridPubSubPublishMessageSpaceTranslateDown | PluridPubSubPublishMessageSpaceTranslateLeft | PluridPubSubPublishMessageSpaceTranslateRight | PluridPubSubPublishMessageSpaceTranslateXWith | PluridPubSubPublishMessageSpaceTranslateYWith | PluridPubSubPublishMessageSpaceTranslateZWith | PluridPubSubPublishMessageSpaceTranslateXTo | PluridPubSubPublishMessageSpaceTranslateYTo | PluridPubSubPublishMessageSpaceTranslateZTo | PluridPubSubPublishMessageSpaceScaleUp | PluridPubSubPublishMessageSpaceScaleDown | PluridPubSubPublishMessageSpaceScaleWith | PluridPubSubPublishMessageSpaceTransform | PluridPubSubPublishMessageViewAddPlane | PluridPubSubPublishMessageViewSetPlanes | PluridPubSubPublishMessageViewRemovePlane | PluridPubSubPublishMessageNavigateToPlane | PluridPubSubPublishMessageRefreshPlane | PluridPubSubPublishMessageIsolatePlane | PluridPubSubPublishMessageOpenClosedPlane | PluridPubSubPublishMessageClosePlane | PluridPubSubPublishMessagePreviousRoot | PluridPubSubPublishMessageNextRoot | PluridPubSubPublishMessageNavigateToRoot;
|
|
326
|
+
export declare type PluridPubSubSubscribeMessage = PluridPubSubSubscribeMessageConfiguration | PluridPubSubSubscribeMessageSpaceAnimatedTransform | PluridPubSubSubscribeMessageSpaceRotateUp | PluridPubSubSubscribeMessageSpaceRotateDown | PluridPubSubSubscribeMessageSpaceRotateLeft | PluridPubSubSubscribeMessageSpaceRotateRight | PluridPubSubSubscribeMessageSpaceRotateXWith | PluridPubSubSubscribeMessageSpaceRotateYWith | PluridPubSubSubscribeMessageSpaceRotateXTo | PluridPubSubSubscribeMessageSpaceRotateYTo | PluridPubSubSubscribeMessageSpaceTranslateUp | PluridPubSubSubscribeMessageSpaceTranslateDown | PluridPubSubSubscribeMessageSpaceTranslateLeft | PluridPubSubSubscribeMessageSpaceTranslateRight | PluridPubSubSubscribeMessageSpaceTranslateXWith | PluridPubSubSubscribeMessageSpaceTranslateYWith | PluridPubSubSubscribeMessageSpaceTranslateZWith | PluridPubSubSubscribeMessageSpaceTranslateXTo | PluridPubSubSubscribeMessageSpaceTranslateYTo | PluridPubSubSubscribeMessageSpaceTranslateZTo | PluridPubSubSubscribeMessageSpaceScaleUp | PluridPubSubSubscribeMessageSpaceScaleDown | PluridPubSubSubscribeMessageSpaceScaleWith | PluridPubSubSubscribeMessageSpaceTransform | PluridPubSubSubscribeMessageViewAddPlane | PluridPubSubSubscribeMessageViewSetPlanes | PluridPubSubSubscribeMessageViewRemovePlane | PluridPubSubSubscribeMessageNavigateToPlane | PluridPubSubSubscribeMessageRefreshPlane | PluridPubSubSubscribeMessageIsolatePlane | PluridPubSubSubscribeMessageOpenClosedPlane | PluridPubSubSubscribeMessageClosePlane | PluridPubSubSubscribeMessagePreviousRoot | PluridPubSubSubscribeMessageNextRoot | PluridPubSubSubscribeMessageNavigateToRoot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PluridPlane, RegisteredPluridPlane } from
|
|
2
|
-
export interface PluridPlanesRegistrar {
|
|
3
|
-
register(planes: PluridPlane[]): void;
|
|
1
|
+
import { PluridPlane, RegisteredPluridPlane } from '../plane';
|
|
2
|
+
export interface PluridPlanesRegistrar<C> {
|
|
3
|
+
register(planes: PluridPlane<C>[]): void;
|
|
4
4
|
identify(): string[];
|
|
5
|
-
get(route: string): RegisteredPluridPlane | undefined;
|
|
6
|
-
getAll(): Map<string, RegisteredPluridPlane
|
|
5
|
+
get(route: string): RegisteredPluridPlane<C> | undefined;
|
|
6
|
+
getAll(): Map<string, RegisteredPluridPlane<C>>;
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface PluridRouteFragments {
|
|
2
|
+
texts: PluridRouteFragmentText[];
|
|
3
|
+
elements: PluridRouteFragmentElement[];
|
|
4
|
+
}
|
|
5
|
+
export interface PluridRouteFragment {
|
|
6
|
+
type: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PluridRouteFragmentText extends PluridRouteFragment {
|
|
9
|
+
type: 'text';
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
occurence: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PluridRouteFragmentElement extends PluridRouteFragment {
|
|
15
|
+
type: 'element';
|
|
16
|
+
id: string;
|
|
17
|
+
occurence: number;
|
|
18
|
+
}
|