@difizen/libro-core 0.2.35-next.0 → 0.2.35
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/es/add-cell/libro-add-cell-view.d.ts.map +1 -1
- package/es/add-cell/libro-add-cell-view.js +1 -7
- package/es/cell/libro-cell-service.d.ts.map +1 -1
- package/es/cell/libro-cell-service.js +3 -0
- package/es/components/cell-protocol.d.ts +4 -0
- package/es/components/cell-protocol.d.ts.map +1 -1
- package/es/components/cell-protocol.js +1 -0
- package/es/components/dnd-cell-item-render.d.ts +2 -0
- package/es/components/dnd-cell-item-render.d.ts.map +1 -1
- package/es/components/dnd-cell-item-render.js +15 -12
- package/es/components/dnd-component/index.less +4 -0
- package/es/index.less +9 -1
- package/es/module.d.ts.map +1 -1
- package/es/module.js +4 -1
- package/es/toolbar/hide-all-selector.js +4 -4
- package/es/toolbar/libro-toolbar.d.ts.map +1 -1
- package/es/toolbar/libro-toolbar.js +3 -2
- package/es/toolbar/side-toolar-more-select.d.ts.map +1 -1
- package/es/toolbar/side-toolar-more-select.js +8 -7
- package/package.json +5 -5
- package/src/add-cell/libro-add-cell-view.tsx +14 -23
- package/src/cell/libro-cell-service.ts +1 -0
- package/src/components/cell-protocol.ts +4 -0
- package/src/components/dnd-cell-item-render.tsx +18 -15
- package/src/components/dnd-component/index.less +4 -0
- package/src/index.less +9 -1
- package/src/module.ts +6 -0
- package/src/toolbar/hide-all-selector.tsx +4 -4
- package/src/toolbar/libro-toolbar.tsx +3 -2
- package/src/toolbar/side-toolar-more-select.tsx +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-add-cell-view.d.ts","sourceRoot":"","sources":["../../src/add-cell/libro-add-cell-view.tsx"],"names":[],"mappings":";AACA,OAAO,EAKL,QAAQ,EAIT,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,cAAc,CAAC;AAOtB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"libro-add-cell-view.d.ts","sourceRoot":"","sources":["../../src/add-cell/libro-add-cell-view.tsx"],"names":[],"mappings":";AACA,OAAO,EAKL,QAAQ,EAIT,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,cAAc,CAAC;AAOtB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EA4BhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,mFAO9B,CAAC;AAEH,qBAEa,gBAAiB,SAAQ,QAAQ;IAC5C,MAAM,EAAE,SAAS,GAAG,SAAS,CAAa;IACjC,IAAI,oFAAuB;IAGpC,OAAO,EAAE,QAAQ,EAAE,CAAM;IAEzB,WAAW,EAAE,WAAW,CAAC;gBAEQ,WAAW,EAAE,WAAW;IAKhD,WAAW;IAIX,aAAa;IAIb,YAAY;IAIrB,aAAa,aAAc,QAAQ,aAA6B;IAEhE,WAAW,CAAC,MAAM,kCAAqB;CAGxC"}
|
|
@@ -48,13 +48,7 @@ export var LibroAddCell = function LibroAddCell() {
|
|
|
48
48
|
}();
|
|
49
49
|
return /*#__PURE__*/_jsx("div", {
|
|
50
50
|
className: "libro-add-cell-container default-add-cell-container",
|
|
51
|
-
children: instance.getCellList().
|
|
52
|
-
if (a.order < b.order) {
|
|
53
|
-
return -1;
|
|
54
|
-
} else {
|
|
55
|
-
return 1;
|
|
56
|
-
}
|
|
57
|
-
}).map(function (item) {
|
|
51
|
+
children: instance.getCellList().map(function (item) {
|
|
58
52
|
return /*#__PURE__*/_jsx(Button, {
|
|
59
53
|
className: "libro-add-cell-container-item ",
|
|
60
54
|
onClick: function onClick() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-cell-service.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,WAAW,EAEX,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAElC,qBACa,gBAAiB,YAAW,WAAW,EAAE,uBAAuB;IAE3E,SAAS,EAAE,QAAQ,EAAE,CAAM;IAE3B,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC/E,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAC7E,SAAS,CAAC,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAa;IACtF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAC5C,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAa;IAEtE,YAAY,EAAE,YAAY,CAAC;gBAGzB,WAAW,EAAE,WAAW,EACF,YAAY,EAAE,YAAY,EAEhD,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAE3D,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAQ3D,SAAS,CAAC,gCAAgC,CAAC,GAAG,EAAE,qBAAqB,GAAG,WAAW;IAOnF,UAAU;
|
|
1
|
+
{"version":3,"file":"libro-cell-service.d.ts","sourceRoot":"","sources":["../../src/cell/libro-cell-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,WAAW,EAEX,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAElC,qBACa,gBAAiB,YAAW,WAAW,EAAE,uBAAuB;IAE3E,SAAS,EAAE,QAAQ,EAAE,CAAM;IAE3B,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IAC/E,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAC7E,SAAS,CAAC,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAa;IACtF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAC5C,SAAS,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAa;IAEtE,YAAY,EAAE,YAAY,CAAC;gBAGzB,WAAW,EAAE,WAAW,EACF,YAAY,EAAE,YAAY,EAEhD,aAAa,EAAE,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAE3D,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAQ3D,SAAS,CAAC,gCAAgC,CAAC,GAAG,EAAE,qBAAqB,GAAG,WAAW;IAOnF,UAAU;IAaV,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IAQrC,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAIzD,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAK5C,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,SAAK,GAAG,OAAO,CAAC,SAAS,CAAC;IAqB7E,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAqBhF,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,oBAAoB,GAAG,SAAS;IASxE,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,qBAAqB,GAAG,SAAS;IAS1E,SAAS,CAAC,4CAA4C,IAAI,qBAAqB,EAAE;IAWjF,SAAS,CAAC,eAAe,CACvB,GAAG,EAAE,qBAAqB,GAAG,oBAAoB,EACjD,OAAO,EAAE,WAAW;CAIvB"}
|
|
@@ -8,6 +8,10 @@ export type CellInputBottonBlankProvider = FC<{
|
|
|
8
8
|
cell: CellView;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const CellInputBottonBlankProvider: unique symbol;
|
|
11
|
+
export type CellOutputBottomBlankProvider = FC<{
|
|
12
|
+
cell: CellView;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const CellOutputBottomBlankProvider: unique symbol;
|
|
11
15
|
export type CellOutputVisulizationProvider = FC<{
|
|
12
16
|
cell: CellView;
|
|
13
17
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell-protocol.d.ts","sourceRoot":"","sources":["../../src/components/cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,yBAAyB,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAE/D,eAAO,MAAM,yBAAyB,eAAsC,CAAC;AAE7E,MAAM,MAAM,4BAA4B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAElE,eAAO,MAAM,4BAA4B,eAAyC,CAAC;AAEnF,MAAM,MAAM,8BAA8B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEpE,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AAEvF,MAAM,MAAM,mBAAmB,GAAG,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF,CAAC,CAAC;AAEH,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"cell-protocol.d.ts","sourceRoot":"","sources":["../../src/components/cell-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,yBAAyB,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAE/D,eAAO,MAAM,yBAAyB,eAAsC,CAAC;AAE7E,MAAM,MAAM,4BAA4B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAElE,eAAO,MAAM,4BAA4B,eAAyC,CAAC;AAEnF,MAAM,MAAM,6BAA6B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEnE,eAAO,MAAM,6BAA6B,eAA0C,CAAC;AAErF,MAAM,MAAM,8BAA8B,GAAG,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEpE,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AAEvF,MAAM,MAAM,mBAAmB,GAAG,EAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF,CAAC,CAAC;AAEH,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export var CellExecutionTimeProvider = Symbol('CellExecutionTimeProvider');
|
|
2
2
|
export var CellInputBottonBlankProvider = Symbol('CellInputBottonBlankProvider');
|
|
3
|
+
export var CellOutputBottomBlankProvider = Symbol('CellOutputBottomBlankProvider');
|
|
3
4
|
export var CellOutputVisulizationProvider = Symbol('CellOutputVisulizationProvider');
|
|
4
5
|
export var BetweenCellProvider = Symbol('BetweenCellProvider');
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import '../index.less';
|
|
3
3
|
import type { CellView, DndItemProps } from '../libro-protocol.js';
|
|
4
|
+
import { CellOutputBottomBlankProvider } from './cell-protocol.js';
|
|
4
5
|
import { CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider } from './cell-protocol.js';
|
|
5
6
|
export declare const CellOutputContent: React.FC<{
|
|
6
7
|
cell: CellView;
|
|
7
8
|
}>;
|
|
8
9
|
export declare const LibroCellExecutionTime: CellExecutionTimeProvider;
|
|
9
10
|
export declare const LibroCellInputBottonBlank: CellInputBottonBlankProvider;
|
|
11
|
+
export declare const LibroCellOutputBottomBlank: CellOutputBottomBlankProvider;
|
|
10
12
|
export declare const LibroCellVisualization: CellOutputVisulizationProvider;
|
|
11
13
|
export declare const DndCellItemContent: React.NamedExoticComponent<{
|
|
12
14
|
cell: CellView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dnd-cell-item-render.d.ts","sourceRoot":"","sources":["../../src/components/dnd-cell-item-render.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAUlF,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAkBnE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"dnd-cell-item-render.d.ts","sourceRoot":"","sources":["../../src/components/dnd-cell-item-render.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAUlF,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAkBnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AAuE5B,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CA4C1D,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,yBAIpC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,4BAIvC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,6BAIxC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,8BAIpC,CAAC;AAyJF,eAAO,MAAM,kBAAkB;UACvB,QAAQ;EA+Bd,CAAC;AAEH,eAAO,MAAM,oBAAoB,0CAgD/B,CAAC;AAyCH,eAAO,MAAM,iBAAiB,gHAA+B,CAAC"}
|
|
@@ -17,6 +17,7 @@ import { isCellView, LibroToolbarArea } from "../libro-protocol.js";
|
|
|
17
17
|
import { CellSideToolbarVisible, CellTopToolbarSetting, CollapserClickActive, OutputScrollBtnVisiable } from "../libro-setting.js";
|
|
18
18
|
import { ArrowDown, ArrowRight, ContentMore, DisableOutputScroll, EnableOutputScroll } from "../material-from-designer.js";
|
|
19
19
|
import { hasErrorOutput } from "../output/index.js";
|
|
20
|
+
import { CellOutputBottomBlankProvider } from "./cell-protocol.js";
|
|
20
21
|
import { CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider } from "./cell-protocol.js";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -24,7 +25,6 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
24
25
|
var CellInputContent = /*#__PURE__*/memo(function CellInputContent(props) {
|
|
25
26
|
var cell = props.cell;
|
|
26
27
|
var observableCell = useObserve(cell);
|
|
27
|
-
var CellExecutionTime = useInject(CellExecutionTimeProvider);
|
|
28
28
|
var CellInputBottonBlank = useInject(CellInputBottonBlankProvider);
|
|
29
29
|
if (!(observableCell !== null && observableCell !== void 0 && observableCell.view) || !isCellView(observableCell)) {
|
|
30
30
|
return null;
|
|
@@ -38,9 +38,7 @@ var CellInputContent = /*#__PURE__*/memo(function CellInputContent(props) {
|
|
|
38
38
|
}
|
|
39
39
|
return /*#__PURE__*/_jsxs("div", {
|
|
40
40
|
className: "libro-cell-input-content",
|
|
41
|
-
children: [/*#__PURE__*/_jsx(
|
|
42
|
-
cell: cell
|
|
43
|
-
}), /*#__PURE__*/_jsx(ViewRender, {
|
|
41
|
+
children: [/*#__PURE__*/_jsx(ViewRender, {
|
|
44
42
|
view: observableCell
|
|
45
43
|
}), /*#__PURE__*/_jsx(CellInputBottonBlank, {
|
|
46
44
|
cell: cell
|
|
@@ -83,6 +81,8 @@ export var CellOutputContent = /*#__PURE__*/memo(function CellOutputContent(prop
|
|
|
83
81
|
var cell = props.cell;
|
|
84
82
|
var observableCell = useObserve(cell);
|
|
85
83
|
var CellOutputVisulization = useInject(CellOutputVisulizationProvider);
|
|
84
|
+
var CellOutputBottomBlank = useInject(CellOutputBottomBlankProvider);
|
|
85
|
+
var CellExecutionTime = useInject(CellExecutionTimeProvider);
|
|
86
86
|
if (!ExecutableCellView.is(cell) || !ExecutableCellView.is(observableCell)) {
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
@@ -99,10 +99,14 @@ export var CellOutputContent = /*#__PURE__*/memo(function CellOutputContent(prop
|
|
|
99
99
|
}
|
|
100
100
|
return /*#__PURE__*/_jsxs("div", {
|
|
101
101
|
className: "libro-cell-output-content ".concat(hasOutputsScrolled ? 'scrolled' : '', " "),
|
|
102
|
-
children: [/*#__PURE__*/_jsx(
|
|
102
|
+
children: [/*#__PURE__*/_jsx(CellExecutionTime, {
|
|
103
|
+
cell: cell
|
|
104
|
+
}), /*#__PURE__*/_jsx(CellOutputVisulization, {
|
|
103
105
|
cell: cell
|
|
104
|
-
}), /*#__PURE__*/_jsx(ViewRender, {
|
|
106
|
+
}), observableCell.outputArea.length > 0 && /*#__PURE__*/_jsx(ViewRender, {
|
|
105
107
|
view: cell.outputArea
|
|
108
|
+
}), /*#__PURE__*/_jsx(CellOutputBottomBlank, {
|
|
109
|
+
cell: cell
|
|
106
110
|
})]
|
|
107
111
|
});
|
|
108
112
|
});
|
|
@@ -112,11 +116,13 @@ export var LibroCellExecutionTime = /*#__PURE__*/forwardRef(function LibroCellEx
|
|
|
112
116
|
export var LibroCellInputBottonBlank = /*#__PURE__*/forwardRef(function LibroCellInputBottonBlank() {
|
|
113
117
|
return null;
|
|
114
118
|
});
|
|
119
|
+
export var LibroCellOutputBottomBlank = /*#__PURE__*/forwardRef(function LibroCellOutputBottomBlank() {
|
|
120
|
+
return null;
|
|
121
|
+
});
|
|
115
122
|
export var LibroCellVisualization = /*#__PURE__*/forwardRef(function LibroCellVisualization() {
|
|
116
123
|
return null;
|
|
117
124
|
});
|
|
118
125
|
var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
119
|
-
var _cell$outputArea;
|
|
120
126
|
var cell = props.cell;
|
|
121
127
|
var outputRef = useRef(null);
|
|
122
128
|
var outputCollapserRef = useRef(null);
|
|
@@ -160,10 +166,7 @@ var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
|
160
166
|
// };
|
|
161
167
|
// }, [outputRef.current, cell, isExecutingRef]);
|
|
162
168
|
|
|
163
|
-
if (!ExecutableCellView.is(cell)) {
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
if (!isCellView(cell) || !ExecutableCellModel.is(cell.model) || !((_cell$outputArea = cell.outputArea) !== null && _cell$outputArea !== void 0 && _cell$outputArea.length)) {
|
|
169
|
+
if (!ExecutableCellView.is(cell) || !ExecutableCellModel.is(cell.model)) {
|
|
167
170
|
return null;
|
|
168
171
|
}
|
|
169
172
|
var handleCellOutputCollapser = function handleCellOutputCollapser() {
|
|
@@ -190,7 +193,7 @@ var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
|
190
193
|
className: 'libro-cell-output-collapser',
|
|
191
194
|
ref: outputCollapserRef,
|
|
192
195
|
onClick: handleCellOutputCollapser
|
|
193
|
-
}), outputScrollBtnVisiable && /*#__PURE__*/_jsx("div", {
|
|
196
|
+
}), outputScrollBtnVisiable && cell.outputArea.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
194
197
|
className: "libro-cell-output-scroll",
|
|
195
198
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
196
199
|
title: "".concat(cell.model.hasOutputsScrolled ? '取消固定 Output 高度' : '固定 Output 高度'),
|
package/es/index.less
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
height: 100%;
|
|
41
41
|
padding: 0;
|
|
42
42
|
overflow-y: auto;
|
|
43
|
+
scrollbar-gutter: stable;
|
|
43
44
|
|
|
44
45
|
.libro-dnd-list-container {
|
|
45
46
|
height: 100%;
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
|
|
84
85
|
.mana-toolbar {
|
|
85
86
|
.mana-toolbar-item {
|
|
87
|
+
height: 24px;
|
|
86
88
|
display: flex;
|
|
87
89
|
align-items: center;
|
|
88
90
|
justify-content: center;
|
|
@@ -408,6 +410,7 @@
|
|
|
408
410
|
height: 41px;
|
|
409
411
|
border-bottom-right-radius: 4px;
|
|
410
412
|
border-bottom-left-radius: 4px;
|
|
413
|
+
border-top: 1px solid var(--mana-libro-code-border-color);
|
|
411
414
|
|
|
412
415
|
svg {
|
|
413
416
|
position: absolute;
|
|
@@ -667,6 +670,11 @@
|
|
|
667
670
|
.mana-menu-item {
|
|
668
671
|
button {
|
|
669
672
|
display: block;
|
|
673
|
+
padding: 0 12px;
|
|
674
|
+
|
|
675
|
+
.mana-menu-item-icon {
|
|
676
|
+
display: none;
|
|
677
|
+
}
|
|
670
678
|
}
|
|
671
679
|
}
|
|
672
680
|
|
|
@@ -758,7 +766,7 @@
|
|
|
758
766
|
}
|
|
759
767
|
|
|
760
768
|
.libro-side-tooltip {
|
|
761
|
-
text-align:
|
|
769
|
+
text-align: center;
|
|
762
770
|
}
|
|
763
771
|
|
|
764
772
|
.libro-tooltip-text {
|
package/es/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA2C/C,eAAO,MAAM,WAAW,YA2ErB,CAAC"}
|
package/es/module.js
CHANGED
|
@@ -4,7 +4,7 @@ import { ManaModule } from '@difizen/mana-app';
|
|
|
4
4
|
import { LibroCellModule } from "./cell/libro-cell-module.js";
|
|
5
5
|
import { CollapseService, CollapseServiceFactory, CollapseServiceOption, DefaultCollapseService } from "./collapse-service.js";
|
|
6
6
|
import { LibroCommandModule } from "./command/index.js";
|
|
7
|
-
import { BetweenCellProvider, CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputVisulizationProvider, LibroBetweenCellContent, LibroCellExecutionTime, LibroCellInputBottonBlank, LibroCellVisualization } from "./components/index.js";
|
|
7
|
+
import { BetweenCellProvider, CellExecutionTimeProvider, CellInputBottonBlankProvider, CellOutputBottomBlankProvider, CellOutputVisulizationProvider, LibroBetweenCellContent, LibroCellExecutionTime, LibroCellInputBottonBlank, LibroCellOutputBottomBlank, LibroCellVisualization } from "./components/index.js";
|
|
8
8
|
import { LibroContentModule } from "./content/index.js";
|
|
9
9
|
import { LibroFormatterModule } from "./formatter/index.js";
|
|
10
10
|
import { LibroContextKey } from "./libro-context-key.js";
|
|
@@ -62,6 +62,9 @@ export var LibroModule = ManaModule.create().register(BaseWorkspaceService, Virt
|
|
|
62
62
|
}, {
|
|
63
63
|
token: CellInputBottonBlankProvider,
|
|
64
64
|
useValue: LibroCellInputBottonBlank
|
|
65
|
+
}, {
|
|
66
|
+
token: CellOutputBottomBlankProvider,
|
|
67
|
+
useValue: LibroCellOutputBottomBlank
|
|
65
68
|
}, {
|
|
66
69
|
token: CellOutputVisulizationProvider,
|
|
67
70
|
useValue: LibroCellVisualization
|
|
@@ -59,11 +59,11 @@ export var HideAllSelectInner = function HideAllSelectInner() {
|
|
|
59
59
|
onClick: handleChange,
|
|
60
60
|
items: [{
|
|
61
61
|
key: 'hideAllInputs',
|
|
62
|
-
label: l10n.t('隐藏全部Code'),
|
|
62
|
+
label: l10n.t('隐藏全部 Code'),
|
|
63
63
|
disabled: !isCodeVisiable
|
|
64
64
|
}, {
|
|
65
65
|
key: 'hideAllOutputs',
|
|
66
|
-
label: l10n.t('隐藏全部Output'),
|
|
66
|
+
label: l10n.t('隐藏全部 Output'),
|
|
67
67
|
disabled: !isOutputVisible
|
|
68
68
|
}, {
|
|
69
69
|
key: 'hideAll',
|
|
@@ -71,11 +71,11 @@ export var HideAllSelectInner = function HideAllSelectInner() {
|
|
|
71
71
|
disabled: !isCodeVisiable || !isOutputVisible
|
|
72
72
|
}, {
|
|
73
73
|
key: 'showAllInputs',
|
|
74
|
-
label: l10n.t('显示全部Code'),
|
|
74
|
+
label: l10n.t('显示全部 Code'),
|
|
75
75
|
disabled: !isCodeHidden
|
|
76
76
|
}, {
|
|
77
77
|
key: 'showAllOutputs',
|
|
78
|
-
label: l10n.t('显示全部Output'),
|
|
78
|
+
label: l10n.t('显示全部 Output'),
|
|
79
79
|
disabled: !isOutputHidden
|
|
80
80
|
}, {
|
|
81
81
|
key: 'showAll',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/libro-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/libro-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAEL,YAAY,EAEZ,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA0BnD,qBACa,wBAAyB,YAAW,mBAAmB;IAC5C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC9C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;CA2LtD"}
|
|
@@ -8,6 +8,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
8
8
|
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); }
|
|
9
9
|
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; }
|
|
10
10
|
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.'); }
|
|
11
|
+
import { isMacintosh } from '@difizen/mana-app';
|
|
11
12
|
import { inject, ModalService, singleton, ToolbarContribution, useObserve } from '@difizen/mana-app';
|
|
12
13
|
import { l10n } from '@difizen/mana-l10n';
|
|
13
14
|
import { DocumentCommands, NotebookCommands } from "../command/index.js";
|
|
@@ -55,7 +56,7 @@ export var LibroToolbarContribution = (_dec = singleton({
|
|
|
55
56
|
children: l10n.t('保存')
|
|
56
57
|
}), /*#__PURE__*/_jsx("span", {
|
|
57
58
|
className: "libro-tooltip-keybind",
|
|
58
|
-
children: "Cmd + S"
|
|
59
|
+
children: "".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + S")
|
|
59
60
|
})]
|
|
60
61
|
}),
|
|
61
62
|
group: ['group1'],
|
|
@@ -113,7 +114,7 @@ export var LibroToolbarContribution = (_dec = singleton({
|
|
|
113
114
|
children: l10n.t('格式化代码')
|
|
114
115
|
}), /*#__PURE__*/_jsx("span", {
|
|
115
116
|
className: "libro-tooltip-keybind",
|
|
116
|
-
children: "Shift+Option+F"
|
|
117
|
+
children: "Shift+".concat(isMacintosh ? 'Option' : 'Alt', "+F")
|
|
117
118
|
})]
|
|
118
119
|
}),
|
|
119
120
|
group: ['sidetoolbar1'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-toolar-more-select.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolar-more-select.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"side-toolar-more-select.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolar-more-select.tsx"],"names":[],"mappings":";AAgGA,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAkE5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAazC,CAAC"}
|
|
@@ -4,6 +4,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
6
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
import { isMacintosh } from '@difizen/mana-app';
|
|
7
8
|
import { CommandRegistry, getOrigin, ToolbarInstance, useInject, useObserve } from '@difizen/mana-app';
|
|
8
9
|
import { l10n } from '@difizen/mana-l10n';
|
|
9
10
|
import { Menu, MenuContext } from '@difizen/mana-react';
|
|
@@ -12,17 +13,17 @@ import { ExecutableCellModel, ExecutableCellView } from "../cell/index.js";
|
|
|
12
13
|
import { NotebookCommands } from "../command/index.js";
|
|
13
14
|
import { MoreOutlined } from "../material-from-designer.js";
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
18
|
var codeItems = [{
|
|
18
19
|
id: NotebookCommands['HideCellCode'].id,
|
|
19
20
|
label: /*#__PURE__*/_jsxs(_Fragment, {
|
|
20
21
|
children: [/*#__PURE__*/_jsx("span", {
|
|
21
22
|
className: "libro-menu-item-label",
|
|
22
23
|
children: l10n.t('隐藏 Code')
|
|
23
|
-
}), /*#__PURE__*/
|
|
24
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
24
25
|
className: "libro-menu-item-keybind",
|
|
25
|
-
children: "Cmd + '"
|
|
26
|
+
children: ["".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + "), "'"]
|
|
26
27
|
})]
|
|
27
28
|
})
|
|
28
29
|
}, {
|
|
@@ -31,9 +32,9 @@ var codeItems = [{
|
|
|
31
32
|
children: [/*#__PURE__*/_jsx("span", {
|
|
32
33
|
className: "libro-menu-item-label",
|
|
33
34
|
children: l10n.t('显示 Code')
|
|
34
|
-
}), /*#__PURE__*/
|
|
35
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
35
36
|
className: "libro-menu-item-keybind",
|
|
36
|
-
children: "Cmd + '"
|
|
37
|
+
children: ["".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + "), "'"]
|
|
37
38
|
})]
|
|
38
39
|
})
|
|
39
40
|
}];
|
|
@@ -45,7 +46,7 @@ var outputItems = [{
|
|
|
45
46
|
children: l10n.t('隐藏 Output')
|
|
46
47
|
}), /*#__PURE__*/_jsx("span", {
|
|
47
48
|
className: "libro-menu-item-keybind",
|
|
48
|
-
children: "Cmd + O"
|
|
49
|
+
children: "".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + O")
|
|
49
50
|
})]
|
|
50
51
|
})
|
|
51
52
|
}, {
|
|
@@ -56,7 +57,7 @@ var outputItems = [{
|
|
|
56
57
|
children: l10n.t('显示 Output')
|
|
57
58
|
}), /*#__PURE__*/_jsx("span", {
|
|
58
59
|
className: "libro-menu-item-keybind",
|
|
59
|
-
children: "Cmd + O"
|
|
60
|
+
children: "".concat(isMacintosh ? 'Cmd' : 'Ctrl', " + O")
|
|
60
61
|
})]
|
|
61
62
|
})
|
|
62
63
|
}];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-core",
|
|
3
|
-
"version": "0.2.35
|
|
3
|
+
"version": "0.2.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"libro",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ant-design/icons": "^5.1.0",
|
|
37
|
-
"@difizen/libro-code-editor": "^0.2.35
|
|
38
|
-
"@difizen/libro-common": "^0.2.35
|
|
39
|
-
"@difizen/libro-shared-model": "^0.2.35
|
|
40
|
-
"@difizen/libro-virtualized": "^0.2.35
|
|
37
|
+
"@difizen/libro-code-editor": "^0.2.35",
|
|
38
|
+
"@difizen/libro-common": "^0.2.35",
|
|
39
|
+
"@difizen/libro-shared-model": "^0.2.35",
|
|
40
|
+
"@difizen/libro-virtualized": "^0.2.35",
|
|
41
41
|
"@difizen/mana-app": "latest",
|
|
42
42
|
"@difizen/mana-l10n": "latest",
|
|
43
43
|
"@difizen/mana-react": "latest",
|
|
@@ -36,29 +36,20 @@ export const LibroAddCell: React.FC = () => {
|
|
|
36
36
|
};
|
|
37
37
|
return (
|
|
38
38
|
<div className="libro-add-cell-container default-add-cell-container">
|
|
39
|
-
{instance
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
onClick={() => {
|
|
54
|
-
addCell(item.type);
|
|
55
|
-
}}
|
|
56
|
-
icon={<PlusOutlined className="libro-add-cell-icon" />}
|
|
57
|
-
>
|
|
58
|
-
{item.name}
|
|
59
|
-
</Button>
|
|
60
|
-
);
|
|
61
|
-
})}
|
|
39
|
+
{instance.getCellList().map((item: AddType) => {
|
|
40
|
+
return (
|
|
41
|
+
<Button
|
|
42
|
+
className="libro-add-cell-container-item "
|
|
43
|
+
key={item.name}
|
|
44
|
+
onClick={() => {
|
|
45
|
+
addCell(item.type);
|
|
46
|
+
}}
|
|
47
|
+
icon={<PlusOutlined className="libro-add-cell-icon" />}
|
|
48
|
+
>
|
|
49
|
+
{item.name}
|
|
50
|
+
</Button>
|
|
51
|
+
);
|
|
52
|
+
})}
|
|
62
53
|
</div>
|
|
63
54
|
);
|
|
64
55
|
};
|
|
@@ -10,6 +10,10 @@ export type CellInputBottonBlankProvider = FC<{ cell: CellView }>;
|
|
|
10
10
|
|
|
11
11
|
export const CellInputBottonBlankProvider = Symbol('CellInputBottonBlankProvider');
|
|
12
12
|
|
|
13
|
+
export type CellOutputBottomBlankProvider = FC<{ cell: CellView }>;
|
|
14
|
+
|
|
15
|
+
export const CellOutputBottomBlankProvider = Symbol('CellOutputBottomBlankProvider');
|
|
16
|
+
|
|
13
17
|
export type CellOutputVisulizationProvider = FC<{ cell: CellView }>;
|
|
14
18
|
|
|
15
19
|
export const CellOutputVisulizationProvider = Symbol('CellOutputVisulizationProvider');
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
} from '../material-from-designer.js';
|
|
42
42
|
import { hasErrorOutput } from '../output/index.js';
|
|
43
43
|
|
|
44
|
+
import { CellOutputBottomBlankProvider } from './cell-protocol.js';
|
|
44
45
|
import {
|
|
45
46
|
CellExecutionTimeProvider,
|
|
46
47
|
CellInputBottonBlankProvider,
|
|
@@ -50,10 +51,6 @@ import {
|
|
|
50
51
|
const CellInputContent = memo(function CellInputContent(props: { cell: CellView }) {
|
|
51
52
|
const { cell } = props;
|
|
52
53
|
const observableCell = useObserve(cell);
|
|
53
|
-
|
|
54
|
-
const CellExecutionTime = useInject<CellExecutionTimeProvider>(
|
|
55
|
-
CellExecutionTimeProvider,
|
|
56
|
-
);
|
|
57
54
|
const CellInputBottonBlank = useInject<CellInputBottonBlankProvider>(
|
|
58
55
|
CellInputBottonBlankProvider,
|
|
59
56
|
);
|
|
@@ -71,7 +68,6 @@ const CellInputContent = memo(function CellInputContent(props: { cell: CellView
|
|
|
71
68
|
}
|
|
72
69
|
return (
|
|
73
70
|
<div className="libro-cell-input-content">
|
|
74
|
-
<CellExecutionTime cell={cell} />
|
|
75
71
|
<ViewRender view={observableCell} />
|
|
76
72
|
<CellInputBottonBlank cell={cell} />
|
|
77
73
|
</div>
|
|
@@ -129,6 +125,12 @@ export const CellOutputContent: React.FC<{ cell: CellView }> = memo(
|
|
|
129
125
|
const CellOutputVisulization = useInject<CellOutputVisulizationProvider>(
|
|
130
126
|
CellOutputVisulizationProvider,
|
|
131
127
|
);
|
|
128
|
+
const CellOutputBottomBlank = useInject<CellOutputBottomBlankProvider>(
|
|
129
|
+
CellOutputBottomBlankProvider,
|
|
130
|
+
);
|
|
131
|
+
const CellExecutionTime = useInject<CellExecutionTimeProvider>(
|
|
132
|
+
CellExecutionTimeProvider,
|
|
133
|
+
);
|
|
132
134
|
|
|
133
135
|
if (!ExecutableCellView.is(cell) || !ExecutableCellView.is(observableCell)) {
|
|
134
136
|
return null;
|
|
@@ -152,8 +154,10 @@ export const CellOutputContent: React.FC<{ cell: CellView }> = memo(
|
|
|
152
154
|
<div
|
|
153
155
|
className={`libro-cell-output-content ${hasOutputsScrolled ? 'scrolled' : ''} `}
|
|
154
156
|
>
|
|
157
|
+
<CellExecutionTime cell={cell} />
|
|
155
158
|
<CellOutputVisulization cell={cell} />
|
|
156
|
-
<ViewRender view={cell.outputArea} />
|
|
159
|
+
{observableCell.outputArea.length > 0 && <ViewRender view={cell.outputArea} />}
|
|
160
|
+
<CellOutputBottomBlank cell={cell} />
|
|
157
161
|
</div>
|
|
158
162
|
);
|
|
159
163
|
},
|
|
@@ -171,6 +175,12 @@ export const LibroCellInputBottonBlank: CellInputBottonBlankProvider = forwardRe
|
|
|
171
175
|
},
|
|
172
176
|
);
|
|
173
177
|
|
|
178
|
+
export const LibroCellOutputBottomBlank: CellOutputBottomBlankProvider = forwardRef(
|
|
179
|
+
function LibroCellOutputBottomBlank() {
|
|
180
|
+
return null;
|
|
181
|
+
},
|
|
182
|
+
);
|
|
183
|
+
|
|
174
184
|
export const LibroCellVisualization: CellOutputVisulizationProvider = forwardRef(
|
|
175
185
|
function LibroCellVisualization() {
|
|
176
186
|
return null;
|
|
@@ -225,14 +235,7 @@ const CellOutput: React.FC<{ cell: CellView }> = forwardRef(function CellOutput(
|
|
|
225
235
|
// };
|
|
226
236
|
// }, [outputRef.current, cell, isExecutingRef]);
|
|
227
237
|
|
|
228
|
-
if (!ExecutableCellView.is(cell)) {
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
if (
|
|
232
|
-
!isCellView(cell) ||
|
|
233
|
-
!ExecutableCellModel.is(cell.model) ||
|
|
234
|
-
!cell.outputArea?.length
|
|
235
|
-
) {
|
|
238
|
+
if (!ExecutableCellView.is(cell) || !ExecutableCellModel.is(cell.model)) {
|
|
236
239
|
return null;
|
|
237
240
|
}
|
|
238
241
|
const handleCellOutputCollapser = () => {
|
|
@@ -259,7 +262,7 @@ const CellOutput: React.FC<{ cell: CellView }> = forwardRef(function CellOutput(
|
|
|
259
262
|
ref={outputCollapserRef}
|
|
260
263
|
onClick={handleCellOutputCollapser}
|
|
261
264
|
/>
|
|
262
|
-
{outputScrollBtnVisiable && (
|
|
265
|
+
{outputScrollBtnVisiable && cell.outputArea.length > 0 && (
|
|
263
266
|
<div className="libro-cell-output-scroll">
|
|
264
267
|
<Tooltip
|
|
265
268
|
title={`${
|
package/src/index.less
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
height: 100%;
|
|
41
41
|
padding: 0;
|
|
42
42
|
overflow-y: auto;
|
|
43
|
+
scrollbar-gutter: stable;
|
|
43
44
|
|
|
44
45
|
.libro-dnd-list-container {
|
|
45
46
|
height: 100%;
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
|
|
84
85
|
.mana-toolbar {
|
|
85
86
|
.mana-toolbar-item {
|
|
87
|
+
height: 24px;
|
|
86
88
|
display: flex;
|
|
87
89
|
align-items: center;
|
|
88
90
|
justify-content: center;
|
|
@@ -408,6 +410,7 @@
|
|
|
408
410
|
height: 41px;
|
|
409
411
|
border-bottom-right-radius: 4px;
|
|
410
412
|
border-bottom-left-radius: 4px;
|
|
413
|
+
border-top: 1px solid var(--mana-libro-code-border-color);
|
|
411
414
|
|
|
412
415
|
svg {
|
|
413
416
|
position: absolute;
|
|
@@ -667,6 +670,11 @@
|
|
|
667
670
|
.mana-menu-item {
|
|
668
671
|
button {
|
|
669
672
|
display: block;
|
|
673
|
+
padding: 0 12px;
|
|
674
|
+
|
|
675
|
+
.mana-menu-item-icon {
|
|
676
|
+
display: none;
|
|
677
|
+
}
|
|
670
678
|
}
|
|
671
679
|
}
|
|
672
680
|
|
|
@@ -758,7 +766,7 @@
|
|
|
758
766
|
}
|
|
759
767
|
|
|
760
768
|
.libro-side-tooltip {
|
|
761
|
-
text-align:
|
|
769
|
+
text-align: center;
|
|
762
770
|
}
|
|
763
771
|
|
|
764
772
|
.libro-tooltip-text {
|
package/src/module.ts
CHANGED
|
@@ -14,10 +14,12 @@ import {
|
|
|
14
14
|
BetweenCellProvider,
|
|
15
15
|
CellExecutionTimeProvider,
|
|
16
16
|
CellInputBottonBlankProvider,
|
|
17
|
+
CellOutputBottomBlankProvider,
|
|
17
18
|
CellOutputVisulizationProvider,
|
|
18
19
|
LibroBetweenCellContent,
|
|
19
20
|
LibroCellExecutionTime,
|
|
20
21
|
LibroCellInputBottonBlank,
|
|
22
|
+
LibroCellOutputBottomBlank,
|
|
21
23
|
LibroCellVisualization,
|
|
22
24
|
} from './components/index.js';
|
|
23
25
|
import { LibroContentModule } from './content/index.js';
|
|
@@ -93,6 +95,10 @@ export const LibroModule = ManaModule.create()
|
|
|
93
95
|
token: CellInputBottonBlankProvider,
|
|
94
96
|
useValue: LibroCellInputBottonBlank,
|
|
95
97
|
},
|
|
98
|
+
{
|
|
99
|
+
token: CellOutputBottomBlankProvider,
|
|
100
|
+
useValue: LibroCellOutputBottomBlank,
|
|
101
|
+
},
|
|
96
102
|
{
|
|
97
103
|
token: CellOutputVisulizationProvider,
|
|
98
104
|
useValue: LibroCellVisualization,
|
|
@@ -78,12 +78,12 @@ export const HideAllSelectInner: React.FC = () => {
|
|
|
78
78
|
items={[
|
|
79
79
|
{
|
|
80
80
|
key: 'hideAllInputs',
|
|
81
|
-
label: l10n.t('隐藏全部Code'),
|
|
81
|
+
label: l10n.t('隐藏全部 Code'),
|
|
82
82
|
disabled: !isCodeVisiable,
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
key: 'hideAllOutputs',
|
|
86
|
-
label: l10n.t('隐藏全部Output'),
|
|
86
|
+
label: l10n.t('隐藏全部 Output'),
|
|
87
87
|
disabled: !isOutputVisible,
|
|
88
88
|
},
|
|
89
89
|
{
|
|
@@ -93,12 +93,12 @@ export const HideAllSelectInner: React.FC = () => {
|
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
key: 'showAllInputs',
|
|
96
|
-
label: l10n.t('显示全部Code'),
|
|
96
|
+
label: l10n.t('显示全部 Code'),
|
|
97
97
|
disabled: !isCodeHidden,
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
key: 'showAllOutputs',
|
|
101
|
-
label: l10n.t('显示全部Output'),
|
|
101
|
+
label: l10n.t('显示全部 Output'),
|
|
102
102
|
disabled: !isOutputHidden,
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolbarRegistry } from '@difizen/mana-app';
|
|
2
|
+
import { isMacintosh } from '@difizen/mana-app';
|
|
2
3
|
import {
|
|
3
4
|
inject,
|
|
4
5
|
ModalService,
|
|
@@ -48,7 +49,7 @@ export class LibroToolbarContribution implements ToolbarContribution {
|
|
|
48
49
|
tooltip: (
|
|
49
50
|
<div className="libro-tooltip">
|
|
50
51
|
<span className="libro-tooltip-text">{l10n.t('保存')}</span>
|
|
51
|
-
<span className="libro-tooltip-keybind">Cmd + S</span>
|
|
52
|
+
<span className="libro-tooltip-keybind">{`${isMacintosh ? 'Cmd' : 'Ctrl'} + S`}</span>
|
|
52
53
|
</div>
|
|
53
54
|
),
|
|
54
55
|
|
|
@@ -100,7 +101,7 @@ export class LibroToolbarContribution implements ToolbarContribution {
|
|
|
100
101
|
tooltip: (
|
|
101
102
|
<div className="libro-side-tooltip">
|
|
102
103
|
<span className="libro-tooltip-text">{l10n.t('格式化代码')}</span>
|
|
103
|
-
<span className="libro-tooltip-keybind">Shift
|
|
104
|
+
<span className="libro-tooltip-keybind">{`Shift+${isMacintosh ? 'Option' : 'Alt'}+F`}</span>
|
|
104
105
|
</div>
|
|
105
106
|
),
|
|
106
107
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Toolbar } from '@difizen/mana-app';
|
|
2
|
+
import { isMacintosh } from '@difizen/mana-app';
|
|
2
3
|
import {
|
|
3
4
|
CommandRegistry,
|
|
4
5
|
getOrigin,
|
|
@@ -23,7 +24,9 @@ const codeItems: LibroSideToolbarMenuItemType[] = [
|
|
|
23
24
|
label: (
|
|
24
25
|
<>
|
|
25
26
|
<span className="libro-menu-item-label">{l10n.t('隐藏 Code')}</span>
|
|
26
|
-
<span className="libro-menu-item-keybind">
|
|
27
|
+
<span className="libro-menu-item-keybind">
|
|
28
|
+
{`${isMacintosh ? 'Cmd' : 'Ctrl'} + `}'
|
|
29
|
+
</span>
|
|
27
30
|
</>
|
|
28
31
|
),
|
|
29
32
|
},
|
|
@@ -32,7 +35,9 @@ const codeItems: LibroSideToolbarMenuItemType[] = [
|
|
|
32
35
|
label: (
|
|
33
36
|
<>
|
|
34
37
|
<span className="libro-menu-item-label">{l10n.t('显示 Code')}</span>
|
|
35
|
-
<span className="libro-menu-item-keybind">
|
|
38
|
+
<span className="libro-menu-item-keybind">
|
|
39
|
+
{`${isMacintosh ? 'Cmd' : 'Ctrl'} + `}'
|
|
40
|
+
</span>
|
|
36
41
|
</>
|
|
37
42
|
),
|
|
38
43
|
},
|
|
@@ -44,7 +49,7 @@ const outputItems: LibroSideToolbarMenuItemType[] = [
|
|
|
44
49
|
label: (
|
|
45
50
|
<>
|
|
46
51
|
<span className="libro-menu-item-label">{l10n.t('隐藏 Output')}</span>
|
|
47
|
-
<span className="libro-menu-item-keybind">Cmd + O</span>
|
|
52
|
+
<span className="libro-menu-item-keybind">{`${isMacintosh ? 'Cmd' : 'Ctrl'} + O`}</span>
|
|
48
53
|
</>
|
|
49
54
|
),
|
|
50
55
|
},
|
|
@@ -53,7 +58,7 @@ const outputItems: LibroSideToolbarMenuItemType[] = [
|
|
|
53
58
|
label: (
|
|
54
59
|
<>
|
|
55
60
|
<span className="libro-menu-item-label">{l10n.t('显示 Output')}</span>
|
|
56
|
-
<span className="libro-menu-item-keybind">Cmd + O</span>
|
|
61
|
+
<span className="libro-menu-item-keybind">{`${isMacintosh ? 'Cmd' : 'Ctrl'} + O`}</span>
|
|
57
62
|
</>
|
|
58
63
|
),
|
|
59
64
|
},
|