1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
18 | var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
19 | if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
20 | 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;
|
21 | return c > 3 && r && Object.defineProperty(target, key, r), r;
|
22 | };
|
23 | Object.defineProperty(exports, "__esModule", { value: true });
|
24 | exports.ColorRegistry = void 0;
|
25 | const inversify_1 = require("inversify");
|
26 | const disposable_1 = require("../common/disposable");
|
27 | const event_1 = require("../common/event");
|
28 | let ColorRegistry = class ColorRegistry {
|
29 | constructor() {
|
30 | this.onDidChangeEmitter = new event_1.Emitter();
|
31 | this.onDidChange = this.onDidChangeEmitter.event;
|
32 | }
|
33 | fireDidChange() {
|
34 | this.onDidChangeEmitter.fire(undefined);
|
35 | }
|
36 | *getColors() { }
|
37 | getCurrentCssVariable(id) {
|
38 | const value = this.getCurrentColor(id);
|
39 | if (!value) {
|
40 | return undefined;
|
41 | }
|
42 | const name = this.toCssVariableName(id);
|
43 | return { name, value };
|
44 | }
|
45 | toCssVariableName(id, prefix = 'theia') {
|
46 | return `--${prefix}-${id.replace(/\./g, '-')}`;
|
47 | }
|
48 | getCurrentColor(id) {
|
49 | return undefined;
|
50 | }
|
51 | register(...definitions) {
|
52 | const result = new disposable_1.DisposableCollection(...definitions.map(definition => this.doRegister(definition)));
|
53 | this.fireDidChange();
|
54 | return result;
|
55 | }
|
56 | doRegister(definition) {
|
57 | return disposable_1.Disposable.NULL;
|
58 | }
|
59 | };
|
60 | ColorRegistry = __decorate([
|
61 | (0, inversify_1.injectable)()
|
62 | ], ColorRegistry);
|
63 | exports.ColorRegistry = ColorRegistry;
|
64 |
|
\ | No newline at end of file |