graphwise-reactodia 0.0.1-TR5 → 0.0.1-TR7

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 (23) hide show
  1. package/dist/cjs/graphwise-reactodia.cjs.entry.js +79 -16
  2. package/dist/cjs/graphwise-reactodia.cjs.js +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +32 -24
  5. package/dist/collection/components/graphwise-reactodia/i18n/language-key.js +5 -0
  6. package/dist/collection/components/graphwise-reactodia/i18n/translations.js +3 -1
  7. package/dist/collection/components/graphwise-reactodia/models/reactodia-config.js +1 -0
  8. package/dist/collection/components/graphwise-reactodia/models/reactodia-seed-link.js +1 -0
  9. package/dist/collection/components/graphwise-reactodia/reactodia-app.js +64 -9
  10. package/dist/collection/pages/graphwise-reactodia/main.js +26 -13
  11. package/dist/esm/graphwise-reactodia.entry.js +79 -16
  12. package/dist/esm/graphwise-reactodia.js +1 -1
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
  15. package/dist/graphwise-reactodia/{p-b10c344f.entry.js → p-eb362faa.entry.js} +1 -1
  16. package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +17 -12
  17. package/dist/types/components/graphwise-reactodia/i18n/language-key.d.ts +4 -0
  18. package/dist/types/components/graphwise-reactodia/i18n/translations.d.ts +5 -342
  19. package/dist/types/components/graphwise-reactodia/models/reactodia-app-props.d.ts +10 -8
  20. package/dist/types/components/graphwise-reactodia/models/reactodia-config.d.ts +29 -0
  21. package/dist/types/components/graphwise-reactodia/models/reactodia-seed-link.d.ts +23 -0
  22. package/dist/types/components.d.ts +33 -29
  23. package/package.json +13 -1
@@ -1,32 +1,37 @@
1
- import { SparqlDataProviderSettings, SparqlQueryFunction } from '@reactodia/workspace';
1
+ import { SparqlDataProviderSettings } from '@reactodia/workspace';
2
+ import { LanguageKey } from './i18n/language-key';
3
+ import { ReactodiaConfig } from './models/reactodia-config';
2
4
  /**
3
5
  * A web component that renders a graph with the Reactodia workspace.
4
6
  *
5
7
  * The component is backed by a SPARQL endpoint but is endpoint-agnostic: the host passes
6
- * the active repository's endpoint via `current-repository` and a `queryFunction` that
7
- * performs the actual HTTP request. Reactodia fetches all node, link and type data lazily
8
- * through them; the canvas starts empty and the user populates it via the search bar.
8
+ * the active repository's endpoint via `current-repository` and a `config.queryFunction`
9
+ * that performs the actual HTTP request. Reactodia fetches all node, link and type data
10
+ * lazily through them; the canvas starts empty and the user populates it via the search bar.
9
11
  *
10
12
  * The component is a thin wrapper around Reactodia: query configuration lives outside the
11
13
  * wrapper and is supplied through the `providerSettings` prop.
12
14
  */
13
15
  export declare class GraphwiseReactodia {
14
- private readonly hostElement;
16
+ private readonly hostElement?;
15
17
  /**
16
18
  * The active repository id. Appended to {@link queryFunction} as the request `url`;
17
19
  * changing it re-points the graph at the new repository (and resets the canvas),
18
20
  * which is how runtime repository changes are handled.
19
21
  */
20
- currentRepository: string;
22
+ currentRepository?: string;
21
23
  /**
22
- * HTTP transport for the SPARQL requests. Set by the host so requests go through the host's HTTP layer (auth,
23
- * interceptors) instead of a built-in `fetch`.
24
+ * Host-supplied configuration: the SPARQL `queryFunction` transport and an optional `seed`
25
+ * set of entities to pre-populate the canvas with. A DOM property (an object, not an
26
+ * attribute) passed in from outside the wrapper.
27
+ *
28
+ * Read once on mount; not watched, as it only sets up the data source and initial canvas.
24
29
  */
25
- queryFunction: SparqlQueryFunction;
30
+ config?: ReactodiaConfig;
26
31
  /**
27
32
  * UI language code (e.g. `en`, `fr`) for the Reactodia interface. Defaults to English.
28
33
  */
29
- language: string;
34
+ language: LanguageKey;
30
35
  /**
31
36
  * Query preset for the SPARQL data provider, owned and configured by the host. A DOM
32
37
  * property (an object, not an attribute) passed in from outside the wrapper. When omitted,
@@ -34,10 +39,10 @@ export declare class GraphwiseReactodia {
34
39
  * the data provider and resets the canvas.
35
40
  */
36
41
  providerSettings?: SparqlDataProviderSettings;
37
- private reactRoot;
42
+ private reactRoot?;
38
43
  onProviderSettingsChange(): void;
39
44
  onLanguageChange(): void;
40
- componentDidLoad(): void;
45
+ connectedCallback(): void;
41
46
  disconnectedCallback(): void;
42
47
  render(): any;
43
48
  private renderGraph;
@@ -0,0 +1,4 @@
1
+ export declare enum LanguageKey {
2
+ EN = "en",
3
+ FR = "fr"
4
+ }
@@ -1,343 +1,6 @@
1
- export declare const TRANSLATIONS: {
2
- fr: {
3
- authoring_state: {
4
- "entity_action_delete.label": string;
5
- "entity_action_delete.title": string;
6
- "entity_action_delete.title_disabled": string;
7
- "entity_action_discard.label": string;
8
- "entity_action_discard.title": string;
9
- "entity_action_edit.label": string;
10
- "entity_action_edit.title": string;
11
- "entity_action_edit.title_disabled": string;
12
- "entity_add.label": string;
13
- "entity_change.label": string;
14
- "entity_delete.label": string;
15
- "relation_action_discard.label": string;
16
- "relation_action_discard.title": string;
17
- "relation_add.label": string;
18
- "relation_change.label": string;
19
- "relation_delete.label": string;
20
- };
21
- classic_workspace: {
22
- "canvas.label": string;
23
- "class_tree.heading": string;
24
- "connections.heading": string;
25
- "instances.heading": string;
26
- };
27
- commands: {
28
- "change_entity.title": string;
29
- "change_link_type_visibility.title": string;
30
- "change_relation.title": string;
31
- "collapse_element.title": string;
32
- "expand_element.title": string;
33
- "place_elements_around.title": string;
34
- "restore_geometry.title": string;
35
- "restore_link_vertices.title": string;
36
- "restore_viewport.title": string;
37
- "set_element_state.title": string;
38
- "set_entity_data.title": string;
39
- "set_entity_group_items.title": string;
40
- "set_link_state.title": string;
41
- "set_relation_data.title": string;
42
- "set_relation_group_items.title": string;
43
- "transform_elements.title": string;
44
- };
45
- connections_menu: {
46
- "all_link.label": string;
47
- "breadcrumbs_root.label": string;
48
- "dialog.caption": string;
49
- "entities.add_all": string;
50
- "entities.add_group": string;
51
- "entities.add_selected": string;
52
- "entities.counter_label": string;
53
- "entities.extra_label": string;
54
- "entities.extra_title": string;
55
- "entities.missing_label": string;
56
- "entities.missing_title": string;
57
- "entities.no_results": string;
58
- "entities.truncated_results": string;
59
- "entities.truncated_results_expand": string;
60
- "input.placeholder": any;
61
- "link.both_navigate_title": string;
62
- "link.both_title": string;
63
- "link.source_navigate_title": string;
64
- "link.source_title": string;
65
- "link.target_navigate_title": string;
66
- "link.target_title": string;
67
- "link.move_to_filter.title": string;
68
- "links.no_results": string;
69
- "links.suggest_similar": string;
70
- "place_elements.command": string;
71
- "select_all.label": string;
72
- "select_all.title": string;
73
- "sort_alphabetically.title": string;
74
- "sort_smart.title": string;
75
- };
76
- data_diagram_model: {
77
- "add_element.command": string;
78
- "add_link.command": string;
79
- "create_links.command": string;
80
- "group_entities.command": string;
81
- "import_layout.command": string;
82
- "regroup_relations.command": string;
83
- "request_entities.command": string;
84
- "request_relations.command": string;
85
- "remove_element.command": string;
86
- "remove_link.command": string;
87
- "ungroup_entities.command": string;
88
- };
89
- default_data_locale: {
90
- iri: string;
91
- iri_blank: string;
92
- };
93
- default_workspace: {
94
- "search_section_entities.label": string;
95
- "search_section_entities.title": string;
96
- "search_section_entity_types.label": string;
97
- "search_section_entity_types.title": string;
98
- "search_section_link_types.label": string;
99
- "search_section_link_types.title": string;
100
- };
101
- drop_on_canvas: {
102
- "drop.command": string;
103
- };
104
- editor_controller: {
105
- "apply_authored_changes.command": string;
106
- "discard_change.command": string;
107
- "entity_add.command": string;
108
- "entity_change.command": string;
109
- "entity_delete.command": string;
110
- "relation_add.command": string;
111
- "relation_change.command": string;
112
- "relation_delete.command": string;
113
- "relation_move_source.command": string;
114
- "relation_move_target.command": string;
115
- "remove_items.command": string;
116
- "set_authoring_state.command": string;
117
- "validate_entity_failed.message": string;
118
- };
119
- forms: {
120
- "input_file.drag_hint": string;
121
- "input_file.remove_value.title": string;
122
- "input_file.select_files.label": string;
123
- "input_list.add_value.title": string;
124
- "input_list.remove_value.title": string;
125
- };
126
- group_paginator: {
127
- "current_page.label": string;
128
- "go_next.title": string;
129
- "go_previous.title": string;
130
- "page_size.title": string;
131
- };
132
- inline_entity: {
133
- title: string;
134
- title_extra: string;
135
- };
136
- link_action: {
137
- "delete_annotation.title": string;
138
- "delete_relation.title": string;
139
- "delete_relation.title_disabled": string;
140
- "edit_relation.title": string;
141
- "edit_relation.title_disabled": string;
142
- "rename_link.title": string;
143
- "move_relation.move_source_title": string;
144
- "move_relation.move_target_title": string;
145
- "vertex.remove_title": string;
146
- };
147
- navigator: {
148
- "toggle_collapse.title": string;
149
- "toggle_expand.title": string;
150
- };
151
- note_annotation: {
152
- "change_text.command": string;
153
- "style_align_center.title": string;
154
- "style_align_left.title": string;
155
- "style_align_right.title": string;
156
- "style_bold.title": string;
157
- "style_color_variant.title": string;
158
- "style_italic.title": string;
159
- "style_strikethrough.title": string;
160
- "style_underline.title": string;
161
- };
162
- overlay_controller: {
163
- multiple_tasks_in_progress: string;
164
- unknown_error: string;
165
- };
166
- search_defaults: {
167
- empty_input_term: string;
168
- "input.placeholder": string;
169
- "input_clear.title": string;
170
- "input_submit.title": string;
171
- input_term_too_short: string;
172
- no_results: string;
173
- };
174
- search_element_types: {
175
- "drag_create.title": string;
176
- "input.placeholder": any;
177
- no_results: string;
178
- "refresh_progress.title": string;
179
- show_only_creatable: string;
180
- };
181
- search_entities: {
182
- "add_group.label": string;
183
- "add_group.title": string;
184
- "add_selected.label": string;
185
- "add_selected.title": string;
186
- criteria_has_type: string;
187
- criteria_connected: string;
188
- criteria_connected_via: string;
189
- criteria_connected_to_source: string;
190
- criteria_connected_to_target: string;
191
- "input.placeholder": any;
192
- "place_elements.command": string;
193
- "query_progress.title": string;
194
- "show_more_results.label": string;
195
- "show_more_results.title": string;
196
- };
197
- search_link_types: {
198
- "add_to_filter.title": string;
199
- heading_connected: string;
200
- heading_connected_single: string;
201
- heading_other: string;
202
- "input.placeholder": any;
203
- no_results: string;
204
- "switch.command": string;
205
- "switch_all.label": string;
206
- "switch_hidden.title": string;
207
- "switch_visible.title": string;
208
- "switch_without_label.title": string;
209
- };
210
- selection_action: {
211
- "add_to_filter.title": string;
212
- "anchor.title": string;
213
- "annotate.defaultContent": string;
214
- "annotate.title": string;
215
- "connections.title": string;
216
- "expand.collapse_command": string;
217
- "expand.expand_command": string;
218
- "expand.title": string;
219
- "expand.title_single": string;
220
- "establish_relation.title": string;
221
- "establish_relation.title_disabled": string;
222
- "group.title": string;
223
- "group.title_ungroup": string;
224
- "layout.title": string;
225
- "remove.title": string;
226
- "remove.title_new": string;
227
- "remove.title_single": string;
228
- "zoom_to_fit.title": string;
229
- };
230
- standard_element: {
231
- blank_node: string;
232
- default_type: string;
233
- "delete.label": string;
234
- "delete.title": string;
235
- "delete.title_disabled": string;
236
- "edit.label": string;
237
- "edit.title": string;
238
- "edit.title_disabled": string;
239
- "group_item.title": string;
240
- "iri.label": string;
241
- "iri.label_modified": string;
242
- no_properties: string;
243
- "property.title": string;
244
- "ungroup.title": string;
245
- };
246
- standard_link: {
247
- "group_source.title": string;
248
- "group_source.value": string;
249
- "group_target.title": string;
250
- "group_target.value": string;
251
- "label.title": string;
252
- "property.title": string;
253
- };
254
- toolbar: {
255
- "menu_toggle.title": string;
256
- };
257
- toolbar_action: {
258
- "clear_all.command": string;
259
- "clear_all.title": string;
260
- "clear_all.label": string;
261
- "export_print.label": string;
262
- "export_print.title": string;
263
- "export_raster.label": string;
264
- "export_raster.title": string;
265
- "export_svg.label": string;
266
- "export_svg.title": string;
267
- "redo.label": string;
268
- "redo.title": string;
269
- "redo.title_named": string;
270
- "save_authoring.title": string;
271
- "save_layout.title": string;
272
- "language_selector.title": string;
273
- "layout.label": string;
274
- "layout.title": string;
275
- "undo.label": string;
276
- "undo.title": string;
277
- "undo.title_named": string;
278
- };
279
- unified_search: {
280
- "input.placeholder": any;
281
- "input_clear.title": string;
282
- "input_collapse.title": string;
283
- };
284
- visual_authoring: {
285
- "dialog.apply.label": string;
286
- "dialog.apply.title": string;
287
- "dialog.cancel.label": string;
288
- "dialog.cancel.title": string;
289
- "edit_entity.dialog.apply.label": any;
290
- "edit_entity.dialog.apply.title": any;
291
- "edit_entity.dialog.caption": string;
292
- "edit_entity.iri.label": string;
293
- "edit_entity.iri.placeholder": string;
294
- "edit_relation.dialog.apply.label": any;
295
- "edit_relation.dialog.apply.title": any;
296
- "edit_relation.dialog.caption": string;
297
- "edit_relation.dialog.caption_new": string;
298
- "edit_relation.validation_progress.title": string;
299
- "find_or_create.connect_command": string;
300
- "find_or_create.create_command": string;
301
- "find_or_create.dialog.apply.label": any;
302
- "find_or_create.dialog.apply.title": any;
303
- "find_or_create.dialog.caption": string;
304
- "find_or_create.loading.label": string;
305
- "find_or_create.validation_progress.title": string;
306
- "property.label": string;
307
- "property.text_value.placeholder": string;
308
- "property.title": string;
309
- "rename_link.dialog.apply.label": any;
310
- "rename_link.dialog.apply.title": any;
311
- "rename_link.dialog.caption": string;
312
- "rename_link.label.label": string;
313
- "select_entity.entity_type.label": string;
314
- "select_entity.input.placeholder": any;
315
- "select_entity.type.label": string;
316
- "select_entity.type.placeholder": string;
317
- "select_entity.results.aria_label": string;
318
- "select_entity.separator.label": string;
319
- "select_entity.validation.error_required": string;
320
- "select_relation.relation_type.label": string;
321
- "select_relation.type.label": string;
322
- "select_relation.type.placeholder": string;
323
- "select_relation.validation.error_duplicate": string;
324
- "select_relation.validation.error_required": string;
325
- };
326
- workspace: {
327
- "group_entities.command": string;
328
- "perform_layout.task": string;
329
- "perform_layout.command": string;
330
- "ungroup_entities.command": string;
331
- };
332
- workspace_layout: {
333
- "toggle_collapse.title": string;
334
- "toggle_expand.title": string;
335
- };
336
- zoom_control: {
337
- "pointer_mode.title": string;
338
- "zoom_in.title": string;
339
- "zoom_out.title": string;
340
- "zoom_to_fit.title": string;
341
- };
342
- };
1
+ import { LanguageKey } from './language-key';
2
+ type TranslationBundle = {
3
+ [language: string]: Record<string, TranslationBundle | string | null>;
343
4
  };
5
+ export declare const TRANSLATIONS: Partial<Record<LanguageKey, TranslationBundle>>;
6
+ export {};
@@ -1,25 +1,27 @@
1
- import { SerializedDiagram, SparqlDataProviderSettings, SparqlQueryFunction } from '@reactodia/workspace';
1
+ import { SerializedDiagram, SparqlDataProviderSettings } from '@reactodia/workspace';
2
+ import { LanguageKey } from '../i18n/language-key';
3
+ import { ReactodiaConfig } from './reactodia-config';
2
4
  /**
3
5
  * Props for the internal Reactodia React application.
4
6
  */
5
7
  export interface ReactodiaAppProps {
6
8
  /**
7
9
  * The active repository id. Passed to the SPARQL data provider as its `endpointUrl` and
8
- * surfaced to {@link queryFunction} as the request `url`, which the host transport uses to
9
- * target the repository. Changing it re-points the diagram at a different repository.
10
+ * surfaced to the {@link ReactodiaConfig.queryFunction} as the request `url`, which the host
11
+ * transport uses to target the repository. Changing it re-points the diagram at a different
12
+ * repository.
10
13
  */
11
14
  currentRepository: string;
12
15
  /**
13
- * Transport for the SPARQL requests. The host owns the connection (auth, interceptors,
14
- * base URL) inside this function; Reactodia delegates every SPARQL call to it instead
15
- * of using the built-in `fetch`.
16
+ * Host-supplied configuration read once on mount: the SPARQL transport and the optional
17
+ * set of entities to pre-populate the canvas with.
16
18
  */
17
- queryFunction: SparqlQueryFunction;
19
+ config: ReactodiaConfig;
18
20
  /**
19
21
  * UI language code (e.g. `en`, `fr`); selects the Reactodia translation bundle
20
22
  * and is also used as the initial graph-data language.
21
23
  */
22
- language: string;
24
+ language: LanguageKey;
23
25
  /**
24
26
  * A previously exported diagram to restore on mount. Used to carry the user's current
25
27
  * canvas across a remount (e.g. forced by a language change). When omitted, the canvas
@@ -0,0 +1,29 @@
1
+ import { SparqlQueryFunction } from '@reactodia/workspace';
2
+ import { ReactodiaSeedLink } from './reactodia-seed-link';
3
+ /**
4
+ * Host-supplied configuration read once when the workspace mounts (not reactive).
5
+ *
6
+ * Groups the inputs the host wires up before the graph is created: the SPARQL transport
7
+ * and the optional set of entities to pre-populate the canvas with. Passed to the
8
+ * `graphwise-reactodia` component as a single DOM property (an object, not an attribute).
9
+ */
10
+ export interface ReactodiaConfig {
11
+ /**
12
+ * HTTP transport for the SPARQL requests. Set by the host so requests go through the host's
13
+ * HTTP layer (auth, interceptors) instead of a built-in `fetch`.
14
+ */
15
+ queryFunction: SparqlQueryFunction;
16
+ /**
17
+ * IRIs of the entities to place on the canvas on startup. When provided, each IRI is added
18
+ * as an element and its data (labels, types, properties) and links are resolved from the
19
+ * SPARQL provider, then the workspace lays them out. Note that when using this seed method reactodia will request data
20
+ * from the connected sparql endpoint, so if the resources are not in the DB, then this approach will not work.
21
+ * (e.g. in the case of a construct query)
22
+ */
23
+ seedIris?: string[];
24
+ /**
25
+ * Pre-resolved edges to place on the canvas on startup. When provided, each link is added to the canvas and we do not
26
+ * request data from the connected sparql endpoint, since this is meant for non-persisted data, like construct and describe queries.
27
+ */
28
+ seedGraph?: ReactodiaSeedLink[];
29
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A pre-resolved edge to place on the canvas on startup, mirroring GraphDB's
3
+ * `rest/explore-graph` link shape. Used to visualize the result of a CONSTRUCT query, whose
4
+ * relationships are computed and therefore not persisted in the repository, so they cannot be
5
+ * fetched lazily through the SPARQL provider and must be supplied directly.
6
+ *
7
+ * The host adapts its source data into this neutral shape (e.g. the workbench maps the
8
+ * `rest/explore-graph/graph` response, mapping its `rawPredicates` onto {@link predicates}).
9
+ */
10
+ export interface ReactodiaSeedLink {
11
+ /** Source element IRI. */
12
+ source: string;
13
+ /** Target element IRI. */
14
+ target: string;
15
+ /**
16
+ * Short display friendly predicate
17
+ */
18
+ predicates: string[];
19
+ /**
20
+ * Full (absolute) predicate IRIs.
21
+ */
22
+ rawPredicates: string[];
23
+ }
@@ -5,45 +5,49 @@
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 { SparqlDataProviderSettings, SparqlQueryFunction } from "@reactodia/workspace";
9
- export { SparqlDataProviderSettings, SparqlQueryFunction } from "@reactodia/workspace";
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` that
15
- * performs the actual HTTP request. Reactodia fetches all node, link and type data lazily
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
- * 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.
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
- "currentRepository": string;
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 'en'
35
+ * @default LanguageKey.EN
28
36
  */
29
- "language": string;
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
- /**
35
- * HTTP transport for the SPARQL requests. Set by the host so requests go through the host's HTTP layer (auth, interceptors) instead of a built-in `fetch`.
36
- */
37
- "queryFunction": SparqlQueryFunction;
38
42
  }
39
43
  }
40
44
  declare global {
41
45
  /**
42
46
  * A web component that renders a graph with the Reactodia workspace.
43
47
  * 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` that
45
- * performs the actual HTTP request. Reactodia fetches all node, link and type data lazily
46
- * through them; the canvas starts empty and the user populates it via the search bar.
48
+ * the active repository's endpoint via `current-repository` and a `config.queryFunction`
49
+ * that performs the actual HTTP request. Reactodia fetches all node, link and type data
50
+ * lazily through them; the canvas starts empty and the user populates it via the search bar.
47
51
  * The component is a thin wrapper around Reactodia: query configuration lives outside the
48
52
  * wrapper and is supplied through the `providerSettings` prop.
49
53
  */
@@ -61,30 +65,30 @@ declare namespace LocalJSX {
61
65
  /**
62
66
  * A web component that renders a graph with the Reactodia workspace.
63
67
  * 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` that
65
- * performs the actual HTTP request. Reactodia fetches all node, link and type data lazily
66
- * through them; the canvas starts empty and the user populates it via the search bar.
68
+ * the active repository's endpoint via `current-repository` and a `config.queryFunction`
69
+ * that performs the actual HTTP request. Reactodia fetches all node, link and type data
70
+ * lazily through them; the canvas starts empty and the user populates it via the search bar.
67
71
  * The component is a thin wrapper around Reactodia: query configuration lives outside the
68
72
  * wrapper and is supplied through the `providerSettings` prop.
69
73
  */
70
74
  interface GraphwiseReactodia {
71
75
  /**
72
- * 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.
76
+ * 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.
77
+ */
78
+ "config"?: ReactodiaConfig;
79
+ /**
80
+ * 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
81
  */
74
82
  "currentRepository"?: string;
75
83
  /**
76
84
  * UI language code (e.g. `en`, `fr`) for the Reactodia interface. Defaults to English.
77
- * @default 'en'
85
+ * @default LanguageKey.EN
78
86
  */
79
- "language"?: string;
87
+ "language"?: LanguageKey;
80
88
  /**
81
89
  * 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
90
  */
83
91
  "providerSettings"?: SparqlDataProviderSettings;
84
- /**
85
- * HTTP transport for the SPARQL requests. Set by the host so requests go through the host's HTTP layer (auth, interceptors) instead of a built-in `fetch`.
86
- */
87
- "queryFunction"?: SparqlQueryFunction;
88
92
  }
89
93
  interface IntrinsicElements {
90
94
  "graphwise-reactodia": GraphwiseReactodia;
@@ -97,9 +101,9 @@ declare module "@stencil/core" {
97
101
  /**
98
102
  * A web component that renders a graph with the Reactodia workspace.
99
103
  * 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` that
101
- * performs the actual HTTP request. Reactodia fetches all node, link and type data lazily
102
- * through them; the canvas starts empty and the user populates it via the search bar.
104
+ * the active repository's endpoint via `current-repository` and a `config.queryFunction`
105
+ * that performs the actual HTTP request. Reactodia fetches all node, link and type data
106
+ * lazily through them; the canvas starts empty and the user populates it via the search bar.
103
107
  * The component is a thin wrapper around Reactodia: query configuration lives outside the
104
108
  * wrapper and is supplied through the `providerSettings` prop.
105
109
  */
package/package.json CHANGED
@@ -1,11 +1,23 @@
1
1
  {
2
2
  "name": "graphwise-reactodia",
3
- "version": "0.0.1-TR5",
3
+ "version": "0.0.1-TR7",
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
+ "import": "./dist/graphwise-reactodia/graphwise-reactodia.esm.js",
13
+ "require": "./dist/index.cjs.js"
14
+ },
15
+ "./loader": {
16
+ "import": "./loader/index.js",
17
+ "require": "./loader/index.cjs.js",
18
+ "types": "./loader/index.d.ts"
19
+ }
20
+ },
9
21
  "files": [
10
22
  "dist/",
11
23
  "loader/"