@lvce-editor/renderer-process 30.68.11 → 30.68.13
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/dist/rendererProcessMain.js +17 -17
- package/package.json +1 -1
|
@@ -1476,7 +1476,6 @@ const createRuntimeName = name => {
|
|
|
1476
1476
|
return {
|
|
1477
1477
|
id,
|
|
1478
1478
|
name,
|
|
1479
|
-
// Platform detection in workers relies on a trailing (Electron) or (Web).
|
|
1480
1479
|
runtimeName: `[${runtimeId}] ${name}`
|
|
1481
1480
|
};
|
|
1482
1481
|
};
|
|
@@ -1634,21 +1633,10 @@ const getConfiguredRendererWorkerUrl = () => {
|
|
|
1634
1633
|
|
|
1635
1634
|
const rendererWorkerUrl = getConfiguredRendererWorkerUrl() || `${assetDir}/packages/renderer-worker/src/rendererWorkerMain.ts`;
|
|
1636
1635
|
|
|
1637
|
-
const getName = platform => {
|
|
1638
|
-
switch (platform) {
|
|
1639
|
-
case Electron$1:
|
|
1640
|
-
return 'Renderer Worker (Electron)';
|
|
1641
|
-
case Web:
|
|
1642
|
-
return 'Renderer Worker (Web)';
|
|
1643
|
-
default:
|
|
1644
|
-
return 'Renderer Worker';
|
|
1645
|
-
}
|
|
1646
|
-
};
|
|
1647
1636
|
const launchRendererWorker = async () => {
|
|
1648
|
-
const name = getName(platform);
|
|
1649
1637
|
const url = new URL(rendererWorkerUrl, location.href);
|
|
1650
1638
|
return launchWorker({
|
|
1651
|
-
name,
|
|
1639
|
+
name: 'Renderer Worker',
|
|
1652
1640
|
url: url.href
|
|
1653
1641
|
});
|
|
1654
1642
|
};
|
|
@@ -10514,15 +10502,25 @@ const setHash = hash => {
|
|
|
10514
10502
|
}
|
|
10515
10503
|
history.replaceState(null, '', url.href);
|
|
10516
10504
|
};
|
|
10517
|
-
const setWorkspaceUri =
|
|
10505
|
+
const setWorkspaceUri = _workspaceUri => {
|
|
10518
10506
|
const currentHref = getHref();
|
|
10519
10507
|
const url = new URL(currentHref);
|
|
10520
|
-
url.searchParams.
|
|
10508
|
+
url.searchParams.delete('workspace');
|
|
10521
10509
|
if (url.href === currentHref) {
|
|
10522
10510
|
return;
|
|
10523
10511
|
}
|
|
10524
10512
|
history.replaceState(null, '', url.href);
|
|
10525
10513
|
};
|
|
10514
|
+
const removeWorkspaceUri = () => {
|
|
10515
|
+
const currentHref = getHref();
|
|
10516
|
+
const url = new URL(currentHref);
|
|
10517
|
+
if (!url.searchParams.has('workspace')) {
|
|
10518
|
+
return currentHref;
|
|
10519
|
+
}
|
|
10520
|
+
url.searchParams.delete('workspace');
|
|
10521
|
+
history.replaceState(null, '', url.href);
|
|
10522
|
+
return getHref();
|
|
10523
|
+
};
|
|
10526
10524
|
const isChatPath = pathName => {
|
|
10527
10525
|
return /(?:^|\/)chat\/?$/.test(pathName);
|
|
10528
10526
|
};
|
|
@@ -10552,9 +10550,11 @@ const getConfig = () => {
|
|
|
10552
10550
|
return JSON.parse(configElement.textContent);
|
|
10553
10551
|
};
|
|
10554
10552
|
const getInitData = () => {
|
|
10553
|
+
const config = getConfig();
|
|
10554
|
+
const href = config.platform === 'electron' ? removeWorkspaceUri() : getHref();
|
|
10555
10555
|
const initData = {
|
|
10556
10556
|
Config: {
|
|
10557
|
-
...
|
|
10557
|
+
...config,
|
|
10558
10558
|
assetDir: assetDir,
|
|
10559
10559
|
platform: platform,
|
|
10560
10560
|
shouldLaunchMultipleWorkers: shouldLaunchMultipleWorkers,
|
|
@@ -10565,7 +10565,7 @@ const getInitData = () => {
|
|
|
10565
10565
|
bounds: getBounds()
|
|
10566
10566
|
},
|
|
10567
10567
|
Location: {
|
|
10568
|
-
href
|
|
10568
|
+
href
|
|
10569
10569
|
}
|
|
10570
10570
|
};
|
|
10571
10571
|
return initData;
|