@lvce-editor/renderer-process 10.23.0 → 10.24.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.
@@ -985,7 +985,7 @@ const hydrate$4 = async () => {
985
985
  };
986
986
 
987
987
  // TODO needed?
988
- const dispose$o = () => {
988
+ const dispose$p = () => {
989
989
  // @ts-expect-error
990
990
  if (state$9.rendererWorker) {
991
991
  // @ts-expect-error
@@ -1008,7 +1008,7 @@ const invokeAndTransfer = (method, ...params) => {
1008
1008
 
1009
1009
  const RendererWorker = {
1010
1010
  __proto__: null,
1011
- dispose: dispose$o,
1011
+ dispose: dispose$p,
1012
1012
  hydrate: hydrate$4,
1013
1013
  invoke: invoke$1,
1014
1014
  invokeAndTransfer,
@@ -1696,7 +1696,7 @@ const applyUidWorkaround = element => {
1696
1696
  set$5(element, editorUid);
1697
1697
  };
1698
1698
 
1699
- const setBounds$9 = ($Element, x, y, width, height) => {
1699
+ const setBounds$a = ($Element, x, y, width, height) => {
1700
1700
  $Element.style.top = `${y}px`;
1701
1701
  $Element.style.left = `${x}px`;
1702
1702
  $Element.style.width = `${width}px`;
@@ -1911,7 +1911,7 @@ const setOffsetX = (state, offsetX) => {
1911
1911
  setXAndYTransform($ColorPickerSliderThumb, offsetX, 0);
1912
1912
  applyUidWorkaround($Viewlet);
1913
1913
  };
1914
- const appendWidget$5 = state => {
1914
+ const appendWidget$6 = state => {
1915
1915
  const {
1916
1916
  $Viewlet
1917
1917
  } = state;
@@ -1921,45 +1921,12 @@ const appendWidget$5 = state => {
1921
1921
  const ViewletColorPicker = {
1922
1922
  __proto__: null,
1923
1923
  Events: ViewletColorPickerEvents,
1924
- appendWidget: appendWidget$5,
1924
+ appendWidget: appendWidget$6,
1925
1925
  setColor,
1926
1926
  setOffsetX
1927
1927
  };
1928
1928
 
1929
- const Alert = 'alert';
1930
- const Application = 'application';
1931
- const Code = 'code';
1932
- const Complementary = 'complementary';
1933
- const ContentInfo = 'contentinfo';
1934
- const Group = 'group';
1935
- const List$1 = 'list';
1936
- const ListBox = 'listbox';
1937
- const Log = 'log';
1938
- const Main$1 = 'main';
1939
- const Menu = 'menu';
1940
- const None$2 = 'none';
1941
- const Status = 'status';
1942
- const TabList = 'tablist';
1943
- const TextBox = 'textbox';
1944
- const ToolBar = 'toolbar';
1945
- const Tree = 'tree';
1946
- const ComboBox = 'combobox';
1947
-
1948
- const attachEvents$c = ($Node, eventMap) => {
1949
- for (const [key, value] of Object.entries(eventMap)) {
1950
- $Node.addEventListener(key, value);
1951
- }
1952
- };
1953
-
1954
- const Passive = {
1955
- passive: true
1956
- };
1957
- const Active = {
1958
- passive: false
1959
- };
1960
- const Capture = {
1961
- capture: true
1962
- };
1929
+ const Script = 2;
1963
1930
 
1964
1931
  /**
1965
1932
  * @param {Event} event
@@ -2039,19 +2006,6 @@ const executeViewletCommand = (uid, command, ...args) => {
2039
2006
  send('Viewlet.executeViewletCommand', uid, command, ...args);
2040
2007
  };
2041
2008
 
2042
- const startTracking = ($Target, pointerId, handlePointerMove, handlePointerUp) => {
2043
- $Target.setPointerCapture(pointerId);
2044
- $Target.addEventListener(PointerMove, handlePointerMove);
2045
- // TODO use pointerlost event instead
2046
- $Target.addEventListener(PointerUp, handlePointerUp);
2047
- };
2048
- const stopTracking = ($Target, pointerId, handlePointerMove, handlePointerUp) => {
2049
- $Target.releasePointerCapture(pointerId);
2050
- $Target.removeEventListener(PointerMove, handlePointerMove);
2051
- // TODO use pointerlost event instead
2052
- $Target.removeEventListener(PointerUp, handlePointerUp);
2053
- };
2054
-
2055
2009
  const nameAnonymousFunction = (fn, name) => {
2056
2010
  Object.defineProperty(fn, 'name', {
2057
2011
  value: name
@@ -2106,7 +2060,7 @@ const handleDropFilePath = forwardViewletCommand('handleDropFilePath');
2106
2060
  const handleDropFiles = forwardViewletCommand('handleDrop');
2107
2061
  forwardViewletCommand('handleFilterInput');
2108
2062
  const handleFocus$c = forwardViewletCommand('handleFocus');
2109
- const handleFocusIn$4 = forwardViewletCommand('handleFocusIn');
2063
+ const handleFocusIn$5 = forwardViewletCommand('handleFocusIn');
2110
2064
  const handleIconError$1 = forwardViewletCommand('handleIconError');
2111
2065
  const handleImageError$1 = forwardViewletCommand('handleImageError');
2112
2066
  const handleInput$9 = forwardViewletCommand('handleInput');
@@ -2163,6 +2117,109 @@ forwardViewletCommand('type');
2163
2117
  forwardViewletCommand('typeWithAutoClosing');
2164
2118
  const updateEditingValue = forwardViewletCommand('updateEditingValue');
2165
2119
 
2120
+ const handleFocusIn$4 = event => {
2121
+ preventDefault(event);
2122
+ const uid = fromEvent(event);
2123
+ handleFocusIn$5(uid);
2124
+ };
2125
+
2126
+ const ViewletEditorCodeGeneratorEvents = {
2127
+ __proto__: null,
2128
+ handleFocusIn: handleFocusIn$4
2129
+ };
2130
+
2131
+ const setBounds$9 = (state, x, y, width, height) => {
2132
+ const {
2133
+ $Viewlet
2134
+ } = state;
2135
+ setBounds$a($Viewlet, x, y, width, height);
2136
+ applyUidWorkaround($Viewlet);
2137
+ };
2138
+ const appendWidget$5 = state => {
2139
+ const {
2140
+ $Viewlet
2141
+ } = state;
2142
+ append$1($Viewlet);
2143
+ };
2144
+ const dispose$o = state => {
2145
+ remove$2(state.$Viewlet);
2146
+ };
2147
+ const focus$j = (state, key, source) => {
2148
+ if (!key) {
2149
+ return;
2150
+ }
2151
+ if (source !== Script) {
2152
+ return;
2153
+ }
2154
+ const {
2155
+ $Viewlet
2156
+ } = state;
2157
+ const $Element = $Viewlet.querySelector(key);
2158
+ if (!$Element) {
2159
+ console.warn(`element not found: ${key}`);
2160
+ return;
2161
+ }
2162
+ $Element.focus();
2163
+ applyUidWorkaround($Viewlet);
2164
+ };
2165
+
2166
+ const ViewletEditorCodeGenerator = {
2167
+ __proto__: null,
2168
+ Events: ViewletEditorCodeGeneratorEvents,
2169
+ appendWidget: appendWidget$5,
2170
+ dispose: dispose$o,
2171
+ focus: focus$j,
2172
+ setBounds: setBounds$9
2173
+ };
2174
+
2175
+ const Alert = 'alert';
2176
+ const Application = 'application';
2177
+ const Code = 'code';
2178
+ const Complementary = 'complementary';
2179
+ const ContentInfo = 'contentinfo';
2180
+ const Group = 'group';
2181
+ const List$1 = 'list';
2182
+ const ListBox = 'listbox';
2183
+ const Log = 'log';
2184
+ const Main$1 = 'main';
2185
+ const Menu = 'menu';
2186
+ const None$2 = 'none';
2187
+ const Status = 'status';
2188
+ const TabList = 'tablist';
2189
+ const TextBox = 'textbox';
2190
+ const ToolBar = 'toolbar';
2191
+ const Tree = 'tree';
2192
+ const ComboBox = 'combobox';
2193
+
2194
+ const attachEvents$c = ($Node, eventMap) => {
2195
+ for (const [key, value] of Object.entries(eventMap)) {
2196
+ $Node.addEventListener(key, value);
2197
+ }
2198
+ };
2199
+
2200
+ const Passive = {
2201
+ passive: true
2202
+ };
2203
+ const Active = {
2204
+ passive: false
2205
+ };
2206
+ const Capture = {
2207
+ capture: true
2208
+ };
2209
+
2210
+ const startTracking = ($Target, pointerId, handlePointerMove, handlePointerUp) => {
2211
+ $Target.setPointerCapture(pointerId);
2212
+ $Target.addEventListener(PointerMove, handlePointerMove);
2213
+ // TODO use pointerlost event instead
2214
+ $Target.addEventListener(PointerUp, handlePointerUp);
2215
+ };
2216
+ const stopTracking = ($Target, pointerId, handlePointerMove, handlePointerUp) => {
2217
+ $Target.releasePointerCapture(pointerId);
2218
+ $Target.removeEventListener(PointerMove, handlePointerMove);
2219
+ // TODO use pointerlost event instead
2220
+ $Target.removeEventListener(PointerUp, handlePointerUp);
2221
+ };
2222
+
2166
2223
  const handleMousedown = event => {
2167
2224
  preventDefault(event);
2168
2225
  const {
@@ -2340,7 +2397,7 @@ const setBounds$8 = (state, x, y, width, height) => {
2340
2397
  const {
2341
2398
  $Viewlet
2342
2399
  } = state;
2343
- setBounds$9($Viewlet, x, y, width, height);
2400
+ setBounds$a($Viewlet, x, y, width, height);
2344
2401
  applyUidWorkaround($Viewlet);
2345
2402
  };
2346
2403
 
@@ -2403,7 +2460,7 @@ const setBounds$7 = (state, x, y, width, height) => {
2403
2460
  const {
2404
2461
  $Viewlet
2405
2462
  } = state;
2406
- setBounds$9($Viewlet, x, y, width, height);
2463
+ setBounds$a($Viewlet, x, y, width, height);
2407
2464
  };
2408
2465
 
2409
2466
  const ViewletEditorCompletionDetails = {
@@ -2477,7 +2534,7 @@ const ViewletEditorHover = {
2477
2534
  const handleFocusIn$3 = event => {
2478
2535
  preventDefault(event);
2479
2536
  const uid = fromEvent(event);
2480
- handleFocusIn$4(uid);
2537
+ handleFocusIn$5(uid);
2481
2538
  };
2482
2539
  const handleBlur$a = event => {
2483
2540
  const uid = fromEvent(event);
@@ -2505,7 +2562,7 @@ const setBounds$5 = (state, x, y, width, height) => {
2505
2562
  const {
2506
2563
  $Viewlet
2507
2564
  } = state;
2508
- setBounds$9($Viewlet, x, y, width, height);
2565
+ setBounds$a($Viewlet, x, y, width, height);
2509
2566
  applyUidWorkaround($Viewlet);
2510
2567
  };
2511
2568
  const appendWidget$2 = state => {
@@ -2529,7 +2586,7 @@ const ViewletEditorRename = {
2529
2586
  const handleFocusIn$2 = event => {
2530
2587
  preventDefault(event);
2531
2588
  const uid = fromEvent(event);
2532
- handleFocusIn$4(uid);
2589
+ handleFocusIn$5(uid);
2533
2590
  };
2534
2591
 
2535
2592
  const ViewletEditorSourceActionsEvents = {
@@ -2541,7 +2598,7 @@ const setBounds$4 = (state, x, y, width, height) => {
2541
2598
  const {
2542
2599
  $Viewlet
2543
2600
  } = state;
2544
- setBounds$9($Viewlet, x, y, width, height);
2601
+ setBounds$a($Viewlet, x, y, width, height);
2545
2602
  applyUidWorkaround($Viewlet);
2546
2603
  };
2547
2604
  const appendWidget$1 = state => {
@@ -2663,7 +2720,7 @@ const focus$i = (state, key, source) => {
2663
2720
  if (!key) {
2664
2721
  return;
2665
2722
  }
2666
- if (source !== /* script */2) {
2723
+ if (source !== Script) {
2667
2724
  return;
2668
2725
  }
2669
2726
  const {
@@ -2703,7 +2760,7 @@ const setBounds$3 = (state, x, y, width, height) => {
2703
2760
  const {
2704
2761
  $Viewlet
2705
2762
  } = state;
2706
- setBounds$9($Viewlet, x, y, width, height);
2763
+ setBounds$a($Viewlet, x, y, width, height);
2707
2764
  };
2708
2765
  const dispose$j = state => {
2709
2766
  remove$2(state.$Viewlet);
@@ -2781,6 +2838,7 @@ const WebView = 'WebView';
2781
2838
  const EditorCompletionDetails = 'EditorCompletionDetails';
2782
2839
  const EditorTextError = 'EditorTextError';
2783
2840
  const EditorRename = 'EditorRename';
2841
+ const EditorCodeGenerator = 'EditorCodeGenerator';
2784
2842
 
2785
2843
  const state$6 = {
2786
2844
  instances: Object.create(null),
@@ -3124,6 +3182,7 @@ const enable = async window => {
3124
3182
  const main = async () => {
3125
3183
  enable(window);
3126
3184
  state$6.modules[ColorPicker] = ViewletColorPicker;
3185
+ state$6.modules[EditorCodeGenerator] = ViewletEditorCodeGenerator;
3127
3186
  state$6.modules[EditorCompletion] = ViewletEditorCompletion;
3128
3187
  state$6.modules[EditorCompletionDetails] = ViewletEditorCompletionDetails;
3129
3188
  state$6.modules[EditorHover] = ViewletEditorHover;
@@ -5829,6 +5888,8 @@ const load$1 = moduleId => {
5829
5888
  return Promise.resolve().then(function () { return ViewletEditorCompletionDetails; });
5830
5889
  case EditorTextError:
5831
5890
  return Promise.resolve().then(function () { return ViewletEditorTextError; });
5891
+ case EditorCodeGenerator:
5892
+ return Promise.resolve().then(function () { return ViewletEditorCodeGenerator; });
5832
5893
  default:
5833
5894
  throw new Error(`${moduleId} module not found in renderer process`);
5834
5895
  }
@@ -5941,7 +6002,7 @@ const isSpecial = id => {
5941
6002
  const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
5942
6003
  const $PlaceHolder = document.createElement('div');
5943
6004
  $PlaceHolder.className = `Viewlet ${viewletId}`;
5944
- setBounds$9($PlaceHolder, left, top, width, height);
6005
+ setBounds$a($PlaceHolder, left, top, width, height);
5945
6006
  if (isSpecial(viewletId)) {
5946
6007
  $PlaceHolder.id = viewletId;
5947
6008
  }
@@ -6262,7 +6323,7 @@ const setBounds$2 = (id, left, top, width, height) => {
6262
6323
  return;
6263
6324
  }
6264
6325
  const $Viewlet = instance.state.$Viewlet;
6265
- setBounds$9($Viewlet, left, top, width, height);
6326
+ setBounds$a($Viewlet, left, top, width, height);
6266
6327
  };
6267
6328
 
6268
6329
  const name$8 = 'Viewlet';
@@ -7019,7 +7080,7 @@ const setBounds$1 = (state, x, y, width, height) => {
7019
7080
  const {
7020
7081
  $Viewlet
7021
7082
  } = state;
7022
- setBounds$9($Viewlet, x, y, width, height);
7083
+ setBounds$a($Viewlet, x, y, width, height);
7023
7084
  };
7024
7085
 
7025
7086
  const ViewletEditorError = {
@@ -7819,7 +7880,7 @@ const setBounds = (state, x, y, width, height) => {
7819
7880
  const {
7820
7881
  $Viewlet
7821
7882
  } = state;
7822
- setBounds$9($Viewlet, x, y, width, height);
7883
+ setBounds$a($Viewlet, x, y, width, height);
7823
7884
  };
7824
7885
 
7825
7886
  const ViewletEditorWidgetError = {
@@ -9161,9 +9222,9 @@ const setSashes = (state, sashSideBar, sashPanel) => {
9161
9222
  $SashSideBar,
9162
9223
  $SashPanel
9163
9224
  } = state;
9164
- setBounds$9($SashSideBar, sashSideBar.x, sashSideBar.y, sashSideBar.width, sashSideBar.height);
9225
+ setBounds$a($SashSideBar, sashSideBar.x, sashSideBar.y, sashSideBar.width, sashSideBar.height);
9165
9226
  $SashSideBar.classList.toggle('SashActive', sashSideBar.active);
9166
- setBounds$9($SashPanel, sashPanel.x, sashPanel.y, sashPanel.width, sashPanel.height);
9227
+ setBounds$a($SashPanel, sashPanel.x, sashPanel.y, sashPanel.width, sashPanel.height);
9167
9228
  $SashPanel.classList.toggle('SashActive', sashPanel.active);
9168
9229
  };
9169
9230
 
@@ -9276,7 +9337,7 @@ const setDragOverlay = (state, visible, x, y, width, height) => {
9276
9337
  const {
9277
9338
  $DragOverlay
9278
9339
  } = state;
9279
- setBounds$9($DragOverlay, x, y, width, height);
9340
+ setBounds$a($DragOverlay, x, y, width, height);
9280
9341
  if (!hasOverlay) {
9281
9342
  document.body.append($DragOverlay);
9282
9343
  }
@@ -11219,7 +11280,7 @@ const setMenus = (state, changes, uid) => {
11219
11280
  level,
11220
11281
  focusedIndex
11221
11282
  } = menu;
11222
- setBounds$9($Menu, x, y, width, height);
11283
+ setBounds$a($Menu, x, y, width, height);
11223
11284
  renderInto($Menu, dom);
11224
11285
  $Menu.id = `Menu-${level}`;
11225
11286
  append$1($Menu);
@@ -11245,7 +11306,7 @@ const setMenus = (state, changes, uid) => {
11245
11306
  focusedIndex
11246
11307
  } = menu;
11247
11308
  const $Menu = $$Menus[level];
11248
- setBounds$9($Menu, x, y, width, height);
11309
+ setBounds$a($Menu, x, y, width, height);
11249
11310
  renderInto($Menu, dom);
11250
11311
  if (level === newLength - 1) {
11251
11312
  if (focusedIndex === -1) {
@@ -11670,7 +11731,7 @@ const setPort = (state, portId, origin) => {
11670
11731
  };
11671
11732
  const setPosition = (state, id, x, y, width, height) => {
11672
11733
  const $Iframe = get(id);
11673
- setBounds$9($Iframe, x, y, width, height);
11734
+ setBounds$a($Iframe, x, y, width, height);
11674
11735
  };
11675
11736
 
11676
11737
  const ViewletWebView = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "10.23.0",
3
+ "version": "10.24.0",
4
4
  "description": "",
5
5
  "main": "dist/rendererProcessMain.js",
6
6
  "type": "module",