forgecad 0.9.16 → 0.10.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.
- package/dist/assets/{AdminPage-CXvls4-J.js → AdminPage-DwYHz72L.js} +1 -1
- package/dist/assets/{BenchmarkPage-B27zk8xL.js → BenchmarkPage-a9_f-1US.js} +1 -1
- package/dist/assets/{BlogPage-CMAVvgQL.js → BlogPage-DodHpvmf.js} +1 -1
- package/dist/assets/{DocsPage-knf4I4h7.js → DocsPage-B5LePEuj.js} +8 -858
- package/dist/assets/EditorApp-QXsAISLR.js +16307 -0
- package/dist/assets/{EmbedViewer-D7ZGlFjx.js → EmbedViewer-DdEHGUMU.js} +2 -2
- package/dist/assets/{LandingPageProofDriven-CnevhTE8.js → LandingPageProofDriven-yhhOodbf.js} +1 -1
- package/dist/assets/{LegalPage-BPTUmqeg.js → LegalPage-5RbKRGYK.js} +1 -1
- package/dist/assets/{PricingPage-B0D4goG_.js → PricingPage-E3Rma7aV.js} +1 -1
- package/dist/assets/{SettingsPage-CFF-UgjI.js → SettingsPage-BJZcM97j.js} +1 -1
- package/dist/assets/{app-T0pDcSX4.js → app-DSYrDg0V.js} +733 -205
- package/dist/assets/cli/{render-C5pcIISc.js → render-ZMHR9HkV.js} +19 -46
- package/dist/assets/{constructionHistoryWorker-Ba2Hm58b.js → constructionHistoryWorker-AwMMWSxg.js} +1103 -349
- package/dist/assets/{evalWorker-vkx310U2.js → evalWorker-DbNs7Dkp.js} +3798 -1622
- package/dist/assets/{inspectWorker-BuTJDVX6.js → inspectWorker-CZsCFtQT.js} +1163 -409
- package/dist/assets/{jointPose-B_Cgedn9.js → jointPose-DO6mnXn_.js} +1 -1
- package/dist/assets/{manifold-BWgsjmAM.js → manifold-BGlQBBH9.js} +1 -1
- package/dist/assets/{manifold-rZexZI0G.js → manifold-BU-tJwQh.js} +1 -1
- package/dist/assets/{manifold-D6IFSkhH.js → manifold-fy2MV7K1.js} +2 -2
- package/dist/assets/{reportWorker-0AGij1Ru.js → reportWorker-DO6hcQbh.js} +7155 -2437
- package/dist/assets/{scalar-sampling-budget-J5cuzxT1.js → scalar-sampling-budget-o90NSNmF.js} +3940 -1742
- package/dist/assets/{scanProxyWorker-Vl4Wxa1y.js → scanProxyWorker-2GtDLk-R.js} +1 -1
- package/dist/assets/{javascript-1kQXfVaz.js → typescript-DBQ6RN5l.js} +874 -22
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +3 -3
- package/dist/docs-raw/AI/usage.md +1 -1
- package/dist/docs-raw/CLI.md +63 -241
- package/dist/docs-raw/README.md +6 -0
- package/dist/docs-raw/component-model.md +17 -150
- package/dist/docs-raw/generated/assembly.md +139 -598
- package/dist/docs-raw/generated/concepts.md +245 -3501
- package/dist/docs-raw/generated/core.md +277 -1251
- package/dist/docs-raw/generated/curves.md +387 -1608
- package/dist/docs-raw/generated/legacy.md +162 -0
- package/dist/docs-raw/generated/lib.md +227 -85
- package/dist/docs-raw/generated/output.md +38 -73
- package/dist/docs-raw/generated/runtime-names.md +23 -23
- package/dist/docs-raw/generated/sdf.md +68 -284
- package/dist/docs-raw/generated/sheet-metal.md +68 -335
- package/dist/docs-raw/generated/sketch.md +240 -1161
- package/dist/docs-raw/generated/viewport.md +75 -316
- package/dist/docs-raw/generated/wood.md +21 -49
- package/dist/docs-raw/guides/coordinate-system.md +4 -42
- package/dist/docs-raw/guides/inspection-bundles.md +44 -442
- package/dist/docs-raw/guides/joint-design.md +18 -79
- package/dist/docs-raw/guides/positioning.md +21 -143
- package/dist/docs-raw/guides/scene-presentation.md +89 -0
- package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +25 -111
- package/dist/docs-raw/skills/forgecad-blockout-model.md +20 -117
- package/dist/docs-raw/skills/forgecad-component-model.md +23 -107
- package/dist/docs-raw/skills/forgecad-high-level-spec.md +47 -155
- package/dist/docs-raw/skills/forgecad-image-replicator.md +26 -143
- package/dist/docs-raw/skills/forgecad-lld.md +19 -113
- package/dist/docs-raw/skills/forgecad-make-a-model.md +112 -532
- package/dist/docs-raw/skills/forgecad-model-grader.md +38 -108
- package/dist/docs-raw/skills/forgecad-prepare-prompt.md +24 -211
- package/dist/docs-raw/skills/forgecad-project.md +13 -131
- package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +42 -134
- package/dist/docs-raw/skills/forgecad-render-inspect.md +27 -174
- package/dist/docs-raw/skills/forgecad-visual-spec.md +32 -112
- package/dist/docs-raw/skills/forgecad.md +19 -18
- package/dist/docs-raw/skills/index.md +2 -0
- package/dist/docs-raw/welcome.md +2 -2
- package/dist/index.html +1 -1
- package/dist/llms.txt +1 -2
- package/dist/sitemap.xml +13 -13
- package/dist-cli/{check-compiler-SYQ2PWOB.js → check-compiler-JTVBITCR.js} +1 -1
- package/dist-cli/{check-query-propagation-HIAGV62W.js → check-query-propagation-3FFLSMVN.js} +1 -1
- package/dist-cli/{chunk-SPZE3DUY.js → chunk-OAN5T4XD.js} +4412 -2212
- package/dist-cli/forgecad.js +507 -179
- package/dist-skill/CONTEXT.md +2172 -8377
- package/dist-skill/SKILL.md +15 -15
- package/dist-skill/docs/API/core/concepts.md +27 -157
- package/dist-skill/docs/CLI.md +63 -241
- package/dist-skill/docs/generated/assembly.md +138 -549
- package/dist-skill/docs/generated/core.md +277 -1251
- package/dist-skill/docs/generated/curves.md +387 -1609
- package/dist-skill/docs/generated/lib.md +227 -85
- package/dist-skill/docs/generated/output.md +38 -73
- package/dist-skill/docs/generated/runtime-names.md +16 -21
- package/dist-skill/docs/generated/sdf.md +68 -284
- package/dist-skill/docs/generated/sheet-metal.md +68 -335
- package/dist-skill/docs/generated/sketch.md +240 -1160
- package/dist-skill/docs/generated/viewport.md +75 -223
- package/dist-skill/docs/generated/wood.md +21 -49
- package/dist-skill/docs/guides/coordinate-system.md +4 -42
- package/dist-skill/docs/guides/inspection-bundles.md +44 -442
- package/dist-skill/docs/guides/joint-design.md +18 -79
- package/dist-skill/docs/guides/positioning.md +21 -143
- package/dist-skill/docs/guides/scene-presentation.md +89 -0
- package/dist-skill/docs/guides/surface-members.md +26 -0
- package/dist-skill/library/forgecad-3d-reconstruction/SKILL.md +23 -111
- package/dist-skill/library/forgecad-blockout-model/SKILL.md +18 -117
- package/dist-skill/library/forgecad-component-model/SKILL.md +21 -107
- package/dist-skill/library/forgecad-high-level-spec/SKILL.md +45 -155
- package/dist-skill/library/forgecad-image-replicator/SKILL.md +24 -143
- package/dist-skill/library/forgecad-lld/SKILL.md +17 -113
- package/dist-skill/library/forgecad-make-a-model/SKILL.md +110 -532
- package/dist-skill/library/forgecad-model-grader/SKILL.md +36 -108
- package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +35 -224
- package/dist-skill/library/forgecad-prepare-prompt/references/default-profiles.md +43 -271
- package/dist-skill/library/forgecad-prepare-prompt/references/master-prompt.md +30 -99
- package/dist-skill/library/forgecad-project/SKILL.md +13 -133
- package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +29 -123
- package/dist-skill/library/forgecad-render-inspect/SKILL.md +25 -174
- package/dist-skill/library/forgecad-visual-spec/SKILL.md +30 -111
- package/dist-skill/website/skills/forgecad-3d-reconstruction.md +58 -0
- package/dist-skill/website/skills/forgecad-blockout-model.md +49 -0
- package/dist-skill/website/skills/forgecad-component-model.md +53 -0
- package/dist-skill/website/skills/forgecad-high-level-spec.md +101 -0
- package/dist-skill/website/skills/forgecad-image-replicator.md +63 -0
- package/dist-skill/website/skills/forgecad-lld.md +41 -0
- package/dist-skill/website/skills/forgecad-make-a-model.md +186 -0
- package/dist-skill/website/skills/forgecad-model-grader.md +82 -0
- package/dist-skill/website/skills/forgecad-prepare-prompt.md +63 -0
- package/dist-skill/website/skills/forgecad-project.md +26 -0
- package/dist-skill/website/skills/forgecad-reconstruction-benchmark.md +60 -0
- package/dist-skill/website/skills/forgecad-render-inspect.md +80 -0
- package/dist-skill/website/skills/forgecad-visual-spec.md +71 -0
- package/dist-skill/website/skills/forgecad.md +122 -0
- package/dist-skill/website/skills/index.md +26 -0
- package/examples/api/comparison-imported-sphere-candidate.forge.js +1 -1
- package/examples/api/conformal-product-ribbon.forge.js +1 -1
- package/examples/api/exact-sheet-shell-assembly.forge.js +1 -1
- package/examples/api/extrude-options.forge.js +4 -2
- package/examples/api/field-loft-drive-tip.forge.js +40 -0
- package/examples/api/guided-loft-olive-oil-bottle.forge.js +1 -1
- package/examples/api/highlight-debug.forge.js +10 -10
- package/examples/api/mesh-import-slats.forge.js +1 -1
- package/examples/api/real-product-curves.forge.js +1 -1
- package/examples/api/sculpt-box-circle-booleans.forge.js +1 -1
- package/examples/api/sdf-shapes.forge.js +2 -5
- package/examples/api/sketch-rounding-strategies.forge.js +6 -6
- package/examples/api/surface-member-bottle-cage.forge.js +3 -3
- package/examples/api/surface-member-conformal-product-ribbon.forge.js +3 -3
- package/examples/api/surface-member-razor-inlay.forge.js +1 -1
- package/examples/api/variable-sweep-test.forge.js +3 -3
- package/examples/mechanical/airplane-propeller.forge.js +74 -39
- package/examples/nurbs-surface.forge.js +1 -1
- package/examples/products/iphone.forge.js +1 -1
- package/package.json +1 -1
- package/dist/assets/EditorApp-BHMQlJ-D.js +0 -14686
- package/dist/docs-raw/guides/geometry-conventions.md +0 -52
- package/dist/docs-raw/guides/modeling-recipes.md +0 -78
- package/dist-skill/docs/guides/geometry-conventions.md +0 -52
- package/dist-skill/docs/guides/modeling-recipes.md +0 -78
- package/dist-skill/library/forgecad-visual-spec/references/prompt-template.md +0 -79
|
@@ -3,8 +3,8 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
var _a;
|
|
5
5
|
import { u as useParams, f as useNavigate, r as reactExports, j as jsxRuntimeExports, L as Link } from "./vendor-react-6j1Kke-Y.js";
|
|
6
|
-
import { H as HighlightJS, j as javascript
|
|
7
|
-
import { a as applyTheme } from "./app-
|
|
6
|
+
import { H as HighlightJS, t as typescript, j as javascript, a as json } from "./typescript-DBQ6RN5l.js";
|
|
7
|
+
import { a as applyTheme } from "./app-DSYrDg0V.js";
|
|
8
8
|
function M() {
|
|
9
9
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
10
10
|
}
|
|
@@ -1155,818 +1155,6 @@ g.walkTokens;
|
|
|
1155
1155
|
g.parseInline;
|
|
1156
1156
|
b.parse;
|
|
1157
1157
|
x.lex;
|
|
1158
|
-
const IDENT_RE = "[A-Za-z$_][0-9A-Za-z$_]*";
|
|
1159
|
-
const KEYWORDS = [
|
|
1160
|
-
"as",
|
|
1161
|
-
// for exports
|
|
1162
|
-
"in",
|
|
1163
|
-
"of",
|
|
1164
|
-
"if",
|
|
1165
|
-
"for",
|
|
1166
|
-
"while",
|
|
1167
|
-
"finally",
|
|
1168
|
-
"var",
|
|
1169
|
-
"new",
|
|
1170
|
-
"function",
|
|
1171
|
-
"do",
|
|
1172
|
-
"return",
|
|
1173
|
-
"void",
|
|
1174
|
-
"else",
|
|
1175
|
-
"break",
|
|
1176
|
-
"catch",
|
|
1177
|
-
"instanceof",
|
|
1178
|
-
"with",
|
|
1179
|
-
"throw",
|
|
1180
|
-
"case",
|
|
1181
|
-
"default",
|
|
1182
|
-
"try",
|
|
1183
|
-
"switch",
|
|
1184
|
-
"continue",
|
|
1185
|
-
"typeof",
|
|
1186
|
-
"delete",
|
|
1187
|
-
"let",
|
|
1188
|
-
"yield",
|
|
1189
|
-
"const",
|
|
1190
|
-
"class",
|
|
1191
|
-
// JS handles these with a special rule
|
|
1192
|
-
// "get",
|
|
1193
|
-
// "set",
|
|
1194
|
-
"debugger",
|
|
1195
|
-
"async",
|
|
1196
|
-
"await",
|
|
1197
|
-
"static",
|
|
1198
|
-
"import",
|
|
1199
|
-
"from",
|
|
1200
|
-
"export",
|
|
1201
|
-
"extends",
|
|
1202
|
-
// It's reached stage 3, which is "recommended for implementation":
|
|
1203
|
-
"using"
|
|
1204
|
-
];
|
|
1205
|
-
const LITERALS = [
|
|
1206
|
-
"true",
|
|
1207
|
-
"false",
|
|
1208
|
-
"null",
|
|
1209
|
-
"undefined",
|
|
1210
|
-
"NaN",
|
|
1211
|
-
"Infinity"
|
|
1212
|
-
];
|
|
1213
|
-
const TYPES = [
|
|
1214
|
-
// Fundamental objects
|
|
1215
|
-
"Object",
|
|
1216
|
-
"Function",
|
|
1217
|
-
"Boolean",
|
|
1218
|
-
"Symbol",
|
|
1219
|
-
// numbers and dates
|
|
1220
|
-
"Math",
|
|
1221
|
-
"Date",
|
|
1222
|
-
"Number",
|
|
1223
|
-
"BigInt",
|
|
1224
|
-
// text
|
|
1225
|
-
"String",
|
|
1226
|
-
"RegExp",
|
|
1227
|
-
// Indexed collections
|
|
1228
|
-
"Array",
|
|
1229
|
-
"Float32Array",
|
|
1230
|
-
"Float64Array",
|
|
1231
|
-
"Int8Array",
|
|
1232
|
-
"Uint8Array",
|
|
1233
|
-
"Uint8ClampedArray",
|
|
1234
|
-
"Int16Array",
|
|
1235
|
-
"Int32Array",
|
|
1236
|
-
"Uint16Array",
|
|
1237
|
-
"Uint32Array",
|
|
1238
|
-
"BigInt64Array",
|
|
1239
|
-
"BigUint64Array",
|
|
1240
|
-
// Keyed collections
|
|
1241
|
-
"Set",
|
|
1242
|
-
"Map",
|
|
1243
|
-
"WeakSet",
|
|
1244
|
-
"WeakMap",
|
|
1245
|
-
// Structured data
|
|
1246
|
-
"ArrayBuffer",
|
|
1247
|
-
"SharedArrayBuffer",
|
|
1248
|
-
"Atomics",
|
|
1249
|
-
"DataView",
|
|
1250
|
-
"JSON",
|
|
1251
|
-
// Control abstraction objects
|
|
1252
|
-
"Promise",
|
|
1253
|
-
"Generator",
|
|
1254
|
-
"GeneratorFunction",
|
|
1255
|
-
"AsyncFunction",
|
|
1256
|
-
// Reflection
|
|
1257
|
-
"Reflect",
|
|
1258
|
-
"Proxy",
|
|
1259
|
-
// Internationalization
|
|
1260
|
-
"Intl",
|
|
1261
|
-
// WebAssembly
|
|
1262
|
-
"WebAssembly"
|
|
1263
|
-
];
|
|
1264
|
-
const ERROR_TYPES = [
|
|
1265
|
-
"Error",
|
|
1266
|
-
"EvalError",
|
|
1267
|
-
"InternalError",
|
|
1268
|
-
"RangeError",
|
|
1269
|
-
"ReferenceError",
|
|
1270
|
-
"SyntaxError",
|
|
1271
|
-
"TypeError",
|
|
1272
|
-
"URIError"
|
|
1273
|
-
];
|
|
1274
|
-
const BUILT_IN_GLOBALS = [
|
|
1275
|
-
"setInterval",
|
|
1276
|
-
"setTimeout",
|
|
1277
|
-
"clearInterval",
|
|
1278
|
-
"clearTimeout",
|
|
1279
|
-
"require",
|
|
1280
|
-
"exports",
|
|
1281
|
-
"eval",
|
|
1282
|
-
"isFinite",
|
|
1283
|
-
"isNaN",
|
|
1284
|
-
"parseFloat",
|
|
1285
|
-
"parseInt",
|
|
1286
|
-
"decodeURI",
|
|
1287
|
-
"decodeURIComponent",
|
|
1288
|
-
"encodeURI",
|
|
1289
|
-
"encodeURIComponent",
|
|
1290
|
-
"escape",
|
|
1291
|
-
"unescape"
|
|
1292
|
-
];
|
|
1293
|
-
const BUILT_IN_VARIABLES = [
|
|
1294
|
-
"arguments",
|
|
1295
|
-
"this",
|
|
1296
|
-
"super",
|
|
1297
|
-
"console",
|
|
1298
|
-
"window",
|
|
1299
|
-
"document",
|
|
1300
|
-
"localStorage",
|
|
1301
|
-
"sessionStorage",
|
|
1302
|
-
"module",
|
|
1303
|
-
"global"
|
|
1304
|
-
// Node.js
|
|
1305
|
-
];
|
|
1306
|
-
const BUILT_INS = [].concat(
|
|
1307
|
-
BUILT_IN_GLOBALS,
|
|
1308
|
-
TYPES,
|
|
1309
|
-
ERROR_TYPES
|
|
1310
|
-
);
|
|
1311
|
-
function javascript(hljs) {
|
|
1312
|
-
const regex = hljs.regex;
|
|
1313
|
-
const hasClosingTag = (match, { after }) => {
|
|
1314
|
-
const tag = "</" + match[0].slice(1);
|
|
1315
|
-
const pos = match.input.indexOf(tag, after);
|
|
1316
|
-
return pos !== -1;
|
|
1317
|
-
};
|
|
1318
|
-
const IDENT_RE$1 = IDENT_RE;
|
|
1319
|
-
const FRAGMENT = {
|
|
1320
|
-
begin: "<>",
|
|
1321
|
-
end: "</>"
|
|
1322
|
-
};
|
|
1323
|
-
const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/;
|
|
1324
|
-
const XML_TAG = {
|
|
1325
|
-
begin: /<[A-Za-z0-9\\._:-]+/,
|
|
1326
|
-
end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
|
|
1327
|
-
/**
|
|
1328
|
-
* @param {RegExpMatchArray} match
|
|
1329
|
-
* @param {CallbackResponse} response
|
|
1330
|
-
*/
|
|
1331
|
-
isTrulyOpeningTag: (match, response) => {
|
|
1332
|
-
const afterMatchIndex = match[0].length + match.index;
|
|
1333
|
-
const nextChar = match.input[afterMatchIndex];
|
|
1334
|
-
if (
|
|
1335
|
-
// HTML should not include another raw `<` inside a tag
|
|
1336
|
-
// nested type?
|
|
1337
|
-
// `<Array<Array<number>>`, etc.
|
|
1338
|
-
nextChar === "<" || // the , gives away that this is not HTML
|
|
1339
|
-
// `<T, A extends keyof T, V>`
|
|
1340
|
-
nextChar === ","
|
|
1341
|
-
) {
|
|
1342
|
-
response.ignoreMatch();
|
|
1343
|
-
return;
|
|
1344
|
-
}
|
|
1345
|
-
if (nextChar === ">") {
|
|
1346
|
-
if (!hasClosingTag(match, { after: afterMatchIndex })) {
|
|
1347
|
-
response.ignoreMatch();
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
let m2;
|
|
1351
|
-
const afterMatch = match.input.substring(afterMatchIndex);
|
|
1352
|
-
if (m2 = afterMatch.match(/^\s*=/)) {
|
|
1353
|
-
response.ignoreMatch();
|
|
1354
|
-
return;
|
|
1355
|
-
}
|
|
1356
|
-
if (m2 = afterMatch.match(/^\s+extends\s+/)) {
|
|
1357
|
-
if (m2.index === 0) {
|
|
1358
|
-
response.ignoreMatch();
|
|
1359
|
-
return;
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
const KEYWORDS$1 = {
|
|
1365
|
-
$pattern: IDENT_RE,
|
|
1366
|
-
keyword: KEYWORDS,
|
|
1367
|
-
literal: LITERALS,
|
|
1368
|
-
built_in: BUILT_INS,
|
|
1369
|
-
"variable.language": BUILT_IN_VARIABLES
|
|
1370
|
-
};
|
|
1371
|
-
const decimalDigits = "[0-9](_?[0-9])*";
|
|
1372
|
-
const frac = `\\.(${decimalDigits})`;
|
|
1373
|
-
const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;
|
|
1374
|
-
const NUMBER = {
|
|
1375
|
-
className: "number",
|
|
1376
|
-
variants: [
|
|
1377
|
-
// DecimalLiteral
|
|
1378
|
-
{ begin: `(\\b(${decimalInteger})((${frac})|\\.)?|(${frac}))[eE][+-]?(${decimalDigits})\\b` },
|
|
1379
|
-
{ begin: `\\b(${decimalInteger})\\b((${frac})\\b|\\.)?|(${frac})\\b` },
|
|
1380
|
-
// DecimalBigIntegerLiteral
|
|
1381
|
-
{ begin: `\\b(0|[1-9](_?[0-9])*)n\\b` },
|
|
1382
|
-
// NonDecimalIntegerLiteral
|
|
1383
|
-
{ begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
|
|
1384
|
-
{ begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
|
|
1385
|
-
{ begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
|
|
1386
|
-
// LegacyOctalIntegerLiteral (does not include underscore separators)
|
|
1387
|
-
// https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
|
|
1388
|
-
{ begin: "\\b0[0-7]+n?\\b" }
|
|
1389
|
-
],
|
|
1390
|
-
relevance: 0
|
|
1391
|
-
};
|
|
1392
|
-
const SUBST = {
|
|
1393
|
-
className: "subst",
|
|
1394
|
-
begin: "\\$\\{",
|
|
1395
|
-
end: "\\}",
|
|
1396
|
-
keywords: KEYWORDS$1,
|
|
1397
|
-
contains: []
|
|
1398
|
-
// defined later
|
|
1399
|
-
};
|
|
1400
|
-
const HTML_TEMPLATE = {
|
|
1401
|
-
begin: ".?html`",
|
|
1402
|
-
end: "",
|
|
1403
|
-
starts: {
|
|
1404
|
-
end: "`",
|
|
1405
|
-
returnEnd: false,
|
|
1406
|
-
contains: [
|
|
1407
|
-
hljs.BACKSLASH_ESCAPE,
|
|
1408
|
-
SUBST
|
|
1409
|
-
],
|
|
1410
|
-
subLanguage: "xml"
|
|
1411
|
-
}
|
|
1412
|
-
};
|
|
1413
|
-
const CSS_TEMPLATE = {
|
|
1414
|
-
begin: ".?css`",
|
|
1415
|
-
end: "",
|
|
1416
|
-
starts: {
|
|
1417
|
-
end: "`",
|
|
1418
|
-
returnEnd: false,
|
|
1419
|
-
contains: [
|
|
1420
|
-
hljs.BACKSLASH_ESCAPE,
|
|
1421
|
-
SUBST
|
|
1422
|
-
],
|
|
1423
|
-
subLanguage: "css"
|
|
1424
|
-
}
|
|
1425
|
-
};
|
|
1426
|
-
const GRAPHQL_TEMPLATE = {
|
|
1427
|
-
begin: ".?gql`",
|
|
1428
|
-
end: "",
|
|
1429
|
-
starts: {
|
|
1430
|
-
end: "`",
|
|
1431
|
-
returnEnd: false,
|
|
1432
|
-
contains: [
|
|
1433
|
-
hljs.BACKSLASH_ESCAPE,
|
|
1434
|
-
SUBST
|
|
1435
|
-
],
|
|
1436
|
-
subLanguage: "graphql"
|
|
1437
|
-
}
|
|
1438
|
-
};
|
|
1439
|
-
const TEMPLATE_STRING = {
|
|
1440
|
-
className: "string",
|
|
1441
|
-
begin: "`",
|
|
1442
|
-
end: "`",
|
|
1443
|
-
contains: [
|
|
1444
|
-
hljs.BACKSLASH_ESCAPE,
|
|
1445
|
-
SUBST
|
|
1446
|
-
]
|
|
1447
|
-
};
|
|
1448
|
-
const JSDOC_COMMENT = hljs.COMMENT(
|
|
1449
|
-
/\/\*\*(?!\/)/,
|
|
1450
|
-
"\\*/",
|
|
1451
|
-
{
|
|
1452
|
-
relevance: 0,
|
|
1453
|
-
contains: [
|
|
1454
|
-
{
|
|
1455
|
-
begin: "(?=@[A-Za-z]+)",
|
|
1456
|
-
relevance: 0,
|
|
1457
|
-
contains: [
|
|
1458
|
-
{
|
|
1459
|
-
className: "doctag",
|
|
1460
|
-
begin: "@[A-Za-z]+"
|
|
1461
|
-
},
|
|
1462
|
-
{
|
|
1463
|
-
className: "type",
|
|
1464
|
-
begin: "\\{",
|
|
1465
|
-
end: "\\}",
|
|
1466
|
-
excludeEnd: true,
|
|
1467
|
-
excludeBegin: true,
|
|
1468
|
-
relevance: 0
|
|
1469
|
-
},
|
|
1470
|
-
{
|
|
1471
|
-
className: "variable",
|
|
1472
|
-
begin: IDENT_RE$1 + "(?=\\s*(-)|$)",
|
|
1473
|
-
endsParent: true,
|
|
1474
|
-
relevance: 0
|
|
1475
|
-
},
|
|
1476
|
-
// eat spaces (not newlines) so we can find
|
|
1477
|
-
// types or variables
|
|
1478
|
-
{
|
|
1479
|
-
begin: /(?=[^\n])\s/,
|
|
1480
|
-
relevance: 0
|
|
1481
|
-
}
|
|
1482
|
-
]
|
|
1483
|
-
}
|
|
1484
|
-
]
|
|
1485
|
-
}
|
|
1486
|
-
);
|
|
1487
|
-
const COMMENT = {
|
|
1488
|
-
className: "comment",
|
|
1489
|
-
variants: [
|
|
1490
|
-
JSDOC_COMMENT,
|
|
1491
|
-
hljs.C_BLOCK_COMMENT_MODE,
|
|
1492
|
-
hljs.C_LINE_COMMENT_MODE
|
|
1493
|
-
]
|
|
1494
|
-
};
|
|
1495
|
-
const SUBST_INTERNALS = [
|
|
1496
|
-
hljs.APOS_STRING_MODE,
|
|
1497
|
-
hljs.QUOTE_STRING_MODE,
|
|
1498
|
-
HTML_TEMPLATE,
|
|
1499
|
-
CSS_TEMPLATE,
|
|
1500
|
-
GRAPHQL_TEMPLATE,
|
|
1501
|
-
TEMPLATE_STRING,
|
|
1502
|
-
// Skip numbers when they are part of a variable name
|
|
1503
|
-
{ match: /\$\d+/ },
|
|
1504
|
-
NUMBER
|
|
1505
|
-
// This is intentional:
|
|
1506
|
-
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
1507
|
-
// hljs.REGEXP_MODE
|
|
1508
|
-
];
|
|
1509
|
-
SUBST.contains = SUBST_INTERNALS.concat({
|
|
1510
|
-
// we need to pair up {} inside our subst to prevent
|
|
1511
|
-
// it from ending too early by matching another }
|
|
1512
|
-
begin: /\{/,
|
|
1513
|
-
end: /\}/,
|
|
1514
|
-
keywords: KEYWORDS$1,
|
|
1515
|
-
contains: [
|
|
1516
|
-
"self"
|
|
1517
|
-
].concat(SUBST_INTERNALS)
|
|
1518
|
-
});
|
|
1519
|
-
const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);
|
|
1520
|
-
const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([
|
|
1521
|
-
// eat recursive parens in sub expressions
|
|
1522
|
-
{
|
|
1523
|
-
begin: /(\s*)\(/,
|
|
1524
|
-
end: /\)/,
|
|
1525
|
-
keywords: KEYWORDS$1,
|
|
1526
|
-
contains: ["self"].concat(SUBST_AND_COMMENTS)
|
|
1527
|
-
}
|
|
1528
|
-
]);
|
|
1529
|
-
const PARAMS = {
|
|
1530
|
-
className: "params",
|
|
1531
|
-
// convert this to negative lookbehind in v12
|
|
1532
|
-
begin: /(\s*)\(/,
|
|
1533
|
-
// to match the parms with
|
|
1534
|
-
end: /\)/,
|
|
1535
|
-
excludeBegin: true,
|
|
1536
|
-
excludeEnd: true,
|
|
1537
|
-
keywords: KEYWORDS$1,
|
|
1538
|
-
contains: PARAMS_CONTAINS
|
|
1539
|
-
};
|
|
1540
|
-
const CLASS_OR_EXTENDS = {
|
|
1541
|
-
variants: [
|
|
1542
|
-
// class Car extends vehicle
|
|
1543
|
-
{
|
|
1544
|
-
match: [
|
|
1545
|
-
/class/,
|
|
1546
|
-
/\s+/,
|
|
1547
|
-
IDENT_RE$1,
|
|
1548
|
-
/\s+/,
|
|
1549
|
-
/extends/,
|
|
1550
|
-
/\s+/,
|
|
1551
|
-
regex.concat(IDENT_RE$1, "(", regex.concat(/\./, IDENT_RE$1), ")*")
|
|
1552
|
-
],
|
|
1553
|
-
scope: {
|
|
1554
|
-
1: "keyword",
|
|
1555
|
-
3: "title.class",
|
|
1556
|
-
5: "keyword",
|
|
1557
|
-
7: "title.class.inherited"
|
|
1558
|
-
}
|
|
1559
|
-
},
|
|
1560
|
-
// class Car
|
|
1561
|
-
{
|
|
1562
|
-
match: [
|
|
1563
|
-
/class/,
|
|
1564
|
-
/\s+/,
|
|
1565
|
-
IDENT_RE$1
|
|
1566
|
-
],
|
|
1567
|
-
scope: {
|
|
1568
|
-
1: "keyword",
|
|
1569
|
-
3: "title.class"
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
]
|
|
1573
|
-
};
|
|
1574
|
-
const CLASS_REFERENCE = {
|
|
1575
|
-
relevance: 0,
|
|
1576
|
-
match: regex.either(
|
|
1577
|
-
// Hard coded exceptions
|
|
1578
|
-
/\bJSON/,
|
|
1579
|
-
// Float32Array, OutT
|
|
1580
|
-
/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
|
|
1581
|
-
// CSSFactory, CSSFactoryT
|
|
1582
|
-
/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
|
|
1583
|
-
// FPs, FPsT
|
|
1584
|
-
/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
|
|
1585
|
-
// P
|
|
1586
|
-
// single letters are not highlighted
|
|
1587
|
-
// BLAH
|
|
1588
|
-
// this will be flagged as a UPPER_CASE_CONSTANT instead
|
|
1589
|
-
),
|
|
1590
|
-
className: "title.class",
|
|
1591
|
-
keywords: {
|
|
1592
|
-
_: [
|
|
1593
|
-
// se we still get relevance credit for JS library classes
|
|
1594
|
-
...TYPES,
|
|
1595
|
-
...ERROR_TYPES
|
|
1596
|
-
]
|
|
1597
|
-
}
|
|
1598
|
-
};
|
|
1599
|
-
const USE_STRICT = {
|
|
1600
|
-
label: "use_strict",
|
|
1601
|
-
className: "meta",
|
|
1602
|
-
relevance: 10,
|
|
1603
|
-
begin: /^\s*['"]use (strict|asm)['"]/
|
|
1604
|
-
};
|
|
1605
|
-
const FUNCTION_DEFINITION = {
|
|
1606
|
-
variants: [
|
|
1607
|
-
{
|
|
1608
|
-
match: [
|
|
1609
|
-
/function/,
|
|
1610
|
-
/\s+/,
|
|
1611
|
-
IDENT_RE$1,
|
|
1612
|
-
/(?=\s*\()/
|
|
1613
|
-
]
|
|
1614
|
-
},
|
|
1615
|
-
// anonymous function
|
|
1616
|
-
{
|
|
1617
|
-
match: [
|
|
1618
|
-
/function/,
|
|
1619
|
-
/\s*(?=\()/
|
|
1620
|
-
]
|
|
1621
|
-
}
|
|
1622
|
-
],
|
|
1623
|
-
className: {
|
|
1624
|
-
1: "keyword",
|
|
1625
|
-
3: "title.function"
|
|
1626
|
-
},
|
|
1627
|
-
label: "func.def",
|
|
1628
|
-
contains: [PARAMS],
|
|
1629
|
-
illegal: /%/
|
|
1630
|
-
};
|
|
1631
|
-
const UPPER_CASE_CONSTANT = {
|
|
1632
|
-
relevance: 0,
|
|
1633
|
-
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
1634
|
-
className: "variable.constant"
|
|
1635
|
-
};
|
|
1636
|
-
function noneOf(list) {
|
|
1637
|
-
return regex.concat("(?!", list.join("|"), ")");
|
|
1638
|
-
}
|
|
1639
|
-
const FUNCTION_CALL = {
|
|
1640
|
-
match: regex.concat(
|
|
1641
|
-
/\b/,
|
|
1642
|
-
noneOf([
|
|
1643
|
-
...BUILT_IN_GLOBALS,
|
|
1644
|
-
"super",
|
|
1645
|
-
"import"
|
|
1646
|
-
].map((x2) => `${x2}\\s*\\(`)),
|
|
1647
|
-
IDENT_RE$1,
|
|
1648
|
-
regex.lookahead(/\s*\(/)
|
|
1649
|
-
),
|
|
1650
|
-
className: "title.function",
|
|
1651
|
-
relevance: 0
|
|
1652
|
-
};
|
|
1653
|
-
const PROPERTY_ACCESS = {
|
|
1654
|
-
begin: regex.concat(/\./, regex.lookahead(
|
|
1655
|
-
regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)
|
|
1656
|
-
)),
|
|
1657
|
-
end: IDENT_RE$1,
|
|
1658
|
-
excludeBegin: true,
|
|
1659
|
-
keywords: "prototype",
|
|
1660
|
-
className: "property",
|
|
1661
|
-
relevance: 0
|
|
1662
|
-
};
|
|
1663
|
-
const GETTER_OR_SETTER = {
|
|
1664
|
-
match: [
|
|
1665
|
-
/get|set/,
|
|
1666
|
-
/\s+/,
|
|
1667
|
-
IDENT_RE$1,
|
|
1668
|
-
/(?=\()/
|
|
1669
|
-
],
|
|
1670
|
-
className: {
|
|
1671
|
-
1: "keyword",
|
|
1672
|
-
3: "title.function"
|
|
1673
|
-
},
|
|
1674
|
-
contains: [
|
|
1675
|
-
{
|
|
1676
|
-
// eat to avoid empty params
|
|
1677
|
-
begin: /\(\)/
|
|
1678
|
-
},
|
|
1679
|
-
PARAMS
|
|
1680
|
-
]
|
|
1681
|
-
};
|
|
1682
|
-
const FUNC_LEAD_IN_RE = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + hljs.UNDERSCORE_IDENT_RE + ")\\s*=>";
|
|
1683
|
-
const FUNCTION_VARIABLE = {
|
|
1684
|
-
match: [
|
|
1685
|
-
/const|var|let/,
|
|
1686
|
-
/\s+/,
|
|
1687
|
-
IDENT_RE$1,
|
|
1688
|
-
/\s*/,
|
|
1689
|
-
/=\s*/,
|
|
1690
|
-
/(async\s*)?/,
|
|
1691
|
-
// async is optional
|
|
1692
|
-
regex.lookahead(FUNC_LEAD_IN_RE)
|
|
1693
|
-
],
|
|
1694
|
-
keywords: "async",
|
|
1695
|
-
className: {
|
|
1696
|
-
1: "keyword",
|
|
1697
|
-
3: "title.function"
|
|
1698
|
-
},
|
|
1699
|
-
contains: [
|
|
1700
|
-
PARAMS
|
|
1701
|
-
]
|
|
1702
|
-
};
|
|
1703
|
-
return {
|
|
1704
|
-
name: "JavaScript",
|
|
1705
|
-
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
1706
|
-
keywords: KEYWORDS$1,
|
|
1707
|
-
// this will be extended by TypeScript
|
|
1708
|
-
exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
|
|
1709
|
-
illegal: /#(?![$_A-z])/,
|
|
1710
|
-
contains: [
|
|
1711
|
-
hljs.SHEBANG({
|
|
1712
|
-
label: "shebang",
|
|
1713
|
-
binary: "node",
|
|
1714
|
-
relevance: 5
|
|
1715
|
-
}),
|
|
1716
|
-
USE_STRICT,
|
|
1717
|
-
hljs.APOS_STRING_MODE,
|
|
1718
|
-
hljs.QUOTE_STRING_MODE,
|
|
1719
|
-
HTML_TEMPLATE,
|
|
1720
|
-
CSS_TEMPLATE,
|
|
1721
|
-
GRAPHQL_TEMPLATE,
|
|
1722
|
-
TEMPLATE_STRING,
|
|
1723
|
-
COMMENT,
|
|
1724
|
-
// Skip numbers when they are part of a variable name
|
|
1725
|
-
{ match: /\$\d+/ },
|
|
1726
|
-
NUMBER,
|
|
1727
|
-
CLASS_REFERENCE,
|
|
1728
|
-
{
|
|
1729
|
-
scope: "attr",
|
|
1730
|
-
match: IDENT_RE$1 + regex.lookahead(":"),
|
|
1731
|
-
relevance: 0
|
|
1732
|
-
},
|
|
1733
|
-
FUNCTION_VARIABLE,
|
|
1734
|
-
{
|
|
1735
|
-
// "value" container
|
|
1736
|
-
begin: "(" + hljs.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
1737
|
-
keywords: "return throw case",
|
|
1738
|
-
relevance: 0,
|
|
1739
|
-
contains: [
|
|
1740
|
-
COMMENT,
|
|
1741
|
-
hljs.REGEXP_MODE,
|
|
1742
|
-
{
|
|
1743
|
-
className: "function",
|
|
1744
|
-
// we have to count the parens to make sure we actually have the
|
|
1745
|
-
// correct bounding ( ) before the =>. There could be any number of
|
|
1746
|
-
// sub-expressions inside also surrounded by parens.
|
|
1747
|
-
begin: FUNC_LEAD_IN_RE,
|
|
1748
|
-
returnBegin: true,
|
|
1749
|
-
end: "\\s*=>",
|
|
1750
|
-
contains: [
|
|
1751
|
-
{
|
|
1752
|
-
className: "params",
|
|
1753
|
-
variants: [
|
|
1754
|
-
{
|
|
1755
|
-
begin: hljs.UNDERSCORE_IDENT_RE,
|
|
1756
|
-
relevance: 0
|
|
1757
|
-
},
|
|
1758
|
-
{
|
|
1759
|
-
className: null,
|
|
1760
|
-
begin: /\(\s*\)/,
|
|
1761
|
-
skip: true
|
|
1762
|
-
},
|
|
1763
|
-
{
|
|
1764
|
-
begin: /(\s*)\(/,
|
|
1765
|
-
end: /\)/,
|
|
1766
|
-
excludeBegin: true,
|
|
1767
|
-
excludeEnd: true,
|
|
1768
|
-
keywords: KEYWORDS$1,
|
|
1769
|
-
contains: PARAMS_CONTAINS
|
|
1770
|
-
}
|
|
1771
|
-
]
|
|
1772
|
-
}
|
|
1773
|
-
]
|
|
1774
|
-
},
|
|
1775
|
-
{
|
|
1776
|
-
// could be a comma delimited list of params to a function call
|
|
1777
|
-
begin: /,/,
|
|
1778
|
-
relevance: 0
|
|
1779
|
-
},
|
|
1780
|
-
{
|
|
1781
|
-
match: /\s+/,
|
|
1782
|
-
relevance: 0
|
|
1783
|
-
},
|
|
1784
|
-
{
|
|
1785
|
-
// JSX
|
|
1786
|
-
variants: [
|
|
1787
|
-
{ begin: FRAGMENT.begin, end: FRAGMENT.end },
|
|
1788
|
-
{ match: XML_SELF_CLOSING },
|
|
1789
|
-
{
|
|
1790
|
-
begin: XML_TAG.begin,
|
|
1791
|
-
// we carefully check the opening tag to see if it truly
|
|
1792
|
-
// is a tag and not a false positive
|
|
1793
|
-
"on:begin": XML_TAG.isTrulyOpeningTag,
|
|
1794
|
-
end: XML_TAG.end
|
|
1795
|
-
}
|
|
1796
|
-
],
|
|
1797
|
-
subLanguage: "xml",
|
|
1798
|
-
contains: [
|
|
1799
|
-
{
|
|
1800
|
-
begin: XML_TAG.begin,
|
|
1801
|
-
end: XML_TAG.end,
|
|
1802
|
-
skip: true,
|
|
1803
|
-
contains: ["self"]
|
|
1804
|
-
}
|
|
1805
|
-
]
|
|
1806
|
-
}
|
|
1807
|
-
]
|
|
1808
|
-
},
|
|
1809
|
-
FUNCTION_DEFINITION,
|
|
1810
|
-
{
|
|
1811
|
-
// prevent this from getting swallowed up by function
|
|
1812
|
-
// since they appear "function like"
|
|
1813
|
-
beginKeywords: "while if switch catch for"
|
|
1814
|
-
},
|
|
1815
|
-
{
|
|
1816
|
-
// we have to count the parens to make sure we actually have the correct
|
|
1817
|
-
// bounding ( ). There could be any number of sub-expressions inside
|
|
1818
|
-
// also surrounded by parens.
|
|
1819
|
-
begin: "\\b(?!function)" + hljs.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
|
|
1820
|
-
// end parens
|
|
1821
|
-
returnBegin: true,
|
|
1822
|
-
label: "func.def",
|
|
1823
|
-
contains: [
|
|
1824
|
-
PARAMS,
|
|
1825
|
-
hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: "title.function" })
|
|
1826
|
-
]
|
|
1827
|
-
},
|
|
1828
|
-
// catch ... so it won't trigger the property rule below
|
|
1829
|
-
{
|
|
1830
|
-
match: /\.\.\./,
|
|
1831
|
-
relevance: 0
|
|
1832
|
-
},
|
|
1833
|
-
PROPERTY_ACCESS,
|
|
1834
|
-
// hack: prevents detection of keywords in some circumstances
|
|
1835
|
-
// .keyword()
|
|
1836
|
-
// $keyword = x
|
|
1837
|
-
{
|
|
1838
|
-
match: "\\$" + IDENT_RE$1,
|
|
1839
|
-
relevance: 0
|
|
1840
|
-
},
|
|
1841
|
-
{
|
|
1842
|
-
match: [/\bconstructor(?=\s*\()/],
|
|
1843
|
-
className: { 1: "title.function" },
|
|
1844
|
-
contains: [PARAMS]
|
|
1845
|
-
},
|
|
1846
|
-
FUNCTION_CALL,
|
|
1847
|
-
UPPER_CASE_CONSTANT,
|
|
1848
|
-
CLASS_OR_EXTENDS,
|
|
1849
|
-
GETTER_OR_SETTER,
|
|
1850
|
-
{
|
|
1851
|
-
match: /\$[(.]/
|
|
1852
|
-
// relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
|
|
1853
|
-
}
|
|
1854
|
-
]
|
|
1855
|
-
};
|
|
1856
|
-
}
|
|
1857
|
-
function typescript(hljs) {
|
|
1858
|
-
const regex = hljs.regex;
|
|
1859
|
-
const tsLanguage = javascript(hljs);
|
|
1860
|
-
const IDENT_RE$1 = IDENT_RE;
|
|
1861
|
-
const TYPES2 = [
|
|
1862
|
-
"any",
|
|
1863
|
-
"void",
|
|
1864
|
-
"number",
|
|
1865
|
-
"boolean",
|
|
1866
|
-
"string",
|
|
1867
|
-
"object",
|
|
1868
|
-
"never",
|
|
1869
|
-
"symbol",
|
|
1870
|
-
"bigint",
|
|
1871
|
-
"unknown"
|
|
1872
|
-
];
|
|
1873
|
-
const NAMESPACE = {
|
|
1874
|
-
begin: [
|
|
1875
|
-
/namespace/,
|
|
1876
|
-
/\s+/,
|
|
1877
|
-
hljs.IDENT_RE
|
|
1878
|
-
],
|
|
1879
|
-
beginScope: {
|
|
1880
|
-
1: "keyword",
|
|
1881
|
-
3: "title.class"
|
|
1882
|
-
}
|
|
1883
|
-
};
|
|
1884
|
-
const INTERFACE = {
|
|
1885
|
-
beginKeywords: "interface",
|
|
1886
|
-
end: /\{/,
|
|
1887
|
-
excludeEnd: true,
|
|
1888
|
-
keywords: {
|
|
1889
|
-
keyword: "interface extends",
|
|
1890
|
-
built_in: TYPES2
|
|
1891
|
-
},
|
|
1892
|
-
contains: [tsLanguage.exports.CLASS_REFERENCE]
|
|
1893
|
-
};
|
|
1894
|
-
const USE_STRICT = {
|
|
1895
|
-
className: "meta",
|
|
1896
|
-
relevance: 10,
|
|
1897
|
-
begin: /^\s*['"]use strict['"]/
|
|
1898
|
-
};
|
|
1899
|
-
const TS_SPECIFIC_KEYWORDS = [
|
|
1900
|
-
"type",
|
|
1901
|
-
// "namespace",
|
|
1902
|
-
"interface",
|
|
1903
|
-
"public",
|
|
1904
|
-
"private",
|
|
1905
|
-
"protected",
|
|
1906
|
-
"implements",
|
|
1907
|
-
"declare",
|
|
1908
|
-
"abstract",
|
|
1909
|
-
"readonly",
|
|
1910
|
-
"enum",
|
|
1911
|
-
"override",
|
|
1912
|
-
"satisfies"
|
|
1913
|
-
];
|
|
1914
|
-
const KEYWORDS$1 = {
|
|
1915
|
-
$pattern: IDENT_RE,
|
|
1916
|
-
keyword: KEYWORDS.concat(TS_SPECIFIC_KEYWORDS),
|
|
1917
|
-
literal: LITERALS,
|
|
1918
|
-
built_in: BUILT_INS.concat(TYPES2),
|
|
1919
|
-
"variable.language": BUILT_IN_VARIABLES
|
|
1920
|
-
};
|
|
1921
|
-
const DECORATOR = {
|
|
1922
|
-
className: "meta",
|
|
1923
|
-
begin: "@" + IDENT_RE$1
|
|
1924
|
-
};
|
|
1925
|
-
const swapMode = (mode, label, replacement) => {
|
|
1926
|
-
const indx = mode.contains.findIndex((m2) => m2.label === label);
|
|
1927
|
-
if (indx === -1) {
|
|
1928
|
-
throw new Error("can not find mode to replace");
|
|
1929
|
-
}
|
|
1930
|
-
mode.contains.splice(indx, 1, replacement);
|
|
1931
|
-
};
|
|
1932
|
-
Object.assign(tsLanguage.keywords, KEYWORDS$1);
|
|
1933
|
-
tsLanguage.exports.PARAMS_CONTAINS.push(DECORATOR);
|
|
1934
|
-
const ATTRIBUTE_HIGHLIGHT = tsLanguage.contains.find((c) => c.scope === "attr");
|
|
1935
|
-
const OPTIONAL_KEY_OR_ARGUMENT = Object.assign(
|
|
1936
|
-
{},
|
|
1937
|
-
ATTRIBUTE_HIGHLIGHT,
|
|
1938
|
-
{ match: regex.concat(IDENT_RE$1, regex.lookahead(/\s*\?:/)) }
|
|
1939
|
-
);
|
|
1940
|
-
tsLanguage.exports.PARAMS_CONTAINS.push([
|
|
1941
|
-
tsLanguage.exports.CLASS_REFERENCE,
|
|
1942
|
-
// class reference for highlighting the params types
|
|
1943
|
-
ATTRIBUTE_HIGHLIGHT,
|
|
1944
|
-
// highlight the params key
|
|
1945
|
-
OPTIONAL_KEY_OR_ARGUMENT
|
|
1946
|
-
// Added for optional property assignment highlighting
|
|
1947
|
-
]);
|
|
1948
|
-
tsLanguage.contains = tsLanguage.contains.concat([
|
|
1949
|
-
DECORATOR,
|
|
1950
|
-
NAMESPACE,
|
|
1951
|
-
INTERFACE,
|
|
1952
|
-
OPTIONAL_KEY_OR_ARGUMENT
|
|
1953
|
-
// Added for optional property assignment highlighting
|
|
1954
|
-
]);
|
|
1955
|
-
swapMode(tsLanguage, "shebang", hljs.SHEBANG());
|
|
1956
|
-
swapMode(tsLanguage, "use_strict", USE_STRICT);
|
|
1957
|
-
const functionDeclaration = tsLanguage.contains.find((m2) => m2.label === "func.def");
|
|
1958
|
-
functionDeclaration.relevance = 0;
|
|
1959
|
-
Object.assign(tsLanguage, {
|
|
1960
|
-
name: "TypeScript",
|
|
1961
|
-
aliases: [
|
|
1962
|
-
"ts",
|
|
1963
|
-
"tsx",
|
|
1964
|
-
"mts",
|
|
1965
|
-
"cts"
|
|
1966
|
-
]
|
|
1967
|
-
});
|
|
1968
|
-
return tsLanguage;
|
|
1969
|
-
}
|
|
1970
1158
|
function bash(hljs) {
|
|
1971
1159
|
const regex = hljs.regex;
|
|
1972
1160
|
const VAR = {};
|
|
@@ -2078,7 +1266,7 @@ function bash(hljs) {
|
|
|
2078
1266
|
contains: [hljs.inherit(hljs.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
|
|
2079
1267
|
relevance: 0
|
|
2080
1268
|
};
|
|
2081
|
-
const
|
|
1269
|
+
const KEYWORDS = [
|
|
2082
1270
|
"if",
|
|
2083
1271
|
"then",
|
|
2084
1272
|
"else",
|
|
@@ -2097,7 +1285,7 @@ function bash(hljs) {
|
|
|
2097
1285
|
"function",
|
|
2098
1286
|
"select"
|
|
2099
1287
|
];
|
|
2100
|
-
const
|
|
1288
|
+
const LITERALS = [
|
|
2101
1289
|
"true",
|
|
2102
1290
|
"false"
|
|
2103
1291
|
];
|
|
@@ -2329,8 +1517,8 @@ function bash(hljs) {
|
|
|
2329
1517
|
],
|
|
2330
1518
|
keywords: {
|
|
2331
1519
|
$pattern: /\b[a-z][a-z0-9._-]+\b/,
|
|
2332
|
-
keyword:
|
|
2333
|
-
literal:
|
|
1520
|
+
keyword: KEYWORDS,
|
|
1521
|
+
literal: LITERALS,
|
|
2334
1522
|
built_in: [
|
|
2335
1523
|
...SHELL_BUILT_INS,
|
|
2336
1524
|
...BASH_BUILT_INS,
|
|
@@ -2359,44 +1547,6 @@ function bash(hljs) {
|
|
|
2359
1547
|
]
|
|
2360
1548
|
};
|
|
2361
1549
|
}
|
|
2362
|
-
function json(hljs) {
|
|
2363
|
-
const ATTRIBUTE = {
|
|
2364
|
-
className: "attr",
|
|
2365
|
-
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
2366
|
-
relevance: 1.01
|
|
2367
|
-
};
|
|
2368
|
-
const PUNCTUATION = {
|
|
2369
|
-
match: /[{}[\],:]/,
|
|
2370
|
-
className: "punctuation",
|
|
2371
|
-
relevance: 0
|
|
2372
|
-
};
|
|
2373
|
-
const LITERALS2 = [
|
|
2374
|
-
"true",
|
|
2375
|
-
"false",
|
|
2376
|
-
"null"
|
|
2377
|
-
];
|
|
2378
|
-
const LITERALS_MODE = {
|
|
2379
|
-
scope: "literal",
|
|
2380
|
-
beginKeywords: LITERALS2.join(" ")
|
|
2381
|
-
};
|
|
2382
|
-
return {
|
|
2383
|
-
name: "JSON",
|
|
2384
|
-
aliases: ["jsonc"],
|
|
2385
|
-
keywords: {
|
|
2386
|
-
literal: LITERALS2
|
|
2387
|
-
},
|
|
2388
|
-
contains: [
|
|
2389
|
-
ATTRIBUTE,
|
|
2390
|
-
PUNCTUATION,
|
|
2391
|
-
hljs.QUOTE_STRING_MODE,
|
|
2392
|
-
LITERALS_MODE,
|
|
2393
|
-
hljs.C_NUMBER_MODE,
|
|
2394
|
-
hljs.C_LINE_COMMENT_MODE,
|
|
2395
|
-
hljs.C_BLOCK_COMMENT_MODE
|
|
2396
|
-
],
|
|
2397
|
-
illegal: "\\S"
|
|
2398
|
-
};
|
|
2399
|
-
}
|
|
2400
1550
|
function isArray(value) {
|
|
2401
1551
|
return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
|
|
2402
1552
|
}
|
|
@@ -3790,8 +2940,8 @@ const SKILL_SECTIONS = [
|
|
|
3790
2940
|
];
|
|
3791
2941
|
HighlightJS.registerLanguage("typescript", typescript);
|
|
3792
2942
|
HighlightJS.registerLanguage("ts", typescript);
|
|
3793
|
-
HighlightJS.registerLanguage("javascript", javascript
|
|
3794
|
-
HighlightJS.registerLanguage("js", javascript
|
|
2943
|
+
HighlightJS.registerLanguage("javascript", javascript);
|
|
2944
|
+
HighlightJS.registerLanguage("js", javascript);
|
|
3795
2945
|
HighlightJS.registerLanguage("bash", bash);
|
|
3796
2946
|
HighlightJS.registerLanguage("shell", bash);
|
|
3797
2947
|
HighlightJS.registerLanguage("json", json);
|