graphwise-reactodia 0.0.1-TR19 → 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 (61) hide show
  1. package/README.md +40 -0
  2. package/dist/cjs/graphwise-reactodia.cjs.entry.js +192 -43
  3. package/dist/cjs/index.cjs.js +16 -4
  4. package/dist/cjs/node-action-DkJ5ct17.js +96 -0
  5. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.css +6 -3
  6. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +2 -2
  7. package/dist/collection/components/graphwise-reactodia/menu/export-diagram-action.js +19 -0
  8. package/dist/collection/components/graphwise-reactodia/menu/graphwise-menu.js +19 -35
  9. package/dist/collection/components/graphwise-reactodia/menu/import-diagram-action.js +31 -0
  10. package/dist/collection/components/graphwise-reactodia/models/error/error-code.js +2 -0
  11. package/dist/collection/components/graphwise-reactodia/models/sparql/sparql-query-function.js +1 -0
  12. package/dist/collection/components/graphwise-reactodia/models/sparql/sparql-query-params.js +1 -0
  13. package/dist/collection/components/graphwise-reactodia/models/ui/menu-config.js +1 -0
  14. package/dist/collection/components/graphwise-reactodia/models/ui/menu-item.js +18 -0
  15. package/dist/collection/components/graphwise-reactodia/models/ui/node-action.js +22 -0
  16. package/dist/collection/components/graphwise-reactodia/models/ui/resolved-toolbar-position.js +1 -0
  17. package/dist/collection/components/graphwise-reactodia/models/ui/resolved-ui-config.js +1 -0
  18. package/dist/collection/components/graphwise-reactodia/models/ui/toolbar-dock.js +14 -0
  19. package/dist/collection/components/graphwise-reactodia/models/ui/toolbar-position.js +1 -0
  20. package/dist/collection/components/graphwise-reactodia/models/ui/ui-config.js +1 -0
  21. package/dist/collection/components/graphwise-reactodia/node-action/node-actions.js +22 -0
  22. package/dist/collection/components/graphwise-reactodia/reactodia-app.js +9 -7
  23. package/dist/collection/components/graphwise-reactodia/ui-config/default-ui-config.js +30 -0
  24. package/dist/collection/components/graphwise-reactodia/ui-config/ui-config-mapper.js +51 -0
  25. package/dist/collection/components/graphwise-reactodia/utils/object-util.js +30 -0
  26. package/dist/collection/index.js +3 -0
  27. package/dist/collection/pages/graphwise-reactodia/main.js +14 -0
  28. package/dist/esm/graphwise-reactodia.entry.js +181 -32
  29. package/dist/esm/index.js +1 -1
  30. package/dist/esm/node-action-fwJ3Zupw.js +94 -0
  31. package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
  32. package/dist/graphwise-reactodia/index.esm.js +1 -1
  33. package/dist/graphwise-reactodia/p-c3d8a69a.entry.js +1 -0
  34. package/dist/graphwise-reactodia/p-fwJ3Zupw.js +1 -0
  35. package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +3 -3
  36. package/dist/types/components/graphwise-reactodia/menu/export-diagram-action.d.ts +4 -0
  37. package/dist/types/components/graphwise-reactodia/menu/graphwise-menu.d.ts +4 -7
  38. package/dist/types/components/graphwise-reactodia/menu/import-diagram-action.d.ts +4 -0
  39. package/dist/types/components/graphwise-reactodia/models/error/error-code.d.ts +3 -1
  40. package/dist/types/components/graphwise-reactodia/models/reactodia-config.d.ts +6 -1
  41. package/dist/types/components/graphwise-reactodia/models/sparql/sparql-query-function.d.ts +6 -0
  42. package/dist/types/components/graphwise-reactodia/models/sparql/sparql-query-params.d.ts +12 -0
  43. package/dist/types/components/graphwise-reactodia/models/ui/menu-config.d.ts +8 -0
  44. package/dist/types/components/graphwise-reactodia/models/ui/menu-item.d.ts +17 -0
  45. package/dist/types/components/graphwise-reactodia/models/ui/node-action.d.ts +21 -0
  46. package/dist/types/components/graphwise-reactodia/models/ui/resolved-toolbar-position.d.ts +8 -0
  47. package/dist/types/components/graphwise-reactodia/models/ui/resolved-ui-config.d.ts +12 -0
  48. package/dist/types/components/graphwise-reactodia/models/ui/toolbar-dock.d.ts +13 -0
  49. package/dist/types/components/graphwise-reactodia/models/ui/toolbar-position.d.ts +11 -0
  50. package/dist/types/components/graphwise-reactodia/models/ui/ui-config.d.ts +17 -0
  51. package/dist/types/components/graphwise-reactodia/node-action/node-actions.d.ts +6 -0
  52. package/dist/types/components/graphwise-reactodia/ui-config/default-ui-config.d.ts +5 -0
  53. package/dist/types/components/graphwise-reactodia/ui-config/ui-config-mapper.d.ts +14 -0
  54. package/dist/types/components/graphwise-reactodia/utils/object-util.d.ts +15 -0
  55. package/dist/types/components.d.ts +2 -2
  56. package/dist/types/index.d.ts +9 -0
  57. package/package.json +4 -1
  58. package/dist/cjs/error-code-BjU_V9e8.js +0 -37
  59. package/dist/esm/error-code-HfC639tc.js +0 -35
  60. package/dist/graphwise-reactodia/p-HfC639tc.js +0 -1
  61. package/dist/graphwise-reactodia/p-bf7f09d2.entry.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-DpCR6zMg.js';
2
- import { C as CLEAR_DIAGRAM_STORAGE_EVENT, E as EventType, a as ErrorCode } from './error-code-HfC639tc.js';
2
+ import { C as CLEAR_DIAGRAM_STORAGE_EVENT, E as EventType, a as ErrorCode, N as NodeAction, M as MenuItem, T as ToolbarDock } from './node-action-fwJ3Zupw.js';
3
3
 
4
4
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
5
 
@@ -30925,10 +30925,10 @@ function getContentFittingBoxForLayout(state) {
30925
30925
  }
30926
30926
 
30927
30927
  const graphwise_toolbar_action$1 = {
30928
- "download_diagram.label": "Export to JSON",
30929
- "download_diagram.title": "Export the diagram to a JSON file",
30930
- "upload_diagram.label": "Import from JSON",
30931
- "upload_diagram.title": "Replace the diagram with one from a JSON file"
30928
+ "export_json.label": "Export to JSON",
30929
+ "export_json.title": "Export the diagram to a JSON file",
30930
+ "import_json.label": "Import from JSON",
30931
+ "import_json.title": "Replace the diagram with one from a JSON file"
30932
30932
  };
30933
30933
  var enTranslation = {
30934
30934
  graphwise_toolbar_action: graphwise_toolbar_action$1
@@ -31189,10 +31189,10 @@ const toolbar = {
31189
31189
  "menu_toggle.title": "Ouvrir le menu"
31190
31190
  };
31191
31191
  const graphwise_toolbar_action = {
31192
- "download_diagram.label": "Exporter en JSON",
31193
- "download_diagram.title": "Exporter le diagramme en fichier JSON",
31194
- "upload_diagram.label": "Importer depuis JSON",
31195
- "upload_diagram.title": "Remplacer le diagramme par celui d'un fichier JSON"
31192
+ "export_json.label": "Exporter en JSON",
31193
+ "export_json.title": "Exporter le diagramme en fichier JSON",
31194
+ "import_json.label": "Importer depuis JSON",
31195
+ "import_json.title": "Remplacer le diagramme par celui d'un fichier JSON"
31196
31196
  };
31197
31197
  const toolbar_action = {
31198
31198
  "clear_all.command": "Tout effacer",
@@ -31738,6 +31738,65 @@ const resetColors = () => {
31738
31738
  typeToIndex.clear();
31739
31739
  };
31740
31740
 
31741
+ /**
31742
+ * Merges an object with default values. Ported from the GraphDB Workbench `ObjectUtil.mergeWithDefaults`.
31743
+ *
31744
+ * For each property in `defaults`, if the value in `object` is `null` or `undefined`, the default value is used instead.
31745
+ * Nested objects are merged recursively. Arrays and other non-plain values are treated as single values and are not
31746
+ * merged.
31747
+ *
31748
+ * The returned object is a new object and does not share references with the inputs. The inputs must be
31749
+ * structured-cloneable.
31750
+ *
31751
+ * @param object Source object whose values take precedence over defaults.
31752
+ * @param defaults Default values applied when properties are missing or null.
31753
+ * @returns A new object containing the merged result.
31754
+ */
31755
+ function mergeWithDefaults(object, defaults) {
31756
+ const result = structuredClone(object);
31757
+ Object.entries(defaults).forEach(([key, defaultValue]) => {
31758
+ const value = result[key];
31759
+ if (value === null || value === undefined) {
31760
+ result[key] = structuredClone(defaultValue);
31761
+ }
31762
+ else if (isPlainObject(value) && isPlainObject(defaultValue)) {
31763
+ result[key] = mergeWithDefaults(value, defaultValue);
31764
+ }
31765
+ });
31766
+ return result;
31767
+ }
31768
+ function isPlainObject(value) {
31769
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
31770
+ }
31771
+
31772
+ /**
31773
+ * The default UI configuration: Reactodia's behaviour, plus the diagram download and upload in the menu.
31774
+ */
31775
+ const DEFAULT_UI_CONFIG = {
31776
+ mainToolbar: { dock: ToolbarDock.NW },
31777
+ actionsToolbar: { dock: ToolbarDock.SW },
31778
+ menu: {
31779
+ items: [
31780
+ MenuItem.CLEAR_ALL,
31781
+ MenuItem.EXPORT_PNG,
31782
+ MenuItem.EXPORT_SVG,
31783
+ MenuItem.PRINT,
31784
+ MenuItem.EXPORT_JSON,
31785
+ MenuItem.IMPORT_JSON
31786
+ ]
31787
+ },
31788
+ nodeActions: [
31789
+ NodeAction.GROUP,
31790
+ NodeAction.REMOVE,
31791
+ NodeAction.EXPAND,
31792
+ NodeAction.OPEN_LINK,
31793
+ NodeAction.CONNECTIONS,
31794
+ NodeAction.ADD_TO_FILTER,
31795
+ NodeAction.ANNOTATE,
31796
+ NodeAction.ESTABLISH_LINK
31797
+ ]
31798
+ };
31799
+
31741
31800
  var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31742
31801
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31743
31802
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -31800,22 +31859,31 @@ DiagramFileService = DiagramFileService_1 = __decorate([
31800
31859
  ], DiagramFileService);
31801
31860
 
31802
31861
  /**
31803
- * The workspace main menu: Reactodia's default actions, followed by the diagram download and upload.
31804
- *
31805
- * Passing a `menu` to the `DefaultWorkspace` replaces its default actions, so they are listed here again.
31806
- * Rendered inside the workspace, so the actions can use the workspace hooks.
31862
+ * Exports the diagram as a JSON file.
31807
31863
  */
31808
- function GraphwiseMenu() {
31864
+ function ExportDiagramAction() {
31809
31865
  const { model } = useWorkspace();
31810
31866
  const t = useTranslation();
31811
31867
  const diagramFileService = service(DiagramFileService);
31812
- const diagramService = service(DiagramService);
31813
- const errorService = service(ErrorService);
31814
- const downloadDiagram = () => {
31868
+ const exportDiagram = () => {
31815
31869
  const timestamp = new Date().toISOString().replace(/[-:]|\.\d+Z$/g, '');
31816
31870
  diagramFileService.download(model.exportLayout(), `diagram-${timestamp}${DiagramFileService.FILE_EXTENSION}`);
31817
31871
  };
31818
- const uploadDiagram = async (file) => {
31872
+ return reactExports.createElement(ToolbarAction,
31873
+ // The same icon as ToolbarActionSave. We don't use that action, since it disables saving on refresh
31874
+ { className: 'reactodia-toolbar-action__save', title: t.text('graphwise_toolbar_action.export_json.title'), onSelect: exportDiagram }, t.text('graphwise_toolbar_action.export_json.label'));
31875
+ }
31876
+
31877
+ /**
31878
+ * Imports a diagram from a JSON file into the workspace.
31879
+ */
31880
+ function ImportDiagramAction() {
31881
+ const { model } = useWorkspace();
31882
+ const t = useTranslation();
31883
+ const diagramFileService = service(DiagramFileService);
31884
+ const diagramService = service(DiagramService);
31885
+ const errorService = service(ErrorService);
31886
+ const importDiagram = async (file) => {
31819
31887
  try {
31820
31888
  const diagram = await diagramFileService.read(file);
31821
31889
  await diagramService.importDiagram(model, model.dataProvider, diagram);
@@ -31824,13 +31892,92 @@ function GraphwiseMenu() {
31824
31892
  errorService.report(ErrorCode.DIAGRAM_IMPORT, error);
31825
31893
  }
31826
31894
  };
31827
- return reactExports.createElement(reactExports.Fragment, null, reactExports.createElement(ToolbarActionClearAll, {}), reactExports.createElement(ToolbarActionExport, { kind: 'exportRaster' }), reactExports.createElement(ToolbarActionExport, { kind: 'exportSvg' }), reactExports.createElement(ToolbarActionExport, { kind: 'print' }), reactExports.createElement(ToolbarAction,
31828
- // The same icon as ToolbarActionSave. We dont use that action, since it disables saving on refresh
31829
- { className: 'reactodia-toolbar-action__save', title: t.text('graphwise_toolbar_action.download_diagram.title'), onSelect: downloadDiagram }, t.text('graphwise_toolbar_action.download_diagram.label')), reactExports.createElement(ToolbarActionOpen, {
31830
- title: t.text('graphwise_toolbar_action.upload_diagram.title'),
31895
+ return reactExports.createElement(ToolbarActionOpen, {
31896
+ title: t.text('graphwise_toolbar_action.import_json.title'),
31831
31897
  fileAccept: DiagramFileService.FILE_EXTENSION,
31832
- onSelect: (file) => void uploadDiagram(file)
31833
- }, t.text('graphwise_toolbar_action.upload_diagram.label')));
31898
+ onSelect: (file) => void importDiagram(file)
31899
+ }, t.text('graphwise_toolbar_action.import_json.label'));
31900
+ }
31901
+
31902
+ /**
31903
+ * Each menu entry.
31904
+ *
31905
+ * Passing a `menu` to the `DefaultWorkspace` replaces its default actions, so they are listed here again.
31906
+ */
31907
+ const MENU_ITEMS = {
31908
+ [MenuItem.CLEAR_ALL]: (key) => reactExports.createElement(ToolbarActionClearAll, { key }),
31909
+ [MenuItem.EXPORT_PNG]: (key) => reactExports.createElement(ToolbarActionExport, { key, kind: 'exportRaster' }),
31910
+ [MenuItem.EXPORT_SVG]: (key) => reactExports.createElement(ToolbarActionExport, { key, kind: 'exportSvg' }),
31911
+ [MenuItem.PRINT]: (key) => reactExports.createElement(ToolbarActionExport, { key, kind: 'print' }),
31912
+ [MenuItem.EXPORT_JSON]: (key) => reactExports.createElement(ExportDiagramAction, { key }),
31913
+ [MenuItem.IMPORT_JSON]: (key) => reactExports.createElement(ImportDiagramAction, { key })
31914
+ };
31915
+ /**
31916
+ * The menu entries for the given menu items.
31917
+ */
31918
+ function createMenuItems(items) {
31919
+ return items.map((item) => MENU_ITEMS[item](item));
31920
+ }
31921
+
31922
+ /**
31923
+ * Each node action at its position in the fork's default `Halo`.
31924
+ */
31925
+ const NODE_ACTIONS = {
31926
+ [NodeAction.GROUP]: (key) => reactExports.createElement(SelectionActionGroup, { key, dock: 'nw', dockColumn: 1 }),
31927
+ [NodeAction.REMOVE]: (key) => reactExports.createElement(SelectionActionRemove, { key, dock: 'ne' }),
31928
+ [NodeAction.EXPAND]: (key) => reactExports.createElement(SelectionActionExpand, { key, dock: 's' }),
31929
+ [NodeAction.OPEN_LINK]: (key) => reactExports.createElement(SelectionActionAnchor, { key, dock: 'w' }),
31930
+ [NodeAction.CONNECTIONS]: (key) => reactExports.createElement(SelectionActionConnections, { key, dock: 'e' }),
31931
+ [NodeAction.ADD_TO_FILTER]: (key) => reactExports.createElement(SelectionActionAddToFilter, { key, dock: 'se' }),
31932
+ [NodeAction.ANNOTATE]: (key) => reactExports.createElement(SelectionActionAnnotate, { key, dock: 'se', dockColumn: 1 }),
31933
+ [NodeAction.ESTABLISH_LINK]: (key) => reactExports.createElement(SelectionActionEstablishLink, { key, dock: 'sw' })
31934
+ };
31935
+ /**
31936
+ * The `Halo` children for the given node actions.
31937
+ */
31938
+ function createNodeActions(actions) {
31939
+ return actions.map((action) => NODE_ACTIONS[action](action));
31940
+ }
31941
+
31942
+ const errorService$2 = service(ErrorService);
31943
+ /**
31944
+ * Merges the host's UI configuration over the default and maps the result to `DefaultWorkspace` props. A `null` or
31945
+ * missing field keeps the default; objects merge key by key and lists replace the default whole. Unknown values are
31946
+ * reported and left out; a repeated list entry is kept once.
31947
+ *
31948
+ * @param ui The host's UI configuration.
31949
+ */
31950
+ function toWorkspaceProps(ui) {
31951
+ const resolved = mergeWithDefaults(ui !== null && ui !== void 0 ? ui : {}, DEFAULT_UI_CONFIG);
31952
+ const menuItems = [...new Set(resolved.menu.items)].filter((item) => isValid(item, MenuItem));
31953
+ const nodeActions = [...new Set(resolved.nodeActions)].filter((action) => isValid(action, NodeAction));
31954
+ return {
31955
+ menu: menuItems.length ? reactExports.createElement(reactExports.Fragment, null, createMenuItems(menuItems)) : null,
31956
+ mainToolbar: toToolbarProps(resolved.mainToolbar, DEFAULT_UI_CONFIG.mainToolbar),
31957
+ actionsToolbar: toToolbarProps(resolved.actionsToolbar, DEFAULT_UI_CONFIG.actionsToolbar),
31958
+ halo: { children: createNodeActions(nodeActions) }
31959
+ };
31960
+ }
31961
+ /**
31962
+ * Maps a toolbar position to the `DefaultWorkspace` toolbar props. With an unknown dock, `defaultPosition` is used
31963
+ * whole, since the offsets are relative to the dock.
31964
+ */
31965
+ function toToolbarProps(position, defaultPosition) {
31966
+ const { dock, offsetX, offsetY } = isValid(position.dock, ToolbarDock) ? position : defaultPosition;
31967
+ return { dock, dockOffsetX: offsetX, dockOffsetY: offsetY };
31968
+ }
31969
+ /**
31970
+ * Whether `value` is one of the `known` values. Reports it as unknown UI configuration when it is not.
31971
+ *
31972
+ * @param value The value from the UI configuration.
31973
+ * @param known The known values, e.g. an enum.
31974
+ */
31975
+ function isValid(value, known) {
31976
+ const isValid = Object.values(known).includes(value);
31977
+ if (!isValid) {
31978
+ errorService$2.report(ErrorCode.UNKNOWN_UI_CONFIG, new Error(`Unknown UI configuration value: "${value}"`));
31979
+ }
31980
+ return isValid;
31834
31981
  }
31835
31982
 
31836
31983
  /**
@@ -31857,6 +32004,11 @@ let workspaceContext = null;
31857
32004
  */
31858
32005
  const subscriptions = new SubscriptionList();
31859
32006
  let diagramStorageSubscription;
32007
+ /**
32008
+ * The `DefaultWorkspace` props from the host's UI configuration. Kept across reloads, so unknown values are reported
32009
+ * once, and cleared in {@link unmountReactodia}.
32010
+ */
32011
+ let uiConfigProps;
31860
32012
  const diagramService = service(DiagramService);
31861
32013
  const diagramStorageService = service(DiagramStorageService);
31862
32014
  const eventService$1 = service(EventService);
@@ -32040,17 +32192,13 @@ function ReactodiaApp(props) {
32040
32192
  defaultLanguage: language,
32041
32193
  translations: translationsForLanguage(language),
32042
32194
  typeStyleResolver: resolveTypeStyle
32043
- }, reactExports.createElement(DefaultWorkspace, {
32044
- colorScheme: props.theme,
32045
- menu: reactExports.createElement(GraphwiseMenu),
32046
- // place Undo/redo/layout actions in top right corner.
32047
- actionsToolbar: { dock: 'ne' }
32048
- }));
32195
+ }, reactExports.createElement(DefaultWorkspace, Object.assign({ colorScheme: props.theme }, uiConfigProps)));
32049
32196
  }
32050
32197
  /**
32051
32198
  * Mounts the Reactodia application into the given container and returns the React root.
32052
32199
  */
32053
32200
  function mountReactodia(container, props) {
32201
+ uiConfigProps !== null && uiConfigProps !== void 0 ? uiConfigProps : (uiConfigProps = toWorkspaceProps(props.config.ui));
32054
32202
  const root = clientExports.createRoot(container);
32055
32203
  root.render(reactExports.createElement(ReactodiaApp, props));
32056
32204
  return root;
@@ -32085,10 +32233,11 @@ function exportReactodiaLayout() {
32085
32233
  */
32086
32234
  function unmountReactodia(root) {
32087
32235
  subscriptions.unsubscribeAll();
32236
+ uiConfigProps = undefined;
32088
32237
  root.unmount();
32089
32238
  }
32090
32239
 
32091
- const graphwiseReactodiaCss = "graphwise-reactodia{--_graphwise-reactodia-type-color-01:var(--graphwise-reactodia-type-color-01);--_graphwise-reactodia-type-color-02:var(--graphwise-reactodia-type-color-02);--_graphwise-reactodia-type-color-03:var(--graphwise-reactodia-type-color-03);--_graphwise-reactodia-type-color-04:var(--graphwise-reactodia-type-color-04);--_graphwise-reactodia-type-color-05:var(--graphwise-reactodia-type-color-05);--_graphwise-reactodia-type-color-06:var(--graphwise-reactodia-type-color-06);--_graphwise-reactodia-type-color-07:var(--graphwise-reactodia-type-color-07);--_graphwise-reactodia-type-color-08:var(--graphwise-reactodia-type-color-08);--_graphwise-reactodia-type-color-09:var(--graphwise-reactodia-type-color-09);--_graphwise-reactodia-type-color-10:var(--graphwise-reactodia-type-color-10);--_graphwise-reactodia-type-color-11:var(--graphwise-reactodia-type-color-11);--_graphwise-reactodia-type-color-12:var(--graphwise-reactodia-type-color-12);--_graphwise-reactodia-type-color-13:var(--graphwise-reactodia-type-color-13);--_graphwise-reactodia-type-color-14:var(--graphwise-reactodia-type-color-14);--_graphwise-reactodia-type-color-15:var(--graphwise-reactodia-type-color-15);--_graphwise-reactodia-type-color-16:var(--graphwise-reactodia-type-color-16);--_graphwise-reactodia-type-color-17:var(--graphwise-reactodia-type-color-17);--_graphwise-reactodia-type-color-18:var(--graphwise-reactodia-type-color-18);--_graphwise-reactodia-type-color-19:var(--graphwise-reactodia-type-color-19);--_graphwise-reactodia-type-color-20:var(--graphwise-reactodia-type-color-20);--_graphwise-reactodia-type-color-contrast:var(--graphwise-reactodia-type-color-contrast, #fff)}graphwise-reactodia{display:block;width:100%;height:100%}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}graphwise-reactodia .reactodia-selection-action__link{display:none}graphwise-reactodia .reactodia-standard-element__thumbnail:not(:has(img)){background:var(--reactodia-element-style-color);border-radius:50%;color:var(--_graphwise-reactodia-type-color-contrast)}";
32240
+ const graphwiseReactodiaCss = "graphwise-reactodia{--_graphwise-reactodia-type-color-01:var(--graphwise-reactodia-type-color-01);--_graphwise-reactodia-type-color-02:var(--graphwise-reactodia-type-color-02);--_graphwise-reactodia-type-color-03:var(--graphwise-reactodia-type-color-03);--_graphwise-reactodia-type-color-04:var(--graphwise-reactodia-type-color-04);--_graphwise-reactodia-type-color-05:var(--graphwise-reactodia-type-color-05);--_graphwise-reactodia-type-color-06:var(--graphwise-reactodia-type-color-06);--_graphwise-reactodia-type-color-07:var(--graphwise-reactodia-type-color-07);--_graphwise-reactodia-type-color-08:var(--graphwise-reactodia-type-color-08);--_graphwise-reactodia-type-color-09:var(--graphwise-reactodia-type-color-09);--_graphwise-reactodia-type-color-10:var(--graphwise-reactodia-type-color-10);--_graphwise-reactodia-type-color-11:var(--graphwise-reactodia-type-color-11);--_graphwise-reactodia-type-color-12:var(--graphwise-reactodia-type-color-12);--_graphwise-reactodia-type-color-13:var(--graphwise-reactodia-type-color-13);--_graphwise-reactodia-type-color-14:var(--graphwise-reactodia-type-color-14);--_graphwise-reactodia-type-color-15:var(--graphwise-reactodia-type-color-15);--_graphwise-reactodia-type-color-16:var(--graphwise-reactodia-type-color-16);--_graphwise-reactodia-type-color-17:var(--graphwise-reactodia-type-color-17);--_graphwise-reactodia-type-color-18:var(--graphwise-reactodia-type-color-18);--_graphwise-reactodia-type-color-19:var(--graphwise-reactodia-type-color-19);--_graphwise-reactodia-type-color-20:var(--graphwise-reactodia-type-color-20);--_graphwise-reactodia-type-color-contrast:var(--graphwise-reactodia-type-color-contrast, #fff)}graphwise-reactodia{display:block;width:100%;height:100%}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}graphwise-reactodia .reactodia-standard-element__thumbnail:not(:has(img)){background:var(--reactodia-element-style-color);border-radius:50%;color:var(--_graphwise-reactodia-type-color-contrast)}graphwise-reactodia .reactodia-note-annotation{overflow:auto}graphwise-reactodia .reactodia-note-annotation__editor{overflow-wrap:anywhere}";
32092
32241
 
32093
32242
  const errorService = service(ErrorService);
32094
32243
  const eventService = service(EventService);
@@ -32139,7 +32288,7 @@ const GraphwiseReactodia = class {
32139
32288
  }
32140
32289
  }
32141
32290
  render() {
32142
- return (h(Host, { key: '2e8541c791f478484c4bad64ad758df99aba2059' }));
32291
+ return (h(Host, { key: 'b5997ab551d1afe62b4a81166aca98a7d62f4e35' }));
32143
32292
  }
32144
32293
  subscribeToEvents() {
32145
32294
  this.subscriptions.add(eventService.subscribe((detail) => this.eventEmitter.emit(detail)));
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CLEAR_DIAGRAM_STORAGE_EVENT, a as ErrorCode, E as EventType } from './error-code-HfC639tc.js';
1
+ export { C as CLEAR_DIAGRAM_STORAGE_EVENT, a as ErrorCode, E as EventType, M as MenuItem, N as NodeAction, T as ToolbarDock } from './node-action-fwJ3Zupw.js';
2
2
 
3
3
  /**
4
4
  * Name of the DOM event the `graphwise-reactodia` element dispatches for every event.
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Event name for clearing the local store state of the diagram. There is an event listener listening for it, which
3
+ * will clear the local store state, whenever this event is fired.
4
+ */
5
+ const CLEAR_DIAGRAM_STORAGE_EVENT = 'graphwise-reactodia:clear-diagram-storage';
6
+
7
+ /**
8
+ * The kind of event the wrapper announces to the host. It selects the payload of an {@link EventDetail}.
9
+ */
10
+ var EventType;
11
+ (function (EventType) {
12
+ EventType["ERROR"] = "error";
13
+ EventType["TEXT_SEARCH"] = "text-search";
14
+ })(EventType || (EventType = {}));
15
+
16
+ /**
17
+ * The stable category of a reported error. The host uses it to choose its own message.
18
+ */
19
+ var ErrorCode;
20
+ (function (ErrorCode) {
21
+ /** A required prop is missing. */
22
+ ErrorCode["MISSING_REQUIRED_PROP"] = "missing-required-prop";
23
+ /** A SPARQL data provider call failed. */
24
+ ErrorCode["DATA_FETCH"] = "data-fetch";
25
+ /** The startup load, a reload or a repository switch failed. */
26
+ ErrorCode["DIAGRAM_LOAD"] = "diagram-load";
27
+ /** The uploaded file was rejected or its import failed. */
28
+ ErrorCode["DIAGRAM_IMPORT"] = "diagram-import";
29
+ /** Reading the diagram from local storage failed. */
30
+ ErrorCode["LOCAL_DIAGRAM_READ"] = "local-diagram-read";
31
+ /** Saving the diagram in local storage failed. */
32
+ ErrorCode["LOCAL_DIAGRAM_SAVE"] = "local-diagram-save";
33
+ /** The host's UI configuration has an unknown value, which is skipped. */
34
+ ErrorCode["UNKNOWN_UI_CONFIG"] = "unknown-ui-config";
35
+ })(ErrorCode || (ErrorCode = {}));
36
+
37
+ /**
38
+ * The side or corner of the canvas a toolbar is docked to.
39
+ */
40
+ var ToolbarDock;
41
+ (function (ToolbarDock) {
42
+ ToolbarDock["NW"] = "nw";
43
+ ToolbarDock["N"] = "n";
44
+ ToolbarDock["NE"] = "ne";
45
+ ToolbarDock["E"] = "e";
46
+ ToolbarDock["SE"] = "se";
47
+ ToolbarDock["S"] = "s";
48
+ ToolbarDock["SW"] = "sw";
49
+ ToolbarDock["W"] = "w";
50
+ })(ToolbarDock || (ToolbarDock = {}));
51
+
52
+ /**
53
+ * An entry of the workspace main menu.
54
+ */
55
+ var MenuItem;
56
+ (function (MenuItem) {
57
+ /** Removes all nodes from the diagram. */
58
+ MenuItem["CLEAR_ALL"] = "clear-all";
59
+ /** Exports the diagram as a PNG image. */
60
+ MenuItem["EXPORT_PNG"] = "export-png";
61
+ /** Exports the diagram as an SVG image. */
62
+ MenuItem["EXPORT_SVG"] = "export-svg";
63
+ /** Prints the diagram. */
64
+ MenuItem["PRINT"] = "print";
65
+ /** Exports the diagram as a JSON file. */
66
+ MenuItem["EXPORT_JSON"] = "export-json";
67
+ /** Imports a diagram from a JSON file. */
68
+ MenuItem["IMPORT_JSON"] = "import-json";
69
+ })(MenuItem || (MenuItem = {}));
70
+
71
+ /**
72
+ * A button shown around a selected node that acts on it.
73
+ */
74
+ var NodeAction;
75
+ (function (NodeAction) {
76
+ /** Groups or ungroups the selected nodes. */
77
+ NodeAction["GROUP"] = "group";
78
+ /** Removes the node from the diagram. */
79
+ NodeAction["REMOVE"] = "remove";
80
+ /** Expands or collapses the node to show its properties. */
81
+ NodeAction["EXPAND"] = "expand";
82
+ /** Opens the node IRI. */
83
+ NodeAction["OPEN_LINK"] = "open-link";
84
+ /** Opens the menu to navigate to connected nodes. */
85
+ NodeAction["CONNECTIONS"] = "connections";
86
+ /** Searches for nodes connected to this one. */
87
+ NodeAction["ADD_TO_FILTER"] = "add-to-filter";
88
+ /** Adds an annotation to the node. */
89
+ NodeAction["ANNOTATE"] = "annotate";
90
+ /** Draws a new link from the node; for an entity, only in authoring mode. */
91
+ NodeAction["ESTABLISH_LINK"] = "establish-link";
92
+ })(NodeAction || (NodeAction = {}));
93
+
94
+ export { CLEAR_DIAGRAM_STORAGE_EVENT as C, EventType as E, MenuItem as M, NodeAction as N, ToolbarDock as T, ErrorCode as a };
@@ -1 +1 @@
1
- import{p as e,b as r}from"./p-DpCR6zMg.js";export{s as setNonce}from"./p-DpCR6zMg.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-bf7f09d2",[[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))));
1
+ import{p as e,b as r}from"./p-DpCR6zMg.js";export{s as setNonce}from"./p-DpCR6zMg.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-c3d8a69a",[[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))));
@@ -1 +1 @@
1
- export{C as CLEAR_DIAGRAM_STORAGE_EVENT,a as ErrorCode,E as EventType}from"./p-HfC639tc.js";const e="graphwiseReactodiaEvent";export{e as GRAPHWISE_REACTODIA_EVENT}
1
+ export{C as CLEAR_DIAGRAM_STORAGE_EVENT,a as ErrorCode,E as EventType,M as MenuItem,N as NodeAction,T as ToolbarDock}from"./p-fwJ3Zupw.js";const o="graphwiseReactodiaEvent";export{o as GRAPHWISE_REACTODIA_EVENT}