@lvce-editor/extension-management-worker 4.90.1 → 4.90.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.
@@ -1818,10 +1818,11 @@ const isStaticHttpAssetDir = assetDir => {
1818
1818
  const isHttpLocation = () => {
1819
1819
  return Reflect.has(globalThis, 'location') && globalThis.location.protocol.startsWith('http');
1820
1820
  };
1821
- const getRuntimeContext = async (assetDir, platform) => {
1821
+ const getRuntimeContext = async (assetDir, platform, applicationId) => {
1822
1822
  const shouldInferPlatform = isMissingPlatform(platform);
1823
- const resolvedAssetDir = isMissingAssetDir(assetDir) ? await invoke$4('Layout.getAssetDir') : assetDir;
1824
- const resolvedPlatform = shouldInferPlatform ? await invoke$4('Layout.getPlatform') : platform;
1823
+ const invoke = command => applicationId === undefined ? invoke$4(command) : invoke$4('Application.execute', applicationId, command);
1824
+ const resolvedAssetDir = isMissingAssetDir(assetDir) ? await invoke('Layout.getAssetDir') : assetDir;
1825
+ const resolvedPlatform = shouldInferPlatform ? await invoke('Layout.getPlatform') : platform;
1825
1826
  if (shouldInferPlatform && isHttpLocation() && isStaticHttpAssetDir(resolvedAssetDir)) {
1826
1827
  return {
1827
1828
  assetDir: resolvedAssetDir,
@@ -3547,7 +3548,14 @@ const deferInvalidateExtensionsCache = (extensionId, disabled) => {
3547
3548
  }, 0);
3548
3549
  };
3549
3550
 
3550
- const handleChange$1 = async _id => {
3551
+ const handleChange$1 = async (_id, applicationId) => {
3552
+ if (applicationId !== undefined) {
3553
+ const visible = await invoke$4('Application.execute', applicationId, 'Layout.getStatusBarVisible');
3554
+ if (visible) {
3555
+ await invoke$4('Application.execute', applicationId, 'StatusBar.handleChange');
3556
+ }
3557
+ return;
3558
+ }
3551
3559
  const statusBarVisible = await invoke$4('Layout.getStatusBarVisible');
3552
3560
  if (!statusBarVisible) {
3553
3561
  return;
@@ -5036,7 +5044,7 @@ const getOutputChannelProviders = async extensionsState => {
5036
5044
  const {
5037
5045
  assetDir,
5038
5046
  platform
5039
- } = await getRuntimeContext('', extensionsState.platform);
5047
+ } = await getRuntimeContext('', extensionsState.platform, extensionsState.applicationId);
5040
5048
  const extensions = await getAllExtensionsWithState(extensionsState, assetDir, platform);
5041
5049
  const outputExtensions = extensions.filter(hasOutputChannels);
5042
5050
  const providers = await Promise.all(outputExtensions.map(extension => getExtensionOutputChannelProviders(extension, assetDir, platform)));
@@ -5063,7 +5071,7 @@ const resolveOutputChannel = async (extensionsState, uri) => {
5063
5071
  const {
5064
5072
  assetDir,
5065
5073
  platform
5066
- } = await getRuntimeContext('', extensionsState.platform);
5074
+ } = await getRuntimeContext('', extensionsState.platform, extensionsState.applicationId);
5067
5075
  const extensions = await getAllExtensionsWithState(extensionsState, assetDir, platform);
5068
5076
  const extension = extensions.find(candidate => getExtensionId$3(candidate) === extensionId && hasOutputChannels(candidate));
5069
5077
  const isContributed = extension?.outputChannels?.some(outputChannel => outputChannel.id === outputChannelId);
@@ -6562,7 +6570,7 @@ const wrapSourceControlProviderCommand = methodName => {
6562
6570
  return executeRequiredSourceControlProvider(extensionsState, providerId, methodName, ...args);
6563
6571
  });
6564
6572
  };
6565
- const sharedApplicationCommands = new Set(['Extensions.getColorThemeCss', 'Extensions.getColorThemeCssFromJson', 'Extensions.getColorThemeJson', 'Extensions.getColorThemeNames', 'Extensions.getPreference', 'Extensions.setPreference']);
6573
+ const sharedApplicationCommands = new Set(['Extensions.getColorThemeCss', 'Extensions.getColorThemeCssFromJson', 'Extensions.getColorThemeJson', 'Extensions.getColorThemeNames']);
6566
6574
  const invokeForApplication = async (applicationId, method, ...args) => {
6567
6575
  const application = get$7(applicationId);
6568
6576
  const command = commandMap[method];
@@ -6588,6 +6596,8 @@ const invokeForApplication = async (applicationId, method, ...args) => {
6588
6596
  return getAllExtensionsWithState(application, args[0] || '', args[1] ?? application.platform, args[2]);
6589
6597
  case 'Extensions.getDynamicWebExtensions':
6590
6598
  return application.webExtensions;
6599
+ case 'Extensions.getPreference':
6600
+ return invoke$2('Application.execute', applicationId, 'Preferences.get', ...args);
6591
6601
  case 'Extensions.getRpcInfo':
6592
6602
  return getRpcInfo$1(application, args[0]);
6593
6603
  case 'Extensions.getRuntimeStatus':
@@ -6607,8 +6617,14 @@ const invokeForApplication = async (applicationId, method, ...args) => {
6607
6617
  return requestViewRerender(args[0], applicationId);
6608
6618
  case 'Extensions.sendMessagePortToFileSystemWorker':
6609
6619
  return createFileSystemPort(application, args[0]);
6620
+ case 'Extensions.setPreference':
6621
+ return invoke$2('Application.execute', applicationId, 'Preferences.update', {
6622
+ [args[0]]: args[1]
6623
+ });
6610
6624
  case 'Extensions.showNotification':
6611
6625
  return invoke$2('Application.execute', applicationId, 'Notification.create', ...args);
6626
+ case 'StatusBar.handleChange':
6627
+ return handleChange$1(args[0], applicationId);
6612
6628
  default:
6613
6629
  throw new Error(`Extension command does not support application context: ${method}`);
6614
6630
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-management-worker",
3
- "version": "4.90.1",
3
+ "version": "4.90.2",
4
4
  "description": "Webworker for the Extension Management functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"