graphwise-reactodia 0.0.1-TR2 → 0.0.1-TR20

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 (117) hide show
  1. package/COPYING +674 -0
  2. package/COPYING.LESSER +165 -0
  3. package/NOTICE +41 -0
  4. package/README.md +225 -1
  5. package/dist/cjs/graphwise-reactodia.cjs.entry.js +28519 -41232
  6. package/dist/cjs/graphwise-reactodia.cjs.js +2 -2
  7. package/dist/cjs/{index-CII9aUQC.js → index-DtzCybH4.js} +16 -0
  8. package/dist/cjs/index.cjs.js +29 -0
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/node-action-DkJ5ct17.js +96 -0
  11. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.css +57 -1
  12. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +135 -40
  13. package/dist/collection/components/graphwise-reactodia/i18n/language-key.js +5 -0
  14. package/dist/collection/components/graphwise-reactodia/i18n/translations.js +6 -1
  15. package/dist/collection/components/graphwise-reactodia/menu/export-diagram-action.js +19 -0
  16. package/dist/collection/components/graphwise-reactodia/menu/graphwise-menu.js +24 -0
  17. package/dist/collection/components/graphwise-reactodia/menu/import-diagram-action.js +31 -0
  18. package/dist/collection/components/graphwise-reactodia/models/clear-diagram-storage-event.js +5 -0
  19. package/dist/collection/components/graphwise-reactodia/models/error/error-cause.js +1 -0
  20. package/dist/collection/components/graphwise-reactodia/models/error/error-code.js +20 -0
  21. package/dist/collection/components/graphwise-reactodia/models/error/error-report.js +1 -0
  22. package/dist/collection/components/graphwise-reactodia/models/event/event-callback.js +1 -0
  23. package/dist/collection/components/graphwise-reactodia/models/event/event-detail.js +4 -0
  24. package/dist/collection/components/graphwise-reactodia/models/event/event-type.js +8 -0
  25. package/dist/collection/components/graphwise-reactodia/models/reactodia-config.js +1 -0
  26. package/dist/collection/components/graphwise-reactodia/models/sparql/sparql-query-function.js +1 -0
  27. package/dist/collection/components/graphwise-reactodia/models/sparql/sparql-query-params.js +1 -0
  28. package/dist/collection/components/graphwise-reactodia/models/subscription-list.js +35 -0
  29. package/dist/collection/components/graphwise-reactodia/models/subscription.js +1 -0
  30. package/dist/collection/components/graphwise-reactodia/models/triple.js +1 -0
  31. package/dist/collection/components/graphwise-reactodia/models/ui/menu-config.js +1 -0
  32. package/dist/collection/components/graphwise-reactodia/models/ui/menu-item.js +18 -0
  33. package/dist/collection/components/graphwise-reactodia/models/ui/node-action.js +22 -0
  34. package/dist/collection/components/graphwise-reactodia/models/ui/resolved-toolbar-position.js +1 -0
  35. package/dist/collection/components/graphwise-reactodia/models/ui/resolved-ui-config.js +1 -0
  36. package/dist/collection/components/graphwise-reactodia/models/ui/toolbar-dock.js +14 -0
  37. package/dist/collection/components/graphwise-reactodia/models/ui/toolbar-position.js +1 -0
  38. package/dist/collection/components/graphwise-reactodia/models/ui/ui-config.js +1 -0
  39. package/dist/collection/components/graphwise-reactodia/node-action/node-actions.js +22 -0
  40. package/dist/collection/components/graphwise-reactodia/providers/service/service-inject.js +15 -0
  41. package/dist/collection/components/graphwise-reactodia/providers/service/service.js +19 -0
  42. package/dist/collection/components/graphwise-reactodia/providers/service/service.provider.js +20 -0
  43. package/dist/collection/components/graphwise-reactodia/reactodia-app.js +188 -26
  44. package/dist/collection/components/graphwise-reactodia/services/diagram/diagram.service.js +71 -0
  45. package/dist/collection/components/graphwise-reactodia/services/diagram-file/diagram-file.service.js +68 -0
  46. package/dist/collection/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.js +71 -0
  47. package/dist/collection/components/graphwise-reactodia/services/error/error.service.js +78 -0
  48. package/dist/collection/components/graphwise-reactodia/services/event/event.service.js +58 -0
  49. package/dist/collection/components/graphwise-reactodia/services/window/window.service.js +24 -0
  50. package/dist/collection/components/graphwise-reactodia/styles/type-style.resolver.js +52 -0
  51. package/dist/collection/components/graphwise-reactodia/testing/storage.mock.js +35 -0
  52. package/dist/collection/components/graphwise-reactodia/ui-config/default-ui-config.js +30 -0
  53. package/dist/collection/components/graphwise-reactodia/ui-config/ui-config-mapper.js +51 -0
  54. package/dist/collection/components/graphwise-reactodia/utils/object-util.js +30 -0
  55. package/dist/collection/index.js +7 -1
  56. package/dist/collection/pages/graphwise-reactodia/main.js +157 -0
  57. package/dist/collection/pages/graphwise-reactodia/owl-rdfs-settings.js +195 -0
  58. package/dist/esm/graphwise-reactodia.entry.js +28519 -41232
  59. package/dist/esm/graphwise-reactodia.js +3 -3
  60. package/dist/esm/{index-Cypw7ydc.js → index-DpCR6zMg.js} +16 -1
  61. package/dist/esm/index.js +7 -0
  62. package/dist/esm/loader.js +3 -3
  63. package/dist/esm/node-action-fwJ3Zupw.js +94 -0
  64. package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
  65. package/dist/graphwise-reactodia/index.esm.js +1 -0
  66. package/dist/graphwise-reactodia/p-DpCR6zMg.js +2 -0
  67. package/dist/graphwise-reactodia/p-c3d8a69a.entry.js +1 -0
  68. package/dist/graphwise-reactodia/p-fwJ3Zupw.js +1 -0
  69. package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +44 -16
  70. package/dist/types/components/graphwise-reactodia/i18n/language-key.d.ts +4 -0
  71. package/dist/types/components/graphwise-reactodia/i18n/translations.d.ts +2 -343
  72. package/dist/types/components/graphwise-reactodia/menu/export-diagram-action.d.ts +4 -0
  73. package/dist/types/components/graphwise-reactodia/menu/graphwise-menu.d.ts +6 -0
  74. package/dist/types/components/graphwise-reactodia/menu/import-diagram-action.d.ts +4 -0
  75. package/dist/types/components/graphwise-reactodia/models/clear-diagram-storage-event.d.ts +5 -0
  76. package/dist/types/components/graphwise-reactodia/models/error/error-cause.d.ts +10 -0
  77. package/dist/types/components/graphwise-reactodia/models/error/error-code.d.ts +19 -0
  78. package/dist/types/components/graphwise-reactodia/models/error/error-report.d.ts +13 -0
  79. package/dist/types/components/graphwise-reactodia/models/event/event-callback.d.ts +5 -0
  80. package/dist/types/components/graphwise-reactodia/models/event/event-detail.d.ts +55 -0
  81. package/dist/types/components/graphwise-reactodia/models/event/event-type.d.ts +7 -0
  82. package/dist/types/components/graphwise-reactodia/models/reactodia-app-props.d.ts +20 -15
  83. package/dist/types/components/graphwise-reactodia/models/reactodia-config.d.ts +36 -0
  84. package/dist/types/components/graphwise-reactodia/models/sparql/sparql-query-function.d.ts +6 -0
  85. package/dist/types/components/graphwise-reactodia/models/sparql/sparql-query-params.d.ts +12 -0
  86. package/dist/types/components/graphwise-reactodia/models/subscription-list.d.ts +26 -0
  87. package/dist/types/components/graphwise-reactodia/models/subscription.d.ts +4 -0
  88. package/dist/types/components/graphwise-reactodia/models/triple.d.ts +19 -0
  89. package/dist/types/components/graphwise-reactodia/models/ui/menu-config.d.ts +8 -0
  90. package/dist/types/components/graphwise-reactodia/models/ui/menu-item.d.ts +17 -0
  91. package/dist/types/components/graphwise-reactodia/models/ui/node-action.d.ts +21 -0
  92. package/dist/types/components/graphwise-reactodia/models/ui/resolved-toolbar-position.d.ts +8 -0
  93. package/dist/types/components/graphwise-reactodia/models/ui/resolved-ui-config.d.ts +12 -0
  94. package/dist/types/components/graphwise-reactodia/models/ui/toolbar-dock.d.ts +13 -0
  95. package/dist/types/components/graphwise-reactodia/models/ui/toolbar-position.d.ts +11 -0
  96. package/dist/types/components/graphwise-reactodia/models/ui/ui-config.d.ts +17 -0
  97. package/dist/types/components/graphwise-reactodia/node-action/node-actions.d.ts +6 -0
  98. package/dist/types/components/graphwise-reactodia/providers/service/service-inject.d.ts +13 -0
  99. package/dist/types/components/graphwise-reactodia/providers/service/service.d.ts +28 -0
  100. package/dist/types/components/graphwise-reactodia/providers/service/service.provider.d.ts +16 -0
  101. package/dist/types/components/graphwise-reactodia/reactodia-app.d.ts +3 -2
  102. package/dist/types/components/graphwise-reactodia/services/diagram/diagram.service.d.ts +36 -0
  103. package/dist/types/components/graphwise-reactodia/services/diagram-file/diagram-file.service.d.ts +24 -0
  104. package/dist/types/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.d.ts +27 -0
  105. package/dist/types/components/graphwise-reactodia/services/error/error.service.d.ts +41 -0
  106. package/dist/types/components/graphwise-reactodia/services/event/event.service.d.ts +30 -0
  107. package/dist/types/components/graphwise-reactodia/services/window/window.service.d.ts +7 -0
  108. package/dist/types/components/graphwise-reactodia/styles/type-style.resolver.d.ts +11 -0
  109. package/dist/types/components/graphwise-reactodia/testing/storage.mock.d.ts +18 -0
  110. package/dist/types/components/graphwise-reactodia/ui-config/default-ui-config.d.ts +5 -0
  111. package/dist/types/components/graphwise-reactodia/ui-config/ui-config-mapper.d.ts +14 -0
  112. package/dist/types/components/graphwise-reactodia/utils/object-util.d.ts +15 -0
  113. package/dist/types/components.d.ts +60 -27
  114. package/dist/types/index.d.ts +15 -1
  115. package/package.json +39 -10
  116. package/dist/graphwise-reactodia/p-Cypw7ydc.js +0 -2
  117. package/dist/graphwise-reactodia/p-bafd6be5.entry.js +0 -1
package/COPYING.LESSER ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
package/NOTICE ADDED
@@ -0,0 +1,41 @@
1
+ graphwise-reactodia -- Graphwise wrapper around the Reactodia graph explorer.
2
+
3
+ Copyright (C) 2026 Ontotext AD
4
+
5
+ This library is free software: you can redistribute it and/or modify it
6
+ under the terms of the GNU Lesser General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or (at your
8
+ option) any later version.
9
+
10
+ This library is distributed in the hope that it will be useful, but
11
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13
+ License for more details.
14
+
15
+ You should have received a copy of the GNU Lesser General Public License
16
+ along with this library (COPYING.LESSER), together with the GNU General
17
+ Public License it supplements (COPYING). If not, see
18
+ <https://www.gnu.org/licenses/>.
19
+
20
+ -------------------------------------------------------------------------------
21
+
22
+ Reactodia Workspace
23
+
24
+ The published bundle (dist/) incorporates Reactodia Workspace, built from
25
+ the Ontotext AD fork:
26
+
27
+ https://github.com/Ontotext-AD/reactodia-workspace-fork
28
+
29
+ The corresponding source for a given release is tag v<version> of
30
+
31
+ https://github.com/Ontotext-AD/graphwise-reactodia
32
+
33
+ together with the reactodia-workspace submodule commit it pins in the fork.
34
+
35
+ Copyright (C) 2026 Alexey Morozov (https://github.com/AlexeyMz)
36
+ Copyright (C) 2019 metaphacts GmbH.
37
+ Copyright (C) 2026 Ontotext AD. Modified from reactodia-workspace v0.35.0.
38
+
39
+ Reactodia Workspace is licensed under the GNU Lesser General Public License
40
+ version 2.1 or (at your option) any later version. It is incorporated here
41
+ under version 3 of that license, as permitted by that option.
package/README.md CHANGED
@@ -1,2 +1,226 @@
1
1
  # graphwise-reactodia
2
- Graphwise wrapper around Reactodia graph explorer
2
+
3
+ Graphwise wrapper (Stencil component) around the [Reactodia](https://github.com/reactodia/reactodia-workspace) graph explorer.
4
+
5
+ Reactodia is vendored as a **git submodule** (`reactodia-workspace/`, pointing at our [fork](https://github.com/Ontotext-AD/reactodia-workspace-fork)).
6
+ It's built first, then consumed by Stencil as a normal ES module via a `file:` dependency.
7
+
8
+ ## Setup
9
+
10
+ After cloning the repo for the first time you will need to update git submodules, which will fetch the Reactodia fork:
11
+ ```bash
12
+ cd graphwise-reactodia
13
+ git submodule update --init --recursive
14
+ ```
15
+
16
+ Install dependencies, which will symlink the Reactodia fork into `node_modules`:
17
+ ```bash
18
+ npm install
19
+ ```
20
+
21
+ ## Develop
22
+ For development run:
23
+ ```bash
24
+ npm start
25
+ ```
26
+
27
+ ## Build
28
+ Build the fork and the Stencil component:
29
+ ```bash
30
+ npm run build
31
+ ```
32
+
33
+ `npm start` and `npm run build` both run `reactodia:build` first, which installs and builds the fork
34
+ (`reactodia:install` + `reactodia:compile`), then runs `reactodia:dedupe-react` to remove the fork's own
35
+ `react`/`react-dom` copies so the bundle ends up with a single React instance.
36
+
37
+ ## Seeding the canvas
38
+
39
+ By default the canvas starts empty and the user populates it through the workspace search bar. The host can
40
+ instead pre-populate it on startup by passing seed data through `config` (see `ReactodiaAppProps`). Seeding is
41
+ skipped when an `initialDiagram` is restored (e.g. after a language-change remount). There are two mechanisms,
42
+ handled in `reactodia-app.ts`:
43
+
44
+ ### `seedIris` — lazy seed
45
+
46
+ `config.seedIris` is a list of element(node) IRIs. Each IRI is placed as a placeholder node, then `seedCanvas` calls
47
+ the model's `requestData()` so both the element data **and** its links are fetched from the SPARQL endpoint.
48
+ Use this when the relationships are persisted in the repository and can be resolved lazily.
49
+
50
+ ### `seedGraph` — pre-resolved seed
51
+
52
+ `config.seedGraph` is a list of `Triple` objects (mirroring GraphDB's `rest/explore-graph` shape).
53
+ `seedGraphCanvas` places each `source`/`target` as an element and draws the supplied links directly, then
54
+ requests **element data only** (`requestElementData`) — it does *not* ask the endpoint for links.
55
+
56
+ Use this for the result of a CONSTRUCT/DESCRIBE query, whose relationships are computed and therefore not
57
+ persisted in the DB, so they can't be fetched lazily and must be supplied by the host.
58
+
59
+ `Triple` (`models/triple.ts`):
60
+
61
+ | Field | Description |
62
+ |-----------------|----------------------------------------------------------|
63
+ | `source` | Source element IRI. |
64
+ | `target` | Target element IRI. |
65
+ | `rawPredicates` | Full (absolute) predicate IRIs — used as the link types. |
66
+
67
+ When both are supplied `seedGraph` takes precedence over `seedIris`.
68
+
69
+ ## UI configuration
70
+
71
+ `config.ui` (`UiConfig`) changes the default UI configuration. It is JSON and read once on mount. It is partial and
72
+ merged over the default: objects are merged key by key, lists replace the default whole.
73
+
74
+ The default UI configuration:
75
+
76
+ ```ts
77
+ {
78
+ mainToolbar: {dock: ToolbarDock.NW},
79
+ actionsToolbar: {dock: ToolbarDock.SW},
80
+ menu: {items: [CLEAR_ALL, EXPORT_PNG, EXPORT_SVG, PRINT, EXPORT_JSON, IMPORT_JSON]},
81
+ nodeActions: [GROUP, REMOVE, EXPAND, OPEN_LINK, CONNECTIONS, ADD_TO_FILTER, ANNOTATE, ESTABLISH_LINK]
82
+ }
83
+ ```
84
+
85
+ | Field | Description |
86
+ |------------------|------------------------------------------------------------------------------------|
87
+ | `mainToolbar` | `ToolbarPosition` of the toolbar with the menu and the search. |
88
+ | `actionsToolbar` | `ToolbarPosition` of the toolbar with undo, redo and layout. |
89
+ | `menu.items` | `MenuItem`s of the main menu, in order. An empty list hides the menu. |
90
+ | `nodeActions` | `NodeAction`s shown around a selected node. |
91
+
92
+ `ToolbarPosition` is `{dock?: ToolbarDock, offsetX?: number, offsetY?: number}`.
93
+
94
+ E.g. the actions toolbar at the top right, without the link node action:
95
+
96
+ ```ts
97
+ element.config = {
98
+ queryFunction,
99
+ ui: {
100
+ actionsToolbar: {dock: ToolbarDock.NE},
101
+ nodeActions: [GROUP, REMOVE, EXPAND, CONNECTIONS, ADD_TO_FILTER, ANNOTATE, ESTABLISH_LINK]
102
+ }
103
+ };
104
+ ```
105
+
106
+ An unknown value is skipped and reported as `unknown-ui-config`; an unknown dock keeps the default toolbar position.
107
+
108
+ ## Events
109
+
110
+ The element sends every event to the host through one DOM event, `graphwiseReactodiaEvent`. The event
111
+ only informs the host and it bubbles. Its name is exported as `GRAPHWISE_REACTODIA_EVENT`.
112
+
113
+ `detail` is an `EventDetail`: `{type, payload}`. `type` is an `EventType`; `payload` depends on it:
114
+
115
+ | `type` | `payload` | Dispatched when |
116
+ |---------------|---------------|-------------------------------------|
117
+ | `error` | `ErrorReport` | An error is reported. |
118
+ | `text-search` | none | The user searches entities by text. |
119
+
120
+ Checking `type` narrows `payload`:
121
+
122
+ ```ts
123
+ element.addEventListener(GRAPHWISE_REACTODIA_EVENT, (event) => {
124
+ const detail = (event as CustomEvent<EventDetail>).detail;
125
+ if (detail.type === EventType.ERROR) {
126
+ const {code, error} = detail.payload; // an ErrorReport
127
+ }
128
+ });
129
+ ```
130
+
131
+ `EventDetail<T>` is one event, e.g. for a handler of a single type:
132
+
133
+ ```ts
134
+ function onError(detail: EventDetail<EventType.ERROR>): void {
135
+ const {code, error} = detail.payload;
136
+ }
137
+ ```
138
+
139
+ ## Error handling
140
+
141
+ The element dispatches an `error` event for every error it reports; the codes below list them.
142
+
143
+ `payload` is an `ErrorReport`:
144
+
145
+ | Field | Description |
146
+ |---------|-----------------------------------------------------------------------------------------|
147
+ | `code` | An `ErrorCode`. The host translates by it. |
148
+ | `error` | Always an `Error`; its `message` is untranslated developer text, meant for the logs. |
149
+
150
+ `ErrorCode`:
151
+
152
+ | Code | Reported when |
153
+ |-------------------------|------------------------------------------------------------|
154
+ | `missing-required-prop` | A required prop is missing. |
155
+ | `data-fetch` | A SPARQL data provider call failed. |
156
+ | `diagram-load` | The startup load, a reload or a repository switch failed. |
157
+ | `diagram-import` | The uploaded file was rejected or its import failed. |
158
+ | `local-diagram-read` | Reading the diagram from local storage failed. |
159
+ | `local-diagram-save` | Saving the diagram in local storage failed. |
160
+ | `unknown-ui-config` | `config.ui` has an unknown value, which is skipped. |
161
+
162
+ Failed PNG/SVG exports and printing are not reported.
163
+
164
+ Every failure is reported once: an error is skipped when it, or an error in its `cause` chain, is already reported.
165
+ Aborted requests are not reported.
166
+
167
+ ## Editing the fork
168
+
169
+ Reactodia lives in the `reactodia-workspace/` submodule, which is its own git repo (remote:
170
+ [reactodia-workspace-fork](https://github.com/Ontotext-AD/reactodia-workspace-fork)). The parent repo does not
171
+ store the fork's files — it stores a single pointer to a commit in the fork. So a fork change involves two repos
172
+ and two commits: one in the fork (the source change) and one here (the pointer bump).
173
+
174
+ Simple setup in IntelliJ so you don't switch between projects: map the submodule as a second VCS root
175
+ (Settings → Version Control → Directory Mappings → add `reactodia-workspace`) so both repos appear
176
+ in the branch widget and Commit panel.
177
+
178
+ ### Testing fork changes locally
179
+
180
+ `npm start` and `npm run build` both run `reactodia:build`, which recompiles the fork from its current
181
+ files, so edits are picked up immediately.
182
+
183
+ ### Persisting a fork change
184
+ 1. In the fork (reactodia-workspace/): create a new branch,
185
+ 2. Make edit, commit and push changes
186
+ 3. Open a PR against the fork's `master` (reactodia-workspace-fork).
187
+ 4. Merge the PR.
188
+ 5. In the parent (graphwise-reactodia/):
189
+ 1. `git submodule update --remote` to fetch the fork's new commit and update the pointer,
190
+ 2. Make a branch, commit the pointer bump and push.
191
+
192
+ The parent commit's diff is just the pointer, never the fork's direct file changes.
193
+ Always bump the pointer to a commit that is merged and pushed on the fork's `master`, so
194
+ anyone running `git submodule update` can fetch it.
195
+
196
+ ## Test
197
+
198
+ Cypress runs against the dev server (`http://localhost:3333`), so start the app first in a separate terminal:
199
+
200
+ ```bash
201
+ npm start
202
+ ```
203
+
204
+ Then, in another terminal:
205
+ ```bash
206
+ npm run cy:open # for interactive browser tests
207
+ npm run cy:run # for headless tests
208
+ ```
209
+
210
+ OR run tests in a container
211
+
212
+ ```bash
213
+ docker compose up
214
+ ```
215
+
216
+ ## License
217
+
218
+ Copyright (C) 2026 Ontotext AD.
219
+
220
+ Licensed under the GNU Lesser General Public License v3.0 or later (`LGPL-3.0-or-later`); see
221
+ [`COPYING.LESSER`](COPYING.LESSER) and [`COPYING`](COPYING).
222
+
223
+ The published bundle includes [Reactodia Workspace](https://github.com/reactodia/reactodia-workspace)
224
+ (`LGPL-2.1-or-later`), built from our [fork](https://github.com/Ontotext-AD/reactodia-workspace-fork) and used
225
+ under LGPL-3.0 through its "or later" option. The source for a release is tag `v<version>` of this repo
226
+ together with the fork commit its `reactodia-workspace` submodule pins. See [`NOTICE`](NOTICE).