@lvce-editor/editor-worker 18.5.0 → 18.6.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.
@@ -575,12 +575,12 @@ const getErrorConstructor = (message, type) => {
575
575
  switch (type) {
576
576
  case DomException:
577
577
  return DOMException;
578
- case TypeError$1:
579
- return TypeError;
580
- case SyntaxError$1:
581
- return SyntaxError;
582
578
  case ReferenceError$1:
583
579
  return ReferenceError;
580
+ case SyntaxError$1:
581
+ return SyntaxError;
582
+ case TypeError$1:
583
+ return TypeError;
584
584
  default:
585
585
  return Error;
586
586
  }
@@ -736,27 +736,27 @@ const getErrorProperty = (error, prettyError) => {
736
736
  if (error && error.code === E_COMMAND_NOT_FOUND) {
737
737
  return {
738
738
  code: MethodNotFound,
739
- message: error.message,
740
- data: error.stack
739
+ data: error.stack,
740
+ message: error.message
741
741
  };
742
742
  }
743
743
  return {
744
744
  code: Custom,
745
- message: prettyError.message,
746
745
  data: {
747
- stack: getStack(prettyError),
748
- codeFrame: prettyError.codeFrame,
749
- type: getErrorType(prettyError),
750
746
  code: prettyError.code,
751
- name: prettyError.name
752
- }
747
+ codeFrame: prettyError.codeFrame,
748
+ name: prettyError.name,
749
+ stack: getStack(prettyError),
750
+ type: getErrorType(prettyError)
751
+ },
752
+ message: prettyError.message
753
753
  };
754
754
  };
755
755
  const create$1$1 = (id, error) => {
756
756
  return {
757
- jsonrpc: Two$1,
757
+ error,
758
758
  id,
759
- error
759
+ jsonrpc: Two$1
760
760
  };
761
761
  };
762
762
  const getErrorResponse = (id, error, preparePrettyError, logError) => {
@@ -767,8 +767,8 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
767
767
  };
768
768
  const create$j = (message, result) => {
769
769
  return {
770
- jsonrpc: Two$1,
771
770
  id: message.id,
771
+ jsonrpc: Two$1,
772
772
  result: result ?? null
773
773
  };
774
774
  };
@@ -778,14 +778,14 @@ const getSuccessResponse = (message, result) => {
778
778
  };
779
779
  const getErrorResponseSimple = (id, error) => {
780
780
  return {
781
- jsonrpc: Two$1,
782
- id,
783
781
  error: {
784
782
  code: Custom,
783
+ data: error,
785
784
  // @ts-ignore
786
- message: error.message,
787
- data: error
788
- }
785
+ message: error.message
786
+ },
787
+ id,
788
+ jsonrpc: Two$1
789
789
  };
790
790
  };
791
791
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
@@ -815,35 +815,35 @@ const normalizeParams = args => {
815
815
  if (args.length === 1) {
816
816
  const options = args[0];
817
817
  return {
818
+ execute: options.execute,
818
819
  ipc: options.ipc,
820
+ logError: options.logError || defaultLogError,
819
821
  message: options.message,
820
- execute: options.execute,
821
- resolve: options.resolve || defaultResolve,
822
822
  preparePrettyError: options.preparePrettyError || defaultPreparePrettyError,
823
- logError: options.logError || defaultLogError,
824
- requiresSocket: options.requiresSocket || defaultRequiresSocket
823
+ requiresSocket: options.requiresSocket || defaultRequiresSocket,
824
+ resolve: options.resolve || defaultResolve
825
825
  };
826
826
  }
827
827
  return {
828
+ execute: args[2],
828
829
  ipc: args[0],
830
+ logError: args[5],
829
831
  message: args[1],
830
- execute: args[2],
831
- resolve: args[3],
832
832
  preparePrettyError: args[4],
833
- logError: args[5],
834
- requiresSocket: args[6]
833
+ requiresSocket: args[6],
834
+ resolve: args[3]
835
835
  };
836
836
  };
837
837
  const handleJsonRpcMessage = async (...args) => {
838
838
  const options = normalizeParams(args);
839
839
  const {
840
- message,
841
- ipc,
842
840
  execute,
843
- resolve,
844
- preparePrettyError,
841
+ ipc,
845
842
  logError,
846
- requiresSocket
843
+ message,
844
+ preparePrettyError,
845
+ requiresSocket,
846
+ resolve
847
847
  } = options;
848
848
  if ('id' in message) {
849
849
  if ('method' in message) {
@@ -904,7 +904,6 @@ const registerPromise = map => {
904
904
  };
905
905
  };
906
906
 
907
- // @ts-ignore
908
907
  const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
909
908
  const {
910
909
  id,
@@ -986,6 +985,41 @@ const listen$1 = async (module, options) => {
986
985
  return ipc;
987
986
  };
988
987
 
988
+ const create$f = async ({
989
+ commandMap,
990
+ isMessagePortOpen = true,
991
+ messagePort
992
+ }) => {
993
+ // TODO create a commandMap per rpc instance
994
+ register(commandMap);
995
+ const rawIpc = await IpcParentWithMessagePort$1.create({
996
+ isMessagePortOpen,
997
+ messagePort
998
+ });
999
+ const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
1000
+ handleIpc(ipc);
1001
+ const rpc = createRpc(ipc);
1002
+ messagePort.start();
1003
+ return rpc;
1004
+ };
1005
+
1006
+ const create$e = async ({
1007
+ commandMap,
1008
+ isMessagePortOpen,
1009
+ send
1010
+ }) => {
1011
+ const {
1012
+ port1,
1013
+ port2
1014
+ } = new MessageChannel();
1015
+ await send(port1);
1016
+ return create$f({
1017
+ commandMap,
1018
+ isMessagePortOpen,
1019
+ messagePort: port2
1020
+ });
1021
+ };
1022
+
989
1023
  const createSharedLazyRpc = factory => {
990
1024
  let rpcPromise;
991
1025
  const getOrCreate = () => {
@@ -1014,13 +1048,13 @@ const createSharedLazyRpc = factory => {
1014
1048
  };
1015
1049
  };
1016
1050
 
1017
- const create$f = async ({
1051
+ const create$d = async ({
1018
1052
  commandMap,
1019
1053
  isMessagePortOpen,
1020
1054
  send
1021
1055
  }) => {
1022
1056
  return createSharedLazyRpc(() => {
1023
- return create$c({
1057
+ return create$e({
1024
1058
  commandMap,
1025
1059
  isMessagePortOpen,
1026
1060
  send
@@ -1028,51 +1062,16 @@ const create$f = async ({
1028
1062
  });
1029
1063
  };
1030
1064
 
1031
- const create$e = async ({
1032
- commandMap,
1033
- isMessagePortOpen = true,
1034
- messagePort
1035
- }) => {
1036
- // TODO create a commandMap per rpc instance
1037
- register(commandMap);
1038
- const rawIpc = await IpcParentWithMessagePort$1.create({
1039
- isMessagePortOpen,
1040
- messagePort
1041
- });
1042
- const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
1043
- handleIpc(ipc);
1044
- const rpc = createRpc(ipc);
1045
- messagePort.start();
1046
- return rpc;
1047
- };
1048
-
1049
- const create$d = async ({
1065
+ const create$c = async ({
1050
1066
  commandMap,
1051
1067
  messagePort
1052
1068
  }) => {
1053
- return create$e({
1069
+ return create$f({
1054
1070
  commandMap,
1055
1071
  messagePort
1056
1072
  });
1057
1073
  };
1058
1074
 
1059
- const create$c = async ({
1060
- commandMap,
1061
- isMessagePortOpen,
1062
- send
1063
- }) => {
1064
- const {
1065
- port1,
1066
- port2
1067
- } = new MessageChannel();
1068
- await send(port1);
1069
- return create$e({
1070
- commandMap,
1071
- isMessagePortOpen,
1072
- messagePort: port2
1073
- });
1074
- };
1075
-
1076
1075
  const create$b = async ({
1077
1076
  commandMap
1078
1077
  }) => {
@@ -1084,70 +1083,8 @@ const create$b = async ({
1084
1083
  return rpc;
1085
1084
  };
1086
1085
 
1087
- const Text$1 = 12;
1088
- const Reference = 100;
1089
-
1090
- const AltKey = 'event.altKey';
1091
- const Button = 'event.button';
1092
- const ClientX = 'event.clientX';
1093
- const ClientY = 'event.clientY';
1094
- const DeltaMode = 'event.deltaMode';
1095
- const DeltaY = 'event.deltaY';
1096
-
1097
- const Backspace = 1;
1098
- const Tab$1 = 2;
1099
- const Enter = 3;
1100
- const Escape = 8;
1101
- const Space$1 = 9;
1102
- const End = 255;
1103
- const Home = 12;
1104
- const LeftArrow = 13;
1105
- const UpArrow = 14;
1106
- const RightArrow = 15;
1107
- const DownArrow = 16;
1108
- const Delete$1 = 18;
1109
- const KeyA = 29;
1110
- const KeyC = 31;
1111
- const KeyD = 32;
1112
- const KeyF = 34;
1113
- const KeyH = 36;
1114
- const KeyJ = 38;
1115
- const KeyK = 39;
1116
- const KeyL = 40;
1117
- const KeyO = 43;
1118
- const KeyV = 50;
1119
- const KeyX = 52;
1120
- const KeyZ = 54;
1121
- const F2 = 58;
1122
- const F3 = 59;
1123
- const F4 = 60;
1124
- const F12 = 68;
1125
- const Period = 87;
1126
- const Slash$1 = 88;
1127
- const BracketLeft = 90;
1128
- const BracketRight = 92;
1129
-
1130
- const CodeGenerator = 1;
1131
- const ColorPicker$1 = 2;
1132
- const Completion = 3;
1133
- const CompletionDetail = 4;
1134
- const Find = 5;
1135
- const Hover = 6;
1136
- const Rename$1 = 7;
1137
- const SourceAction$1 = 8;
1138
-
1139
1086
  const Script$1 = 2;
1140
1087
 
1141
- const CtrlCmd = 1 << 11 >>> 0;
1142
- const Shift = 1 << 10 >>> 0;
1143
- const Alt$1 = 1 << 9 >>> 0;
1144
-
1145
- const Editor$1 = 3;
1146
- const SourceControl = 22;
1147
-
1148
- const Separator = 1;
1149
- const None = 0;
1150
-
1151
1088
  const CompletionWorker = 301;
1152
1089
  const DebugWorker = 55;
1153
1090
  const EditorWorker = 99;
@@ -1158,14 +1095,6 @@ const MarkdownWorker = 300;
1158
1095
  const OpenerWorker = 4561;
1159
1096
  const RendererWorker$1 = 1;
1160
1097
 
1161
- const FocusSelector = 'Viewlet.focusSelector';
1162
- const SetCss$1 = 'Viewlet.setCss';
1163
- const SetFocusContext$1 = 'Viewlet.setFocusContext';
1164
- const SetPatches = 'Viewlet.setPatches';
1165
-
1166
- const FocusEditorText$1 = 12;
1167
- const FocusExplorer = 13;
1168
-
1169
1098
  const createMockRpc = ({
1170
1099
  commandMap
1171
1100
  }) => {
@@ -1292,6 +1221,9 @@ const searchFileHtml = async uri => {
1292
1221
  const getFilePathElectron = async file => {
1293
1222
  return invoke$d('FileSystemHandle.getFilePathElectron', file);
1294
1223
  };
1224
+ const handleModifiedStatusChange = async (uri, modified) => {
1225
+ return invoke$d('Main.handleModifiedStatusChange', uri, modified);
1226
+ };
1295
1227
  /**
1296
1228
  * @deprecated
1297
1229
  */
@@ -1395,6 +1327,9 @@ const disableExtension = async id => {
1395
1327
  const enableExtension = async id => {
1396
1328
  return invoke$d('ExtensionManagement.enable', id);
1397
1329
  };
1330
+ const disposeEditor = async uid => {
1331
+ return invoke$d('Viewlet.dispose', uid);
1332
+ };
1398
1333
  const handleDebugChange = async params => {
1399
1334
  return invoke$d('Run And Debug.handleChange', params);
1400
1335
  };
@@ -1407,10 +1342,31 @@ const handleWorkspaceRefresh = async () => {
1407
1342
  const closeWidget = async widgetId => {
1408
1343
  return invoke$d('Viewlet.closeWidget', widgetId);
1409
1344
  };
1345
+ const createViewlet = async (viewletModuleId, editorUid, tabId, bounds, uri) => {
1346
+ return invoke$d('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
1347
+ };
1410
1348
  const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1411
1349
  const command = 'HandleMessagePort.handleMessagePort2';
1412
1350
  await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1413
1351
  };
1352
+ const getViewletModuleId = async uri => {
1353
+ return invoke$d('Layout.getModuleId', uri);
1354
+ };
1355
+ const showPanel = async () => {
1356
+ return invoke$d('Layout.showPanel');
1357
+ };
1358
+ const showPreview = async () => {
1359
+ return invoke$d('Layout.showPreview');
1360
+ };
1361
+ const saveEditor = async () => {
1362
+ return invoke$d('Editor.save');
1363
+ };
1364
+ const togglePanelView = async id => {
1365
+ return invoke$d('Panel.toggleView', id);
1366
+ };
1367
+ const resizeViewlet = async (uid, dimensions) => {
1368
+ return invoke$d('Viewlet.resize', uid, dimensions);
1369
+ };
1414
1370
  const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
1415
1371
  const command = 'QuickPick.handleMessagePort';
1416
1372
  await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
@@ -1431,6 +1387,12 @@ const getKeyBindings$1 = async () => {
1431
1387
  const writeClipBoardText = async text => {
1432
1388
  await invoke$d('ClipBoard.writeText', /* text */text);
1433
1389
  };
1390
+ const writeFile = async (uri, text) => {
1391
+ await invoke$d('FileSystem.writeFile', uri, text);
1392
+ };
1393
+ const handleUriChange = async (uri, newUri) => {
1394
+ await invoke$d('Main.handleUriChange', uri, newUri);
1395
+ };
1434
1396
  const readClipBoardText = async () => {
1435
1397
  return invoke$d('ClipBoard.readText');
1436
1398
  };
@@ -1559,6 +1521,9 @@ const unmaximizeWindow = async () => {
1559
1521
  const maximizeWindow = async () => {
1560
1522
  return invoke$d('ElectronWindow.maximize');
1561
1523
  };
1524
+ const showSideBar = async (id, focus) => {
1525
+ return invoke$d('SideBar.show', id, focus);
1526
+ };
1562
1527
  const closeWindow = async () => {
1563
1528
  return invoke$d('ElectronWindow.close');
1564
1529
  };
@@ -1597,8 +1562,10 @@ const RendererWorker = {
1597
1562
  closeWidget,
1598
1563
  closeWindow,
1599
1564
  confirm,
1565
+ createViewlet,
1600
1566
  disableExtension,
1601
1567
  dispose: dispose$2,
1568
+ disposeEditor,
1602
1569
  enableExtension,
1603
1570
  getActiveEditorId,
1604
1571
  getAllExtensions,
@@ -1623,6 +1590,7 @@ const RendererWorker = {
1623
1590
  getPreference,
1624
1591
  getRecentlyOpened,
1625
1592
  getV8Version,
1593
+ getViewletModuleId,
1626
1594
  getWebViewSecret,
1627
1595
  getWindowId,
1628
1596
  getWorkspacePath,
@@ -1630,6 +1598,8 @@ const RendererWorker = {
1630
1598
  handleDebugPaused,
1631
1599
  handleDebugResumed,
1632
1600
  handleDebugScriptParsed,
1601
+ handleModifiedStatusChange,
1602
+ handleUriChange,
1633
1603
  handleWorkspaceRefresh,
1634
1604
  installExtension,
1635
1605
  invoke: invoke$d,
@@ -1650,6 +1620,8 @@ const RendererWorker = {
1650
1620
  registerWebViewInterceptor,
1651
1621
  renderMarkdown,
1652
1622
  rerenderEditor,
1623
+ resizeViewlet,
1624
+ saveEditor,
1653
1625
  searchFileFetch,
1654
1626
  searchFileHtml,
1655
1627
  searchFileMemory,
@@ -1683,12 +1655,17 @@ const RendererWorker = {
1683
1655
  showContextMenu2,
1684
1656
  showErrorDialog,
1685
1657
  showMessageBox,
1658
+ showPanel,
1659
+ showPreview,
1686
1660
  showSaveFilePicker,
1661
+ showSideBar,
1662
+ togglePanelView,
1687
1663
  uninstallExtension,
1688
1664
  unmaximizeWindow,
1689
1665
  unregisterWebViewInterceptor,
1690
1666
  writeClipBoardImage,
1691
- writeClipBoardText
1667
+ writeClipBoardText,
1668
+ writeFile
1692
1669
  };
1693
1670
 
1694
1671
  const {
@@ -1710,13 +1687,25 @@ const {
1710
1687
  invokeAndTransfer,
1711
1688
  set: set$9
1712
1689
  } = create$a(MarkdownWorker);
1690
+ const tokenizeIncremental = (uid, languageId, oldLine, newLine, rowIndex, minLineY) => {
1691
+ return invoke$a('TokenizeIncremental.tokenizeIncremental', uid, languageId, oldLine, newLine, rowIndex, minLineY);
1692
+ };
1693
+ const getTokensViewPort = (slimEditor, startLineIndex, endLineIndex, hasLinesToSend, id, linesToSend) => {
1694
+ return invoke$a('GetTokensViewport.getTokensViewport', slimEditor, startLineIndex, endLineIndex, hasLinesToSend, id, linesToSend);
1695
+ };
1696
+ const loadTokenizer$1 = (languageId, tokenizerPath) => {
1697
+ return invoke$a('Tokenizer.load', languageId, tokenizerPath);
1698
+ };
1713
1699
 
1714
1700
  const SyntaxHighlightingWorker = {
1715
1701
  __proto__: null,
1716
1702
  dispose: dispose$1,
1703
+ getTokensViewPort,
1717
1704
  invoke: invoke$a,
1718
1705
  invokeAndTransfer,
1719
- set: set$9
1706
+ loadTokenizer: loadTokenizer$1,
1707
+ set: set$9,
1708
+ tokenizeIncremental
1720
1709
  };
1721
1710
 
1722
1711
  const createLazyRpc = rpcId => {
@@ -1789,7 +1778,7 @@ const create$9 = () => {
1789
1778
  },
1790
1779
  getKeys() {
1791
1780
  return Object.keys(states).map(key => {
1792
- return Number.parseInt(key);
1781
+ return Number.parseFloat(key);
1793
1782
  });
1794
1783
  },
1795
1784
  registerCommands(commandMap) {
@@ -1831,6 +1820,37 @@ const create$9 = () => {
1831
1820
  return fn(newState, ...args);
1832
1821
  };
1833
1822
  return wrapped;
1823
+ },
1824
+ wrapLoadContent(fn) {
1825
+ const wrapped = async (uid, ...args) => {
1826
+ const {
1827
+ newState,
1828
+ oldState
1829
+ } = states[uid];
1830
+ const result = await fn(newState, ...args);
1831
+ const {
1832
+ error,
1833
+ state
1834
+ } = result;
1835
+ if (oldState === state || newState === state) {
1836
+ return {
1837
+ error
1838
+ };
1839
+ }
1840
+ const latestOld = states[uid];
1841
+ const latestNew = {
1842
+ ...latestOld.newState,
1843
+ ...state
1844
+ };
1845
+ states[uid] = {
1846
+ newState: latestNew,
1847
+ oldState: latestOld.oldState
1848
+ };
1849
+ return {
1850
+ error
1851
+ };
1852
+ };
1853
+ return wrapped;
1834
1854
  }
1835
1855
  };
1836
1856
  };
@@ -1854,7 +1874,7 @@ const codeGeneratorAccept = state => {
1854
1874
  const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
1855
1875
 
1856
1876
  const launchWorker = async (name, url, intializeCommand) => {
1857
- const rpc = await create$c({
1877
+ const rpc = await create$e({
1858
1878
  commandMap: {},
1859
1879
  isMessagePortOpen: true,
1860
1880
  async send(port) {
@@ -1920,7 +1940,7 @@ const {
1920
1940
 
1921
1941
  const emptyIncrementalEdits = [];
1922
1942
 
1923
- const ColorPicker = 41;
1943
+ const ColorPicker$1 = 41;
1924
1944
  const EditorCompletion = 9;
1925
1945
  const Empty = 0;
1926
1946
  const FindWidget = 16;
@@ -2004,6 +2024,73 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
2004
2024
  set$8(id, editor, editor);
2005
2025
  };
2006
2026
 
2027
+ const AltKey = 'event.altKey';
2028
+ const Button = 'event.button';
2029
+ const ClientX = 'event.clientX';
2030
+ const ClientY = 'event.clientY';
2031
+ const DeltaMode = 'event.deltaMode';
2032
+ const DeltaY = 'event.deltaY';
2033
+
2034
+ const Backspace = 1;
2035
+ const Tab$1 = 2;
2036
+ const Enter = 3;
2037
+ const Escape = 8;
2038
+ const Space$1 = 9;
2039
+ const End = 255;
2040
+ const Home = 12;
2041
+ const LeftArrow = 13;
2042
+ const UpArrow = 14;
2043
+ const RightArrow = 15;
2044
+ const DownArrow = 16;
2045
+ const Delete$1 = 18;
2046
+ const KeyA = 29;
2047
+ const KeyC = 31;
2048
+ const KeyD = 32;
2049
+ const KeyF = 34;
2050
+ const KeyH = 36;
2051
+ const KeyJ = 38;
2052
+ const KeyK = 39;
2053
+ const KeyL = 40;
2054
+ const KeyO = 43;
2055
+ const KeyV = 50;
2056
+ const KeyX = 52;
2057
+ const KeyZ = 54;
2058
+ const F2 = 58;
2059
+ const F3 = 59;
2060
+ const F4 = 60;
2061
+ const F12 = 68;
2062
+ const Period = 87;
2063
+ const Slash$1 = 88;
2064
+ const BracketLeft = 90;
2065
+ const BracketRight = 92;
2066
+
2067
+ const CodeGenerator = 1;
2068
+ const ColorPicker = 2;
2069
+ const Completion = 3;
2070
+ const CompletionDetail = 4;
2071
+ const Find = 5;
2072
+ const Hover = 6;
2073
+ const Rename$1 = 7;
2074
+ const SourceAction$1 = 8;
2075
+
2076
+ const CtrlCmd = 1 << 11 >>> 0;
2077
+ const Shift = 1 << 10 >>> 0;
2078
+ const Alt$1 = 1 << 9 >>> 0;
2079
+
2080
+ const Editor$1 = 3;
2081
+ const SourceControl = 22;
2082
+
2083
+ const Separator = 1;
2084
+ const None = 0;
2085
+
2086
+ const FocusSelector = 'Viewlet.focusSelector';
2087
+ const SetCss$1 = 'Viewlet.setCss';
2088
+ const SetFocusContext$1 = 'Viewlet.setFocusContext';
2089
+ const SetPatches = 'Viewlet.setPatches';
2090
+
2091
+ const FocusEditorText$1 = 12;
2092
+ const FocusExplorer = 13;
2093
+
2007
2094
  // TODO use numeric enum
2008
2095
  const CompositionUpdate = 'compositionUpdate';
2009
2096
  const ContentEditableInput = 'contentEditableInput';
@@ -5073,7 +5160,7 @@ const create$7 = () => {
5073
5160
  const create$6 = () => {
5074
5161
  const completionUid = create$7();
5075
5162
  const widget = {
5076
- id: ColorPicker$1,
5163
+ id: ColorPicker,
5077
5164
  newState: {
5078
5165
  commands: [],
5079
5166
  height: 0,
@@ -5098,7 +5185,7 @@ const newStateGenerator$6 = (state, parentUid) => {
5098
5185
  return loadContent$3(state, parentUid);
5099
5186
  };
5100
5187
  const openColorPicker = async editor => {
5101
- return addWidgetToEditor(ColorPicker$1, ColorPicker, editor, create$6, newStateGenerator$6);
5188
+ return addWidgetToEditor(ColorPicker, ColorPicker$1, editor, create$6, newStateGenerator$6);
5102
5189
  };
5103
5190
 
5104
5191
  const state$4 = {
@@ -9383,7 +9470,7 @@ const editorUnindent = editor => {
9383
9470
 
9384
9471
  const isFunctional = widgetId => {
9385
9472
  switch (widgetId) {
9386
- case ColorPicker$1:
9473
+ case ColorPicker:
9387
9474
  case Completion:
9388
9475
  case Find:
9389
9476
  case Hover:
@@ -9428,7 +9515,7 @@ const addWidget$1 = (widget, id, render) => {
9428
9515
 
9429
9516
  const getWidgetInvoke = widgetId => {
9430
9517
  switch (widgetId) {
9431
- case ColorPicker$1:
9518
+ case ColorPicker:
9432
9519
  return invoke$9;
9433
9520
  case Completion:
9434
9521
  return invoke$4;
@@ -9905,13 +9992,13 @@ const HandleWheel = 'handleWheel';
9905
9992
  const Div = 4;
9906
9993
  const Input = 6;
9907
9994
  const Span = 8;
9908
- const Text = 12;
9995
+ const Text$1 = 12;
9909
9996
 
9910
9997
  const text = data => {
9911
9998
  return {
9912
9999
  childCount: 0,
9913
10000
  text: data,
9914
- type: Text
10001
+ type: Text$1
9915
10002
  };
9916
10003
  };
9917
10004
 
@@ -10893,7 +10980,7 @@ const handleBeforeInput = (editor, inputType, data) => {
10893
10980
  };
10894
10981
 
10895
10982
  const handleMessagePort = async (port, rpcId) => {
10896
- const rpc = await create$d({
10983
+ const rpc = await create$c({
10897
10984
  commandMap: {},
10898
10985
  messagePort: port
10899
10986
  });
@@ -11013,7 +11100,7 @@ const sendMessagePortToExtensionHostWorker2 = async (port, initialCommand, rpcId
11013
11100
  const createExtensionHostRpc = async () => {
11014
11101
  try {
11015
11102
  const initialCommand = 'HandleMessagePort.handleMessagePort2';
11016
- const rpc = await create$c({
11103
+ const rpc = await create$e({
11017
11104
  commandMap: {},
11018
11105
  async send(port) {
11019
11106
  await sendMessagePortToExtensionHostWorker2(port, initialCommand, EditorWorker);
@@ -11032,7 +11119,7 @@ const initializeExtensionHost = async () => {
11032
11119
 
11033
11120
  const createExtensionManagementWorkerRpc = async () => {
11034
11121
  try {
11035
- const rpc = await create$c({
11122
+ const rpc = await create$e({
11036
11123
  commandMap: {},
11037
11124
  async send(port) {
11038
11125
  await sendMessagePortToExtensionManagementWorker(port, EditorWorker);
@@ -11059,7 +11146,7 @@ const send$1 = port => {
11059
11146
  };
11060
11147
  const initializeOpenerWorker = async () => {
11061
11148
  try {
11062
- const rpc = await create$f({
11149
+ const rpc = await create$d({
11063
11150
  commandMap: {},
11064
11151
  send: send$1
11065
11152
  });
@@ -11082,7 +11169,7 @@ const sendMessagePortToSyntaxHighlightingWorker = async port => {
11082
11169
 
11083
11170
  const createSyntaxHighlightingWorkerRpc = async () => {
11084
11171
  try {
11085
- const rpc = await create$c({
11172
+ const rpc = await create$e({
11086
11173
  commandMap: {},
11087
11174
  send: sendMessagePortToSyntaxHighlightingWorker
11088
11175
  });
@@ -11107,7 +11194,7 @@ const send = port => {
11107
11194
  return sendMessagePortToTextMeasurementWorker(port);
11108
11195
  };
11109
11196
  const initializeTextMeasurementWorker = async () => {
11110
- const rpc = await create$f({
11197
+ const rpc = await create$d({
11111
11198
  commandMap: {},
11112
11199
  send
11113
11200
  });
@@ -11396,6 +11483,9 @@ const renderFocusContext$1 = (oldState, newState) => {
11396
11483
  return [SetFocusContext$1, newState.uid, FocusExplorer];
11397
11484
  };
11398
11485
 
11486
+ const Text = 12;
11487
+ const Reference = 100;
11488
+
11399
11489
  const SetText = 1;
11400
11490
  const Replace = 2;
11401
11491
  const SetAttribute = 3;
@@ -11484,7 +11574,7 @@ const compareNodes = (oldNode, newNode) => {
11484
11574
  return patches;
11485
11575
  }
11486
11576
  // Handle text nodes
11487
- if (oldNode.type === Text$1 && newNode.type === Text$1) {
11577
+ if (oldNode.type === Text && newNode.type === Text) {
11488
11578
  if (oldNode.text !== newNode.text) {
11489
11579
  patches.push({
11490
11580
  type: SetText,
@@ -12825,7 +12915,7 @@ const EditorHoverWidget = {
12825
12915
  };
12826
12916
 
12827
12917
  const registerWidgets = () => {
12828
- set$7(ColorPicker$1, EditorColorPickerWidget);
12918
+ set$7(ColorPicker, EditorColorPickerWidget);
12829
12919
  set$7(Completion, EditorCompletionWidget);
12830
12920
  set$7(CompletionDetail, EditorCompletionDetailWidget);
12831
12921
  set$7(Find, EditorFindWidget);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "18.5.0",
3
+ "version": "18.6.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"