@covalent/components 8.20.5 → 8.20.6
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/notebook-cell/notebook-cell.d.ts.map +1 -1
- package/notebook-cell.js +11 -7
- package/notebook-cell.mjs +27 -23
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"notebook-cell.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/notebook-cell/notebook-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAMvE,OAAO,4BAA4B,CAAC;AACpC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAElC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,oBAAoB,CAAC;KAC1C;CACF;AAED;;;;GAIG;AACH,qBACa,oBAAqB,SAAQ,UAAU;IAClD;;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,UAAS;IAEnB;;OAEG;IAEH,SAAS,UAAS;IAElB;;OAEG;IAEH,WAAW,SAAM;IAEjB,OAAO,CAAC,OAAO,CAAgC;IAE/C,OAAO,CAAC,cAAc,CAAS;IAG/B,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,cAAc,CAAU;IAEhC,OAAO,CAAC,aAAa,CAAuB;IAE5C,aAAa;;;;;;;;;;;;;;;;;;;;MAkBX;IAEF,OAAgB,MAAM,4BAIpB;;IAQF,gBAAgB,IAAI,IAAI;IAIxB,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAK5B,gBAAgB,CAAC,CAAC,EAAE,WAAW;IAI/B,cAAc,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO;IAMhD,iBAAiB,CAAC,CAAC,EAAE,WAAW;IAWhC,eAAe,CAAC,CAAC,EAAE,UAAU;IAkC7B,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAkBnD,gBAAgB,IAAI,MAAM;IAS1B,YAAY;IAqBZ,YAAY;IASZ,oBAAoB;IAapB,SAAS,CAAC,MAAM;
|
1
|
+
{"version":3,"file":"notebook-cell.d.ts","sourceRoot":"","sources":["../../../../libs/components/src/notebook-cell/notebook-cell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,cAAc,EAAa,MAAM,KAAK,CAAC;AAMvE,OAAO,4BAA4B,CAAC;AACpC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AACpC,OAAO,0BAA0B,CAAC;AAElC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,oBAAoB,CAAC;KAC1C;CACF;AAED;;;;GAIG;AACH,qBACa,oBAAqB,SAAQ,UAAU;IAClD;;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,UAAS;IAEnB;;OAEG;IAEH,SAAS,UAAS;IAElB;;OAEG;IAEH,WAAW,SAAM;IAEjB,OAAO,CAAC,OAAO,CAAgC;IAE/C,OAAO,CAAC,cAAc,CAAS;IAG/B,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO,CAAC,cAAc,CAAU;IAEhC,OAAO,CAAC,aAAa,CAAuB;IAE5C,aAAa;;;;;;;;;;;;;;;;;;;;MAkBX;IAEF,OAAgB,MAAM,4BAIpB;;IAQF,gBAAgB,IAAI,IAAI;IAIxB,iBAAiB,IAAI,IAAI;IAKzB,oBAAoB,IAAI,IAAI;IAK5B,gBAAgB,CAAC,CAAC,EAAE,WAAW;IAI/B,cAAc,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO;IAMhD,iBAAiB,CAAC,CAAC,EAAE,WAAW;IAWhC,eAAe,CAAC,CAAC,EAAE,UAAU;IAkC7B,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAkBnD,gBAAgB,IAAI,MAAM;IAS1B,YAAY;IAqBZ,YAAY;IASZ,oBAAoB;IAapB,SAAS,CAAC,MAAM;CAoCjB;AAED,eAAe,oBAAoB,CAAC"}
|
package/notebook-cell.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./query-assigned-elements-f623705d.js"),s=require("./property-57f6f6fe.js"),v=require("./state-0974a8e5.js"),
|
2
|
-
`;var x=Object.defineProperty,m=Object.getOwnPropertyDescriptor,n=(c,e,t,i)=>{for(var o=i>1?void 0:i?m(e,t):e,l=c.length-1,a;l>=0;l--)(a=c[l])&&(o=(i?a(e,t,o):a(o))||o);return i&&o&&x(e,t,o),o};exports.CovalentNotebookCell=class extends r.s{constructor(){super(),this.code="",this.language="",this.loading=!1,this.selected=!1,this.timesExecuted=0,this.hideEditor=!1,this.hideCount=!1,this.editorTheme="",this._editorFocused=!1,this._isMenuOpen=!1,this._menuMaxHeight="auto",this._menuPosition={top:0,left:0},this.editorOptions={minimap:{enabled:!1},wordWrap:"on",fontSize:"14px",glyphMargin:!1,folding:!1,lineHeight:20,lineNumbers:"off",lineDecorationsWidth:0,lineNumbersMinChars:0,renderIndentGuides:!1,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"}},this.closeContextMenu=this.closeContextMenu.bind(this),this.showContextMenu=this.showContextMenu.bind(this)}closeContextMenu(){this._isMenuOpen=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeContextMenu)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.closeContextMenu)}handleCodeChange(e){this.code=e.detail.code}setEditorFocus(e,t){e.stopImmediatePropagation(),this._editorFocused=t,this.requestUpdate()}setEditorInstance(e){e.stopImmediatePropagation(),this._editor=e.detail.editor,this._editor.onKeyDown(t=>{t.shiftKey&&t.keyCode===g.KeyCode.Enter&&t.preventDefault()})}showContextMenu(e){var u;e.preventDefault();const t=document.querySelectorAll("cv-notebook-cell");t==null||t.forEach(
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./query-assigned-elements-f623705d.js"),s=require("./property-57f6f6fe.js"),v=require("./state-0974a8e5.js"),p=require("./class-map-0a4c6ca9.js"),g=require("./code-editor-b2ecbde1.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("./query-680f1868.js");require("./style-map-a135c6ab.js");require("./aria-property-849c8816.js");require("./event-options-3f5eb195.js");require("./if-defined-f1c45245.js");const b=`:host{--mdc-icon-button-size: 2rem;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface);border-radius:0;box-sizing:border-box}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;height:100%;visibility:hidden}.selectionIndicatorWrapper{min-width:8px}.selectionIndicatorWrapper:hover .selectionIndicator{visibility:visible}.status{padding:0 1px;position:relative}.loading{top:2.5px}.timesExecuted{--cv-icon-button-cursor: grab;align-items:center;box-sizing:border-box;color:var(--cv-theme-on-surface-38);display:flex;font-family:var(--cv-typography-subtitle2-font-family);font-size:var(--cv-typography-subtitle2-font-size);gap:.5rem;height:56px;line-height:var(--cv-typography-headline6-line-height)}.timesExecuted .executionCount{padding-right:1rem;overflow:hidden;text-align:right;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap;width:52px}.timesExecuted .dragHandle{color:var(--cv-theme-on-surface-variant);cursor:grab;padding-left:.5rem;transition:visibility .3s ease;visibility:hidden}.timesExecuted .dragHandle:active{--cv-icon-button-cursor: grabbing}.timesExecutedWrapper{cursor:grab}.timesExecutedWrapper:active{cursor:grabbing}.timesExecutedWrapper:hover .dragHandle{visibility:visible}.cell{box-sizing:border-box;cursor:pointer;display:flex;justify-content:space-between;position:relative;transition:background-color .2s ease;-webkit-user-select:auto;user-select:auto}.cell.focused .selectionIndicator,.cell.selected .selectionIndicator{visibility:visible}.cell:hover{background-color:var(--cv-theme-secondary-4)}.cell:hover .selectionIndicator{visibility:visible;background-color:var(--cv-theme-on-secondary-container-38)}.cell:active{background-color:var(--cv-theme-secondary-12)}.cell:active .selectionIndicator{visibility:visible;background-color:var(--cv-theme-on-secondary-container-74)}.cellWrapper{display:flex;flex-direction:column;width:100%}.cellOutputWrapper{display:flex;flex-direction:column;max-width:calc(100% - 130px);flex:1}.contextMenu{background-color:var(--cv-theme-surface-canvas);border-radius:8px;box-shadow:0 8px 12px 6px #00000026,0 4px 4px #0000004d;display:flex;flex-direction:column;position:fixed;visibility:hidden;z-index:1000}.contextMenuContent{border-radius:4px;flex-grow:1;max-height:100%;overflow:auto}.contextMenu.open{visibility:visible}.editorContainer{box-sizing:border-box;background-color:var(--cv-theme-surface);border:1px solid var(--cv-theme-outline-variant);border-radius:var(--cv-editor-border-radius, 4px);min-height:56px;overflow:hidden;padding:1rem}.errors,.output{max-width:100%;width:100%}
|
2
|
+
`;var x=Object.defineProperty,m=Object.getOwnPropertyDescriptor,n=(c,e,t,i)=>{for(var o=i>1?void 0:i?m(e,t):e,l=c.length-1,a;l>=0;l--)(a=c[l])&&(o=(i?a(e,t,o):a(o))||o);return i&&o&&x(e,t,o),o};exports.CovalentNotebookCell=class extends r.s{constructor(){super(),this.code="",this.language="",this.loading=!1,this.selected=!1,this.timesExecuted=0,this.hideEditor=!1,this.hideCount=!1,this.editorTheme="",this._editorFocused=!1,this._isMenuOpen=!1,this._menuMaxHeight="auto",this._menuPosition={top:0,left:0},this.editorOptions={minimap:{enabled:!1},wordWrap:"on",fontSize:"14px",glyphMargin:!1,folding:!1,lineHeight:20,lineNumbers:"off",lineDecorationsWidth:0,lineNumbersMinChars:0,renderIndentGuides:!1,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"}},this.closeContextMenu=this.closeContextMenu.bind(this),this.showContextMenu=this.showContextMenu.bind(this)}closeContextMenu(){this._isMenuOpen=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeContextMenu)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.closeContextMenu)}handleCodeChange(e){this.code=e.detail.code}setEditorFocus(e,t){e.stopImmediatePropagation(),this._editorFocused=t,this.requestUpdate()}setEditorInstance(e){e.stopImmediatePropagation(),this._editor=e.detail.editor,this._editor.onKeyDown(t=>{t.shiftKey&&t.keyCode===g.KeyCode.Enter&&t.preventDefault()})}showContextMenu(e){var u;e.preventDefault();const t=document.querySelectorAll("cv-notebook-cell");t==null||t.forEach(h=>{h.closeContextMenu()});const i=(u=this.shadowRoot)==null?void 0:u.querySelector(".contextMenu"),o=i==null?void 0:i.offsetHeight,a=window.innerHeight-e.clientY,d=e.clientY;a>=o?(this._menuPosition={top:e.clientY,left:e.clientX},this._menuMaxHeight=`${a}px`):d>=o?(this._menuPosition={top:e.clientY-o,left:e.clientX},this._menuMaxHeight=`${o}px`):(this._menuPosition={top:e.clientY-d,left:e.clientX},this._menuMaxHeight=`${d}px`),this._isMenuOpen=!0}updated(e){var i,o;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("cv-code-editor");if(e.has("code")||e.has("language"))if(t)t.code=this.code,t.language=this.language;else{const l=(o=this.shadowRoot)==null?void 0:o.querySelector("cv-code-snippet");l&&!this.selected&&l.highlight()}super.updated(e)}getEditorBgColor(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".editorContainer");return e?window.getComputedStyle(e).getPropertyValue("background-color"):""}renderEditor(){const e=this.selected?r.x`<cv-code-editor
|
3
3
|
@code-change="${this.handleCodeChange}"
|
4
4
|
@editor-ready="${this.setEditorInstance}"
|
5
5
|
@editor-focus="${t=>this.setEditorFocus(t,!0)}"
|
@@ -14,17 +14,19 @@
|
|
14
14
|
<div class="output">
|
15
15
|
<slot name="output"></slot>
|
16
16
|
<slot name="input"></slot>
|
17
|
-
</div>`;return r.x`${e}`}renderExecutionCount(){if(this.hideCount)return r.x` `;const e={status:!0,loading:this.loading};return r.x`[<span class="${
|
17
|
+
</div>`;return r.x`${e}`}renderExecutionCount(){if(this.hideCount)return r.x` `;const e={status:!0,loading:this.loading};return r.x`[<span class="${p.o(e)}"
|
18
18
|
>${this.loading?"*":this.timesExecuted||" "}</span
|
19
19
|
>] :`}render(){const e={cell:!0,selected:this.selected,focused:this._editorFocused};return r.x`
|
20
|
-
<div class="${
|
20
|
+
<div class="${p.o(e)}" @contextmenu=${this.showContextMenu}>
|
21
21
|
<div class="selectionIndicatorWrapper">
|
22
22
|
<div class="selectionIndicator"></div>
|
23
23
|
</div>
|
24
24
|
|
25
25
|
<div class="timesExecutedWrapper">
|
26
26
|
<div class="timesExecuted">
|
27
|
-
<
|
27
|
+
<div class="dragHandle">
|
28
|
+
<slot name="drag-handle"></slot>
|
29
|
+
</div>
|
28
30
|
<div class="executionCount">${this.renderExecutionCount()}</div>
|
29
31
|
</div>
|
30
32
|
</div>
|
@@ -37,8 +39,10 @@
|
|
37
39
|
class="contextMenu ${this._isMenuOpen?"open":""}"
|
38
40
|
style="left: ${this._menuPosition.left}px; top: ${this._menuPosition.top}px; max-height: ${this._menuMaxHeight}"
|
39
41
|
>
|
40
|
-
<
|
42
|
+
<div class="contextMenuContent">
|
43
|
+
<slot name="context-menu"></slot>
|
44
|
+
</div>
|
41
45
|
</div>
|
42
46
|
`}};exports.CovalentNotebookCell.styles=[r.i`
|
43
47
|
${r.r(b)}
|
44
|
-
`];n([s.n({type:Number})],exports.CovalentNotebookCell.prototype,"index",2);n([s.n({type:String})],exports.CovalentNotebookCell.prototype,"code",2);n([s.n({type:String})],exports.CovalentNotebookCell.prototype,"language",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"loading",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"selected",2);n([s.n({type:Number})],exports.CovalentNotebookCell.prototype,"timesExecuted",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"hideEditor",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"hideCount",2);n([s.n({type:String})],exports.CovalentNotebookCell.prototype,"editorTheme",2);n([v.t()],exports.CovalentNotebookCell.prototype,"_isMenuOpen",2);exports.CovalentNotebookCell=n([r.e("cv-notebook-cell")],exports.CovalentNotebookCell);const
|
48
|
+
`];n([s.n({type:Number})],exports.CovalentNotebookCell.prototype,"index",2);n([s.n({type:String})],exports.CovalentNotebookCell.prototype,"code",2);n([s.n({type:String})],exports.CovalentNotebookCell.prototype,"language",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"loading",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"selected",2);n([s.n({type:Number})],exports.CovalentNotebookCell.prototype,"timesExecuted",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"hideEditor",2);n([s.n({type:Boolean,reflect:!0})],exports.CovalentNotebookCell.prototype,"hideCount",2);n([s.n({type:String})],exports.CovalentNotebookCell.prototype,"editorTheme",2);n([v.t()],exports.CovalentNotebookCell.prototype,"_isMenuOpen",2);exports.CovalentNotebookCell=n([r.e("cv-notebook-cell")],exports.CovalentNotebookCell);const f=exports.CovalentNotebookCell;exports.default=f;
|
package/notebook-cell.mjs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { i as v, r as m, s as g, x as c, e as
|
2
|
-
import { n as
|
3
|
-
import { t as
|
1
|
+
import { i as v, r as m, s as g, x as c, e as x } from "./query-assigned-elements-4a39219d.mjs";
|
2
|
+
import { n as d } from "./property-9b6ea53b.mjs";
|
3
|
+
import { t as f } from "./state-b5e865db.mjs";
|
4
4
|
import { o as u } from "./class-map-6e504a9a.mjs";
|
5
|
-
import { K as
|
5
|
+
import { K as b } from "./code-editor-74bd33c8.mjs";
|
6
6
|
import "./code-snippet.mjs";
|
7
7
|
import "./icon-button.mjs";
|
8
8
|
import "./typography.mjs";
|
@@ -20,11 +20,11 @@ import "./style-map-e7ec6d41.mjs";
|
|
20
20
|
import "./aria-property-fa2717fe.mjs";
|
21
21
|
import "./event-options-78d6cf94.mjs";
|
22
22
|
import "./if-defined-c367f208.mjs";
|
23
|
-
const y = `:host{--mdc-icon-button-size: 2rem;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface);border-radius:0;box-sizing:border-box}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;height:100%;visibility:hidden}.selectionIndicatorWrapper{min-width:8px}.selectionIndicatorWrapper:hover .selectionIndicator{visibility:visible}.status{padding:0 1px;position:relative}.loading{top:2.5px}.timesExecuted{--cv-icon-button-cursor: grab;align-items:center;box-sizing:border-box;color:var(--cv-theme-on-surface-38);display:flex;font-family:var(--cv-typography-subtitle2-font-family);font-size:var(--cv-typography-subtitle2-font-size);height:56px;line-height:var(--cv-typography-headline6-line-height)}.timesExecuted .executionCount{padding-right:1rem;overflow:hidden;text-align:right;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap;width:
|
23
|
+
const y = `:host{--mdc-icon-button-size: 2rem;font-family:var(--mdc-typography-body1-font-family);width:100%}cv-code-snippet{background-color:var(--cv-theme-surface);border-radius:0;box-sizing:border-box}cv-code-snippet::part(code){font-size:var(--mdc-typography-body2-font-size);line-height:var(--mdc-typography-body2-line-height);padding:0;white-space:pre-wrap}cv-code-editor{margin-top:-1px}.selectionIndicator{background-color:var(--cv-theme-primary);border-radius:2px;height:100%;visibility:hidden}.selectionIndicatorWrapper{min-width:8px}.selectionIndicatorWrapper:hover .selectionIndicator{visibility:visible}.status{padding:0 1px;position:relative}.loading{top:2.5px}.timesExecuted{--cv-icon-button-cursor: grab;align-items:center;box-sizing:border-box;color:var(--cv-theme-on-surface-38);display:flex;font-family:var(--cv-typography-subtitle2-font-family);font-size:var(--cv-typography-subtitle2-font-size);gap:.5rem;height:56px;line-height:var(--cv-typography-headline6-line-height)}.timesExecuted .executionCount{padding-right:1rem;overflow:hidden;text-align:right;text-overflow:ellipsis;-webkit-user-select:none;user-select:none;white-space:nowrap;width:52px}.timesExecuted .dragHandle{color:var(--cv-theme-on-surface-variant);cursor:grab;padding-left:.5rem;transition:visibility .3s ease;visibility:hidden}.timesExecuted .dragHandle:active{--cv-icon-button-cursor: grabbing}.timesExecutedWrapper{cursor:grab}.timesExecutedWrapper:active{cursor:grabbing}.timesExecutedWrapper:hover .dragHandle{visibility:visible}.cell{box-sizing:border-box;cursor:pointer;display:flex;justify-content:space-between;position:relative;transition:background-color .2s ease;-webkit-user-select:auto;user-select:auto}.cell.focused .selectionIndicator,.cell.selected .selectionIndicator{visibility:visible}.cell:hover{background-color:var(--cv-theme-secondary-4)}.cell:hover .selectionIndicator{visibility:visible;background-color:var(--cv-theme-on-secondary-container-38)}.cell:active{background-color:var(--cv-theme-secondary-12)}.cell:active .selectionIndicator{visibility:visible;background-color:var(--cv-theme-on-secondary-container-74)}.cellWrapper{display:flex;flex-direction:column;width:100%}.cellOutputWrapper{display:flex;flex-direction:column;max-width:calc(100% - 130px);flex:1}.contextMenu{background-color:var(--cv-theme-surface-canvas);border-radius:8px;box-shadow:0 8px 12px 6px #00000026,0 4px 4px #0000004d;display:flex;flex-direction:column;position:fixed;visibility:hidden;z-index:1000}.contextMenuContent{border-radius:4px;flex-grow:1;max-height:100%;overflow:auto}.contextMenu.open{visibility:visible}.editorContainer{box-sizing:border-box;background-color:var(--cv-theme-surface);border:1px solid var(--cv-theme-outline-variant);border-radius:var(--cv-editor-border-radius, 4px);min-height:56px;overflow:hidden;padding:1rem}.errors,.output{max-width:100%;width:100%}
|
24
24
|
`;
|
25
25
|
var C = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (e, t, o, r) => {
|
26
|
-
for (var s = r > 1 ? void 0 : r ? w(t, o) : t,
|
27
|
-
(a = e[
|
26
|
+
for (var s = r > 1 ? void 0 : r ? w(t, o) : t, l = e.length - 1, a; l >= 0; l--)
|
27
|
+
(a = e[l]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
28
28
|
return r && s && C(t, o, s), s;
|
29
29
|
};
|
30
30
|
let i = class extends g {
|
@@ -68,7 +68,7 @@ let i = class extends g {
|
|
68
68
|
}
|
69
69
|
setEditorInstance(e) {
|
70
70
|
e.stopImmediatePropagation(), this._editor = e.detail.editor, this._editor.onKeyDown((t) => {
|
71
|
-
t.shiftKey && t.keyCode ===
|
71
|
+
t.shiftKey && t.keyCode === b.Enter && t.preventDefault();
|
72
72
|
});
|
73
73
|
}
|
74
74
|
showContextMenu(e) {
|
@@ -80,8 +80,8 @@ let i = class extends g {
|
|
80
80
|
});
|
81
81
|
const o = (p = this.shadowRoot) == null ? void 0 : p.querySelector(
|
82
82
|
".contextMenu"
|
83
|
-
), r = o == null ? void 0 : o.offsetHeight,
|
84
|
-
|
83
|
+
), r = o == null ? void 0 : o.offsetHeight, l = window.innerHeight - e.clientY, a = e.clientY;
|
84
|
+
l >= r ? (this._menuPosition = { top: e.clientY, left: e.clientX }, this._menuMaxHeight = `${l}px`) : a >= r ? (this._menuPosition = { top: e.clientY - r, left: e.clientX }, this._menuMaxHeight = `${r}px`) : (this._menuPosition = { top: e.clientY - a, left: e.clientX }, this._menuMaxHeight = `${a}px`), this._isMenuOpen = !0;
|
85
85
|
}
|
86
86
|
updated(e) {
|
87
87
|
var o, r;
|
@@ -148,7 +148,9 @@ let i = class extends g {
|
|
148
148
|
|
149
149
|
<div class="timesExecutedWrapper">
|
150
150
|
<div class="timesExecuted">
|
151
|
-
<
|
151
|
+
<div class="dragHandle">
|
152
|
+
<slot name="drag-handle"></slot>
|
153
|
+
</div>
|
152
154
|
<div class="executionCount">${this.renderExecutionCount()}</div>
|
153
155
|
</div>
|
154
156
|
</div>
|
@@ -161,7 +163,9 @@ let i = class extends g {
|
|
161
163
|
class="contextMenu ${this._isMenuOpen ? "open" : ""}"
|
162
164
|
style="left: ${this._menuPosition.left}px; top: ${this._menuPosition.top}px; max-height: ${this._menuMaxHeight}"
|
163
165
|
>
|
164
|
-
<
|
166
|
+
<div class="contextMenuContent">
|
167
|
+
<slot name="context-menu"></slot>
|
168
|
+
</div>
|
165
169
|
</div>
|
166
170
|
`;
|
167
171
|
}
|
@@ -172,37 +176,37 @@ i.styles = [
|
|
172
176
|
`
|
173
177
|
];
|
174
178
|
n([
|
175
|
-
|
179
|
+
d({ type: Number })
|
176
180
|
], i.prototype, "index", 2);
|
177
181
|
n([
|
178
|
-
|
182
|
+
d({ type: String })
|
179
183
|
], i.prototype, "code", 2);
|
180
184
|
n([
|
181
|
-
|
185
|
+
d({ type: String })
|
182
186
|
], i.prototype, "language", 2);
|
183
187
|
n([
|
184
|
-
|
188
|
+
d({ type: Boolean, reflect: !0 })
|
185
189
|
], i.prototype, "loading", 2);
|
186
190
|
n([
|
187
|
-
|
191
|
+
d({ type: Boolean, reflect: !0 })
|
188
192
|
], i.prototype, "selected", 2);
|
189
193
|
n([
|
190
|
-
|
194
|
+
d({ type: Number })
|
191
195
|
], i.prototype, "timesExecuted", 2);
|
192
196
|
n([
|
193
|
-
|
197
|
+
d({ type: Boolean, reflect: !0 })
|
194
198
|
], i.prototype, "hideEditor", 2);
|
195
199
|
n([
|
196
|
-
|
200
|
+
d({ type: Boolean, reflect: !0 })
|
197
201
|
], i.prototype, "hideCount", 2);
|
198
202
|
n([
|
199
|
-
|
203
|
+
d({ type: String })
|
200
204
|
], i.prototype, "editorTheme", 2);
|
201
205
|
n([
|
202
|
-
|
206
|
+
f()
|
203
207
|
], i.prototype, "_isMenuOpen", 2);
|
204
208
|
i = n([
|
205
|
-
|
209
|
+
x("cv-notebook-cell")
|
206
210
|
], i);
|
207
211
|
const T = i;
|
208
212
|
export {
|