graphwise-reactodia 0.0.1-TR1 → 0.0.1-TR10
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/README.md +115 -1
- package/dist/cjs/graphwise-reactodia.cjs.entry.js +27276 -41135
- package/dist/cjs/graphwise-reactodia.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +69 -34
- package/dist/collection/components/graphwise-reactodia/i18n/language-key.js +5 -0
- package/dist/collection/components/graphwise-reactodia/i18n/translations.js +3 -1
- package/dist/collection/components/graphwise-reactodia/models/clear-diagram-storage-event.js +5 -0
- package/dist/collection/components/graphwise-reactodia/models/reactodia-config.js +1 -0
- package/dist/collection/components/graphwise-reactodia/models/subscription-list.js +35 -0
- package/dist/collection/components/graphwise-reactodia/models/subscription.js +1 -0
- package/dist/collection/components/graphwise-reactodia/models/triple.js +1 -0
- package/dist/collection/components/graphwise-reactodia/providers/service/service-inject.js +15 -0
- package/dist/collection/components/graphwise-reactodia/providers/service/service.js +19 -0
- package/dist/collection/components/graphwise-reactodia/providers/service/service.provider.js +20 -0
- package/dist/collection/components/graphwise-reactodia/reactodia-app.js +107 -17
- package/dist/collection/components/graphwise-reactodia/services/diagram/diagram.service.js +54 -0
- package/dist/collection/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.js +55 -0
- package/dist/collection/components/graphwise-reactodia/services/event/event.service.js +35 -0
- package/dist/collection/components/graphwise-reactodia/services/window/window.service.js +24 -0
- package/dist/collection/components/graphwise-reactodia/styles/type-style.resolver.js +53 -0
- package/dist/collection/components/graphwise-reactodia/testing/storage.mock.js +35 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/pages/graphwise-reactodia/main.js +50 -0
- package/dist/esm/graphwise-reactodia.entry.js +27273 -41132
- package/dist/esm/graphwise-reactodia.js +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/loader.js +1 -1
- package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
- package/dist/graphwise-reactodia/index.esm.js +1 -0
- package/dist/graphwise-reactodia/p-b56c58a0.entry.js +1 -0
- package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +25 -12
- package/dist/types/components/graphwise-reactodia/i18n/language-key.d.ts +4 -0
- package/dist/types/components/graphwise-reactodia/i18n/translations.d.ts +2 -343
- package/dist/types/components/graphwise-reactodia/models/clear-diagram-storage-event.d.ts +5 -0
- package/dist/types/components/graphwise-reactodia/models/reactodia-app-props.d.ts +15 -14
- package/dist/types/components/graphwise-reactodia/models/reactodia-config.d.ts +31 -0
- package/dist/types/components/graphwise-reactodia/models/subscription-list.d.ts +26 -0
- package/dist/types/components/graphwise-reactodia/models/subscription.d.ts +4 -0
- package/dist/types/components/graphwise-reactodia/models/triple.d.ts +19 -0
- package/dist/types/components/graphwise-reactodia/providers/service/service-inject.d.ts +13 -0
- package/dist/types/components/graphwise-reactodia/providers/service/service.d.ts +28 -0
- package/dist/types/components/graphwise-reactodia/providers/service/service.provider.d.ts +16 -0
- package/dist/types/components/graphwise-reactodia/services/diagram/diagram.service.d.ts +26 -0
- package/dist/types/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.d.ts +26 -0
- package/dist/types/components/graphwise-reactodia/services/event/event.service.d.ts +14 -0
- package/dist/types/components/graphwise-reactodia/services/window/window.service.d.ts +7 -0
- package/dist/types/components/graphwise-reactodia/styles/type-style.resolver.d.ts +11 -0
- package/dist/types/components/graphwise-reactodia/testing/storage.mock.d.ts +18 -0
- package/dist/types/components.d.ts +37 -25
- package/dist/types/index.d.ts +1 -1
- package/package.json +31 -8
- package/dist/graphwise-reactodia/p-bafd6be5.entry.js +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SerializedDiagram } from '@reactodia/workspace';
|
|
2
|
+
/**
|
|
3
|
+
* Service for local store-related diagram operations
|
|
4
|
+
*/
|
|
5
|
+
export declare class DiagramStorageService {
|
|
6
|
+
static readonly ID = "DiagramStorageService";
|
|
7
|
+
private static readonly STORAGE_KEY;
|
|
8
|
+
/**
|
|
9
|
+
* Load the persisted diagram from the local store, or `undefined` when nothing is stored (or the stored value
|
|
10
|
+
* is unreadable).
|
|
11
|
+
*/
|
|
12
|
+
load(): SerializedDiagram | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Persists the given diagram serialization.
|
|
15
|
+
*/
|
|
16
|
+
save(diagram: SerializedDiagram): void;
|
|
17
|
+
/**
|
|
18
|
+
* Removes the persisted diagram. Used when a new view (a seed) should take precedence over
|
|
19
|
+
* previously saved edits.
|
|
20
|
+
*/
|
|
21
|
+
clear(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Local storage getter
|
|
24
|
+
*/
|
|
25
|
+
private get storage();
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Subscription } from '../../models/subscription';
|
|
2
|
+
/**
|
|
3
|
+
* Service for event based operations
|
|
4
|
+
*/
|
|
5
|
+
export declare class EventService {
|
|
6
|
+
static readonly ID = "EventService";
|
|
7
|
+
/**
|
|
8
|
+
* Subscribes to the host's "clear persisted diagram" command.
|
|
9
|
+
*
|
|
10
|
+
* @param onClear Called whenever the event fires.
|
|
11
|
+
* @returns A {@link Subscription} that, when called, removes the listener.
|
|
12
|
+
*/
|
|
13
|
+
subscribeToClearDiagramStorage(onClear: () => void): Subscription;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypeStyleResolver } from '@reactodia/workspace';
|
|
2
|
+
/**
|
|
3
|
+
* Colors an element by its type: each type takes the next color from the palette, which wraps
|
|
4
|
+
* around once it runs out
|
|
5
|
+
*
|
|
6
|
+
* Returns `undefined` for elements without a type (placeholders and other non-entity elements) and
|
|
7
|
+
* when the host does not define the palette, leaving Reactodia to fall back to its own hash-based
|
|
8
|
+
* colors.
|
|
9
|
+
*/
|
|
10
|
+
export declare const resolveTypeStyle: TypeStyleResolver;
|
|
11
|
+
export declare const resetColors: () => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal in-memory {@link Storage}, so services that read `localStorage` can be exercised
|
|
3
|
+
* without a real browser store and asserted against directly. Shared across test suites.
|
|
4
|
+
*/
|
|
5
|
+
export declare class StorageMock implements Storage {
|
|
6
|
+
private readonly store;
|
|
7
|
+
get length(): number;
|
|
8
|
+
clear(): void;
|
|
9
|
+
getItem(key: string): string | null;
|
|
10
|
+
key(index: number): string | null;
|
|
11
|
+
removeItem(key: string): void;
|
|
12
|
+
setItem(key: string, value: string): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a fresh {@link StorageMock}. Suites install the returned instance as the global
|
|
16
|
+
* `localStorage` themselves.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createStorageMock(): StorageMock;
|
|
@@ -5,45 +5,53 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import { ReactodiaConfig } from "./components/graphwise-reactodia/models/reactodia-config";
|
|
9
|
+
import { LanguageKey } from "./components/graphwise-reactodia/i18n/language-key";
|
|
10
|
+
import { SparqlDataProviderSettings } from "@reactodia/workspace";
|
|
11
|
+
export { ReactodiaConfig } from "./components/graphwise-reactodia/models/reactodia-config";
|
|
12
|
+
export { LanguageKey } from "./components/graphwise-reactodia/i18n/language-key";
|
|
13
|
+
export { SparqlDataProviderSettings } from "@reactodia/workspace";
|
|
10
14
|
export namespace Components {
|
|
11
15
|
/**
|
|
12
16
|
* A web component that renders a graph with the Reactodia workspace.
|
|
13
17
|
* The component is backed by a SPARQL endpoint but is endpoint-agnostic: the host passes
|
|
14
|
-
* the active repository's endpoint via `current-repository` and a `queryFunction`
|
|
15
|
-
* performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
16
|
-
* through them; the canvas starts empty and the user populates it via the search bar.
|
|
18
|
+
* the active repository's endpoint via `current-repository` and a `config.queryFunction`
|
|
19
|
+
* that performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
20
|
+
* lazily through them; the canvas starts empty and the user populates it via the search bar.
|
|
17
21
|
* The component is a thin wrapper around Reactodia: query configuration lives outside the
|
|
18
22
|
* wrapper and is supplied through the `providerSettings` prop.
|
|
19
23
|
*/
|
|
20
24
|
interface GraphwiseReactodia {
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
26
|
+
* Host-supplied configuration: the SPARQL `queryFunction` transport and an optional `seed` set of entities to pre-populate the canvas with. A DOM property (an object, not an attribute) passed in from outside the wrapper. Read once on mount; not watched, as it only sets up the data source and initial canvas.
|
|
23
27
|
*/
|
|
24
|
-
"
|
|
28
|
+
"config"?: ReactodiaConfig;
|
|
29
|
+
/**
|
|
30
|
+
* The active repository id. Appended to {@link queryFunction } as the request `url`; changing it re-points the graph at the new repository (and resets the canvas), which is how runtime repository changes are handled.
|
|
31
|
+
*/
|
|
32
|
+
"currentRepository"?: string;
|
|
25
33
|
/**
|
|
26
34
|
* UI language code (e.g. `en`, `fr`) for the Reactodia interface. Defaults to English.
|
|
27
|
-
* @default
|
|
35
|
+
* @default LanguageKey.EN
|
|
28
36
|
*/
|
|
29
|
-
"language":
|
|
37
|
+
"language": LanguageKey;
|
|
30
38
|
/**
|
|
31
39
|
* Query preset for the SPARQL data provider, owned and configured by the host. A DOM property (an object, not an attribute) passed in from outside the wrapper. When omitted, the data provider falls back to Reactodia's generic OWL/RDFS preset. Changing it rebuilds the data provider and resets the canvas.
|
|
32
40
|
*/
|
|
33
41
|
"providerSettings"?: SparqlDataProviderSettings;
|
|
34
42
|
/**
|
|
35
|
-
*
|
|
43
|
+
* The theme currently applied by the host (e.g. `light`, `dark`). The value itself is never read - the node colors are taken from the host's CSS custom properties - it only signals that those values have changed. The host owns the theme, including whether it follows the OS color scheme, so the change is passed in instead of being detected here.
|
|
36
44
|
*/
|
|
37
|
-
"
|
|
45
|
+
"theme"?: string;
|
|
38
46
|
}
|
|
39
47
|
}
|
|
40
48
|
declare global {
|
|
41
49
|
/**
|
|
42
50
|
* A web component that renders a graph with the Reactodia workspace.
|
|
43
51
|
* The component is backed by a SPARQL endpoint but is endpoint-agnostic: the host passes
|
|
44
|
-
* the active repository's endpoint via `current-repository` and a `queryFunction`
|
|
45
|
-
* performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
46
|
-
* through them; the canvas starts empty and the user populates it via the search bar.
|
|
52
|
+
* the active repository's endpoint via `current-repository` and a `config.queryFunction`
|
|
53
|
+
* that performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
54
|
+
* lazily through them; the canvas starts empty and the user populates it via the search bar.
|
|
47
55
|
* The component is a thin wrapper around Reactodia: query configuration lives outside the
|
|
48
56
|
* wrapper and is supplied through the `providerSettings` prop.
|
|
49
57
|
*/
|
|
@@ -61,30 +69,34 @@ declare namespace LocalJSX {
|
|
|
61
69
|
/**
|
|
62
70
|
* A web component that renders a graph with the Reactodia workspace.
|
|
63
71
|
* The component is backed by a SPARQL endpoint but is endpoint-agnostic: the host passes
|
|
64
|
-
* the active repository's endpoint via `current-repository` and a `queryFunction`
|
|
65
|
-
* performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
66
|
-
* through them; the canvas starts empty and the user populates it via the search bar.
|
|
72
|
+
* the active repository's endpoint via `current-repository` and a `config.queryFunction`
|
|
73
|
+
* that performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
74
|
+
* lazily through them; the canvas starts empty and the user populates it via the search bar.
|
|
67
75
|
* The component is a thin wrapper around Reactodia: query configuration lives outside the
|
|
68
76
|
* wrapper and is supplied through the `providerSettings` prop.
|
|
69
77
|
*/
|
|
70
78
|
interface GraphwiseReactodia {
|
|
71
79
|
/**
|
|
72
|
-
*
|
|
80
|
+
* Host-supplied configuration: the SPARQL `queryFunction` transport and an optional `seed` set of entities to pre-populate the canvas with. A DOM property (an object, not an attribute) passed in from outside the wrapper. Read once on mount; not watched, as it only sets up the data source and initial canvas.
|
|
81
|
+
*/
|
|
82
|
+
"config"?: ReactodiaConfig;
|
|
83
|
+
/**
|
|
84
|
+
* The active repository id. Appended to {@link queryFunction } as the request `url`; changing it re-points the graph at the new repository (and resets the canvas), which is how runtime repository changes are handled.
|
|
73
85
|
*/
|
|
74
86
|
"currentRepository"?: string;
|
|
75
87
|
/**
|
|
76
88
|
* UI language code (e.g. `en`, `fr`) for the Reactodia interface. Defaults to English.
|
|
77
|
-
* @default
|
|
89
|
+
* @default LanguageKey.EN
|
|
78
90
|
*/
|
|
79
|
-
"language"?:
|
|
91
|
+
"language"?: LanguageKey;
|
|
80
92
|
/**
|
|
81
93
|
* Query preset for the SPARQL data provider, owned and configured by the host. A DOM property (an object, not an attribute) passed in from outside the wrapper. When omitted, the data provider falls back to Reactodia's generic OWL/RDFS preset. Changing it rebuilds the data provider and resets the canvas.
|
|
82
94
|
*/
|
|
83
95
|
"providerSettings"?: SparqlDataProviderSettings;
|
|
84
96
|
/**
|
|
85
|
-
*
|
|
97
|
+
* The theme currently applied by the host (e.g. `light`, `dark`). The value itself is never read - the node colors are taken from the host's CSS custom properties - it only signals that those values have changed. The host owns the theme, including whether it follows the OS color scheme, so the change is passed in instead of being detected here.
|
|
86
98
|
*/
|
|
87
|
-
"
|
|
99
|
+
"theme"?: string;
|
|
88
100
|
}
|
|
89
101
|
interface IntrinsicElements {
|
|
90
102
|
"graphwise-reactodia": GraphwiseReactodia;
|
|
@@ -97,9 +109,9 @@ declare module "@stencil/core" {
|
|
|
97
109
|
/**
|
|
98
110
|
* A web component that renders a graph with the Reactodia workspace.
|
|
99
111
|
* The component is backed by a SPARQL endpoint but is endpoint-agnostic: the host passes
|
|
100
|
-
* the active repository's endpoint via `current-repository` and a `queryFunction`
|
|
101
|
-
* performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
102
|
-
* through them; the canvas starts empty and the user populates it via the search bar.
|
|
112
|
+
* the active repository's endpoint via `current-repository` and a `config.queryFunction`
|
|
113
|
+
* that performs the actual HTTP request. Reactodia fetches all node, link and type data
|
|
114
|
+
* lazily through them; the canvas starts empty and the user populates it via the search bar.
|
|
103
115
|
* The component is a thin wrapper around Reactodia: query configuration lives outside the
|
|
104
116
|
* wrapper and is supplied through the `providerSettings` prop.
|
|
105
117
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { CLEAR_DIAGRAM_STORAGE_EVENT } from './components/graphwise-reactodia/models/clear-diagram-storage-event';
|
package/package.json
CHANGED
|
@@ -1,30 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphwise-reactodia",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-TR10",
|
|
4
4
|
"description": "Graphwise wrapper around the Reactodia graph explorer.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Ontotext AD",
|
|
7
7
|
"main": "dist/index.cjs.js",
|
|
8
|
+
"module": "dist/esm/index.js",
|
|
8
9
|
"collection": "dist/collection/collection-manifest.json",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"require": "./dist/index.cjs.js"
|
|
15
|
+
},
|
|
16
|
+
"./loader": {
|
|
17
|
+
"import": "./loader/index.js",
|
|
18
|
+
"require": "./loader/index.cjs.js",
|
|
19
|
+
"types": "./loader/index.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
9
22
|
"files": [
|
|
10
23
|
"dist/",
|
|
11
24
|
"loader/"
|
|
12
25
|
],
|
|
13
26
|
"scripts": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
27
|
+
"reactodia:install": "cd reactodia-workspace && npm ci",
|
|
28
|
+
"reactodia:compile": "cd reactodia-workspace && npm run build && npm run typings",
|
|
29
|
+
"reactodia:build": "npm run reactodia:install && npm run reactodia:compile",
|
|
30
|
+
"build": "npm run reactodia:build && stencil build",
|
|
31
|
+
"start": "npm run reactodia:build && stencil build --dev --watch --serve",
|
|
32
|
+
"cy:open": "cypress open",
|
|
33
|
+
"cy:run": "cypress run",
|
|
34
|
+
"cy:run:ci": "docker compose --ansi never up --exit-code-from cypress",
|
|
35
|
+
"test": "stencil test --spec",
|
|
36
|
+
"test.watch": "stencil test --spec --watchAll"
|
|
21
37
|
},
|
|
22
38
|
"devDependencies": {
|
|
23
39
|
"@rdfjs/types": "^2.0.1",
|
|
40
|
+
"@reactodia/workspace": "file:./reactodia-workspace",
|
|
24
41
|
"@stencil/core": "4.35.1",
|
|
25
42
|
"@stencil/sass": "^3.2.3",
|
|
43
|
+
"@types/jest": "^29.5.14",
|
|
26
44
|
"@types/react": "^18.3.12",
|
|
27
45
|
"@types/react-dom": "^18.3.1",
|
|
46
|
+
"cypress": "^15.17.0",
|
|
47
|
+
"jest": "^29.7.0",
|
|
48
|
+
"jest-cli": "^29.7.0",
|
|
49
|
+
"react": "^18.3.1",
|
|
50
|
+
"react-dom": "^18.3.1",
|
|
28
51
|
"rollup-plugin-node-polyfills": "^0.2.1"
|
|
29
52
|
}
|
|
30
53
|
}
|