kempo-ui 0.0.74 → 0.0.76

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.
@@ -1,4 +1,4 @@
1
- import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComponent.js";import drag from"../utils/drag.js";export default class Split extends ShadowComponent{static properties={resizing:{type:Boolean,reflect:!0},stacked:{type:Boolean,reflect:!0},stackWidth:{type:Number,attribute:"stack-width"},direction:{type:String,reflect:!0}};constructor(){super(),this.resizing=!1,this.stacked=!1,this.stackWidth=0,this.direction="horizontal",this.dragStartSize=0,this.dragCleanup=()=>{},this.resizeObserver=null}firstUpdated(){super.firstUpdated(),this.setupDragHandler(),this.setupResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this.dragCleanup(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}handleDragStart=()=>{this.resizing=!0,this.dragStartSize=Math.round(this.shadowRoot.getElementById("pane-1").getBoundingClientRect()["vertical"===this.direction?"height":"width"]),this.dispatchEvent(new CustomEvent("resizestart",{detail:{startSize:this.dragStartSize},bubbles:!0}))};handleDrag=({x:e,y:t})=>{const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.dispatchEvent(new CustomEvent("resize",{detail:{size:s},bubbles:!0}))};handleDragEnd=({x:e,y:t})=>{this.resizing=!1;const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.dispatchEvent(new CustomEvent("resizeend",{detail:{size:s},bubbles:!0}))};setSize(e){this.style.setProperty("--pane_1_size",e)}setupDragHandler(){const e=this.shadowRoot.getElementById("divider-handle");e&&(this.dragCleanup=drag({element:e,callback:this.handleDrag,startCallback:this.handleDragStart,endCallback:this.handleDragEnd}))}setupResizeObserver(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect.width;this.stacked=e<=this.stackWidth}}),this.resizeObserver.observe(this)}static styles=css`
1
+ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComponent.js";import drag from"../utils/drag.js";export default class Split extends ShadowComponent{static properties={resizing:{type:Boolean,reflect:!0},stacked:{type:Boolean,reflect:!0},stackWidth:{type:Number,attribute:"stack-width"},direction:{type:String,reflect:!0},persistentId:{type:String,reflect:!0,attribute:"persistent-id"}};constructor(){super(),this.resizing=!1,this.stacked=!1,this.stackWidth=0,this.direction="horizontal",this.persistentId=null,this.dragStartSize=0,this.dragCleanup=()=>{},this.resizeObserver=null}firstUpdated(){if(super.firstUpdated(),this.setupDragHandler(),this.setupResizeObserver(),this.persistentId&&window?.localStorage){const e=window.localStorage.getItem(`split-persistent-id-${this.persistentId}`);e&&this.setSize(e)}}disconnectedCallback(){super.disconnectedCallback(),this.dragCleanup(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}handleDragStart=()=>{this.resizing=!0,this.dragStartSize=Math.round(this.shadowRoot.getElementById("pane-1").getBoundingClientRect()["vertical"===this.direction?"height":"width"]),this.dispatchEvent(new CustomEvent("resizestart",{detail:{startSize:this.dragStartSize},bubbles:!0}))};handleDrag=({x:e,y:t})=>{const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.dispatchEvent(new CustomEvent("resize",{detail:{size:s},bubbles:!0}))};handleDragEnd=({x:e,y:t})=>{this.resizing=!1;const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.persistentId&&window?.localStorage&&window.localStorage.setItem(`split-persistent-id-${this.persistentId}`,s),this.dispatchEvent(new CustomEvent("resizeend",{detail:{size:s},bubbles:!0}))};setSize(e){this.style.setProperty("--pane_1_size",e)}setupDragHandler(){const e=this.shadowRoot.getElementById("divider-handle");e&&(this.dragCleanup=drag({element:e,callback:this.handleDrag,startCallback:this.handleDragStart,endCallback:this.handleDragEnd}))}setupResizeObserver(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect.width;this.stacked=e<=this.stackWidth}}),this.resizeObserver.observe(this)}static styles=css`
2
2
  :host {
3
3
  --pane_1_size: calc((100% - var(--handle_width)) / 2);
4
4
  --handle_width: 0.5rem;
@@ -17,7 +17,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
17
17
 
18
18
  .pane {
19
19
  min-width: var(--min_pane_size);
20
- max-width: calc(100% - var(--min_pane_size));
20
+ max-width: calc(100% - var(--min_pane_size) - var(--handle_width));
21
21
  max-height: 100%;
22
22
  overflow: hidden;
23
23
  }
@@ -28,6 +28,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
28
28
 
29
29
  #divider-handle {
30
30
  display: flex;
31
+ flex-shrink: 0;
31
32
  justify-content: center;
32
33
  width: var(--handle_width);
33
34
  cursor: ew-resize;
@@ -37,9 +38,12 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
37
38
  background-color: var(--tc_primary);
38
39
  }
39
40
 
41
+ :host([resizing]) {
42
+ user-select: none;
43
+ }
44
+
40
45
  :host([resizing]) .pane {
41
46
  pointer-events: none;
42
- user-select: none;
43
47
  }
44
48
 
45
49
  #divider-border {
@@ -80,7 +84,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
80
84
  min-width: 0;
81
85
  max-width: 100%;
82
86
  min-height: var(--min_pane_size);
83
- max-height: calc(100% - var(--min_pane_size));
87
+ max-height: calc(100% - var(--min_pane_size) - var(--handle_width));
84
88
  }
85
89
 
86
90
  :host([direction="vertical"]) #pane-1 {
@@ -24,7 +24,7 @@
24
24
  <a href="#basicUsage">Basic Usage</a><br />
25
25
  <a href="#resizing">Resizing</a><br />
26
26
  <a href="#verticalSplit">Vertical Split</a><br />
27
-
27
+ <a href="#persistentState">Persistent State</a><br />
28
28
  <h6 class="mt"><a href="#jsRef" class="no-link">JavaScript Reference</a></h6>
29
29
  <a href="#constructor">Constructor</a><br />
30
30
  <a href="#requirements">Requirements</a><br />
@@ -139,6 +139,24 @@
139
139
  </div>
140
140
 
141
141
 
142
+ <h3 id="persistentState"><a href="#persistentState" class="no-link">Persistent State</a></h3>
143
+ <p>Add the <code>persistent-id</code> attribute to save and restore the pane size across page refreshes using <code>localStorage</code>. Each split that uses persistence must have a unique <code>persistent-id</code> value.</p>
144
+ <div class="row -mx mb">
145
+ <div class="col d-span-6 m-span-12 px">
146
+ <k-card label="HTML">
147
+ <pre><code class="hljs xml"><span class="hljs-tag">&lt;<span class="hljs-name">k-split</span> <span class="hljs-attr">persistent-id</span>=<span class="hljs-string">"my-split"</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 10rem"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"b"</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>Left Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /> <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">slot</span>=<span class="hljs-string">"right"</span>&gt;</span>Right Pane Content<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><br /><span class="hljs-tag">&lt;/<span class="hljs-name">k-split</span>&gt;</span></code></pre>
148
+ </k-card>
149
+ </div>
150
+ <div class="col d-span-6 m-span-12 px">
151
+ <k-card label="Results">
152
+ <k-split persistent-id="docs-split-example" style="height: 10rem" class="b">
153
+ <div>Left Pane Content</div>
154
+ <div slot="right">Right Pane Content</div>
155
+ </k-split>
156
+ </k-card>
157
+ </div>
158
+ </div>
159
+
142
160
  <h2 id="jsRef">JavaScript Reference</h2>
143
161
 
144
162
  <h3 id="constructor"><a href="#constructor" class="no-link">Constructor</a></h3>
@@ -161,6 +179,8 @@
161
179
  <p>The window width threshold for stacking behavior. Syncs to <code>stack-width</code> attribute.</p>
162
180
  <h5><code>direction<i>: string</i></code></h5>
163
181
  <p>The direction of the split. Can be <code>"horizontal"</code> (default) or <code>"vertical"</code>. Syncs to <code>direction</code> attribute.</p>
182
+ <h5><code>persistentId<i>: string</i></code></h5>
183
+ <p>When set, the pane size is saved to <code>localStorage</code> on resize and restored on initialization. Must be unique per split instance. Syncs to <code>persistent-id</code> attribute.</p>
164
184
 
165
185
  <h3 id="cssCustomProperties"><a href="#cssCustomProperties" class="no-link">CSS Custom Properties</a></h3>
166
186
  <h5><code>--pane_1_size</code></h5>
@@ -1,4 +1,4 @@
1
- import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComponent.js";import drag from"../utils/drag.js";export default class Split extends ShadowComponent{static properties={resizing:{type:Boolean,reflect:!0},stacked:{type:Boolean,reflect:!0},stackWidth:{type:Number,attribute:"stack-width"},direction:{type:String,reflect:!0}};constructor(){super(),this.resizing=!1,this.stacked=!1,this.stackWidth=0,this.direction="horizontal",this.dragStartSize=0,this.dragCleanup=()=>{},this.resizeObserver=null}firstUpdated(){super.firstUpdated(),this.setupDragHandler(),this.setupResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this.dragCleanup(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}handleDragStart=()=>{this.resizing=!0,this.dragStartSize=Math.round(this.shadowRoot.getElementById("pane-1").getBoundingClientRect()["vertical"===this.direction?"height":"width"]),this.dispatchEvent(new CustomEvent("resizestart",{detail:{startSize:this.dragStartSize},bubbles:!0}))};handleDrag=({x:e,y:t})=>{const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.dispatchEvent(new CustomEvent("resize",{detail:{size:s},bubbles:!0}))};handleDragEnd=({x:e,y:t})=>{this.resizing=!1;const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.dispatchEvent(new CustomEvent("resizeend",{detail:{size:s},bubbles:!0}))};setSize(e){this.style.setProperty("--pane_1_size",e)}setupDragHandler(){const e=this.shadowRoot.getElementById("divider-handle");e&&(this.dragCleanup=drag({element:e,callback:this.handleDrag,startCallback:this.handleDragStart,endCallback:this.handleDragEnd}))}setupResizeObserver(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect.width;this.stacked=e<=this.stackWidth}}),this.resizeObserver.observe(this)}static styles=css`
1
+ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComponent.js";import drag from"../utils/drag.js";export default class Split extends ShadowComponent{static properties={resizing:{type:Boolean,reflect:!0},stacked:{type:Boolean,reflect:!0},stackWidth:{type:Number,attribute:"stack-width"},direction:{type:String,reflect:!0},persistentId:{type:String,reflect:!0,attribute:"persistent-id"}};constructor(){super(),this.resizing=!1,this.stacked=!1,this.stackWidth=0,this.direction="horizontal",this.persistentId=null,this.dragStartSize=0,this.dragCleanup=()=>{},this.resizeObserver=null}firstUpdated(){if(super.firstUpdated(),this.setupDragHandler(),this.setupResizeObserver(),this.persistentId&&window?.localStorage){const e=window.localStorage.getItem(`split-persistent-id-${this.persistentId}`);e&&this.setSize(e)}}disconnectedCallback(){super.disconnectedCallback(),this.dragCleanup(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}handleDragStart=()=>{this.resizing=!0,this.dragStartSize=Math.round(this.shadowRoot.getElementById("pane-1").getBoundingClientRect()["vertical"===this.direction?"height":"width"]),this.dispatchEvent(new CustomEvent("resizestart",{detail:{startSize:this.dragStartSize},bubbles:!0}))};handleDrag=({x:e,y:t})=>{const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.dispatchEvent(new CustomEvent("resize",{detail:{size:s},bubbles:!0}))};handleDragEnd=({x:e,y:t})=>{this.resizing=!1;const i="vertical"===this.direction?t:e,s=`${this.dragStartSize+i}px`;this.setSize(s),this.persistentId&&window?.localStorage&&window.localStorage.setItem(`split-persistent-id-${this.persistentId}`,s),this.dispatchEvent(new CustomEvent("resizeend",{detail:{size:s},bubbles:!0}))};setSize(e){this.style.setProperty("--pane_1_size",e)}setupDragHandler(){const e=this.shadowRoot.getElementById("divider-handle");e&&(this.dragCleanup=drag({element:e,callback:this.handleDrag,startCallback:this.handleDragStart,endCallback:this.handleDragEnd}))}setupResizeObserver(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const e=t.contentRect.width;this.stacked=e<=this.stackWidth}}),this.resizeObserver.observe(this)}static styles=css`
2
2
  :host {
3
3
  --pane_1_size: calc((100% - var(--handle_width)) / 2);
4
4
  --handle_width: 0.5rem;
@@ -17,7 +17,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
17
17
 
18
18
  .pane {
19
19
  min-width: var(--min_pane_size);
20
- max-width: calc(100% - var(--min_pane_size));
20
+ max-width: calc(100% - var(--min_pane_size) - var(--handle_width));
21
21
  max-height: 100%;
22
22
  overflow: hidden;
23
23
  }
@@ -28,6 +28,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
28
28
 
29
29
  #divider-handle {
30
30
  display: flex;
31
+ flex-shrink: 0;
31
32
  justify-content: center;
32
33
  width: var(--handle_width);
33
34
  cursor: ew-resize;
@@ -37,9 +38,12 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
37
38
  background-color: var(--tc_primary);
38
39
  }
39
40
 
41
+ :host([resizing]) {
42
+ user-select: none;
43
+ }
44
+
40
45
  :host([resizing]) .pane {
41
46
  pointer-events: none;
42
- user-select: none;
43
47
  }
44
48
 
45
49
  #divider-border {
@@ -80,7 +84,7 @@ import{html,css}from"../lit-all.min.js";import ShadowComponent from"./ShadowComp
80
84
  min-width: 0;
81
85
  max-width: 100%;
82
86
  min-height: var(--min_pane_size);
83
- max-height: calc(100% - var(--min_pane_size));
87
+ max-height: calc(100% - var(--min_pane_size) - var(--handle_width));
84
88
  }
85
89
 
86
90
  :host([direction="vertical"]) #pane-1 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kempo-ui",
3
- "version": "0.0.74",
3
+ "version": "0.0.76",
4
4
  "type": "module",
5
5
  "description": "A Lit based web-component library",
6
6
  "main": "index.js",
@@ -7,7 +7,8 @@ export default class Split extends ShadowComponent {
7
7
  resizing: { type: Boolean, reflect: true },
8
8
  stacked: { type: Boolean, reflect: true },
9
9
  stackWidth: { type: Number, attribute: 'stack-width' },
10
- direction: { type: String, reflect: true }
10
+ direction: { type: String, reflect: true },
11
+ persistentId: { type: String, reflect: true, attribute: 'persistent-id' }
11
12
  };
12
13
 
13
14
  constructor() {
@@ -17,6 +18,7 @@ export default class Split extends ShadowComponent {
17
18
  this.stacked = false;
18
19
  this.stackWidth = 0;
19
20
  this.direction = 'horizontal';
21
+ this.persistentId = null;
20
22
 
21
23
  // Private state
22
24
  this.dragStartSize = 0;
@@ -31,6 +33,10 @@ export default class Split extends ShadowComponent {
31
33
  super.firstUpdated();
32
34
  this.setupDragHandler();
33
35
  this.setupResizeObserver();
36
+ if(this.persistentId && window?.localStorage) {
37
+ const size = window.localStorage.getItem(`split-persistent-id-${this.persistentId}`);
38
+ if(size) this.setSize(size);
39
+ }
34
40
  }
35
41
 
36
42
  disconnectedCallback() {
@@ -69,6 +75,9 @@ export default class Split extends ShadowComponent {
69
75
  const delta = this.direction === 'vertical' ? y : x;
70
76
  const size = `${this.dragStartSize + delta}px`;
71
77
  this.setSize(size);
78
+ if(this.persistentId && window?.localStorage) {
79
+ window.localStorage.setItem(`split-persistent-id-${this.persistentId}`, size);
80
+ }
72
81
  this.dispatchEvent(new CustomEvent('resizeend', {
73
82
  detail: { size },
74
83
  bubbles: true
@@ -126,7 +135,7 @@ export default class Split extends ShadowComponent {
126
135
 
127
136
  .pane {
128
137
  min-width: var(--min_pane_size);
129
- max-width: calc(100% - var(--min_pane_size));
138
+ max-width: calc(100% - var(--min_pane_size) - var(--handle_width));
130
139
  max-height: 100%;
131
140
  overflow: hidden;
132
141
  }
@@ -137,6 +146,7 @@ export default class Split extends ShadowComponent {
137
146
 
138
147
  #divider-handle {
139
148
  display: flex;
149
+ flex-shrink: 0;
140
150
  justify-content: center;
141
151
  width: var(--handle_width);
142
152
  cursor: ew-resize;
@@ -146,9 +156,12 @@ export default class Split extends ShadowComponent {
146
156
  background-color: var(--tc_primary);
147
157
  }
148
158
 
159
+ :host([resizing]) {
160
+ user-select: none;
161
+ }
162
+
149
163
  :host([resizing]) .pane {
150
164
  pointer-events: none;
151
- user-select: none;
152
165
  }
153
166
 
154
167
  #divider-border {
@@ -189,7 +202,7 @@ export default class Split extends ShadowComponent {
189
202
  min-width: 0;
190
203
  max-width: 100%;
191
204
  min-height: var(--min_pane_size);
192
- max-height: calc(100% - var(--min_pane_size));
205
+ max-height: calc(100% - var(--min_pane_size) - var(--handle_width));
193
206
  }
194
207
 
195
208
  :host([direction="vertical"]) #pane-1 {
@@ -5,7 +5,7 @@ const createSplit = async (options = {}) => {
5
5
  container.style.width = '800px';
6
6
  container.style.height = '400px';
7
7
  container.innerHTML = `
8
- <k-split ${options.stacked ? 'stacked' : ''} ${options.stackWidth ? `stack-width="${options.stackWidth}"` : ''} ${options.direction ? `direction="${options.direction}"` : ''}>
8
+ <k-split ${options.stacked ? 'stacked' : ''} ${options.stackWidth ? `stack-width="${options.stackWidth}"` : ''} ${options.direction ? `direction="${options.direction}"` : ''} ${options.persistentId ? `persistent-id="${options.persistentId}"` : ''}>
9
9
  <div id="left-content">Left Pane Content</div>
10
10
  <div slot="right" id="right-content">Right Pane Content</div>
11
11
  </k-split>
@@ -709,5 +709,92 @@ export default {
709
709
 
710
710
  cleanup(container);
711
711
  pass('Size updates during vertical drag');
712
+ },
713
+
714
+ 'should have default persistentId as null': async ({pass, fail}) => {
715
+ const { container, split } = await createSplit();
716
+
717
+ if(split.persistentId !== null){
718
+ cleanup(container);
719
+ fail(`Expected persistentId to be null, got ${split.persistentId}`);
720
+ return;
721
+ }
722
+
723
+ cleanup(container);
724
+ pass('Default persistentId is null');
725
+ },
726
+
727
+ 'should accept persistent-id attribute': async ({pass, fail}) => {
728
+ const { container, split } = await createSplit({ persistentId: 'my-split' });
729
+
730
+ if(split.persistentId !== 'my-split'){
731
+ cleanup(container);
732
+ fail(`Expected persistentId to be "my-split", got ${split.persistentId}`);
733
+ return;
734
+ }
735
+
736
+ cleanup(container);
737
+ pass('persistent-id attribute accepted');
738
+ },
739
+
740
+ 'should save size to localStorage on drag end when persistentId is set': async ({pass, fail}) => {
741
+ const key = 'split-persistent-id-save-test';
742
+ window.localStorage.removeItem(key);
743
+
744
+ const { container, split } = await createSplit({ persistentId: 'save-test' });
745
+
746
+ split.handleDragStart();
747
+ split.handleDragEnd({ x: 100, y: 0 });
748
+
749
+ const saved = window.localStorage.getItem(key);
750
+
751
+ if(!saved){
752
+ cleanup(container);
753
+ window.localStorage.removeItem(key);
754
+ fail('Size should be saved to localStorage on drag end');
755
+ return;
756
+ }
757
+
758
+ cleanup(container);
759
+ window.localStorage.removeItem(key);
760
+ pass('Size saved to localStorage on drag end');
761
+ },
762
+
763
+ 'should not save to localStorage on drag end when persistentId is not set': async ({pass, fail}) => {
764
+ const { container, split } = await createSplit();
765
+
766
+ const keysBefore = Object.keys(window.localStorage).filter(k => k.startsWith('split-persistent-id-'));
767
+ split.handleDragStart();
768
+ split.handleDragEnd({ x: 100, y: 0 });
769
+ const keysAfter = Object.keys(window.localStorage).filter(k => k.startsWith('split-persistent-id-'));
770
+
771
+ if(keysAfter.length !== keysBefore.length){
772
+ cleanup(container);
773
+ fail('Should not save to localStorage when persistentId is not set');
774
+ return;
775
+ }
776
+
777
+ cleanup(container);
778
+ pass('Does not save to localStorage when persistentId is not set');
779
+ },
780
+
781
+ 'should restore size from localStorage when persistentId is set': async ({pass, fail}) => {
782
+ const key = 'split-persistent-id-restore-test';
783
+ window.localStorage.setItem(key, '350px');
784
+
785
+ const { container, split } = await createSplit({ persistentId: 'restore-test' });
786
+
787
+ const pane1Size = split.style.getPropertyValue('--pane_1_size');
788
+
789
+ window.localStorage.removeItem(key);
790
+
791
+ if(pane1Size !== '350px'){
792
+ cleanup(container);
793
+ fail(`Expected --pane_1_size to be 350px (restored from localStorage), got ${pane1Size}`);
794
+ return;
795
+ }
796
+
797
+ cleanup(container);
798
+ pass('Size restored from localStorage when persistentId is set');
712
799
  }
713
800
  };