@covalent/components 8.15.0-beta.10 → 8.15.0-beta.12
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/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.mjs +18 -18
- package/notebook/notebook.d.ts +8 -3
- package/notebook/notebook.d.ts.map +1 -1
- package/{cell/cell.d.ts → notebook-cell/notebook-cell.d.ts} +9 -4
- package/notebook-cell/notebook-cell.d.ts.map +1 -0
- package/notebook-cell.js +29 -0
- package/notebook-cell.mjs +155 -0
- package/notebook.js +37 -20
- package/notebook.mjs +339 -304
- package/package.json +5 -5
- package/cell/cell.d.ts.map +0 -1
- package/cell.js +0 -29
- package/cell.mjs +0 -147
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@covalent/components",
|
3
|
-
"version": "8.15.0-beta.
|
3
|
+
"version": "8.15.0-beta.12",
|
4
4
|
"description": "a catalog of material components for covalent",
|
5
5
|
"main": "./index.js",
|
6
6
|
"module": "./index.mjs",
|
@@ -41,10 +41,10 @@
|
|
41
41
|
"import": "./button.mjs",
|
42
42
|
"require": "./button.js"
|
43
43
|
},
|
44
|
-
"./cell": {
|
45
|
-
"types": "./cell/cell.d.ts",
|
46
|
-
"import": "./cell.mjs",
|
47
|
-
"require": "./cell.js"
|
44
|
+
"./notebook-cell": {
|
45
|
+
"types": "./notebook-cell/notebook-cell.d.ts",
|
46
|
+
"import": "./notebook-cell.mjs",
|
47
|
+
"require": "./notebook-cell.js"
|
48
48
|
},
|
49
49
|
"./checkbox": {
|
50
50
|
"types": "./checkbox/checkbox.d.ts",
|
package/cell/cell.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
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,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;IAenD,YAAY;IA2BZ,SAAS,CAAC,MAAM;CAsBjB;AAED,eAAe,YAAY,CAAC"}
|
package/cell.js
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("./query-assigned-elements-f623705d.js"),n=require("./property-57f6f6fe.js"),d=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}.selection-indicator{background-color:var(--cv-theme-primary);border-radius:2px;margin-top:2px;visibility:hidden;min-width:8px}.timesExecuted{color:var(--cv-theme-outline-variant);margin:0 2rem;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:100%}.cellCodeWrapper{align-items:flex-start;display:flex;justify-content:space-between}.cellOutputWrapper{width:calc(100% - 96px)}.output{margin:.75rem .25rem .5rem;max-width:100%}
|
2
|
-
`;var p=Object.defineProperty,h=Object.getOwnPropertyDescriptor,s=(a,e,r,o)=>{for(var t=o>1?void 0:o?h(e,r):e,l=a.length-1,c;l>=0;l--)(c=a[l])&&(t=(o?c(e,r,t):c(t))||t);return o&&t&&p(e,r,t),t};exports.CovalentCell=class extends i.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",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 r,o;if(e.has("code")||e.has("language")){const t=(r=this.shadowRoot)==null?void 0:r.querySelector("cv-code-editor");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.language=this.language)}}}renderEditor(){const e=this.selected?i.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.x`<cv-code-snippet hideHeader .language="${this.language}"
|
10
|
-
>${this.code}</cv-code-snippet
|
11
|
-
>`,r=i.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 i.x`${this.showEditor?e:""}${!this.showEditor&&this.language==="markdown"||this.language!=="markdown"?r:""}`}render(){const e={cell:!0,selected:this.selected,focused:this._editorFocused};return i.x`
|
16
|
-
<div class="${d.o(e)}">
|
17
|
-
<span class="selection-indicator"></span>
|
18
|
-
<div class="cellWrapper">
|
19
|
-
<div class="cellCodeWrapper">
|
20
|
-
<span class="timesExecuted">
|
21
|
-
${this.showEditor?i.x`[${this.timesExecuted?this.timesExecuted:" "}]:`:""}
|
22
|
-
</span>
|
23
|
-
<div class="cellOutputWrapper">${this.renderEditor()}</div>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
`}};exports.CovalentCell.styles=[i.i`
|
28
|
-
${i.r(u)}
|
29
|
-
`];s([n.n({type:Number})],exports.CovalentCell.prototype,"index",2);s([n.n({type:String})],exports.CovalentCell.prototype,"code",2);s([n.n({type:String})],exports.CovalentCell.prototype,"language",2);s([n.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"selected",2);s([n.n({type:Number})],exports.CovalentCell.prototype,"timesExecuted",2);s([n.n({type:Boolean,reflect:!0})],exports.CovalentCell.prototype,"showEditor",2);exports.CovalentCell=s([i.e("cv-cell")],exports.CovalentCell);const v=exports.CovalentCell;exports.default=v;
|
package/cell.mjs
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
import { i as p, r as h, s as u, x as c, e as m } from "./query-assigned-elements-4a39219d.mjs";
|
2
|
-
import { n as l } 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";
|
6
|
-
import "./icon-button.mjs";
|
7
|
-
import "./typography.mjs";
|
8
|
-
import "./directive-daf4e9b6.mjs";
|
9
|
-
import "./async-directive-99a01ec7.mjs";
|
10
|
-
import "./directive-helpers-e3ea6592.mjs";
|
11
|
-
import "./query-assigned-nodes-df691e78.mjs";
|
12
|
-
import "./_commonjsHelpers-2f131a27.mjs";
|
13
|
-
import "./tslib.es6-c4b0f3b1.mjs";
|
14
|
-
import "./ripple-handlers-8883e893.mjs";
|
15
|
-
import "./base-element-acf30176.mjs";
|
16
|
-
import "./utils-dc65fdc9.mjs";
|
17
|
-
import "./state-b5e865db.mjs";
|
18
|
-
import "./query-d843aa92.mjs";
|
19
|
-
import "./style-map-e7ec6d41.mjs";
|
20
|
-
import "./aria-property-fa2717fe.mjs";
|
21
|
-
import "./event-options-78d6cf94.mjs";
|
22
|
-
import "./if-defined-c367f208.mjs";
|
23
|
-
const v = `: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}.selection-indicator{background-color:var(--cv-theme-primary);border-radius:2px;margin-top:2px;visibility:hidden;min-width:8px}.timesExecuted{color:var(--cv-theme-outline-variant);margin:0 2rem;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:100%}.cellCodeWrapper{align-items:flex-start;display:flex;justify-content:space-between}.cellOutputWrapper{width:calc(100% - 96px)}.output{margin:.75rem .25rem .5rem;max-width:100%}
|
24
|
-
`;
|
25
|
-
var f = Object.defineProperty, y = Object.getOwnPropertyDescriptor, s = (e, o, d, r) => {
|
26
|
-
for (var t = r > 1 ? void 0 : r ? y(o, d) : o, a = e.length - 1, n; a >= 0; a--)
|
27
|
-
(n = e[a]) && (t = (r ? n(o, d, t) : n(t)) || t);
|
28
|
-
return r && t && f(o, d, t), t;
|
29
|
-
};
|
30
|
-
let i = class extends u {
|
31
|
-
constructor() {
|
32
|
-
super(...arguments), this.code = "", this.language = "", this.selected = !1, this.timesExecuted = 0, this.showEditor = !0, this._editorFocused = !1, this.editorOptions = {
|
33
|
-
minimap: { enabled: !1 },
|
34
|
-
// Disable minimap to save space
|
35
|
-
wordWrap: "on",
|
36
|
-
// Enable word wrap to avoid horizontal scroll
|
37
|
-
fontSize: "14px",
|
38
|
-
glyphMargin: !1,
|
39
|
-
folding: !1,
|
40
|
-
lineNumbers: "off",
|
41
|
-
lineDecorationsWidth: 0,
|
42
|
-
lineNumbersMinChars: 0,
|
43
|
-
renderLineHighlight: "none",
|
44
|
-
overviewRulerLanes: 0,
|
45
|
-
hideCursorInOverviewRuler: !0,
|
46
|
-
scrollbar: {
|
47
|
-
alwaysConsumeMouseWheel: !1,
|
48
|
-
vertical: "hidden"
|
49
|
-
}
|
50
|
-
};
|
51
|
-
}
|
52
|
-
handleCodeChange(e) {
|
53
|
-
this.code = e.detail.code;
|
54
|
-
}
|
55
|
-
handleRun() {
|
56
|
-
this.dispatchEvent(
|
57
|
-
new CustomEvent("cell-run-code", {
|
58
|
-
detail: { index: this.index, code: this.code },
|
59
|
-
bubbles: !0,
|
60
|
-
composed: !0
|
61
|
-
})
|
62
|
-
);
|
63
|
-
}
|
64
|
-
setEditorFocus(e) {
|
65
|
-
this._editorFocused = e, this.requestUpdate();
|
66
|
-
}
|
67
|
-
updated(e) {
|
68
|
-
var o, d;
|
69
|
-
if (e.has("code") || e.has("language")) {
|
70
|
-
const r = (o = this.shadowRoot) == null ? void 0 : o.querySelector("cv-code-editor");
|
71
|
-
if (r)
|
72
|
-
r.code = this.code, r.language = this.language;
|
73
|
-
else {
|
74
|
-
const t = (d = this.shadowRoot) == null ? void 0 : d.querySelector("cv-code-snippet");
|
75
|
-
t && !this.selected && (t.language = this.language);
|
76
|
-
}
|
77
|
-
}
|
78
|
-
}
|
79
|
-
renderEditor() {
|
80
|
-
const e = this.selected ? c`<cv-code-editor
|
81
|
-
@code-change="${this.handleCodeChange}"
|
82
|
-
@editor-focus="${() => this.setEditorFocus(!0)}"
|
83
|
-
@editor-blur="${() => this.setEditorFocus(!1)}"
|
84
|
-
.code="${this.code}"
|
85
|
-
.language="${this.language}"
|
86
|
-
.options="${this.editorOptions}"
|
87
|
-
></cv-code-editor>` : c`<cv-code-snippet hideHeader .language="${this.language}"
|
88
|
-
>${this.code}</cv-code-snippet
|
89
|
-
>`, o = c`<slot name="error"></slot>
|
90
|
-
<cv-typography class="output" scale="body1">
|
91
|
-
<slot name="output"></slot>
|
92
|
-
<slot name="input"></slot>
|
93
|
-
</cv-typography>`;
|
94
|
-
return c`${this.showEditor ? e : ""}${!this.showEditor && this.language === "markdown" || this.language !== "markdown" ? o : ""}`;
|
95
|
-
}
|
96
|
-
render() {
|
97
|
-
const e = {
|
98
|
-
cell: !0,
|
99
|
-
selected: this.selected,
|
100
|
-
focused: this._editorFocused
|
101
|
-
};
|
102
|
-
return c`
|
103
|
-
<div class="${g(e)}">
|
104
|
-
<span class="selection-indicator"></span>
|
105
|
-
<div class="cellWrapper">
|
106
|
-
<div class="cellCodeWrapper">
|
107
|
-
<span class="timesExecuted">
|
108
|
-
${this.showEditor ? c`[${this.timesExecuted ? this.timesExecuted : " "}]:` : ""}
|
109
|
-
</span>
|
110
|
-
<div class="cellOutputWrapper">${this.renderEditor()}</div>
|
111
|
-
</div>
|
112
|
-
</div>
|
113
|
-
</div>
|
114
|
-
`;
|
115
|
-
}
|
116
|
-
};
|
117
|
-
i.styles = [
|
118
|
-
p`
|
119
|
-
${h(v)}
|
120
|
-
`
|
121
|
-
];
|
122
|
-
s([
|
123
|
-
l({ type: Number })
|
124
|
-
], i.prototype, "index", 2);
|
125
|
-
s([
|
126
|
-
l({ type: String })
|
127
|
-
], i.prototype, "code", 2);
|
128
|
-
s([
|
129
|
-
l({ type: String })
|
130
|
-
], i.prototype, "language", 2);
|
131
|
-
s([
|
132
|
-
l({ type: Boolean, reflect: !0 })
|
133
|
-
], i.prototype, "selected", 2);
|
134
|
-
s([
|
135
|
-
l({ type: Number })
|
136
|
-
], i.prototype, "timesExecuted", 2);
|
137
|
-
s([
|
138
|
-
l({ type: Boolean, reflect: !0 })
|
139
|
-
], i.prototype, "showEditor", 2);
|
140
|
-
i = s([
|
141
|
-
m("cv-cell")
|
142
|
-
], i);
|
143
|
-
const I = i;
|
144
|
-
export {
|
145
|
-
i as CovalentCell,
|
146
|
-
I as default
|
147
|
-
};
|