@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.
Files changed (56) hide show
  1. package/distribution/constants/compare/index.d.ts +1 -1
  2. package/distribution/constants/configuration/index.d.ts +1 -1
  3. package/distribution/constants/index.d.ts +11 -11
  4. package/distribution/constants/internationalization/chinese/index.d.ts +1 -1
  5. package/distribution/constants/internationalization/english/index.d.ts +1 -1
  6. package/distribution/constants/internationalization/fields.d.ts +1 -1
  7. package/distribution/constants/internationalization/french/index.d.ts +1 -1
  8. package/distribution/constants/internationalization/german/index.d.ts +1 -1
  9. package/distribution/constants/internationalization/hindi/index.d.ts +1 -1
  10. package/distribution/constants/internationalization/index.d.ts +12 -12
  11. package/distribution/constants/internationalization/italian/index.d.ts +1 -1
  12. package/distribution/constants/internationalization/japanese/index.d.ts +1 -1
  13. package/distribution/constants/internationalization/languages.d.ts +1 -1
  14. package/distribution/constants/internationalization/romanian/index.d.ts +1 -1
  15. package/distribution/constants/internationalization/russian/index.d.ts +1 -1
  16. package/distribution/constants/internationalization/spanish/index.d.ts +1 -1
  17. package/distribution/constants/keys/index.d.ts +1 -1
  18. package/distribution/constants/pubsub/index.d.ts +2 -0
  19. package/distribution/constants/shortcuts/index.d.ts +2 -2
  20. package/distribution/constants/tree/index.d.ts +1 -1
  21. package/distribution/enumerations/index.d.ts +1 -1
  22. package/distribution/index.d.ts +3 -3
  23. package/distribution/index.es.js +2 -0
  24. package/distribution/index.es.js.map +1 -1
  25. package/distribution/index.js +2 -0
  26. package/distribution/index.js.map +1 -1
  27. package/distribution/interfaces/external/application/index.d.ts +34 -14
  28. package/distribution/interfaces/external/cluster/index.d.ts +5 -5
  29. package/distribution/interfaces/external/component/index.d.ts +18 -39
  30. package/distribution/interfaces/external/configuration/index.d.ts +16 -9
  31. package/distribution/interfaces/external/configurator/index.d.ts +1 -1
  32. package/distribution/interfaces/external/index.d.ts +17 -16
  33. package/distribution/interfaces/external/layout/index.d.ts +1 -1
  34. package/distribution/interfaces/external/link/index.d.ts +3 -4
  35. package/distribution/interfaces/external/metastate/index.d.ts +1 -1
  36. package/distribution/interfaces/external/plane/index.d.ts +32 -15
  37. package/distribution/interfaces/external/pubsub/index.d.ts +4 -4
  38. package/distribution/interfaces/external/pubsub/message.d.ts +4 -3
  39. package/distribution/interfaces/external/registrar/index.d.ts +5 -5
  40. package/distribution/interfaces/external/router/fragment/index.d.ts +18 -0
  41. package/distribution/interfaces/external/router/index.d.ts +19 -210
  42. package/distribution/interfaces/external/router/multispace/index.d.ts +14 -0
  43. package/distribution/interfaces/external/router/preserve/index.d.ts +70 -0
  44. package/distribution/interfaces/external/router/route/index.d.ts +163 -0
  45. package/distribution/interfaces/external/routing/index.d.ts +58 -0
  46. package/distribution/interfaces/external/universe/index.d.ts +6 -6
  47. package/distribution/interfaces/external/window/index.d.ts +3 -3
  48. package/distribution/interfaces/index.d.ts +3 -3
  49. package/distribution/interfaces/internal/context/index.d.ts +8 -5
  50. package/distribution/interfaces/internal/index.d.ts +7 -7
  51. package/distribution/interfaces/internal/plane/index.d.ts +2 -3
  52. package/distribution/interfaces/internal/shortcuts/index.d.ts +2 -2
  53. package/distribution/interfaces/internal/state/index.d.ts +6 -6
  54. package/distribution/interfaces/internal/tree/index.d.ts +1 -1
  55. package/distribution/interfaces/internal/universe/index.d.ts +8 -8
  56. package/package.json +13 -12
@@ -1,19 +1,19 @@
1
- import { PluridState } from "../../internal/state/index";
2
- import { PluridPlane, PluridPlaneContext } from "../plane/index";
3
- import { PluridComponent } from "../component/index";
4
- import { PluridView } from "../view/index";
5
- import { PluridPartialConfiguration } from "../configuration/index";
6
- import { IndexedPluridPlane } from "../plane/index";
7
- import { PluridPubSub } from "../pubsub/index";
8
- import { PluridPlanesRegistrar } from "../registrar/index";
9
- export interface PluridApplication {
1
+ import { PluridState } from '../../internal/state';
2
+ import { PluridPlane, PluridPlaneContext } from '../plane';
3
+ import { PluridView } from '../view';
4
+ import { PluridPartialConfiguration } from '../configuration';
5
+ import { IndexedPluridPlane } from '../plane';
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>;
11
+ indexedPlanes?: Map<string, IndexedPluridPlane<C>>;
12
12
  planesProperties?: Map<string, any>;
13
13
  /**
14
14
  * The planes which will be rendered by the `PluridApplication`.
15
15
  */
16
- planes?: PluridPlane[];
16
+ planes?: PluridPlane<C>[];
17
17
  /**
18
18
  * Optional context for the plane to have access to.
19
19
  */
@@ -28,9 +28,17 @@ export interface PluridApplication {
28
28
  view: PluridApplicationView;
29
29
  /**
30
30
  * Show or not the default Plane Not Found component, or pass a custom component.
31
+ *
32
+ * Default `true`.
33
+ */
34
+ planeNotFound?: boolean | C;
35
+ /**
36
+ * Use or not Plurid Plane Error Boundary and show the default Plurid Plane Render Error component,
37
+ * or pass a custom component.
38
+ *
31
39
  * Default `true`.
32
40
  */
33
- notFound?: boolean | PluridComponent;
41
+ planeRenderError?: boolean | C;
34
42
  /**
35
43
  * Application-wide partial configuration.
36
44
  */
@@ -44,14 +52,26 @@ export interface PluridApplication {
44
52
  */
45
53
  static?: boolean;
46
54
  precomputedState?: Partial<PluridState>;
47
- planesRegistrar?: PluridPlanesRegistrar;
55
+ planesRegistrar?: PluridPlanesRegistrar<C>;
48
56
  /**
49
57
  * Save plurid application state to local storage,
50
58
  * and load from local storage at startup.
51
59
  *
52
60
  * If multiple plurid applications run on the same origin,
53
61
  * use the `id` property to differentiate between states.
62
+ *
63
+ * `LocalStorageUsage` differentiates between multiple local storages:
64
+ * for view, for user interface configuration.
54
65
  */
55
66
  useLocalStorage?: boolean;
67
+ /**
68
+ * Replace the internal plurid plane with a custom implementation.
69
+ */
70
+ customPlane?: C;
71
+ matchedRoute: IsoMatcherRouteResult<C>;
72
+ }
73
+ export declare type PluridApplicationView = (string | PluridView)[];
74
+ export interface LocalStorageUsage {
75
+ view: boolean;
76
+ ui: boolean;
56
77
  }
57
- export declare type PluridApplicationView = string[] | PluridView[];
@@ -1,9 +1,9 @@
1
- import { PluridPlane } from "../plane/index";
2
- import { PluridLayout } from "../layout/index";
3
- export interface PluridCluster {
1
+ import { PluridPlane } from '../plane';
2
+ import { PluridLayout } from '../layout';
3
+ export interface PluridCluster<C> {
4
4
  id: string;
5
5
  name?: string;
6
- planes?: PluridPlane[];
7
- clusters?: PluridCluster[];
6
+ planes?: PluridPlane<C>[];
7
+ clusters?: PluridCluster<C>[];
8
8
  layout?: PluridLayout;
9
9
  }
@@ -1,45 +1,24 @@
1
- import React from 'react';
2
- import { RouteHostDivision, RouteDivision, RouteHostProtocol, RoutePlaneDivision } from "../../internal/tree/index";
3
- export interface PluridComponentBase {
4
- kind: PluridComponentKind;
5
- /**
6
- * The `properties` will be passed to the `element` at runtime.
7
- */
8
- properties?: Record<string, any>;
1
+ import { PluridRouteFragments } from '../router';
2
+ export declare type ComponentWithPlurid<T, W> = T & WithPluridComponentProperty<W>;
3
+ export interface WithPluridComponentProperty<W> {
4
+ plurid: W;
9
5
  }
10
- export declare type PluridComponentKind = 'elementql' | 'react';
11
- export interface PluridComponentElementQL extends PluridComponentBase {
12
- kind: 'elementql';
13
- endpoint: string;
14
- element: string;
6
+ export declare type PlaneComponentWithPluridProperty<T> = ComponentWithPlurid<T, PluridPlaneComponentProperty>;
7
+ export declare type RouteComponentWithPluridProperty<T> = ComponentWithPlurid<T, PluridRouteComponentProperty>;
8
+ export interface PluridPlaneComponentProperty {
9
+ route: PluridRouteComponentProperty;
10
+ plane: PluridPlaneComponentPropertyPlane;
15
11
  }
16
- export interface PluridComponentReact extends PluridComponentBase {
17
- kind: 'react';
18
- /**
19
- * The `element` will receive the properties, if any,
20
- * and the `plurid` property.
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 {
12
+ export interface PluridPlaneComponentPropertyPlane {
13
+ value: string;
14
+ parameters: Record<string, string>;
15
+ query: Record<string, string>;
16
+ fragments: PluridRouteFragments;
33
17
  planeID: string;
34
18
  parentPlaneID?: string;
35
19
  }
36
- export interface PluridComponentPropertyRoute {
37
- protocol: RouteHostProtocol;
38
- host: RouteHostDivision;
39
- path: RouteDivision;
40
- space: RouteDivision;
41
- universe: RouteDivision;
42
- cluster: RouteDivision;
43
- plane: RoutePlaneDivision;
20
+ export interface PluridRouteComponentProperty {
21
+ value: string;
22
+ parameters: Record<string, string>;
23
+ query: Record<string, string>;
44
24
  }
45
- export declare type PluridComponent = PluridComponentElementQL | PluridComponentReact;
@@ -1,8 +1,8 @@
1
- import themes, { Theme } from '@plurid/plurid-themes';
2
- import { SIZES, TRANSFORM_MODES, TRANSFORM_TOUCHES, TOOLBAR_DRAWERS } from "../../../enumerations/index";
3
- import { RecursivePartial } from "../../helpers/index";
4
- import { PluridLayout } from "../layout/index";
5
- import { InternationalizationLanguageType } from "../../internal/internationalization/index";
1
+ import { Theme, ThemeName } from '@plurid/plurid-themes';
2
+ import { SIZES, TRANSFORM_MODES, TRANSFORM_TOUCHES, TOOLBAR_DRAWERS } from '../../../enumerations';
3
+ import { RecursivePartial } from '../../helpers';
4
+ import { PluridLayout } from '../layout';
5
+ import { InternationalizationLanguageType } from '../../internal/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: keyof typeof themes | PluridConfigurationTheme;
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: keyof typeof themes | Theme;
60
- interaction: keyof typeof themes | Theme;
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
- toggledDrawers: (keyof typeof TOOLBAR_DRAWERS | undefined)[];
130
+ drawers: (keyof typeof TOOLBAR_DRAWERS)[];
131
+ toggledDrawers: (keyof typeof TOOLBAR_DRAWERS)[];
125
132
  }
126
133
  export interface PluridConfigurationElementsViewcube {
127
134
  show: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import PluridPubSub from '@plurid/plurid-pubsub';
2
+ import { PluridPubSub } from '../pubsub';
3
3
  export interface PluridApplicationConfiguratorProperties {
4
4
  /**
5
5
  * Publish/Subscribe bus based on `@plurid/plurid-pubsub`.
@@ -1,16 +1,17 @@
1
- export * from "./application/index";
2
- export * from "./cluster/index";
3
- export * from "./compare/index";
4
- export * from "./component/index";
5
- export * from "./configuration/index";
6
- export * from "./keys/index";
7
- export * from "./layout/index";
8
- export * from "./link/index";
9
- export * from "./metastate/index";
10
- export * from "./plane/index";
11
- export * from "./pubsub/index";
12
- export * from "./registrar/index";
13
- export * from "./router/index";
14
- export * from "./universe/index";
15
- export * from "./view/index";
16
- export * from "./window/index";
1
+ export * from './application';
2
+ export * from './cluster';
3
+ export * from './compare';
4
+ export * from './component';
5
+ export * from './configuration';
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';
@@ -1,4 +1,4 @@
1
- import { LAYOUT_TYPES } from "../../../enumerations/index";
1
+ import { LAYOUT_TYPES } from '../../../enumerations';
2
2
  export interface Layout {
3
3
  type: keyof typeof LAYOUT_TYPES;
4
4
  }
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { PluridComponent } from "../component/index";
3
- export interface PluridLink {
2
+ export interface PluridLink<C> {
4
3
  /**
5
4
  * The route of the plane.
6
5
  *
@@ -121,13 +120,13 @@ export interface PluridLink {
121
120
  /**
122
121
  * Show or not the default Not Found component, or pass a custom component
123
122
  */
124
- notFound?: boolean | PluridComponent;
123
+ notFound?: boolean | C;
125
124
  preview?: boolean;
126
125
  previewFadeIn?: number;
127
126
  previewFadeOut?: number;
128
127
  previewOffsetX?: number;
129
128
  previewOffsetY?: number;
130
- previewComponent?: PluridComponent;
129
+ previewComponent?: C;
131
130
  style?: React.CSSProperties;
132
131
  className?: string;
133
132
  }
@@ -1,4 +1,4 @@
1
- import { PluridState } from "../../internal/state/index";
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,12 @@
1
1
  /// <reference types="react" />
2
- import { PluridComponent } from "../component/index";
3
- export interface PluridPlane {
2
+ import { PluridRouteParameter, PluridRouteFragments } from '../router';
3
+ export interface PluridPlaneOptions {
4
4
  /**
5
- * Custom HTML, React, Vue, or Angular component to be rendered in the PluridPlane.
5
+ * Constraints for the parameters.
6
6
  */
7
- component: PluridComponent;
7
+ parameters?: Record<string, PluridRouteParameter>;
8
+ }
9
+ export interface PluridPlaneObject<C> extends PluridPlaneOptions {
8
10
  /**
9
11
  * Route to the plane, e.g. `/plane-1`. By convention, it starts with an '/'.
10
12
  *
@@ -33,9 +35,28 @@ export interface PluridPlane {
33
35
  *
34
36
  */
35
37
  route: string;
38
+ /**
39
+ * Component to be rendered in the PluridPlane.
40
+ */
41
+ component: C;
36
42
  }
43
+ export declare type PluridPlaneTuple<C> = [
44
+ /**
45
+ * See `PluridPlaneObject<C>.route`.
46
+ */
47
+ route: string,
48
+ /**
49
+ * See `PluridPlaneObject<C>.component`.
50
+ */
51
+ component: C,
52
+ /**
53
+ * See `PluridPlaneOptions`.
54
+ */
55
+ options?: PluridPlaneOptions
56
+ ];
57
+ export declare type PluridPlane<C> = PluridPlaneObject<C> | PluridPlaneTuple<C>;
37
58
  export declare type PluridPlaneContext<T> = React.Context<T>;
38
- export interface IndexedPluridPlane {
59
+ export interface IndexedPluridPlane<C> {
39
60
  protocol: string;
40
61
  host: string;
41
62
  path: string;
@@ -44,21 +65,17 @@ export interface IndexedPluridPlane {
44
65
  cluster: string;
45
66
  plane: string;
46
67
  route: string;
47
- component: PluridComponent;
68
+ component: C;
48
69
  }
49
70
  export interface RouteSegment {
50
71
  [key: string]: any;
51
72
  }
52
- export interface RegisteredPluridPlane {
73
+ export interface RegisteredPluridPlane<C> {
53
74
  route: {
54
- protocol: RouteSegment;
55
- host: RouteSegment;
56
- path: RouteSegment;
57
- space: RouteSegment;
58
- universe: RouteSegment;
59
- cluster: RouteSegment;
60
- plane: RouteSegment;
61
75
  absolute: string;
76
+ fragments: PluridRouteFragments;
77
+ parameters: Record<string, string>;
78
+ query: Record<string, string>;
62
79
  };
63
- component: PluridComponent;
80
+ component: C;
64
81
  }
@@ -1,11 +1,11 @@
1
- import { PluridPubSubTopic } from "../../../constants/pubsub/index";
2
- import { PluridPubSubPublishMessage, PluridPubSubSubscribeMessage } from "./message";
3
- export * from "./message";
1
+ import { PluridPubSubTopicKeysType } from "../../../constants/pubsub";
2
+ import { PluridPubSubPublishMessage, PluridPubSubSubscribeMessage } from './message';
3
+ export * from './message';
4
4
  export interface PluridPubSubOptions {
5
5
  debug?: boolean;
6
6
  }
7
7
  export interface PluridPubSub {
8
8
  publish(message: PluridPubSubPublishMessage): void;
9
9
  subscribe(message: PluridPubSubSubscribeMessage): number;
10
- unsubscribe(index: number, topic: PluridPubSubTopic): boolean;
10
+ unsubscribe(index: number, topic: PluridPubSubTopicKeysType): boolean;
11
11
  }
@@ -1,4 +1,5 @@
1
- import { PLURID_PUBSUB_TOPIC } from "../../../constants/pubsub/index";
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,11 +9,11 @@ export interface PluridPubSubDataValueString {
8
9
  }
9
10
  export interface PluridPubSubPublishMessageConfiguration {
10
11
  topic: typeof PLURID_PUBSUB_TOPIC.CONFIGURATION;
11
- data: any;
12
+ data: PluridPartialConfiguration;
12
13
  }
13
14
  export interface PluridPubSubSubscribeMessageConfiguration {
14
15
  topic: typeof PLURID_PUBSUB_TOPIC.CONFIGURATION;
15
- callback: PluridPubSubCallback<any>;
16
+ callback: PluridPubSubCallback<PluridPartialConfiguration>;
16
17
  }
17
18
  export interface PluridPubSubPublishMessageSpaceAnimatedTransform {
18
19
  topic: typeof PLURID_PUBSUB_TOPIC.SPACE_ANIMATED_TRANSFORM;
@@ -1,7 +1,7 @@
1
- import { PluridPlane, RegisteredPluridPlane } from "../plane/index";
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
+ }