@covalent/components 8.15.0-beta.1 → 8.15.0-beta.11
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/cell/cell.d.ts +12 -0
- package/cell/cell.d.ts.map +1 -1
- package/cell.js +21 -21
- package/cell.mjs +74 -52
- package/code-editor/code-editor.d.ts +30 -8
- package/code-editor/code-editor.d.ts.map +1 -1
- package/code-editor-3a09cbf1.js +732 -0
- package/{code-editor-383a8fae.mjs → code-editor-ce557bd5.mjs} +14372 -47270
- package/code-editor.js +1 -1
- package/code-editor.mjs +1 -1
- package/code-snippet.js +1 -1
- package/code-snippet.mjs +1 -1
- package/{html-d9124a1e.js → html-4fffc46e.js} +1 -1
- package/{html-a95df2b1.mjs → html-783f1e7c.mjs} +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/{javascript-0226b3a0.mjs → javascript-4d09cd3c.mjs} +2 -2
- package/{javascript-ec698494.js → javascript-90bb18e6.js} +1 -1
- package/notebook/notebook.d.ts +55 -16
- package/notebook/notebook.d.ts.map +1 -1
- package/notebook.js +76 -44
- package/notebook.mjs +927 -784
- package/package.json +1 -1
- package/{python-7770f129.mjs → python-562f8e9b.mjs} +1 -1
- package/{python-c7862f06.js → python-af3aad7d.js} +1 -1
- package/select.js +1 -1
- package/select.mjs +1 -1
- package/style.css +1 -1
- package/{typescript-eb2ab867.js → typescript-76d039b3.js} +1 -1
- package/{typescript-37d9bf54.mjs → typescript-a2a5d6b2.mjs} +1 -1
- package/{xml-9970ffe1.mjs → xml-89571455.mjs} +1 -1
- package/{xml-349a9a42.js → xml-e66929d0.js} +1 -1
- package/{yaml-837b2090.js → yaml-11a91e71.js} +1 -1
- package/{yaml-167e3d82.mjs → yaml-4eccd122.mjs} +1 -1
- package/abap-1354785f.mjs +0 -1314
- package/abap-c7187853.js +0 -6
- package/apex-279d4f27.mjs +0 -315
- package/apex-fc5f2b3e.js +0 -6
- package/assets/css.worker-1af1972f.js +0 -84
- package/assets/editor.worker-df55e1ff.js +0 -8
- package/assets/html.worker-38c267f1.js +0 -456
- package/assets/json.worker-bf861c27.js +0 -39
- package/assets/ts.worker-e151483b.js +0 -33972
- package/azcli-ba812c55.mjs +0 -74
- package/azcli-eb191d91.js +0 -6
- package/bat-34d38df4.js +0 -6
- package/bat-4d77495d.mjs +0 -95
- package/bicep-7b240724.mjs +0 -108
- package/bicep-a8264e77.js +0 -7
- package/cameligo-5d2daeb8.mjs +0 -168
- package/cameligo-6e71c8f3.js +0 -6
- package/clojure-355adae1.js +0 -6
- package/clojure-b7ea12a3.mjs +0 -754
- package/code-editor-4cce5e5d.js +0 -1200
- package/coffee-1a8cfbf4.mjs +0 -228
- package/coffee-fd8a7421.js +0 -6
- package/csp-54919de0.js +0 -6
- package/csp-96407af0.mjs +0 -57
- package/cssMode-821261c4.js +0 -9
- package/cssMode-9b89f9af.mjs +0 -1450
- package/cypher-11e5a4b6.mjs +0 -262
- package/cypher-cc849b67.js +0 -6
- package/dockerfile-2f8684f7.js +0 -6
- package/dockerfile-8739cff7.mjs +0 -132
- package/ecl-68a6f20f.js +0 -6
- package/ecl-a20c5155.mjs +0 -454
- package/elixir-32cc668e.js +0 -6
- package/elixir-8b028584.mjs +0 -467
- package/flow9-0dea2e73.mjs +0 -141
- package/flow9-1d2ab5f6.js +0 -6
- package/freemarker2-4fc0d2e6.mjs +0 -648
- package/freemarker2-7095cbc4.js +0 -8
- package/fsharp-49a70fad.mjs +0 -210
- package/fsharp-a22f5013.js +0 -6
- package/graphql-1a14eb34.js +0 -6
- package/graphql-51a577e5.mjs +0 -141
- package/handlebars-6a356ce9.js +0 -6
- package/handlebars-82c24f9d.mjs +0 -396
- package/hcl-0833427e.js +0 -6
- package/hcl-56b85754.mjs +0 -177
- package/htmlMode-3946317b.js +0 -9
- package/htmlMode-45fac07b.mjs +0 -1460
- package/ini-1d58d82f.mjs +0 -68
- package/ini-34a929df.js +0 -6
- package/jsonMode-a8e45f39.js +0 -11
- package/jsonMode-bdcd2ed9.mjs +0 -1871
- package/julia-7db1fb9a.js +0 -6
- package/julia-a0caf483.mjs +0 -496
- package/less-5219eae1.js +0 -7
- package/less-718543b4.mjs +0 -168
- package/lexon-5e6e7a44.mjs +0 -151
- package/lexon-dfd683ab.js +0 -6
- package/liquid-2dc745b6.mjs +0 -243
- package/liquid-b6e2effe.js +0 -6
- package/m3-87473279.js +0 -6
- package/m3-aadaf771.mjs +0 -210
- package/mips-161e49ce.mjs +0 -194
- package/mips-82a1ce59.js +0 -6
- package/msdax-b3b5017e.js +0 -6
- package/msdax-f65cb1e6.mjs +0 -377
- package/mysql-24549dd1.mjs +0 -875
- package/mysql-69f1c589.js +0 -6
- package/objective-c-c8319b65.js +0 -6
- package/objective-c-e129a5ca.mjs +0 -188
- package/pascal-4ccdf5ce.mjs +0 -245
- package/pascal-e5207a08.js +0 -6
- package/pascaligo-8eb79945.js +0 -6
- package/pascaligo-a9603dcd.mjs +0 -158
- package/perl-ba1fb97a.mjs +0 -599
- package/perl-e8264c91.js +0 -6
- package/pgsql-89978310.mjs +0 -843
- package/pgsql-c8ba6faf.js +0 -6
- package/pla-96c2695d.mjs +0 -131
- package/pla-c85b0e59.js +0 -6
- package/postiats-3c2c478e.js +0 -6
- package/postiats-7b52ebac.mjs +0 -544
- package/powerquery-8954ec26.mjs +0 -890
- package/powerquery-b0d5f9e4.js +0 -6
- package/powershell-cdb88123.js +0 -6
- package/powershell-f00d0274.mjs +0 -233
- package/protobuf-3eb85f80.mjs +0 -422
- package/protobuf-a3b2ca94.js +0 -7
- package/pug-6fab415a.mjs +0 -393
- package/pug-c5df821d.js +0 -6
- package/qsharp-4792f872.mjs +0 -282
- package/qsharp-7eddb7b9.js +0 -6
- package/razor-3871ef20.mjs +0 -517
- package/razor-4a6a11b1.js +0 -6
- package/redis-0d0a89dd.js +0 -6
- package/redis-276b8288.mjs +0 -298
- package/redshift-520a7359.mjs +0 -806
- package/redshift-b6bdaeca.js +0 -6
- package/restructuredtext-4676a3fc.mjs +0 -162
- package/restructuredtext-c83d56ed.js +0 -6
- package/ruby-764137cd.mjs +0 -444
- package/ruby-96103dcf.js +0 -6
- package/sb-8c22f14c.mjs +0 -110
- package/sb-e2701210.js +0 -6
- package/scheme-b9cbf7cb.js +0 -6
- package/scheme-e6a52cb0.mjs +0 -114
- package/scss-45104c77.mjs +0 -244
- package/scss-d0f4f80e.js +0 -8
- package/solidity-d4979008.mjs +0 -1351
- package/solidity-f1319e8a.js +0 -6
- package/sophia-21995caf.mjs +0 -190
- package/sophia-a1ce907f.js +0 -6
- package/sparql-5088743c.mjs +0 -193
- package/sparql-98d9e092.js +0 -6
- package/st-122893c4.js +0 -6
- package/st-fa9ab362.mjs +0 -414
- package/systemverilog-8139818b.js +0 -6
- package/systemverilog-a4f858ed.mjs +0 -556
- package/tcl-8adf937f.mjs +0 -232
- package/tcl-e49fed0b.js +0 -6
- package/tsMode-426fdb34.mjs +0 -794
- package/tsMode-9087ec29.js +0 -16
- package/twig-404eb73e.mjs +0 -323
- package/twig-4bfb5b04.js +0 -6
- package/vb-8dfd000c.js +0 -6
- package/vb-e21e8153.mjs +0 -364
package/cell/cell.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
2
2
|
import '../code-editor/code-editor';
|
3
|
+
import '../code-snippet/code-snippet';
|
3
4
|
import '../icon-button/icon-button';
|
4
5
|
import '../typography/typography';
|
5
6
|
declare global {
|
@@ -20,6 +21,10 @@ export declare class CovalentCell extends LitElement {
|
|
20
21
|
* Language of the code
|
21
22
|
*/
|
22
23
|
language: string;
|
24
|
+
/**
|
25
|
+
* Whether the cell is loading
|
26
|
+
*/
|
27
|
+
loading: boolean;
|
23
28
|
/**
|
24
29
|
* Whether the cell is selected
|
25
30
|
*/
|
@@ -45,6 +50,12 @@ export declare class CovalentCell extends LitElement {
|
|
45
50
|
lineDecorationsWidth: number;
|
46
51
|
lineNumbersMinChars: number;
|
47
52
|
renderLineHighlight: string;
|
53
|
+
overviewRulerLanes: number;
|
54
|
+
hideCursorInOverviewRuler: boolean;
|
55
|
+
scrollbar: {
|
56
|
+
alwaysConsumeMouseWheel: boolean;
|
57
|
+
vertical: string;
|
58
|
+
};
|
48
59
|
};
|
49
60
|
static styles: import("lit").CSSResult[];
|
50
61
|
handleCodeChange(e: CustomEvent): void;
|
@@ -52,6 +63,7 @@ export declare class CovalentCell extends LitElement {
|
|
52
63
|
setEditorFocus(setFocus: boolean): void;
|
53
64
|
protected updated(changedProperties: PropertyValues): void;
|
54
65
|
renderEditor(): import("lit-html").TemplateResult<1>;
|
66
|
+
renderExecutionCount(): import("lit-html").TemplateResult<1>;
|
55
67
|
protected render(): import("lit-html").TemplateResult<1>;
|
56
68
|
}
|
57
69
|
export default CovalentCell;
|
package/cell/cell.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/cell/cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"cell.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/cell/cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAKvE,OAAO,4BAA4B,CAAC;AACpC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAElC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,YAAY,CAAC;KACzB;CACF;AAMD,qBACa,YAAa,SAAQ,UAAU;IAC1C;;OAEG;IAEH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,aAAa,SAAK;IAElB;;OAEG;IAEH,UAAU,CAAC,sBAAQ;IAEnB,cAAc,UAAS;IAEvB,aAAa;;;;;;;;;;;;;;;;;;MAgBX;IAEF,OAAgB,MAAM,4BAIpB;IAEF,gBAAgB,CAAC,CAAC,EAAE,WAAW;IAI/B,SAAS;IAUT,cAAc,CAAC,QAAQ,EAAE,OAAO;IAKhC,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAgBnD,YAAY;IA2BZ,oBAAoB;IAYpB,SAAS,CAAC,MAAM;CAgBjB;AAED,eAAe,YAAY,CAAC"}
|
package/cell.js
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./query-assigned-elements-f623705d.js"),l=require("./property-57f6f6fe.js"),
|
2
|
-
`;var p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</div>
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./query-assigned-elements-f623705d.js"),l=require("./property-57f6f6fe.js"),c=require("./class-map-0a4c6ca9.js");require("./code-editor-3a09cbf1.js");require("./code-snippet.js");require("./icon-button.js");require("./typography.js");require("./directive-1186bc23.js");require("./async-directive-4a34f75e.js");require("./directive-helpers-0ce1f995.js");require("./query-assigned-nodes-99eae71d.js");require("./_commonjsHelpers-2367a3a2.js");require("./tslib.es6-98719205.js");require("./ripple-handlers-9fb4a31a.js");require("./base-element-58a3f9ea.js");require("./utils-a8190a39.js");require("./state-0974a8e5.js");require("./query-680f1868.js");require("./style-map-a135c6ab.js");require("./aria-property-849c8816.js");require("./event-options-3f5eb195.js");require("./if-defined-f1c45245.js");const u=`:host{--mdc-icon-button-size: 24px;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface-container-high);border-radius:0;box-sizing:border-box;min-height:21px;padding:0 .25rem}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:1px 0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;margin-top:2px;visibility:hidden;min-width:8px}.timesExecuted{color:var(--cv-theme-outline-variant);display:inline-flex;font-family:var(--mdc-typography-body2-font-family);font-size:var(--mdc-typography-body2-font-size);justify-content:end;line-height:var(--mdc-typography-body2-line-height);padding:0 .75rem;min-width:8%;max-width:8%}.timesExecuted .executionCount{box-sizing:border-box;display:inline-block;max-width:70%;padding:0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.timesExecuted .loading{font-size:var(--mdc-typography-headline6-font-size);position:relative;top:.275rem}.cell{box-sizing:border-box;display:flex;justify-content:space-between}.cell:hover .selectionIndicator,.cell.focused .selectionIndicator,.cell.selected .selectionIndicator{visibility:visible}.cell:hover .timesExecuted,.cell.focused .timesExecuted,.cell.selected .timesExecuted{color:var(--cv-theme-primary)}.cellWrapper{display:flex;flex-direction:column;width:100%}.cellCodeWrapper{align-items:flex-start;display:flex;justify-content:space-between;width:calc(100% - 8px)}.cellOutputWrapper{max-width:90%;min-width:90%}.output{margin:.75rem .25rem .5rem;max-width:100%}
|
2
|
+
`;var p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,r=(d,e,o,s)=>{for(var i=s>1?void 0:s?h(e,o):e,n=d.length-1,a;n>=0;n--)(a=d[n])&&(i=(s?a(e,o,i):a(i))||i);return s&&i&&p(e,o,i),i};exports.CovalentCell=class extends t.s{constructor(){super(...arguments),this.code="",this.language="",this.loading=!1,this.selected=!1,this.timesExecuted=0,this.showEditor=!0,this._editorFocused=!1,this.editorOptions={minimap:{enabled:!1},wordWrap:"on",fontSize:"14px",glyphMargin:!1,folding:!1,lineNumbers:"off",lineDecorationsWidth:0,lineNumbersMinChars:0,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"}}}handleCodeChange(e){this.code=e.detail.code}handleRun(){this.dispatchEvent(new CustomEvent("cell-run-code",{detail:{index:this.index,code:this.code},bubbles:!0,composed:!0}))}setEditorFocus(e){this._editorFocused=e,this.requestUpdate()}updated(e){var o,s;if(e.has("code")||e.has("language")){const i=(o=this.shadowRoot)==null?void 0:o.querySelector("cv-code-editor");if(i)i.code=this.code,i.language=this.language;else{const n=(s=this.shadowRoot)==null?void 0:s.querySelector("cv-code-snippet");n&&!this.selected&&n.highlight()}}super.updated(e)}renderEditor(){const e=this.selected?t.x`<cv-code-editor
|
3
|
+
@code-change="${this.handleCodeChange}"
|
4
|
+
@editor-focus="${()=>this.setEditorFocus(!0)}"
|
5
|
+
@editor-blur="${()=>this.setEditorFocus(!1)}"
|
6
|
+
.code="${this.code}"
|
7
|
+
.language="${this.language}"
|
8
|
+
.options="${this.editorOptions}"
|
9
|
+
></cv-code-editor>`:t.x`<cv-code-snippet hideHeader .language="${this.language}"
|
10
|
+
>${this.code}</cv-code-snippet
|
11
|
+
>`,o=t.x`<slot name="error"></slot>
|
12
|
+
<cv-typography class="output" scale="body1">
|
13
|
+
<slot name="output"></slot>
|
14
|
+
<slot name="input"></slot>
|
15
|
+
</cv-typography>`;return t.x`${this.showEditor?e:""}${!this.showEditor&&this.language==="markdown"||this.language!=="markdown"?o:""}`}renderExecutionCount(){let e=t.x` `;return this.showEditor&&(this.loading?e=t.x`<span class="loading">*</span>`:this.timesExecuted&&(e=t.x`${this.timesExecuted}`)),t.x`[<span class="executionCount">${e}</span>] :`}render(){const e={cell:!0,selected:this.selected,focused:this._editorFocused};return t.x`
|
16
|
+
<div class="${c.o(e)}">
|
17
|
+
<span class="selectionIndicator"></span>
|
18
|
+
<div class="cellCodeWrapper">
|
19
|
+
<span class="timesExecuted">${this.renderExecutionCount()}</span>
|
20
|
+
<div class="cellOutputWrapper">${this.renderEditor()}</div>
|
21
21
|
</div>
|
22
22
|
</div>
|
23
23
|
`}};exports.CovalentCell.styles=[t.i`
|
24
24
|
${t.r(u)}
|
25
|
-
`];
|
25
|
+
`];r([l.n({type:Number})],exports.CovalentCell.prototype,"index",2);r([l.n({type:String})],exports.CovalentCell.prototype,"code",2);r([l.n({type:String})],exports.CovalentCell.prototype,"language",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"loading",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"selected",2);r([l.n({type:Number})],exports.CovalentCell.prototype,"timesExecuted",2);r([l.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"showEditor",2);exports.CovalentCell=r([t.e("cv-cell")],exports.CovalentCell);const v=exports.CovalentCell;exports.default=v;
|
package/cell.mjs
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
-
import { i as p, r as
|
2
|
-
import { n
|
3
|
-
import { o as
|
4
|
-
import "./code-editor-
|
1
|
+
import { i as p, r as h, s as u, x as r, e as m } from "./query-assigned-elements-4a39219d.mjs";
|
2
|
+
import { n } from "./property-9b6ea53b.mjs";
|
3
|
+
import { o as g } from "./class-map-6e504a9a.mjs";
|
4
|
+
import "./code-editor-ce557bd5.mjs";
|
5
|
+
import "./code-snippet.mjs";
|
5
6
|
import "./icon-button.mjs";
|
6
7
|
import "./typography.mjs";
|
7
8
|
import "./directive-daf4e9b6.mjs";
|
8
9
|
import "./async-directive-99a01ec7.mjs";
|
9
10
|
import "./directive-helpers-e3ea6592.mjs";
|
11
|
+
import "./query-assigned-nodes-df691e78.mjs";
|
12
|
+
import "./_commonjsHelpers-2f131a27.mjs";
|
10
13
|
import "./tslib.es6-c4b0f3b1.mjs";
|
11
14
|
import "./ripple-handlers-8883e893.mjs";
|
12
15
|
import "./base-element-acf30176.mjs";
|
@@ -17,16 +20,16 @@ import "./style-map-e7ec6d41.mjs";
|
|
17
20
|
import "./aria-property-fa2717fe.mjs";
|
18
21
|
import "./event-options-78d6cf94.mjs";
|
19
22
|
import "./if-defined-c367f208.mjs";
|
20
|
-
const
|
23
|
+
const y = `:host{--mdc-icon-button-size: 24px;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface-container-high);border-radius:0;box-sizing:border-box;min-height:21px;padding:0 .25rem}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:1px 0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;margin-top:2px;visibility:hidden;min-width:8px}.timesExecuted{color:var(--cv-theme-outline-variant);display:inline-flex;font-family:var(--mdc-typography-body2-font-family);font-size:var(--mdc-typography-body2-font-size);justify-content:end;line-height:var(--mdc-typography-body2-line-height);padding:0 .75rem;min-width:8%;max-width:8%}.timesExecuted .executionCount{box-sizing:border-box;display:inline-block;max-width:70%;padding:0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.timesExecuted .loading{font-size:var(--mdc-typography-headline6-font-size);position:relative;top:.275rem}.cell{box-sizing:border-box;display:flex;justify-content:space-between}.cell:hover .selectionIndicator,.cell.focused .selectionIndicator,.cell.selected .selectionIndicator{visibility:visible}.cell:hover .timesExecuted,.cell.focused .timesExecuted,.cell.selected .timesExecuted{color:var(--cv-theme-primary)}.cellWrapper{display:flex;flex-direction:column;width:100%}.cellCodeWrapper{align-items:flex-start;display:flex;justify-content:space-between;width:calc(100% - 8px)}.cellOutputWrapper{max-width:90%;min-width:90%}.output{margin:.75rem .25rem .5rem;max-width:100%}
|
21
24
|
`;
|
22
|
-
var
|
23
|
-
for (var
|
24
|
-
(
|
25
|
-
return
|
25
|
+
var f = Object.defineProperty, v = Object.getOwnPropertyDescriptor, d = (e, i, l, s) => {
|
26
|
+
for (var o = s > 1 ? void 0 : s ? v(i, l) : i, a = e.length - 1, c; a >= 0; a--)
|
27
|
+
(c = e[a]) && (o = (s ? c(i, l, o) : c(o)) || o);
|
28
|
+
return s && o && f(i, l, o), o;
|
26
29
|
};
|
27
|
-
let t = class extends
|
30
|
+
let t = class extends u {
|
28
31
|
constructor() {
|
29
|
-
super(...arguments), this.code = "", this.language = "", this.selected = !1, this.timesExecuted = 0, this.showEditor = !0, this._editorFocused = !1, this.editorOptions = {
|
32
|
+
super(...arguments), this.code = "", this.language = "", this.loading = !1, this.selected = !1, this.timesExecuted = 0, this.showEditor = !0, this._editorFocused = !1, this.editorOptions = {
|
30
33
|
minimap: { enabled: !1 },
|
31
34
|
// Disable minimap to save space
|
32
35
|
wordWrap: "on",
|
@@ -37,7 +40,13 @@ let t = class extends h {
|
|
37
40
|
lineNumbers: "off",
|
38
41
|
lineDecorationsWidth: 0,
|
39
42
|
lineNumbersMinChars: 0,
|
40
|
-
renderLineHighlight: "none"
|
43
|
+
renderLineHighlight: "none",
|
44
|
+
overviewRulerLanes: 0,
|
45
|
+
hideCursorInOverviewRuler: !0,
|
46
|
+
scrollbar: {
|
47
|
+
alwaysConsumeMouseWheel: !1,
|
48
|
+
vertical: "hidden"
|
49
|
+
}
|
41
50
|
};
|
42
51
|
}
|
43
52
|
handleCodeChange(e) {
|
@@ -56,24 +65,38 @@ let t = class extends h {
|
|
56
65
|
this._editorFocused = e, this.requestUpdate();
|
57
66
|
}
|
58
67
|
updated(e) {
|
59
|
-
var
|
68
|
+
var i, l;
|
60
69
|
if (e.has("code") || e.has("language")) {
|
61
|
-
const
|
62
|
-
|
70
|
+
const s = (i = this.shadowRoot) == null ? void 0 : i.querySelector("cv-code-editor");
|
71
|
+
if (s)
|
72
|
+
s.code = this.code, s.language = this.language;
|
73
|
+
else {
|
74
|
+
const o = (l = this.shadowRoot) == null ? void 0 : l.querySelector("cv-code-snippet");
|
75
|
+
o && !this.selected && o.highlight();
|
76
|
+
}
|
63
77
|
}
|
78
|
+
super.updated(e);
|
64
79
|
}
|
65
80
|
renderEditor() {
|
66
|
-
const e =
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
81
|
+
const e = this.selected ? r`<cv-code-editor
|
82
|
+
@code-change="${this.handleCodeChange}"
|
83
|
+
@editor-focus="${() => this.setEditorFocus(!0)}"
|
84
|
+
@editor-blur="${() => this.setEditorFocus(!1)}"
|
85
|
+
.code="${this.code}"
|
86
|
+
.language="${this.language}"
|
87
|
+
.options="${this.editorOptions}"
|
88
|
+
></cv-code-editor>` : r`<cv-code-snippet hideHeader .language="${this.language}"
|
89
|
+
>${this.code}</cv-code-snippet
|
90
|
+
>`, i = r`<slot name="error"></slot>
|
91
|
+
<cv-typography class="output" scale="body1">
|
92
|
+
<slot name="output"></slot>
|
93
|
+
<slot name="input"></slot>
|
94
|
+
</cv-typography>`;
|
95
|
+
return r`${this.showEditor ? e : ""}${!this.showEditor && this.language === "markdown" || this.language !== "markdown" ? i : ""}`;
|
96
|
+
}
|
97
|
+
renderExecutionCount() {
|
98
|
+
let e = r` `;
|
99
|
+
return this.showEditor && (this.loading ? e = r`<span class="loading">*</span>` : this.timesExecuted && (e = r`${this.timesExecuted}`)), r`[<span class="executionCount">${e}</span>] :`;
|
77
100
|
}
|
78
101
|
render() {
|
79
102
|
const e = {
|
@@ -81,16 +104,12 @@ let t = class extends h {
|
|
81
104
|
selected: this.selected,
|
82
105
|
focused: this._editorFocused
|
83
106
|
};
|
84
|
-
return
|
85
|
-
<div class="${
|
86
|
-
<span class="
|
87
|
-
<div class="
|
88
|
-
<
|
89
|
-
|
90
|
-
${this.showEditor ? c`[${this.timesExecuted === 0 ? " " : this.timesExecuted}]:` : ""}
|
91
|
-
</span>
|
92
|
-
<div class="editor-output-wrapper">${this.renderEditor()}</div>
|
93
|
-
</div>
|
107
|
+
return r`
|
108
|
+
<div class="${g(e)}">
|
109
|
+
<span class="selectionIndicator"></span>
|
110
|
+
<div class="cellCodeWrapper">
|
111
|
+
<span class="timesExecuted">${this.renderExecutionCount()}</span>
|
112
|
+
<div class="cellOutputWrapper">${this.renderEditor()}</div>
|
94
113
|
</div>
|
95
114
|
</div>
|
96
115
|
`;
|
@@ -98,32 +117,35 @@ let t = class extends h {
|
|
98
117
|
};
|
99
118
|
t.styles = [
|
100
119
|
p`
|
101
|
-
${
|
120
|
+
${h(y)}
|
102
121
|
`
|
103
122
|
];
|
104
|
-
|
105
|
-
|
123
|
+
d([
|
124
|
+
n({ type: Number })
|
106
125
|
], t.prototype, "index", 2);
|
107
|
-
|
108
|
-
|
126
|
+
d([
|
127
|
+
n({ type: String })
|
109
128
|
], t.prototype, "code", 2);
|
110
|
-
|
111
|
-
|
129
|
+
d([
|
130
|
+
n({ type: String })
|
112
131
|
], t.prototype, "language", 2);
|
113
|
-
|
114
|
-
|
132
|
+
d([
|
133
|
+
n({ type: Boolean, reflect: !0 })
|
134
|
+
], t.prototype, "loading", 2);
|
135
|
+
d([
|
136
|
+
n({ type: Boolean, reflect: !0 })
|
115
137
|
], t.prototype, "selected", 2);
|
116
|
-
|
117
|
-
|
138
|
+
d([
|
139
|
+
n({ type: Number })
|
118
140
|
], t.prototype, "timesExecuted", 2);
|
119
|
-
|
120
|
-
|
141
|
+
d([
|
142
|
+
n({ type: Boolean, reflect: !0 })
|
121
143
|
], t.prototype, "showEditor", 2);
|
122
|
-
t =
|
144
|
+
t = d([
|
123
145
|
m("cv-cell")
|
124
146
|
], t);
|
125
|
-
const
|
147
|
+
const P = t;
|
126
148
|
export {
|
127
149
|
t as CovalentCell,
|
128
|
-
|
150
|
+
P as default
|
129
151
|
};
|
@@ -1,5 +1,27 @@
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
2
|
-
import
|
2
|
+
import { editor } from 'monaco-editor/esm/vs/editor/editor.api.js';
|
3
|
+
import 'monaco-editor/esm/vs/basic-languages/html/html.contribution';
|
4
|
+
import 'monaco-editor/esm/vs/basic-languages/css/css.contribution';
|
5
|
+
import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution';
|
6
|
+
import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution';
|
7
|
+
import 'monaco-editor/esm/vs/basic-languages/python/python.contribution';
|
8
|
+
import 'monaco-editor/esm/vs/basic-languages/java/java.contribution';
|
9
|
+
import 'monaco-editor/esm/vs/basic-languages/csharp/csharp.contribution';
|
10
|
+
import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution';
|
11
|
+
import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution';
|
12
|
+
import 'monaco-editor/esm/vs/basic-languages/xml/xml.contribution';
|
13
|
+
import 'monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution';
|
14
|
+
import 'monaco-editor/esm/vs/basic-languages/shell/shell.contribution';
|
15
|
+
import 'monaco-editor/esm/vs/basic-languages/go/go.contribution';
|
16
|
+
import 'monaco-editor/esm/vs/basic-languages/r/r.contribution';
|
17
|
+
import 'monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution';
|
18
|
+
import 'monaco-editor/esm/vs/basic-languages/rust/rust.contribution';
|
19
|
+
import 'monaco-editor/esm/vs/basic-languages/kotlin/kotlin.contribution';
|
20
|
+
import 'monaco-editor/esm/vs/basic-languages/swift/swift.contribution';
|
21
|
+
import 'monaco-editor/esm/vs/basic-languages/lua/lua.contribution';
|
22
|
+
import 'monaco-editor/esm/vs/basic-languages/scala/scala.contribution';
|
23
|
+
import 'monaco-editor/esm/vs/basic-languages/dart/dart.contribution';
|
24
|
+
import 'monaco-editor/esm/vs/basic-languages/php/php.contribution';
|
3
25
|
export declare class CovalentCodeEditor extends LitElement {
|
4
26
|
/**
|
5
27
|
* The container where editor will be created
|
@@ -8,7 +30,7 @@ export declare class CovalentCodeEditor extends LitElement {
|
|
8
30
|
/**
|
9
31
|
* Editor instance
|
10
32
|
*/
|
11
|
-
editor?:
|
33
|
+
editor?: editor.IStandaloneCodeEditor;
|
12
34
|
/**
|
13
35
|
* Theme of the editor
|
14
36
|
*/
|
@@ -24,22 +46,22 @@ export declare class CovalentCodeEditor extends LitElement {
|
|
24
46
|
/**
|
25
47
|
* Options that can be ste for the editor
|
26
48
|
*/
|
27
|
-
options?:
|
49
|
+
options?: editor.IEditorOptions & editor.IGlobalEditorOptions;
|
28
50
|
static styles: import("lit").CSSResult[];
|
29
51
|
private getFile;
|
30
52
|
private getCode;
|
31
53
|
private getLang;
|
32
54
|
private getTheme;
|
33
55
|
private isDark;
|
34
|
-
|
35
|
-
getValue(): string | undefined;
|
56
|
+
private setTheme;
|
36
57
|
adjustHeight(): void;
|
37
58
|
createEditor(container: HTMLElement): void;
|
38
|
-
onModelChange(): void;
|
39
59
|
firstUpdated(): void;
|
40
|
-
|
60
|
+
getValue(): string | undefined;
|
61
|
+
onModelChange(): void;
|
41
62
|
render(): import("lit-html").TemplateResult<1>;
|
42
|
-
|
63
|
+
setValue(value: string): void;
|
64
|
+
updated(changedProperties: PropertyValues): void;
|
43
65
|
disconnectedCallback(): void;
|
44
66
|
}
|
45
67
|
declare global {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"code-editor.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/code-editor/code-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAOvE,OAAO,
|
1
|
+
{"version":3,"file":"code-editor.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/code-editor/code-editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAOvE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAInE,OAAO,6DAA6D,CAAC;AACrE,OAAO,2DAA2D,CAAC;AACnE,OAAO,yEAAyE,CAAC;AACjF,OAAO,yEAAyE,CAAC;AACjF,OAAO,iEAAiE,CAAC;AACzE,OAAO,6DAA6D,CAAC;AACrE,OAAO,iEAAiE,CAAC;AACzE,OAAO,2DAA2D,CAAC;AACnE,OAAO,6DAA6D,CAAC;AACrE,OAAO,2DAA2D,CAAC;AACnE,OAAO,qEAAqE,CAAC;AAC7E,OAAO,+DAA+D,CAAC;AACvE,OAAO,yDAAyD,CAAC;AACjE,OAAO,uDAAuD,CAAC;AAC/D,OAAO,2DAA2D,CAAC;AACnE,OAAO,6DAA6D,CAAC;AACrE,OAAO,iEAAiE,CAAC;AACzE,OAAO,+DAA+D,CAAC;AACvE,OAAO,2DAA2D,CAAC;AACnE,OAAO,+DAA+D,CAAC;AACvE,OAAO,6DAA6D,CAAC;AACrE,OAAO,2DAA2D,CAAC;AAEnE,qBACa,kBAAmB,SAAQ,UAAU;IAChD;;OAEG;IACH,OAAO,CAAC,SAAS,CAAiC;IAClD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,qBAAqB,CAAC;IACtC;;OAEG;IACS,KAAK,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACS,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACS,IAAI,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACyB,OAAO,CAAC,EAAE,MAAM,CAAC,cAAc,GACzD,MAAM,CAAC,oBAAoB,CAAC;IAE9B,MAAM,CAAC,MAAM,4BAIX;IAEF,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,OAAO;IAQf,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,QAAQ,CAEd;IAEF,YAAY;IAQZ,YAAY,CAAC,SAAS,EAAE,WAAW;IAqBnC,YAAY;IAmCZ,QAAQ;IAKR,aAAa;IAab,MAAM;IAIN,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAehC,oBAAoB,IAAI,IAAI;CAKtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,kBAAkB,CAAC;KACtC;CACF;AAED,eAAe,kBAAkB,CAAC"}
|