@pb33f/cowboy-components 0.6.6 → 0.7.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/equalizer.worker-DyLD5JTU.js +1 -0
- package/dist/assets/search-problems.worker-BAF8L2rX.js +1 -0
- package/dist/components/auth/oauth-login.js +0 -1
- package/dist/components/changelog/changelog.js +1 -1
- package/dist/components/charts/beefy-chart.d.ts +21 -0
- package/dist/components/charts/beefy-chart.js +159 -0
- package/dist/components/charts/chart-colors.d.ts +27 -0
- package/dist/components/charts/chart-colors.js +76 -0
- package/dist/components/charts/config.d.ts +15 -0
- package/dist/components/charts/config.js +35 -0
- package/dist/components/charts/doughnut-chart.d.ts +22 -0
- package/dist/components/charts/doughnut-chart.js +128 -0
- package/dist/components/editor/editor.d.ts +9 -3
- package/dist/components/editor/editor.js +115 -60
- package/dist/components/editor/init.d.ts +0 -0
- package/dist/components/editor/init.js +28 -0
- package/dist/components/editor/schemas/openapi3.json +1651 -0
- package/dist/components/editor/schemas/openapi31.json +1449 -0
- package/dist/components/model-icon/model-icon.js +3 -0
- package/dist/components/model-renderer/callback.js +2 -1
- package/dist/components/model-renderer/change.css.d.ts +2 -0
- package/dist/components/model-renderer/change.css.js +254 -0
- package/dist/components/model-renderer/changes.d.ts +19 -0
- package/dist/components/model-renderer/changes.js +306 -0
- package/dist/components/model-renderer/clickable-ref.d.ts +10 -6
- package/dist/components/model-renderer/clickable-ref.js +9 -0
- package/dist/components/model-renderer/components.js +1 -0
- package/dist/components/model-renderer/contact.js +2 -1
- package/dist/components/model-renderer/document.js +11 -9
- package/dist/components/model-renderer/encoding.js +1 -0
- package/dist/components/model-renderer/example.js +1 -0
- package/dist/components/model-renderer/external-docs.js +1 -0
- package/dist/components/model-renderer/has-changes.d.ts +8 -0
- package/dist/components/model-renderer/has-changes.js +50 -0
- package/dist/components/model-renderer/header.js +1 -0
- package/dist/components/model-renderer/info.js +3 -1
- package/dist/components/model-renderer/license.js +3 -3
- package/dist/components/model-renderer/link.js +1 -1
- package/dist/components/model-renderer/media-type.js +1 -1
- package/dist/components/model-renderer/oauth-flows.js +2 -1
- package/dist/components/model-renderer/operation.js +2 -1
- package/dist/components/model-renderer/parameter.js +1 -0
- package/dist/components/model-renderer/path-item.js +1 -0
- package/dist/components/model-renderer/paths.js +1 -0
- package/dist/components/model-renderer/rendered-node.js +20 -20
- package/dist/components/model-renderer/rendered-property.css.js +4 -0
- package/dist/components/model-renderer/rendered-property.js +5 -2
- package/dist/components/model-renderer/request-body.js +1 -1
- package/dist/components/model-renderer/response.js +1 -1
- package/dist/components/model-renderer/schema.js +57 -54
- package/dist/components/model-renderer/security-scheme.js +1 -1
- package/dist/components/model-renderer/server.js +1 -0
- package/dist/components/model-renderer/tag.js +3 -1
- package/dist/components/model-tree/tree.d.ts +7 -4
- package/dist/components/model-tree/tree.js +54 -25
- package/dist/components/paginator/paginator.css.js +6 -3
- package/dist/components/paginator/paginator.d.ts +1 -0
- package/dist/components/paginator/paginator.js +26 -7
- package/dist/components/problem-list/problem-mainview.js +8 -1
- package/dist/components/rodeo/npm/download-statistic.d.ts +41 -0
- package/dist/components/rodeo/npm/download-statistic.js +634 -0
- package/dist/components/rodeo/rodeo-nav.js +1 -0
- package/dist/components/rodeo/rodeo.d.ts +1 -0
- package/dist/components/rodeo/rodeo.js +9 -2
- package/dist/components/rodeo/statistic.css.js +17 -0
- package/dist/components/rodeo/statistic.d.ts +4 -2
- package/dist/components/rodeo/statistic.js +15 -4
- package/dist/components/the-doctor/settings.css.d.ts +2 -0
- package/dist/components/the-doctor/settings.css.js +28 -0
- package/dist/components/the-doctor/settings.d.ts +13 -0
- package/dist/components/the-doctor/settings.js +83 -2
- package/dist/components/the-doctor/sparks.d.ts +3 -0
- package/dist/components/the-doctor/sparks.js +16 -5
- package/dist/components/the-doctor/the-doctor.css.js +80 -47
- package/dist/components/the-doctor/the-doctor.d.ts +24 -6
- package/dist/components/the-doctor/the-doctor.js +344 -109
- package/dist/components/the-doctor/upload-archive.js +1 -1
- package/dist/components/theme-switcher/theme-switcher.d.ts +1 -1
- package/dist/components/theme-switcher/theme-switcher.js +5 -2
- package/dist/components/time-vortex/change-list-item.css.d.ts +2 -0
- package/dist/components/time-vortex/change-list-item.css.js +96 -0
- package/dist/components/time-vortex/change-list-item.d.ts +10 -0
- package/dist/components/time-vortex/change-list-item.js +58 -0
- package/dist/components/time-vortex/history-picker.css.d.ts +2 -0
- package/dist/components/time-vortex/history-picker.css.js +90 -0
- package/dist/components/time-vortex/history-picker.d.ts +18 -0
- package/dist/components/time-vortex/history-picker.js +143 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.css.d.ts +2 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.css.js +144 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.d.ts +11 -0
- package/dist/components/time-vortex/spec-summary-timeline-item.js +153 -0
- package/dist/components/time-vortex/tardis-control.css.d.ts +2 -0
- package/dist/components/time-vortex/tardis-control.css.js +103 -0
- package/dist/components/time-vortex/tardis-control.d.ts +32 -0
- package/dist/components/time-vortex/tardis-control.js +286 -0
- package/dist/components/time-vortex/time-vortex.d.ts +17 -0
- package/dist/components/time-vortex/time-vortex.js +75 -0
- package/dist/components/time-vortex/timeline-view.css.d.ts +2 -0
- package/dist/components/time-vortex/timeline-view.css.js +28 -0
- package/dist/components/time-vortex/timeline-view.d.ts +32 -0
- package/dist/components/time-vortex/timeline-view.js +233 -0
- package/dist/components/timeline/timeline-item.css.js +95 -48
- package/dist/components/timeline/timeline-item.d.ts +1 -0
- package/dist/components/timeline/timeline-item.js +20 -1
- package/dist/components/timeline/timeline.css.js +46 -40
- package/dist/components/timeline/timeline.d.ts +1 -0
- package/dist/components/timeline/timeline.js +9 -5
- package/dist/components/toast/toast-component.css.js +4 -0
- package/dist/components/visualizer/equalizer.d.ts +2 -0
- package/dist/components/visualizer/equalizer.js +13 -5
- package/dist/components/visualizer/explorer.d.ts +5 -0
- package/dist/components/visualizer/explorer.js +41 -37
- package/dist/components/visualizer/foreign-object.js +3 -0
- package/dist/components/visualizer/nodes/callback.js +3 -1
- package/dist/components/visualizer/nodes/changes.css.d.ts +2 -0
- package/dist/components/visualizer/nodes/changes.css.js +33 -0
- package/dist/components/visualizer/nodes/components.js +3 -1
- package/dist/components/visualizer/nodes/contact.js +3 -1
- package/dist/components/visualizer/nodes/document.js +1 -0
- package/dist/components/visualizer/nodes/graph-node.d.ts +8 -7
- package/dist/components/visualizer/nodes/graph-node.js +55 -1
- package/dist/components/visualizer/nodes/header.js +3 -1
- package/dist/components/visualizer/nodes/info.js +3 -1
- package/dist/components/visualizer/nodes/license.js +8 -1
- package/dist/components/visualizer/nodes/link.js +3 -1
- package/dist/components/visualizer/nodes/media-type.js +3 -1
- package/dist/components/visualizer/nodes/operation.js +4 -1
- package/dist/components/visualizer/nodes/parameter.js +3 -1
- package/dist/components/visualizer/nodes/path-item.js +3 -1
- package/dist/components/visualizer/nodes/request-body.js +3 -1
- package/dist/components/visualizer/nodes/response.js +3 -1
- package/dist/components/visualizer/nodes/schema.js +3 -1
- package/dist/components/visualizer/nodes/security-scheme.js +3 -1
- package/dist/components/visualizer/nodes/server.js +3 -1
- package/dist/components/visualizer/nodes/tag.js +3 -1
- package/dist/components/visualizer/nodes/xml.js +3 -1
- package/dist/components/visualizer/orientation-controls.d.ts +1 -0
- package/dist/components/visualizer/orientation-controls.js +31 -16
- package/dist/components/visualizer/search.js +4 -3
- package/dist/components/warning-stripe/warning-stripe.d.ts +20 -0
- package/dist/components/warning-stripe/warning-stripe.js +124 -0
- package/dist/cowboy-components.umd.cjs +3849 -2221
- package/dist/css/panels.css.d.ts +2 -0
- package/dist/css/panels.css.js +44 -0
- package/dist/css/pb33f-theme.css +8 -1
- package/dist/css/scrollbar.css.d.ts +2 -0
- package/dist/css/scrollbar.css.js +16 -0
- package/dist/css/tabs.css.js +1 -1
- package/dist/events/doctor.d.ts +15 -1
- package/dist/events/doctor.js +5 -0
- package/dist/model/api-response.d.ts +6 -0
- package/dist/model/api-response.js +2 -0
- package/dist/model/chart-data.d.ts +15 -0
- package/dist/model/chart-data.js +1 -0
- package/dist/model/diagnostic-report.d.ts +5 -0
- package/dist/model/diagnostic-report.js +3 -0
- package/dist/model/document.d.ts +1 -0
- package/dist/model/graph.d.ts +26 -0
- package/dist/model/media-type.d.ts +2 -0
- package/dist/model/media-type.js +7 -0
- package/dist/model/node_type.d.ts +2 -0
- package/dist/model/node_type.js +2 -0
- package/dist/model/settings.d.ts +5 -0
- package/dist/model/settings.js +1 -0
- package/dist/model/timeline.d.ts +33 -0
- package/dist/model/timeline.js +1 -0
- package/dist/monacoeditorwork/css.worker.bundle.js +53460 -0
- package/dist/monacoeditorwork/editor.worker.bundle.js +13517 -0
- package/dist/monacoeditorwork/html.worker.bundle.js +29660 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +21318 -0
- package/dist/monacoeditorwork/yaml.worker..bundle.js +37321 -0
- package/dist/services/color-service.d.ts +1 -0
- package/dist/services/color-service.js +13 -0
- package/dist/services/linting-service.d.ts +1 -3
- package/dist/services/linting-service.js +21 -29
- package/dist/services/model-service.d.ts +1 -1
- package/dist/services/model-service.js +35 -8
- package/dist/services/rodeo-service.d.ts +6 -0
- package/dist/services/rodeo-service.js +134 -0
- package/dist/services/timeline-service.d.ts +8 -0
- package/dist/services/timeline-service.js +85 -0
- package/dist/style.css +1 -1
- package/dist/workers/equalizer.worker.js +1 -1
- package/dist/workers/search-problems.worker.js +1 -1
- package/package.json +6 -1
- package/dist/assets/css.worker-Byh--afc.js +0 -84
- package/dist/assets/editor.worker-CYC0jP-p.js +0 -12
- package/dist/assets/equalizer.worker-CdIiiqfH.js +0 -1
- package/dist/assets/html.worker-DArWg-Dy.js +0 -461
- package/dist/assets/json.worker-heCfXoJw.js +0 -49
- package/dist/assets/search-problems.worker-VJi4P9Gj.js +0 -1
|
@@ -4,37 +4,38 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import * as monaco from "monaco-editor";
|
|
8
|
+
import { configureMonacoYaml } from "monaco-yaml";
|
|
7
9
|
import { html, LitElement } from "lit";
|
|
8
10
|
import { customElement, property, state } from "lit/decorators.js";
|
|
9
11
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
10
|
-
// -- Monaco Editor Imports --
|
|
11
|
-
import * as monaco from "monaco-editor";
|
|
12
|
-
// @ts-ignore
|
|
13
|
-
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker.js?worker";
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker.js?worker";
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker.js?worker";
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker.js?worker";
|
|
20
12
|
import { DocumentReferenceClicked, EditorClicked, EditorUpdated } from "../../events/doctor.js";
|
|
21
13
|
import { SpecEditorBreadcrumb } from "./editor-breadcrumb.js";
|
|
22
14
|
import editorCss from "./editor.css.js";
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
// schemas
|
|
16
|
+
import openapi3 from './schemas/openapi3.json';
|
|
17
|
+
import openapi31 from './schemas/openapi31.json';
|
|
18
|
+
// register the YAML worker (only once)
|
|
19
|
+
configureMonacoYaml(monaco, {
|
|
20
|
+
// mirror the old setDiagnosticsOptions flags:
|
|
21
|
+
enableSchemaRequest: false, // we’re inlining the schemas
|
|
22
|
+
hover: true,
|
|
23
|
+
completion: true,
|
|
24
|
+
validate: true,
|
|
25
|
+
format: true,
|
|
26
|
+
schemas: [
|
|
27
|
+
// {
|
|
28
|
+
// uri: "inmemory://schema/openapi-3.0.json",
|
|
29
|
+
// fileMatch: ["*.yaml","*.yml"],
|
|
30
|
+
// schema: openapi3
|
|
31
|
+
// },
|
|
32
|
+
{
|
|
33
|
+
uri: "inmemory://schema/openapi-3.1.json",
|
|
34
|
+
fileMatch: ["*.yaml", "*.yml"],
|
|
35
|
+
schema: openapi31
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
37
|
+
]
|
|
38
|
+
});
|
|
38
39
|
const editorGreen = '#00FF00FF';
|
|
39
40
|
const editorGreenDim = '#008a00';
|
|
40
41
|
const editorRed = '#ff3c74';
|
|
@@ -193,7 +194,9 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
193
194
|
constructor(id = "spec") {
|
|
194
195
|
super();
|
|
195
196
|
this.container = createRef();
|
|
197
|
+
this.currentVersion = null;
|
|
196
198
|
this.decorationIdToLinkTarget = new Map();
|
|
199
|
+
this.linkRun = false;
|
|
197
200
|
this.id = id;
|
|
198
201
|
this.links = [];
|
|
199
202
|
this.decorationIdToLinkTarget = new Map();
|
|
@@ -272,11 +275,21 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
272
275
|
this.editor?.setValue(value);
|
|
273
276
|
}
|
|
274
277
|
getValue() {
|
|
275
|
-
|
|
278
|
+
if (this.editor) {
|
|
279
|
+
return this.editor.getValue();
|
|
280
|
+
}
|
|
281
|
+
return '';
|
|
282
|
+
}
|
|
283
|
+
updated(changed) {
|
|
284
|
+
if (changed.has("links")) {
|
|
285
|
+
this.applyLinkDecorations();
|
|
286
|
+
}
|
|
276
287
|
}
|
|
277
288
|
clearDecorations() {
|
|
278
289
|
this.linkDecorations.clear();
|
|
279
|
-
this.
|
|
290
|
+
this.linkProvider?.dispose();
|
|
291
|
+
this.links = [];
|
|
292
|
+
this.linkRun = false;
|
|
280
293
|
}
|
|
281
294
|
clearAllMarkers() {
|
|
282
295
|
monaco.editor.removeAllMarkers("owner-" + this.id);
|
|
@@ -293,14 +306,58 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
293
306
|
}
|
|
294
307
|
});
|
|
295
308
|
}
|
|
309
|
+
onDocChange() {
|
|
310
|
+
if (this.model) {
|
|
311
|
+
const text = this.model.getValue();
|
|
312
|
+
// look for "openapi: 3.0.x" or "3.1.x"
|
|
313
|
+
const m = text.match(/^openapi:\s*(3\.\d+)(?:\.\d+)?/m);
|
|
314
|
+
if (!m) {
|
|
315
|
+
return; // no version yet
|
|
316
|
+
}
|
|
317
|
+
const ver = m[1].startsWith('3.1') ? '3.1' : '3.0';
|
|
318
|
+
if (ver === this.currentVersion) {
|
|
319
|
+
return; // no change
|
|
320
|
+
}
|
|
321
|
+
this.currentVersion = ver;
|
|
322
|
+
// pick the right JSON schema
|
|
323
|
+
const schema = (ver === '3.1') ? openapi31 : openapi3;
|
|
324
|
+
const uri = `inmemory://schema/openapi-${ver}.json`;
|
|
325
|
+
// 4) update monaco-yaml with the new schema
|
|
326
|
+
const settings = {
|
|
327
|
+
uri,
|
|
328
|
+
fileMatch: ['**/*.yaml', '**/*.yml'],
|
|
329
|
+
schema
|
|
330
|
+
};
|
|
331
|
+
this.monacoYaml.update({ schemas: [settings] });
|
|
332
|
+
}
|
|
333
|
+
}
|
|
296
334
|
firstUpdated() {
|
|
335
|
+
// monkey patch the monaco API to drop monaco-yaml’s link providers
|
|
336
|
+
const origReg = monaco.languages.registerLinkProvider.bind(monaco.languages);
|
|
337
|
+
monaco.languages.registerLinkProvider = (language, provider) => {
|
|
338
|
+
const code = provider.provideLinks.toString();
|
|
339
|
+
// drop *both* of monaco‑yaml's providers by matching on the workerManager call:
|
|
340
|
+
if (code.includes('workerManager.getWorker') || code.includes('worker.findLinks')) {
|
|
341
|
+
// return a no‑op disposable
|
|
342
|
+
return { dispose() { } };
|
|
343
|
+
}
|
|
344
|
+
return origReg(language, provider);
|
|
345
|
+
};
|
|
346
|
+
this.monacoYaml = configureMonacoYaml(monaco, {
|
|
347
|
+
enableSchemaRequest: false,
|
|
348
|
+
hover: true,
|
|
349
|
+
completion: true,
|
|
350
|
+
validate: true,
|
|
351
|
+
format: true,
|
|
352
|
+
schemas: [] // start empty
|
|
353
|
+
});
|
|
297
354
|
setupMonaco();
|
|
298
|
-
const uri = monaco.Uri.parse("inmemory://doc-" + this.id);
|
|
355
|
+
const uri = monaco.Uri.parse("inmemory://doc-" + this.id + '.yaml');
|
|
299
356
|
const value = this.getCode();
|
|
300
357
|
this.model = monaco.editor.createModel(value, "yaml", uri);
|
|
301
358
|
this.editor = monaco.editor.create(this.container.value, {
|
|
302
359
|
model: this.model,
|
|
303
|
-
language: '
|
|
360
|
+
language: 'yaml',
|
|
304
361
|
theme: 'pb33f',
|
|
305
362
|
glyphMargin: true,
|
|
306
363
|
readOnly: this.readOnly,
|
|
@@ -317,7 +374,9 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
317
374
|
sticky: true,
|
|
318
375
|
},
|
|
319
376
|
});
|
|
320
|
-
|
|
377
|
+
// restore the original API so nothing else is affected
|
|
378
|
+
monaco.languages.registerLinkProvider = origReg;
|
|
379
|
+
this.linkProvider = monaco.languages.registerLinkProvider('yaml', { provideLinks: this.provideLinks.bind(this) });
|
|
321
380
|
monaco.editor.registerLinkOpener({ open: this.open.bind(this) });
|
|
322
381
|
// monaco.languages.registerCodeActionProvider("yaml", {
|
|
323
382
|
// provideCodeActions: (
|
|
@@ -406,6 +465,7 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
406
465
|
id: this.id
|
|
407
466
|
}
|
|
408
467
|
}));
|
|
468
|
+
this.onDocChange();
|
|
409
469
|
}
|
|
410
470
|
else {
|
|
411
471
|
this.firstboot = false;
|
|
@@ -452,6 +512,8 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
452
512
|
// }
|
|
453
513
|
// }
|
|
454
514
|
//})
|
|
515
|
+
// also do an initial run
|
|
516
|
+
this.onDocChange();
|
|
455
517
|
window
|
|
456
518
|
.matchMedia("(prefers-color-scheme: dark)")
|
|
457
519
|
.addEventListener("change", () => {
|
|
@@ -471,38 +533,33 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
471
533
|
return Promise.resolve(true);
|
|
472
534
|
}
|
|
473
535
|
applyLinkDecorations() {
|
|
474
|
-
if (this.editor) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
},
|
|
495
|
-
};
|
|
496
|
-
});
|
|
497
|
-
const decorationIds = this.linkDecorations.set(newDecorations);
|
|
498
|
-
this.decorationIdToLinkTarget.clear();
|
|
499
|
-
decorationIds.forEach((decorationId, index) => {
|
|
500
|
-
const target = this.links[index].jsonPath + '||' + this.links[index].targetLine + ':' + this.links[index].targetColumn + "||" + this.links[index].fullDefinition + "||" + this.links[index].rolodexIdHash;
|
|
501
|
-
this.decorationIdToLinkTarget.set(decorationId, target);
|
|
536
|
+
if (!this.editor) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
this.linkDecorations.clear();
|
|
540
|
+
const newDecorations = this.links.map(link => ({
|
|
541
|
+
range: new monaco.Range(link.line, link.startColumn, link.line, link.endColumn),
|
|
542
|
+
options: {
|
|
543
|
+
inlineClassName: link.isPolymorphic ? 'ref-poly' : 'ref',
|
|
544
|
+
glyphMarginClassName: link.isPolymorphic ? 'ref-poly-margin' : 'ref-margin',
|
|
545
|
+
glyphMarginHoverMessage: {
|
|
546
|
+
value: link.isPolymorphic
|
|
547
|
+
? `Polymorphic reference → **${link.fullDefinition}**`
|
|
548
|
+
: `Reference → **${link.fullDefinition}**`
|
|
549
|
+
},
|
|
550
|
+
}
|
|
551
|
+
}));
|
|
552
|
+
this.linkDecorations.set(newDecorations);
|
|
553
|
+
if (this.links.length) {
|
|
554
|
+
this.linkProvider = monaco.languages.registerLinkProvider('yaml', {
|
|
555
|
+
provideLinks: this.provideLinks.bind(this)
|
|
502
556
|
});
|
|
503
557
|
}
|
|
504
558
|
}
|
|
505
559
|
provideLinks(_model, _token) {
|
|
560
|
+
if (this.linkRun) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
506
563
|
const links = this.links.map((link) => {
|
|
507
564
|
const range = new monaco.Range(link.line, link.startColumn, link.line, link.endColumn);
|
|
508
565
|
const linkString = link.jsonPath + '||' + link.targetLine + ':' + link.targetColumn + "||" + link.fullDefinition + "||" + link.rolodexIdHash;
|
|
@@ -511,6 +568,7 @@ let SpecEditor = class SpecEditor extends LitElement {
|
|
|
511
568
|
url: monaco.Uri.parse(`doctor://${encodeURIComponent(linkString)}`),
|
|
512
569
|
};
|
|
513
570
|
});
|
|
571
|
+
this.linkRun = true;
|
|
514
572
|
return { links };
|
|
515
573
|
}
|
|
516
574
|
};
|
|
@@ -527,9 +585,6 @@ __decorate([
|
|
|
527
585
|
__decorate([
|
|
528
586
|
property()
|
|
529
587
|
], SpecEditor.prototype, "code", void 0);
|
|
530
|
-
__decorate([
|
|
531
|
-
state()
|
|
532
|
-
], SpecEditor.prototype, "links", void 0);
|
|
533
588
|
__decorate([
|
|
534
589
|
property()
|
|
535
590
|
], SpecEditor.prototype, "minimapVisible", void 0);
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ---------- FILE: src/editor‑init.ts ----------
|
|
3
|
+
// (!) This module is only responsible for wiring the workers.
|
|
4
|
+
// Import it before importing anything else from "monaco‑editor".
|
|
5
|
+
// // @ts-ignore
|
|
6
|
+
// import editorWorker from "monaco‑editor/esm/vs/editor/editor.worker.js?worker";
|
|
7
|
+
// // @ts-ignore
|
|
8
|
+
// import jsonWorker from "monaco‑editor/esm/vs/language/json/json.worker.js?worker";
|
|
9
|
+
// // @ts-ignore
|
|
10
|
+
// import htmlWorker from "monaco‑editor/esm/vs/language/html/html.worker.js?worker";
|
|
11
|
+
// // @ts-ignore
|
|
12
|
+
// import cssWorker from "monaco‑editor/esm/vs/language/css/css.worker.js?worker";
|
|
13
|
+
// // @ts-ignore
|
|
14
|
+
// import yamlWorker from "monaco‑yaml/yaml.worker.js?worker";
|
|
15
|
+
//
|
|
16
|
+
// declare let self: any;
|
|
17
|
+
// self.MonacoEnvironment = {
|
|
18
|
+
// getWorker(_moduleId: string, label: string) {
|
|
19
|
+
// switch (label) {
|
|
20
|
+
// case "json": return new jsonWorker();
|
|
21
|
+
// case "html": return new htmlWorker();
|
|
22
|
+
// case "css": return new cssWorker();
|
|
23
|
+
// case "yaml": return new yamlWorker();
|
|
24
|
+
// default: return new editorWorker();
|
|
25
|
+
// }
|
|
26
|
+
// }
|
|
27
|
+
// };
|
|
28
|
+
// export {};
|