zz-shopify-components 0.22.1-beta.0 → 0.22.1-beta.2
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/assets/zz-modal.js +11 -11
- package/package.json +1 -1
package/assets/zz-modal.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
const trackModalEvent = (eventType, modalId, additionalData = {}) => {
|
|
15
15
|
try {
|
|
16
16
|
const eventData = {
|
|
17
|
-
event:
|
|
17
|
+
event: eventType,
|
|
18
18
|
modal_action: eventType,
|
|
19
19
|
modal_id: modalId || 'unknown',
|
|
20
20
|
timestamp: new Date().toISOString(),
|
|
@@ -208,8 +208,7 @@
|
|
|
208
208
|
|
|
209
209
|
// Reflect open state if attribute present at mount
|
|
210
210
|
if (this.hasAttribute('open')) {
|
|
211
|
-
|
|
212
|
-
queueMicrotask(() => this.show());
|
|
211
|
+
queueMicrotask(() => this._openInternal(false));
|
|
213
212
|
}
|
|
214
213
|
|
|
215
214
|
// Auto hide empty header/footer
|
|
@@ -229,9 +228,9 @@
|
|
|
229
228
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
230
229
|
if (name === 'open' && oldValue !== newValue) {
|
|
231
230
|
if (this.hasAttribute('open')) {
|
|
232
|
-
this.
|
|
231
|
+
this._openInternal(false);
|
|
233
232
|
} else {
|
|
234
|
-
this.
|
|
233
|
+
this._closeInternal(false);
|
|
235
234
|
}
|
|
236
235
|
}
|
|
237
236
|
}
|
|
@@ -343,11 +342,11 @@
|
|
|
343
342
|
modal_type: this.getAttribute('data-modal-type') || 'default',
|
|
344
343
|
time_open: this._getTimeOpen()
|
|
345
344
|
});
|
|
346
|
-
|
|
347
|
-
this._lastTriggerSource = null;
|
|
348
|
-
this._lastCloseMethod = null;
|
|
349
|
-
this._openTimestamp = null;
|
|
350
345
|
}
|
|
346
|
+
|
|
347
|
+
this._lastTriggerSource = null;
|
|
348
|
+
this._lastCloseMethod = null;
|
|
349
|
+
this._openTimestamp = null;
|
|
351
350
|
}
|
|
352
351
|
|
|
353
352
|
_onKeydown(e) {
|
|
@@ -381,7 +380,8 @@
|
|
|
381
380
|
|
|
382
381
|
_onNativeClose() {
|
|
383
382
|
// Ensure attribute sync and cleanup
|
|
384
|
-
this.
|
|
383
|
+
const shouldEmit = this.hasAttribute('open');
|
|
384
|
+
this._closeInternal(shouldEmit);
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
_onMouseDown(e) {
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
|
|
462
462
|
// Analytics helper methods
|
|
463
463
|
_getTriggerSource() {
|
|
464
|
-
return this._lastTriggerSource || '
|
|
464
|
+
return this._lastTriggerSource || 'unknown';
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
_getCloseMethod() {
|