@difizen/libro-sql-cell 0.2.34
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 +52 -0
- package/es/libro-sql-cell-view.d.ts.map +1 -0
- package/es/libro-sql-cell-view.js +712 -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 +116 -0
- package/src/index.spec.ts +9 -0
- package/src/index.ts +1 -0
- package/src/libro-formatter-sql-magic-contribution.ts +53 -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 +111 -0
- package/src/libro-sql-cell-protocol.ts +19 -0
- package/src/libro-sql-cell-script.ts +7 -0
- package/src/libro-sql-cell-view.tsx +600 -0
- package/src/libro-sql-utils.ts +22 -0
- package/src/module.ts +38 -0
|
@@ -0,0 +1,161 @@
|
|
|
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, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
|
|
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 _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 _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
13
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
14
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
18
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
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; }
|
|
22
|
+
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.'); }
|
|
23
|
+
import { CellOptions, LibroCellModel } from '@difizen/libro-jupyter';
|
|
24
|
+
import { Emitter, inject, prop, transient, ViewManager } from '@difizen/mana-app';
|
|
25
|
+
export var LibroSqlCellModel = (_dec = transient(), _dec2 = prop(), _dec3 = prop(), _dec4 = prop(), _dec5 = prop(), _dec6 = prop(), _dec7 = prop(), _dec8 = prop(), _dec9 = prop(), _dec10 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function (_LibroCellModel) {
|
|
26
|
+
_inherits(LibroSqlCellModel, _LibroCellModel);
|
|
27
|
+
var _super = _createSuper(LibroSqlCellModel);
|
|
28
|
+
function LibroSqlCellModel(options, viewManager) {
|
|
29
|
+
var _options$cell;
|
|
30
|
+
var _this;
|
|
31
|
+
_classCallCheck(this, LibroSqlCellModel);
|
|
32
|
+
_this = _super.call(this, options);
|
|
33
|
+
_initializerDefineProperty(_this, "resultVariable", _descriptor, _assertThisInitialized(_this));
|
|
34
|
+
_initializerDefineProperty(_this, "executeCount", _descriptor2, _assertThisInitialized(_this));
|
|
35
|
+
_initializerDefineProperty(_this, "executing", _descriptor3, _assertThisInitialized(_this));
|
|
36
|
+
_initializerDefineProperty(_this, "hasOutputHidden", _descriptor4, _assertThisInitialized(_this));
|
|
37
|
+
_initializerDefineProperty(_this, "hasOutputsScrolled", _descriptor5, _assertThisInitialized(_this));
|
|
38
|
+
_initializerDefineProperty(_this, "kernelExecuting", _descriptor6, _assertThisInitialized(_this));
|
|
39
|
+
_initializerDefineProperty(_this, "hasExecutedSuccess", _descriptor7, _assertThisInitialized(_this));
|
|
40
|
+
_initializerDefineProperty(_this, "hasExecutedError", _descriptor8, _assertThisInitialized(_this));
|
|
41
|
+
_initializerDefineProperty(_this, "metadata", _descriptor9, _assertThisInitialized(_this));
|
|
42
|
+
// Emitter Msg
|
|
43
|
+
_this.msgChangeEmitter = void 0;
|
|
44
|
+
_this.viewManager = void 0;
|
|
45
|
+
_this.clearExecution = function () {
|
|
46
|
+
_this.executeCount = null;
|
|
47
|
+
_this.executing = false;
|
|
48
|
+
_this.kernelExecuting = false;
|
|
49
|
+
_this.metadata['execution'] = {};
|
|
50
|
+
};
|
|
51
|
+
_this.viewManager = viewManager;
|
|
52
|
+
_this.executing = false;
|
|
53
|
+
_this.msgChangeEmitter = new Emitter();
|
|
54
|
+
_this.executeCount = options.cell.execution_count || null;
|
|
55
|
+
_this.mimeType = 'application/vnd.libro.sql+json';
|
|
56
|
+
_this.hasOutputHidden = false;
|
|
57
|
+
_this.hasOutputsScrolled = false;
|
|
58
|
+
_this.libroFormatType = 'formatter-sql-magic';
|
|
59
|
+
_this.metadata = _objectSpread(_objectSpread({}, options === null || options === void 0 || (_options$cell = options.cell) === null || _options$cell === void 0 ? void 0 : _options$cell.metadata), {}, {
|
|
60
|
+
libroFormatter: _this.libroFormatType
|
|
61
|
+
});
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
LibroSqlCellModel = inject(ViewManager)(LibroSqlCellModel, undefined, 1) || LibroSqlCellModel;
|
|
65
|
+
LibroSqlCellModel = inject(CellOptions)(LibroSqlCellModel, undefined, 0) || LibroSqlCellModel;
|
|
66
|
+
_createClass(LibroSqlCellModel, [{
|
|
67
|
+
key: "msgChange",
|
|
68
|
+
get: function get() {
|
|
69
|
+
return this.msgChangeEmitter.event;
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
key: "toJSON",
|
|
73
|
+
value: function toJSON() {
|
|
74
|
+
// const outputs = this.outputArea?.toJSON() ?? this.outputs;
|
|
75
|
+
return {
|
|
76
|
+
id: this.id,
|
|
77
|
+
cell_type: this.type,
|
|
78
|
+
source: this.source,
|
|
79
|
+
metadata: this.metadata,
|
|
80
|
+
execution_count: this.executeCount
|
|
81
|
+
// outputs: this.outputs,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "decodeObject",
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _objectSpread(_objectSpread({}, this._decodeObject), {}, {
|
|
88
|
+
value: this.value,
|
|
89
|
+
result_variable: this.resultVariable || this._decodeObject.result_variable
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
set: function set(data) {
|
|
93
|
+
this.value = data.value;
|
|
94
|
+
this.resultVariable = data.result_variable;
|
|
95
|
+
this._decodeObject = data;
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "dispose",
|
|
99
|
+
value: function dispose() {
|
|
100
|
+
_get(_getPrototypeOf(LibroSqlCellModel.prototype), "dispose", this).call(this);
|
|
101
|
+
this.msgChangeEmitter.dispose();
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "getSource",
|
|
105
|
+
value: function getSource() {
|
|
106
|
+
return this.value;
|
|
107
|
+
}
|
|
108
|
+
}]);
|
|
109
|
+
return LibroSqlCellModel;
|
|
110
|
+
}(LibroCellModel), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "resultVariable", [_dec2], {
|
|
111
|
+
configurable: true,
|
|
112
|
+
enumerable: true,
|
|
113
|
+
writable: true,
|
|
114
|
+
initializer: null
|
|
115
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "executeCount", [_dec3], {
|
|
116
|
+
configurable: true,
|
|
117
|
+
enumerable: true,
|
|
118
|
+
writable: true,
|
|
119
|
+
initializer: null
|
|
120
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "executing", [_dec4], {
|
|
121
|
+
configurable: true,
|
|
122
|
+
enumerable: true,
|
|
123
|
+
writable: true,
|
|
124
|
+
initializer: null
|
|
125
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "hasOutputHidden", [_dec5], {
|
|
126
|
+
configurable: true,
|
|
127
|
+
enumerable: true,
|
|
128
|
+
writable: true,
|
|
129
|
+
initializer: null
|
|
130
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "hasOutputsScrolled", [_dec6], {
|
|
131
|
+
configurable: true,
|
|
132
|
+
enumerable: true,
|
|
133
|
+
writable: true,
|
|
134
|
+
initializer: null
|
|
135
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "kernelExecuting", [_dec7], {
|
|
136
|
+
configurable: true,
|
|
137
|
+
enumerable: true,
|
|
138
|
+
writable: true,
|
|
139
|
+
initializer: function initializer() {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "hasExecutedSuccess", [_dec8], {
|
|
143
|
+
configurable: true,
|
|
144
|
+
enumerable: true,
|
|
145
|
+
writable: true,
|
|
146
|
+
initializer: function initializer() {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "hasExecutedError", [_dec9], {
|
|
150
|
+
configurable: true,
|
|
151
|
+
enumerable: true,
|
|
152
|
+
writable: true,
|
|
153
|
+
initializer: function initializer() {
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "metadata", [_dec10], {
|
|
157
|
+
configurable: true,
|
|
158
|
+
enumerable: true,
|
|
159
|
+
writable: true,
|
|
160
|
+
initializer: null
|
|
161
|
+
})), _class2)) || _class);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CellOptions, CellView } from '@difizen/libro-jupyter';
|
|
2
|
+
import type { LibroSqlCellModel } from './libro-sql-cell-model.js';
|
|
3
|
+
export type LibroSqlCellModelFactory = (options: CellOptions) => LibroSqlCellModel;
|
|
4
|
+
export declare const LibroSqlCellModelFactory: unique symbol;
|
|
5
|
+
export interface VisAnalysis {
|
|
6
|
+
addAnalysisCell: (cellView: CellView, dfName?: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface DatabaseConfig {
|
|
9
|
+
db_type: string;
|
|
10
|
+
username: string;
|
|
11
|
+
password: string;
|
|
12
|
+
host: string;
|
|
13
|
+
port: number;
|
|
14
|
+
database: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=libro-sql-cell-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-sql-cell-protocol.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,iBAAiB,CAAC;AACnF,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAE3E,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var LibroSqlCellModelFactory = Symbol('LibroSqlCellModelFactory');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-sql-cell-script.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-script.ts"],"names":[],"mappings":"AAEA,qBACa,SAAS;IACpB,SAAgB,WAAW,EAAE,MAAM,CACV;CAC1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
import { singleton } from '@difizen/mana-app';
|
|
9
|
+
export var SqlScript = (_dec = singleton(), _dec(_class = /*#__PURE__*/_createClass(function SqlScript() {
|
|
10
|
+
_classCallCheck(this, SqlScript);
|
|
11
|
+
this.getDbConfig = "from libro_sql.database import db\ndb.get_db_config().json()";
|
|
12
|
+
})) || _class);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CodeEditorView } from '@difizen/libro-code-editor';
|
|
2
|
+
import { CodeEditorManager } from '@difizen/libro-code-editor';
|
|
3
|
+
import type { IOutput } from '@difizen/libro-common';
|
|
4
|
+
import type { CellViewOptions, LibroCell, KernelMessage } from '@difizen/libro-jupyter';
|
|
5
|
+
import { CellService, EditorStatus, LibroContextKey, LibroExecutableCellView, LibroViewTracker, LibroOutputArea } from '@difizen/libro-jupyter';
|
|
6
|
+
import type { ViewSize } from '@difizen/mana-app';
|
|
7
|
+
import { Deferred, DisposableCollection, ViewManager } from '@difizen/mana-app';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import './index.less';
|
|
10
|
+
import { LibroSqlCellModel } from './libro-sql-cell-model.js';
|
|
11
|
+
import type { DatabaseConfig } from './libro-sql-cell-protocol.js';
|
|
12
|
+
import { SqlScript } from './libro-sql-cell-script.js';
|
|
13
|
+
export declare const LibroSqlCell: React.ForwardRefExoticComponent<React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export declare class LibroSqlCellView extends LibroExecutableCellView {
|
|
15
|
+
view: React.ForwardRefExoticComponent<React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
model: LibroSqlCellModel;
|
|
17
|
+
libroViewTracker: LibroViewTracker;
|
|
18
|
+
codeEditorManager: CodeEditorManager;
|
|
19
|
+
protected toDisposeOnEditor: DisposableCollection;
|
|
20
|
+
protected readonly libroContextKey: LibroContextKey;
|
|
21
|
+
outputs: IOutput[];
|
|
22
|
+
editorView?: CodeEditorView;
|
|
23
|
+
databaseConfig?: DatabaseConfig;
|
|
24
|
+
editorStatus: EditorStatus;
|
|
25
|
+
editorAreaHeight: number;
|
|
26
|
+
noEditorAreaHeight: number;
|
|
27
|
+
sqlScript: SqlScript;
|
|
28
|
+
protected editorViewReadyDeferred: Deferred<void>;
|
|
29
|
+
get editorReady(): Promise<void>;
|
|
30
|
+
renderEditor: () => import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
+
calcEditorOffset(): number;
|
|
32
|
+
calcEditorAreaHeight(): number;
|
|
33
|
+
protected outputAreaDeferred: Deferred<LibroOutputArea>;
|
|
34
|
+
get outputAreaReady(): Promise<LibroOutputArea>;
|
|
35
|
+
constructor(options: CellViewOptions, cellService: CellService, viewManager: ViewManager, libroViewTracker: LibroViewTracker, codeEditorManager: CodeEditorManager);
|
|
36
|
+
onViewMount: () => Promise<void>;
|
|
37
|
+
setEditorHost(ref: any): void;
|
|
38
|
+
createEditor(): Promise<void>;
|
|
39
|
+
protected afterEditorReady(): Promise<void>;
|
|
40
|
+
protected focusEditor(): void;
|
|
41
|
+
onViewResize: (size: ViewSize) => void;
|
|
42
|
+
toJSON(): LibroCell;
|
|
43
|
+
focus: (toEdit: boolean) => void;
|
|
44
|
+
blur: () => void;
|
|
45
|
+
clearExecution: () => void;
|
|
46
|
+
run(): Promise<boolean>;
|
|
47
|
+
fetch: (content: KernelMessage.IExecuteRequestMsg['content'], ioCallback: (msg: KernelMessage.IIOPubMessage) => any) => Promise<KernelMessage.IExecuteReplyMsg>;
|
|
48
|
+
handleQueryResponse: (response: KernelMessage.IIOPubMessage, cb: (result: string) => void) => void;
|
|
49
|
+
getDatabaseConfig: () => Promise<KernelMessage.IExecuteReplyMsg>;
|
|
50
|
+
shouldEnterEditorMode(e: React.FocusEvent<HTMLElement>): boolean;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=libro-sql-cell-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libro-sql-cell-view.d.ts","sourceRoot":"","sources":["../src/libro-sql-cell-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAa,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EACV,eAAe,EAGf,SAAS,EACT,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAIhB,eAAe,EAChB,MAAM,wB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