@conduction/nextcloud-vue 2.88.0 → 2.89.0

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.
@@ -34796,28 +34796,28 @@ to {
34796
34796
  }
34797
34797
 
34798
34798
 
34799
- .cn-admin-settings-shell[data-v-0f41828c] {
34799
+ .cn-admin-settings-shell[data-v-c3ceda64] {
34800
34800
  max-width: 900px;
34801
34801
  }
34802
34802
 
34803
34803
  /* The board look lifts the width and lays the header and cards on a grid (look-board.css). */
34804
- .cn-support-info[data-v-0f41828c] {
34804
+ .cn-support-info[data-v-c3ceda64] {
34805
34805
  margin-top: 16px;
34806
34806
  padding-top: 16px;
34807
34807
  border-top: 1px solid var(--color-border);
34808
34808
  }
34809
- .cn-support-info h4[data-v-0f41828c] {
34809
+ .cn-support-info h4[data-v-c3ceda64] {
34810
34810
  margin: 0 0 8px 0;
34811
34811
  font-size: 14px;
34812
34812
  font-weight: 600;
34813
34813
  color: var(--color-main-text);
34814
34814
  }
34815
- .cn-support-info p[data-v-0f41828c] {
34815
+ .cn-support-info p[data-v-c3ceda64] {
34816
34816
  margin: 4px 0;
34817
34817
  color: var(--color-text-maxcontrast);
34818
34818
  font-size: 14px;
34819
34819
  }
34820
- .cn-support-info a[data-v-0f41828c] {
34820
+ .cn-support-info a[data-v-c3ceda64] {
34821
34821
  color: var(--color-primary-element);
34822
34822
  }
34823
34823
 
@@ -257113,6 +257113,43 @@ function readTabFromAddress(key) {
257113
257113
  return new URLSearchParams(window.location.search).get(key) || ''
257114
257114
  }
257115
257115
 
257116
+ /**
257117
+ * The tab remembered under a storage key, or '' without a key, a value or
257118
+ * usable storage (a private window can refuse it).
257119
+ *
257120
+ * @param {string} key The storage key.
257121
+ * @return {string} The remembered tab id.
257122
+ */
257123
+ function readStoredTab(key) {
257124
+ if (!key) {
257125
+ return ''
257126
+ }
257127
+ try {
257128
+ return window.localStorage.getItem(key) || ''
257129
+ } catch {
257130
+ return ''
257131
+ }
257132
+ }
257133
+
257134
+ /**
257135
+ * Remember the open tab under a storage key; nothing without a key or
257136
+ * usable storage.
257137
+ *
257138
+ * @param {string} key The storage key.
257139
+ * @param {string} id The tab's id.
257140
+ * @return {void}
257141
+ */
257142
+ function storeTab(key, id) {
257143
+ if (!key) {
257144
+ return
257145
+ }
257146
+ try {
257147
+ window.localStorage.setItem(key, id);
257148
+ } catch {
257149
+ // Storage refused (private window): the address still holds the tab.
257150
+ }
257151
+ }
257152
+
257116
257153
  /**
257117
257154
  * Put the open tab in the address without a new history entry.
257118
257155
  *
@@ -257323,6 +257360,18 @@ var script$2k = {
257323
257360
  default: 'tab',
257324
257361
  },
257325
257362
 
257363
+ /**
257364
+ * A browser storage key under which the shell remembers the last
257365
+ * opened tab, so the page opens on it again when the address names no
257366
+ * tab. Empty (the default) remembers nothing. The address still wins.
257367
+ *
257368
+ * @spec openspec/changes/admin-shell-remembers-tab/specs/settings-board-look/spec.md#requirement-the-admin-shell-can-remember-the-last-tab
257369
+ */
257370
+ tabStorageKey: {
257371
+ type: String,
257372
+ default: '',
257373
+ },
257374
+
257326
257375
  /**
257327
257376
  * How the `tabs` strip is drawn, as CnTabs' `variant`: `line`, the
257328
257377
  * folder tabs (the default), or `underline`, plain labels on a rule
@@ -257495,7 +257544,7 @@ var script$2k = {
257495
257544
  reimporting: false,
257496
257545
  setupWizardOpen: false,
257497
257546
  // The open tab's id; empty until a tab is picked or the address names one.
257498
- chosenTabId: readTabFromAddress(this.tabQueryKey),
257547
+ chosenTabId: readTabFromAddress(this.tabQueryKey) || readStoredTab(this.tabStorageKey),
257499
257548
  }
257500
257549
  },
257501
257550
 
@@ -257655,6 +257704,19 @@ var script$2k = {
257655
257704
  },
257656
257705
  },
257657
257706
 
257707
+ /**
257708
+ * A page that opens on a tab other than the first (named in the address,
257709
+ * or remembered) tells the app once, as a click would, so a breadcrumb or
257710
+ * title that follows the tab is right from the first paint.
257711
+ *
257712
+ * @spec openspec/changes/admin-shell-remembers-tab/specs/settings-board-look/spec.md#requirement-the-admin-shell-can-remember-the-last-tab
257713
+ */
257714
+ mounted() {
257715
+ if (this.tabItems.length > 0 && this.activeTabId !== this.tabItems[0].id) {
257716
+ this.$emit('tab-change', this.activeTabId);
257717
+ }
257718
+ },
257719
+
257658
257720
  methods: {
257659
257721
  /**
257660
257722
  * A tab was picked in the strip: remember it, put it in the address
@@ -257671,6 +257733,7 @@ var script$2k = {
257671
257733
  }
257672
257734
  this.chosenTabId = tab.id;
257673
257735
  writeTabToAddress(this.tabQueryKey, tab.id);
257736
+ storeTab(this.tabStorageKey, tab.id);
257674
257737
  /**
257675
257738
  * @event tab-change Emitted when the reader opens another tab. Payload: its `id`.
257676
257739
  */
@@ -258008,7 +258071,7 @@ function render$2k(_ctx, _cache, $props, $setup, $data, $options) {
258008
258071
  }
258009
258072
 
258010
258073
  script$2k.render = render$2k;
258011
- script$2k.__scopeId = "data-v-0f41828c";
258074
+ script$2k.__scopeId = "data-v-c3ceda64";
258012
258075
  const __sfc_main$2k = script$2k;
258013
258076
 
258014
258077
  /**
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/nextcloud-vue.cjs.js.map
3
- size: 40756512 bytes
4
- sha256: 944995c0769e4a09afde370b0f98c983e7749487f9a29ab5a1f49e7191a0c530
3
+ size: 40761222 bytes
4
+ sha256: 74c8351e2250accf05102ce32e61fbb7e7f3c5c7ace613b0d9df9cee7b9249ae
@@ -34796,28 +34796,28 @@ to {
34796
34796
  }
34797
34797
 
34798
34798
 
34799
- .cn-admin-settings-shell[data-v-0f41828c] {
34799
+ .cn-admin-settings-shell[data-v-c3ceda64] {
34800
34800
  max-width: 900px;
34801
34801
  }
34802
34802
 
34803
34803
  /* The board look lifts the width and lays the header and cards on a grid (look-board.css). */
34804
- .cn-support-info[data-v-0f41828c] {
34804
+ .cn-support-info[data-v-c3ceda64] {
34805
34805
  margin-top: 16px;
34806
34806
  padding-top: 16px;
34807
34807
  border-top: 1px solid var(--color-border);
34808
34808
  }
34809
- .cn-support-info h4[data-v-0f41828c] {
34809
+ .cn-support-info h4[data-v-c3ceda64] {
34810
34810
  margin: 0 0 8px 0;
34811
34811
  font-size: 14px;
34812
34812
  font-weight: 600;
34813
34813
  color: var(--color-main-text);
34814
34814
  }
34815
- .cn-support-info p[data-v-0f41828c] {
34815
+ .cn-support-info p[data-v-c3ceda64] {
34816
34816
  margin: 4px 0;
34817
34817
  color: var(--color-text-maxcontrast);
34818
34818
  font-size: 14px;
34819
34819
  }
34820
- .cn-support-info a[data-v-0f41828c] {
34820
+ .cn-support-info a[data-v-c3ceda64] {
34821
34821
  color: var(--color-primary-element);
34822
34822
  }
34823
34823
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/nextcloud-vue",
3
- "version": "2.88.0",
3
+ "version": "2.89.0",
4
4
  "description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
5
5
  "homepage": "https://github.com/ConductionNL/nextcloud-vue#readme",
6
6
  "bugs": {
@@ -232,6 +232,43 @@ function readTabFromAddress(key) {
232
232
  return new URLSearchParams(window.location.search).get(key) || ''
233
233
  }
234
234
 
235
+ /**
236
+ * The tab remembered under a storage key, or '' without a key, a value or
237
+ * usable storage (a private window can refuse it).
238
+ *
239
+ * @param {string} key The storage key.
240
+ * @return {string} The remembered tab id.
241
+ */
242
+ function readStoredTab(key) {
243
+ if (!key) {
244
+ return ''
245
+ }
246
+ try {
247
+ return window.localStorage.getItem(key) || ''
248
+ } catch {
249
+ return ''
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Remember the open tab under a storage key; nothing without a key or
255
+ * usable storage.
256
+ *
257
+ * @param {string} key The storage key.
258
+ * @param {string} id The tab's id.
259
+ * @return {void}
260
+ */
261
+ function storeTab(key, id) {
262
+ if (!key) {
263
+ return
264
+ }
265
+ try {
266
+ window.localStorage.setItem(key, id)
267
+ } catch {
268
+ // Storage refused (private window): the address still holds the tab.
269
+ }
270
+ }
271
+
235
272
  /**
236
273
  * Put the open tab in the address without a new history entry.
237
274
  *
@@ -442,6 +479,18 @@ export default {
442
479
  default: 'tab',
443
480
  },
444
481
 
482
+ /**
483
+ * A browser storage key under which the shell remembers the last
484
+ * opened tab, so the page opens on it again when the address names no
485
+ * tab. Empty (the default) remembers nothing. The address still wins.
486
+ *
487
+ * @spec openspec/changes/admin-shell-remembers-tab/specs/settings-board-look/spec.md#requirement-the-admin-shell-can-remember-the-last-tab
488
+ */
489
+ tabStorageKey: {
490
+ type: String,
491
+ default: '',
492
+ },
493
+
445
494
  /**
446
495
  * How the `tabs` strip is drawn, as CnTabs' `variant`: `line`, the
447
496
  * folder tabs (the default), or `underline`, plain labels on a rule
@@ -614,7 +663,7 @@ export default {
614
663
  reimporting: false,
615
664
  setupWizardOpen: false,
616
665
  // The open tab's id; empty until a tab is picked or the address names one.
617
- chosenTabId: readTabFromAddress(this.tabQueryKey),
666
+ chosenTabId: readTabFromAddress(this.tabQueryKey) || readStoredTab(this.tabStorageKey),
618
667
  }
619
668
  },
620
669
 
@@ -774,6 +823,19 @@ export default {
774
823
  },
775
824
  },
776
825
 
826
+ /**
827
+ * A page that opens on a tab other than the first (named in the address,
828
+ * or remembered) tells the app once, as a click would, so a breadcrumb or
829
+ * title that follows the tab is right from the first paint.
830
+ *
831
+ * @spec openspec/changes/admin-shell-remembers-tab/specs/settings-board-look/spec.md#requirement-the-admin-shell-can-remember-the-last-tab
832
+ */
833
+ mounted() {
834
+ if (this.tabItems.length > 0 && this.activeTabId !== this.tabItems[0].id) {
835
+ this.$emit('tab-change', this.activeTabId)
836
+ }
837
+ },
838
+
777
839
  methods: {
778
840
  /**
779
841
  * A tab was picked in the strip: remember it, put it in the address
@@ -790,6 +852,7 @@ export default {
790
852
  }
791
853
  this.chosenTabId = tab.id
792
854
  writeTabToAddress(this.tabQueryKey, tab.id)
855
+ storeTab(this.tabStorageKey, tab.id)
793
856
  /**
794
857
  * @event tab-change Emitted when the reader opens another tab. Payload: its `id`.
795
858
  */