@lvce-editor/renderer-process 30.4.0 → 30.5.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.
@@ -1867,18 +1867,16 @@ const getPathName = () => {
1867
1867
  const getHref = () => {
1868
1868
  return location.href;
1869
1869
  };
1870
- const matchesPathName = (a, b) => {
1871
- return a === b || a === '/' && b === '' || a === '' && b === '/';
1870
+ const matchesPathName = (currentPathName, pathName) => {
1871
+ const resolvedPathName = new URL(pathName, getHref()).pathname;
1872
+ return currentPathName === resolvedPathName;
1872
1873
  };
1873
-
1874
- // TODO should do nothing if it is already at this path
1875
1874
  const setPathName = pathName => {
1876
1875
  const currentPathName = getPathName();
1877
1876
  if (matchesPathName(currentPathName, pathName)) {
1878
1877
  return;
1879
1878
  }
1880
- // @ts-expect-error
1881
- history.pushState(null, null, pathName);
1879
+ history.pushState(null, '', pathName);
1882
1880
  };
1883
1881
  const hydrate$4 = () => {
1884
1882
  // addEventListener('popstate', handlePopState)
@@ -9081,6 +9079,12 @@ const unmaximize = () => {};
9081
9079
  const close = () => {
9082
9080
  // window.close()
9083
9081
  };
9082
+ const toggleFullScreen = () => {
9083
+ if (document.fullscreenElement) {
9084
+ return document.exitFullscreen();
9085
+ }
9086
+ return document.documentElement.requestFullscreen();
9087
+ };
9084
9088
  const sendVisibilityChangeHint = () => {
9085
9089
  send(/* SaveState.handleVisibilityChange */'SaveState.handleVisibilityChange', /* visibilityState */'hidden');
9086
9090
  };
@@ -9310,6 +9314,7 @@ const commandMap = {
9310
9314
  'Window.minimize': minimize,
9311
9315
  'Window.onVisibilityChange': onVisibilityChange,
9312
9316
  'Window.reload': reload,
9317
+ 'Window.toggleFullScreen': toggleFullScreen,
9313
9318
  'Window.unmaximize': unmaximize,
9314
9319
  'WindowTitle.set': set$1
9315
9320
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.4.0",
3
+ "version": "30.5.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"