@difizen/libro-core 0.3.42 → 0.3.43
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-virtualized-render.d.ts","sourceRoot":"","sources":["../../src/components/libro-virtualized-render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"libro-virtualized-render.d.ts","sourceRoot":"","sources":["../../src/components/libro-virtualized-render.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKlD,UAAU,wBAAwB;IAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAkBlE,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5C,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,SAAS,CAAC;CAC3B,CAoNA,CAAC"}
|
|
@@ -13,6 +13,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
13
13
|
import { AutoSizer, List } from '@difizen/libro-virtualized';
|
|
14
14
|
import { memo, useEffect, useMemo, useRef, useState } from 'react';
|
|
15
15
|
import { EditorCellView } from "../cell/index.js";
|
|
16
|
+
import { useFrameMonitor } from "../utils/index.js";
|
|
16
17
|
import { DndCellRender } from "./dnd-component/index.js";
|
|
17
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -37,6 +38,7 @@ export var LibroVirtualizedRow = /*#__PURE__*/memo(function LibroVirtualizedRow(
|
|
|
37
38
|
|
|
38
39
|
// 已经在上层判断是否为虚拟滚动
|
|
39
40
|
export var LibroCellsOutputRender = function LibroCellsOutputRender(_ref2) {
|
|
41
|
+
var _listRef$current;
|
|
40
42
|
var cells = _ref2.cells,
|
|
41
43
|
libroView = _ref2.libroView,
|
|
42
44
|
addCellButtons = _ref2.addCellButtons;
|
|
@@ -164,6 +166,22 @@ export var LibroCellsOutputRender = function LibroCellsOutputRender(_ref2) {
|
|
|
164
166
|
});
|
|
165
167
|
setEditorsOffset(newCellOffsets);
|
|
166
168
|
}, [cells]);
|
|
169
|
+
useFrameMonitor({
|
|
170
|
+
current: (_listRef$current = listRef.current) === null || _listRef$current === void 0 || (_listRef$current = _listRef$current.Grid) === null || _listRef$current === void 0 ? void 0 : _listRef$current._scrollingContainer
|
|
171
|
+
}, libroView.libroViewTracker.isEnabledSpmReporter, function (payload) {
|
|
172
|
+
var _libroView$model$curr;
|
|
173
|
+
var fpsTracker = libroView.libroViewTracker.getOrCreateTrackers({
|
|
174
|
+
type: 'fps',
|
|
175
|
+
id: libroView.model.options['modelId'] + 'fps'
|
|
176
|
+
});
|
|
177
|
+
fpsTracker['avgFPS'] = payload.summary.avgFPS;
|
|
178
|
+
fpsTracker['maxFrameTime'] = payload.summary.maxFrameTime;
|
|
179
|
+
fpsTracker['totalDropped'] = payload.summary.totalDropped;
|
|
180
|
+
fpsTracker['extra'] = payload.frames;
|
|
181
|
+
fpsTracker['cells'] = libroView.model.cells.length;
|
|
182
|
+
fpsTracker['size'] = (_libroView$model$curr = libroView.model.currentFileContents) === null || _libroView$model$curr === void 0 ? void 0 : _libroView$model$curr.size;
|
|
183
|
+
libroView.libroViewTracker.tracker(fpsTracker);
|
|
184
|
+
});
|
|
167
185
|
return /*#__PURE__*/_jsx(AutoSizer, {
|
|
168
186
|
style: {
|
|
169
187
|
height: '100%',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.43",
|
|
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.3.
|
|
38
|
-
"@difizen/libro-common": "^0.3.
|
|
39
|
-
"@difizen/libro-shared-model": "^0.3.
|
|
40
|
-
"@difizen/libro-virtualized": "^0.3.
|
|
37
|
+
"@difizen/libro-code-editor": "^0.3.43",
|
|
38
|
+
"@difizen/libro-common": "^0.3.43",
|
|
39
|
+
"@difizen/libro-shared-model": "^0.3.43",
|
|
40
|
+
"@difizen/libro-virtualized": "^0.3.43",
|
|
41
41
|
"@difizen/mana-app": "latest",
|
|
42
42
|
"@difizen/mana-l10n": "latest",
|
|
43
43
|
"@difizen/mana-react": "latest",
|
|
@@ -6,6 +6,7 @@ import { memo, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
6
6
|
import { EditorCellView } from '../cell/index.js';
|
|
7
7
|
import type { CellView, ScrollParams } from '../libro-protocol.js';
|
|
8
8
|
import type { LibroView } from '../libro-view.js';
|
|
9
|
+
import { useFrameMonitor } from '../utils/index.js';
|
|
9
10
|
|
|
10
11
|
import { DndCellRender } from './dnd-component/index.js';
|
|
11
12
|
|
|
@@ -190,6 +191,26 @@ export const LibroCellsOutputRender: React.FC<{
|
|
|
190
191
|
setEditorsOffset(newCellOffsets);
|
|
191
192
|
}, [cells]);
|
|
192
193
|
|
|
194
|
+
useFrameMonitor(
|
|
195
|
+
{
|
|
196
|
+
current: listRef.current?.Grid?._scrollingContainer,
|
|
197
|
+
},
|
|
198
|
+
libroView.libroViewTracker.isEnabledSpmReporter,
|
|
199
|
+
(payload) => {
|
|
200
|
+
const fpsTracker = libroView.libroViewTracker.getOrCreateTrackers({
|
|
201
|
+
type: 'fps',
|
|
202
|
+
id: libroView.model.options['modelId'] + 'fps',
|
|
203
|
+
});
|
|
204
|
+
fpsTracker['avgFPS'] = payload.summary.avgFPS;
|
|
205
|
+
fpsTracker['maxFrameTime'] = payload.summary.maxFrameTime;
|
|
206
|
+
fpsTracker['totalDropped'] = payload.summary.totalDropped;
|
|
207
|
+
fpsTracker['extra'] = payload.frames;
|
|
208
|
+
fpsTracker['cells'] = libroView.model.cells.length;
|
|
209
|
+
fpsTracker['size'] = libroView.model.currentFileContents?.size;
|
|
210
|
+
libroView.libroViewTracker.tracker(fpsTracker);
|
|
211
|
+
},
|
|
212
|
+
);
|
|
213
|
+
|
|
193
214
|
return (
|
|
194
215
|
<AutoSizer style={{ height: '100%', width: '100%' }} ref={parentRef}>
|
|
195
216
|
{({ width, height }: { width: number; height: number }) => {
|