@lvce-editor/chat-view 6.69.0 → 6.70.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.
@@ -6997,6 +6997,28 @@ const jsRules = [{
6997
6997
  className: TokenKeyword,
6998
6998
  regex: /\b(?:const|let|var|function|return|if|else|for|while|class|new|typeof|instanceof|import|export|from|default|async|await|try|catch|finally|throw|this|true|false|null|undefined)\b/
6999
6999
  }];
7000
+ const tsRules = [{
7001
+ className: TokenComment,
7002
+ regex: /\/\/[^\n]*/
7003
+ }, {
7004
+ className: TokenComment,
7005
+ regex: /\/\*[\s\S]*?\*\//
7006
+ }, {
7007
+ className: TokenString,
7008
+ regex: /"[^"\\]*(?:\\.[^"\\]*)*"/
7009
+ }, {
7010
+ className: TokenString,
7011
+ regex: /'[^'\\]*(?:\\.[^'\\]*)*'/
7012
+ }, {
7013
+ className: TokenString,
7014
+ regex: /`[^`\\]*(?:\\.[^`\\]*)*`/
7015
+ }, {
7016
+ className: TokenNumber,
7017
+ regex: /\b\d+\.?\d*\b/
7018
+ }, {
7019
+ className: TokenKeyword,
7020
+ regex: /\b(?:abstract|any|as|asserts|async|await|boolean|class|const|constructor|declare|default|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|never|new|null|number|object|override|private|protected|public|readonly|return|satisfies|set|static|string|super|switch|symbol|this|throw|true|try|type|typeof|undefined|unknown|var|void|while)\b/
7021
+ }];
7000
7022
  const htmlRules = [{
7001
7023
  className: TokenComment,
7002
7024
  regex: /<!--[\s\S]*?-->/
@@ -7120,6 +7142,9 @@ const highlightCode = (code, language) => {
7120
7142
  if (normalized === 'js' || normalized === 'javascript') {
7121
7143
  return tokenize(code, jsRules);
7122
7144
  }
7145
+ if (normalized === 'ts' || normalized === 'typescript') {
7146
+ return tokenize(code, tsRules);
7147
+ }
7123
7148
  if (normalized === 'py' || normalized === 'python') {
7124
7149
  return tokenize(code, pythonRules);
7125
7150
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/chat-view",
3
- "version": "6.69.0",
3
+ "version": "6.70.0",
4
4
  "description": "Chat View Worker",
5
5
  "repository": {
6
6
  "type": "git",