graphwise-reactodia 0.0.1-TR9 → 0.0.1-blank-nodes-TR1
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/dist/cjs/graphwise-reactodia.cjs.entry.js +120 -20
- package/dist/cjs/graphwise-reactodia.cjs.js +2 -2
- package/dist/cjs/{index-CII9aUQC.js → index-D1-Nmh_N.js} +111 -9
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.css +10 -2
- package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +57 -8
- package/dist/collection/components/graphwise-reactodia/providers/service/service.provider.js +5 -5
- package/dist/collection/components/graphwise-reactodia/reactodia-app.js +23 -7
- package/dist/collection/components/graphwise-reactodia/styles/type-style.resolver.js +53 -0
- package/dist/esm/graphwise-reactodia.entry.js +120 -20
- package/dist/esm/graphwise-reactodia.js +3 -3
- package/dist/esm/{index-Cypw7ydc.js → index-CKnLINf8.js} +112 -9
- package/dist/esm/loader.js +3 -3
- package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
- package/dist/graphwise-reactodia/p-3c085b73.entry.js +1 -0
- package/dist/graphwise-reactodia/p-CKnLINf8.js +2 -0
- package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +14 -2
- package/dist/types/components/graphwise-reactodia/models/reactodia-app-props.d.ts +1 -1
- package/dist/types/components/graphwise-reactodia/providers/service/service.provider.d.ts +2 -2
- package/dist/types/components/graphwise-reactodia/reactodia-app.d.ts +6 -0
- package/dist/types/components/graphwise-reactodia/styles/type-style.resolver.d.ts +11 -0
- package/dist/types/components.d.ts +10 -2
- package/package.json +1 -1
- package/dist/graphwise-reactodia/p-5b907998.entry.js +0 -1
- package/dist/graphwise-reactodia/p-Cypw7ydc.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$1 = require('./index-
|
|
3
|
+
var index$1 = require('./index-D1-Nmh_N.js');
|
|
4
4
|
var index = require('./index.cjs.js');
|
|
5
5
|
|
|
6
6
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -6833,6 +6833,7 @@ var RdfSettings = {
|
|
|
6833
6833
|
openWorldLinks: false,
|
|
6834
6834
|
propertyConfigurations: [],
|
|
6835
6835
|
openWorldProperties: false,
|
|
6836
|
+
acceptBlankNodes: false,
|
|
6836
6837
|
linksInfoQuery: `SELECT ?source ?type ?target
|
|
6837
6838
|
WHERE {
|
|
6838
6839
|
\${linkConfigurations}
|
|
@@ -7036,7 +7037,7 @@ var SparqlDataProvider = class {
|
|
|
7036
7037
|
options;
|
|
7037
7038
|
settings;
|
|
7038
7039
|
queryFunction;
|
|
7039
|
-
acceptBlankNodes
|
|
7040
|
+
acceptBlankNodes;
|
|
7040
7041
|
chunkMeasure;
|
|
7041
7042
|
linkByPredicate = /* @__PURE__ */ new Map();
|
|
7042
7043
|
linkById = /* @__PURE__ */ new Map();
|
|
@@ -7052,6 +7053,7 @@ var SparqlDataProvider = class {
|
|
|
7052
7053
|
this.settings = settings;
|
|
7053
7054
|
this.queryFunction = queryFunction;
|
|
7054
7055
|
const { chunk, queryMethod = "GET", prepareLabelPredicate, prepareImagePredicate } = this.options;
|
|
7056
|
+
this.acceptBlankNodes = Boolean(settings.acceptBlankNodes);
|
|
7055
7057
|
if (chunk) {
|
|
7056
7058
|
if (!Number.isSafeInteger(chunk.maxSize)) throw new Error("SparqlDataProviderOptions.chunk.maxSize should be a non-negative number");
|
|
7057
7059
|
}
|
|
@@ -7081,6 +7083,17 @@ var SparqlDataProvider = class {
|
|
|
7081
7083
|
this.labelPredicate = prepareLabelPredicate ?? rdfs.label;
|
|
7082
7084
|
this.imagePredicate = prepareImagePredicate ?? schema.thumbnailUrl;
|
|
7083
7085
|
}
|
|
7086
|
+
/**
|
|
7087
|
+
* Sets whether blank nodes are allowed to appear as entities in the query results.
|
|
7088
|
+
*
|
|
7089
|
+
* The flag is read while a query is being built, so the change applies to every
|
|
7090
|
+
* subsequent request without recreating the provider.
|
|
7091
|
+
*
|
|
7092
|
+
* @see {@link SparqlDataProviderSettings.acceptBlankNodes}
|
|
7093
|
+
*/
|
|
7094
|
+
setAcceptBlankNodes(accept) {
|
|
7095
|
+
this.acceptBlankNodes = accept;
|
|
7096
|
+
}
|
|
7084
7097
|
async queryChunked(items, callback) {
|
|
7085
7098
|
const { maxSize, measure } = this.chunkMeasure;
|
|
7086
7099
|
const tasks = [];
|
|
@@ -30655,15 +30668,15 @@ class ServiceProvider {
|
|
|
30655
30668
|
/**
|
|
30656
30669
|
* Returns the instance of the given service type, creating and caching it on first request.
|
|
30657
30670
|
*
|
|
30658
|
-
* @param
|
|
30671
|
+
* @param serviceClass The service type to retrieve.
|
|
30659
30672
|
* @returns The shared instance of the service.
|
|
30660
30673
|
* @template T The type of the service to retrieve.
|
|
30661
30674
|
*/
|
|
30662
|
-
static get(
|
|
30663
|
-
if (!ServiceProvider.SERVICE_INSTANCES.has(
|
|
30664
|
-
ServiceProvider.SERVICE_INSTANCES.set(
|
|
30675
|
+
static get(serviceClass) {
|
|
30676
|
+
if (!ServiceProvider.SERVICE_INSTANCES.has(serviceClass.ID)) {
|
|
30677
|
+
ServiceProvider.SERVICE_INSTANCES.set(serviceClass.ID, new serviceClass());
|
|
30665
30678
|
}
|
|
30666
|
-
return ServiceProvider.SERVICE_INSTANCES.get(
|
|
30679
|
+
return ServiceProvider.SERVICE_INSTANCES.get(serviceClass.ID);
|
|
30667
30680
|
}
|
|
30668
30681
|
}
|
|
30669
30682
|
ServiceProvider.SERVICE_INSTANCES = new Map();
|
|
@@ -30882,6 +30895,60 @@ class SubscriptionList {
|
|
|
30882
30895
|
}
|
|
30883
30896
|
}
|
|
30884
30897
|
|
|
30898
|
+
const NODE_COLOR_VARIABLES = [
|
|
30899
|
+
'--gw-foreground-visual-diagram-categorical-01',
|
|
30900
|
+
'--gw-foreground-visual-diagram-categorical-02',
|
|
30901
|
+
'--gw-foreground-visual-diagram-categorical-03',
|
|
30902
|
+
'--gw-foreground-visual-diagram-categorical-04',
|
|
30903
|
+
'--gw-foreground-visual-diagram-categorical-05',
|
|
30904
|
+
'--gw-foreground-visual-diagram-categorical-06',
|
|
30905
|
+
'--gw-foreground-visual-diagram-categorical-07',
|
|
30906
|
+
'--gw-foreground-visual-diagram-categorical-08',
|
|
30907
|
+
'--gw-foreground-visual-diagram-categorical-09',
|
|
30908
|
+
'--gw-foreground-visual-diagram-categorical-10',
|
|
30909
|
+
'--gw-foreground-visual-diagram-categorical-11',
|
|
30910
|
+
'--gw-foreground-visual-diagram-categorical-12',
|
|
30911
|
+
'--gw-foreground-visual-diagram-categorical-13',
|
|
30912
|
+
'--gw-foreground-visual-diagram-categorical-14',
|
|
30913
|
+
'--gw-foreground-visual-diagram-categorical-15',
|
|
30914
|
+
'--gw-foreground-visual-diagram-categorical-16',
|
|
30915
|
+
'--gw-foreground-visual-diagram-categorical-17',
|
|
30916
|
+
'--gw-foreground-visual-diagram-categorical-18',
|
|
30917
|
+
'--gw-foreground-visual-diagram-categorical-19',
|
|
30918
|
+
'--gw-foreground-visual-diagram-categorical-20'
|
|
30919
|
+
];
|
|
30920
|
+
/**
|
|
30921
|
+
* Color slot assigned to each type, in the order the types are first seen.
|
|
30922
|
+
*/
|
|
30923
|
+
const typeToIndex = new Map();
|
|
30924
|
+
function getColor(variable) {
|
|
30925
|
+
return getComputedStyle(document.documentElement).getPropertyValue(variable).trim();
|
|
30926
|
+
}
|
|
30927
|
+
/**
|
|
30928
|
+
* Colors an element by its type: each type takes the next color from the palette, which wraps
|
|
30929
|
+
* around once it runs out
|
|
30930
|
+
*
|
|
30931
|
+
* Returns `undefined` for elements without a type (placeholders and other non-entity elements) and
|
|
30932
|
+
* when the host does not define the palette, leaving Reactodia to fall back to its own hash-based
|
|
30933
|
+
* colors.
|
|
30934
|
+
*/
|
|
30935
|
+
const resolveTypeStyle = (types) => {
|
|
30936
|
+
const type = types[0];
|
|
30937
|
+
if (!type) {
|
|
30938
|
+
return undefined;
|
|
30939
|
+
}
|
|
30940
|
+
let index = typeToIndex.get(type);
|
|
30941
|
+
if (index === undefined) {
|
|
30942
|
+
index = typeToIndex.size;
|
|
30943
|
+
typeToIndex.set(type, index);
|
|
30944
|
+
}
|
|
30945
|
+
const color = getColor(NODE_COLOR_VARIABLES[index % NODE_COLOR_VARIABLES.length]);
|
|
30946
|
+
return color ? { color } : undefined;
|
|
30947
|
+
};
|
|
30948
|
+
const resetColors = () => {
|
|
30949
|
+
typeToIndex.clear();
|
|
30950
|
+
};
|
|
30951
|
+
|
|
30885
30952
|
/**
|
|
30886
30953
|
* Reactodia ships English as its built-in default bundle, so English needs no override.
|
|
30887
30954
|
* Other languages are layered on top as partial bundles; unknown codes fall back to English.
|
|
@@ -30899,6 +30966,11 @@ function translationsForLanguage(language) {
|
|
|
30899
30966
|
* runs outside React and therefore cannot call the `useWorkspace` hook.
|
|
30900
30967
|
*/
|
|
30901
30968
|
let workspaceContext = null;
|
|
30969
|
+
/**
|
|
30970
|
+
* The data provider backing the current diagram, kept so runtime flags can be flipped on it
|
|
30971
|
+
* in place. Replaced whenever the provider is rebuilt.
|
|
30972
|
+
*/
|
|
30973
|
+
let activeDataProvider = null;
|
|
30902
30974
|
/**
|
|
30903
30975
|
* Active listeners that persist diagram edits to local storage. Populated when the workspace
|
|
30904
30976
|
* mounts and released in {@link unmountReactodia}, so persistence follows the same lifecycle as
|
|
@@ -30908,15 +30980,24 @@ const subscriptions = new SubscriptionList();
|
|
|
30908
30980
|
/**
|
|
30909
30981
|
* Builds a Reactodia {@link SparqlDataProvider} for the given endpoint using the supplied
|
|
30910
30982
|
* query preset. The host owns the query configuration and passes it in via props; when none
|
|
30911
|
-
* is provided we fall back to Reactodia's generic {@link
|
|
30983
|
+
* is provided we fall back to Reactodia's generic {@link OwlStatsSettings} OWL/RDFS preset.
|
|
30912
30984
|
*/
|
|
30913
30985
|
function createDataProvider(props) {
|
|
30914
30986
|
const { currentRepository, config, providerSettings } = props;
|
|
30915
|
-
|
|
30987
|
+
activeDataProvider = new SparqlDataProvider({
|
|
30916
30988
|
endpointUrl: currentRepository,
|
|
30917
30989
|
queryMethod: 'POST',
|
|
30918
30990
|
queryFunction: config.queryFunction
|
|
30919
|
-
}, providerSettings);
|
|
30991
|
+
}, Object.assign(Object.assign({}, OwlStatsSettings), providerSettings));
|
|
30992
|
+
return activeDataProvider;
|
|
30993
|
+
}
|
|
30994
|
+
/**
|
|
30995
|
+
* Flips the `acceptBlankNodes` flag on the live data provider. The flag is read while a query
|
|
30996
|
+
* is being built, so this applies to every subsequent request without recreating the provider
|
|
30997
|
+
* and without resetting the canvas.
|
|
30998
|
+
*/
|
|
30999
|
+
function setAcceptBlankNodes(accept) {
|
|
31000
|
+
activeDataProvider === null || activeDataProvider === void 0 ? void 0 : activeDataProvider.setAcceptBlankNodes(accept);
|
|
30920
31001
|
}
|
|
30921
31002
|
/**
|
|
30922
31003
|
* Places the seed entities on the canvas. Each IRI is added as a placeholder element, and data is then loaded for the
|
|
@@ -31004,7 +31085,7 @@ function ReactodiaApp(props) {
|
|
|
31004
31085
|
if (isReload) {
|
|
31005
31086
|
// Simply reload without using the current state. This may happen when the user switches the language at runtime.
|
|
31006
31087
|
// since there is no existing mechanism to re-translate the UI at runtime (not for the UI labels at least)
|
|
31007
|
-
await model.importLayout({ dataProvider, diagram: currentDiagram, signal });
|
|
31088
|
+
await model.importLayout({ dataProvider, diagram: currentDiagram, signal, validateLinks: true });
|
|
31008
31089
|
}
|
|
31009
31090
|
else if ((_a = config.seedIris) === null || _a === void 0 ? void 0 : _a.length) {
|
|
31010
31091
|
await seedIrisToCanvas(context, dataProvider, config.seedIris, signal);
|
|
@@ -31015,7 +31096,7 @@ function ReactodiaApp(props) {
|
|
|
31015
31096
|
else {
|
|
31016
31097
|
// Restore the previously saved layout when present, otherwise start empty. Either way this binds the
|
|
31017
31098
|
// data provider (savedDiagram is undefined -> empty diagram), so the unified search/lookup works.
|
|
31018
|
-
await model.importLayout({ dataProvider, diagram: savedDiagram, signal });
|
|
31099
|
+
await model.importLayout({ dataProvider, diagram: savedDiagram, signal, validateLinks: true });
|
|
31019
31100
|
}
|
|
31020
31101
|
}, [language]);
|
|
31021
31102
|
/**
|
|
@@ -31032,7 +31113,8 @@ function ReactodiaApp(props) {
|
|
|
31032
31113
|
ref: onMount,
|
|
31033
31114
|
defaultLayout: blockingDefaultLayout,
|
|
31034
31115
|
defaultLanguage: language,
|
|
31035
|
-
translations: translationsForLanguage(language)
|
|
31116
|
+
translations: translationsForLanguage(language),
|
|
31117
|
+
typeStyleResolver: resolveTypeStyle
|
|
31036
31118
|
}, reactExports.createElement(DefaultWorkspace, {}));
|
|
31037
31119
|
}
|
|
31038
31120
|
/**
|
|
@@ -31070,7 +31152,7 @@ function unmountReactodia(root) {
|
|
|
31070
31152
|
root.unmount();
|
|
31071
31153
|
}
|
|
31072
31154
|
|
|
31073
|
-
const graphwiseReactodiaCss = "graphwise-reactodia{display:
|
|
31155
|
+
const graphwiseReactodiaCss = "graphwise-reactodia{display:flex;flex-direction:column;width:100%;height:75vh}graphwise-reactodia .blank-nodes-toggle{display:flex;align-items:center;gap:4px;padding:4px 8px}graphwise-reactodia .reactodia-container{position:relative;flex:1;min-height:0;width:100%}";
|
|
31074
31156
|
|
|
31075
31157
|
const GraphwiseReactodia = class {
|
|
31076
31158
|
constructor(hostRef) {
|
|
@@ -31079,6 +31161,8 @@ const GraphwiseReactodia = class {
|
|
|
31079
31161
|
* UI language code (e.g. `en`, `fr`) for the Reactodia interface. Defaults to English.
|
|
31080
31162
|
*/
|
|
31081
31163
|
this.language = LanguageKey.EN;
|
|
31164
|
+
/** POC toggle for the provider's `acceptBlankNodes` flag. Internal, not part of the public API. */
|
|
31165
|
+
this.acceptBlankNodes = false;
|
|
31082
31166
|
}
|
|
31083
31167
|
onProviderSettingsChange() {
|
|
31084
31168
|
this.renderGraph();
|
|
@@ -31088,11 +31172,21 @@ const GraphwiseReactodia = class {
|
|
|
31088
31172
|
// to re-translate the UI is to re-create the graph.
|
|
31089
31173
|
this.renderGraph(true);
|
|
31090
31174
|
}
|
|
31175
|
+
onThemeChange() {
|
|
31176
|
+
resetColors();
|
|
31177
|
+
this.renderGraph(true);
|
|
31178
|
+
}
|
|
31091
31179
|
connectedCallback() {
|
|
31092
31180
|
if (this.config) {
|
|
31093
31181
|
this.renderGraph();
|
|
31094
31182
|
}
|
|
31095
31183
|
}
|
|
31184
|
+
// The graph container is only available after the first render, so the initial mount happens here.
|
|
31185
|
+
componentDidLoad() {
|
|
31186
|
+
if (this.config) {
|
|
31187
|
+
this.renderGraph();
|
|
31188
|
+
}
|
|
31189
|
+
}
|
|
31096
31190
|
disconnectedCallback() {
|
|
31097
31191
|
if (this.reactRoot) {
|
|
31098
31192
|
unmountReactodia(this.reactRoot);
|
|
@@ -31100,7 +31194,12 @@ const GraphwiseReactodia = class {
|
|
|
31100
31194
|
}
|
|
31101
31195
|
}
|
|
31102
31196
|
render() {
|
|
31103
|
-
return (index$1.h(index$1.Host, { key: '
|
|
31197
|
+
return (index$1.h(index$1.Host, { key: '65718a059757d2b18fde62002d5b050304830143' }, index$1.h("label", { key: '3b50b626a046366b3b705f8e430c04d88af436ca', class: "blank-nodes-toggle" }, index$1.h("input", { key: 'c81d4d27d8fec14ae1ed9333b4f21eb90e482bc5', type: "checkbox", "data-test": "accept-blank-nodes", checked: this.acceptBlankNodes, onChange: (event) => this.onAcceptBlankNodesChange(event) }), "Accept blank nodes"), index$1.h("div", { key: 'e1313a71ebf215cea2ef23917fb643dc7c74b014', class: "reactodia-container", ref: (element) => this.graphContainer = element })));
|
|
31198
|
+
}
|
|
31199
|
+
// Applied to the live provider, so the next query picks it up without rebuilding the diagram.
|
|
31200
|
+
onAcceptBlankNodesChange(event) {
|
|
31201
|
+
this.acceptBlankNodes = event.target.checked;
|
|
31202
|
+
setAcceptBlankNodes(this.acceptBlankNodes);
|
|
31104
31203
|
}
|
|
31105
31204
|
renderGraph(isReloading) {
|
|
31106
31205
|
var _a;
|
|
@@ -31110,7 +31209,7 @@ const GraphwiseReactodia = class {
|
|
|
31110
31209
|
if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.queryFunction)) {
|
|
31111
31210
|
throw new Error('config.queryFunction is required');
|
|
31112
31211
|
}
|
|
31113
|
-
if (!this.
|
|
31212
|
+
if (!this.graphContainer) {
|
|
31114
31213
|
return;
|
|
31115
31214
|
}
|
|
31116
31215
|
const props = {
|
|
@@ -31118,20 +31217,21 @@ const GraphwiseReactodia = class {
|
|
|
31118
31217
|
currentRepository: this.currentRepository,
|
|
31119
31218
|
config: this.config,
|
|
31120
31219
|
language: this.language,
|
|
31121
|
-
|
|
31220
|
+
// Carried through so a rebuilt provider keeps whatever the toggle is currently set to.
|
|
31221
|
+
providerSettings: Object.assign(Object.assign({}, this.providerSettings), { acceptBlankNodes: this.acceptBlankNodes }),
|
|
31122
31222
|
};
|
|
31123
31223
|
if (this.reactRoot && !isReloading) {
|
|
31124
31224
|
void updateReactodia(props);
|
|
31125
31225
|
}
|
|
31126
31226
|
else {
|
|
31127
|
-
this.reactRoot = mountReactodia(this.
|
|
31227
|
+
this.reactRoot = mountReactodia(this.graphContainer, props);
|
|
31128
31228
|
}
|
|
31129
31229
|
}
|
|
31130
|
-
get hostElement() { return index$1.getElement(this); }
|
|
31131
31230
|
static get watchers() { return {
|
|
31132
31231
|
"currentRepository": ["onProviderSettingsChange"],
|
|
31133
31232
|
"providerSettings": ["onProviderSettingsChange"],
|
|
31134
|
-
"language": ["onLanguageChange"]
|
|
31233
|
+
"language": ["onLanguageChange"],
|
|
31234
|
+
"theme": ["onThemeChange"]
|
|
31135
31235
|
}; }
|
|
31136
31236
|
};
|
|
31137
31237
|
GraphwiseReactodia.style = graphwiseReactodiaCss;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-D1-Nmh_N.js');
|
|
4
4
|
var appGlobals = require('./app-globals-CcJr5lkF.js');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
@@ -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"]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"]}]]]], 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],"acceptBlankNodes":[32]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"],"theme":["onThemeChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -39,6 +39,7 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
39
39
|
hostElement.__stencil__getHostRef = () => ref;
|
|
40
40
|
return ref;
|
|
41
41
|
};
|
|
42
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
42
43
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
43
44
|
|
|
44
45
|
// src/client/client-load-module.ts
|
|
@@ -238,6 +239,12 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
238
239
|
if (vnodeData.key) {
|
|
239
240
|
key = vnodeData.key;
|
|
240
241
|
}
|
|
242
|
+
{
|
|
243
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
244
|
+
if (classData) {
|
|
245
|
+
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
246
|
+
}
|
|
247
|
+
}
|
|
241
248
|
}
|
|
242
249
|
const vnode = newVNode(nodeName, null);
|
|
243
250
|
vnode.$attrs$ = vnodeData;
|
|
@@ -288,7 +295,6 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
288
295
|
}
|
|
289
296
|
return propValue;
|
|
290
297
|
};
|
|
291
|
-
var getElement = (ref) => getHostRef(ref).$hostElement$ ;
|
|
292
298
|
var emitEvent = (elm, name, opts) => {
|
|
293
299
|
const ev = plt.ce(name, opts);
|
|
294
300
|
elm.dispatchEvent(ev);
|
|
@@ -389,8 +395,85 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
389
395
|
if (oldValue === newValue) {
|
|
390
396
|
return;
|
|
391
397
|
}
|
|
392
|
-
memberName
|
|
398
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
399
|
+
let ln = memberName.toLowerCase();
|
|
400
|
+
if (memberName === "class") {
|
|
401
|
+
const classList = elm.classList;
|
|
402
|
+
const oldClasses = parseClassList(oldValue);
|
|
403
|
+
let newClasses = parseClassList(newValue);
|
|
404
|
+
{
|
|
405
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
406
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
407
|
+
}
|
|
408
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
409
|
+
if (newValue) {
|
|
410
|
+
newValue(elm);
|
|
411
|
+
}
|
|
412
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
413
|
+
if (memberName[2] === "-") {
|
|
414
|
+
memberName = memberName.slice(3);
|
|
415
|
+
} else if (isMemberInElement(win, ln)) {
|
|
416
|
+
memberName = ln.slice(2);
|
|
417
|
+
} else {
|
|
418
|
+
memberName = ln[2] + memberName.slice(3);
|
|
419
|
+
}
|
|
420
|
+
if (oldValue || newValue) {
|
|
421
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
422
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
423
|
+
if (oldValue) {
|
|
424
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
425
|
+
}
|
|
426
|
+
if (newValue) {
|
|
427
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
} else {
|
|
431
|
+
const isComplex = isComplexType(newValue);
|
|
432
|
+
if ((isProp || isComplex && newValue !== null) && true) {
|
|
433
|
+
try {
|
|
434
|
+
if (!elm.tagName.includes("-")) {
|
|
435
|
+
const n = newValue == null ? "" : newValue;
|
|
436
|
+
if (memberName === "list") {
|
|
437
|
+
isProp = false;
|
|
438
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
439
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
440
|
+
elm[memberName] = n;
|
|
441
|
+
} else {
|
|
442
|
+
elm.setAttribute(memberName, n);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
} else if (elm[memberName] !== newValue) {
|
|
446
|
+
elm[memberName] = newValue;
|
|
447
|
+
}
|
|
448
|
+
} catch (e) {
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (newValue == null || newValue === false) {
|
|
452
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
453
|
+
{
|
|
454
|
+
elm.removeAttribute(memberName);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
458
|
+
newValue = newValue === true ? "" : newValue;
|
|
459
|
+
{
|
|
460
|
+
elm.setAttribute(memberName, newValue);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
var parseClassListRegex = /\s/;
|
|
466
|
+
var parseClassList = (value) => {
|
|
467
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
468
|
+
value = value.baseVal;
|
|
469
|
+
}
|
|
470
|
+
if (!value || typeof value !== "string") {
|
|
471
|
+
return [];
|
|
472
|
+
}
|
|
473
|
+
return value.split(parseClassListRegex);
|
|
393
474
|
};
|
|
475
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
476
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
394
477
|
|
|
395
478
|
// src/runtime/vdom/update-element.ts
|
|
396
479
|
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
@@ -404,7 +487,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
404
487
|
elm,
|
|
405
488
|
memberName,
|
|
406
489
|
oldVnodeAttrs[memberName],
|
|
407
|
-
void 0
|
|
490
|
+
void 0,
|
|
491
|
+
isSvgMode2,
|
|
492
|
+
newVnode.$flags$);
|
|
408
493
|
}
|
|
409
494
|
}
|
|
410
495
|
}
|
|
@@ -413,7 +498,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
413
498
|
elm,
|
|
414
499
|
memberName,
|
|
415
500
|
oldVnodeAttrs[memberName],
|
|
416
|
-
newVnodeAttrs[memberName]
|
|
501
|
+
newVnodeAttrs[memberName],
|
|
502
|
+
isSvgMode2,
|
|
503
|
+
newVnode.$flags$);
|
|
417
504
|
}
|
|
418
505
|
};
|
|
419
506
|
function sortedAttrNames(attrNames) {
|
|
@@ -426,12 +513,15 @@ function sortedAttrNames(attrNames) {
|
|
|
426
513
|
);
|
|
427
514
|
}
|
|
428
515
|
var hostTagName;
|
|
516
|
+
var isSvgMode = false;
|
|
429
517
|
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
430
518
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
431
519
|
let i2 = 0;
|
|
432
520
|
let elm;
|
|
433
521
|
let childNode;
|
|
434
|
-
{
|
|
522
|
+
if (newVNode2.$text$ !== null) {
|
|
523
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
524
|
+
} else {
|
|
435
525
|
if (!win.document) {
|
|
436
526
|
throw new Error(
|
|
437
527
|
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
@@ -441,7 +531,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
441
531
|
newVNode2.$tag$
|
|
442
532
|
);
|
|
443
533
|
{
|
|
444
|
-
updateElement(null, newVNode2);
|
|
534
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
445
535
|
}
|
|
446
536
|
if (newVNode2.$children$) {
|
|
447
537
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
@@ -473,6 +563,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
473
563
|
const vnode = vnodes[index];
|
|
474
564
|
if (vnode) {
|
|
475
565
|
const elm = vnode.$elm$;
|
|
566
|
+
nullifyVNodeRefs(vnode);
|
|
476
567
|
if (elm) {
|
|
477
568
|
elm.remove();
|
|
478
569
|
}
|
|
@@ -579,13 +670,17 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
579
670
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
580
671
|
const oldChildren = oldVNode.$children$;
|
|
581
672
|
const newChildren = newVNode2.$children$;
|
|
582
|
-
|
|
673
|
+
const text = newVNode2.$text$;
|
|
674
|
+
if (text === null) {
|
|
583
675
|
{
|
|
584
|
-
updateElement(oldVNode, newVNode2);
|
|
676
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
585
677
|
}
|
|
586
678
|
if (oldChildren !== null && newChildren !== null) {
|
|
587
679
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
588
680
|
} else if (newChildren !== null) {
|
|
681
|
+
if (oldVNode.$text$ !== null) {
|
|
682
|
+
elm.textContent = "";
|
|
683
|
+
}
|
|
589
684
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
590
685
|
} else if (
|
|
591
686
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
@@ -593,6 +688,14 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
593
688
|
) {
|
|
594
689
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
595
690
|
}
|
|
691
|
+
} else if (oldVNode.$text$ !== text) {
|
|
692
|
+
elm.data = text;
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
696
|
+
{
|
|
697
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
698
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
596
699
|
}
|
|
597
700
|
};
|
|
598
701
|
var insertBefore = (parent, newNode, reference) => {
|
|
@@ -1205,7 +1308,6 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
1205
1308
|
|
|
1206
1309
|
exports.Host = Host;
|
|
1207
1310
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1208
|
-
exports.getElement = getElement;
|
|
1209
1311
|
exports.h = h;
|
|
1210
1312
|
exports.promiseResolve = promiseResolve;
|
|
1211
1313
|
exports.registerInstance = registerInstance;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-D1-Nmh_N.js');
|
|
4
4
|
var appGlobals = require('./app-globals-CcJr5lkF.js');
|
|
5
5
|
|
|
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"]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"]}]]]], 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],"acceptBlankNodes":[32]},null,{"currentRepository":["onProviderSettingsChange"],"providerSettings":["onProviderSettingsChange"],"language":["onLanguageChange"],"theme":["onThemeChange"]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
graphwise-reactodia {
|
|
2
|
-
display:
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
3
4
|
width: 100%;
|
|
4
5
|
height: 75vh;
|
|
5
6
|
}
|
|
7
|
+
graphwise-reactodia .blank-nodes-toggle {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
padding: 4px 8px;
|
|
12
|
+
}
|
|
6
13
|
graphwise-reactodia .reactodia-container {
|
|
7
14
|
position: relative;
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
8
17
|
width: 100%;
|
|
9
|
-
height: 100%;
|
|
10
18
|
}
|