@difizen/libro-core 0.1.14 → 0.1.16
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/components/dnd-cell-item-render.js +25 -22
- package/es/libro-context-key.d.ts +1 -1
- package/es/libro-context-key.d.ts.map +1 -1
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +9 -7
- package/package.json +5 -5
- package/src/components/dnd-cell-item-render.tsx +23 -23
- package/src/libro-context-key.ts +1 -1
- package/src/libro-view.tsx +9 -5
|
@@ -135,28 +135,31 @@ var CellOutput = /*#__PURE__*/forwardRef(function CellOutput(props, ref) {
|
|
|
135
135
|
useLayoutEffect(function () {
|
|
136
136
|
isExecutingRef.current = !!executing;
|
|
137
137
|
}, [executing]);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
138
|
+
|
|
139
|
+
// useLayoutEffect(() => {
|
|
140
|
+
// if (!outputRef || !isExecutingRef || !outputRef?.current) {
|
|
141
|
+
// return () => {
|
|
142
|
+
// //
|
|
143
|
+
// };
|
|
144
|
+
// }
|
|
145
|
+
// const el = outputRef?.current;
|
|
146
|
+
|
|
147
|
+
// const resizeObserver = new ResizeObserver((entries) => {
|
|
148
|
+
// entries.forEach(() => {
|
|
149
|
+
// const outputAreaHeight = outputRef?.current?.clientHeight || 0;
|
|
150
|
+
// if (isExecutingRef.current && outputAreaHeight > 495) {
|
|
151
|
+
// command.executeCommand(NotebookCommands['EnableOutputScrolling'].id);
|
|
152
|
+
// }
|
|
153
|
+
// });
|
|
154
|
+
// });
|
|
155
|
+
|
|
156
|
+
// resizeObserver.observe(el as HTMLElement);
|
|
157
|
+
// return () => {
|
|
158
|
+
// resizeObserver.unobserve(el as HTMLElement);
|
|
159
|
+
// resizeObserver.disconnect();
|
|
160
|
+
// };
|
|
161
|
+
// }, [outputRef.current, cell, isExecutingRef]);
|
|
162
|
+
|
|
160
163
|
if (!ExecutableCellView.is(cell)) {
|
|
161
164
|
return null;
|
|
162
165
|
}
|
|
@@ -6,7 +6,7 @@ export declare class LirboContextKey {
|
|
|
6
6
|
protected readonly contextKeyService: ContextKeyService;
|
|
7
7
|
protected readonly libroService: LibroService;
|
|
8
8
|
protected toDisposeOnActiveChanged?: Disposable;
|
|
9
|
-
|
|
9
|
+
commandModeEnabled: boolean;
|
|
10
10
|
protected isCommandMode: boolean;
|
|
11
11
|
active: IContextKey<boolean>;
|
|
12
12
|
focus: IContextKey<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-context-key.d.ts","sourceRoot":"","sources":["../src/libro-context-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,qBACa,eAAe;IAC1B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACxD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAC9C,SAAS,CAAC,wBAAwB,CAAC,EAAE,UAAU,CAAC;IAChD,
|
|
1
|
+
{"version":3,"file":"libro-context-key.d.ts","sourceRoot":"","sources":["../src/libro-context-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CA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AAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAChC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,IAAI,CAAA;KAAE;IAsBhC,qBAAqB,SAAU,QAAQ,UAYrC;IAEF,sBAAsB,SAAU,QAAQ,UAatC;IAEF,yBAAyB,aAOvB;IAEF,wBAAwB,aAOtB;IAEF,QAAQ,UAAS;IAER,OAAO;IAQhB,gBAAgB,cAAe,OAAO,UAUpC;IAEF,aAAa,aAIX;IAEF,cAAc,SAAU,QAAQ,UAW9B;IAEF,YAAY,SAAU,QAAQ,UAW5B;IAEF,cAAc,SAAgB,QAAQ,mBA+BpC;IAEF,cAAc,SAAgB,QAAQ,mBA8BpC;IAEF,UAAU,SAAgB,QAAQ,mBAgChC;IACF,aAAa,aAEX;IAEF,SAAS,SAAgB,QAAQ,mBA0C/B;IACF,kBAAkB,aAKhB;IAEF,gBAAgB,aAId;IAEF;;OAEG;IACH,iBAAiB,SAAgB,QAAQ,SAAS,MAAM,mBAqEtD;IAEF,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO;IAI9C,IAAI;CAYL"}
|
package/es/libro-view.js
CHANGED
|
@@ -165,6 +165,11 @@ export var LibroRender = /*#__PURE__*/forwardRef(function LibroRender(props, ref
|
|
|
165
165
|
if (typeof ref === 'function') {
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
|
+
// focus编辑器host
|
|
169
|
+
if (!e.relatedTarget) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
// focus编辑器外部区域
|
|
168
173
|
if (ref !== null && ref !== void 0 && (_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains(e.relatedTarget)) {
|
|
169
174
|
var _ref$current2;
|
|
170
175
|
var dndDom = ref === null || ref === void 0 || (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.getElementsByClassName('libro-dnd-cells-container')[0];
|
|
@@ -566,13 +571,10 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
566
571
|
_this.runCells([cell]);
|
|
567
572
|
}
|
|
568
573
|
if (_this.virtualizedManager.isVirtualized) {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
});
|
|
574
|
+
// 通过用户反馈,这里跳动会严重影响体验
|
|
575
|
+
// setTimeout(() => {
|
|
576
|
+
// if (this.activeCell) this.model.scrollToCellView({ cellIndex: this.activeCellIndex });
|
|
577
|
+
// });
|
|
576
578
|
} else {
|
|
577
579
|
setTimeout(function () {
|
|
578
580
|
if (_this.activeCell) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
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.1.
|
|
38
|
-
"@difizen/libro-common": "^0.1.
|
|
39
|
-
"@difizen/libro-shared-model": "^0.1.
|
|
40
|
-
"@difizen/libro-virtualized": "^0.1.
|
|
37
|
+
"@difizen/libro-code-editor": "^0.1.16",
|
|
38
|
+
"@difizen/libro-common": "^0.1.16",
|
|
39
|
+
"@difizen/libro-shared-model": "^0.1.16",
|
|
40
|
+
"@difizen/libro-virtualized": "^0.1.16",
|
|
41
41
|
"@difizen/mana-app": "latest",
|
|
42
42
|
"@difizen/mana-l10n": "latest",
|
|
43
43
|
"@difizen/mana-react": "latest",
|
|
@@ -201,29 +201,29 @@ const CellOutput: React.FC<{ cell: CellView }> = forwardRef(function CellOutput(
|
|
|
201
201
|
isExecutingRef.current = !!executing;
|
|
202
202
|
}, [executing]);
|
|
203
203
|
|
|
204
|
-
useLayoutEffect(() => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}, [outputRef.current, cell, isExecutingRef]);
|
|
204
|
+
// useLayoutEffect(() => {
|
|
205
|
+
// if (!outputRef || !isExecutingRef || !outputRef?.current) {
|
|
206
|
+
// return () => {
|
|
207
|
+
// //
|
|
208
|
+
// };
|
|
209
|
+
// }
|
|
210
|
+
// const el = outputRef?.current;
|
|
211
|
+
|
|
212
|
+
// const resizeObserver = new ResizeObserver((entries) => {
|
|
213
|
+
// entries.forEach(() => {
|
|
214
|
+
// const outputAreaHeight = outputRef?.current?.clientHeight || 0;
|
|
215
|
+
// if (isExecutingRef.current && outputAreaHeight > 495) {
|
|
216
|
+
// command.executeCommand(NotebookCommands['EnableOutputScrolling'].id);
|
|
217
|
+
// }
|
|
218
|
+
// });
|
|
219
|
+
// });
|
|
220
|
+
|
|
221
|
+
// resizeObserver.observe(el as HTMLElement);
|
|
222
|
+
// return () => {
|
|
223
|
+
// resizeObserver.unobserve(el as HTMLElement);
|
|
224
|
+
// resizeObserver.disconnect();
|
|
225
|
+
// };
|
|
226
|
+
// }, [outputRef.current, cell, isExecutingRef]);
|
|
227
227
|
|
|
228
228
|
if (!ExecutableCellView.is(cell)) {
|
|
229
229
|
return null;
|
package/src/libro-context-key.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class LirboContextKey {
|
|
|
11
11
|
protected readonly contextKeyService: ContextKeyService;
|
|
12
12
|
protected readonly libroService: LibroService;
|
|
13
13
|
protected toDisposeOnActiveChanged?: Disposable;
|
|
14
|
-
|
|
14
|
+
commandModeEnabled = true;
|
|
15
15
|
protected isCommandMode = false;
|
|
16
16
|
active: IContextKey<boolean>;
|
|
17
17
|
focus: IContextKey<boolean>;
|
package/src/libro-view.tsx
CHANGED
|
@@ -224,6 +224,11 @@ export const LibroRender = forwardRef<HTMLDivElement>(function LibroRender(props
|
|
|
224
224
|
if (typeof ref === 'function') {
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
+
// focus编辑器host
|
|
228
|
+
if (!e.relatedTarget) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
// focus编辑器外部区域
|
|
227
232
|
if (ref?.current?.contains(e.relatedTarget)) {
|
|
228
233
|
const dndDom = ref?.current?.getElementsByClassName(
|
|
229
234
|
'libro-dnd-cells-container',
|
|
@@ -653,11 +658,10 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
653
658
|
this.runCells([cell]);
|
|
654
659
|
}
|
|
655
660
|
if (this.virtualizedManager.isVirtualized) {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
});
|
|
661
|
+
// 通过用户反馈,这里跳动会严重影响体验
|
|
662
|
+
// setTimeout(() => {
|
|
663
|
+
// if (this.activeCell) this.model.scrollToCellView({ cellIndex: this.activeCellIndex });
|
|
664
|
+
// });
|
|
661
665
|
} else {
|
|
662
666
|
setTimeout(() => {
|
|
663
667
|
if (this.activeCell) {
|