@yorun-ai/skel-highlight 0.11.2 → 0.12.1

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.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Frontend syntax-highlighting definitions for the Skel contract language. The package supports Shiki, PrismJS, Highlight.js, Monaco Editor, Starry Night, and CodeMirror 6. Its TextMate grammar is the canonical lexical definition shared with the VS Code extension.
4
4
 
5
+ Field names such as `data: list<TItem>` are distinguished from declaration keywords such as `data PageResp<TItem>` across the adapters.
6
+
5
7
  Install the package with only the highlighter used by your application. All highlighter peer dependencies are optional.
6
8
 
7
9
  ## Shiki
@@ -54,7 +54,6 @@ var builtinTypes = Object.freeze([
54
54
  "localdatetime",
55
55
  "uuid",
56
56
  "json",
57
- "PermissionCode",
58
57
  "list",
59
58
  "map"
60
59
  ]);
@@ -98,6 +97,7 @@ var skelStreamParser = {
98
97
  if (stream.match(/\d+(?:\.\d+)?/)) return "number";
99
98
  if (stream.match(/[A-Za-z_][A-Za-z0-9_]*/)) {
100
99
  const word = stream.current();
100
+ if (stream.match(/^[ \t]*:/, false)) return "variableName";
101
101
  if (keywordSet.has(word)) return "keyword";
102
102
  if (builtinTypeSet.has(word)) return "typeName";
103
103
  if (/^[A-Z]/.test(word)) return "className";
@@ -51,7 +51,6 @@ var builtinTypes = Object.freeze([
51
51
  "localdatetime",
52
52
  "uuid",
53
53
  "json",
54
- "PermissionCode",
55
54
  "list",
56
55
  "map"
57
56
  ]);
@@ -74,6 +73,7 @@ function skelHighlightJs(hljs) {
74
73
  { scope: "string", begin: /"""/, end: /"""/ },
75
74
  { scope: "string", begin: /"/, end: /"/, contains: [hljs.BACKSLASH_ESCAPE] },
76
75
  { scope: "meta", begin: /@[A-Za-z_][A-Za-z0-9_]*/ },
76
+ { scope: "property", begin: /\b[A-Za-z_][A-Za-z0-9_]*(?=[ \t]*:)/ },
77
77
  hljs.C_NUMBER_MODE,
78
78
  { scope: "title.class", begin: /\b[A-Z][A-Za-z0-9_]*\b/ }
79
79
  ]
package/dist/index.js CHANGED
@@ -315,7 +315,7 @@ var skel_tmLanguage_default = {
315
315
  patterns: [
316
316
  {
317
317
  name: "support.type.builtin.skel",
318
- match: "\\b(int|float|bool|string|decimal|binary|timestamp|duration|localdate|localtime|localdatetime|uuid|json|PermissionCode|list|map)\\b"
318
+ match: "\\b(int|float|bool|string|decimal|binary|timestamp|duration|localdate|localtime|localdatetime|uuid|json|list|map)\\b"
319
319
  }
320
320
  ]
321
321
  },
package/dist/monaco.js CHANGED
@@ -51,7 +51,6 @@ var builtinTypes = Object.freeze([
51
51
  "localdatetime",
52
52
  "uuid",
53
53
  "json",
54
- "PermissionCode",
55
54
  "list",
56
55
  "map"
57
56
  ]);
@@ -91,6 +90,7 @@ var skelMonarch = {
91
90
  [/"""/, "string", "@tripleString"],
92
91
  [/"(?:\\.|[^"\\])*"/, "string"],
93
92
  [/@[A-Za-z_][A-Za-z0-9_]*/, "annotation"],
93
+ [/[A-Za-z_][A-Za-z0-9_]*(?=[ \t]*:)/, "identifier"],
94
94
  [/[A-Za-z_][A-Za-z0-9_]*/, { cases: { "@keywords": "keyword", "@builtinTypes": "type", "@default": "identifier" } }],
95
95
  [/\d+(?:\.\d+)?/, "number"],
96
96
  [/[?=*]/, "operator"],
package/dist/prism.js CHANGED
@@ -51,7 +51,6 @@ var builtinTypes = Object.freeze([
51
51
  "localdatetime",
52
52
  "uuid",
53
53
  "json",
54
- "PermissionCode",
55
54
  "list",
56
55
  "map"
57
56
  ]);
@@ -78,6 +77,7 @@ var skelPrism = Object.freeze({
78
77
  pattern: /@[A-Za-z_][A-Za-z0-9_]*/,
79
78
  alias: "annotation"
80
79
  },
80
+ property: /\b[A-Za-z_][A-Za-z0-9_]*(?=[ \t]*:)/,
81
81
  "class-name": {
82
82
  pattern: declarationNamePattern,
83
83
  lookbehind: true
@@ -315,7 +315,7 @@ var skel_tmLanguage_default = {
315
315
  patterns: [
316
316
  {
317
317
  name: "support.type.builtin.skel",
318
- match: "\\b(int|float|bool|string|decimal|binary|timestamp|duration|localdate|localtime|localdatetime|uuid|json|PermissionCode|list|map)\\b"
318
+ match: "\\b(int|float|bool|string|decimal|binary|timestamp|duration|localdate|localtime|localdatetime|uuid|json|list|map)\\b"
319
319
  }
320
320
  ]
321
321
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yorun-ai/skel-highlight",
3
- "version": "0.11.2",
3
+ "version": "0.12.1",
4
4
  "description": "Syntax highlighting definitions for the Skel contract language.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -314,7 +314,7 @@
314
314
  "patterns": [
315
315
  {
316
316
  "name": "support.type.builtin.skel",
317
- "match": "\\b(int|float|bool|string|decimal|binary|timestamp|duration|localdate|localtime|localdatetime|uuid|json|PermissionCode|list|map)\\b"
317
+ "match": "\\b(int|float|bool|string|decimal|binary|timestamp|duration|localdate|localtime|localdatetime|uuid|json|list|map)\\b"
318
318
  }
319
319
  ]
320
320
  },