@lvce-editor/renderer-process 30.60.0 → 30.60.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.
@@ -1556,7 +1556,7 @@ const launchRendererWorker = async () => {
1556
1556
  };
1557
1557
 
1558
1558
  const selector = 'script.RendererWorkerTrace';
1559
- const state$h = {
1559
+ const state$i = {
1560
1560
  enabled: false,
1561
1561
  entries: []
1562
1562
  };
@@ -1606,14 +1606,14 @@ const isCommand = value => {
1606
1606
  };
1607
1607
  const initialize = search => {
1608
1608
  const searchParams = new URLSearchParams(search);
1609
- state$h.enabled = searchParams.has('traceRendererWorker');
1610
- state$h.entries = [];
1609
+ state$i.enabled = searchParams.has('traceRendererWorker');
1610
+ state$i.entries = [];
1611
1611
  };
1612
1612
  const record = (direction, method, params) => {
1613
- if (!state$h.enabled) {
1613
+ if (!state$i.enabled) {
1614
1614
  return;
1615
1615
  }
1616
- state$h.entries.push({
1616
+ state$i.entries.push({
1617
1617
  direction,
1618
1618
  method,
1619
1619
  params: serialize(params),
@@ -1621,7 +1621,7 @@ const record = (direction, method, params) => {
1621
1621
  });
1622
1622
  };
1623
1623
  const listen$1 = rpc => {
1624
- if (!state$h.enabled) {
1624
+ if (!state$i.enabled) {
1625
1625
  return;
1626
1626
  }
1627
1627
  const ipc = rpc.ipc;
@@ -1636,7 +1636,7 @@ const listen$1 = rpc => {
1636
1636
  });
1637
1637
  };
1638
1638
  const exportToDom = () => {
1639
- if (!state$h.enabled) {
1639
+ if (!state$i.enabled) {
1640
1640
  return;
1641
1641
  }
1642
1642
  const existing = document.querySelector(selector);
@@ -1644,7 +1644,7 @@ const exportToDom = () => {
1644
1644
  script.className = 'RendererWorkerTrace';
1645
1645
  script.type = 'application/json';
1646
1646
  script.textContent = JSON.stringify({
1647
- entries: state$h.entries,
1647
+ entries: state$i.entries,
1648
1648
  version: 1
1649
1649
  });
1650
1650
  if (!existing) {
@@ -1652,42 +1652,42 @@ const exportToDom = () => {
1652
1652
  }
1653
1653
  };
1654
1654
  const scheduleExport = () => {
1655
- if (!state$h.enabled) {
1655
+ if (!state$i.enabled) {
1656
1656
  return;
1657
1657
  }
1658
1658
  queueMicrotask(exportToDom);
1659
1659
  };
1660
1660
 
1661
- const state$g = {
1661
+ const state$h = {
1662
1662
  rpc: undefined
1663
1663
  };
1664
1664
  const hydrate$4 = async () => {
1665
1665
  const result = await launchRendererWorker();
1666
1666
  if (isError(result)) {
1667
- state$g.rpc = undefined;
1667
+ state$h.rpc = undefined;
1668
1668
  return result;
1669
1669
  }
1670
- state$g.rpc = result.value;
1670
+ state$h.rpc = result.value;
1671
1671
  listen$1(result.value);
1672
1672
  return success(undefined);
1673
1673
  };
1674
1674
  const send$1 = (method, ...params) => {
1675
1675
  record('sent', method, params);
1676
1676
  // @ts-ignore
1677
- state$g.rpc.send(method, ...params);
1677
+ state$h.rpc.send(method, ...params);
1678
1678
  };
1679
1679
  const invoke$1 = (method, ...params) => {
1680
1680
  record('sent', method, params);
1681
1681
  // @ts-ignore
1682
- return state$g.rpc.invoke(method, ...params);
1682
+ return state$h.rpc.invoke(method, ...params);
1683
1683
  };
1684
1684
  const invokeAndTransfer = (method, ...params) => {
1685
1685
  record('sent', method, params);
1686
1686
  // @ts-ignore
1687
- return state$g.rpc.invokeAndTransfer(method, ...params);
1687
+ return state$h.rpc.invokeAndTransfer(method, ...params);
1688
1688
  };
1689
1689
 
1690
- const state$f = {
1690
+ const state$g = {
1691
1691
  client: undefined,
1692
1692
  enabled: false,
1693
1693
  lastError: '',
@@ -1697,38 +1697,38 @@ const state$f = {
1697
1697
  const workerUrl = new URL('sessionReplayWorkerMain.js', import.meta.url);
1698
1698
  const reloadMessage = 'Reload the window to start session replay with the complete DOM command history';
1699
1699
  const report = error => {
1700
- state$f.lastError = error instanceof Error ? error.message : String(error);
1701
- state$f.stopObserving?.();
1702
- state$f.stopObserving = undefined;
1703
- console.warn(`Session replay: ${state$f.lastError}`);
1700
+ state$g.lastError = error instanceof Error ? error.message : String(error);
1701
+ state$g.stopObserving?.();
1702
+ state$g.stopObserving = undefined;
1703
+ console.warn(`Session replay: ${state$g.lastError}`);
1704
1704
  };
1705
1705
 
1706
1706
  // Retain snapshot recording for older renderer workers during dependency rollout.
1707
1707
  const configure = async options => {
1708
- state$f.stopObserving?.();
1709
- state$f.stopObserving = undefined;
1710
- state$f.enabled = false;
1711
- if (state$f.client) {
1708
+ state$g.stopObserving?.();
1709
+ state$g.stopObserving = undefined;
1710
+ state$g.enabled = false;
1711
+ if (state$g.client) {
1712
1712
  try {
1713
- await state$f.client.invoke('stop');
1713
+ await state$g.client.invoke('stop');
1714
1714
  } catch (error) {
1715
1715
  report(error);
1716
1716
  }
1717
1717
  // Live channels still need their proxy after capture stops.
1718
- if (!state$f.proxy) {
1719
- state$f.client.dispose();
1720
- state$f.client = undefined;
1718
+ if (!state$g.proxy) {
1719
+ state$g.client.dispose();
1720
+ state$g.client = undefined;
1721
1721
  }
1722
1722
  }
1723
1723
  if (!options.local && !options.upload) return '';
1724
- if (state$f.proxy) throw new Error(reloadMessage);
1725
- state$f.lastError = '';
1724
+ if (state$g.proxy) throw new Error(reloadMessage);
1725
+ state$g.lastError = '';
1726
1726
  const client = createClient(workerUrl);
1727
1727
  try {
1728
1728
  const id = await client.invoke('start', options);
1729
- state$f.stopObserving = observe(document, (type, data) => client.invoke('record', type, data), report);
1730
- state$f.client = client;
1731
- state$f.enabled = true;
1729
+ state$g.stopObserving = observe(document, (type, data) => client.invoke('record', type, data), report);
1730
+ state$g.client = client;
1731
+ state$g.enabled = true;
1732
1732
  return id;
1733
1733
  } catch (error) {
1734
1734
  client.dispose();
@@ -1736,7 +1736,7 @@ const configure = async options => {
1736
1736
  }
1737
1737
  };
1738
1738
  const configureProxy = async (options, port) => {
1739
- if (state$f.client || !options.local && !options.upload) {
1739
+ if (state$g.client || !options.local && !options.upload) {
1740
1740
  port.close();
1741
1741
  throw new Error(reloadMessage);
1742
1742
  }
@@ -1749,25 +1749,25 @@ const configureProxy = async (options, port) => {
1749
1749
  commandMap: commandMapRef,
1750
1750
  messagePort: proxyPort
1751
1751
  });
1752
- const original = state$g.rpc;
1753
- state$g.rpc = {
1752
+ const original = state$h.rpc;
1753
+ state$h.rpc = {
1754
1754
  ...rpc,
1755
1755
  async dispose() {
1756
1756
  try {
1757
1757
  await rpc.dispose();
1758
1758
  } finally {
1759
1759
  client.dispose();
1760
- state$f.client = undefined;
1761
- state$f.enabled = false;
1762
- state$f.proxy = false;
1760
+ state$g.client = undefined;
1761
+ state$g.enabled = false;
1762
+ state$g.proxy = false;
1763
1763
  await original?.dispose();
1764
1764
  }
1765
1765
  }
1766
1766
  };
1767
- state$f.client = client;
1768
- state$f.enabled = true;
1769
- state$f.proxy = true;
1770
- state$f.lastError = '';
1767
+ state$g.client = client;
1768
+ state$g.enabled = true;
1769
+ state$g.proxy = true;
1770
+ state$g.lastError = '';
1771
1771
  return id;
1772
1772
  } catch (error) {
1773
1773
  proxyPort?.close();
@@ -1777,21 +1777,21 @@ const configureProxy = async (options, port) => {
1777
1777
  }
1778
1778
  };
1779
1779
  const getSession = async () => {
1780
- if (!state$f.enabled || !state$f.client) throw new Error('Session replay is disabled in settings');
1781
- return state$f.client.invoke('export');
1780
+ if (!state$g.enabled || !state$g.client) throw new Error('Session replay is disabled in settings');
1781
+ return state$g.client.invoke('export');
1782
1782
  };
1783
1783
  const getStatus = async () => {
1784
- if (!state$f.client) return {
1784
+ if (!state$g.client) return {
1785
1785
  enabled: false,
1786
- error: state$f.lastError
1786
+ error: state$g.lastError
1787
1787
  };
1788
1788
  return {
1789
- enabled: state$f.enabled,
1790
- ...(await state$f.client.invoke('status')),
1791
- captureError: state$f.lastError
1789
+ enabled: state$g.enabled,
1790
+ ...(await state$g.client.invoke('status')),
1791
+ captureError: state$g.lastError
1792
1792
  };
1793
1793
  };
1794
- const flush = async () => state$f.client?.invoke('flush');
1794
+ const flush = async () => state$g.client?.invoke('flush');
1795
1795
  const openLocalFile = async () => {
1796
1796
  const input = document.createElement('input');
1797
1797
  input.type = 'file';
@@ -1911,25 +1911,25 @@ const confirm = message => {
1911
1911
  return window.confirm(message);
1912
1912
  };
1913
1913
 
1914
- const state$e = {
1914
+ const state$f = {
1915
1915
  styleSheets: Object.create(null),
1916
1916
  texts: Object.create(null)
1917
1917
  };
1918
1918
  const set$b = (id, sheet) => {
1919
- state$e.styleSheets[id] = sheet;
1919
+ state$f.styleSheets[id] = sheet;
1920
1920
  };
1921
1921
  const get$a = id => {
1922
- return state$e.styleSheets[id];
1922
+ return state$f.styleSheets[id];
1923
1923
  };
1924
1924
  const setText$2 = (id, text) => {
1925
- state$e.texts[id] = text;
1925
+ state$f.texts[id] = text;
1926
1926
  };
1927
1927
  const getText = id => {
1928
- return state$e.texts[id];
1928
+ return state$f.texts[id];
1929
1929
  };
1930
1930
  const remove$4 = id => {
1931
- delete state$e.styleSheets[id];
1932
- delete state$e.texts[id];
1931
+ delete state$f.styleSheets[id];
1932
+ delete state$f.texts[id];
1933
1933
  };
1934
1934
 
1935
1935
  const addCssStyleSheet = (id, text) => {
@@ -2124,7 +2124,7 @@ const createIdGenerator = () => {
2124
2124
  };
2125
2125
  const create$A = createIdGenerator();
2126
2126
 
2127
- const state$d = Object.create(null);
2127
+ const state$e = Object.create(null);
2128
2128
  const retainString = (item, index) => {
2129
2129
  const value = new Promise(resolve => {
2130
2130
  item.getAsString(resolve);
@@ -2175,25 +2175,25 @@ const retainItems = dataTransfer => {
2175
2175
  };
2176
2176
  const addItems = items => {
2177
2177
  const id = create$A();
2178
- state$d[id] = items;
2178
+ state$e[id] = items;
2179
2179
  return id;
2180
2180
  };
2181
2181
  const add$2 = dataTransfer => {
2182
2182
  return addItems(retainItems(dataTransfer));
2183
2183
  };
2184
2184
  const acquire$2 = id => {
2185
- const items = state$d[id];
2185
+ const items = state$e[id];
2186
2186
  if (!items) {
2187
2187
  throw new Error(`Drop data not found: ${id}`);
2188
2188
  }
2189
- delete state$d[id];
2189
+ delete state$e[id];
2190
2190
  return items;
2191
2191
  };
2192
2192
 
2193
- const state$c = Object.create(null);
2193
+ const state$d = Object.create(null);
2194
2194
  const acquire$1 = id => {
2195
- const promise = state$c[id];
2196
- delete state$c[id];
2195
+ const promise = state$d[id];
2196
+ delete state$d[id];
2197
2197
  return promise;
2198
2198
  };
2199
2199
  const getFileHandles = async ids => {
@@ -2203,7 +2203,7 @@ const getFileHandles = async ids => {
2203
2203
  };
2204
2204
  const add$1 = promise => {
2205
2205
  const id = create$A();
2206
- state$c[id] = promise;
2206
+ state$d[id] = promise;
2207
2207
  return id;
2208
2208
  };
2209
2209
  const addFileHandle$1 = fileHandle => {
@@ -2394,14 +2394,14 @@ const getEventListenerArgs = (params, event) => {
2394
2394
  return serialized;
2395
2395
  };
2396
2396
 
2397
- const state$b = {
2397
+ const state$c = {
2398
2398
  ipc: undefined
2399
2399
  };
2400
2400
  const getIpc = () => {
2401
- return state$b.ipc;
2401
+ return state$c.ipc;
2402
2402
  };
2403
2403
  const setIpc = value => {
2404
- state$b.ipc = value;
2404
+ state$c.ipc = value;
2405
2405
  };
2406
2406
 
2407
2407
  const nameAnonymousFunction$1 = (fn, name) => {
@@ -3324,6 +3324,10 @@ const removeProp = ($Element, key) => {
3324
3324
  $Element.style[key] = '';
3325
3325
  return;
3326
3326
  }
3327
+ if (key === 'playsInline') {
3328
+ // Firefox does not reflect playsInline as an HTMLVideoElement property.
3329
+ $Element[key] = false;
3330
+ }
3327
3331
  const attributeName = removedAttributeProps.get(key) || key;
3328
3332
  $Element.removeAttribute(attributeName);
3329
3333
  };
@@ -3372,6 +3376,10 @@ const setHtmlProp = ($Element, key, value) => {
3372
3376
  }
3373
3377
  return;
3374
3378
  }
3379
+ if (key === 'autocorrect' || key === 'autocapitalize') {
3380
+ $Element.setAttribute(key, String(value));
3381
+ return;
3382
+ }
3375
3383
  if (key === 'inputType') {
3376
3384
  // @ts-ignore
3377
3385
  $Element.type = value;
@@ -3468,12 +3476,12 @@ const render$1 = (element, eventMap, newEventMap) => {
3468
3476
  }
3469
3477
  };
3470
3478
 
3471
- const renderInternal = ($Parent, elements, eventMap, newEventMap) => {
3479
+ const renderInternal = ($Parent, elements, eventMap, newEventMap, renderElement = render$1) => {
3472
3480
  const max = elements.length - 1;
3473
3481
  let stack = [];
3474
3482
  for (let i = max; i >= 0; i--) {
3475
3483
  const element = elements[i];
3476
- const $Element = render$1(element, eventMap, newEventMap);
3484
+ const $Element = renderElement(element, eventMap, newEventMap);
3477
3485
  if (element.childCount > 0) {
3478
3486
  // @ts-expect-error
3479
3487
  $Element.append(...stack.slice(0, element.childCount));
@@ -3775,7 +3783,10 @@ const restoreFocusedElement = ($Hidden, $New, focused) => {
3775
3783
  const renderWithUid = ($Viewlet, dom, eventMap, uid, inputMap, focused, activeElement) => {
3776
3784
  const newEventMap = getEventListenerMap(uid);
3777
3785
  const $New = render(dom, eventMap, newEventMap).firstChild;
3778
- const $Hidden = createHiddenContainer($New.contains(activeElement || null) ? undefined : activeElement, focused);
3786
+ // A referenced pane can be temporarily absent from the new layout. Leave its
3787
+ // focused input in that pane unless there is a replacement to transfer it to.
3788
+ const hasReplacement = focused && $New.querySelector(`[name="${CSS.escape(focused)}"]`);
3789
+ const $Hidden = createHiddenContainer(hasReplacement && !$New.contains(activeElement || null) ? activeElement : undefined, focused);
3779
3790
  setComponentUid($New, uid);
3780
3791
  const $$NewInputs = queryInputs($New);
3781
3792
  for (const $Input of $$NewInputs) {
@@ -3920,26 +3931,26 @@ const launchDragAndDropWorker = async () => {
3920
3931
  }
3921
3932
  };
3922
3933
 
3923
- const state$a = {
3934
+ const state$b = {
3924
3935
  rpc: undefined
3925
3936
  };
3926
3937
  const hydrate$3 = async () => {
3927
3938
  const result = await launchDragAndDropWorker();
3928
3939
  if (isError(result)) {
3929
- state$a.rpc = undefined;
3940
+ state$b.rpc = undefined;
3930
3941
  return result;
3931
3942
  }
3932
- state$a.rpc = result.value;
3943
+ state$b.rpc = result.value;
3933
3944
  return success(undefined);
3934
3945
  };
3935
3946
  const handleMessagePort$1 = async port => {
3936
- if (!state$a.rpc) {
3947
+ if (!state$b.rpc) {
3937
3948
  const result = await hydrate$3();
3938
3949
  if (isError(result)) {
3939
3950
  throw result.error;
3940
3951
  }
3941
3952
  }
3942
- const rpc = state$a.rpc;
3953
+ const rpc = state$b.rpc;
3943
3954
  if (!rpc) {
3944
3955
  throw new Error('Drag And Drop Worker failed to initialize');
3945
3956
  }
@@ -4640,7 +4651,7 @@ const create$Button = (label, icon) => {
4640
4651
  };
4641
4652
 
4642
4653
  // TODO this file is not needed when all elements are position fixed
4643
- const state$9 = {
4654
+ const state$a = {
4644
4655
  $Widgets: undefined,
4645
4656
  widgetSet: new Set()
4646
4657
  };
@@ -4652,20 +4663,20 @@ const create$Widgets = () => {
4652
4663
  };
4653
4664
  const append$1 = $Element => {
4654
4665
  // TODO should not call append in the first place if it is already in DOM
4655
- if (state$9.widgetSet.has($Element)) {
4666
+ if (state$a.widgetSet.has($Element)) {
4656
4667
  return;
4657
4668
  }
4658
- state$9.widgetSet.add($Element);
4659
- if (state$9.$Widgets) {
4669
+ state$a.widgetSet.add($Element);
4670
+ if (state$a.$Widgets) {
4660
4671
  // @ts-expect-error
4661
- state$9.$Widgets.append($Element);
4672
+ state$a.$Widgets.append($Element);
4662
4673
  } else {
4663
4674
  // @ts-expect-error
4664
- state$9.$Widgets = create$Widgets();
4675
+ state$a.$Widgets = create$Widgets();
4665
4676
  // @ts-expect-error
4666
- state$9.$Widgets.append($Element);
4677
+ state$a.$Widgets.append($Element);
4667
4678
  // @ts-expect-error
4668
- document.body.append(state$9.$Widgets);
4679
+ document.body.append(state$a.$Widgets);
4669
4680
  }
4670
4681
  };
4671
4682
  const remove$1 = $Element => {
@@ -4673,16 +4684,19 @@ const remove$1 = $Element => {
4673
4684
  // TODO $Element should always be defined
4674
4685
  return;
4675
4686
  }
4676
- state$9.widgetSet.delete($Element);
4687
+ state$a.widgetSet.delete($Element);
4677
4688
  $Element.remove();
4678
4689
  // TODO state.$Widgets should always be defined at this point
4679
- if (state$9.widgetSet.size === 0 && state$9.$Widgets) {
4690
+ if (state$a.widgetSet.size === 0 && state$a.$Widgets) {
4680
4691
  // @ts-expect-error
4681
- state$9.$Widgets.remove();
4682
- state$9.$Widgets = undefined;
4692
+ state$a.$Widgets.remove();
4693
+ state$a.$Widgets = undefined;
4683
4694
  }
4684
4695
  };
4685
4696
 
4697
+ const state$9 = {
4698
+ nextNotificationId: 0
4699
+ };
4686
4700
  const handleCloseClick = event => {
4687
4701
  const $CloseButton = event.currentTarget;
4688
4702
  remove$1($CloseButton.parentNode);
@@ -4703,6 +4717,7 @@ const create$Notification = message => {
4703
4717
  const $NotificationMessage = create$NotificationMessage(message);
4704
4718
  const $CloseButton = create$CloseButton();
4705
4719
  const $Notification = document.createElement('div');
4720
+ $Notification.id = `Notification-${++state$9.nextNotificationId}`;
4706
4721
  $Notification.className = 'Notification';
4707
4722
  $Notification.append($NotificationMessage, $CloseButton);
4708
4723
  return $Notification;
@@ -4716,9 +4731,10 @@ const create$s = (type, message, parentUid) => {
4716
4731
  if ($Parent) {
4717
4732
  $Notification.style.position = 'absolute';
4718
4733
  $Parent.append($Notification);
4719
- return;
4734
+ return $Notification.id;
4720
4735
  }
4721
4736
  append$1($Notification);
4737
+ return $Notification.id;
4722
4738
  };
4723
4739
  const findIndex$1 = $Child => {
4724
4740
  const $Parent = $Child.parentNode;
@@ -4750,6 +4766,7 @@ const create$NotificationWithOptions = (message, options) => {
4750
4766
  $NotificationOptions.append($NotificationOption);
4751
4767
  }
4752
4768
  const $Notification = document.createElement('div');
4769
+ $Notification.id = `Notification-${++state$9.nextNotificationId}`;
4753
4770
  $Notification.className = 'Notification';
4754
4771
  $Notification.append($NotificationMessage, $CloseButton, $NotificationOptions);
4755
4772
  $Notification.onclick = handleNotificationClick;
@@ -4758,9 +4775,13 @@ const create$NotificationWithOptions = (message, options) => {
4758
4775
  const createWithOptions = (type, message, options) => {
4759
4776
  const $Notification = create$NotificationWithOptions(message, options);
4760
4777
  append$1($Notification);
4778
+ return $Notification.id;
4761
4779
  };
4762
4780
  const dispose$h = id => {
4763
- // const $Notification = state.$Notifications
4781
+ const $Notification = document.getElementById(id);
4782
+ if ($Notification?.classList.contains('Notification')) {
4783
+ remove$1($Notification);
4784
+ }
4764
4785
  };
4765
4786
 
4766
4787
  const createObjectUrl = blob => {