@lvce-editor/renderer-process 10.2.0 → 10.3.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.
@@ -739,7 +739,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
739
739
  const errorProperty = getErrorProperty(error, prettyError);
740
740
  return create$1$1(message, errorProperty);
741
741
  };
742
- const create$M = (message, result) => {
742
+ const create$N = (message, result) => {
743
743
  return {
744
744
  jsonrpc: Two,
745
745
  id: message.id,
@@ -748,7 +748,7 @@ const create$M = (message, result) => {
748
748
  };
749
749
  const getSuccessResponse = (message, result) => {
750
750
  const resultProperty = result ?? null;
751
- return create$M(message, resultProperty);
751
+ return create$N(message, resultProperty);
752
752
  };
753
753
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
754
754
  try {
@@ -923,7 +923,7 @@ const launchWorker = async ({
923
923
  name,
924
924
  url
925
925
  }) => {
926
- const worker = await create$L({
926
+ const worker = await create$M({
927
927
  method: Auto,
928
928
  url,
929
929
  name
@@ -998,7 +998,7 @@ const hydrate$4 = async () => {
998
998
  };
999
999
 
1000
1000
  // TODO needed?
1001
- const dispose$k = () => {
1001
+ const dispose$l = () => {
1002
1002
  // @ts-expect-error
1003
1003
  if (state$9.rendererWorker) {
1004
1004
  // @ts-expect-error
@@ -1021,7 +1021,7 @@ const invokeAndTransfer = (method, ...params) => {
1021
1021
 
1022
1022
  const RendererWorker = {
1023
1023
  __proto__: null,
1024
- dispose: dispose$k,
1024
+ dispose: dispose$l,
1025
1025
  hydrate: hydrate$4,
1026
1026
  invoke: invoke$1,
1027
1027
  invokeAndTransfer,
@@ -1030,7 +1030,7 @@ const RendererWorker = {
1030
1030
  state: state$9
1031
1031
  };
1032
1032
 
1033
- const create$L = async ({
1033
+ const create$M = async ({
1034
1034
  method,
1035
1035
  ...options
1036
1036
  }) => {
@@ -1051,7 +1051,7 @@ const create$L = async ({
1051
1051
  };
1052
1052
 
1053
1053
  const launchEditorWorker = async port => {
1054
- const ipc = await create$L({
1054
+ const ipc = await create$M({
1055
1055
  name: 'Editor Worker',
1056
1056
  url: editorWorkerUrl,
1057
1057
  method: ModuleWorkerWithMessagePort,
@@ -1081,7 +1081,7 @@ const extensionHostWorkerUrl = getConfiguredExtensionHostWorkerUrl() || `${asset
1081
1081
 
1082
1082
  const launchExtensionHostWorker = async port => {
1083
1083
  const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
1084
- const ipc = await create$L({
1084
+ const ipc = await create$M({
1085
1085
  name,
1086
1086
  url: extensionHostWorkerUrl,
1087
1087
  method: ModuleWorkerWithMessagePort,
@@ -1105,7 +1105,7 @@ const hydrate$2 = async () => {
1105
1105
  const syntaxHighlightingWorkerUrl = `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/syntax-highlighting-worker/dist/syntaxHighlightingWorkerMain.js`;
1106
1106
 
1107
1107
  const launchSyntaxHighlightingWorker = async port => {
1108
- const ipc = await create$L({
1108
+ const ipc = await create$M({
1109
1109
  name: 'Syntax Highlighting Worker',
1110
1110
  url: syntaxHighlightingWorkerUrl,
1111
1111
  method: ModuleWorkerWithMessagePort,
@@ -1229,7 +1229,7 @@ const ToolBar = 'toolbar';
1229
1229
  const Tree = 'tree';
1230
1230
  const ComboBox = 'combobox';
1231
1231
 
1232
- const attachEvents$c = ($Node, eventMap) => {
1232
+ const attachEvents$d = ($Node, eventMap) => {
1233
1233
  for (const [key, value] of Object.entries(eventMap)) {
1234
1234
  $Node.addEventListener(key, value);
1235
1235
  }
@@ -1282,7 +1282,7 @@ const TouchMove = 'touchmove';
1282
1282
  const TouchStart = 'touchstart';
1283
1283
  const Wheel = 'wheel';
1284
1284
 
1285
- const setBounds$6 = ($Element, x, y, width, height) => {
1285
+ const setBounds$7 = ($Element, x, y, width, height) => {
1286
1286
  $Element.style.top = `${y}px`;
1287
1287
  $Element.style.left = `${x}px`;
1288
1288
  $Element.style.width = `${width}px`;
@@ -2157,7 +2157,7 @@ const setNegativeMargin = (state, negativeMargin) => {
2157
2157
  setTop($ListItems, negativeMargin);
2158
2158
  };
2159
2159
 
2160
- const create$K = () => {
2160
+ const create$L = () => {
2161
2161
  const $ListItems = document.createElement('div');
2162
2162
  $ListItems.className = 'ListItems';
2163
2163
  $ListItems.role = ListBox;
@@ -2181,24 +2181,24 @@ const create$K = () => {
2181
2181
  $ScrollBarThumb
2182
2182
  };
2183
2183
  };
2184
- const attachEvents$b = state => {
2184
+ const attachEvents$c = state => {
2185
2185
  const {
2186
2186
  $Viewlet,
2187
2187
  $ListItems,
2188
2188
  $ScrollBar
2189
2189
  } = state;
2190
2190
  $Viewlet.addEventListener(Wheel, handleWheel$3, Passive);
2191
- attachEvents$c($ListItems, {
2191
+ attachEvents$d($ListItems, {
2192
2192
  [MouseDown]: handleMousedown
2193
2193
  });
2194
- attachEvents$c($ScrollBar, {
2194
+ attachEvents$d($ScrollBar, {
2195
2195
  [PointerDown]: handleScrollBarPointerDown$4
2196
2196
  });
2197
2197
  };
2198
2198
  // TODO show should be passed active cursor position
2199
2199
  // this would make this function easier to test as it would avoid dependency on globals of other files
2200
2200
 
2201
- const setDom$a = (state, dom) => {
2201
+ const setDom$b = (state, dom) => {
2202
2202
  const {
2203
2203
  $ListItems,
2204
2204
  $Viewlet
@@ -2210,7 +2210,7 @@ const setDom$a = (state, dom) => {
2210
2210
  // TODO recycle nodes
2211
2211
  // TODO set right aria attributes on $EditorInput
2212
2212
  };
2213
- const dispose$j = state => {
2213
+ const dispose$k = state => {
2214
2214
  remove$2(state.$Viewlet);
2215
2215
  // state.$EditorInput.removeAttribute('aria-activedescendant')
2216
2216
  };
@@ -2230,28 +2230,67 @@ const handleError$8 = (state, error) => {
2230
2230
  } = state;
2231
2231
  $Viewlet.textContent = `${error}`;
2232
2232
  };
2233
- const setBounds$5 = (state, x, y, width, height) => {
2233
+ const setBounds$6 = (state, x, y, width, height) => {
2234
2234
  const {
2235
2235
  $Viewlet
2236
2236
  } = state;
2237
- setBounds$6($Viewlet, x, y, width, height);
2237
+ setBounds$7($Viewlet, x, y, width, height);
2238
2238
  };
2239
2239
 
2240
2240
  const ViewletEditorCompletion = {
2241
2241
  __proto__: null,
2242
- attachEvents: attachEvents$b,
2243
- create: create$K,
2244
- dispose: dispose$j,
2242
+ attachEvents: attachEvents$c,
2243
+ create: create$L,
2244
+ dispose: dispose$k,
2245
2245
  handleError: handleError$8,
2246
- setBounds: setBounds$5,
2246
+ setBounds: setBounds$6,
2247
2247
  setContentHeight,
2248
- setDom: setDom$a,
2248
+ setDom: setDom$b,
2249
2249
  setNegativeMargin,
2250
2250
  setScrollBar: setScrollBar$2,
2251
2251
  setSize,
2252
2252
  showLoading
2253
2253
  };
2254
2254
 
2255
+ const create$K = () => {
2256
+ const $Viewlet = document.createElement('div');
2257
+ $Viewlet.className = 'Viewlet EditorCompletionDetails';
2258
+ $Viewlet.id = 'CompletionsDetails';
2259
+ return {
2260
+ $Viewlet
2261
+ };
2262
+ };
2263
+ const attachEvents$b = state => {
2264
+ // TODO
2265
+ };
2266
+ const setDom$a = (state, dom) => {
2267
+ const {
2268
+ $Viewlet
2269
+ } = state;
2270
+ const $Root = render2(dom);
2271
+ // @ts-expect-error
2272
+ $Viewlet.replaceChildren(...$Root.firstChild.childNodes);
2273
+ append$1($Viewlet);
2274
+ };
2275
+ const dispose$j = state => {
2276
+ remove$2(state.$Viewlet);
2277
+ };
2278
+ const setBounds$5 = (state, x, y, width, height) => {
2279
+ const {
2280
+ $Viewlet
2281
+ } = state;
2282
+ setBounds$7($Viewlet, x, y, width, height);
2283
+ };
2284
+
2285
+ const ViewletEditorCompletionDetails = {
2286
+ __proto__: null,
2287
+ attachEvents: attachEvents$b,
2288
+ create: create$K,
2289
+ dispose: dispose$j,
2290
+ setBounds: setBounds$5,
2291
+ setDom: setDom$a
2292
+ };
2293
+
2255
2294
  const ActivityBar = 'ActivityBar';
2256
2295
  const Audio$1 = 'Audio';
2257
2296
  const BrowserViewOverview = 'BrowserViewOverview';
@@ -2308,6 +2347,7 @@ const EditorSourceActions = 'EditorSourceActions';
2308
2347
  const E2eTests = 'E2eTests';
2309
2348
  const E2eTest = 'E2eTest';
2310
2349
  const WebView = 'WebView';
2350
+ const EditorCompletionDetails = 'EditorCompletionDetails';
2311
2351
 
2312
2352
  const state$6 = {
2313
2353
  instances: Object.create(null),
@@ -2651,6 +2691,7 @@ const enable = async window => {
2651
2691
  const main = async () => {
2652
2692
  enable(window);
2653
2693
  state$6.modules[EditorCompletion] = ViewletEditorCompletion;
2694
+ state$6.modules[EditorCompletionDetails] = ViewletEditorCompletionDetails;
2654
2695
  setLoad(load$2);
2655
2696
  // TODO this is discovered very late
2656
2697
  await launchWorkers();
@@ -3977,7 +4018,7 @@ const InitData_ipc = {
3977
4018
 
3978
4019
  const name$n = 'IpcParent';
3979
4020
  const Commands$o = {
3980
- create: create$L
4021
+ create: create$M
3981
4022
  };
3982
4023
 
3983
4024
  const IpcParent_ipc = {
@@ -5348,6 +5389,8 @@ const load$1 = moduleId => {
5348
5389
  return Promise.resolve().then(function () { return ViewletE2eTest; });
5349
5390
  case WebView:
5350
5391
  return Promise.resolve().then(function () { return ViewletWebView; });
5392
+ case EditorCompletionDetails:
5393
+ return Promise.resolve().then(function () { return ViewletEditorCompletionDetails; });
5351
5394
  default:
5352
5395
  throw new Error(`${moduleId} module not found in renderer process`);
5353
5396
  }
@@ -5460,7 +5503,7 @@ const isSpecial = id => {
5460
5503
  const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
5461
5504
  const $PlaceHolder = document.createElement('div');
5462
5505
  $PlaceHolder.className = `Viewlet ${viewletId}`;
5463
- setBounds$6($PlaceHolder, left, top, width, height);
5506
+ setBounds$7($PlaceHolder, left, top, width, height);
5464
5507
  if (isSpecial(viewletId)) {
5465
5508
  $PlaceHolder.id = viewletId;
5466
5509
  }
@@ -5771,7 +5814,7 @@ const setBounds$4 = (id, left, top, width, height) => {
5771
5814
  return;
5772
5815
  }
5773
5816
  const $Viewlet = instance.state.$Viewlet;
5774
- setBounds$6($Viewlet, left, top, width, height);
5817
+ setBounds$7($Viewlet, left, top, width, height);
5775
5818
  };
5776
5819
 
5777
5820
  const name$8 = 'Viewlet';
@@ -6617,7 +6660,7 @@ const setBounds$3 = (state, x, y, width, height) => {
6617
6660
  const {
6618
6661
  $Viewlet
6619
6662
  } = state;
6620
- setBounds$6($Viewlet, x, y, width, height);
6663
+ setBounds$7($Viewlet, x, y, width, height);
6621
6664
  };
6622
6665
 
6623
6666
  const ViewletEditorError = {
@@ -6778,7 +6821,7 @@ const attachEvents$9 = state => {
6778
6821
  const {
6779
6822
  $Viewlet
6780
6823
  } = state;
6781
- attachEvents$c($Viewlet, {
6824
+ attachEvents$d($Viewlet, {
6782
6825
  [PointerDown]: handlePointerDown$5,
6783
6826
  [PointerUp]: handlePointerUp,
6784
6827
  [ContextMenu]: handleContextMenu$a,
@@ -7458,7 +7501,7 @@ const setBounds$1 = (state, x, y, width, height) => {
7458
7501
  const {
7459
7502
  $Viewlet
7460
7503
  } = state;
7461
- setBounds$6($Viewlet, x, y, width, height);
7504
+ setBounds$7($Viewlet, x, y, width, height);
7462
7505
  };
7463
7506
 
7464
7507
  const ViewletEditorWidgetError = {
@@ -7974,7 +8017,7 @@ const attachEvents$8 = state => {
7974
8017
  $ExtensionHeader.addEventListener(Input$1, handleInput$6, Capture);
7975
8018
  // @ts-expect-error
7976
8019
  $ExtensionHeader.addEventListener(Click, undefined);
7977
- attachEvents$c($ListItems, {
8020
+ attachEvents$d($ListItems, {
7978
8021
  [ContextMenu]: handleContextMenu$8,
7979
8022
  [PointerDown]: handlePointerDown$3,
7980
8023
  [Focus]: handleFocus$6,
@@ -7984,7 +8027,7 @@ const attachEvents$8 = state => {
7984
8027
  $ListItems.addEventListener(TouchMove, handleTouchMove, Passive);
7985
8028
  $ListItems.addEventListener(TouchEnd, handleTouchEnd, Passive);
7986
8029
  $ListItems.addEventListener(Wheel, handleWheel$3, Passive);
7987
- attachEvents$c($ScrollBar, {
8030
+ attachEvents$d($ScrollBar, {
7988
8031
  [PointerDown]: handleScrollBarPointerDown$2
7989
8032
  });
7990
8033
  };
@@ -8891,15 +8934,15 @@ const attachEvents$7 = state => {
8891
8934
  $SashSideBar,
8892
8935
  $SashPanel
8893
8936
  } = state;
8894
- attachEvents$c($SashSideBar, {
8937
+ attachEvents$d($SashSideBar, {
8895
8938
  [PointerDown]: handleSashPointerDown,
8896
8939
  [DoubleClick]: handleSashDoubleClick
8897
8940
  });
8898
- attachEvents$c($SashPanel, {
8941
+ attachEvents$d($SashPanel, {
8899
8942
  [PointerDown]: handleSashPointerDown,
8900
8943
  [DoubleClick]: handleSashDoubleClick
8901
8944
  });
8902
- attachEvents$c(window, {
8945
+ attachEvents$d(window, {
8903
8946
  [Resize]: handleResize,
8904
8947
  [Focus]: handleFocus$3,
8905
8948
  [Blur]: handleBlur$3,
@@ -8912,9 +8955,9 @@ const setSashes = (state, sashSideBar, sashPanel) => {
8912
8955
  $SashSideBar,
8913
8956
  $SashPanel
8914
8957
  } = state;
8915
- setBounds$6($SashSideBar, sashSideBar.x, sashSideBar.y, sashSideBar.width, sashSideBar.height);
8958
+ setBounds$7($SashSideBar, sashSideBar.x, sashSideBar.y, sashSideBar.width, sashSideBar.height);
8916
8959
  $SashSideBar.classList.toggle('SashActive', sashSideBar.active);
8917
- setBounds$6($SashPanel, sashPanel.x, sashPanel.y, sashPanel.width, sashPanel.height);
8960
+ setBounds$7($SashPanel, sashPanel.x, sashPanel.y, sashPanel.width, sashPanel.height);
8918
8961
  $SashPanel.classList.toggle('SashActive', sashPanel.active);
8919
8962
  };
8920
8963
 
@@ -8964,7 +9007,7 @@ const attachEvents$6 = state => {
8964
9007
  const {
8965
9008
  $Viewlet
8966
9009
  } = state;
8967
- attachEvents$c($Viewlet, {
9010
+ attachEvents$d($Viewlet, {
8968
9011
  [Drop]: handleDrop,
8969
9012
  [DragOver]: handleDragOver,
8970
9013
  [DragEnd]: handleDragEnd,
@@ -9027,7 +9070,7 @@ const setDragOverlay = (state, visible, x, y, width, height) => {
9027
9070
  const {
9028
9071
  $DragOverlay
9029
9072
  } = state;
9030
- setBounds$6($DragOverlay, x, y, width, height);
9073
+ setBounds$7($DragOverlay, x, y, width, height);
9031
9074
  if (!hasOverlay) {
9032
9075
  document.body.append($DragOverlay);
9033
9076
  }
@@ -9102,7 +9145,7 @@ const attachEvents$5 = state => {
9102
9145
  const {
9103
9146
  $MainTabs
9104
9147
  } = state;
9105
- attachEvents$c($MainTabs, {
9148
+ attachEvents$d($MainTabs, {
9106
9149
  [MouseDown]: handleTabsMouseDown,
9107
9150
  [ContextMenu]: handleTabsContextMenu,
9108
9151
  [DragStart]: handleDragStart
@@ -9279,13 +9322,13 @@ const attachEvents$4 = state => {
9279
9322
  $ButtonClose,
9280
9323
  $PanelHeader
9281
9324
  } = state;
9282
- attachEvents$c($PanelHeader, {
9325
+ attachEvents$d($PanelHeader, {
9283
9326
  [Click]: handleHeaderClick$2
9284
9327
  });
9285
- attachEvents$c($ButtonMaximize, {
9328
+ attachEvents$d($ButtonMaximize, {
9286
9329
  [Click]: handleClickMaximize
9287
9330
  });
9288
- attachEvents$c($ButtonClose, {
9331
+ attachEvents$d($ButtonClose, {
9289
9332
  [Click]: handleClickClose$1
9290
9333
  });
9291
9334
  };
@@ -9601,11 +9644,11 @@ const attachEvents$3 = state => {
9601
9644
  $QuickPickItems,
9602
9645
  $QuickPickInput
9603
9646
  } = state;
9604
- attachEvents$c($QuickPickItems, {
9647
+ attachEvents$d($QuickPickItems, {
9605
9648
  [PointerDown]: handlePointerDown
9606
9649
  });
9607
9650
  $QuickPickItems.addEventListener(Wheel, handleWheel$3, Passive);
9608
- attachEvents$c($QuickPickInput, {
9651
+ attachEvents$d($QuickPickInput, {
9609
9652
  [Blur]: handleBlur$2,
9610
9653
  [BeforeInput]: handleBeforeInput
9611
9654
  });
@@ -10080,7 +10123,7 @@ const attachEvents$2 = state => {
10080
10123
  const {
10081
10124
  $SideBarTitleArea
10082
10125
  } = state;
10083
- attachEvents$c($SideBarTitleArea, {
10126
+ attachEvents$d($SideBarTitleArea, {
10084
10127
  [Click]: handleHeaderClick
10085
10128
  });
10086
10129
  };
@@ -10653,7 +10696,7 @@ const attachEvents = state => {
10653
10696
  const {
10654
10697
  $Viewlet
10655
10698
  } = state;
10656
- attachEvents$c($Viewlet, {
10699
+ attachEvents$d($Viewlet, {
10657
10700
  [ContextMenu]: handleContextMenu$4
10658
10701
  });
10659
10702
  };
@@ -10985,7 +11028,7 @@ const setMenus = (state, changes, uid) => {
10985
11028
  level,
10986
11029
  focusedIndex
10987
11030
  } = menu;
10988
- setBounds$6($Menu, x, y, width, height);
11031
+ setBounds$7($Menu, x, y, width, height);
10989
11032
  renderInto($Menu, dom);
10990
11033
  $Menu.id = `Menu-${level}`;
10991
11034
  append$1($Menu);
@@ -11011,7 +11054,7 @@ const setMenus = (state, changes, uid) => {
11011
11054
  focusedIndex
11012
11055
  } = menu;
11013
11056
  const $Menu = $$Menus[level];
11014
- setBounds$6($Menu, x, y, width, height);
11057
+ setBounds$7($Menu, x, y, width, height);
11015
11058
  renderInto($Menu, dom);
11016
11059
  if (level === newLength - 1) {
11017
11060
  if (focusedIndex === -1) {
@@ -11463,7 +11506,7 @@ const setPort = (state, portId, origin) => {
11463
11506
  };
11464
11507
  const setPosition = (state, id, x, y, width, height) => {
11465
11508
  const $Iframe = get(id);
11466
- setBounds$6($Iframe, x, y, width, height);
11509
+ setBounds$7($Iframe, x, y, width, height);
11467
11510
  };
11468
11511
 
11469
11512
  const ViewletWebView = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "10.2.0",
3
+ "version": "10.3.0",
4
4
  "description": "",
5
5
  "main": "dist/rendererProcessMain.js",
6
6
  "type": "module",