@difizen/libro-sql-cell 0.0.0-snapshot-20241017072317
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/LICENSE +21 -0
- package/README.md +1 -0
- package/es/index.d.ts +2 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +1 -0
- package/es/index.less +116 -0
- package/es/libro-formatter-sql-magic-contribution.d.ts +25 -0
- package/es/libro-formatter-sql-magic-contribution.d.ts.map +1 -0
- package/es/libro-formatter-sql-magic-contribution.js +50 -0
- package/es/libro-formatter-sql-trans-contribution.d.ts +13 -0
- package/es/libro-formatter-sql-trans-contribution.d.ts.map +1 -0
- package/es/libro-formatter-sql-trans-contribution.js +26 -0
- package/es/libro-sql-cell-color-registry.d.ts +6 -0
- package/es/libro-sql-cell-color-registry.d.ts.map +1 -0
- package/es/libro-sql-cell-color-registry.js +57 -0
- package/es/libro-sql-cell-contribution.d.ts +15 -0
- package/es/libro-sql-cell-contribution.d.ts.map +1 -0
- package/es/libro-sql-cell-contribution.js +75 -0
- package/es/libro-sql-cell-model.d.ts +33 -0
- package/es/libro-sql-cell-model.d.ts.map +1 -0
- package/es/libro-sql-cell-model.js +161 -0
- package/es/libro-sql-cell-protocol.d.ts +16 -0
- package/es/libro-sql-cell-protocol.d.ts.map +1 -0
- package/es/libro-sql-cell-protocol.js +1 -0
- package/es/libro-sql-cell-script.d.ts +4 -0
- package/es/libro-sql-cell-script.d.ts.map +1 -0
- package/es/libro-sql-cell-script.js +12 -0
- package/es/libro-sql-cell-view.d.ts +42 -0
- package/es/libro-sql-cell-view.d.ts.map +1 -0
- package/es/libro-sql-cell-view.js +583 -0
- package/es/libro-sql-utils.d.ts +3 -0
- package/es/libro-sql-utils.d.ts.map +1 -0
- package/es/libro-sql-utils.js +33 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +25 -0
- package/package.json +65 -0
- package/src/index.less +120 -0
- package/src/index.spec.ts +9 -0
- package/src/index.ts +1 -0
- package/src/libro-formatter-sql-magic-contribution.ts +66 -0
- package/src/libro-formatter-sql-trans-contribution.ts +22 -0
- package/src/libro-sql-cell-color-registry.ts +35 -0
- package/src/libro-sql-cell-contribution.ts +46 -0
- package/src/libro-sql-cell-model.ts +115 -0
- package/src/libro-sql-cell-protocol.ts +20 -0
- package/src/libro-sql-cell-script.ts +6 -0
- package/src/libro-sql-cell-view.tsx +560 -0
- package/src/libro-sql-utils.ts +22 -0
- package/src/module.ts +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-present Difizen Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# libro-sql-cell
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./module.js";
|
package/es/index.less
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// The prefix to use on all css classes from ant.
|
|
2
|
+
@ant-prefix: ant;
|
|
3
|
+
|
|
4
|
+
.libro-sql-cell-header {
|
|
5
|
+
height: 36px;
|
|
6
|
+
border-bottom: 1px solid var(--mana-libro-code-border-color);
|
|
7
|
+
display: flex;
|
|
8
|
+
|
|
9
|
+
span {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.libro-sql-source {
|
|
15
|
+
padding: 0 16px;
|
|
16
|
+
border-right: 1px solid var(--mana-libro-cell-border-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.libro-sql-input-warning-text,
|
|
20
|
+
.libro-sql-variable-name-input {
|
|
21
|
+
display: block !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.libro-sql-variable-name-input {
|
|
25
|
+
width: 120px !important;
|
|
26
|
+
height: 32px;
|
|
27
|
+
border: 1px solid #d6d8da !important;
|
|
28
|
+
border-radius: 6px !important;
|
|
29
|
+
box-shadow: unset !important;
|
|
30
|
+
&.@{ant-prefix}-input-status-warning {
|
|
31
|
+
border-color: #faad14 !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.libro-sql-variable-name-title {
|
|
36
|
+
padding-left: 16px;
|
|
37
|
+
color: var(--mana-libro-cell-header-title);
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-family: SFProText;
|
|
41
|
+
line-height: 36px;
|
|
42
|
+
letter-spacing: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.libro-sql-source-content,
|
|
46
|
+
.libro-sql-variable-content {
|
|
47
|
+
padding-left: 3px;
|
|
48
|
+
color: var(--mana-libro-cell-header-content);
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
font-family: SFProText;
|
|
52
|
+
line-height: 36px;
|
|
53
|
+
letter-spacing: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.libro-sql-variable-name {
|
|
57
|
+
margin-left: 8px;
|
|
58
|
+
|
|
59
|
+
svg {
|
|
60
|
+
margin-left: 4px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.libro-sql-input-save,
|
|
65
|
+
.libro-sql-input-cancel {
|
|
66
|
+
width: 28px;
|
|
67
|
+
height: 20px;
|
|
68
|
+
color: #1890ff;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
letter-spacing: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.libro-sql-input-save {
|
|
75
|
+
margin-left: 8px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.libro-sql-edit-icon {
|
|
79
|
+
color: #bdc0c4 !important;
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
color: #1590ff !important;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.libro-sql-popover-container {
|
|
87
|
+
padding-top: 10px !important;
|
|
88
|
+
.@{ant-prefix}-popover-inner {
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
}
|
|
91
|
+
.@{ant-prefix}-popover-inner-content {
|
|
92
|
+
height: 100% !important;
|
|
93
|
+
text-align: right;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.@{ant-prefix}-popover-content {
|
|
97
|
+
transform: translateX(-18px) !important;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.libro-sql-input-warning-text {
|
|
102
|
+
width: 112px;
|
|
103
|
+
height: 20px;
|
|
104
|
+
margin-top: 4px;
|
|
105
|
+
color: #faad14;
|
|
106
|
+
font-weight: 400;
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.libro-sql-input-button {
|
|
111
|
+
margin-top: 12px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.libro-sql-variable-name-popover {
|
|
115
|
+
vertical-align: middle;
|
|
116
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormatterContribution } from '@difizen/libro-jupyter';
|
|
2
|
+
import type { DefaultEncodedFormatter, DefaultDecodedFormatter } from '@difizen/libro-jupyter';
|
|
3
|
+
export interface SqlDecodedFormatter extends DefaultDecodedFormatter {
|
|
4
|
+
result_variable?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class FormatterSqlMagicContribution implements FormatterContribution<SqlDecodedFormatter> {
|
|
7
|
+
formatter: string;
|
|
8
|
+
formatterOptions?: object;
|
|
9
|
+
canHandle: (libroFormatter: string) => 100 | 1;
|
|
10
|
+
encode: (source: SqlDecodedFormatter) => {
|
|
11
|
+
source: string;
|
|
12
|
+
metadata: {
|
|
13
|
+
libroFormatter: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
decode: (formatterValue: DefaultEncodedFormatter) => {
|
|
17
|
+
result_variable: string;
|
|
18
|
+
value: string;
|
|
19
|
+
} | {
|
|
20
|
+
value: string;
|
|
21
|
+
result_variable?: undefined;
|
|
22
|
+
};
|
|
23
|
+
validate: (source: SqlDecodedFormatter) => source is SqlDecodedFormatter;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=libro-formatter-sql-magic-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-formatter-sql-magic-contribution.d.ts","sourceRoot":"","sources":["../src/libro-formatter-sql-magic-contribution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,mBAAoB,SAAQ,uBAAuB;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBACa,6BACX,YAAW,qBAAqB,CAAC,mBAAmB,CAAC;IAErD,SAAS,SAAyB;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,SAAS,mBAAoB,MAAM,aAEjC;IACF,MAAM,WAAY,mBAAmB;;;;;MAQnC;IACF,MAAM,mBAAoB,uBAAuB;;;;;;MAe/C;IAEF,QAAQ,WAAY,mBAAmB,mCAErC;CACH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _class;
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
9
|
+
import { concatMultilineString } from '@difizen/libro-common';
|
|
10
|
+
import { FormatterContribution } from '@difizen/libro-jupyter';
|
|
11
|
+
import { singleton } from '@difizen/mana-app';
|
|
12
|
+
export var FormatterSqlMagicContribution = (_dec = singleton({
|
|
13
|
+
contrib: FormatterContribution
|
|
14
|
+
}), _dec(_class = /*#__PURE__*/_createClass(function FormatterSqlMagicContribution() {
|
|
15
|
+
var _this = this;
|
|
16
|
+
_classCallCheck(this, FormatterSqlMagicContribution);
|
|
17
|
+
this.formatter = 'formatter-sql-magic';
|
|
18
|
+
this.formatterOptions = void 0;
|
|
19
|
+
this.canHandle = function (libroFormatter) {
|
|
20
|
+
return libroFormatter === _this.formatter ? 100 : 1;
|
|
21
|
+
};
|
|
22
|
+
this.encode = function (source) {
|
|
23
|
+
var sqlEncodedValue = "%%sql \n{\"result_variable\":\"".concat(source.result_variable, "\", \"sql_script\":\"").concat(source.value, "\"}");
|
|
24
|
+
return {
|
|
25
|
+
source: sqlEncodedValue,
|
|
26
|
+
metadata: {
|
|
27
|
+
libroFormatter: _this.formatter
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
this.decode = function (formatterValue) {
|
|
32
|
+
var value = concatMultilineString(formatterValue.source);
|
|
33
|
+
if (value.startsWith('%%sql \n')) {
|
|
34
|
+
var run = value.split('%%sql \n')[1];
|
|
35
|
+
var runValue = JSON.parse(run);
|
|
36
|
+
var result_variable = runValue.result_variable;
|
|
37
|
+
var codeValue = runValue.sql_script;
|
|
38
|
+
return {
|
|
39
|
+
result_variable: result_variable,
|
|
40
|
+
value: codeValue
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
value: ''
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
this.validate = function (source) {
|
|
48
|
+
return 'result_variable' in source && 'sql_script' in source;
|
|
49
|
+
};
|
|
50
|
+
})) || _class);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FormatterTransContribution } from '@difizen/libro-jupyter';
|
|
2
|
+
import type { DefaultDecodedFormatter } from '@difizen/libro-jupyter';
|
|
3
|
+
import type { SqlDecodedFormatter } from './libro-formatter-sql-magic-contribution.js';
|
|
4
|
+
export declare class FormatterStringTransSqlContribution implements FormatterTransContribution<DefaultDecodedFormatter, SqlDecodedFormatter> {
|
|
5
|
+
origin: string;
|
|
6
|
+
target: string;
|
|
7
|
+
priority: number;
|
|
8
|
+
decodedValueTrans: (source: DefaultDecodedFormatter) => {
|
|
9
|
+
result_variable: any;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=libro-formatter-sql-trans-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-formatter-sql-trans-contribution.d.ts","sourceRoot":"","sources":["../src/libro-formatter-sql-trans-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,qBACa,mCACX,YAAW,0BAA0B,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;IAEnF,MAAM,SAAsB;IAC5B,MAAM,SAAyB;IAC/B,QAAQ,SAAO;IAEf,iBAAiB,WAAY,uBAAuB;;;MAKlD;CACH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _class;
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
12
|
+
import { FormatterTransContribution } from '@difizen/libro-jupyter';
|
|
13
|
+
import { singleton } from '@difizen/mana-app';
|
|
14
|
+
export var FormatterStringTransSqlContribution = (_dec = singleton({
|
|
15
|
+
contrib: FormatterTransContribution
|
|
16
|
+
}), _dec(_class = /*#__PURE__*/_createClass(function FormatterStringTransSqlContribution() {
|
|
17
|
+
_classCallCheck(this, FormatterStringTransSqlContribution);
|
|
18
|
+
this.origin = 'formatter-string';
|
|
19
|
+
this.target = 'formatter-sql-magic';
|
|
20
|
+
this.priority = 100;
|
|
21
|
+
this.decodedValueTrans = function (source) {
|
|
22
|
+
return _objectSpread(_objectSpread({}, source), {}, {
|
|
23
|
+
result_variable: source['result_variable'] || 'df_from_trans'
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
})) || _class);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ColorRegistry } from '@difizen/mana-app';
|
|
2
|
+
import { ColorContribution } from '@difizen/mana-app';
|
|
3
|
+
export declare class LibroSQLCellColorRegistry implements ColorContribution {
|
|
4
|
+
registerColors(colors: ColorRegistry): void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=libro-sql-cell-color-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-sql-cell-color-registry.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-color-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAS,iBAAiB,EAAa,MAAM,mBAAmB,CAAC;AAExE,qBACa,yBAA0B,YAAW,iBAAiB;IACjE,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;CA6B5C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _class;
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
import { Color, ColorContribution, singleton } from '@difizen/mana-app';
|
|
9
|
+
export var LibroSQLCellColorRegistry = (_dec = singleton({
|
|
10
|
+
contrib: ColorContribution
|
|
11
|
+
}), _dec(_class = /*#__PURE__*/function () {
|
|
12
|
+
function LibroSQLCellColorRegistry() {
|
|
13
|
+
_classCallCheck(this, LibroSQLCellColorRegistry);
|
|
14
|
+
}
|
|
15
|
+
_createClass(LibroSQLCellColorRegistry, [{
|
|
16
|
+
key: "registerColors",
|
|
17
|
+
value: function registerColors(colors) {
|
|
18
|
+
colors.register({
|
|
19
|
+
id: 'libro.sql.tab',
|
|
20
|
+
defaults: {
|
|
21
|
+
dark: '#B2B2B3',
|
|
22
|
+
light: Color.rgba(0, 10, 26, 0.68)
|
|
23
|
+
},
|
|
24
|
+
description: ''
|
|
25
|
+
}, {
|
|
26
|
+
id: 'libro.sql.tab.background',
|
|
27
|
+
defaults: {
|
|
28
|
+
dark: '#1C1C1D',
|
|
29
|
+
light: '#FAFAFB'
|
|
30
|
+
},
|
|
31
|
+
description: ''
|
|
32
|
+
}, {
|
|
33
|
+
id: 'libro.sql.button.border',
|
|
34
|
+
defaults: {
|
|
35
|
+
dark: '#505559',
|
|
36
|
+
light: Color.rgba(0, 10, 26, 0.1)
|
|
37
|
+
},
|
|
38
|
+
description: ''
|
|
39
|
+
}, {
|
|
40
|
+
id: 'libro.sql.button.background',
|
|
41
|
+
defaults: {
|
|
42
|
+
dark: '#2F3032',
|
|
43
|
+
light: '#FFFFFF'
|
|
44
|
+
},
|
|
45
|
+
description: ''
|
|
46
|
+
}, {
|
|
47
|
+
id: 'libro.sql.button.text.color',
|
|
48
|
+
defaults: {
|
|
49
|
+
dark: '#BDC0C4',
|
|
50
|
+
light: Color.rgba(0, 10, 26, 0.68)
|
|
51
|
+
},
|
|
52
|
+
description: ''
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}]);
|
|
56
|
+
return LibroSQLCellColorRegistry;
|
|
57
|
+
}()) || _class);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LanguageSpecRegistry } from '@difizen/libro-code-editor';
|
|
2
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
3
|
+
import type { CellMeta, CellModel, CellOptions } from '@difizen/libro-jupyter';
|
|
4
|
+
import { CellModelContribution, CellViewContribution } from '@difizen/libro-jupyter';
|
|
5
|
+
import { LibroSqlCellModelFactory } from './libro-sql-cell-protocol.js';
|
|
6
|
+
import { LibroSqlCellView } from './libro-sql-cell-view.js';
|
|
7
|
+
export declare class SqlCellContribution implements CellModelContribution, CellViewContribution, LanguageSpecContribution {
|
|
8
|
+
sqlCellModelFactory: LibroSqlCellModelFactory;
|
|
9
|
+
cellMeta: CellMeta;
|
|
10
|
+
canHandle(options: CellOptions, libroType?: string): number;
|
|
11
|
+
createModel(options: CellOptions): Promise<CellModel>;
|
|
12
|
+
view: typeof LibroSqlCellView;
|
|
13
|
+
registerLanguageSpec: (register: LanguageSpecRegistry) => void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=libro-sql-cell-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-sql-cell-contribution.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAIrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,qBAGa,mBACX,YAAW,qBAAqB,EAAE,oBAAoB,EAAE,wBAAwB;IAGhF,mBAAmB,EAAE,wBAAwB,CAAC;IAE9C,QAAQ,EAAE,QAAQ,CAKhB;IAEF,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrD,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC;IAK3D,IAAI,0BAAoB;IAExB,oBAAoB,aAAc,oBAAoB,UAOpD;CACH"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _dec, _dec2, _class, _class2, _descriptor;
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
4
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
5
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6
|
+
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
13
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
14
|
+
import { LanguageSpecContribution } from '@difizen/libro-code-editor';
|
|
15
|
+
import { CellModelContribution, CellViewContribution } from '@difizen/libro-jupyter';
|
|
16
|
+
import { inject } from '@difizen/mana-app';
|
|
17
|
+
import { singleton } from '@difizen/mana-app';
|
|
18
|
+
import { LibroSqlCellModelFactory } from "./libro-sql-cell-protocol.js";
|
|
19
|
+
import { LibroSqlCellView } from "./libro-sql-cell-view.js";
|
|
20
|
+
export var SqlCellContribution = (_dec = singleton({
|
|
21
|
+
contrib: [CellModelContribution, CellViewContribution, LanguageSpecContribution]
|
|
22
|
+
}), _dec2 = inject(LibroSqlCellModelFactory), _dec(_class = (_class2 = /*#__PURE__*/function () {
|
|
23
|
+
function SqlCellContribution() {
|
|
24
|
+
_classCallCheck(this, SqlCellContribution);
|
|
25
|
+
_initializerDefineProperty(this, "sqlCellModelFactory", _descriptor, this);
|
|
26
|
+
this.cellMeta = {
|
|
27
|
+
type: 'sql',
|
|
28
|
+
name: 'SQL',
|
|
29
|
+
order: 'e',
|
|
30
|
+
nbformatType: 'code'
|
|
31
|
+
};
|
|
32
|
+
this.view = LibroSqlCellView;
|
|
33
|
+
this.registerLanguageSpec = function (register) {
|
|
34
|
+
register.registerLanguageSpec({
|
|
35
|
+
name: 'SQL',
|
|
36
|
+
language: 'sql-odps',
|
|
37
|
+
mime: 'application/vnd.libro.sql+json',
|
|
38
|
+
ext: ['.sql']
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
_createClass(SqlCellContribution, [{
|
|
43
|
+
key: "canHandle",
|
|
44
|
+
value: function canHandle(options, libroType) {
|
|
45
|
+
return libroType === this.cellMeta.type ? 2000 : -1;
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "createModel",
|
|
49
|
+
value: function () {
|
|
50
|
+
var _createModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
51
|
+
var model;
|
|
52
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
model = this.sqlCellModelFactory(options);
|
|
56
|
+
return _context.abrupt("return", model);
|
|
57
|
+
case 2:
|
|
58
|
+
case "end":
|
|
59
|
+
return _context.stop();
|
|
60
|
+
}
|
|
61
|
+
}, _callee, this);
|
|
62
|
+
}));
|
|
63
|
+
function createModel(_x) {
|
|
64
|
+
return _createModel.apply(this, arguments);
|
|
65
|
+
}
|
|
66
|
+
return createModel;
|
|
67
|
+
}()
|
|
68
|
+
}]);
|
|
69
|
+
return SqlCellContribution;
|
|
70
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "sqlCellModelFactory", [_dec2], {
|
|
71
|
+
configurable: true,
|
|
72
|
+
enumerable: true,
|
|
73
|
+
writable: true,
|
|
74
|
+
initializer: null
|
|
75
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ICellMetadata, ICodeCell, ICodeCellMetadata } from '@difizen/libro-common';
|
|
2
|
+
import type { ExecutionCount } from '@difizen/libro-common';
|
|
3
|
+
import { CellOptions, LibroCellModel } from '@difizen/libro-jupyter';
|
|
4
|
+
import type { ExecutableCellModel } from '@difizen/libro-jupyter';
|
|
5
|
+
import type { Event as ManaEvent } from '@difizen/mana-app';
|
|
6
|
+
import { Emitter, ViewManager } from '@difizen/mana-app';
|
|
7
|
+
import type { SqlDecodedFormatter } from './libro-formatter-sql-magic-contribution.js';
|
|
8
|
+
export interface SqlCellMetadata extends ICodeCellMetadata {
|
|
9
|
+
resultVariable: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class LibroSqlCellModel extends LibroCellModel implements ExecutableCellModel {
|
|
12
|
+
resultVariable: string | undefined;
|
|
13
|
+
executeCount: ExecutionCount;
|
|
14
|
+
executing: boolean;
|
|
15
|
+
hasOutputHidden: boolean;
|
|
16
|
+
hasOutputsScrolled: boolean;
|
|
17
|
+
kernelExecuting: boolean;
|
|
18
|
+
hasExecutedSuccess: boolean;
|
|
19
|
+
hasExecutedError: boolean;
|
|
20
|
+
metadata: Partial<SqlCellMetadata | ICellMetadata>;
|
|
21
|
+
_decodeObject: SqlDecodedFormatter;
|
|
22
|
+
msgChangeEmitter: Emitter<any>;
|
|
23
|
+
get msgChange(): ManaEvent<any>;
|
|
24
|
+
viewManager: ViewManager;
|
|
25
|
+
constructor(options: CellOptions, viewManager: ViewManager);
|
|
26
|
+
toJSON(): Omit<ICodeCell, 'outputs'>;
|
|
27
|
+
set decodeObject(data: SqlDecodedFormatter);
|
|
28
|
+
get decodeObject(): SqlDecodedFormatter;
|
|
29
|
+
clearExecution: () => void;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
getSource(): string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=libro-sql-cell-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-sql-cell-model.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAA2B,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAEvF,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,cAAc,EAAE,MAAM,CAAC;CACxB;AACD,qBACa,iBAAkB,SAAQ,cAAe,YAAW,mBAAmB;IAElF,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC,YAAY,EAAE,cAAc,CAAC;IAE7B,SAAS,EAAE,OAAO,CAAC;IAEnB,eAAe,EAAE,OAAO,CAAC;IAEzB,kBAAkB,EAAE,OAAO,CAAC;IAG5B,eAAe,UAAS;IAGxB,kBAAkB,UAAS;IAE3B,gBAAgB,UAAS;IAEhB,QAAQ,EAAE,OAAO,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC;IAEpD,aAAa,EAAE,mBAAmB,CAAC;IAG3C,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAE/B,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,CAAC,CAE9B;IAED,WAAW,EAAE,WAAW,CAAC;gBAGF,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,WAAW;IAiBtC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC;IAY7C,IAAa,YAAY,CAAC,IAAI,EAAE,mBAAmB,EAIlD;IAED,IAAa,YAAY,IANO,mBAAmB,CAYlD;IAED,cAAc,aAKZ;IAEO,OAAO;IAKhB,SAAS;CAGV"}
|