@lvce-editor/renderer-process 30.64.14 → 30.65.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.
@@ -10475,9 +10475,16 @@ const setModernUi = enabled => {
10475
10475
  const state$2 = {
10476
10476
  nextNotificationId: 0
10477
10477
  };
10478
+ const pendingChoices = new WeakMap();
10479
+ const close$1 = ($Notification, choice) => {
10480
+ const resolve = pendingChoices.get($Notification);
10481
+ pendingChoices.delete($Notification);
10482
+ remove$1($Notification);
10483
+ resolve?.(choice);
10484
+ };
10478
10485
  const handleCloseClick = event => {
10479
10486
  const $CloseButton = event.currentTarget;
10480
- remove$1($CloseButton.parentNode);
10487
+ close$1($CloseButton.parentNode);
10481
10488
  };
10482
10489
  const create$NotificationMessage = message => {
10483
10490
  const $NotificationMessage = document.createElement('p');
@@ -10555,10 +10562,23 @@ const createWithOptions = (type, message, options) => {
10555
10562
  append$1($Notification);
10556
10563
  return $Notification.id;
10557
10564
  };
10565
+ const showWithOptions = (type, message, options) => {
10566
+ const $Notification = create$NotificationWithOptions(message, options);
10567
+ return new Promise(resolve => {
10568
+ pendingChoices.set($Notification, resolve);
10569
+ $Notification.onclick = event => {
10570
+ const $Target = event.target;
10571
+ if ($Target instanceof HTMLButtonElement && $Target.classList.contains('NotificationOption')) {
10572
+ close$1($Notification, findIndex($Target));
10573
+ }
10574
+ };
10575
+ append$1($Notification);
10576
+ });
10577
+ };
10558
10578
  const dispose$3 = id => {
10559
10579
  const $Notification = document.getElementById(id);
10560
10580
  if ($Notification?.classList.contains('Notification')) {
10561
- remove$1($Notification);
10581
+ close$1($Notification);
10562
10582
  }
10563
10583
  };
10564
10584
 
@@ -11874,6 +11894,7 @@ const commandMap = {
11874
11894
  'Notification.create': create$3,
11875
11895
  'Notification.createWithOptions': createWithOptions,
11876
11896
  'Notification.dispose': dispose$3,
11897
+ 'Notification.showWithOptions': showWithOptions,
11877
11898
  'ObjectUrl.create': createObjectUrl,
11878
11899
  'ObjectUrl.revoke': revokeObjectUrl,
11879
11900
  'OffscreenCanvas.create': create$2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.64.14",
3
+ "version": "30.65.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"