@lvce-editor/editor-worker 19.47.0 → 19.48.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.
@@ -3374,6 +3374,7 @@ const HAS_SCHEME_PATTERN = /^(?:https?|ftp|ftps|file):\/\//;
3374
3374
 
3375
3375
  // Regex to check if URL starts with www.
3376
3376
  const HAS_WWW_PATTERN = /^www\./;
3377
+ const TEMPLATE_EXPRESSION_START = '${';
3377
3378
  const TRAILING_SENTENCE_PUNCTUATION = '.,;:!?';
3378
3379
  const OPENING_DELIMITER_MAP = {
3379
3380
  ')': '(',
@@ -3423,8 +3424,8 @@ const detectLinks = text => {
3423
3424
  const links = [];
3424
3425
  for (const match of matches) {
3425
3426
  const url = trimTrailingPunctuation(match[0]);
3426
- // Only consider as link if it has a scheme or starts with www.
3427
- if (HAS_SCHEME_PATTERN.test(url) || HAS_WWW_PATTERN.test(url)) {
3427
+ // Only consider static links with a scheme or www prefix.
3428
+ if (!url.includes(TEMPLATE_EXPRESSION_START) && (HAS_SCHEME_PATTERN.test(url) || HAS_WWW_PATTERN.test(url))) {
3428
3429
  links.push({
3429
3430
  length: url.length,
3430
3431
  start: match.index ?? 0
@@ -5531,7 +5532,7 @@ const isEqual$3 = (oldState, newState) => {
5531
5532
  };
5532
5533
 
5533
5534
  const isEqual$2 = (oldState, newState) => {
5534
- return oldState.breadcrumbsEnabled === newState.breadcrumbsEnabled && oldState.breakPoints === newState.breakPoints && oldState.bracketMatchInfos === newState.bracketMatchInfos && oldState.cursorInfos === newState.cursorInfos && oldState.diagnostics === newState.diagnostics && oldState.documentSymbols === newState.documentSymbols && oldState.endOfLineDecorations === newState.endOfLineDecorations && oldState.gutterDecorations === newState.gutterDecorations && oldState.highlightedLine === newState.highlightedLine && oldState.lineNumbers === newState.lineNumbers && oldState.loadError === newState.loadError && oldState.textInfos === newState.textInfos && oldState.differences === newState.differences && oldState.initial === newState.initial && oldState.selectionInfos === newState.selectionInfos && oldState.selections === newState.selections && oldState.workspaceUri === newState.workspaceUri;
5535
+ return oldState.breadcrumbsEnabled === newState.breadcrumbsEnabled && oldState.breakPoints === newState.breakPoints && oldState.bracketMatchInfos === newState.bracketMatchInfos && oldState.cursorInfos === newState.cursorInfos && oldState.diagnostics === newState.diagnostics && oldState.documentSymbols === newState.documentSymbols && oldState.endOfLineDecorations === newState.endOfLineDecorations && oldState.focused === newState.focused && oldState.gutterDecorations === newState.gutterDecorations && oldState.highlightedLine === newState.highlightedLine && oldState.lineNumbers === newState.lineNumbers && oldState.loadError === newState.loadError && oldState.textInfos === newState.textInfos && oldState.differences === newState.differences && oldState.initial === newState.initial && oldState.selectionInfos === newState.selectionInfos && oldState.selections === newState.selections && oldState.workspaceUri === newState.workspaceUri;
5535
5536
  };
5536
5537
 
5537
5538
  const isEqual$1 = (oldState, newState) => {
@@ -12551,6 +12552,7 @@ const HoverProblemMessage = 'HoverProblemMessage';
12551
12552
  const IconClose = 'IconClose';
12552
12553
  const InputBox = 'InputBox';
12553
12554
  const MaskIcon = 'MaskIcon';
12555
+ const SelectionUnfocused = 'SelectionUnfocused';
12554
12556
  const Viewlet = 'Viewlet';
12555
12557
 
12556
12558
  const HandleBeforeInput = 1;
@@ -14960,8 +14962,9 @@ const getEditorRowsVirtualDom = (textInfos, differences, lineNumbers = true, hig
14960
14962
  }, ...rowsDom];
14961
14963
  };
14962
14964
 
14963
- const getSelectionsVirtualDom = selections => {
14965
+ const getSelectionsVirtualDom = (selections, focused = true) => {
14964
14966
  const dom = [];
14967
+ const className = focused ? EditorSelection : mergeClassNames(EditorSelection, SelectionUnfocused);
14965
14968
  for (let i = 0; i < selections.length; i += 4) {
14966
14969
  const x = selections[i];
14967
14970
  const y = selections[i + 1];
@@ -14969,7 +14972,7 @@ const getSelectionsVirtualDom = selections => {
14969
14972
  const height = selections[i + 3];
14970
14973
  dom.push({
14971
14974
  childCount: 0,
14972
- className: EditorSelection,
14975
+ className,
14973
14976
  height,
14974
14977
  left: x,
14975
14978
  top: y,
@@ -14980,8 +14983,8 @@ const getSelectionsVirtualDom = selections => {
14980
14983
  return dom;
14981
14984
  };
14982
14985
 
14983
- const getEditorSelectionsVirtualDom = selectionInfos => {
14984
- const selectionsDom = getSelectionsVirtualDom(selectionInfos);
14986
+ const getEditorSelectionsVirtualDom = (selectionInfos, focused = true) => {
14987
+ const selectionsDom = getSelectionsVirtualDom(selectionInfos, focused);
14985
14988
  return [{
14986
14989
  childCount: selectionInfos.length / 4,
14987
14990
  className: 'Selections',
@@ -14994,8 +14997,8 @@ const editorLayersNode = {
14994
14997
  className: 'EditorLayers',
14995
14998
  type: Div
14996
14999
  };
14997
- const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineNumbers = true, highlightedLine = -1, cursorInfos = [], diagnostics = [], visibleLineIndices = [], endOfLineDecorations = [], bracketMatchInfos = []) => {
14998
- return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine, visibleLineIndices, endOfLineDecorations), ...getEditorCursorsVirtualDom(cursorInfos), ...getEditorDiagnosticsVirtualDom(diagnostics, bracketMatchInfos)];
15000
+ const getEditorLayersVirtualDom = (selectionInfos, textInfos, differences, lineNumbers = true, highlightedLine = -1, cursorInfos = [], diagnostics = [], visibleLineIndices = [], endOfLineDecorations = [], bracketMatchInfos = [], focused = true) => {
15001
+ return [editorLayersNode, ...getEditorSelectionsVirtualDom(selectionInfos, focused), ...getEditorRowsVirtualDom(textInfos, differences, lineNumbers, highlightedLine, visibleLineIndices, endOfLineDecorations), ...getEditorCursorsVirtualDom(cursorInfos), ...getEditorDiagnosticsVirtualDom(diagnostics, bracketMatchInfos)];
14999
15002
  };
15000
15003
 
15001
15004
  const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
@@ -15057,6 +15060,7 @@ const getEditorContentVirtualDom = ({
15057
15060
  diagnostics = [],
15058
15061
  differences,
15059
15062
  endOfLineDecorations = [],
15063
+ focused = true,
15060
15064
  highlightedLine = -1,
15061
15065
  lineNumbers = true,
15062
15066
  scrollBarDiagnostics = [],
@@ -15064,7 +15068,7 @@ const getEditorContentVirtualDom = ({
15064
15068
  textInfos,
15065
15069
  visibleLineIndices = []
15066
15070
  }) => {
15067
- return [editorContentNode, ...getEditorInputVirtualDom(), ...getEditorLayersVirtualDom(selectionInfos, textInfos, differences, lineNumbers, highlightedLine, cursorInfos, diagnostics, visibleLineIndices, endOfLineDecorations, bracketMatchInfos), ...getEditorScrollBarDiagnosticsVirtualDom(scrollBarDiagnostics), ...getScrollBarVirtualDom()];
15071
+ return [editorContentNode, ...getEditorInputVirtualDom(), ...getEditorLayersVirtualDom(selectionInfos, textInfos, differences, lineNumbers, highlightedLine, cursorInfos, diagnostics, visibleLineIndices, endOfLineDecorations, bracketMatchInfos, focused), ...getEditorScrollBarDiagnosticsVirtualDom(scrollBarDiagnostics), ...getScrollBarVirtualDom()];
15068
15072
  };
15069
15073
 
15070
15074
  const getGutterInfoVirtualDom = (gutterInfo, activeLineNumber) => {
@@ -15193,6 +15197,7 @@ const getEditorVirtualDom = ({
15193
15197
  differences,
15194
15198
  documentSymbols = [],
15195
15199
  endOfLineDecorations = [],
15200
+ focused = true,
15196
15201
  gutterDecorations = [],
15197
15202
  gutterInfos = [],
15198
15203
  highlightedLine = -1,
@@ -15250,6 +15255,7 @@ const getEditorVirtualDom = ({
15250
15255
  diagnostics,
15251
15256
  differences,
15252
15257
  endOfLineDecorations,
15258
+ focused,
15253
15259
  highlightedLine,
15254
15260
  lineNumbers,
15255
15261
  scrollBarDiagnostics,
@@ -15456,10 +15462,10 @@ const renderSelections = {
15456
15462
  selectionInfos = []
15457
15463
  } = newState;
15458
15464
  const cursorsDom = getCursorsVirtualDom(cursorInfos);
15459
- const selectionsDom = getSelectionsVirtualDom(selectionInfos);
15465
+ const selectionsDom = getSelectionsVirtualDom(selectionInfos, newState.focused);
15460
15466
  return [/* method */'setSelections', cursorsDom, selectionsDom];
15461
15467
  },
15462
- isEqual: (oldState, newState) => oldState.cursorInfos === newState.cursorInfos && oldState.selectionInfos === newState.selectionInfos
15468
+ isEqual: (oldState, newState) => oldState.cursorInfos === newState.cursorInfos && oldState.selectionInfos === newState.selectionInfos && oldState.focused === newState.focused
15463
15469
  };
15464
15470
  const renderCss = {
15465
15471
  apply: renderCss$1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.47.0",
3
+ "version": "19.48.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"