@omegagrid/code 0.2.5
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/components/code.d.ts +30 -0
- package/dist/components/code.d.ts.map +1 -0
- package/dist/components/code.js +118 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/highlighter.d.ts +19 -0
- package/dist/components/highlighter.d.ts.map +1 -0
- package/dist/components/highlighter.js +87 -0
- package/dist/components/highlighter.js.map +1 -0
- package/dist/components/highlighter.style.d.ts +2 -0
- package/dist/components/highlighter.style.d.ts.map +1 -0
- package/dist/components/highlighter.style.js +71 -0
- package/dist/components/highlighter.style.js.map +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +19 -0
- package/dist/components/index.js.map +1 -0
- package/dist/constants.d.ts +42 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +23 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +36 -0
- package/dist/loader.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Layout } from '@omegagrid/core';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
import * as monaco from 'monaco-editor';
|
|
4
|
+
export declare class CodeEvent extends Event {
|
|
5
|
+
readonly editor: monaco.editor.IStandaloneCodeEditor;
|
|
6
|
+
constructor(type: string, editor: monaco.editor.IStandaloneCodeEditor);
|
|
7
|
+
}
|
|
8
|
+
export declare class Code extends LitElement implements Layout {
|
|
9
|
+
static monaco: typeof monaco;
|
|
10
|
+
static styles: import("lit").CSSResult;
|
|
11
|
+
language: string;
|
|
12
|
+
private _content;
|
|
13
|
+
private _initialized;
|
|
14
|
+
get content(): string;
|
|
15
|
+
set content(val: string);
|
|
16
|
+
get selectedContent(): string;
|
|
17
|
+
codeRoot: HTMLDivElement;
|
|
18
|
+
editor: monaco.editor.IStandaloneCodeEditor;
|
|
19
|
+
preventChangeEvent: boolean;
|
|
20
|
+
get theme(): "vs" | "vs-dark";
|
|
21
|
+
onStyleChange: () => void;
|
|
22
|
+
initMonaco(): Promise<void>;
|
|
23
|
+
initEditor(): Promise<void>;
|
|
24
|
+
updated(): void;
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
disconnectedCallback(): void;
|
|
27
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
28
|
+
layout(): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/components/code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAY,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,qBAAa,SAAU,SAAQ,KAAK;aACO,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB;gBAAzE,IAAI,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB;CAGrF;AAED,qBAEa,IAAK,SAAQ,UAAW,YAAW,MAAM;IAErD,MAAM,CAAC,MAAM,EAAE,OAAO,MAAM,CAAC;IAC7B,MAAM,CAAC,MAAM,0BAQX;IAGF,QAAQ,SAAgB;IAExB,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,YAAY,CAAS;IAE7B,IACI,OAAO,IAEM,MAAM,CAFsD;IAE7E,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,EAItB;IAED,IAAI,eAAe,WAKlB;IAGD,QAAQ,EAAE,cAAc,CAAC;IAEzB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAC5C,kBAAkB,UAAS;IAE3B,IAAI,KAAK,qBAA8E;IAEvF,aAAa,aAEZ;IAEK,UAAU;IAOV,UAAU;IAwBhB,OAAO;IAIP,iBAAiB;IAKjB,oBAAoB;IAIpB,MAAM,6CAEJ;IAEF,MAAM;CAIN"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var Code_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Code = exports.CodeEvent = void 0;
|
|
11
|
+
const core_1 = require("@omegagrid/core");
|
|
12
|
+
const lit_1 = require("lit");
|
|
13
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
14
|
+
const loader_1 = require("../loader");
|
|
15
|
+
class CodeEvent extends Event {
|
|
16
|
+
constructor(type, editor) {
|
|
17
|
+
super(`code.${type}`, { bubbles: true, composed: true });
|
|
18
|
+
this.editor = editor;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.CodeEvent = CodeEvent;
|
|
22
|
+
let Code = Code_1 = class Code extends lit_1.LitElement {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.language = 'typescript';
|
|
26
|
+
this._content = '';
|
|
27
|
+
this._initialized = false;
|
|
28
|
+
this.preventChangeEvent = false;
|
|
29
|
+
this.onStyleChange = () => {
|
|
30
|
+
this.editor.updateOptions({ theme: this.theme });
|
|
31
|
+
};
|
|
32
|
+
this.render = () => (0, lit_1.html) `
|
|
33
|
+
<div id="codeRoot"></div>
|
|
34
|
+
`;
|
|
35
|
+
}
|
|
36
|
+
get content() { return this.editor ? this.editor.getValue() : this._content; }
|
|
37
|
+
set content(val) {
|
|
38
|
+
var _a;
|
|
39
|
+
this._content = val;
|
|
40
|
+
this.preventChangeEvent = true;
|
|
41
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.setValue(val);
|
|
42
|
+
}
|
|
43
|
+
get selectedContent() {
|
|
44
|
+
if (!this.editor)
|
|
45
|
+
return this._content;
|
|
46
|
+
const selectedCodeChunks = this.editor.getSelections().map(selection => this.editor.getModel().getValueInRange(selection));
|
|
47
|
+
const selectedCode = selectedCodeChunks.join("\n").trim();
|
|
48
|
+
return selectedCode == null || selectedCode == '' ? this.editor.getValue() : selectedCode;
|
|
49
|
+
}
|
|
50
|
+
get theme() { return (0, core_1.getStyleManager)().currentThemeName == 'light' ? 'vs' : 'vs-dark'; }
|
|
51
|
+
async initMonaco() {
|
|
52
|
+
var _a;
|
|
53
|
+
if (this._initialized)
|
|
54
|
+
return;
|
|
55
|
+
Code_1.monaco = (_a = Code_1.monaco) !== null && _a !== void 0 ? _a : await loader_1.MonacoLoader.get();
|
|
56
|
+
core_1.dom.appendStyle(this.shadowRoot, loader_1.MonacoLoader.monacoStyle);
|
|
57
|
+
this._initialized = true;
|
|
58
|
+
}
|
|
59
|
+
async initEditor() {
|
|
60
|
+
var _a;
|
|
61
|
+
await this.initMonaco();
|
|
62
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
63
|
+
this.editor = Code_1.monaco.editor.create(this.codeRoot, {
|
|
64
|
+
value: this._content,
|
|
65
|
+
language: this.language,
|
|
66
|
+
theme: this.theme,
|
|
67
|
+
// workaround for caret positioning issue in chrome
|
|
68
|
+
// https://github.com/microsoft/monaco-editor/issues/3217#issuecomment-1511978166
|
|
69
|
+
fontLigatures: ''
|
|
70
|
+
});
|
|
71
|
+
this.dispatchEvent(new CodeEvent('ready', this.editor));
|
|
72
|
+
this.editor.onDidChangeModelContent(() => {
|
|
73
|
+
if (!this.preventChangeEvent)
|
|
74
|
+
this.dispatchEvent(new CodeEvent('change', this.editor));
|
|
75
|
+
else
|
|
76
|
+
this.preventChangeEvent = false;
|
|
77
|
+
});
|
|
78
|
+
this.preventChangeEvent = false;
|
|
79
|
+
}
|
|
80
|
+
updated() {
|
|
81
|
+
this.initEditor();
|
|
82
|
+
}
|
|
83
|
+
connectedCallback() {
|
|
84
|
+
super.connectedCallback();
|
|
85
|
+
(0, core_1.getStyleManager)().addEventListener('change', this.onStyleChange);
|
|
86
|
+
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
(0, core_1.getStyleManager)().removeEventListener('change', this.onStyleChange);
|
|
89
|
+
}
|
|
90
|
+
layout() {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = this.editor) === null || _a === void 0 ? void 0 : _a.layout();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.Code = Code;
|
|
96
|
+
Code.styles = (0, lit_1.css) `
|
|
97
|
+
:host, #codeRoot {
|
|
98
|
+
user-select: text;
|
|
99
|
+
display: block;
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
102
|
+
position: relative;
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, decorators_js_1.property)({ type: String })
|
|
107
|
+
], Code.prototype, "language", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, decorators_js_1.property)({ type: String, noAccessor: true })
|
|
110
|
+
], Code.prototype, "content", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, decorators_js_1.query)('#codeRoot')
|
|
113
|
+
], Code.prototype, "codeRoot", void 0);
|
|
114
|
+
exports.Code = Code = Code_1 = __decorate([
|
|
115
|
+
(0, decorators_js_1.customElement)('og-code'),
|
|
116
|
+
(0, core_1.stylable)({ vars: ['font-*'] })
|
|
117
|
+
], Code);
|
|
118
|
+
//# sourceMappingURL=code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/components/code.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,0CAAyE;AACzE,6BAA4C;AAC5C,qDAAmE;AAEnE,sCAAyC;AAEzC,MAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,IAAY,EAAkB,MAA2C;QACpF,KAAK,CAAC,QAAQ,IAAI,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QADd,WAAM,GAAN,MAAM,CAAqC;IAErF,CAAC;CACD;AAJD,8BAIC;AAIM,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,gBAAU;IAA7B;;QAcN,aAAQ,GAAG,YAAY,CAAC;QAEhB,aAAQ,GAAG,EAAE,CAAC;QACd,iBAAY,GAAG,KAAK,CAAC;QAsB7B,uBAAkB,GAAG,KAAK,CAAC;QAI3B,kBAAa,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAC;QAChD,CAAC,CAAA;QA8CD,WAAM,GAAG,GAAG,EAAE,CAAC,IAAA,UAAI,EAAA;;EAElB,CAAC;IAMH,CAAC;IA/EA,IAAI,OAAO,KAAK,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAA,CAAC,CAAC;IAE7E,IAAI,OAAO,CAAC,GAAW;;QACtB,IAAI,CAAC,QAAQ,GAAG,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,MAAM,EAAC,CAAC;sCACD;AAMxB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;mCACkC;AAgB7E;IADC,IAAA,qBAAK,EAAC,WAAW,CAAC;sCACM;eApCb,IAAI;IAFhB,IAAA,6BAAa,EAAC,SAAS,CAAC;IACxB,IAAA,eAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAChB,IAAI,CAmGhB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Alert } from '@omegagrid/core';
|
|
2
|
+
import { LitElement } from 'lit';
|
|
3
|
+
export declare class Highlighter extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
language: string;
|
|
6
|
+
scrollable: boolean;
|
|
7
|
+
content: string;
|
|
8
|
+
copy: boolean;
|
|
9
|
+
root: HTMLDivElement;
|
|
10
|
+
alertCopy: Alert;
|
|
11
|
+
get theme(): "vs" | "vs-dark";
|
|
12
|
+
onStyleChange: () => void;
|
|
13
|
+
updated(): Promise<void>;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
16
|
+
copyContent: () => void;
|
|
17
|
+
render: () => import("lit-html").TemplateResult<1>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=highlighter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlighter.d.ts","sourceRoot":"","sources":["../../src/components/highlighter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA6B,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAMvC,qBAEa,WAAY,SAAQ,UAAU;IAE1C,MAAM,CAAC,MAAM,4BAAW;IAGxB,QAAQ,SAAgB;IAGxB,UAAU,UAAS;IAGnB,OAAO,EAAE,MAAM,CAAC;IAGhB,IAAI,UAAS;IAGb,IAAI,EAAE,cAAc,CAAC;IAGrB,SAAS,EAAE,KAAK,CAAC;IAEjB,IAAI,KAAK,qBAA8E;IAEvF,aAAa,aAA8B;IAErC,OAAO;IAOb,iBAAiB;IAKjB,oBAAoB;IAIpB,WAAW,aAIV;IAED,MAAM,6CAkBJ;CAEF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Highlighter = void 0;
|
|
10
|
+
const core_1 = require("@omegagrid/core");
|
|
11
|
+
const lit_1 = require("lit");
|
|
12
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
13
|
+
const loader_1 = require("../loader");
|
|
14
|
+
const localize_1 = require("@lit/localize");
|
|
15
|
+
const highlighter_style_1 = require("./highlighter.style");
|
|
16
|
+
let Highlighter = class Highlighter extends lit_1.LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.language = 'typescript';
|
|
20
|
+
this.scrollable = false;
|
|
21
|
+
this.copy = false;
|
|
22
|
+
this.onStyleChange = () => this.requestUpdate();
|
|
23
|
+
this.copyContent = () => {
|
|
24
|
+
navigator.clipboard.writeText(this.content);
|
|
25
|
+
this.alertCopy.className = 'fade-out';
|
|
26
|
+
setTimeout(() => this.alertCopy.className = '', 2000);
|
|
27
|
+
};
|
|
28
|
+
this.render = () => (0, lit_1.html) `
|
|
29
|
+
${this.copy ? (0, lit_1.html) `
|
|
30
|
+
<og-button
|
|
31
|
+
id="btnCopy"
|
|
32
|
+
icon="copy"
|
|
33
|
+
color="transparent"
|
|
34
|
+
@click="${this.copyContent}">
|
|
35
|
+
</og-button>
|
|
36
|
+
<og-alert type="success" id="alertCopy"><div slot="content">${(0, localize_1.msg)('copied')}</div></og-alert>
|
|
37
|
+
` : ''}
|
|
38
|
+
|
|
39
|
+
${this.scrollable ? (0, lit_1.html) `
|
|
40
|
+
<og-container>
|
|
41
|
+
<div id="root" slot="content"></div>
|
|
42
|
+
</og-container>
|
|
43
|
+
` : (0, lit_1.html) `
|
|
44
|
+
<div id="root" slot="content"></div>
|
|
45
|
+
`}
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
get theme() { return (0, core_1.getStyleManager)().currentThemeName == 'light' ? 'vs' : 'vs-dark'; }
|
|
49
|
+
async updated() {
|
|
50
|
+
this.root.innerHTML = '';
|
|
51
|
+
this.root.textContent = this.content;
|
|
52
|
+
const monaco = await loader_1.MonacoLoader.get();
|
|
53
|
+
monaco.editor.colorizeElement(this.root, { mimeType: this.language, theme: this.theme });
|
|
54
|
+
}
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback();
|
|
57
|
+
(0, core_1.getStyleManager)().addEventListener('change', this.onStyleChange);
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
(0, core_1.getStyleManager)().removeEventListener('change', this.onStyleChange);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.Highlighter = Highlighter;
|
|
64
|
+
Highlighter.styles = [highlighter_style_1.style];
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, decorators_js_1.property)({ type: String })
|
|
67
|
+
], Highlighter.prototype, "language", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
70
|
+
], Highlighter.prototype, "scrollable", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, decorators_js_1.property)({ type: String })
|
|
73
|
+
], Highlighter.prototype, "content", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, decorators_js_1.property)({ type: Boolean })
|
|
76
|
+
], Highlighter.prototype, "copy", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, decorators_js_1.query)('#root')
|
|
79
|
+
], Highlighter.prototype, "root", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, decorators_js_1.query)('#alertCopy')
|
|
82
|
+
], Highlighter.prototype, "alertCopy", void 0);
|
|
83
|
+
exports.Highlighter = Highlighter = __decorate([
|
|
84
|
+
(0, decorators_js_1.customElement)('og-highlighter'),
|
|
85
|
+
(0, core_1.stylable)({ vars: ['font-*'] })
|
|
86
|
+
], Highlighter);
|
|
87
|
+
//# sourceMappingURL=highlighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlighter.js","sourceRoot":"","sources":["../../src/components/highlighter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAAmE;AACnE,6BAAuC;AACvC,qDAAmE;AACnE,sCAAyC;AACzC,4CAAoC;AACpC,2DAA4C;AAIrC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,gBAAU;IAApC;;QAKN,aAAQ,GAAG,YAAY,CAAC;QAGxB,eAAU,GAAG,KAAK,CAAC;QAMnB,SAAI,GAAG,KAAK,CAAC;QAUb,kBAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QAkB3C,gBAAW,GAAG,GAAG,EAAE;YAClB,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,CAAC;YACtC,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,EAAE,EAAE,IAAI,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V,CAAW;AAGxB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;6CACD;AAGxB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;+CACP;AAGnB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;4CACT;AAGhB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCACb;AAGb;IADC,IAAA,qBAAK,EAAC,OAAO,CAAC;yCACM;AAGrB;IADC,IAAA,qBAAK,EAAC,YAAY,CAAC;8CACH;sBApBL,WAAW;IAFvB,IAAA,6BAAa,EAAC,gBAAgB,CAAC;IAC/B,IAAA,eAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAC,CAAC;GAChB,WAAW,CAoEvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlighter.style.d.ts","sourceRoot":"","sources":["../../src/components/highlighter.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAiEjB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.style = void 0;
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
exports.style = (0, lit_1.css) `
|
|
6
|
+
* {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host {
|
|
11
|
+
user-select: text;
|
|
12
|
+
display: block;
|
|
13
|
+
position: relative;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#root {
|
|
18
|
+
font-family: Consolas, "Courier New", monospace;
|
|
19
|
+
font-size: var(--font-size);
|
|
20
|
+
padding: 4px;
|
|
21
|
+
overflow: visible;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
#btnCopy {
|
|
25
|
+
//display: none;
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 4px;
|
|
28
|
+
right: 4px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host(:hover) #btnCopy {
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
og-container {
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
og-button {
|
|
40
|
+
z-index: 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
og-alert {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 4px;
|
|
46
|
+
right: 30px;
|
|
47
|
+
width: 80px;
|
|
48
|
+
padding: 2px;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
text-align: center;
|
|
51
|
+
opacity: 0;
|
|
52
|
+
visibility: hidden;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
og-alert.fade-out {
|
|
56
|
+
animation: fadeOut 2s forwards;
|
|
57
|
+
visibility: visible;
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@keyframes fadeOut {
|
|
62
|
+
0% {
|
|
63
|
+
opacity: 1;
|
|
64
|
+
}
|
|
65
|
+
100% {
|
|
66
|
+
opacity: 0;
|
|
67
|
+
visibility: hidden;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
//# sourceMappingURL=highlighter.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlighter.style.js","sourceRoot":"","sources":["../../src/components/highlighter.style.ts"],"names":[],"mappings":";;;AAAA,6BAA0B;AAEb,QAAA,KAAK,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiEvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./code"), exports);
|
|
18
|
+
__exportStar(require("./highlighter"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,gDAA8B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
LOCALE: string;
|
|
3
|
+
PREFIX: string;
|
|
4
|
+
DEFAULT_ACCENT_COLOR: string;
|
|
5
|
+
DEFAULT_ACCENT_COLOR_2: import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<any> | {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}> | {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}> | {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}> | {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}> | {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}> | {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}> | {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}> | {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}> | {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}> | {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}> | {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>;
|
|
28
|
+
SIZER_SIZE: number;
|
|
29
|
+
SLIDER_SIZE: number;
|
|
30
|
+
SLIDER_MIN_LENGTH: number;
|
|
31
|
+
EXPANDER_SIZE: number;
|
|
32
|
+
LIST_ITEM_HEIGHT: number;
|
|
33
|
+
LIST_RENDERING_TRESHOLD: number;
|
|
34
|
+
LIST_AUTOSCROLL_TRESHOLD: number;
|
|
35
|
+
LIST_AUTOSCROLL_DELAY: number;
|
|
36
|
+
DEFAULT_TEXT_HIGHLIGHT_COLOR: string;
|
|
37
|
+
TOOLTIP_MARGIN: number;
|
|
38
|
+
MENU_ITEM_HEIGHT: number;
|
|
39
|
+
COLORPICKER_COLOR_SIZE: number;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
42
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;AAAA,0CAA6D;AAE7D,kBAAe;IACd,GAAG,gBAAa;CAChB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./components"), exports);
|
|
18
|
+
__exportStar(require("./loader"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB"}
|
package/dist/loader.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor';
|
|
2
|
+
export interface Require {
|
|
3
|
+
(paths: string[], callback?: () => void): void;
|
|
4
|
+
config: (options: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}) => void;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
monaco: typeof monaco;
|
|
11
|
+
require: Require;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare class MonacoLoader {
|
|
15
|
+
static _monaco: typeof monaco;
|
|
16
|
+
static monacoStyle: string;
|
|
17
|
+
static monacoPath: string;
|
|
18
|
+
static monacoLoader: Require;
|
|
19
|
+
static init(loader: Require, path: string): void;
|
|
20
|
+
static get(): Promise<typeof monaco>;
|
|
21
|
+
static load(): Promise<typeof monaco>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAIxC,MAAM,WAAW,OAAO;IACvB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,OAAO,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,KAAK,IAAI,CAAC;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QAClB,MAAM,EAAE,OAAO,MAAM,CAAC;QACtB,OAAO,EAAE,OAAO,CAAC;KACd;CACJ;AAED,qBAAa,YAAY;IAExB,MAAM,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC;IAC9B,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC;IAE7B,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM;WAa5B,GAAG;IAKhB,MAAM,CAAC,IAAI;CAaX"}
|
package/dist/loader.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MonacoLoader = void 0;
|
|
4
|
+
const lit_1 = require("lit");
|
|
5
|
+
const core_1 = require("@omegagrid/core");
|
|
6
|
+
class MonacoLoader {
|
|
7
|
+
static init(loader, path) {
|
|
8
|
+
MonacoLoader.monacoLoader = loader;
|
|
9
|
+
MonacoLoader.monacoPath = path;
|
|
10
|
+
MonacoLoader.monacoStyle = `@import "${(0, lit_1.unsafeCSS)(path)}/editor/editor.main.css"`;
|
|
11
|
+
core_1.dom.appendStyle(document.head, `
|
|
12
|
+
@font-face {
|
|
13
|
+
font-family: 'codicon';
|
|
14
|
+
src: url('${path}/base/browser/ui/codicons/codicon/codicon.ttf') format('truetype');
|
|
15
|
+
}
|
|
16
|
+
`);
|
|
17
|
+
}
|
|
18
|
+
static async get() {
|
|
19
|
+
if (!this._monaco)
|
|
20
|
+
this._monaco = await this.load();
|
|
21
|
+
return this._monaco;
|
|
22
|
+
}
|
|
23
|
+
static load() {
|
|
24
|
+
MonacoLoader.monacoLoader.config({
|
|
25
|
+
paths: { 'vs': MonacoLoader.monacoPath },
|
|
26
|
+
'vs/css': { disabled: true }
|
|
27
|
+
});
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
MonacoLoader.monacoLoader(['vs/editor/editor.main'], () => {
|
|
30
|
+
resolve(self.monaco);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.MonacoLoader = MonacoLoader;
|
|
36
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":";;;AACA,6BAAgC;AAChC,0CAAsC;AActC,MAAa,YAAY;IAOxB,MAAM,CAAC,IAAI,CAAC,MAAe,EAAE,IAAY;QACxC,YAAY,CAAC,YAAY,GAAG,MAAM,CAAC;QACnC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC;QAC/B,YAAY,CAAC,WAAW,GAAG,YAAY,IAAA,eAAS,EAAC,IAAI,CAAC,0BAA0B,CAAC;QAEjF,UAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE;;;gBAGjB,IAAI;;GAEjB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG;QACf,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,IAAI;QACV,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC;YAChC,KAAK,EAAE,EAAC,IAAI,EAAE,YAAY,CAAC,UAAU,EAAC;YACtC,QAAQ,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC;SAC1B,CAAC,CAAC;QAEH,OAAO,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,EAAE;YAC7C,YAAY,CAAC,YAAY,CAAC,CAAC,uBAAuB,CAAC,EAAE,GAAG,EAAE;gBACzD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CAED;AAtCD,oCAsCC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@omegagrid/code",
|
|
3
|
+
"version": "0.2.5",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
|
+
"description": "Monaco editor webcomponent",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"./dist/**/*"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/cechi/omegagrid.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": "https://github.com/cechi/omegagrid/issues",
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Petr Čechura",
|
|
18
|
+
"email": "p.cechura@gmail.com",
|
|
19
|
+
"url": "https://cechura.eu"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"watch": "tsc --watch",
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"test": "jest --passWithNoTests",
|
|
25
|
+
"lint": "eslint **/src/**/*.ts",
|
|
26
|
+
"_prepack": "yarn build",
|
|
27
|
+
"_prepublish": "yarn test && yarn lint"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
|
31
|
+
"@lit/localize": "^0.12.1",
|
|
32
|
+
"@omegagrid/core": "^0.2.5",
|
|
33
|
+
"@riovir/wc-fontawesome": "^0.1.9",
|
|
34
|
+
"lit": "^3.1.1",
|
|
35
|
+
"monaco-editor": "^0.45.0",
|
|
36
|
+
"ts-debounce": "^4.0.0",
|
|
37
|
+
"vscode-loader": "^1.0.2"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/jest": "^29.5.11",
|
|
41
|
+
"@types/node": "^20.11.5",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
43
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
44
|
+
"eslint": "^8.56.0",
|
|
45
|
+
"jest": "^29.7.0",
|
|
46
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
47
|
+
"ts-jest": "^29.1.1",
|
|
48
|
+
"ts-node": "^10.9.2",
|
|
49
|
+
"typescript": "5.3.2"
|
|
50
|
+
}
|
|
51
|
+
}
|