@lvce-editor/panel-worker 2.14.1 → 2.14.3

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.
@@ -1177,6 +1177,8 @@ const None = 0;
1177
1177
  const Checked = 2;
1178
1178
  const Unchecked = 3;
1179
1179
 
1180
+ const Web = 1;
1181
+
1180
1182
  const RendererProcess = 1670;
1181
1183
  const RendererWorker = 1;
1182
1184
 
@@ -1470,8 +1472,11 @@ const {
1470
1472
  wrapGetter
1471
1473
  } = create$1();
1472
1474
 
1473
- const create = (uid, uri, x, y, width, height, platform, assetDir) => {
1475
+ const create = (uid, uri, x, y, width, height, platform, assetDir, applicationId) => {
1474
1476
  const state = {
1477
+ ...(applicationId !== undefined && {
1478
+ applicationId
1479
+ }),
1475
1480
  actionsUid: 0,
1476
1481
  assetDir,
1477
1482
  availableViews: [],
@@ -1744,8 +1749,11 @@ const handleFilterInput = async (state, value) => {
1744
1749
  const remoteSshWorkspacePrefix = 'remote-ssh://';
1745
1750
  const devContainerWorkspacePrefix = 'devcontainers:///';
1746
1751
  const codespacesWorkspacePrefix = 'codespaces://';
1747
- const getPanelViews = (workspaceUri = '') => {
1752
+ const getPanelViews = (workspaceUri = '', platform = 0) => {
1748
1753
  const views = [Problems, Output, DebugConsole, Terminals];
1754
+ if (platform === Web) {
1755
+ views.splice(views.indexOf(Terminals), 1);
1756
+ }
1749
1757
  if (workspaceUri.startsWith(remoteSshWorkspacePrefix) || workspaceUri.startsWith(devContainerWorkspacePrefix) || workspaceUri.startsWith(codespacesWorkspacePrefix)) {
1750
1758
  views.push(Ports);
1751
1759
  }
@@ -1759,8 +1767,12 @@ const getSavedViewletId = savedState => {
1759
1767
  return Problems;
1760
1768
  };
1761
1769
 
1762
- const createViewlet = async (viewletModuleId, editorUid, tabId, actionsUid, bounds, uri, focus) => {
1763
- await invoke$1('Layout.createPanelViewlet', viewletModuleId, editorUid, tabId, actionsUid, bounds, uri, focus);
1770
+ const createViewlet = async (viewletModuleId, editorUid, tabId, actionsUid, bounds, uri, focus, applicationId) => {
1771
+ if (applicationId === undefined) {
1772
+ await invoke$1('Layout.createPanelViewlet', viewletModuleId, editorUid, tabId, actionsUid, bounds, uri, focus);
1773
+ } else {
1774
+ await invoke$1('Application.execute', applicationId, 'Layout.createPanelViewlet', viewletModuleId, editorUid, tabId, actionsUid, bounds, uri, focus);
1775
+ }
1764
1776
  };
1765
1777
 
1766
1778
  const getContentDimensions = dimensions => {
@@ -1814,6 +1826,7 @@ const saveViewletState = async (childUid, viewletId) => {
1814
1826
 
1815
1827
  const openViewlet = async (state, id, focus = false, uri = '') => {
1816
1828
  const {
1829
+ applicationId,
1817
1830
  childUid: currentChildUid,
1818
1831
  currentViewletId,
1819
1832
  uid,
@@ -1828,7 +1841,7 @@ const openViewlet = async (state, id, focus = false, uri = '') => {
1828
1841
  const tabId = getUid();
1829
1842
  const actionsUid = getUid();
1830
1843
  const index = views.indexOf(id);
1831
- await createViewlet(id, childUid, tabId, actionsUid, childDimensions, uri, focus);
1844
+ await createViewlet(id, childUid, tabId, actionsUid, childDimensions, uri, focus, applicationId);
1832
1845
  if (currentChildUid > 0) {
1833
1846
  add(uid, currentChildUid);
1834
1847
  }
@@ -1845,10 +1858,11 @@ const openViewlet = async (state, id, focus = false, uri = '') => {
1845
1858
  const loadContent = (state, savedState, workspaceUri = '') => {
1846
1859
  const {
1847
1860
  currentViewletId: activeViewletId,
1848
- hiddenViews: activeHiddenViews
1861
+ hiddenViews: activeHiddenViews,
1862
+ platform
1849
1863
  } = state;
1850
1864
  const savedViewletId = savedState?.currentViewletId || activeViewletId || getSavedViewletId(savedState);
1851
- const availableViews = getPanelViews(workspaceUri);
1865
+ const availableViews = getPanelViews(workspaceUri, platform);
1852
1866
  const hiddenViews = (savedState?.hiddenViews || activeHiddenViews || []).filter(view => availableViews.includes(view));
1853
1867
  let views = availableViews.filter(view => !hiddenViews.includes(view));
1854
1868
  if (views.length === 0 && availableViews.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/panel-worker",
3
- "version": "2.14.1",
3
+ "version": "2.14.3",
4
4
  "description": "Panel Worker",
5
5
  "repository": {
6
6
  "type": "git",