@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.
Files changed (160) hide show
  1. package/cell/cell.d.ts +12 -0
  2. package/cell/cell.d.ts.map +1 -1
  3. package/cell.js +21 -21
  4. package/cell.mjs +74 -52
  5. package/code-editor/code-editor.d.ts +30 -8
  6. package/code-editor/code-editor.d.ts.map +1 -1
  7. package/code-editor-3a09cbf1.js +732 -0
  8. package/{code-editor-383a8fae.mjs → code-editor-ce557bd5.mjs} +14372 -47270
  9. package/code-editor.js +1 -1
  10. package/code-editor.mjs +1 -1
  11. package/code-snippet.js +1 -1
  12. package/code-snippet.mjs +1 -1
  13. package/{html-d9124a1e.js → html-4fffc46e.js} +1 -1
  14. package/{html-a95df2b1.mjs → html-783f1e7c.mjs} +1 -1
  15. package/index.js +1 -1
  16. package/index.mjs +1 -1
  17. package/{javascript-0226b3a0.mjs → javascript-4d09cd3c.mjs} +2 -2
  18. package/{javascript-ec698494.js → javascript-90bb18e6.js} +1 -1
  19. package/notebook/notebook.d.ts +55 -16
  20. package/notebook/notebook.d.ts.map +1 -1
  21. package/notebook.js +76 -44
  22. package/notebook.mjs +927 -784
  23. package/package.json +1 -1
  24. package/{python-7770f129.mjs → python-562f8e9b.mjs} +1 -1
  25. package/{python-c7862f06.js → python-af3aad7d.js} +1 -1
  26. package/select.js +1 -1
  27. package/select.mjs +1 -1
  28. package/style.css +1 -1
  29. package/{typescript-eb2ab867.js → typescript-76d039b3.js} +1 -1
  30. package/{typescript-37d9bf54.mjs → typescript-a2a5d6b2.mjs} +1 -1
  31. package/{xml-9970ffe1.mjs → xml-89571455.mjs} +1 -1
  32. package/{xml-349a9a42.js → xml-e66929d0.js} +1 -1
  33. package/{yaml-837b2090.js → yaml-11a91e71.js} +1 -1
  34. package/{yaml-167e3d82.mjs → yaml-4eccd122.mjs} +1 -1
  35. package/abap-1354785f.mjs +0 -1314
  36. package/abap-c7187853.js +0 -6
  37. package/apex-279d4f27.mjs +0 -315
  38. package/apex-fc5f2b3e.js +0 -6
  39. package/assets/css.worker-1af1972f.js +0 -84
  40. package/assets/editor.worker-df55e1ff.js +0 -8
  41. package/assets/html.worker-38c267f1.js +0 -456
  42. package/assets/json.worker-bf861c27.js +0 -39
  43. package/assets/ts.worker-e151483b.js +0 -33972
  44. package/azcli-ba812c55.mjs +0 -74
  45. package/azcli-eb191d91.js +0 -6
  46. package/bat-34d38df4.js +0 -6
  47. package/bat-4d77495d.mjs +0 -95
  48. package/bicep-7b240724.mjs +0 -108
  49. package/bicep-a8264e77.js +0 -7
  50. package/cameligo-5d2daeb8.mjs +0 -168
  51. package/cameligo-6e71c8f3.js +0 -6
  52. package/clojure-355adae1.js +0 -6
  53. package/clojure-b7ea12a3.mjs +0 -754
  54. package/code-editor-4cce5e5d.js +0 -1200
  55. package/coffee-1a8cfbf4.mjs +0 -228
  56. package/coffee-fd8a7421.js +0 -6
  57. package/csp-54919de0.js +0 -6
  58. package/csp-96407af0.mjs +0 -57
  59. package/cssMode-821261c4.js +0 -9
  60. package/cssMode-9b89f9af.mjs +0 -1450
  61. package/cypher-11e5a4b6.mjs +0 -262
  62. package/cypher-cc849b67.js +0 -6
  63. package/dockerfile-2f8684f7.js +0 -6
  64. package/dockerfile-8739cff7.mjs +0 -132
  65. package/ecl-68a6f20f.js +0 -6
  66. package/ecl-a20c5155.mjs +0 -454
  67. package/elixir-32cc668e.js +0 -6
  68. package/elixir-8b028584.mjs +0 -467
  69. package/flow9-0dea2e73.mjs +0 -141
  70. package/flow9-1d2ab5f6.js +0 -6
  71. package/freemarker2-4fc0d2e6.mjs +0 -648
  72. package/freemarker2-7095cbc4.js +0 -8
  73. package/fsharp-49a70fad.mjs +0 -210
  74. package/fsharp-a22f5013.js +0 -6
  75. package/graphql-1a14eb34.js +0 -6
  76. package/graphql-51a577e5.mjs +0 -141
  77. package/handlebars-6a356ce9.js +0 -6
  78. package/handlebars-82c24f9d.mjs +0 -396
  79. package/hcl-0833427e.js +0 -6
  80. package/hcl-56b85754.mjs +0 -177
  81. package/htmlMode-3946317b.js +0 -9
  82. package/htmlMode-45fac07b.mjs +0 -1460
  83. package/ini-1d58d82f.mjs +0 -68
  84. package/ini-34a929df.js +0 -6
  85. package/jsonMode-a8e45f39.js +0 -11
  86. package/jsonMode-bdcd2ed9.mjs +0 -1871
  87. package/julia-7db1fb9a.js +0 -6
  88. package/julia-a0caf483.mjs +0 -496
  89. package/less-5219eae1.js +0 -7
  90. package/less-718543b4.mjs +0 -168
  91. package/lexon-5e6e7a44.mjs +0 -151
  92. package/lexon-dfd683ab.js +0 -6
  93. package/liquid-2dc745b6.mjs +0 -243
  94. package/liquid-b6e2effe.js +0 -6
  95. package/m3-87473279.js +0 -6
  96. package/m3-aadaf771.mjs +0 -210
  97. package/mips-161e49ce.mjs +0 -194
  98. package/mips-82a1ce59.js +0 -6
  99. package/msdax-b3b5017e.js +0 -6
  100. package/msdax-f65cb1e6.mjs +0 -377
  101. package/mysql-24549dd1.mjs +0 -875
  102. package/mysql-69f1c589.js +0 -6
  103. package/objective-c-c8319b65.js +0 -6
  104. package/objective-c-e129a5ca.mjs +0 -188
  105. package/pascal-4ccdf5ce.mjs +0 -245
  106. package/pascal-e5207a08.js +0 -6
  107. package/pascaligo-8eb79945.js +0 -6
  108. package/pascaligo-a9603dcd.mjs +0 -158
  109. package/perl-ba1fb97a.mjs +0 -599
  110. package/perl-e8264c91.js +0 -6
  111. package/pgsql-89978310.mjs +0 -843
  112. package/pgsql-c8ba6faf.js +0 -6
  113. package/pla-96c2695d.mjs +0 -131
  114. package/pla-c85b0e59.js +0 -6
  115. package/postiats-3c2c478e.js +0 -6
  116. package/postiats-7b52ebac.mjs +0 -544
  117. package/powerquery-8954ec26.mjs +0 -890
  118. package/powerquery-b0d5f9e4.js +0 -6
  119. package/powershell-cdb88123.js +0 -6
  120. package/powershell-f00d0274.mjs +0 -233
  121. package/protobuf-3eb85f80.mjs +0 -422
  122. package/protobuf-a3b2ca94.js +0 -7
  123. package/pug-6fab415a.mjs +0 -393
  124. package/pug-c5df821d.js +0 -6
  125. package/qsharp-4792f872.mjs +0 -282
  126. package/qsharp-7eddb7b9.js +0 -6
  127. package/razor-3871ef20.mjs +0 -517
  128. package/razor-4a6a11b1.js +0 -6
  129. package/redis-0d0a89dd.js +0 -6
  130. package/redis-276b8288.mjs +0 -298
  131. package/redshift-520a7359.mjs +0 -806
  132. package/redshift-b6bdaeca.js +0 -6
  133. package/restructuredtext-4676a3fc.mjs +0 -162
  134. package/restructuredtext-c83d56ed.js +0 -6
  135. package/ruby-764137cd.mjs +0 -444
  136. package/ruby-96103dcf.js +0 -6
  137. package/sb-8c22f14c.mjs +0 -110
  138. package/sb-e2701210.js +0 -6
  139. package/scheme-b9cbf7cb.js +0 -6
  140. package/scheme-e6a52cb0.mjs +0 -114
  141. package/scss-45104c77.mjs +0 -244
  142. package/scss-d0f4f80e.js +0 -8
  143. package/solidity-d4979008.mjs +0 -1351
  144. package/solidity-f1319e8a.js +0 -6
  145. package/sophia-21995caf.mjs +0 -190
  146. package/sophia-a1ce907f.js +0 -6
  147. package/sparql-5088743c.mjs +0 -193
  148. package/sparql-98d9e092.js +0 -6
  149. package/st-122893c4.js +0 -6
  150. package/st-fa9ab362.mjs +0 -414
  151. package/systemverilog-8139818b.js +0 -6
  152. package/systemverilog-a4f858ed.mjs +0 -556
  153. package/tcl-8adf937f.mjs +0 -232
  154. package/tcl-e49fed0b.js +0 -6
  155. package/tsMode-426fdb34.mjs +0 -794
  156. package/tsMode-9087ec29.js +0 -16
  157. package/twig-404eb73e.mjs +0 -323
  158. package/twig-4bfb5b04.js +0 -6
  159. package/vb-8dfd000c.js +0 -6
  160. 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;
@@ -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;AAIvE,OAAO,4BAA4B,CAAC;AACpC,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,QAAQ,UAAS;IAEjB;;OAEG;IAEH,aAAa,SAAK;IAElB;;OAEG;IAEH,UAAU,CAAC,sBAAQ;IAEnB,cAAc,UAAS;IAEvB,aAAa;;;;;;;;;;;;MAUX;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;IAUnD,YAAY;IAqBZ,SAAS,CAAC,MAAM;CAwBjB;AAED,eAAe,YAAY,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"),a=require("./class-map-0a4c6ca9.js");require("./code-editor-4cce5e5d.js");require("./icon-button.js");require("./typography.js");require("./directive-1186bc23.js");require("./async-directive-4a34f75e.js");require("./directive-helpers-0ce1f995.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);height:100%;width:100%}.selection-indicator{background-color:var(--cv-theme-primary);border-radius:2px;margin-top:2px;visibility:hidden;width:8px}.timesExecuted{color:var(--cv-theme-outline-variant);min-height:var(--mdc-icon-button-size);min-width:var(--mdc-icon-button-size)}.cell{box-sizing:border-box;display:flex;justify-content:space-between}.cell:hover .selection-indicator,.cell.focused .selection-indicator,.cell.selected .selection-indicator{visibility:visible}.cell:hover .timesExecuted,.cell.focused .timesExecuted,.cell.selected .timesExecuted{color:var(--cv-theme-primary)}.cellWrapper{display:flex;flex-direction:column;width:95%}.cellCodeWrapper{align-items:flex-start;display:flex;justify-content:space-between}.cellCodeWrapper .editor-output-wrapper{width:calc(95% - 8px)}.output{margin:.5rem .25rem}
2
- `;var p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,s=(n,e,i,o)=>{for(var r=o>1?void 0:o?h(e,i):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(r=(o?c(e,i,r):c(r))||r);return o&&r&&p(e,i,r),r};exports.CovalentCell=class extends t.s{constructor(){super(...arguments),this.code="",this.language="",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"}}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 i;if(e.has("code")||e.has("language")){const o=(i=this.shadowRoot)==null?void 0:i.querySelector("cv-code-editor");o&&(o.code=this.code,o.language=this.language)}}renderEditor(){const e=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>`,i=t.x`<cv-typography class="output" scale="body1">
10
- <slot name="output"></slot>
11
- </cv-typography>`;return t.x`${this.showEditor?e:""}${!this.showEditor&&this.language==="markdown"||this.language!=="markdown"?i:""}`}render(){const e={cell:!0,selected:this.selected,focused:this._editorFocused};return t.x`
12
- <div class="${a.o(e)}">
13
- <span class="selection-indicator"></span>
14
- <div class="cellWrapper">
15
- <div class="cellCodeWrapper">
16
- <span class="timesExecuted">
17
- ${this.showEditor?t.x`[${this.timesExecuted===0?" ":this.timesExecuted}]:`:""}
18
- </span>
19
- <div class="editor-output-wrapper">${this.renderEditor()}</div>
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`&nbsp;`;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
- `];s([l.n({type:Number})],exports.CovalentCell.prototype,"index",2);s([l.n({type:String})],exports.CovalentCell.prototype,"code",2);s([l.n({type:String})],exports.CovalentCell.prototype,"language",2);s([l.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"selected",2);s([l.n({type:Number})],exports.CovalentCell.prototype,"timesExecuted",2);s([l.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"showEditor",2);exports.CovalentCell=s([t.e("cv-cell")],exports.CovalentCell);const v=exports.CovalentCell;exports.default=v;
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 u, s as h, x as c, e as m } from "./query-assigned-elements-4a39219d.mjs";
2
- import { n as d } from "./property-9b6ea53b.mjs";
3
- import { o as v } from "./class-map-6e504a9a.mjs";
4
- import "./code-editor-383a8fae.mjs";
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 f = `:host{--mdc-icon-button-size: 24px;font-family:var(--mdc-typography-body1-font-family);height:100%;width:100%}.selection-indicator{background-color:var(--cv-theme-primary);border-radius:2px;margin-top:2px;visibility:hidden;width:8px}.timesExecuted{color:var(--cv-theme-outline-variant);min-height:var(--mdc-icon-button-size);min-width:var(--mdc-icon-button-size)}.cell{box-sizing:border-box;display:flex;justify-content:space-between}.cell:hover .selection-indicator,.cell.focused .selection-indicator,.cell.selected .selection-indicator{visibility:visible}.cell:hover .timesExecuted,.cell.focused .timesExecuted,.cell.selected .timesExecuted{color:var(--cv-theme-primary)}.cellWrapper{display:flex;flex-direction:column;width:95%}.cellCodeWrapper{align-items:flex-start;display:flex;justify-content:space-between}.cellCodeWrapper .editor-output-wrapper{width:calc(95% - 8px)}.output{margin:.5rem .25rem}
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 g = Object.defineProperty, y = Object.getOwnPropertyDescriptor, s = (e, o, i, l) => {
23
- for (var r = l > 1 ? void 0 : l ? y(o, i) : o, a = e.length - 1, n; a >= 0; a--)
24
- (n = e[a]) && (r = (l ? n(o, i, r) : n(r)) || r);
25
- return l && r && g(o, i, r), r;
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 h {
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 o;
68
+ var i, l;
60
69
  if (e.has("code") || e.has("language")) {
61
- const i = (o = this.shadowRoot) == null ? void 0 : o.querySelector("cv-code-editor");
62
- i && (i.code = this.code, i.language = this.language);
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 = c`<cv-code-editor
67
- @code-change="${this.handleCodeChange}"
68
- @editor-focus="${() => this.setEditorFocus(!0)}"
69
- @editor-blur="${() => this.setEditorFocus(!1)}"
70
- .code="${this.code}"
71
- .language="${this.language}"
72
- .options="${this.editorOptions}"
73
- ></cv-code-editor>`, o = c`<cv-typography class="output" scale="body1">
74
- <slot name="output"></slot>
75
- </cv-typography>`;
76
- return c`${this.showEditor ? e : ""}${!this.showEditor && this.language === "markdown" || this.language !== "markdown" ? o : ""}`;
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`&nbsp;`;
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 c`
85
- <div class="${v(e)}">
86
- <span class="selection-indicator"></span>
87
- <div class="cellWrapper">
88
- <div class="cellCodeWrapper">
89
- <span class="timesExecuted">
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
- ${u(f)}
120
+ ${h(y)}
102
121
  `
103
122
  ];
104
- s([
105
- d({ type: Number })
123
+ d([
124
+ n({ type: Number })
106
125
  ], t.prototype, "index", 2);
107
- s([
108
- d({ type: String })
126
+ d([
127
+ n({ type: String })
109
128
  ], t.prototype, "code", 2);
110
- s([
111
- d({ type: String })
129
+ d([
130
+ n({ type: String })
112
131
  ], t.prototype, "language", 2);
113
- s([
114
- d({ type: Boolean, reflect: !0 })
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
- s([
117
- d({ type: Number })
138
+ d([
139
+ n({ type: Number })
118
140
  ], t.prototype, "timesExecuted", 2);
119
- s([
120
- d({ type: Boolean, reflect: !0 })
141
+ d([
142
+ n({ type: Boolean, reflect: !0 })
121
143
  ], t.prototype, "showEditor", 2);
122
- t = s([
144
+ t = d([
123
145
  m("cv-cell")
124
146
  ], t);
125
- const R = t;
147
+ const P = t;
126
148
  export {
127
149
  t as CovalentCell,
128
- R as default
150
+ P as default
129
151
  };
@@ -1,5 +1,27 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
- import * as monaco from 'monaco-editor';
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?: monaco.editor.IStandaloneCodeEditor;
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?: monaco.editor.IEditorOptions & monaco.editor.IGlobalEditorOptions;
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
- setValue(value: string): void;
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
- updated(changedProperties: PropertyValues): void;
60
+ getValue(): string | undefined;
61
+ onModelChange(): void;
41
62
  render(): import("lit-html").TemplateResult<1>;
42
- private _setTheme;
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,KAAK,MAAM,MAAM,eAAe,CAAC;AAgCxC,qBACa,kBAAmB,SAAQ,UAAU;IAChD;;OAEG;IACH,OAAO,CAAC,SAAS,CAAiC;IAClD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAC7C;;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,MAAM,CAAC,cAAc,GAChE,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAAC;IAErC,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,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB,QAAQ;IAKR,YAAY;IAQZ,YAAY,CAAC,SAAS,EAAE,WAAW;IAmBnC,aAAa;IAcb,YAAY;IA8BZ,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAezC,MAAM;IAIN,OAAO,CAAC,SAAS,CAEf;IAEO,oBAAoB,IAAI,IAAI;CAKtC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,kBAAkB,CAAC;KACtC;CACF;AAED,eAAe,kBAAkB,CAAC"}
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"}