graphwise-reactodia 0.0.1-TR12 → 0.0.1-TR13

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.
@@ -31699,8 +31699,7 @@ let workspaceContext = null;
31699
31699
  const subscriptions = new SubscriptionList();
31700
31700
  /**
31701
31701
  * Builds a Reactodia {@link SparqlDataProvider} for the given endpoint using the supplied
31702
- * query preset. The host owns the query configuration and passes it in via props; when none
31703
- * is provided we fall back to Reactodia's generic {@link OwlRdfsSettings} OWL/RDFS preset.
31702
+ * query preset. The host owns the query configuration and always passes it in via props.
31704
31703
  */
31705
31704
  function createDataProvider(props) {
31706
31705
  const { currentRepository, config, providerSettings } = props;
@@ -31795,8 +31794,9 @@ function ReactodiaApp(props) {
31795
31794
  const savedDiagram = service(DiagramStorageService).load();
31796
31795
  const diagramService = service(DiagramService);
31797
31796
  if (isReload) {
31798
- // Simply reload without using the current state. This may happen when the user switches the language at runtime.
31799
- // since there is no existing mechanism to re-translate the UI at runtime (not for the UI labels at least)
31797
+ // Reload the diagram that is currently on the canvas. This may happen when the host changes the provider
31798
+ // settings, or when the user switches the language at runtime, since there is no existing mechanism to
31799
+ // re-translate the UI at runtime (not for the UI labels at least)
31800
31800
  await diagramService.importDiagram(model, dataProvider, currentDiagram, signal);
31801
31801
  }
31802
31802
  else if ((_a = config.seedIris) === null || _a === void 0 ? void 0 : _a.length) {
@@ -31827,7 +31827,11 @@ function ReactodiaApp(props) {
31827
31827
  defaultLanguage: language,
31828
31828
  translations: translationsForLanguage(language),
31829
31829
  typeStyleResolver: resolveTypeStyle
31830
- }, reactExports.createElement(DefaultWorkspace, { menu: reactExports.createElement(GraphwiseMenu) }));
31830
+ }, reactExports.createElement(DefaultWorkspace, {
31831
+ menu: reactExports.createElement(GraphwiseMenu),
31832
+ // place Undo/redo/layout actions in top right corner.
31833
+ actionsToolbar: { dock: 'ne' }
31834
+ }));
31831
31835
  }
31832
31836
  /**
31833
31837
  * Mounts the Reactodia application into the given container and returns the React root.
@@ -31838,8 +31842,9 @@ function mountReactodia(container, props) {
31838
31842
  return root;
31839
31843
  }
31840
31844
  /**
31841
- * Re-points the diagram at a new SPARQL endpoint or query preset by recreating it with a
31842
- * fresh data provider. The canvas is reset to empty, matching the initial mount.
31845
+ * Re-points the diagram at a new SPARQL endpoint by recreating it with a fresh data provider.
31846
+ * The canvas is reset to empty, matching the initial mount, since the data of another repository
31847
+ * has nothing to do with the current graph.
31843
31848
  */
31844
31849
  async function updateReactodia(props) {
31845
31850
  if (!workspaceContext) {
@@ -31864,7 +31869,7 @@ function unmountReactodia(root) {
31864
31869
  root.unmount();
31865
31870
  }
31866
31871
 
31867
- const graphwiseReactodiaCss = "graphwise-reactodia{display:block;width:100%;height:75vh}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}";
31872
+ const graphwiseReactodiaCss = "graphwise-reactodia{display:block;width:100%;height:75vh}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}graphwise-reactodia .reactodia-selection-action__link{display:none}";
31868
31873
 
31869
31874
  const GraphwiseReactodia = class {
31870
31875
  constructor(hostRef) {
@@ -31874,12 +31879,13 @@ const GraphwiseReactodia = class {
31874
31879
  */
31875
31880
  this.language = LanguageKey.EN;
31876
31881
  }
31877
- onProviderSettingsChange() {
31882
+ onCurrentRepositoryChange() {
31878
31883
  this.renderGraph();
31879
31884
  }
31880
- onLanguageChange() {
31885
+ onLanguageOrSettingsChange() {
31881
31886
  // The translations are evaluated by the workspace at construction, so the only way
31882
31887
  // to re-translate the UI is to re-create the graph.
31888
+ // Setting changes should keep the current diagram despite possible
31883
31889
  this.renderGraph(true);
31884
31890
  }
31885
31891
  onThemeChange() {
@@ -31898,7 +31904,7 @@ const GraphwiseReactodia = class {
31898
31904
  }
31899
31905
  }
31900
31906
  render() {
31901
- return (index$1.h(index$1.Host, { key: 'f3247ee3254896e4e4987bd2fa0e3dfce1ce1d2a' }));
31907
+ return (index$1.h(index$1.Host, { key: '6f1115b91eac308ef155978dfe1482f152c38b1b' }));
31902
31908
  }
31903
31909
  renderGraph(isReloading) {
31904
31910
  var _a;
@@ -31908,6 +31914,9 @@ const GraphwiseReactodia = class {
31908
31914
  if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.queryFunction)) {
31909
31915
  throw new Error('config.queryFunction is required');
31910
31916
  }
31917
+ if (!this.providerSettings) {
31918
+ throw new Error('providerSettings is required');
31919
+ }
31911
31920
  if (!this.hostElement) {
31912
31921
  return;
31913
31922
  }
@@ -31927,9 +31936,9 @@ const GraphwiseReactodia = class {
31927
31936
  }
31928
31937
  get hostElement() { return index$1.getElement(this); }
31929
31938
  static get watchers() { return {
31930
- "currentRepository": ["onProviderSettingsChange"],
31931
- "providerSettings": ["onProviderSettingsChange"],
31932
- "language": ["onLanguageChange"],
31939
+ "currentRepository": ["onCurrentRepositoryChange"],
31940
+ "language": ["onLanguageOrSettingsChange"],
31941
+ "providerSettings": ["onLanguageOrSettingsChange"],
31933
31942
  "theme": ["onThemeChange"]
31934
31943
  }; }
31935
31944
  };
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["graphwise-reactodia.cjs",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"],"theme":["onThemeChange"]}]]]], options);
22
+ return index.bootstrapLazy([["graphwise-reactodia.cjs",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onCurrentRepositoryChange"],"language":["onLanguageOrSettingsChange"],"providerSettings":["onLanguageOrSettingsChange"],"theme":["onThemeChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-CcJr5lkF.js');
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["graphwise-reactodia.cjs",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"],"theme":["onThemeChange"]}]]]], options);
9
+ return index.bootstrapLazy([["graphwise-reactodia.cjs",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onCurrentRepositoryChange"],"language":["onLanguageOrSettingsChange"],"providerSettings":["onLanguageOrSettingsChange"],"theme":["onThemeChange"]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -7,4 +7,7 @@ graphwise-reactodia .reactodia-container {
7
7
  position: relative;
8
8
  width: 100%;
9
9
  height: 100%;
10
+ }
11
+ graphwise-reactodia .reactodia-selection-action__link {
12
+ display: none;
10
13
  }
@@ -20,12 +20,13 @@ export class GraphwiseReactodia {
20
20
  */
21
21
  this.language = LanguageKey.EN;
22
22
  }
23
- onProviderSettingsChange() {
23
+ onCurrentRepositoryChange() {
24
24
  this.renderGraph();
25
25
  }
26
- onLanguageChange() {
26
+ onLanguageOrSettingsChange() {
27
27
  // The translations are evaluated by the workspace at construction, so the only way
28
28
  // to re-translate the UI is to re-create the graph.
29
+ // Setting changes should keep the current diagram despite possible
29
30
  this.renderGraph(true);
30
31
  }
31
32
  onThemeChange() {
@@ -44,7 +45,7 @@ export class GraphwiseReactodia {
44
45
  }
45
46
  }
46
47
  render() {
47
- return (h(Host, { key: 'f3247ee3254896e4e4987bd2fa0e3dfce1ce1d2a' }));
48
+ return (h(Host, { key: '6f1115b91eac308ef155978dfe1482f152c38b1b' }));
48
49
  }
49
50
  renderGraph(isReloading) {
50
51
  var _a;
@@ -54,6 +55,9 @@ export class GraphwiseReactodia {
54
55
  if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.queryFunction)) {
55
56
  throw new Error('config.queryFunction is required');
56
57
  }
58
+ if (!this.providerSettings) {
59
+ throw new Error('providerSettings is required');
60
+ }
57
61
  if (!this.hostElement) {
58
62
  return;
59
63
  }
@@ -172,7 +176,7 @@ export class GraphwiseReactodia {
172
176
  "optional": true,
173
177
  "docs": {
174
178
  "tags": [],
175
- "text": "Query preset for the SPARQL data provider, owned and configured by the host. A DOM\nproperty (an object, not an attribute) passed in from outside the wrapper. When omitted,\nthe data provider falls back to Reactodia's generic OWL/RDFS preset. Changing it rebuilds\nthe data provider and resets the canvas."
179
+ "text": "Query preset for the SPARQL data provider, owned and configured by the host. A DOM\nproperty (an object, not an attribute) passed in from outside the wrapper. Required: the\nwrapper has no default preset and throws when it is missing. Changing it rebuilds the data\nprovider and reloads the graph with it, keeping the current diagram."
176
180
  },
177
181
  "getter": false,
178
182
  "setter": false
@@ -202,13 +206,13 @@ export class GraphwiseReactodia {
202
206
  static get watchers() {
203
207
  return [{
204
208
  "propName": "currentRepository",
205
- "methodName": "onProviderSettingsChange"
206
- }, {
207
- "propName": "providerSettings",
208
- "methodName": "onProviderSettingsChange"
209
+ "methodName": "onCurrentRepositoryChange"
209
210
  }, {
210
211
  "propName": "language",
211
- "methodName": "onLanguageChange"
212
+ "methodName": "onLanguageOrSettingsChange"
213
+ }, {
214
+ "propName": "providerSettings",
215
+ "methodName": "onLanguageOrSettingsChange"
212
216
  }, {
213
217
  "propName": "theme",
214
218
  "methodName": "onThemeChange"
@@ -35,8 +35,7 @@ let workspaceContext = null;
35
35
  const subscriptions = new SubscriptionList();
36
36
  /**
37
37
  * Builds a Reactodia {@link SparqlDataProvider} for the given endpoint using the supplied
38
- * query preset. The host owns the query configuration and passes it in via props; when none
39
- * is provided we fall back to Reactodia's generic {@link OwlRdfsSettings} OWL/RDFS preset.
38
+ * query preset. The host owns the query configuration and always passes it in via props.
40
39
  */
41
40
  function createDataProvider(props) {
42
41
  const { currentRepository, config, providerSettings } = props;
@@ -131,8 +130,9 @@ function ReactodiaApp(props) {
131
130
  const savedDiagram = service(DiagramStorageService).load();
132
131
  const diagramService = service(DiagramService);
133
132
  if (isReload) {
134
- // Simply reload without using the current state. This may happen when the user switches the language at runtime.
135
- // since there is no existing mechanism to re-translate the UI at runtime (not for the UI labels at least)
133
+ // Reload the diagram that is currently on the canvas. This may happen when the host changes the provider
134
+ // settings, or when the user switches the language at runtime, since there is no existing mechanism to
135
+ // re-translate the UI at runtime (not for the UI labels at least)
136
136
  await diagramService.importDiagram(model, dataProvider, currentDiagram, signal);
137
137
  }
138
138
  else if ((_a = config.seedIris) === null || _a === void 0 ? void 0 : _a.length) {
@@ -163,7 +163,11 @@ function ReactodiaApp(props) {
163
163
  defaultLanguage: language,
164
164
  translations: translationsForLanguage(language),
165
165
  typeStyleResolver: resolveTypeStyle
166
- }, createElement(DefaultWorkspace, { menu: createElement(GraphwiseMenu) }));
166
+ }, createElement(DefaultWorkspace, {
167
+ menu: createElement(GraphwiseMenu),
168
+ // place Undo/redo/layout actions in top right corner.
169
+ actionsToolbar: { dock: 'ne' }
170
+ }));
167
171
  }
168
172
  /**
169
173
  * Mounts the Reactodia application into the given container and returns the React root.
@@ -174,8 +178,9 @@ export function mountReactodia(container, props) {
174
178
  return root;
175
179
  }
176
180
  /**
177
- * Re-points the diagram at a new SPARQL endpoint or query preset by recreating it with a
178
- * fresh data provider. The canvas is reset to empty, matching the initial mount.
181
+ * Re-points the diagram at a new SPARQL endpoint by recreating it with a fresh data provider.
182
+ * The canvas is reset to empty, matching the initial mount, since the data of another repository
183
+ * has nothing to do with the current graph.
179
184
  */
180
185
  export async function updateReactodia(props) {
181
186
  if (!workspaceContext) {
@@ -27,6 +27,12 @@ function setQueryFunction() {
27
27
  reactodia.config = {...reactodia.config, queryFunction: stubQueryFunction};
28
28
  }
29
29
 
30
+ // The wrapper has no default preset, so the host always passes one. The demo uses Reactodia's generic
31
+ // OWL/RDFS preset, copied into `owl-rdfs-settings.js`.
32
+ function setProviderSettings() {
33
+ reactodia.providerSettings = OWL_RDFS_SETTINGS;
34
+ }
35
+
30
36
  function setSeed() {
31
37
  reactodia.config = {...reactodia.config, seedIris: SEED_NODES};
32
38
  }
@@ -0,0 +1,195 @@
1
+ // A copy of Reactodia's `OwlRdfsSettings` preset (`src/data/sparql/sparqlDataProviderSettings.ts` in the
2
+ // reactodia-workspace fork), which the demo page passes to the wrapper as its `providerSettings`. The wrapper
3
+ // requires the host to pass the settings, and this plain script can't import them from `@reactodia/workspace`.
4
+ // Keep it in sync with the fork: `RDF_SETTINGS` mirrors `RdfSettings`, `OWL_RDFS_SETTINGS_OVERRIDE` mirrors
5
+ // `OwlRdfsSettingsOverride`.
6
+
7
+ const RDF_SETTINGS = {
8
+ linkConfigurations: [],
9
+ openWorldLinks: false,
10
+
11
+ propertyConfigurations: [],
12
+ openWorldProperties: false,
13
+
14
+ linksInfoQuery: `SELECT ?source ?type ?target
15
+ WHERE {
16
+ \${linkConfigurations}
17
+ VALUES (?source) {\${sourceIris}}
18
+ VALUES (?target) {\${targetIris}}
19
+ }`,
20
+
21
+ defaultPrefix: '',
22
+
23
+ schemaLabelProperty: 'rdfs:label',
24
+ dataLabelProperty: 'rdfs:label',
25
+
26
+ fullTextSearch: {
27
+ prefix: '',
28
+ queryPattern: '',
29
+ },
30
+
31
+ classTreeQuery: '',
32
+
33
+ classInfoQuery:
34
+ `SELECT ?class ?label ?instcount WHERE {
35
+ VALUES(?class) {\${ids}}
36
+ OPTIONAL {
37
+ ?class \${schemaLabelProperty} ?label
38
+ \${labelLanguageFilter}
39
+ }
40
+ BIND("" as ?instcount)
41
+ }`,
42
+
43
+ linkTypesQuery:
44
+ `SELECT DISTINCT ?link ?instcount ?label WHERE {
45
+ \${linkTypesPattern}
46
+ OPTIONAL {
47
+ ?link \${schemaLabelProperty} ?label
48
+ \${labelLanguageFilter}
49
+ }
50
+ }`,
51
+
52
+ linkTypesPattern: '',
53
+
54
+ linkTypesInfoQuery:
55
+ `SELECT ?link ?label WHERE {
56
+ VALUES(?link) {\${ids}}
57
+ OPTIONAL {
58
+ ?link \${schemaLabelProperty} ?label
59
+ \${labelLanguageFilter}
60
+ }
61
+ }`,
62
+
63
+ propertyInfoQuery:
64
+ `SELECT ?property ?label WHERE {
65
+ VALUES(?property) {\${ids}}
66
+ OPTIONAL {
67
+ ?property \${schemaLabelProperty} ?label
68
+ \${labelLanguageFilter}
69
+ }
70
+ }`,
71
+
72
+ elementInfoQuery: '',
73
+ imageQueryPattern: '',
74
+
75
+ linkTypesOfQuery: '',
76
+ linkTypesStatisticsQuery: '',
77
+
78
+ lookupQuery:
79
+ `SELECT \${outerProjection} WHERE {
80
+ \${filterInnerPrelude}
81
+ {
82
+ SELECT DISTINCT \${innerProjection} WHERE {
83
+ \${filterByType}
84
+ \${filterByRefElementLink}
85
+ \${filterByText}
86
+ \${filterAdditionalRestriction}
87
+ } \${orderBy} \${limit}
88
+ }
89
+ \${queryTypes}
90
+ \${queryElementInfo}
91
+ } \${orderBy}`,
92
+
93
+ filterRefElementLinkPattern: '',
94
+ filterTypePattern: '',
95
+ filterAdditionalRestriction: '',
96
+ filterElementInfoPattern: '',
97
+ };
98
+
99
+ const OWL_RDFS_SETTINGS_OVERRIDE = {
100
+ defaultPrefix:
101
+ `PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
102
+ PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
103
+ PREFIX owl: <http://www.w3.org/2002/07/owl#>
104
+ `,
105
+ schemaLabelProperty: 'rdfs:label',
106
+ dataLabelProperty: 'rdfs:label',
107
+ fullTextSearch: {
108
+ prefix: '',
109
+ queryPattern:
110
+ `?inst \${dataLabelProperty} ?search1
111
+ FILTER regex(COALESCE(str(?search1)), "\${text}", "i")
112
+ BIND(0 as ?score)
113
+ `,
114
+ extractLabel: true,
115
+ },
116
+ classTreeQuery: `
117
+ SELECT ?class ?label ?parent
118
+ WHERE {
119
+ {
120
+ ?class a rdfs:Class
121
+ } UNION {
122
+ ?class a owl:Class
123
+ }
124
+ FILTER ISIRI(?class)
125
+ OPTIONAL {
126
+ ?class rdfs:label ?label
127
+ \${labelLanguageFilter}
128
+ }
129
+ OPTIONAL {?class rdfs:subClassOf ?parent. FILTER ISIRI(?parent)}
130
+ }
131
+ `,
132
+
133
+ // todo: think more, maybe add a limit here?
134
+ linkTypesPattern: `
135
+ { ?link a rdf:Property }
136
+ UNION
137
+ { ?link a owl:ObjectProperty }
138
+ BIND('' as ?instcount)
139
+ `,
140
+ elementInfoQuery: `
141
+ CONSTRUCT {
142
+ ?inst <urn:reactodia:sparql:type> ?class .
143
+ ?inst <urn:reactodia:sparql:label> ?label .
144
+ ?inst ?propType ?propValue.
145
+ } WHERE {
146
+ VALUES (?inst) {\${ids}}
147
+ OPTIONAL { ?inst a ?class }
148
+ OPTIONAL {
149
+ ?inst \${dataLabelProperty} ?label
150
+ \${labelLanguageFilter}
151
+ }
152
+ OPTIONAL {
153
+ \${propertyConfigurations}
154
+ FILTER (isLiteral(?propValue))
155
+ \${valueLanguageFilter}
156
+ }
157
+ }
158
+ `,
159
+ imageQueryPattern: '{ ?inst ?linkType ?image } UNION { [] ?linkType ?inst. BIND(?inst as ?image) }',
160
+ linkTypesOfQuery: `
161
+ SELECT DISTINCT ?link ?direction
162
+ WHERE {
163
+ \${linkConfigurations}
164
+ }
165
+ `,
166
+ linkTypesStatisticsQuery: `
167
+ SELECT ?link ?outCount ?inCount
168
+ WHERE {
169
+ {
170
+ SELECT (\${linkId} as ?link) (count(?outObject) as ?outCount) WHERE {
171
+ \${linkConfigurationOut}
172
+ \${navigateElementFilterOut}
173
+ } LIMIT 101
174
+ } {
175
+ SELECT (\${linkId} as ?link) (count(?inObject) as ?inCount) WHERE {
176
+ \${linkConfigurationIn}
177
+ \${navigateElementFilterIn}
178
+ } LIMIT 101
179
+ }
180
+ }
181
+ `,
182
+ filterRefElementLinkPattern: '',
183
+ filterTypePattern: '?inst a ?instType. ?instType rdfs:subClassOf* ?class',
184
+ filterElementInfoPattern: `
185
+ OPTIONAL {?inst rdf:type ?foundClass}
186
+ BIND (coalesce(?foundClass, owl:Thing) as ?class)
187
+ OPTIONAL {
188
+ ?inst \${dataLabelProperty} ?label
189
+ \${labelLanguageFilter}
190
+ }
191
+ `,
192
+ filterAdditionalRestriction: '',
193
+ };
194
+
195
+ const OWL_RDFS_SETTINGS = {...RDF_SETTINGS, ...OWL_RDFS_SETTINGS_OVERRIDE};
@@ -31697,8 +31697,7 @@ let workspaceContext = null;
31697
31697
  const subscriptions = new SubscriptionList();
31698
31698
  /**
31699
31699
  * Builds a Reactodia {@link SparqlDataProvider} for the given endpoint using the supplied
31700
- * query preset. The host owns the query configuration and passes it in via props; when none
31701
- * is provided we fall back to Reactodia's generic {@link OwlRdfsSettings} OWL/RDFS preset.
31700
+ * query preset. The host owns the query configuration and always passes it in via props.
31702
31701
  */
31703
31702
  function createDataProvider(props) {
31704
31703
  const { currentRepository, config, providerSettings } = props;
@@ -31793,8 +31792,9 @@ function ReactodiaApp(props) {
31793
31792
  const savedDiagram = service(DiagramStorageService).load();
31794
31793
  const diagramService = service(DiagramService);
31795
31794
  if (isReload) {
31796
- // Simply reload without using the current state. This may happen when the user switches the language at runtime.
31797
- // since there is no existing mechanism to re-translate the UI at runtime (not for the UI labels at least)
31795
+ // Reload the diagram that is currently on the canvas. This may happen when the host changes the provider
31796
+ // settings, or when the user switches the language at runtime, since there is no existing mechanism to
31797
+ // re-translate the UI at runtime (not for the UI labels at least)
31798
31798
  await diagramService.importDiagram(model, dataProvider, currentDiagram, signal);
31799
31799
  }
31800
31800
  else if ((_a = config.seedIris) === null || _a === void 0 ? void 0 : _a.length) {
@@ -31825,7 +31825,11 @@ function ReactodiaApp(props) {
31825
31825
  defaultLanguage: language,
31826
31826
  translations: translationsForLanguage(language),
31827
31827
  typeStyleResolver: resolveTypeStyle
31828
- }, reactExports.createElement(DefaultWorkspace, { menu: reactExports.createElement(GraphwiseMenu) }));
31828
+ }, reactExports.createElement(DefaultWorkspace, {
31829
+ menu: reactExports.createElement(GraphwiseMenu),
31830
+ // place Undo/redo/layout actions in top right corner.
31831
+ actionsToolbar: { dock: 'ne' }
31832
+ }));
31829
31833
  }
31830
31834
  /**
31831
31835
  * Mounts the Reactodia application into the given container and returns the React root.
@@ -31836,8 +31840,9 @@ function mountReactodia(container, props) {
31836
31840
  return root;
31837
31841
  }
31838
31842
  /**
31839
- * Re-points the diagram at a new SPARQL endpoint or query preset by recreating it with a
31840
- * fresh data provider. The canvas is reset to empty, matching the initial mount.
31843
+ * Re-points the diagram at a new SPARQL endpoint by recreating it with a fresh data provider.
31844
+ * The canvas is reset to empty, matching the initial mount, since the data of another repository
31845
+ * has nothing to do with the current graph.
31841
31846
  */
31842
31847
  async function updateReactodia(props) {
31843
31848
  if (!workspaceContext) {
@@ -31862,7 +31867,7 @@ function unmountReactodia(root) {
31862
31867
  root.unmount();
31863
31868
  }
31864
31869
 
31865
- const graphwiseReactodiaCss = "graphwise-reactodia{display:block;width:100%;height:75vh}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}";
31870
+ const graphwiseReactodiaCss = "graphwise-reactodia{display:block;width:100%;height:75vh}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}graphwise-reactodia .reactodia-selection-action__link{display:none}";
31866
31871
 
31867
31872
  const GraphwiseReactodia = class {
31868
31873
  constructor(hostRef) {
@@ -31872,12 +31877,13 @@ const GraphwiseReactodia = class {
31872
31877
  */
31873
31878
  this.language = LanguageKey.EN;
31874
31879
  }
31875
- onProviderSettingsChange() {
31880
+ onCurrentRepositoryChange() {
31876
31881
  this.renderGraph();
31877
31882
  }
31878
- onLanguageChange() {
31883
+ onLanguageOrSettingsChange() {
31879
31884
  // The translations are evaluated by the workspace at construction, so the only way
31880
31885
  // to re-translate the UI is to re-create the graph.
31886
+ // Setting changes should keep the current diagram despite possible
31881
31887
  this.renderGraph(true);
31882
31888
  }
31883
31889
  onThemeChange() {
@@ -31896,7 +31902,7 @@ const GraphwiseReactodia = class {
31896
31902
  }
31897
31903
  }
31898
31904
  render() {
31899
- return (h(Host, { key: 'f3247ee3254896e4e4987bd2fa0e3dfce1ce1d2a' }));
31905
+ return (h(Host, { key: '6f1115b91eac308ef155978dfe1482f152c38b1b' }));
31900
31906
  }
31901
31907
  renderGraph(isReloading) {
31902
31908
  var _a;
@@ -31906,6 +31912,9 @@ const GraphwiseReactodia = class {
31906
31912
  if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.queryFunction)) {
31907
31913
  throw new Error('config.queryFunction is required');
31908
31914
  }
31915
+ if (!this.providerSettings) {
31916
+ throw new Error('providerSettings is required');
31917
+ }
31909
31918
  if (!this.hostElement) {
31910
31919
  return;
31911
31920
  }
@@ -31925,9 +31934,9 @@ const GraphwiseReactodia = class {
31925
31934
  }
31926
31935
  get hostElement() { return getElement(this); }
31927
31936
  static get watchers() { return {
31928
- "currentRepository": ["onProviderSettingsChange"],
31929
- "providerSettings": ["onProviderSettingsChange"],
31930
- "language": ["onLanguageChange"],
31937
+ "currentRepository": ["onCurrentRepositoryChange"],
31938
+ "language": ["onLanguageOrSettingsChange"],
31939
+ "providerSettings": ["onLanguageOrSettingsChange"],
31931
31940
  "theme": ["onThemeChange"]
31932
31941
  }; }
31933
31942
  };
@@ -17,5 +17,5 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy([["graphwise-reactodia",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"],"theme":["onThemeChange"]}]]]], options);
20
+ return bootstrapLazy([["graphwise-reactodia",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onCurrentRepositoryChange"],"language":["onLanguageOrSettingsChange"],"providerSettings":["onLanguageOrSettingsChange"],"theme":["onThemeChange"]}]]]], options);
21
21
  });
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-CalY52z6.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["graphwise-reactodia",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"],"theme":["onThemeChange"]}]]]], options);
8
+ return bootstrapLazy([["graphwise-reactodia",[[0,"graphwise-reactodia",{"currentRepository":[1,"current-repository"],"config":[16],"language":[1],"providerSettings":[16,"provider-settings"],"theme":[1]},null,{"currentRepository":["onCurrentRepositoryChange"],"language":["onLanguageOrSettingsChange"],"providerSettings":["onLanguageOrSettingsChange"],"theme":["onThemeChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -1 +1 @@
1
- import{p as e,b as r}from"./p-Cypw7ydc.js";export{s as setNonce}from"./p-Cypw7ydc.js";import{g as t}from"./p-CalY52z6.js";(()=>{const r=import.meta.url,t={};return""!==r&&(t.resourcesUrl=new URL(".",r).href),e(t)})().then((async e=>(await t(),r([["p-52bd1b0e",[[0,"graphwise-reactodia",{currentRepository:[1,"current-repository"],config:[16],language:[1],providerSettings:[16,"provider-settings"],theme:[1]},null,{currentRepository:["onProviderSettingsChange"],providerSettings:["onProviderSettingsChange"],language:["onLanguageChange"],theme:["onThemeChange"]}]]]],e))));
1
+ import{p as e,b as r}from"./p-Cypw7ydc.js";export{s as setNonce}from"./p-Cypw7ydc.js";import{g as t}from"./p-CalY52z6.js";(()=>{const r=import.meta.url,t={};return""!==r&&(t.resourcesUrl=new URL(".",r).href),e(t)})().then((async e=>(await t(),r([["p-420b9dce",[[0,"graphwise-reactodia",{currentRepository:[1,"current-repository"],config:[16],language:[1],providerSettings:[16,"provider-settings"],theme:[1]},null,{currentRepository:["onCurrentRepositoryChange"],language:["onLanguageOrSettingsChange"],providerSettings:["onLanguageOrSettingsChange"],theme:["onThemeChange"]}]]]],e))));