@abi-software/mapintegratedvuer 1.23.0 → 1.24.1

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 (34) hide show
  1. package/dist/{ConnectivityGraph-Cao0C1-G.js → ConnectivityGraph-Cye6QvZR.js} +6 -6
  2. package/dist/{ContentMixin-4t04VWoF.js → ContentMixin-SBI5HTPO.js} +295 -244
  3. package/dist/{DynamicMarkerMixin-tATj70ym.js → DynamicMarkerMixin-LB2RYdSY.js} +1 -1
  4. package/dist/{Flatmap-DF4FAwLY.js → Flatmap-TcOqOyD5.js} +5 -5
  5. package/dist/{Iframe-DbQ22y53.js → Iframe-D-Eq3G6T.js} +2 -2
  6. package/dist/{MultiFlatmap-Dwy9gbWC.js → MultiFlatmap-C122IUmB.js} +6 -6
  7. package/dist/{Plot-COXE_H78.js → Plot-DTv-vd63.js} +2 -2
  8. package/dist/{Scaffold-9ubjNzcD.js → Scaffold-B2g3O1xF.js} +46 -36
  9. package/dist/{Simulation-CR-yKjxu.js → Simulation-ClMZ5HHt.js} +2 -2
  10. package/dist/{connectivities-DhBMlBSj.js → connectivities-LtlFwLOp.js} +6399 -5790
  11. package/dist/es-D-YkSGXX.js +436 -0
  12. package/dist/mapintegratedvuer.js +12994 -11652
  13. package/dist/mapintegratedvuer.umd.cjs +191 -190
  14. package/dist/style.css +1 -1
  15. package/package.json +4 -4
  16. package/src/assets/header-icon.scss +9 -3
  17. package/src/components/ContentBar.vue +172 -92
  18. package/src/components/ContentVuer.vue +41 -1
  19. package/src/components/DialogToolbarContent.vue +45 -4
  20. package/src/components/EventBus.js +8 -0
  21. package/src/components/MapContent.vue +77 -31
  22. package/src/components/ResizeSensor.vue +7 -9
  23. package/src/components/ScreenshotPopover.vue +526 -0
  24. package/src/components/SplitDialog.vue +94 -93
  25. package/src/components/SplitFlow.vue +158 -96
  26. package/src/components/scripts/utilities.js +56 -1
  27. package/src/components/viewers/Flatmap.vue +1 -0
  28. package/src/components/viewers/MultiFlatmap.vue +3 -0
  29. package/src/components/viewers/Scaffold.vue +25 -13
  30. package/src/components.d.ts +2 -0
  31. package/src/mixins/ContentMixin.js +32 -21
  32. package/src/services/screenshot.js +1186 -0
  33. package/src/stores/connectivities.js +38 -5
  34. package/src/stores/settings.js +18 -0
@@ -1,6 +1,23 @@
1
+ import { markRaw, toRaw } from 'vue';
1
2
  import { defineStore } from 'pinia';
2
3
  import { listsAreEqual } from '../components/scripts/utilities';
3
4
 
5
+ // Structural equality with JSON.stringify semantics (undefined properties are
6
+ // ignored), without serialising the whole knowledge base into strings.
7
+ function isJsonEqual(a, b) {
8
+ if (a === b) return true;
9
+ if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {
10
+ return false;
11
+ }
12
+ if (Array.isArray(a) !== Array.isArray(b)) return false;
13
+ if (Array.isArray(a)) {
14
+ return a.length === b.length && a.every((value, index) => isJsonEqual(value, b[index]));
15
+ }
16
+ const keysA = Object.keys(a).filter((key) => a[key] !== undefined);
17
+ const keysB = Object.keys(b).filter((key) => b[key] !== undefined);
18
+ return keysA.length === keysB.length && keysA.every((key) => isJsonEqual(a[key], b[key]));
19
+ }
20
+
4
21
  function mergeConnectivityEntries(existingEntries = [], incomingEntries = []) {
5
22
  const merged = new Map();
6
23
 
@@ -114,14 +131,30 @@ export const useConnectivitiesStore = defineStore('connectivities', {
114
131
  // snapshot may be stale for the same entry set. Merge by key and by id
115
132
  // so a later flatmap update does not wipe richer scaffold metadata such
116
133
  // as nerve-label.
117
- const merged = { ...this.globalConnectivities };
134
+ //
135
+ // Entry arrays are large, read-only and not watched by any module, they
136
+ // are marked as raw.
137
+ const current = toRaw(this.globalConnectivities);
138
+ const merged = { ...current };
139
+ let changed = false;
118
140
 
119
- Object.entries(globalConnectivities).forEach(([uuid, entries]) => {
120
- const existingEntries = merged[uuid] || [];
121
- merged[uuid] = mergeConnectivityEntries(existingEntries, entries || []);
141
+ Object.entries(toRaw(globalConnectivities)).forEach(([uuid, entries]) => {
142
+ const existingEntries = toRaw(current[uuid]);
143
+ const mergedEntries = mergeConnectivityEntries(
144
+ existingEntries || [],
145
+ toRaw(entries) || [],
146
+ );
147
+ if (existingEntries && isJsonEqual(mergedEntries, existingEntries)) {
148
+ // Unchanged; keep the stored array (viewers may have written it
149
+ // into the store directly) but stop Vue from proxying it
150
+ markRaw(existingEntries);
151
+ } else {
152
+ merged[uuid] = markRaw(mergedEntries);
153
+ changed = true;
154
+ }
122
155
  });
123
156
 
124
- if (JSON.stringify(merged) !== JSON.stringify(this.globalConnectivities)) {
157
+ if (changed) {
125
158
  this.globalConnectivities = merged;
126
159
  this.connectivitiesUpdated = true;
127
160
  }
@@ -1,4 +1,5 @@
1
1
  import { defineStore } from 'pinia';
2
+ import { SCREENSHOT_LEGEND_MODES } from '../services/screenshot';
2
3
 
3
4
  export const useSettingsStore = defineStore('settings', {
4
5
  state: () => {
@@ -32,6 +33,11 @@ export const useSettingsStore = defineStore('settings', {
32
33
  allClosable: true,
33
34
  offlineAnnotationEnabled: false,
34
35
  displayMinimap: true,
36
+ screenshot: {
37
+ scale: 1, // multiplier on top of the device pixel ratio
38
+ legend: 'exclude', // exclude, include, only
39
+ toolbar: false, // include the header bar of each pane
40
+ },
35
41
  globalSettings: {
36
42
  displayMarkers: true, // comment out to hide in settings
37
43
  // highlightConnectedPaths: false, // comment out to hide in settings
@@ -211,6 +217,18 @@ export const useSettingsStore = defineStore('settings', {
211
217
  updateDisplayMinimap(displayMinimap) {
212
218
  this.displayMinimap = displayMinimap;
213
219
  },
220
+ updateScreenshotOptions(options) {
221
+ const { scale, legend, toolbar } = options || {};
222
+ if (Number(scale) > 0) {
223
+ this.screenshot.scale = Number(scale);
224
+ }
225
+ if (SCREENSHOT_LEGEND_MODES.includes(legend)) {
226
+ this.screenshot.legend = legend;
227
+ }
228
+ if (typeof toolbar === 'boolean') {
229
+ this.screenshot.toolbar = toolbar;
230
+ }
231
+ },
214
232
  updateGlobalSettings(globalSettings) {
215
233
  for (const [key, value] of Object.entries(globalSettings)) {
216
234
  this.globalSettings[key] = value;