@magic-spells/dialog-panel 1.1.0 → 1.2.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.
- package/README.md +49 -1
- package/dist/dialog-panel.cjs.js +183 -14
- package/dist/dialog-panel.cjs.js.map +1 -1
- package/dist/dialog-panel.css +66 -35
- package/dist/dialog-panel.esm.js +183 -14
- package/dist/dialog-panel.esm.js.map +1 -1
- package/dist/dialog-panel.js +183 -14
- package/dist/dialog-panel.js.map +1 -1
- package/dist/dialog-panel.min.css +1 -1
- package/dist/dialog-panel.min.js +1 -1
- package/package.json +1 -1
package/dist/dialog-panel.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* @property {HTMLDialogElement} dialog - Reference to inner <dialog> element
|
|
15
15
|
* @property {boolean} isOpen - True if state is 'showing' or 'shown'
|
|
16
16
|
* @property {HTMLElement|null} triggerElement - Element that triggered current action
|
|
17
|
+
* @property {Object|null} morphEngine - Optional duck-typed morph transition engine
|
|
17
18
|
*
|
|
18
19
|
* @fires beforeShow - Fired before showing starts (cancelable)
|
|
19
20
|
* @fires shown - Fired after show animation completes
|
|
@@ -26,12 +27,19 @@
|
|
|
26
27
|
#triggerElement = null;
|
|
27
28
|
#dialog = null;
|
|
28
29
|
#result = null;
|
|
30
|
+
#hideTriggerElement = null;
|
|
31
|
+
#morphEngine = null;
|
|
32
|
+
#morphListenersAttached = false;
|
|
29
33
|
|
|
30
34
|
// Event handler references for cleanup
|
|
31
35
|
#handlers = {
|
|
32
36
|
click: null,
|
|
33
37
|
dialogClick: null,
|
|
34
38
|
cancel: null,
|
|
39
|
+
close: null,
|
|
40
|
+
morphShown: null,
|
|
41
|
+
morphHidden: null,
|
|
42
|
+
morphStop: null,
|
|
35
43
|
};
|
|
36
44
|
|
|
37
45
|
// Animation cleanup references
|
|
@@ -65,6 +73,7 @@
|
|
|
65
73
|
|
|
66
74
|
// Bind event handlers
|
|
67
75
|
_.#bindEvents();
|
|
76
|
+
_.#wireMorphEngine();
|
|
68
77
|
}
|
|
69
78
|
|
|
70
79
|
disconnectedCallback() {
|
|
@@ -79,6 +88,7 @@
|
|
|
79
88
|
clearTimeout(_.#pendingTimeout);
|
|
80
89
|
_.#pendingTimeout = null;
|
|
81
90
|
}
|
|
91
|
+
_.#unwireMorphEngine();
|
|
82
92
|
|
|
83
93
|
// Clean up event listeners
|
|
84
94
|
if (_.#handlers.click) {
|
|
@@ -94,6 +104,9 @@
|
|
|
94
104
|
if (_.#handlers.cancel) {
|
|
95
105
|
_.#dialog.removeEventListener('cancel', _.#handlers.cancel);
|
|
96
106
|
}
|
|
107
|
+
if (_.#handlers.close) {
|
|
108
|
+
_.#dialog.removeEventListener('close', _.#handlers.close);
|
|
109
|
+
}
|
|
97
110
|
}
|
|
98
111
|
}
|
|
99
112
|
|
|
@@ -137,6 +150,105 @@
|
|
|
137
150
|
_.hide();
|
|
138
151
|
};
|
|
139
152
|
_.#dialog.addEventListener('cancel', _.#handlers.cancel);
|
|
153
|
+
|
|
154
|
+
// Cover browser force-close paths that bypass the cancel event
|
|
155
|
+
_.#handlers.close = () => {
|
|
156
|
+
if (
|
|
157
|
+
_.#morphEngine?.state === 'shown' &&
|
|
158
|
+
_.#state === 'shown' &&
|
|
159
|
+
!_.#dialog.open
|
|
160
|
+
) {
|
|
161
|
+
_.hide();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
_.#dialog.addEventListener('close', _.#handlers.close);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Wire morph engine lifecycle listeners
|
|
169
|
+
* @private
|
|
170
|
+
*/
|
|
171
|
+
#wireMorphEngine() {
|
|
172
|
+
const _ = this;
|
|
173
|
+
|
|
174
|
+
if (!_.#morphEngine || _.#morphListenersAttached) return;
|
|
175
|
+
|
|
176
|
+
if (!_.#handlers.morphShown) {
|
|
177
|
+
_.#handlers.morphShown = _.#handleMorphShown.bind(_);
|
|
178
|
+
_.#handlers.morphHidden = _.#handleMorphHidden.bind(_);
|
|
179
|
+
_.#handlers.morphStop = _.#handleMorphStop.bind(_);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
_.#morphEngine.on('shown', _.#handlers.morphShown);
|
|
183
|
+
_.#morphEngine.on('hidden', _.#handlers.morphHidden);
|
|
184
|
+
_.#morphEngine.on('stop', _.#handlers.morphStop);
|
|
185
|
+
_.#morphListenersAttached = true;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Unwire morph engine lifecycle listeners
|
|
190
|
+
* @private
|
|
191
|
+
*/
|
|
192
|
+
#unwireMorphEngine() {
|
|
193
|
+
const _ = this;
|
|
194
|
+
|
|
195
|
+
if (!_.#morphEngine || !_.#morphListenersAttached) return;
|
|
196
|
+
|
|
197
|
+
_.#morphEngine.off('shown', _.#handlers.morphShown);
|
|
198
|
+
_.#morphEngine.off('hidden', _.#handlers.morphHidden);
|
|
199
|
+
_.#morphEngine.off('stop', _.#handlers.morphStop);
|
|
200
|
+
_.#morphListenersAttached = false;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Promote the settled morph target into the dialog top layer
|
|
205
|
+
* @private
|
|
206
|
+
*/
|
|
207
|
+
#handleMorphShown() {
|
|
208
|
+
const _ = this;
|
|
209
|
+
|
|
210
|
+
if (!_.#dialog.open) _.#dialog.showModal();
|
|
211
|
+
_.#setState('shown');
|
|
212
|
+
_.#emit('shown');
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Finalize a settled morph hide
|
|
217
|
+
* @private
|
|
218
|
+
*/
|
|
219
|
+
#handleMorphHidden() {
|
|
220
|
+
this.#finalizeMorphHide();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Finalize an interrupted morph as hidden
|
|
225
|
+
* @private
|
|
226
|
+
*/
|
|
227
|
+
#handleMorphStop() {
|
|
228
|
+
this.#finalizeMorphHide();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Restore the component's hidden state after a morph ends
|
|
233
|
+
* @private
|
|
234
|
+
*/
|
|
235
|
+
#finalizeMorphHide() {
|
|
236
|
+
const _ = this;
|
|
237
|
+
|
|
238
|
+
if (_.#dialog.open) _.#dialog.close();
|
|
239
|
+
_.#setState('hidden');
|
|
240
|
+
_.#emit('hidden', {
|
|
241
|
+
result: _.#result,
|
|
242
|
+
triggerElement: _.#hideTriggerElement,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// Return focus to trigger element
|
|
246
|
+
if (_.#triggerElement) _.#triggerElement.focus();
|
|
247
|
+
|
|
248
|
+
// Clean up
|
|
249
|
+
_.#triggerElement = null;
|
|
250
|
+
_.#hideTriggerElement = null;
|
|
251
|
+
_.#result = null;
|
|
140
252
|
}
|
|
141
253
|
|
|
142
254
|
/**
|
|
@@ -150,17 +262,36 @@
|
|
|
150
262
|
// Check if already showing/shown
|
|
151
263
|
if (_.#state === 'showing' || _.#state === 'shown') return true;
|
|
152
264
|
|
|
153
|
-
|
|
154
|
-
|
|
265
|
+
const reversingMorph =
|
|
266
|
+
_.#state === 'hiding' && _.#morphEngine?.state === 'hiding';
|
|
267
|
+
|
|
268
|
+
// CSS transitions cannot reverse while hiding
|
|
269
|
+
if (_.#state === 'hiding' && !reversingMorph) return false;
|
|
155
270
|
|
|
156
271
|
// Store trigger element for focus return later
|
|
157
|
-
_.#triggerElement = triggerEl || null;
|
|
272
|
+
if (!reversingMorph) _.#triggerElement = triggerEl || null;
|
|
158
273
|
|
|
159
274
|
// Fire beforeShow (cancelable)
|
|
160
275
|
if (!_.#emit('beforeShow', { cancelable: true })) return false;
|
|
161
276
|
|
|
162
|
-
|
|
277
|
+
if (reversingMorph) {
|
|
278
|
+
_.#hideTriggerElement = null;
|
|
279
|
+
_.#result = null;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Set state to 'showing'
|
|
163
283
|
_.#setState('showing');
|
|
284
|
+
|
|
285
|
+
if (_.#morphEngine && (triggerEl || reversingMorph)) {
|
|
286
|
+
_.#morphEngine.show({
|
|
287
|
+
from: _.#triggerElement,
|
|
288
|
+
to: _.#dialog,
|
|
289
|
+
display: _.getAttribute('morph-display') || 'block',
|
|
290
|
+
});
|
|
291
|
+
return true;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Open native dialog for the CSS transition path
|
|
164
295
|
_.#dialog.showModal();
|
|
165
296
|
|
|
166
297
|
// Double RAF ensures browser has painted the 'showing' state
|
|
@@ -191,8 +322,11 @@
|
|
|
191
322
|
// Check if already hiding/hidden
|
|
192
323
|
if (_.#state === 'hiding' || _.#state === 'hidden') return true;
|
|
193
324
|
|
|
194
|
-
|
|
195
|
-
|
|
325
|
+
const reversingMorph =
|
|
326
|
+
_.#state === 'showing' && _.#morphEngine?.state === 'showing';
|
|
327
|
+
|
|
328
|
+
// CSS transitions cannot reverse while showing
|
|
329
|
+
if (_.#state === 'showing' && !reversingMorph) return false;
|
|
196
330
|
|
|
197
331
|
// Capture result from trigger element
|
|
198
332
|
_.#result = triggerEl?.dataset?.result ?? null;
|
|
@@ -208,6 +342,14 @@
|
|
|
208
342
|
return false;
|
|
209
343
|
}
|
|
210
344
|
|
|
345
|
+
if (reversingMorph || _.#morphEngine?.state === 'shown') {
|
|
346
|
+
_.#hideTriggerElement = triggerEl;
|
|
347
|
+
if (_.#dialog.open) _.#dialog.close();
|
|
348
|
+
_.#morphEngine.hide();
|
|
349
|
+
_.#setState('hiding');
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
|
|
211
353
|
// Set state to 'hiding' - this triggers CSS exit animation
|
|
212
354
|
_.#setState('hiding');
|
|
213
355
|
|
|
@@ -239,15 +381,16 @@
|
|
|
239
381
|
#waitForTransition(callback) {
|
|
240
382
|
const _ = this;
|
|
241
383
|
let called = false;
|
|
384
|
+
let timerId = null;
|
|
242
385
|
|
|
243
386
|
const done = () => {
|
|
244
387
|
if (called) return;
|
|
245
388
|
called = true;
|
|
246
389
|
_.#dialog.removeEventListener('transitionend', onTransitionEnd);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
390
|
+
// clear only our own timer — clearing the shared field would let an
|
|
391
|
+
// earlier, still-pending wait cancel a later wait's fallback
|
|
392
|
+
clearTimeout(timerId);
|
|
393
|
+
if (_.#pendingTimeout === timerId) _.#pendingTimeout = null;
|
|
251
394
|
callback();
|
|
252
395
|
};
|
|
253
396
|
|
|
@@ -257,10 +400,8 @@
|
|
|
257
400
|
|
|
258
401
|
_.#dialog.addEventListener('transitionend', onTransitionEnd);
|
|
259
402
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
DialogPanel.TRANSITION_FALLBACK_TIMEOUT
|
|
263
|
-
);
|
|
403
|
+
timerId = setTimeout(done, DialogPanel.TRANSITION_FALLBACK_TIMEOUT);
|
|
404
|
+
_.#pendingTimeout = timerId;
|
|
264
405
|
}
|
|
265
406
|
|
|
266
407
|
/**
|
|
@@ -299,6 +440,34 @@
|
|
|
299
440
|
return _.dispatchEvent(event);
|
|
300
441
|
}
|
|
301
442
|
|
|
443
|
+
/**
|
|
444
|
+
* Optional morph transition transport
|
|
445
|
+
* @returns {Object|null} The attached morph engine
|
|
446
|
+
*/
|
|
447
|
+
get morphEngine() {
|
|
448
|
+
return this.#morphEngine;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Attach or remove a duck-typed morph transition engine
|
|
453
|
+
* @param {Object|null} engine - Engine with show, hide, state, on, and off
|
|
454
|
+
*/
|
|
455
|
+
set morphEngine(engine) {
|
|
456
|
+
const _ = this;
|
|
457
|
+
|
|
458
|
+
if (_.#morphEngine === engine) return;
|
|
459
|
+
|
|
460
|
+
_.#unwireMorphEngine();
|
|
461
|
+
_.#morphEngine = engine || null;
|
|
462
|
+
|
|
463
|
+
if (_.#morphEngine) {
|
|
464
|
+
_.setAttribute('morph', '');
|
|
465
|
+
_.#wireMorphEngine();
|
|
466
|
+
} else {
|
|
467
|
+
_.removeAttribute('morph');
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
302
471
|
// Read-only properties
|
|
303
472
|
get state() {
|
|
304
473
|
return this.#state;
|
package/dist/dialog-panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-panel.js","sources":["../src/dialog-panel.js"],"sourcesContent":["import './dialog-panel.css';\n\n/**\n * DialogPanel - A lightweight web component wrapper for native <dialog> elements\n * with state-driven animations.\n *\n * @extends HTMLElement\n *\n * @property {string} state - Current state: 'hidden' | 'showing' | 'shown' | 'hiding'\n * @property {HTMLDialogElement} dialog - Reference to inner <dialog> element\n * @property {boolean} isOpen - True if state is 'showing' or 'shown'\n * @property {HTMLElement|null} triggerElement - Element that triggered current action\n *\n * @fires beforeShow - Fired before showing starts (cancelable)\n * @fires shown - Fired after show animation completes\n * @fires beforeHide - Fired before hiding starts (cancelable)\n * @fires hidden - Fired after hide animation completes\n */\nclass DialogPanel extends HTMLElement {\n\t// Private fields\n\t#state = 'hidden';\n\t#triggerElement = null;\n\t#dialog = null;\n\t#result = null;\n\n\t// Event handler references for cleanup\n\t#handlers = {\n\t\tclick: null,\n\t\tdialogClick: null,\n\t\tcancel: null,\n\t};\n\n\t// Animation cleanup references\n\t#pendingRAF = null;\n\t#pendingTimeout = null;\n\n\t// Fallback timeout for transitionend (in ms)\n\tstatic TRANSITION_FALLBACK_TIMEOUT = 700;\n\n\tconnectedCallback() {\n\t\tconst _ = this;\n\n\t\t// Find inner dialog element\n\t\t_.#dialog = _.querySelector('dialog');\n\n\t\tif (!_.#dialog) {\n\t\t\tconsole.warn(\n\t\t\t\t'DialogPanel: No <dialog> element found inside <dialog-panel>'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Auto-create dialog-backdrop if not present\n\t\tif (!_.querySelector('dialog-backdrop')) {\n\t\t\tconst backdrop = document.createElement('dialog-backdrop');\n\t\t\t_.insertBefore(backdrop, _.firstChild);\n\t\t}\n\n\t\t// Set initial state attribute\n\t\t_.#setState('hidden');\n\n\t\t// Bind event handlers\n\t\t_.#bindEvents();\n\t}\n\n\tdisconnectedCallback() {\n\t\tconst _ = this;\n\n\t\t// Cancel pending animations\n\t\tif (_.#pendingRAF) {\n\t\t\tcancelAnimationFrame(_.#pendingRAF);\n\t\t\t_.#pendingRAF = null;\n\t\t}\n\t\tif (_.#pendingTimeout) {\n\t\t\tclearTimeout(_.#pendingTimeout);\n\t\t\t_.#pendingTimeout = null;\n\t\t}\n\n\t\t// Clean up event listeners\n\t\tif (_.#handlers.click) {\n\t\t\t_.removeEventListener('click', _.#handlers.click);\n\t\t}\n\t\tif (_.#dialog) {\n\t\t\tif (_.#handlers.dialogClick) {\n\t\t\t\t_.#dialog.removeEventListener(\n\t\t\t\t\t'click',\n\t\t\t\t\t_.#handlers.dialogClick\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (_.#handlers.cancel) {\n\t\t\t\t_.#dialog.removeEventListener('cancel', _.#handlers.cancel);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bind event listeners for close buttons, backdrop, and escape key\n\t * @private\n\t */\n\t#bindEvents() {\n\t\tconst _ = this;\n\n\t\t// Handle close buttons with data-action-hide-dialog\n\t\t_.#handlers.click = (e) => {\n\t\t\tconst trigger = e.target.closest('[data-action-hide-dialog]');\n\t\t\tif (trigger) {\n\t\t\t\te.stopPropagation();\n\t\t\t\t_.hide(trigger);\n\t\t\t}\n\t\t};\n\t\t_.addEventListener('click', _.#handlers.click);\n\n\t\t// Handle backdrop click - detect clicks outside dialog bounds\n\t\t// This works because clicks on ::backdrop still fire on the dialog element\n\t\t_.#handlers.dialogClick = (e) => {\n\t\t\tconst rect = _.#dialog.getBoundingClientRect();\n\t\t\tconst clickedOutside =\n\t\t\t\te.clientX < rect.left ||\n\t\t\t\te.clientX > rect.right ||\n\t\t\t\te.clientY < rect.top ||\n\t\t\t\te.clientY > rect.bottom;\n\t\t\tif (clickedOutside) {\n\t\t\t\te.stopPropagation();\n\t\t\t\t_.hide();\n\t\t\t}\n\t\t};\n\t\t_.#dialog.addEventListener('click', _.#handlers.dialogClick);\n\n\t\t// Handle escape key - intercept native cancel and animate close\n\t\t_.#handlers.cancel = (e) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\t_.hide();\n\t\t};\n\t\t_.#dialog.addEventListener('cancel', _.#handlers.cancel);\n\t}\n\n\t/**\n\t * Show the dialog with animation\n\t * @param {HTMLElement} [triggerEl=null] - The element that triggered the show\n\t * @returns {boolean} False if show was prevented via beforeShow event\n\t */\n\tshow(triggerEl = null) {\n\t\tconst _ = this;\n\n\t\t// Check if already showing/shown\n\t\tif (_.#state === 'showing' || _.#state === 'shown') return true;\n\n\t\t// If currently hiding, ignore (let hide complete first)\n\t\tif (_.#state === 'hiding') return false;\n\n\t\t// Store trigger element for focus return later\n\t\t_.#triggerElement = triggerEl || null;\n\n\t\t// Fire beforeShow (cancelable)\n\t\tif (!_.#emit('beforeShow', { cancelable: true })) return false;\n\n\t\t// Set state to 'showing' and open native dialog\n\t\t_.#setState('showing');\n\t\t_.#dialog.showModal();\n\n\t\t// Double RAF ensures browser has painted the 'showing' state\n\t\t// before we transition to 'shown'\n\t\t_.#pendingRAF = requestAnimationFrame(() => {\n\t\t\t_.#pendingRAF = requestAnimationFrame(() => {\n\t\t\t\t_.#pendingRAF = null;\n\t\t\t\t_.#setState('shown');\n\n\t\t\t\t// Wait for transition to complete before firing 'shown' event\n\t\t\t\t_.#waitForTransition(() => {\n\t\t\t\t\t_.#emit('shown');\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Hide the dialog with animation\n\t * @param {HTMLElement} [triggerEl=null] - The element that triggered the hide\n\t * @returns {boolean} False if hide was prevented via beforeHide event\n\t */\n\thide(triggerEl = null) {\n\t\tconst _ = this;\n\n\t\t// Check if already hiding/hidden\n\t\tif (_.#state === 'hiding' || _.#state === 'hidden') return true;\n\n\t\t// If currently showing, ignore (let show complete first)\n\t\tif (_.#state === 'showing') return false;\n\n\t\t// Capture result from trigger element\n\t\t_.#result = triggerEl?.dataset?.result ?? null;\n\n\t\t// Fire beforeHide (cancelable)\n\t\tif (\n\t\t\t!_.#emit('beforeHide', {\n\t\t\t\tcancelable: true,\n\t\t\t\tresult: _.#result,\n\t\t\t\ttriggerElement: triggerEl,\n\t\t\t})\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set state to 'hiding' - this triggers CSS exit animation\n\t\t_.#setState('hiding');\n\n\t\t// Wait for transition to complete\n\t\t_.#waitForTransition(() => {\n\t\t\t_.#dialog.close();\n\t\t\t_.#setState('hidden');\n\t\t\t_.#emit('hidden', {\n\t\t\t\tresult: _.#result,\n\t\t\t\ttriggerElement: triggerEl,\n\t\t\t});\n\n\t\t\t// Return focus to trigger element\n\t\t\tif (_.#triggerElement) _.#triggerElement.focus();\n\n\t\t\t// Clean up\n\t\t\t_.#triggerElement = null;\n\t\t\t_.#result = null;\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Wait for CSS transition to complete with fallback timeout\n\t * @param {Function} callback - Called when transition completes\n\t * @private\n\t */\n\t#waitForTransition(callback) {\n\t\tconst _ = this;\n\t\tlet called = false;\n\n\t\tconst done = () => {\n\t\t\tif (called) return;\n\t\t\tcalled = true;\n\t\t\t_.#dialog.removeEventListener('transitionend', onTransitionEnd);\n\t\t\tif (_.#pendingTimeout) {\n\t\t\t\tclearTimeout(_.#pendingTimeout);\n\t\t\t\t_.#pendingTimeout = null;\n\t\t\t}\n\t\t\tcallback();\n\t\t};\n\n\t\tconst onTransitionEnd = (e) => {\n\t\t\tif (e.target === _.#dialog) done();\n\t\t};\n\n\t\t_.#dialog.addEventListener('transitionend', onTransitionEnd);\n\n\t\t_.#pendingTimeout = setTimeout(\n\t\t\tdone,\n\t\t\tDialogPanel.TRANSITION_FALLBACK_TIMEOUT\n\t\t);\n\t}\n\n\t/**\n\t * Set the component state\n\t * @param {string} newState - The new state\n\t * @private\n\t */\n\t#setState(newState) {\n\t\tthis.#state = newState;\n\t\tthis.setAttribute('state', newState);\n\t}\n\n\t/**\n\t * Emit a custom event\n\t * @param {string} name - Event name\n\t * @param {Object} options - Event options\n\t * @returns {boolean} False if event was cancelled\n\t * @private\n\t */\n\t#emit(name, options = {}) {\n\t\tconst _ = this;\n\t\tconst { cancelable = false, ...detail } = options;\n\n\t\tconst event = new CustomEvent(name, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tcancelable,\n\t\t\tdetail: {\n\t\t\t\ttriggerElement: _.#triggerElement,\n\t\t\t\tresult: _.#result,\n\t\t\t\tstate: _.#state,\n\t\t\t\t...detail,\n\t\t\t},\n\t\t});\n\n\t\treturn _.dispatchEvent(event);\n\t}\n\n\t// Read-only properties\n\tget state() {\n\t\treturn this.#state;\n\t}\n\tget dialog() {\n\t\treturn this.#dialog;\n\t}\n\tget isOpen() {\n\t\treturn this.#state === 'showing' || this.#state === 'shown';\n\t}\n\tget triggerElement() {\n\t\treturn this.#triggerElement;\n\t}\n}\n\n/**\n * DialogBackdrop - A custom backdrop element that animates with the dialog-panel state.\n * Use this instead of native ::backdrop for consistent cross-browser animations.\n *\n * @extends HTMLElement\n */\nclass DialogBackdrop extends HTMLElement {\n\t#panel = null;\n\t#handlers = {\n\t\tclick: null,\n\t};\n\n\tconnectedCallback() {\n\t\tconst _ = this;\n\n\t\t// Find parent dialog-panel\n\t\t_.#panel = _.closest('dialog-panel');\n\n\t\tif (!_.#panel) {\n\t\t\tconsole.warn(\n\t\t\t\t'DialogBackdrop: Must be inside a <dialog-panel> element'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Handle click to close\n\t\t_.#handlers.click = () => {\n\t\t\t_.#panel.hide();\n\t\t};\n\t\t_.addEventListener('click', _.#handlers.click);\n\t}\n\n\tdisconnectedCallback() {\n\t\tconst _ = this;\n\t\tif (_.#handlers.click) {\n\t\t\t_.removeEventListener('click', _.#handlers.click);\n\t\t}\n\t}\n}\n\n// Register the custom elements\n// Note: dialog-backdrop must be defined BEFORE dialog-panel,\n// because dialog-panel's connectedCallback may create dialog-backdrop elements\nif (!customElements.get('dialog-backdrop')) {\n\tcustomElements.define('dialog-backdrop', DialogBackdrop);\n}\nif (!customElements.get('dialog-panel')) {\n\tcustomElements.define('dialog-panel', DialogPanel);\n}\n\nexport { DialogPanel, DialogBackdrop };\n"],"names":[],"mappings":";;;;;;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,MAAM,WAAW,SAAS,WAAW,CAAC;CACtC;CACA,CAAC,MAAM,GAAG,QAAQ,CAAC;CACnB,CAAC,eAAe,GAAG,IAAI,CAAC;CACxB,CAAC,OAAO,GAAG,IAAI,CAAC;CAChB,CAAC,OAAO,GAAG,IAAI,CAAC;AAChB;CACA;CACA,CAAC,SAAS,GAAG;CACb,EAAE,KAAK,EAAE,IAAI;CACb,EAAE,WAAW,EAAE,IAAI;CACnB,EAAE,MAAM,EAAE,IAAI;CACd,EAAE,CAAC;AACH;CACA;CACA,CAAC,WAAW,GAAG,IAAI,CAAC;CACpB,CAAC,eAAe,GAAG,IAAI,CAAC;AACxB;CACA;CACA,CAAC,OAAO,2BAA2B,GAAG,GAAG,CAAC;AAC1C;CACA,CAAC,iBAAiB,GAAG;CACrB,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;AACjB;CACA;CACA,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACxC;CACA,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE;CAClB,GAAG,OAAO,CAAC,IAAI;CACf,IAAI,8DAA8D;CAClE,IAAI,CAAC;CACL,GAAG,OAAO;CACV,GAAG;AACH;CACA;CACA,EAAE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AAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;CACpD;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dialog-panel.js","sources":["../src/dialog-panel.js"],"sourcesContent":["import './dialog-panel.css';\n\n/**\n * DialogPanel - A lightweight web component wrapper for native <dialog> elements\n * with state-driven animations.\n *\n * @extends HTMLElement\n *\n * @property {string} state - Current state: 'hidden' | 'showing' | 'shown' | 'hiding'\n * @property {HTMLDialogElement} dialog - Reference to inner <dialog> element\n * @property {boolean} isOpen - True if state is 'showing' or 'shown'\n * @property {HTMLElement|null} triggerElement - Element that triggered current action\n * @property {Object|null} morphEngine - Optional duck-typed morph transition engine\n *\n * @fires beforeShow - Fired before showing starts (cancelable)\n * @fires shown - Fired after show animation completes\n * @fires beforeHide - Fired before hiding starts (cancelable)\n * @fires hidden - Fired after hide animation completes\n */\nclass DialogPanel extends HTMLElement {\n\t// Private fields\n\t#state = 'hidden';\n\t#triggerElement = null;\n\t#dialog = null;\n\t#result = null;\n\t#hideTriggerElement = null;\n\t#morphEngine = null;\n\t#morphListenersAttached = false;\n\n\t// Event handler references for cleanup\n\t#handlers = {\n\t\tclick: null,\n\t\tdialogClick: null,\n\t\tcancel: null,\n\t\tclose: null,\n\t\tmorphShown: null,\n\t\tmorphHidden: null,\n\t\tmorphStop: null,\n\t};\n\n\t// Animation cleanup references\n\t#pendingRAF = null;\n\t#pendingTimeout = null;\n\n\t// Fallback timeout for transitionend (in ms)\n\tstatic TRANSITION_FALLBACK_TIMEOUT = 700;\n\n\tconnectedCallback() {\n\t\tconst _ = this;\n\n\t\t// Find inner dialog element\n\t\t_.#dialog = _.querySelector('dialog');\n\n\t\tif (!_.#dialog) {\n\t\t\tconsole.warn(\n\t\t\t\t'DialogPanel: No <dialog> element found inside <dialog-panel>'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Auto-create dialog-backdrop if not present\n\t\tif (!_.querySelector('dialog-backdrop')) {\n\t\t\tconst backdrop = document.createElement('dialog-backdrop');\n\t\t\t_.insertBefore(backdrop, _.firstChild);\n\t\t}\n\n\t\t// Set initial state attribute\n\t\t_.#setState('hidden');\n\n\t\t// Bind event handlers\n\t\t_.#bindEvents();\n\t\t_.#wireMorphEngine();\n\t}\n\n\tdisconnectedCallback() {\n\t\tconst _ = this;\n\n\t\t// Cancel pending animations\n\t\tif (_.#pendingRAF) {\n\t\t\tcancelAnimationFrame(_.#pendingRAF);\n\t\t\t_.#pendingRAF = null;\n\t\t}\n\t\tif (_.#pendingTimeout) {\n\t\t\tclearTimeout(_.#pendingTimeout);\n\t\t\t_.#pendingTimeout = null;\n\t\t}\n\t\t_.#unwireMorphEngine();\n\n\t\t// Clean up event listeners\n\t\tif (_.#handlers.click) {\n\t\t\t_.removeEventListener('click', _.#handlers.click);\n\t\t}\n\t\tif (_.#dialog) {\n\t\t\tif (_.#handlers.dialogClick) {\n\t\t\t\t_.#dialog.removeEventListener(\n\t\t\t\t\t'click',\n\t\t\t\t\t_.#handlers.dialogClick\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (_.#handlers.cancel) {\n\t\t\t\t_.#dialog.removeEventListener('cancel', _.#handlers.cancel);\n\t\t\t}\n\t\t\tif (_.#handlers.close) {\n\t\t\t\t_.#dialog.removeEventListener('close', _.#handlers.close);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Bind event listeners for close buttons, backdrop, and escape key\n\t * @private\n\t */\n\t#bindEvents() {\n\t\tconst _ = this;\n\n\t\t// Handle close buttons with data-action-hide-dialog\n\t\t_.#handlers.click = (e) => {\n\t\t\tconst trigger = e.target.closest('[data-action-hide-dialog]');\n\t\t\tif (trigger) {\n\t\t\t\te.stopPropagation();\n\t\t\t\t_.hide(trigger);\n\t\t\t}\n\t\t};\n\t\t_.addEventListener('click', _.#handlers.click);\n\n\t\t// Handle backdrop click - detect clicks outside dialog bounds\n\t\t// This works because clicks on ::backdrop still fire on the dialog element\n\t\t_.#handlers.dialogClick = (e) => {\n\t\t\tconst rect = _.#dialog.getBoundingClientRect();\n\t\t\tconst clickedOutside =\n\t\t\t\te.clientX < rect.left ||\n\t\t\t\te.clientX > rect.right ||\n\t\t\t\te.clientY < rect.top ||\n\t\t\t\te.clientY > rect.bottom;\n\t\t\tif (clickedOutside) {\n\t\t\t\te.stopPropagation();\n\t\t\t\t_.hide();\n\t\t\t}\n\t\t};\n\t\t_.#dialog.addEventListener('click', _.#handlers.dialogClick);\n\n\t\t// Handle escape key - intercept native cancel and animate close\n\t\t_.#handlers.cancel = (e) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\t_.hide();\n\t\t};\n\t\t_.#dialog.addEventListener('cancel', _.#handlers.cancel);\n\n\t\t// Cover browser force-close paths that bypass the cancel event\n\t\t_.#handlers.close = () => {\n\t\t\tif (\n\t\t\t\t_.#morphEngine?.state === 'shown' &&\n\t\t\t\t_.#state === 'shown' &&\n\t\t\t\t!_.#dialog.open\n\t\t\t) {\n\t\t\t\t_.hide();\n\t\t\t}\n\t\t};\n\t\t_.#dialog.addEventListener('close', _.#handlers.close);\n\t}\n\n\t/**\n\t * Wire morph engine lifecycle listeners\n\t * @private\n\t */\n\t#wireMorphEngine() {\n\t\tconst _ = this;\n\n\t\tif (!_.#morphEngine || _.#morphListenersAttached) return;\n\n\t\tif (!_.#handlers.morphShown) {\n\t\t\t_.#handlers.morphShown = _.#handleMorphShown.bind(_);\n\t\t\t_.#handlers.morphHidden = _.#handleMorphHidden.bind(_);\n\t\t\t_.#handlers.morphStop = _.#handleMorphStop.bind(_);\n\t\t}\n\n\t\t_.#morphEngine.on('shown', _.#handlers.morphShown);\n\t\t_.#morphEngine.on('hidden', _.#handlers.morphHidden);\n\t\t_.#morphEngine.on('stop', _.#handlers.morphStop);\n\t\t_.#morphListenersAttached = true;\n\t}\n\n\t/**\n\t * Unwire morph engine lifecycle listeners\n\t * @private\n\t */\n\t#unwireMorphEngine() {\n\t\tconst _ = this;\n\n\t\tif (!_.#morphEngine || !_.#morphListenersAttached) return;\n\n\t\t_.#morphEngine.off('shown', _.#handlers.morphShown);\n\t\t_.#morphEngine.off('hidden', _.#handlers.morphHidden);\n\t\t_.#morphEngine.off('stop', _.#handlers.morphStop);\n\t\t_.#morphListenersAttached = false;\n\t}\n\n\t/**\n\t * Promote the settled morph target into the dialog top layer\n\t * @private\n\t */\n\t#handleMorphShown() {\n\t\tconst _ = this;\n\n\t\tif (!_.#dialog.open) _.#dialog.showModal();\n\t\t_.#setState('shown');\n\t\t_.#emit('shown');\n\t}\n\n\t/**\n\t * Finalize a settled morph hide\n\t * @private\n\t */\n\t#handleMorphHidden() {\n\t\tthis.#finalizeMorphHide();\n\t}\n\n\t/**\n\t * Finalize an interrupted morph as hidden\n\t * @private\n\t */\n\t#handleMorphStop() {\n\t\tthis.#finalizeMorphHide();\n\t}\n\n\t/**\n\t * Restore the component's hidden state after a morph ends\n\t * @private\n\t */\n\t#finalizeMorphHide() {\n\t\tconst _ = this;\n\n\t\tif (_.#dialog.open) _.#dialog.close();\n\t\t_.#setState('hidden');\n\t\t_.#emit('hidden', {\n\t\t\tresult: _.#result,\n\t\t\ttriggerElement: _.#hideTriggerElement,\n\t\t});\n\n\t\t// Return focus to trigger element\n\t\tif (_.#triggerElement) _.#triggerElement.focus();\n\n\t\t// Clean up\n\t\t_.#triggerElement = null;\n\t\t_.#hideTriggerElement = null;\n\t\t_.#result = null;\n\t}\n\n\t/**\n\t * Show the dialog with animation\n\t * @param {HTMLElement} [triggerEl=null] - The element that triggered the show\n\t * @returns {boolean} False if show was prevented via beforeShow event\n\t */\n\tshow(triggerEl = null) {\n\t\tconst _ = this;\n\n\t\t// Check if already showing/shown\n\t\tif (_.#state === 'showing' || _.#state === 'shown') return true;\n\n\t\tconst reversingMorph =\n\t\t\t_.#state === 'hiding' && _.#morphEngine?.state === 'hiding';\n\n\t\t// CSS transitions cannot reverse while hiding\n\t\tif (_.#state === 'hiding' && !reversingMorph) return false;\n\n\t\t// Store trigger element for focus return later\n\t\tif (!reversingMorph) _.#triggerElement = triggerEl || null;\n\n\t\t// Fire beforeShow (cancelable)\n\t\tif (!_.#emit('beforeShow', { cancelable: true })) return false;\n\n\t\tif (reversingMorph) {\n\t\t\t_.#hideTriggerElement = null;\n\t\t\t_.#result = null;\n\t\t}\n\n\t\t// Set state to 'showing'\n\t\t_.#setState('showing');\n\n\t\tif (_.#morphEngine && (triggerEl || reversingMorph)) {\n\t\t\t_.#morphEngine.show({\n\t\t\t\tfrom: _.#triggerElement,\n\t\t\t\tto: _.#dialog,\n\t\t\t\tdisplay: _.getAttribute('morph-display') || 'block',\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\n\t\t// Open native dialog for the CSS transition path\n\t\t_.#dialog.showModal();\n\n\t\t// Double RAF ensures browser has painted the 'showing' state\n\t\t// before we transition to 'shown'\n\t\t_.#pendingRAF = requestAnimationFrame(() => {\n\t\t\t_.#pendingRAF = requestAnimationFrame(() => {\n\t\t\t\t_.#pendingRAF = null;\n\t\t\t\t_.#setState('shown');\n\n\t\t\t\t// Wait for transition to complete before firing 'shown' event\n\t\t\t\t_.#waitForTransition(() => {\n\t\t\t\t\t_.#emit('shown');\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Hide the dialog with animation\n\t * @param {HTMLElement} [triggerEl=null] - The element that triggered the hide\n\t * @returns {boolean} False if hide was prevented via beforeHide event\n\t */\n\thide(triggerEl = null) {\n\t\tconst _ = this;\n\n\t\t// Check if already hiding/hidden\n\t\tif (_.#state === 'hiding' || _.#state === 'hidden') return true;\n\n\t\tconst reversingMorph =\n\t\t\t_.#state === 'showing' && _.#morphEngine?.state === 'showing';\n\n\t\t// CSS transitions cannot reverse while showing\n\t\tif (_.#state === 'showing' && !reversingMorph) return false;\n\n\t\t// Capture result from trigger element\n\t\t_.#result = triggerEl?.dataset?.result ?? null;\n\n\t\t// Fire beforeHide (cancelable)\n\t\tif (\n\t\t\t!_.#emit('beforeHide', {\n\t\t\t\tcancelable: true,\n\t\t\t\tresult: _.#result,\n\t\t\t\ttriggerElement: triggerEl,\n\t\t\t})\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (reversingMorph || _.#morphEngine?.state === 'shown') {\n\t\t\t_.#hideTriggerElement = triggerEl;\n\t\t\tif (_.#dialog.open) _.#dialog.close();\n\t\t\t_.#morphEngine.hide();\n\t\t\t_.#setState('hiding');\n\t\t\treturn true;\n\t\t}\n\n\t\t// Set state to 'hiding' - this triggers CSS exit animation\n\t\t_.#setState('hiding');\n\n\t\t// Wait for transition to complete\n\t\t_.#waitForTransition(() => {\n\t\t\t_.#dialog.close();\n\t\t\t_.#setState('hidden');\n\t\t\t_.#emit('hidden', {\n\t\t\t\tresult: _.#result,\n\t\t\t\ttriggerElement: triggerEl,\n\t\t\t});\n\n\t\t\t// Return focus to trigger element\n\t\t\tif (_.#triggerElement) _.#triggerElement.focus();\n\n\t\t\t// Clean up\n\t\t\t_.#triggerElement = null;\n\t\t\t_.#result = null;\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Wait for CSS transition to complete with fallback timeout\n\t * @param {Function} callback - Called when transition completes\n\t * @private\n\t */\n\t#waitForTransition(callback) {\n\t\tconst _ = this;\n\t\tlet called = false;\n\t\tlet timerId = null;\n\n\t\tconst done = () => {\n\t\t\tif (called) return;\n\t\t\tcalled = true;\n\t\t\t_.#dialog.removeEventListener('transitionend', onTransitionEnd);\n\t\t\t// clear only our own timer — clearing the shared field would let an\n\t\t\t// earlier, still-pending wait cancel a later wait's fallback\n\t\t\tclearTimeout(timerId);\n\t\t\tif (_.#pendingTimeout === timerId) _.#pendingTimeout = null;\n\t\t\tcallback();\n\t\t};\n\n\t\tconst onTransitionEnd = (e) => {\n\t\t\tif (e.target === _.#dialog) done();\n\t\t};\n\n\t\t_.#dialog.addEventListener('transitionend', onTransitionEnd);\n\n\t\ttimerId = setTimeout(done, DialogPanel.TRANSITION_FALLBACK_TIMEOUT);\n\t\t_.#pendingTimeout = timerId;\n\t}\n\n\t/**\n\t * Set the component state\n\t * @param {string} newState - The new state\n\t * @private\n\t */\n\t#setState(newState) {\n\t\tthis.#state = newState;\n\t\tthis.setAttribute('state', newState);\n\t}\n\n\t/**\n\t * Emit a custom event\n\t * @param {string} name - Event name\n\t * @param {Object} options - Event options\n\t * @returns {boolean} False if event was cancelled\n\t * @private\n\t */\n\t#emit(name, options = {}) {\n\t\tconst _ = this;\n\t\tconst { cancelable = false, ...detail } = options;\n\n\t\tconst event = new CustomEvent(name, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tcancelable,\n\t\t\tdetail: {\n\t\t\t\ttriggerElement: _.#triggerElement,\n\t\t\t\tresult: _.#result,\n\t\t\t\tstate: _.#state,\n\t\t\t\t...detail,\n\t\t\t},\n\t\t});\n\n\t\treturn _.dispatchEvent(event);\n\t}\n\n\t/**\n\t * Optional morph transition transport\n\t * @returns {Object|null} The attached morph engine\n\t */\n\tget morphEngine() {\n\t\treturn this.#morphEngine;\n\t}\n\n\t/**\n\t * Attach or remove a duck-typed morph transition engine\n\t * @param {Object|null} engine - Engine with show, hide, state, on, and off\n\t */\n\tset morphEngine(engine) {\n\t\tconst _ = this;\n\n\t\tif (_.#morphEngine === engine) return;\n\n\t\t_.#unwireMorphEngine();\n\t\t_.#morphEngine = engine || null;\n\n\t\tif (_.#morphEngine) {\n\t\t\t_.setAttribute('morph', '');\n\t\t\t_.#wireMorphEngine();\n\t\t} else {\n\t\t\t_.removeAttribute('morph');\n\t\t}\n\t}\n\n\t// Read-only properties\n\tget state() {\n\t\treturn this.#state;\n\t}\n\tget dialog() {\n\t\treturn this.#dialog;\n\t}\n\tget isOpen() {\n\t\treturn this.#state === 'showing' || this.#state === 'shown';\n\t}\n\tget triggerElement() {\n\t\treturn this.#triggerElement;\n\t}\n}\n\n/**\n * DialogBackdrop - A custom backdrop element that animates with the dialog-panel state.\n * Use this instead of native ::backdrop for consistent cross-browser animations.\n *\n * @extends HTMLElement\n */\nclass DialogBackdrop extends HTMLElement {\n\t#panel = null;\n\t#handlers = {\n\t\tclick: null,\n\t};\n\n\tconnectedCallback() {\n\t\tconst _ = this;\n\n\t\t// Find parent dialog-panel\n\t\t_.#panel = _.closest('dialog-panel');\n\n\t\tif (!_.#panel) {\n\t\t\tconsole.warn(\n\t\t\t\t'DialogBackdrop: Must be inside a <dialog-panel> element'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Handle click to close\n\t\t_.#handlers.click = () => {\n\t\t\t_.#panel.hide();\n\t\t};\n\t\t_.addEventListener('click', _.#handlers.click);\n\t}\n\n\tdisconnectedCallback() {\n\t\tconst _ = this;\n\t\tif (_.#handlers.click) {\n\t\t\t_.removeEventListener('click', _.#handlers.click);\n\t\t}\n\t}\n}\n\n// Register the custom elements\n// Note: dialog-backdrop must be defined BEFORE dialog-panel,\n// because dialog-panel's connectedCallback may create dialog-backdrop elements\nif (!customElements.get('dialog-backdrop')) {\n\tcustomElements.define('dialog-backdrop', DialogBackdrop);\n}\nif (!customElements.get('dialog-panel')) {\n\tcustomElements.define('dialog-panel', DialogPanel);\n}\n\nexport { DialogPanel, DialogBackdrop };\n"],"names":[],"mappings":";;;;;;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,MAAM,WAAW,SAAS,WAAW,CAAC;CACtC;CACA,CAAC,MAAM,GAAG,QAAQ,CAAC;CACnB,CAAC,eAAe,GAAG,IAAI,CAAC;CACxB,CAAC,OAAO,GAAG,IAAI,CAAC;CAChB,CAAC,OAAO,GAAG,IAAI,CAAC;CAChB,CAAC,mBAAmB,GAAG,IAAI,CAAC;CAC5B,CAAC,YAAY,GAAG,IAAI,CAAC;CACrB,CAAC,uBAAuB,GAAG,KAAK,CAAC;AACjC;CACA;CACA,CAAC,SAAS,GAAG;CACb,EAAE,KAAK,EAAE,IAAI;CACb,EAAE,WAAW,EAAE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I,CAAC;AACjB;CACA;CACA,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AACvC;CACA,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE;CACjB,GAAG,OAAO,CAAC,IAAI;CACf,IAAI,yDAAyD;CAC7D,IAAI,CAAC;CACL,GAAG,OAAO;CACV,GAAG;AACH;CACA;CACA,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,GAAG,MAAM;CAC5B,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;CACnB,GAAG,CAAC;CACJ,EAAE,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;CACjD,EAAE;AACF;CACA,CAAC,oBAAoB,GAAG;CACxB,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CACjB,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE;CACzB,GAAG,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;CACrD,GAAG;CACH,EAAE;CACF,CAAC;AACD;CACA;CACA;CACA;CACA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;CAC5C,CAAC,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;CAC1D,CAAC;CACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;CACzC,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;CACpD;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
dialog-panel{display:contents}dialog-panel>dialog{border:none;box-shadow:0 10px 25px rgba(0,0,0,.15);max-height:85vh;max-width:32rem;opacity:0;overflow:visible;padding:0;transform:scale(.95);transition:opacity .3s ease-out,transform .3s ease-out;width:90vw}dialog-panel:has(dialog-backdrop)>dialog::backdrop{background:transparent}dialog-panel:not(:has(dialog-backdrop))>dialog::backdrop{background:rgba(0,0,0,.3);opacity:0;transition:opacity .3s ease-out}dialog-backdrop{background:rgba(0,0,0,.3);height:200dvh;left:50%;opacity:0;pointer-events:none;position:fixed;top:50%;transform:translateY(-50%) translateX(-50%);transition:opacity .3s ease-out;width:200vw;z-index:9999999}dialog-panel[state=showing]>dialog{opacity:0;transform:scale(.95)}dialog-panel:not(:has(dialog-backdrop))[state=showing]>dialog::backdrop{opacity:0}dialog-panel[state=shown]>dialog{opacity:1;transform:scale(1)}dialog-panel:not(:has(dialog-backdrop))[state=shown]>dialog::backdrop{opacity:1}dialog-panel[state=hiding]>dialog{opacity:0;transform:scale(.95);transition:opacity .2s ease-in,transform .2s ease-in}dialog-panel:not(:has(dialog-backdrop))[state=hiding]>dialog::backdrop{opacity:0;transition:opacity .2s ease-in}dialog-panel[state=hidden]>dialog-backdrop,dialog-panel[state=showing]>dialog-backdrop{opacity:0;pointer-events:none}dialog-panel[state=shown]>dialog-backdrop{opacity:1;pointer-events:auto}dialog-panel[state=hiding]>dialog-backdrop{opacity:0;pointer-events:none;transition:opacity .2s ease-in}dialog-panel[position=
|
|
1
|
+
dialog-panel{display:contents}dialog-panel>dialog{border:none;box-shadow:0 10px 25px rgba(0,0,0,.15);max-height:85vh;max-width:32rem;opacity:0;overflow:visible;padding:0;transform:scale(.95);transition:opacity .3s ease-out,transform .3s ease-out;width:90vw}dialog-panel:has(dialog-backdrop)>dialog::backdrop{background:transparent}dialog-panel:not(:has(dialog-backdrop))>dialog::backdrop{background:rgba(0,0,0,.3);opacity:0;transition:opacity .3s ease-out}dialog-backdrop{background:rgba(0,0,0,.3);height:200dvh;left:50%;opacity:0;pointer-events:none;position:fixed;top:50%;transform:translateY(-50%) translateX(-50%);transition:opacity .3s ease-out;width:200vw;z-index:9999999}dialog-panel[state=showing]>dialog{opacity:0;transform:scale(.95)}dialog-panel:not(:has(dialog-backdrop))[state=showing]>dialog::backdrop{opacity:0}dialog-panel[state=shown]>dialog{opacity:1;transform:scale(1)}dialog-panel:not(:has(dialog-backdrop))[state=shown]>dialog::backdrop{opacity:1}dialog-panel[state=hiding]>dialog{opacity:0;transform:scale(.95);transition:opacity .2s ease-in,transform .2s ease-in}dialog-panel:not(:has(dialog-backdrop))[state=hiding]>dialog::backdrop{opacity:0;transition:opacity .2s ease-in}dialog-panel[state=hidden]>dialog-backdrop,dialog-panel[state=showing]>dialog-backdrop{opacity:0;pointer-events:none}dialog-panel[state=shown]>dialog-backdrop{opacity:1;pointer-events:auto}dialog-panel[state=hiding]>dialog-backdrop{opacity:0;pointer-events:none;transition:opacity .2s ease-in}dialog-panel[position=bottom]>dialog,dialog-panel[position=left]>dialog,dialog-panel[position=right]>dialog,dialog-panel[position=top]>dialog{margin:0;max-width:100%;opacity:1;position:fixed}dialog-panel[position=top]>dialog{bottom:auto;left:0;max-height:85vh;right:0;top:0;transform:translateY(-100%);width:100%}dialog-panel[position=top][state=shown]>dialog{transform:translateY(0)}dialog-panel[position=bottom]>dialog{bottom:0;left:0;max-height:85vh;right:0;top:auto;transform:translateY(100%);width:100%}dialog-panel[position=bottom][state=shown]>dialog{transform:translateY(0)}dialog-panel[position=left]>dialog{bottom:0;height:100dvh;left:0;max-height:100dvh;right:auto;top:0;transform:translateX(-100%);width:min(24rem,90vw)}dialog-panel[position=left][state=shown]>dialog{transform:translateX(0)}dialog-panel[position=right]>dialog{bottom:0;height:100dvh;left:auto;max-height:100dvh;right:0;top:0;transform:translateX(100%);width:min(24rem,90vw)}dialog-panel[position=right][state=shown]>dialog{transform:translateX(0)}body:has(dialog-panel[state=hiding]),body:has(dialog-panel[state=showing]),body:has(dialog-panel[state=shown]){overflow:hidden}dialog-panel[morph]>dialog,dialog-panel[morph][state]>dialog{inset:0;margin:auto;max-height:none;max-width:none;opacity:1;position:fixed;transform:none;transition:none}dialog-panel[morph][state=showing]>dialog-backdrop{opacity:1;pointer-events:auto}
|
package/dist/dialog-panel.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).DialogPanel={})}(this,function(e){"use strict";class DialogPanel extends HTMLElement{#e="hidden";#n=null;#t=null;#i=null;#l=null;#o=null;#r=!1;#s={click:null,dialogClick:null,cancel:null,close:null,morphShown:null,morphHidden:null,morphStop:null};#a=null;#d=null;static TRANSITION_FALLBACK_TIMEOUT=700;connectedCallback(){const e=this;if(e.#t=e.querySelector("dialog"),e.#t){if(!e.querySelector("dialog-backdrop")){const n=document.createElement("dialog-backdrop");e.insertBefore(n,e.firstChild)}e.#h("hidden"),e.#g(),e.#c()}else console.warn("DialogPanel: No <dialog> element found inside <dialog-panel>")}disconnectedCallback(){const e=this;e.#a&&(cancelAnimationFrame(e.#a),e.#a=null),e.#d&&(clearTimeout(e.#d),e.#d=null),e.#p(),e.#s.click&&e.removeEventListener("click",e.#s.click),e.#t&&(e.#s.dialogClick&&e.#t.removeEventListener("click",e.#s.dialogClick),e.#s.cancel&&e.#t.removeEventListener("cancel",e.#s.cancel),e.#s.close&&e.#t.removeEventListener("close",e.#s.close))}#g(){const e=this;e.#s.click=n=>{const t=n.target.closest("[data-action-hide-dialog]");t&&(n.stopPropagation(),e.hide(t))},e.addEventListener("click",e.#s.click),e.#s.dialogClick=n=>{const t=e.#t.getBoundingClientRect();(n.clientX<t.left||n.clientX>t.right||n.clientY<t.top||n.clientY>t.bottom)&&(n.stopPropagation(),e.hide())},e.#t.addEventListener("click",e.#s.dialogClick),e.#s.cancel=n=>{n.preventDefault(),n.stopPropagation(),e.hide()},e.#t.addEventListener("cancel",e.#s.cancel),e.#s.close=()=>{"shown"!==e.#o?.state||"shown"!==e.#e||e.#t.open||e.hide()},e.#t.addEventListener("close",e.#s.close)}#c(){const e=this;e.#o&&!e.#r&&(e.#s.morphShown||(e.#s.morphShown=e.#m.bind(e),e.#s.morphHidden=e.#u.bind(e),e.#s.morphStop=e.#E.bind(e)),e.#o.on("shown",e.#s.morphShown),e.#o.on("hidden",e.#s.morphHidden),e.#o.on("stop",e.#s.morphStop),e.#r=!0)}#p(){const e=this;e.#o&&e.#r&&(e.#o.off("shown",e.#s.morphShown),e.#o.off("hidden",e.#s.morphHidden),e.#o.off("stop",e.#s.morphStop),e.#r=!1)}#m(){const e=this;e.#t.open||e.#t.showModal(),e.#h("shown"),e.#w("shown")}#u(){this.#f()}#E(){this.#f()}#f(){const e=this;e.#t.open&&e.#t.close(),e.#h("hidden"),e.#w("hidden",{result:e.#i,triggerElement:e.#l}),e.#n&&e.#n.focus(),e.#n=null,e.#l=null,e.#i=null}show(e=null){const n=this;if("showing"===n.#e||"shown"===n.#e)return!0;const t="hiding"===n.#e&&"hiding"===n.#o?.state;return!("hiding"===n.#e&&!t)&&(t||(n.#n=e||null),!!n.#w("beforeShow",{cancelable:!0})&&(t&&(n.#l=null,n.#i=null),n.#h("showing"),n.#o&&(e||t)?(n.#o.show({from:n.#n,to:n.#t,display:n.getAttribute("morph-display")||"block"}),!0):(n.#t.showModal(),n.#a=requestAnimationFrame(()=>{n.#a=requestAnimationFrame(()=>{n.#a=null,n.#h("shown"),n.#k(()=>{n.#w("shown")})})}),!0)))}hide(e=null){const n=this;if("hiding"===n.#e||"hidden"===n.#e)return!0;const t="showing"===n.#e&&"showing"===n.#o?.state;return!("showing"===n.#e&&!t)&&(n.#i=e?.dataset?.result??null,!!n.#w("beforeHide",{cancelable:!0,result:n.#i,triggerElement:e})&&(t||"shown"===n.#o?.state?(n.#l=e,n.#t.open&&n.#t.close(),n.#o.hide(),n.#h("hiding"),!0):(n.#h("hiding"),n.#k(()=>{n.#t.close(),n.#h("hidden"),n.#w("hidden",{result:n.#i,triggerElement:e}),n.#n&&n.#n.focus(),n.#n=null,n.#i=null}),!0)))}#k(e){const n=this;let t=!1,i=null;const l=()=>{t||(t=!0,n.#t.removeEventListener("transitionend",o),clearTimeout(i),n.#d===i&&(n.#d=null),e())},o=e=>{e.target===n.#t&&l()};n.#t.addEventListener("transitionend",o),i=setTimeout(l,DialogPanel.TRANSITION_FALLBACK_TIMEOUT),n.#d=i}#h(e){this.#e=e,this.setAttribute("state",e)}#w(e,n={}){const t=this,{cancelable:i=!1,...l}=n,o=new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:i,detail:{triggerElement:t.#n,result:t.#i,state:t.#e,...l}});return t.dispatchEvent(o)}get morphEngine(){return this.#o}set morphEngine(e){const n=this;n.#o!==e&&(n.#p(),n.#o=e||null,n.#o?(n.setAttribute("morph",""),n.#c()):n.removeAttribute("morph"))}get state(){return this.#e}get dialog(){return this.#t}get isOpen(){return"showing"===this.#e||"shown"===this.#e}get triggerElement(){return this.#n}}class DialogBackdrop extends HTMLElement{#b=null;#s={click:null};connectedCallback(){const e=this;e.#b=e.closest("dialog-panel"),e.#b?(e.#s.click=()=>{e.#b.hide()},e.addEventListener("click",e.#s.click)):console.warn("DialogBackdrop: Must be inside a <dialog-panel> element")}disconnectedCallback(){const e=this;e.#s.click&&e.removeEventListener("click",e.#s.click)}}customElements.get("dialog-backdrop")||customElements.define("dialog-backdrop",DialogBackdrop),customElements.get("dialog-panel")||customElements.define("dialog-panel",DialogPanel),e.DialogBackdrop=DialogBackdrop,e.DialogPanel=DialogPanel});
|
package/package.json
CHANGED