@difizen/libro-output 0.0.2-alpha.0 → 0.1.0
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/README.md +22 -0
- package/es/display-data-output/display-data-output-contribution.d.ts +0 -1
- package/es/display-data-output/display-data-output-contribution.d.ts.map +1 -1
- package/es/display-data-output/display-data-output-contribution.js +1 -1
- package/es/display-data-output/display-data-output-model.d.ts +7 -9
- package/es/display-data-output/display-data-output-model.d.ts.map +1 -1
- package/es/display-data-output/display-data-output-model.js +1 -1
- package/es/error-output/error-output-contribution.d.ts +0 -1
- package/es/error-output/error-output-contribution.d.ts.map +1 -1
- package/es/error-output/error-output-contribution.js +1 -1
- package/es/error-output/error-output-model.d.ts +4 -4
- package/es/error-output/error-output-model.js +1 -1
- package/es/index.less +5 -6
- package/es/stream-output/stream-output-contribution.d.ts +0 -1
- package/es/stream-output/stream-output-contribution.d.ts.map +1 -1
- package/es/stream-output/stream-output-contribution.js +1 -1
- package/es/stream-output/stream-output-model.d.ts +3 -7
- package/es/stream-output/stream-output-model.d.ts.map +1 -1
- package/es/stream-output/stream-output-model.js +1 -1
- package/package.json +5 -5
- package/src/index.spec.ts +16 -0
package/README.md
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# libro-output
|
|
2
|
+
|
|
3
|
+
该包基于 [libro-core](../libro-core) 模块提供的输出扩展实现了 Jupyter 场景下的三个 Output 模块:
|
|
4
|
+
`StreamOutputModule`,`ErrorOutputModule`,`DisplayDataOutputModule`。同时,Output 中不同输出数据格式的渲染实现在 [libro-rendermime](../libro-rendermime/)。
|
|
5
|
+
|
|
6
|
+
## 标准输出
|
|
7
|
+
|
|
8
|
+
`StreamOutputModule` 模块主要功能是处理与显示代码执行的标准文本输出。
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## 错误输出
|
|
13
|
+
|
|
14
|
+
`ErrorOutputModule` 模块主要功能是处理与显示执行错误类型的输出。对错误类型在 UI 交互上进行了更突出的设计,增加隐藏与显示详细错误信息的交互,避免大段的错误信息导致文件篇幅过长。
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
## 富文本输出
|
|
19
|
+
|
|
20
|
+
`DisplayDataOutputModule` 模块支持富文本格式输出的处理与显示。
|
|
21
|
+
|
|
22
|
+

|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-data-output-contribution.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"display-data-output-contribution.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,qBACa,6BAA8B,YAAW,kBAAkB;IACjD,WAAW,EAAE,WAAW,CAAC;IAC9C,SAAS,+BAQP;IACF,OAAO,CAAC,MAAM,EAAE,cAAc;CAG/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
var _dec, _dec2, _class, _class2, _descriptor;
|
|
3
3
|
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 }); }
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -6,16 +6,14 @@ export declare class DisplayDataOutputModel extends LibroOutputView implements B
|
|
|
6
6
|
constructor(options: IOutputOptions);
|
|
7
7
|
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
8
8
|
toJSON(): {
|
|
9
|
-
output_type:
|
|
10
|
-
data:
|
|
11
|
-
metadata:
|
|
12
|
-
execution_count:
|
|
13
|
-
[key: string]: import("@difizen/libro-common").PartialJSONValue;
|
|
14
|
-
}> | import("@difizen/libro-common").PartialJSONValue[] | null;
|
|
9
|
+
output_type: any;
|
|
10
|
+
data: any;
|
|
11
|
+
metadata: any;
|
|
12
|
+
execution_count: any;
|
|
15
13
|
} | {
|
|
16
|
-
output_type:
|
|
17
|
-
data:
|
|
18
|
-
metadata:
|
|
14
|
+
output_type: any;
|
|
15
|
+
data: any;
|
|
16
|
+
metadata: any;
|
|
19
17
|
execution_count?: undefined;
|
|
20
18
|
};
|
|
21
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display-data-output-model.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-model.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAc1E,OAAO,eAAe,CAAC;AAwBvB,qBAEa,sBAAuB,SAAQ,eAAgB,YAAW,cAAc;gBACnD,OAAO,EAAE,cAAc;IAO9C,IAAI,2FAAgC;IACpC,MAAM
|
|
1
|
+
{"version":3,"file":"display-data-output-model.d.ts","sourceRoot":"","sources":["../../src/display-data-output/display-data-output-model.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAc1E,OAAO,eAAe,CAAC;AAwBvB,qBAEa,sBAAuB,SAAQ,eAAgB,YAAW,cAAc;gBACnD,OAAO,EAAE,cAAc;IAO9C,IAAI,2FAAgC;IACpC,MAAM;;;;;;;;;;;CAehB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
var _dec, _dec2, _class;
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
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); } }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-output-contribution.d.ts","sourceRoot":"","sources":["../../src/error-output/error-output-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-output-contribution.d.ts","sourceRoot":"","sources":["../../src/error-output/error-output-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBACa,uBAAwB,YAAW,kBAAkB;IAC3C,WAAW,EAAE,WAAW,CAAC;IAC9C,SAAS,+BAKP;IACF,OAAO,CAAC,MAAM,EAAE,cAAc;CAG/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
var _dec, _dec2, _class, _class2, _descriptor;
|
|
3
3
|
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 }); }
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -6,10 +6,10 @@ export declare class ErrorOutputModel extends LibroOutputView implements BaseOut
|
|
|
6
6
|
constructor(options: IOutputOptions);
|
|
7
7
|
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
8
8
|
toJSON(): {
|
|
9
|
-
output_type:
|
|
10
|
-
ename:
|
|
11
|
-
evalue:
|
|
12
|
-
traceback:
|
|
9
|
+
output_type: any;
|
|
10
|
+
ename: any;
|
|
11
|
+
evalue: any;
|
|
12
|
+
traceback: any;
|
|
13
13
|
};
|
|
14
14
|
showErrorDetail: boolean;
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
var _dec, _dec2, _dec3, _class, _class2, _descriptor;
|
|
3
3
|
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 }); }
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
package/es/index.less
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* stylelint-disable number-max-precision */
|
|
1
2
|
.libro-display-data-container img {
|
|
2
3
|
max-width: 100%;
|
|
3
4
|
max-height: 100%;
|
|
@@ -213,19 +214,17 @@
|
|
|
213
214
|
--jp-search-selected-match-color: black;
|
|
214
215
|
--jp-search-unselected-match-background-color: var(--jp-inverse-layout-color0);
|
|
215
216
|
--jp-search-unselected-match-color: var(--jp-ui-inverse-font-color0);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/* -----------------------------------------------------------------------------
|
|
219
|
-
| RenderedText
|
|
220
|
-
|---------------------------------------------------------------------------- */
|
|
221
217
|
|
|
222
|
-
:root {
|
|
223
218
|
/* This is the padding value to fill the gaps between lines containing spans with background color. */
|
|
224
219
|
--jp-private-code-span-padding: calc(
|
|
225
220
|
(var(--jp-code-line-height) - 1) * var(--jp-code-font-size) / 2
|
|
226
221
|
);
|
|
227
222
|
}
|
|
228
223
|
|
|
224
|
+
/* -----------------------------------------------------------------------------
|
|
225
|
+
| RenderedText
|
|
226
|
+
|---------------------------------------------------------------------------- */
|
|
227
|
+
|
|
229
228
|
.libro-text-render {
|
|
230
229
|
text-align: left;
|
|
231
230
|
line-height: var(--jp-code-line-height);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-output-contribution.d.ts","sourceRoot":"","sources":["../../src/stream-output/stream-output-contribution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream-output-contribution.d.ts","sourceRoot":"","sources":["../../src/stream-output/stream-output-contribution.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,qBACa,wBAAyB,YAAW,kBAAkB;IAC5C,WAAW,EAAE,WAAW,CAAC;IAC9C,SAAS,+BAKP;IACF,OAAO,CAAC,MAAM,EAAE,cAAc;CAG/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
var _dec, _dec2, _class, _class2, _descriptor;
|
|
3
3
|
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 }); }
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -6,13 +6,9 @@ export declare class StreamOutputModel extends LibroOutputView implements BaseOu
|
|
|
6
6
|
constructor(options: IOutputOptions);
|
|
7
7
|
view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
8
8
|
toJSON(): {
|
|
9
|
-
output_type:
|
|
10
|
-
name:
|
|
11
|
-
|
|
12
|
-
}> | import("@difizen/libro-common").PartialJSONValue[] | null | undefined;
|
|
13
|
-
text: string | number | boolean | Partial<{
|
|
14
|
-
[key: string]: import("@difizen/libro-common").PartialJSONValue;
|
|
15
|
-
}> | import("@difizen/libro-common").PartialJSONValue[] | string[] | null | undefined;
|
|
9
|
+
output_type: any;
|
|
10
|
+
name: any;
|
|
11
|
+
text: any;
|
|
16
12
|
};
|
|
17
13
|
}
|
|
18
14
|
//# sourceMappingURL=stream-output-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-output-model.d.ts","sourceRoot":"","sources":["../../src/stream-output/stream-output-model.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAa1E,OAAO,eAAe,CAAC;AA0BvB,qBAEa,iBAAkB,SAAQ,eAAgB,YAAW,cAAc;gBAC9C,OAAO,EAAE,cAAc;IAO9C,IAAI,2FAA2B;IAC/B,MAAM
|
|
1
|
+
{"version":3,"file":"stream-output-model.d.ts","sourceRoot":"","sources":["../../src/stream-output/stream-output-model.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAa1E,OAAO,eAAe,CAAC;AA0BvB,qBAEa,iBAAkB,SAAQ,eAAgB,YAAW,cAAc;gBAC9C,OAAO,EAAE,cAAc;IAO9C,IAAI,2FAA2B;IAC/B,MAAM;;;;;CAOhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
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
2
|
var _dec, _dec2, _class;
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
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); } }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-output",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"src"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@difizen/libro-common": "^0.
|
|
36
|
-
"@difizen/libro-core": "^0.
|
|
37
|
-
"@difizen/libro-rendermime": "^0.
|
|
38
|
-
"@difizen/mana-app": "
|
|
35
|
+
"@difizen/libro-common": "^0.1.0",
|
|
36
|
+
"@difizen/libro-core": "^0.1.0",
|
|
37
|
+
"@difizen/libro-rendermime": "^0.1.0",
|
|
38
|
+
"@difizen/mana-app": "latest",
|
|
39
39
|
"markdown-it": "^13.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import assert from 'assert';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DisplayDataOutputModel,
|
|
5
|
+
ErrorOutputModel,
|
|
6
|
+
StreamOutputModel,
|
|
7
|
+
} from './index.js';
|
|
8
|
+
import 'reflect-metadata';
|
|
9
|
+
|
|
10
|
+
describe('libro-output', () => {
|
|
11
|
+
it('#import', () => {
|
|
12
|
+
assert(DisplayDataOutputModel);
|
|
13
|
+
assert(ErrorOutputModel);
|
|
14
|
+
assert(StreamOutputModel);
|
|
15
|
+
});
|
|
16
|
+
});
|