@plurid/plurid-data 0.0.0-1 → 0.0.0-10
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/index.d.ts +11 -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 +1 -1
- 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 +12 -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/pubsub/index.d.ts +2 -0
- package/distribution/constants/shortcuts/index.d.ts +2 -2
- package/distribution/constants/tree/index.d.ts +1 -1
- package/distribution/enumerations/index.d.ts +1 -1
- package/distribution/index.d.ts +3 -3
- package/distribution/index.es.js +2 -0
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +2 -0
- package/distribution/index.js.map +1 -1
- package/distribution/interfaces/external/application/index.d.ts +34 -14
- package/distribution/interfaces/external/cluster/index.d.ts +5 -5
- package/distribution/interfaces/external/component/index.d.ts +18 -39
- package/distribution/interfaces/external/configuration/index.d.ts +16 -9
- package/distribution/interfaces/external/configurator/index.d.ts +1 -1
- package/distribution/interfaces/external/index.d.ts +17 -16
- package/distribution/interfaces/external/layout/index.d.ts +1 -1
- package/distribution/interfaces/external/link/index.d.ts +3 -4
- package/distribution/interfaces/external/metastate/index.d.ts +1 -1
- package/distribution/interfaces/external/plane/index.d.ts +32 -15
- package/distribution/interfaces/external/pubsub/index.d.ts +4 -4
- package/distribution/interfaces/external/pubsub/message.d.ts +4 -3
- 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 +19 -210
- 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 +163 -0
- package/distribution/interfaces/external/routing/index.d.ts +58 -0
- package/distribution/interfaces/external/universe/index.d.ts +6 -6
- 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 +8 -5
- package/distribution/interfaces/internal/index.d.ts +7 -7
- package/distribution/interfaces/internal/plane/index.d.ts +2 -3
- package/distribution/interfaces/internal/shortcuts/index.d.ts +2 -2
- package/distribution/interfaces/internal/state/index.d.ts +6 -6
- package/distribution/interfaces/internal/tree/index.d.ts +1 -1
- package/distribution/interfaces/internal/universe/index.d.ts +8 -8
- package/package.json +13 -12
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { PluridRoute, PluridRoutePlane } from './route';
|
|
2
|
+
export interface PluridRouterProperties<C> {
|
|
3
|
+
routes: PluridRoute<C>[];
|
|
4
|
+
/**
|
|
5
|
+
* Plurid planes not specific to any route.
|
|
6
|
+
*/
|
|
7
|
+
planes?: PluridRoutePlane<C>[];
|
|
6
8
|
/**
|
|
7
9
|
* Component to be rendered outside of the current `path` component and of the `shell`.
|
|
8
10
|
*/
|
|
9
|
-
exterior?:
|
|
11
|
+
exterior?: C;
|
|
10
12
|
/**
|
|
11
13
|
* Component to wrap around the current path component.
|
|
12
14
|
*/
|
|
13
|
-
shell?:
|
|
15
|
+
shell?: C;
|
|
14
16
|
/**
|
|
15
17
|
* Path to navigate to when using clean navigation.
|
|
16
18
|
*/
|
|
@@ -45,7 +47,7 @@ export interface PluridRouterProperties {
|
|
|
45
47
|
/**
|
|
46
48
|
* Component to be rendered on the gateway path, external to the plurid view.
|
|
47
49
|
*/
|
|
48
|
-
gatewayExterior?:
|
|
50
|
+
gatewayExterior?: C;
|
|
49
51
|
/**
|
|
50
52
|
* Redirect not found paths to this path.
|
|
51
53
|
* Default: `/not-found`.
|
|
@@ -55,210 +57,17 @@ export interface PluridRouterProperties {
|
|
|
55
57
|
* API endpoint to request the elements for the paths not found in the initial routing.
|
|
56
58
|
*/
|
|
57
59
|
api?: string;
|
|
58
|
-
static?:
|
|
59
|
-
}
|
|
60
|
-
export interface PluridRouterStatic {
|
|
61
|
-
path: string;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* A route can be `plurid space` or `exterior`-based.
|
|
65
|
-
*/
|
|
66
|
-
export interface PluridRoute {
|
|
67
|
-
/**
|
|
68
|
-
* The route `value` can:
|
|
69
|
-
* + be a simple string, e.g. `'/route/to/page'`;
|
|
70
|
-
* + be a parametric location, e.g. `'/route/to/:page'`, where `:page` is the parameter name;
|
|
71
|
-
* + receive query `key=value` pairs,
|
|
72
|
-
* e.g. `'/route/to/page?id=1&show=true'`, where `id=1` and `show=true` are `key=value` pairs;
|
|
73
|
-
*/
|
|
74
|
-
value: string;
|
|
75
|
-
parameters?: Record<string, PluridRouteParameter>;
|
|
76
|
-
/**
|
|
77
|
-
* Accepts a component which will be rendered outside of the `spaces`.
|
|
78
|
-
*/
|
|
79
|
-
exterior?: PluridComponent;
|
|
80
|
-
/**
|
|
81
|
-
* A path can have planes and/or spaces.
|
|
82
|
-
*
|
|
83
|
-
* Planes will be assigned to the `default` space, `default` universe, `default` cluster.
|
|
84
|
-
*/
|
|
85
|
-
planes?: PluridRoutePlane[];
|
|
86
|
-
view?: string[];
|
|
87
|
-
/**
|
|
88
|
-
* A path can have planes and/or spaces.
|
|
89
|
-
*/
|
|
90
|
-
spaces?: PluridRouteSpace[];
|
|
91
|
-
/**
|
|
92
|
-
* Pass the rendered `spaces[]` components as a property to the `exterior` component
|
|
93
|
-
* to be rendered in particular slots.
|
|
94
|
-
*/
|
|
95
|
-
slotted?: boolean;
|
|
96
|
-
multispace?: PluridRouteMultispace;
|
|
97
|
-
defaultConfiguration?: PluridPartialConfiguration;
|
|
98
|
-
}
|
|
99
|
-
export interface PluridPreserve<C = undefined> {
|
|
60
|
+
static?: PluridRouterStatic;
|
|
100
61
|
/**
|
|
101
|
-
*
|
|
62
|
+
* Replace the internal plurid plane with a custom implementation.
|
|
102
63
|
*/
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The function will be executed and awaited before rendering the application on the server.
|
|
106
|
-
*
|
|
107
|
-
* The function can return one or more providers which will be passed to their appropriate consumers,
|
|
108
|
-
* can redirect to a different path, or can handle any cross-cutting concerns, such as eventing or logging.
|
|
109
|
-
*/
|
|
110
|
-
onServe: PluridPreserveOnServe<C>;
|
|
111
|
-
/**
|
|
112
|
-
* Function called after route is served successfully.
|
|
113
|
-
*/
|
|
114
|
-
afterServe?: PluridPreserveAfterServe<C>;
|
|
115
|
-
/**
|
|
116
|
-
* Function called if `onServe` throws an error.
|
|
117
|
-
*/
|
|
118
|
-
onError?: PluridPreserveOnError<C>;
|
|
64
|
+
customPlane?: C;
|
|
119
65
|
}
|
|
120
|
-
export
|
|
121
|
-
export declare type PluridPreserveAfterServe<C> = (transmission: PluridPreserveTransmission<C | undefined>) => Promise<void>;
|
|
122
|
-
export declare type PluridPreserveOnError<C> = (error: any, transmission: PluridPreserveTransmission<C | undefined>) => Promise<PluridPreserveResponse | void>;
|
|
123
|
-
export interface PluridPreserveTransmission<C = undefined> {
|
|
124
|
-
request: any;
|
|
125
|
-
response: any;
|
|
126
|
-
context: PluridPreserveTransmissionContext<C>;
|
|
127
|
-
}
|
|
128
|
-
export interface PluridPreserveTransmissionContext<C = undefined> {
|
|
66
|
+
export interface PluridRouterStatic {
|
|
129
67
|
path: string;
|
|
130
|
-
|
|
131
|
-
match: {
|
|
132
|
-
target: string;
|
|
133
|
-
source: string;
|
|
134
|
-
elements: any;
|
|
135
|
-
parameters?: Record<string, string>;
|
|
136
|
-
};
|
|
137
|
-
contextualizers: C;
|
|
138
|
-
}
|
|
139
|
-
export interface PluridPreserveResponse {
|
|
140
|
-
providers?: PluridPreserveResponseProviders;
|
|
141
|
-
/**
|
|
142
|
-
* Redirect to another route.
|
|
143
|
-
*/
|
|
144
|
-
redirect?: string;
|
|
145
|
-
/**
|
|
146
|
-
* If `response` is handled within the preserve `action`, set the `responded` value to `true`,
|
|
147
|
-
* to prevent the server from sending a double response.
|
|
148
|
-
*/
|
|
149
|
-
responded?: boolean;
|
|
150
|
-
/**
|
|
151
|
-
* Handle the server response without taking into account the preserve.
|
|
152
|
-
* Considers only the first match.
|
|
153
|
-
*/
|
|
154
|
-
depreserve?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Ignore the preserve computation, but continue to try to find a match in the preserves array.
|
|
157
|
-
* To be used with the catch-all matcher `'*'` or with complex routing with overlapping parameters.
|
|
158
|
-
*/
|
|
159
|
-
pass?: boolean;
|
|
160
|
-
}
|
|
161
|
-
export interface PluridPreserveResponseProviders {
|
|
162
|
-
apollo?: any;
|
|
163
|
-
redux?: any;
|
|
164
|
-
plurid?: any;
|
|
165
|
-
}
|
|
166
|
-
export interface PluridRouteParameter {
|
|
167
|
-
/**
|
|
168
|
-
* Constrain the path parameter to be of a certain length.
|
|
169
|
-
*/
|
|
170
|
-
length?: number;
|
|
171
|
-
/**
|
|
172
|
-
* Ensure that the `length` of the path is of a certain type:
|
|
173
|
-
*
|
|
174
|
-
* * `'=='` - equal,
|
|
175
|
-
* * `'<='` - equal or less than,
|
|
176
|
-
* * `'<'` - less than,
|
|
177
|
-
* * `'>='` - equal or greater than,
|
|
178
|
-
* * `'>'` - greater than.
|
|
179
|
-
*
|
|
180
|
-
* Default `'<='`, if a `length` is provided.
|
|
181
|
-
*/
|
|
182
|
-
lengthType?: CompareType;
|
|
183
|
-
startsWith?: string;
|
|
184
|
-
endsWith?: string;
|
|
185
|
-
includes?: string[];
|
|
186
|
-
}
|
|
187
|
-
export interface PluridRouteSpace {
|
|
188
|
-
value: string;
|
|
189
|
-
/**
|
|
190
|
-
* Accepts a component which will be rendered outside of the `space`.
|
|
191
|
-
*/
|
|
192
|
-
exterior?: PluridComponent;
|
|
193
|
-
/**
|
|
194
|
-
* A space can have planes and/or universes.
|
|
195
|
-
*
|
|
196
|
-
* Planes will be assigned to the `default` universe, `default` cluster.
|
|
197
|
-
*/
|
|
198
|
-
planes?: PluridRoutePlane[];
|
|
199
|
-
view?: string[];
|
|
200
|
-
/**
|
|
201
|
-
* A space can have planes and/or universes.
|
|
202
|
-
*/
|
|
203
|
-
universes?: PluridRouteUniverse[];
|
|
204
|
-
configuration?: PluridPartialConfiguration;
|
|
205
|
-
}
|
|
206
|
-
export interface PluridRouteUniverse {
|
|
207
|
-
value: string;
|
|
208
|
-
/**
|
|
209
|
-
* An universe can have planes and/or clusters.
|
|
210
|
-
*
|
|
211
|
-
* Planes will be assigned to the `default` cluster.
|
|
212
|
-
*/
|
|
213
|
-
planes?: PluridRoutePlane[];
|
|
214
|
-
clusters?: PluridRouteCluster[];
|
|
215
|
-
}
|
|
216
|
-
export interface PluridRouteCluster {
|
|
217
|
-
value: string;
|
|
218
|
-
planes: PluridRoutePlane[];
|
|
219
|
-
}
|
|
220
|
-
export interface PluridRoutePlane {
|
|
221
|
-
component: PluridComponent;
|
|
222
|
-
value: string;
|
|
223
|
-
/**
|
|
224
|
-
* Map a direct link for a specific plane.
|
|
225
|
-
*
|
|
226
|
-
* e.g. `/plane-one` will route in browser the path `protocol://host/plane-one`
|
|
227
|
-
*/
|
|
228
|
-
link?: string;
|
|
229
|
-
/**
|
|
230
|
-
* On direct link access, show the plane in a `plurid` space,
|
|
231
|
-
* or as the legacy view of an web page.
|
|
232
|
-
*/
|
|
233
|
-
linkView?: 'legacy' | 'plurid';
|
|
234
|
-
}
|
|
235
|
-
export interface PluridRouteMultispace {
|
|
236
|
-
/**
|
|
237
|
-
* Default: `y`.
|
|
238
|
-
*/
|
|
239
|
-
alignment?: 'x' | 'y';
|
|
240
|
-
/**
|
|
241
|
-
* Default: `mandatory`.
|
|
242
|
-
*/
|
|
243
|
-
snapType?: 'none' | 'mandatory' | 'proximity';
|
|
244
|
-
header?: PluridComponent;
|
|
245
|
-
footer?: PluridComponent;
|
|
246
|
-
}
|
|
247
|
-
export interface PluridRouteFragments {
|
|
248
|
-
texts: PluridRouteFragmentText[];
|
|
249
|
-
elements: PluridRouteFragmentElement[];
|
|
250
|
-
}
|
|
251
|
-
export interface PluridRouteFragment {
|
|
252
|
-
type: string;
|
|
253
|
-
}
|
|
254
|
-
export interface PluridRouteFragmentText extends PluridRouteFragment {
|
|
255
|
-
type: 'text';
|
|
256
|
-
start: string;
|
|
257
|
-
end: string;
|
|
258
|
-
occurence: number;
|
|
259
|
-
}
|
|
260
|
-
export interface PluridRouteFragmentElement extends PluridRouteFragment {
|
|
261
|
-
type: 'element';
|
|
262
|
-
id: string;
|
|
263
|
-
occurence: number;
|
|
68
|
+
directPlane?: string;
|
|
264
69
|
}
|
|
70
|
+
export * from './fragment';
|
|
71
|
+
export * from './multispace';
|
|
72
|
+
export * from './preserve';
|
|
73
|
+
export * from './route';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare type PluridRouteMultispaceAlignment = 'x' | 'y';
|
|
2
|
+
export declare type PluridRouteMultispaceSnapType = 'none' | 'mandatory' | 'proximity';
|
|
3
|
+
export interface PluridRouteMultispace<C> {
|
|
4
|
+
/**
|
|
5
|
+
* Default: `y`.
|
|
6
|
+
*/
|
|
7
|
+
alignment?: PluridRouteMultispaceAlignment;
|
|
8
|
+
/**
|
|
9
|
+
* Default: `mandatory`.
|
|
10
|
+
*/
|
|
11
|
+
snapType?: PluridRouteMultispaceSnapType;
|
|
12
|
+
header?: C;
|
|
13
|
+
footer?: C;
|
|
14
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface PluridPreserve<M = any, RQ = any, RS = any> {
|
|
2
|
+
/**
|
|
3
|
+
* Served path value.
|
|
4
|
+
*/
|
|
5
|
+
serve: string;
|
|
6
|
+
/**
|
|
7
|
+
* The function will be executed and awaited before rendering the application on the server.
|
|
8
|
+
*
|
|
9
|
+
* The function can return one or more providers which will be passed to their appropriate consumers,
|
|
10
|
+
* can redirect to a different path, or can handle any cross-cutting concerns, such as eventing or logging.
|
|
11
|
+
*/
|
|
12
|
+
onServe: PluridPreserveOnServe<M, RQ, RS>;
|
|
13
|
+
/**
|
|
14
|
+
* Function called after route is served successfully.
|
|
15
|
+
*/
|
|
16
|
+
afterServe?: PluridPreserveAfterServe<M, RQ, RS>;
|
|
17
|
+
/**
|
|
18
|
+
* Function called if `onServe` throws an error.
|
|
19
|
+
*/
|
|
20
|
+
onError?: PluridPreserveOnError<M, RQ, RS>;
|
|
21
|
+
}
|
|
22
|
+
export declare type PluridPreserveOnServe<M, RQ, RS> = (transmission: PluridPreserveTransmission<M, RQ, RS>) => Promise<PluridPreserveResponse | undefined>;
|
|
23
|
+
export declare type PluridPreserveAfterServe<M, RQ, RS> = (transmission: PluridPreserveTransmission<M, RQ, RS>) => Promise<undefined>;
|
|
24
|
+
export declare type PluridPreserveOnError<M, RQ, RS> = (error: any, transmission: PluridPreserveTransmission<M, RQ, RS>) => Promise<PluridPreserveResponse | undefined>;
|
|
25
|
+
export interface PluridPreserveTransmission<M, RQ, RS> {
|
|
26
|
+
context: PluridPreserveTransmissionContext<M>;
|
|
27
|
+
request: RQ;
|
|
28
|
+
response: RS;
|
|
29
|
+
}
|
|
30
|
+
export interface PluridPreserveTransmissionContext<M = undefined> {
|
|
31
|
+
match: M;
|
|
32
|
+
route: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PluridPreserveResponse {
|
|
35
|
+
providers?: PluridPreserveResponseProviders;
|
|
36
|
+
/**
|
|
37
|
+
* Redirect to another route.
|
|
38
|
+
*/
|
|
39
|
+
redirect?: string;
|
|
40
|
+
/**
|
|
41
|
+
* If `response` is handled within the preserve `action`, set the `responded` value to `true`,
|
|
42
|
+
* to prevent the server from sending a double response.
|
|
43
|
+
*/
|
|
44
|
+
responded?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Handle the server response without taking into account the preserve.
|
|
47
|
+
* Considers only the first match.
|
|
48
|
+
*/
|
|
49
|
+
depreserve?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Ignore the preserve computation, but continue to try to find a match in the preserves array.
|
|
52
|
+
* To be used with the catch-all matcher `'*'` or with complex routing with overlapping parameters.
|
|
53
|
+
*/
|
|
54
|
+
pass?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Key-value pairs which will be inserted as globals on the window as in
|
|
57
|
+
* `window.${key} = ${value}`.
|
|
58
|
+
*/
|
|
59
|
+
globals?: Record<string, string>;
|
|
60
|
+
template?: PluridPreserveResponseTemplate;
|
|
61
|
+
}
|
|
62
|
+
export declare type PluridPreserveResponseProviders = Record<string, any>;
|
|
63
|
+
export interface PluridPreserveResponseTemplate {
|
|
64
|
+
htmlLanguage?: string;
|
|
65
|
+
htmlAttributes?: Record<string, string>;
|
|
66
|
+
bodyAttributes?: Record<string, string>;
|
|
67
|
+
headScripts?: string[];
|
|
68
|
+
bodyScripts?: string[];
|
|
69
|
+
styles?: string[];
|
|
70
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { PluridPartialConfiguration } from "../../configuration";
|
|
2
|
+
import { CompareType } from "../../compare";
|
|
3
|
+
import { PluridRouteMultispace } from '../multispace';
|
|
4
|
+
/**
|
|
5
|
+
* A route can be `plurid space` or `exterior`-based.
|
|
6
|
+
*/
|
|
7
|
+
export interface PluridRoute<C> {
|
|
8
|
+
/**
|
|
9
|
+
* The route `value` can:
|
|
10
|
+
* + be a simple string, e.g. `'/route/to/page'`;
|
|
11
|
+
* + be a parametric location, e.g. `'/route/to/:page'`, where `:page` is the parameter name;
|
|
12
|
+
* + receive query `key=value` pairs,
|
|
13
|
+
* e.g. `'/route/to/page?id=1&show=true'`, where `id=1` and `show=true` are `key=value` pairs;
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
parameters?: Record<string, PluridRouteParameter>;
|
|
17
|
+
/**
|
|
18
|
+
* Accepts a component which will be rendered outside of the `spaces`.
|
|
19
|
+
*/
|
|
20
|
+
exterior?: C;
|
|
21
|
+
/**
|
|
22
|
+
* A path can have planes and/or spaces.
|
|
23
|
+
*
|
|
24
|
+
* Planes will be assigned to the `default` space, `default` universe, `default` cluster.
|
|
25
|
+
*/
|
|
26
|
+
planes?: PluridRoutePlane<C>[];
|
|
27
|
+
view?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* A path can have planes and/or spaces.
|
|
30
|
+
*/
|
|
31
|
+
spaces?: PluridRouteSpace<C>[];
|
|
32
|
+
/**
|
|
33
|
+
* Pass the rendered `spaces[]` components as a property to the `exterior` component
|
|
34
|
+
* to be rendered in particular slots.
|
|
35
|
+
*/
|
|
36
|
+
slotted?: boolean;
|
|
37
|
+
multispace?: PluridRouteMultispace<C>;
|
|
38
|
+
defaultConfiguration?: PluridPartialConfiguration;
|
|
39
|
+
}
|
|
40
|
+
export interface PluridRouteParameter {
|
|
41
|
+
/**
|
|
42
|
+
* Constrain the route parameter to be of a certain length.
|
|
43
|
+
*/
|
|
44
|
+
length?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Ensure that the `length` of the route parameter is of a certain type:
|
|
47
|
+
*
|
|
48
|
+
* * `'=='` - equal,
|
|
49
|
+
* * `'<='` - equal or less than,
|
|
50
|
+
* * `'<'` - less than,
|
|
51
|
+
* * `'>='` - equal or greater than,
|
|
52
|
+
* * `'>'` - greater than.
|
|
53
|
+
*
|
|
54
|
+
* Default `'<='`, if a `length` is provided.
|
|
55
|
+
*/
|
|
56
|
+
lengthType?: CompareType;
|
|
57
|
+
startsWith?: string;
|
|
58
|
+
endsWith?: string;
|
|
59
|
+
includes?: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface PluridRouteSpace<C> {
|
|
62
|
+
value: string;
|
|
63
|
+
/**
|
|
64
|
+
* Accepts a component which will be rendered outside of the `space`.
|
|
65
|
+
*/
|
|
66
|
+
exterior?: C;
|
|
67
|
+
/**
|
|
68
|
+
* A space can have planes and/or universes.
|
|
69
|
+
*
|
|
70
|
+
* Planes will be assigned to the `default` universe, `default` cluster.
|
|
71
|
+
*/
|
|
72
|
+
planes?: PluridRoutePlane<C>[];
|
|
73
|
+
view?: string[];
|
|
74
|
+
/**
|
|
75
|
+
* A space can have planes and/or universes.
|
|
76
|
+
*/
|
|
77
|
+
universes?: PluridRouteUniverse<C>[];
|
|
78
|
+
configuration?: PluridPartialConfiguration;
|
|
79
|
+
}
|
|
80
|
+
export interface PluridRouteUniverse<C> {
|
|
81
|
+
value: string;
|
|
82
|
+
/**
|
|
83
|
+
* An universe can have planes and/or clusters.
|
|
84
|
+
*
|
|
85
|
+
* Planes will be assigned to the `default` cluster.
|
|
86
|
+
*/
|
|
87
|
+
planes?: PluridRoutePlane<C>[];
|
|
88
|
+
clusters?: PluridRouteCluster<C>[];
|
|
89
|
+
}
|
|
90
|
+
export interface PluridRouteCluster<C> {
|
|
91
|
+
value: string;
|
|
92
|
+
planes: PluridRoutePlane<C>[];
|
|
93
|
+
}
|
|
94
|
+
export interface PluridRoutePlaneOptions {
|
|
95
|
+
/**
|
|
96
|
+
* Map a direct link for a specific plane.
|
|
97
|
+
*
|
|
98
|
+
* e.g. `/plane-one` will route in browser the path `protocol://host/plane-one`
|
|
99
|
+
*
|
|
100
|
+
* Default composed from route and plane value, `/<route.value/<plane.value>`
|
|
101
|
+
*/
|
|
102
|
+
link?: string;
|
|
103
|
+
/**
|
|
104
|
+
* On direct link access (from the browser), show the plane in a `plurid` space,
|
|
105
|
+
* or as the legacy view of an web page.
|
|
106
|
+
*
|
|
107
|
+
* Default `'plurid'`
|
|
108
|
+
*/
|
|
109
|
+
linkView?: 'legacy' | 'plurid';
|
|
110
|
+
/**
|
|
111
|
+
* Injectable into other `plurid` spaces.
|
|
112
|
+
*
|
|
113
|
+
* Default `true`
|
|
114
|
+
*/
|
|
115
|
+
injectable?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Direct access to the plane from the browser.
|
|
118
|
+
*
|
|
119
|
+
* Default plane link composed from route and plane value, `/<route.value/<plane.value>`;
|
|
120
|
+
* changeable through the `link` property.
|
|
121
|
+
*
|
|
122
|
+
* Default `true`
|
|
123
|
+
*/
|
|
124
|
+
urlable?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Access to the plane through the `gateway` path.
|
|
127
|
+
*
|
|
128
|
+
* Default `true`
|
|
129
|
+
*/
|
|
130
|
+
gateable?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Render route exterior when directly accessed.
|
|
133
|
+
*
|
|
134
|
+
* Default `true`
|
|
135
|
+
*/
|
|
136
|
+
directExterior?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Render route exterior when injected into other `plurid` space.
|
|
139
|
+
*
|
|
140
|
+
* Default `false`
|
|
141
|
+
*/
|
|
142
|
+
injectExterior?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Constraints for the parameters.
|
|
145
|
+
*/
|
|
146
|
+
parameters?: Record<string, PluridRouteParameter>;
|
|
147
|
+
}
|
|
148
|
+
export interface PluridRoutePlaneObject<C> extends PluridRoutePlaneOptions {
|
|
149
|
+
value: string;
|
|
150
|
+
component: C;
|
|
151
|
+
}
|
|
152
|
+
export declare type PluridRoutePlaneTuple<C> = [
|
|
153
|
+
/**
|
|
154
|
+
* See `PluridRoutePlaneObject<C>.value`.
|
|
155
|
+
*/
|
|
156
|
+
value: string,
|
|
157
|
+
/**
|
|
158
|
+
* See `PluridRoutePlaneObject<C>.component`.
|
|
159
|
+
*/
|
|
160
|
+
component: C,
|
|
161
|
+
options?: PluridRoutePlaneOptions
|
|
162
|
+
];
|
|
163
|
+
export declare type PluridRoutePlane<C> = PluridRoutePlaneObject<C> | PluridRoutePlaneTuple<C>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PluridRoute, PluridRoutePlane, PluridRoutePlaneObject, PluridRouteFragments } from '../router';
|
|
2
|
+
import { PluridPlane, PluridPlaneObject } from '../plane';
|
|
3
|
+
export interface IsoMatcherData<C> {
|
|
4
|
+
routes?: PluridRoute<C>[];
|
|
5
|
+
routePlanes?: PluridRoutePlane<C>[];
|
|
6
|
+
planes?: PluridPlane<C>[];
|
|
7
|
+
}
|
|
8
|
+
export declare type IsoMatcherContext = 'route' | 'plane';
|
|
9
|
+
export interface IsoMatcherResultBase {
|
|
10
|
+
value: string;
|
|
11
|
+
parameters: Record<string, string>;
|
|
12
|
+
query: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
export interface IsoMatcherRouteResultBase {
|
|
15
|
+
match: IsoMatcherResultBase;
|
|
16
|
+
}
|
|
17
|
+
export interface IsoMatcherRouteResultRoute<C> extends IsoMatcherRouteResultBase {
|
|
18
|
+
kind: 'Route';
|
|
19
|
+
data: PluridRoute<C>;
|
|
20
|
+
}
|
|
21
|
+
export interface IsoMatcherRouteResultRoutePlane<C> extends IsoMatcherRouteResultBase {
|
|
22
|
+
kind: 'RoutePlane';
|
|
23
|
+
data: PluridRoutePlaneObject<C>;
|
|
24
|
+
}
|
|
25
|
+
export declare type IsoMatcherRouteResult<C> = IsoMatcherRouteResultRoute<C> | IsoMatcherRouteResultRoutePlane<C>;
|
|
26
|
+
export interface IsoMatcherIndexedRoute<C> {
|
|
27
|
+
data: PluridRoute<C>;
|
|
28
|
+
}
|
|
29
|
+
export declare type IsoMatcherPlaneType = 'Plane' | 'RoutePlane';
|
|
30
|
+
export interface IsoMatcherPlaneResultMatch extends IsoMatcherResultBase {
|
|
31
|
+
fragments: PluridRouteFragments;
|
|
32
|
+
}
|
|
33
|
+
export interface IsoMatcherPlaneResultBase<C> {
|
|
34
|
+
parent?: string;
|
|
35
|
+
match: IsoMatcherPlaneResultMatch;
|
|
36
|
+
}
|
|
37
|
+
export interface IsoMatcherPlaneResultPlane<C> extends IsoMatcherPlaneResultBase<C> {
|
|
38
|
+
kind: 'Plane';
|
|
39
|
+
data: PluridPlaneObject<C>;
|
|
40
|
+
}
|
|
41
|
+
export interface IsoMatcherPlaneResultRoutePlane<C> extends IsoMatcherPlaneResultBase<C> {
|
|
42
|
+
kind: 'RoutePlane';
|
|
43
|
+
data: PluridRoutePlaneObject<C>;
|
|
44
|
+
}
|
|
45
|
+
export declare type IsoMatcherPlaneResult<C> = IsoMatcherPlaneResultPlane<C> | IsoMatcherPlaneResultRoutePlane<C>;
|
|
46
|
+
export declare type IsoMatcherResult<C> = IsoMatcherRouteResult<C> | IsoMatcherPlaneResult<C>;
|
|
47
|
+
export interface IsoMatcherIndexedPlaneBase<C> {
|
|
48
|
+
parent?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface IsoMatcherIndexedPlanePlane<C> extends IsoMatcherIndexedPlaneBase<C> {
|
|
51
|
+
kind: 'Plane';
|
|
52
|
+
data: PluridPlaneObject<C>;
|
|
53
|
+
}
|
|
54
|
+
export interface IsoMatcherIndexedPlaneRoutePlane<C> extends IsoMatcherIndexedPlaneBase<C> {
|
|
55
|
+
kind: 'RoutePlane';
|
|
56
|
+
data: PluridRoutePlaneObject<C>;
|
|
57
|
+
}
|
|
58
|
+
export declare type IsoMatcherIndexedPlane<C> = IsoMatcherIndexedPlanePlane<C> | IsoMatcherIndexedPlaneRoutePlane<C>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PluridPlane } from
|
|
2
|
-
import { PluridCluster } from
|
|
3
|
-
import { PluridView } from
|
|
4
|
-
export interface PluridUniverse {
|
|
1
|
+
import { PluridPlane } from '../plane';
|
|
2
|
+
import { PluridCluster } from '../cluster';
|
|
3
|
+
import { PluridView } from '../view';
|
|
4
|
+
export interface PluridUniverse<C> {
|
|
5
5
|
/**
|
|
6
6
|
* Optional, application-wide unique identifier.
|
|
7
7
|
*/
|
|
@@ -10,7 +10,7 @@ export interface PluridUniverse {
|
|
|
10
10
|
* Must be unique if IDs not provided.
|
|
11
11
|
*/
|
|
12
12
|
name: string;
|
|
13
|
-
planes: PluridPlane[];
|
|
13
|
+
planes: PluridPlane<C>[];
|
|
14
14
|
/**
|
|
15
15
|
* By default, the order the documents are shown in is based on their index in the `documents[]`.
|
|
16
16
|
* The ordinal can be used to overrule the default order.
|
|
@@ -33,5 +33,5 @@ export interface PluridUniverse {
|
|
|
33
33
|
* A cluster ensures the rendering of all the pages that it contains
|
|
34
34
|
* in the same space zone.
|
|
35
35
|
*/
|
|
36
|
-
clusters?: PluridCluster[];
|
|
36
|
+
clusters?: PluridCluster<C>[];
|
|
37
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluridPlanesRegistrar } from
|
|
2
|
-
export declare type PluridalWindow = typeof window & {
|
|
3
|
-
__pluridPlanesRegistrar__: PluridPlanesRegistrar
|
|
1
|
+
import { PluridPlanesRegistrar } from '../registrar';
|
|
2
|
+
export declare type PluridalWindow<C> = typeof window & {
|
|
3
|
+
__pluridPlanesRegistrar__: PluridPlanesRegistrar<C>;
|
|
4
4
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from './external';
|
|
2
|
+
export * from './internal';
|
|
3
|
+
export * from './helpers';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { PluridPlaneContext } from "../../external/plane
|
|
2
|
-
import { PluridPlanesRegistrar } from "../../external/registrar
|
|
3
|
-
import { PluridPubSub } from "../../external/pubsub
|
|
4
|
-
export interface PluridContext {
|
|
5
|
-
planesRegistrar?: PluridPlanesRegistrar
|
|
1
|
+
import { PluridPlaneContext } from "../../external/plane";
|
|
2
|
+
import { PluridPlanesRegistrar } from "../../external/registrar";
|
|
3
|
+
import { PluridPubSub } from "../../external/pubsub";
|
|
4
|
+
export interface PluridContext<C> {
|
|
5
|
+
planesRegistrar?: PluridPlanesRegistrar<C>;
|
|
6
6
|
planeContext?: PluridPlaneContext<any>;
|
|
7
7
|
planeContextValue?: any;
|
|
8
|
+
customPlane?: C;
|
|
9
|
+
planeNotFound?: boolean | C;
|
|
10
|
+
planeRenderError?: boolean | C;
|
|
8
11
|
registerPubSub: (pubsub: PluridPubSub) => void;
|
|
9
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
1
|
+
export * from './context';
|
|
2
|
+
export * from './internationalization';
|
|
3
|
+
export * from './plane';
|
|
4
|
+
export * from './shortcuts';
|
|
5
|
+
export * from './state';
|
|
6
|
+
export * from './tree';
|
|
7
|
+
export * from './universe';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { PluridComponent } from "../../external/index";
|
|
2
1
|
export interface PluridInternalPlane {
|
|
3
2
|
id: string;
|
|
4
3
|
path: string;
|
|
5
4
|
}
|
|
6
5
|
export interface PluridInternalStatePlane extends PluridInternalPlane {
|
|
7
6
|
}
|
|
8
|
-
export interface PluridInternalContextPlane extends PluridInternalPlane {
|
|
9
|
-
component:
|
|
7
|
+
export interface PluridInternalContextPlane<C> extends PluridInternalPlane {
|
|
8
|
+
component: C;
|
|
10
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SHORTCUTS } from
|
|
2
|
-
import { InternationalizationFieldType } from
|
|
1
|
+
import { SHORTCUTS } from '../../../enumerations';
|
|
2
|
+
import { InternationalizationFieldType } from '../internationalization';
|
|
3
3
|
export interface ShortcutName {
|
|
4
4
|
name: InternationalizationFieldType;
|
|
5
5
|
internationalizedKey?: boolean;
|