@difizen/libro-core 0.3.13 → 0.3.15
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/cell/libro-cell-view.d.ts +9 -9
- package/es/cell/libro-cell-view.js +6 -6
- package/es/cell/libro-edit-cell-view.d.ts.map +1 -1
- package/es/cell/libro-edit-cell-view.js +19 -0
- package/es/command/libro-command-contribution.js +3 -3
- package/es/libro-protocol.d.ts +1 -2
- package/es/libro-protocol.d.ts.map +1 -1
- package/es/libro-service.d.ts.map +1 -1
- package/es/libro-service.js +10 -11
- package/es/libro-view-tracker.d.ts +21 -5
- package/es/libro-view-tracker.d.ts.map +1 -1
- package/es/libro-view-tracker.js +36 -9
- package/es/libro-view.d.ts +2 -1
- package/es/libro-view.d.ts.map +1 -1
- package/es/libro-view.js +27 -19
- package/es/utils/index.d.ts +13 -0
- package/es/utils/index.d.ts.map +1 -1
- package/es/utils/index.js +125 -1
- package/package.json +5 -5
- package/src/cell/libro-cell-view.tsx +6 -6
- package/src/cell/libro-edit-cell-view.tsx +24 -0
- package/src/command/libro-command-contribution.ts +3 -3
- package/src/libro-protocol.ts +1 -2
- package/src/libro-service.ts +1 -7
- package/src/libro-view-tracker.ts +37 -10
- package/src/libro-view.tsx +32 -20
- package/src/utils/index.ts +142 -0
|
@@ -41,16 +41,21 @@ export declare class LibroCellView extends BaseView implements CellView {
|
|
|
41
41
|
toJSON(): LibroCell;
|
|
42
42
|
toJSONWithoutId: () => {
|
|
43
43
|
[x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
|
|
44
|
-
|
|
45
|
-
cell_type:
|
|
46
|
-
metadata: Partial<import("@difizen/libro-common").IRawCellMetadata>;
|
|
47
|
-
attachments?: import("@difizen/libro-common").IAttachments | undefined;
|
|
44
|
+
metadata: Partial<import("./libro-cell-protocol.js").LibroCellMetadata>;
|
|
45
|
+
cell_type: string;
|
|
48
46
|
source: import("@difizen/libro-common").MultilineString;
|
|
49
47
|
} | {
|
|
50
48
|
[x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
|
|
51
49
|
cell_type: string;
|
|
52
50
|
source: import("@difizen/libro-common").MultilineString;
|
|
53
51
|
metadata: Partial<import("@difizen/libro-common").ICellMetadata>;
|
|
52
|
+
} | {
|
|
53
|
+
[x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
|
|
54
|
+
id?: string | undefined;
|
|
55
|
+
cell_type: "raw";
|
|
56
|
+
metadata: Partial<import("@difizen/libro-common").IRawCellMetadata>;
|
|
57
|
+
attachments?: import("@difizen/libro-common").IAttachments | undefined;
|
|
58
|
+
source: import("@difizen/libro-common").MultilineString;
|
|
54
59
|
} | {
|
|
55
60
|
[x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
|
|
56
61
|
id?: string | undefined;
|
|
@@ -66,11 +71,6 @@ export declare class LibroCellView extends BaseView implements CellView {
|
|
|
66
71
|
outputs: import("@difizen/libro-common").IOutput[];
|
|
67
72
|
execution_count: import("@difizen/libro-common").ExecutionCount;
|
|
68
73
|
source: import("@difizen/libro-common").MultilineString;
|
|
69
|
-
} | {
|
|
70
|
-
[x: string]: import("@difizen/libro-common").PartialJSONValue | undefined;
|
|
71
|
-
metadata: Partial<import("./libro-cell-protocol.js").LibroCellMetadata>;
|
|
72
|
-
cell_type: string;
|
|
73
|
-
source: import("@difizen/libro-common").MultilineString;
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
//# sourceMappingURL=libro-cell-view.d.ts.map
|
|
@@ -100,11 +100,11 @@ export var LibroCellView = (_dec = view('libro-cell-view'), _dec2 = prop(), _dec
|
|
|
100
100
|
value: function onViewMount() {
|
|
101
101
|
var id = this.options.id + this.parent.id + 'add';
|
|
102
102
|
if (this.cellService.libroViewTracker.isEnabledSpmReporter && this.options.id && this.cellService.libroViewTracker.hasTracker(id)) {
|
|
103
|
-
var cellTracker = this.cellService.libroViewTracker.
|
|
103
|
+
var cellTracker = this.cellService.libroViewTracker.getOrCreateTrackers({
|
|
104
104
|
id: id
|
|
105
105
|
});
|
|
106
|
-
cellTracker
|
|
107
|
-
cellTracker
|
|
106
|
+
cellTracker['endTime'] = Date.now();
|
|
107
|
+
cellTracker['extra'].cellType = this.model.type;
|
|
108
108
|
this.cellService.libroViewTracker.tracker(cellTracker);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -113,11 +113,11 @@ export var LibroCellView = (_dec = view('libro-cell-view'), _dec2 = prop(), _dec
|
|
|
113
113
|
value: function onViewUnmount() {
|
|
114
114
|
var id = this.model.id + this.parent.id + 'delete';
|
|
115
115
|
if (this.cellService.libroViewTracker.isEnabledSpmReporter && this.cellService.libroViewTracker.hasTracker(id)) {
|
|
116
|
-
var cellTracker = this.cellService.libroViewTracker.
|
|
116
|
+
var cellTracker = this.cellService.libroViewTracker.getOrCreateTrackers({
|
|
117
117
|
id: id
|
|
118
118
|
});
|
|
119
|
-
cellTracker
|
|
120
|
-
cellTracker
|
|
119
|
+
cellTracker['endTime'] = Date.now();
|
|
120
|
+
cellTracker['extra'].cellType = this.model.type;
|
|
121
121
|
this.cellService.libroViewTracker.tracker(cellTracker);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-edit-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-edit-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,OAAO,EACR,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAEL,oBAAoB,EAOrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACtE,OA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
|
|
164
164
|
if (e.status === 'ready') {
|
|
165
165
|
_this3.editor = _this3.editorView.editor;
|
|
166
166
|
_this3.afterEditorReady();
|
|
167
|
+
if (_this3.parent.libroViewTracker.isEnabledSpmReporter) {
|
|
168
|
+
if (_this3.parent.libroViewTracker.hasTracker(_this3.parent.model.options['modelId'] || _this3.parent.model.options['id'])) {
|
|
169
|
+
var libroTracker = _this3.parent.libroViewTracker.getOrCreateTrackers({
|
|
170
|
+
id: _this3.parent.model.options['modelId'] || _this3.parent.model.options['id']
|
|
171
|
+
});
|
|
172
|
+
libroTracker['endTime'] = Date.now();
|
|
173
|
+
libroTracker['extra'].cellsCount = _this3.parent.model.cells.length;
|
|
174
|
+
_this3.parent.libroViewTracker.tracker(libroTracker);
|
|
175
|
+
}
|
|
176
|
+
var id = _this3.options.id + _this3.parent.id + 'add';
|
|
177
|
+
if (_this3.options.id && _this3.parent.libroViewTracker.hasTracker(id)) {
|
|
178
|
+
var cellTracker = _this3.parent.libroViewTracker.getOrCreateTrackers({
|
|
179
|
+
id: id
|
|
180
|
+
});
|
|
181
|
+
cellTracker['endTime'] = Date.now();
|
|
182
|
+
cellTracker['extra'].cellType = _this3.model.type;
|
|
183
|
+
_this3.parent.libroViewTracker.tracker(cellTracker);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
167
186
|
} else if (e.status === 'disposed') {
|
|
168
187
|
_this3.toDisposeOnEditor.dispose();
|
|
169
188
|
}
|
|
@@ -400,11 +400,11 @@ export var LibroCommandContribution = (_dec = singleton({
|
|
|
400
400
|
libro.addCell(newCell, insertIndex);
|
|
401
401
|
if (_this.libroViewTracker.isEnabledSpmReporter) {
|
|
402
402
|
id = newCell.id + libro.id;
|
|
403
|
-
libroTracker = _this.libroViewTracker.
|
|
403
|
+
libroTracker = _this.libroViewTracker.getOrCreateTrackers({
|
|
404
404
|
id: id
|
|
405
405
|
});
|
|
406
|
-
libroTracker
|
|
407
|
-
libroTracker
|
|
406
|
+
libroTracker['extra'].cellsCount = libro.model.cells.length;
|
|
407
|
+
libroTracker['extra'].cellOperation = 'add';
|
|
408
408
|
}
|
|
409
409
|
case 7:
|
|
410
410
|
case "end":
|
package/es/libro-protocol.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-protocol.d.ts","sourceRoot":"","sources":["../src/libro-protocol.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EACV,QAAQ,EACR,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC;AACF,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,cAAc,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,aAAa,CAAC;AAE7E,eAAO,MAAM,aAAa,eA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C,SAAS,CAAC,SAAS,UAAS;IAE5B,gBAAgB,CAAC,OAAO,EAAE,cAAc;IAWlC,eAAe,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAsBrE,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY;IAuD9C,SAAS,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI;IAKpC,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAIpC,SAAS,CAAC,UAAU,UAAS;IAC7B,IAAI,QAAQ,YAEX;IACD,OAAO;CAIR"}
|
package/es/libro-service.js
CHANGED
|
@@ -157,29 +157,28 @@ export var LibroService = (_dec = singleton({
|
|
|
157
157
|
key: "getOrCreateView",
|
|
158
158
|
value: function () {
|
|
159
159
|
var _getOrCreateView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
160
|
-
var
|
|
160
|
+
var notebookViewPromise, notebookView;
|
|
161
161
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
162
162
|
while (1) switch (_context.prev = _context.next) {
|
|
163
163
|
case 0:
|
|
164
|
-
if (this.libroViewTracker.isEnabledSpmReporter) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
model = this.getOrCreateModel(options);
|
|
164
|
+
// if (this.libroViewTracker.isEnabledSpmReporter) {
|
|
165
|
+
// this.libroViewTracker.getOrCreateTrackers({
|
|
166
|
+
// id: options.modelId || options.id,
|
|
167
|
+
// });
|
|
168
|
+
// }
|
|
170
169
|
notebookViewPromise = this.viewManager.getOrCreateView(notebookViewFactoryId, _objectSpread(_objectSpread({}, options || {}), {}, {
|
|
171
|
-
modelId:
|
|
170
|
+
modelId: options.modelId || options.id
|
|
172
171
|
}));
|
|
173
|
-
_context.next =
|
|
172
|
+
_context.next = 3;
|
|
174
173
|
return notebookViewPromise;
|
|
175
|
-
case
|
|
174
|
+
case 3:
|
|
176
175
|
notebookView = _context.sent;
|
|
177
176
|
if (!this.libroViewTracker.viewCache.has(notebookView.id)) {
|
|
178
177
|
this.watchNotebookView(notebookView);
|
|
179
178
|
}
|
|
180
179
|
this.libroViewTracker.viewCache.set(notebookView.id, notebookView);
|
|
181
180
|
return _context.abrupt("return", notebookViewPromise);
|
|
182
|
-
case
|
|
181
|
+
case 7:
|
|
183
182
|
case "end":
|
|
184
183
|
return _context.stop();
|
|
185
184
|
}
|
|
@@ -17,15 +17,31 @@ export declare class Tracker implements ITracker {
|
|
|
17
17
|
extra: any;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
+
export declare class FpsTracker implements ITracker {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
extra?: any;
|
|
23
|
+
id: string;
|
|
24
|
+
avgFPS: number;
|
|
25
|
+
maxFrameTime: number;
|
|
26
|
+
totalDropped: number;
|
|
27
|
+
constructor(id?: string, extra?: any);
|
|
28
|
+
log(): {
|
|
29
|
+
id: string;
|
|
30
|
+
avgFPS: number;
|
|
31
|
+
maxFrameTime: number;
|
|
32
|
+
totalDropped: number;
|
|
33
|
+
extra: any;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
20
36
|
export declare class LibroViewTracker {
|
|
21
37
|
viewCache: Map<string, NotebookView>;
|
|
22
38
|
modelCache: Map<string, NotebookModel>;
|
|
23
|
-
|
|
39
|
+
trackers: Map<string, ITracker>;
|
|
24
40
|
isEnabledSpmReporter: boolean;
|
|
25
|
-
protected onTrackerEmitter: Emitter<
|
|
26
|
-
get onTracker(): import("@difizen/mana-app").Event<
|
|
27
|
-
|
|
28
|
-
tracker(tracker:
|
|
41
|
+
protected onTrackerEmitter: Emitter<Record<string, any>>;
|
|
42
|
+
get onTracker(): import("@difizen/mana-app").Event<Record<string, any>>;
|
|
43
|
+
getOrCreateTrackers(options: Options): ITracker | FpsTracker | Tracker;
|
|
44
|
+
tracker(tracker: ITracker): void;
|
|
29
45
|
hasTracker(id: string): boolean;
|
|
30
46
|
}
|
|
31
47
|
//# sourceMappingURL=libro-view-tracker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-view-tracker.d.ts","sourceRoot":"","sources":["../src/libro-view-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,OAAO,EACR,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,OAAQ,YAAW,QAAQ;IACtC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;gBAEC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAMpC,QAAQ;IAKR,WAAW;IAOX,GAAG;;;;;;;CAWJ;AAED,qBACa,gBAAgB;IAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IACjD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAa;IACnD,
|
|
1
|
+
{"version":3,"file":"libro-view-tracker.d.ts","sourceRoot":"","sources":["../src/libro-view-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,OAAO,EACR,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,OAAQ,YAAW,QAAQ;IACtC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;gBAEC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAMpC,QAAQ;IAKR,WAAW;IAOX,GAAG;;;;;;;CAWJ;AAED,qBAAa,UAAW,YAAW,QAAQ;IACzC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;gBAET,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAKpC,GAAG;;;;;;;CAUJ;AAED,qBACa,gBAAgB;IAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IACjD,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAa;IACnD,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAa;IAC5C,oBAAoB,EAAE,OAAO,CAAC;IAE9B,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAiB;IACzE,IAAI,SAAS,2DAEZ;IAED,mBAAmB,CAAC,OAAO,EAAE,OAAO;IAepC,OAAO,CAAC,OAAO,EAAE,QAAQ;IAMzB,UAAU,CAAC,EAAE,EAAE,MAAM;CAGtB"}
|
package/es/libro-view-tracker.js
CHANGED
|
@@ -48,12 +48,38 @@ export var Tracker = /*#__PURE__*/function () {
|
|
|
48
48
|
}]);
|
|
49
49
|
return Tracker;
|
|
50
50
|
}();
|
|
51
|
+
export var FpsTracker = /*#__PURE__*/function () {
|
|
52
|
+
function FpsTracker(id, extra) {
|
|
53
|
+
_classCallCheck(this, FpsTracker);
|
|
54
|
+
this.extra = void 0;
|
|
55
|
+
this.id = void 0;
|
|
56
|
+
this.avgFPS = void 0;
|
|
57
|
+
this.maxFrameTime = void 0;
|
|
58
|
+
this.totalDropped = void 0;
|
|
59
|
+
this.id = id || v4();
|
|
60
|
+
this.extra = extra || {};
|
|
61
|
+
}
|
|
62
|
+
_createClass(FpsTracker, [{
|
|
63
|
+
key: "log",
|
|
64
|
+
value: function log() {
|
|
65
|
+
var result = {
|
|
66
|
+
id: this.id,
|
|
67
|
+
avgFPS: this.avgFPS,
|
|
68
|
+
maxFrameTime: this.maxFrameTime,
|
|
69
|
+
totalDropped: this.totalDropped,
|
|
70
|
+
extra: this.extra
|
|
71
|
+
};
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
}]);
|
|
75
|
+
return FpsTracker;
|
|
76
|
+
}();
|
|
51
77
|
export var LibroViewTracker = (_dec = singleton(), _dec(_class = /*#__PURE__*/function () {
|
|
52
78
|
function LibroViewTracker() {
|
|
53
79
|
_classCallCheck(this, LibroViewTracker);
|
|
54
80
|
this.viewCache = new Map();
|
|
55
81
|
this.modelCache = new Map();
|
|
56
|
-
this.
|
|
82
|
+
this.trackers = new Map();
|
|
57
83
|
this.isEnabledSpmReporter = void 0;
|
|
58
84
|
this.onTrackerEmitter = new Emitter();
|
|
59
85
|
}
|
|
@@ -63,30 +89,31 @@ export var LibroViewTracker = (_dec = singleton(), _dec(_class = /*#__PURE__*/fu
|
|
|
63
89
|
return this.onTrackerEmitter.event;
|
|
64
90
|
}
|
|
65
91
|
}, {
|
|
66
|
-
key: "
|
|
67
|
-
value: function
|
|
92
|
+
key: "getOrCreateTrackers",
|
|
93
|
+
value: function getOrCreateTrackers(options) {
|
|
68
94
|
var id = options.id || v4();
|
|
69
|
-
var exist = this.
|
|
95
|
+
var exist = this.trackers.get(id);
|
|
70
96
|
if (exist) {
|
|
71
|
-
if (!exist
|
|
72
|
-
exist
|
|
97
|
+
if (options['type'] !== 'fps' && !exist['startTime']) {
|
|
98
|
+
exist['startTime'] = Date.now();
|
|
73
99
|
}
|
|
74
100
|
return exist;
|
|
75
101
|
}
|
|
76
|
-
var tracker = new Tracker(id);
|
|
77
|
-
this.
|
|
102
|
+
var tracker = options['type'] === 'fps' ? new FpsTracker(id) : new Tracker(id);
|
|
103
|
+
this.trackers.set(id, tracker);
|
|
78
104
|
return tracker;
|
|
79
105
|
}
|
|
80
106
|
}, {
|
|
81
107
|
key: "tracker",
|
|
82
108
|
value: function tracker(_tracker) {
|
|
83
109
|
var trackerLog = _tracker.log();
|
|
110
|
+
this.trackers.delete(_tracker.id);
|
|
84
111
|
this.onTrackerEmitter.fire(trackerLog);
|
|
85
112
|
}
|
|
86
113
|
}, {
|
|
87
114
|
key: "hasTracker",
|
|
88
115
|
value: function hasTracker(id) {
|
|
89
|
-
return this.
|
|
116
|
+
return this.trackers.has(id);
|
|
90
117
|
}
|
|
91
118
|
}]);
|
|
92
119
|
return LibroViewTracker;
|
package/es/libro-view.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare class LibroView extends BaseView implements NotebookView {
|
|
|
39
39
|
libroService: LibroService;
|
|
40
40
|
libroSlotManager: LibroSlotManager;
|
|
41
41
|
contextKey: LibroContextKey;
|
|
42
|
-
|
|
42
|
+
libroViewTracker: LibroViewTracker;
|
|
43
43
|
protected viewManager: ViewManager;
|
|
44
44
|
protected configurationService: ConfigurationService;
|
|
45
45
|
protected virtualizedManager: VirtualizedManager;
|
|
@@ -52,6 +52,7 @@ export declare class LibroView extends BaseView implements NotebookView {
|
|
|
52
52
|
outputsScroll: boolean;
|
|
53
53
|
get hasModal(): boolean;
|
|
54
54
|
saving?: boolean;
|
|
55
|
+
options: NotebookOption;
|
|
55
56
|
onSaveEmitter: Emitter<boolean>;
|
|
56
57
|
get onSave(): import("@difizen/mana-app").Event<boolean>;
|
|
57
58
|
onCellContentChangedEmitter: Emitter<IModelContentChange[]>;
|
package/es/libro-view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libro-view.d.ts","sourceRoot":"","sources":["../src/libro-view.tsx"],"names":[],"mappings":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gB,cAAe,OAAO,UAUpC;IAEF,aAAa,aAIX;IAEF,cAAc,SAAU,QAAQ,UAO9B;IAEF,YAAY,SAAU,QAAQ,UAO5B;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
|
@@ -47,7 +47,7 @@ import { LibroService } from "./libro-service.js";
|
|
|
47
47
|
import { AutoInsertWhenNoCell, EnterEditModeWhenAddCell, HeaderToolbarVisible, RightContentFixed } from "./libro-setting.js";
|
|
48
48
|
import { LibroViewTracker } from "./libro-view-tracker.js";
|
|
49
49
|
import { LibroSlotManager, LibroSlotView } from "./slot/index.js";
|
|
50
|
-
import { useSize } from "./utils/index.js";
|
|
50
|
+
import { useFrameMonitor, useSize } from "./utils/index.js";
|
|
51
51
|
import { VirtualizedManagerHelper } from "./virtualized-manager-helper.js";
|
|
52
52
|
import "./index.less";
|
|
53
53
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -67,6 +67,16 @@ export var LibroContentComponent = /*#__PURE__*/memo(function LibroContentCompon
|
|
|
67
67
|
var _useConfigurationValu3 = useConfigurationValue(RightContentFixed),
|
|
68
68
|
_useConfigurationValu4 = _slicedToArray(_useConfigurationValu3, 1),
|
|
69
69
|
rightContentFixed = _useConfigurationValu4[0];
|
|
70
|
+
useFrameMonitor(libroViewContentRef, instance.libroViewTracker.isEnabledSpmReporter, function (payload) {
|
|
71
|
+
var fpsTracker = instance.libroViewTracker.getOrCreateTrackers({
|
|
72
|
+
type: 'fps'
|
|
73
|
+
});
|
|
74
|
+
fpsTracker['avgFPS'] = payload.summary.avgFPS;
|
|
75
|
+
fpsTracker['maxFrameTime'] = payload.summary.maxFrameTime;
|
|
76
|
+
fpsTracker['totalDropped'] = payload.summary.totalDropped;
|
|
77
|
+
fpsTracker['extra'] = payload.frames;
|
|
78
|
+
instance.libroViewTracker.tracker(fpsTracker);
|
|
79
|
+
});
|
|
70
80
|
var handleScroll = useCallback(function () {
|
|
71
81
|
var _instance$container, _instance$activeCell, _instance$activeCell2, _instance$activeCell3, _activeOutput$outputs, _instance$activeCell4, _libroViewTopRef$curr;
|
|
72
82
|
instance.cellScrollEmitter.fire();
|
|
@@ -246,6 +256,7 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
246
256
|
_initializerDefineProperty(_this, "collapserVisible", _descriptor9, _assertThisInitialized(_this));
|
|
247
257
|
_initializerDefineProperty(_this, "outputsScroll", _descriptor10, _assertThisInitialized(_this));
|
|
248
258
|
_initializerDefineProperty(_this, "saving", _descriptor11, _assertThisInitialized(_this));
|
|
259
|
+
_this.options = void 0;
|
|
249
260
|
_this.onSaveEmitter = new Emitter();
|
|
250
261
|
_this.onCellContentChangedEmitter = new Emitter();
|
|
251
262
|
_this.runCellEmitter = new Emitter();
|
|
@@ -255,7 +266,11 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
255
266
|
_this.onViewMount = function () {
|
|
256
267
|
_this.libroService.active = _assertThisInitialized(_this);
|
|
257
268
|
_this.libroSlotManager.setup(_assertThisInitialized(_this));
|
|
258
|
-
|
|
269
|
+
if (_this.libroViewTracker.isEnabledSpmReporter) {
|
|
270
|
+
_this.libroViewTracker.getOrCreateTrackers({
|
|
271
|
+
id: _this.options.modelId || _this.options.id
|
|
272
|
+
});
|
|
273
|
+
}
|
|
259
274
|
// this.libroService.libroPerformanceStatistics.setRenderEnd(new Date());
|
|
260
275
|
|
|
261
276
|
// console.log(
|
|
@@ -328,11 +343,11 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
328
343
|
case 0:
|
|
329
344
|
if (_this.libroViewTracker.isEnabledSpmReporter && option.id) {
|
|
330
345
|
id = option.id + _this.id;
|
|
331
|
-
libroTracker = _this.libroViewTracker.
|
|
346
|
+
libroTracker = _this.libroViewTracker.getOrCreateTrackers({
|
|
332
347
|
id: id + 'add'
|
|
333
348
|
});
|
|
334
|
-
libroTracker
|
|
335
|
-
libroTracker
|
|
349
|
+
libroTracker['extra'].cellsCount = _this.model.cells.length;
|
|
350
|
+
libroTracker['extra'].cellOperation = 'add';
|
|
336
351
|
}
|
|
337
352
|
_context3.next = 3;
|
|
338
353
|
return _this.getCellViewByOption(option);
|
|
@@ -357,11 +372,11 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
357
372
|
case 0:
|
|
358
373
|
if (_this.libroViewTracker.isEnabledSpmReporter && option.id) {
|
|
359
374
|
id = option.id + _this.id;
|
|
360
|
-
libroTracker = _this.libroViewTracker.
|
|
375
|
+
libroTracker = _this.libroViewTracker.getOrCreateTrackers({
|
|
361
376
|
id: id + 'add'
|
|
362
377
|
});
|
|
363
|
-
libroTracker
|
|
364
|
-
libroTracker
|
|
378
|
+
libroTracker['extra'].cellsCount = _this.model.cells.length;
|
|
379
|
+
libroTracker['extra'].cellOperation = 'add';
|
|
365
380
|
}
|
|
366
381
|
_context4.next = 3;
|
|
367
382
|
return _this.getCellViewByOption(option);
|
|
@@ -391,11 +406,11 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
391
406
|
_this.deleteCell = function (cell) {
|
|
392
407
|
if (_this.libroViewTracker.isEnabledSpmReporter && cell.model.id) {
|
|
393
408
|
var id = cell.model.id + _this.id;
|
|
394
|
-
var libroTracker = _this.libroViewTracker.
|
|
409
|
+
var libroTracker = _this.libroViewTracker.getOrCreateTrackers({
|
|
395
410
|
id: id + 'delete'
|
|
396
411
|
});
|
|
397
|
-
libroTracker
|
|
398
|
-
libroTracker
|
|
412
|
+
libroTracker['extra'].cellsCount = _this.model.cells.length;
|
|
413
|
+
libroTracker['extra'].cellOperation = 'delete';
|
|
399
414
|
}
|
|
400
415
|
var deleteIndex = _this.model.getCells().findIndex(function (item) {
|
|
401
416
|
return equals(item, cell);
|
|
@@ -1691,6 +1706,7 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1691
1706
|
if (_options.id) {
|
|
1692
1707
|
_this.id = _options.id;
|
|
1693
1708
|
}
|
|
1709
|
+
_this.options = _options;
|
|
1694
1710
|
_this.notebookService = notebookService;
|
|
1695
1711
|
_this.model = _this.notebookService.getOrCreateModel(_options);
|
|
1696
1712
|
_this.collapseService = collapseServiceFactory({
|
|
@@ -1826,14 +1842,6 @@ export var LibroView = (_dec = transient(), _dec2 = view(notebookViewFactoryId),
|
|
|
1826
1842
|
var _this2$model$onChange, _this2$model;
|
|
1827
1843
|
(_this2$model$onChange = (_this2$model = _this2.model).onChange) === null || _this2$model$onChange === void 0 || _this2$model$onChange.call(_this2$model);
|
|
1828
1844
|
}));
|
|
1829
|
-
if (_this2.libroViewTracker.isEnabledSpmReporter) {
|
|
1830
|
-
var libroTracker = _this2.libroViewTracker.getOrCreateSpmTracker({
|
|
1831
|
-
id: _this2.model.id
|
|
1832
|
-
});
|
|
1833
|
-
libroTracker.endTime = Date.now();
|
|
1834
|
-
libroTracker.extra.cellsCount = _this2.model.cells.length;
|
|
1835
|
-
_this2.libroViewTracker.tracker(libroTracker);
|
|
1836
|
-
}
|
|
1837
1845
|
_this2.initializedDefer.resolve();
|
|
1838
1846
|
}, 0);
|
|
1839
1847
|
case 8:
|
package/es/utils/index.d.ts
CHANGED
|
@@ -4,5 +4,18 @@ type Size = {
|
|
|
4
4
|
height: number;
|
|
5
5
|
};
|
|
6
6
|
export declare function useSize(ref: RefObject<HTMLDivElement>): Size | undefined;
|
|
7
|
+
interface FrameMetrics {
|
|
8
|
+
timestamp: number;
|
|
9
|
+
fps: number;
|
|
10
|
+
frameTime: number;
|
|
11
|
+
droppedFrames: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const useFrameMonitor: (scrollContainerRef: React.RefObject<HTMLElement>, isEnabledSpmReporter: boolean, onReport?: ((payload: {
|
|
14
|
+
frames: FrameMetrics[];
|
|
15
|
+
summary: any;
|
|
16
|
+
}) => void) | undefined) => {
|
|
17
|
+
frameData: import("react").MutableRefObject<FrameMetrics[]>;
|
|
18
|
+
reportFrames: () => void;
|
|
19
|
+
};
|
|
7
20
|
export {};
|
|
8
21
|
//# sourceMappingURL=index.d.ts.map
|
package/es/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAuBvC,KAAK,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9C,wBAAgB,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,cAAc,CAAC,GAAG,IAAI,GAAG,SAAS,CAuBxE;AAED,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,uBACN,eAAe,CAAC,WAAW,CAAC,wBAC1B,OAAO,wBACR;IAAE,QAAQ,YAAY,EAAE,CAAC;IAAC,OAAO,EAAE,GAAG,CAAA;CAAE,KAAK,IAAI;;;CAiIvE,CAAC"}
|
package/es/utils/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -5,6 +9,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
11
|
import { useUnmount } from '@difizen/mana-app';
|
|
12
|
+
import { useEffect } from 'react';
|
|
8
13
|
import { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
9
14
|
function useRafState(initialState) {
|
|
10
15
|
var ref = useRef(0);
|
|
@@ -50,4 +55,123 @@ export function useSize(ref) {
|
|
|
50
55
|
};
|
|
51
56
|
}, [ref, setSize]);
|
|
52
57
|
return size;
|
|
53
|
-
}
|
|
58
|
+
}
|
|
59
|
+
export var useFrameMonitor = function useFrameMonitor(scrollContainerRef, isEnabledSpmReporter, onReport) {
|
|
60
|
+
var frameData = useRef([]);
|
|
61
|
+
var lastFrameTime = useRef(performance.now());
|
|
62
|
+
var frameCount = useRef(0);
|
|
63
|
+
var lastScrollPos = useRef(0);
|
|
64
|
+
var rafId = useRef();
|
|
65
|
+
var isMonitoring = useRef(false);
|
|
66
|
+
// const reportTimeout = useRef<NodeJS.Timeout>();
|
|
67
|
+
var intervalId = useRef();
|
|
68
|
+
var scrollDebounceTimer = useRef();
|
|
69
|
+
var stopFrameCapture = useCallback(function () {
|
|
70
|
+
if (rafId.current) {
|
|
71
|
+
cancelAnimationFrame(rafId.current);
|
|
72
|
+
}
|
|
73
|
+
if (intervalId.current) {
|
|
74
|
+
clearInterval(intervalId.current);
|
|
75
|
+
}
|
|
76
|
+
isMonitoring.current = false;
|
|
77
|
+
frameCount.current = 0;
|
|
78
|
+
lastFrameTime.current = performance.now();
|
|
79
|
+
}, []);
|
|
80
|
+
var startFrameCapture = useCallback(function () {
|
|
81
|
+
if (isMonitoring.current) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
var calculateFPS = function calculateFPS() {
|
|
85
|
+
if (!isMonitoring.current) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
var now = performance.now();
|
|
89
|
+
var delta = now - lastFrameTime.current;
|
|
90
|
+
frameData.current.push({
|
|
91
|
+
timestamp: now,
|
|
92
|
+
fps: Math.round(frameCount.current * 1000 / delta),
|
|
93
|
+
frameTime: delta / frameCount.current,
|
|
94
|
+
droppedFrames: Math.max(0, Math.floor(delta / 16.67) - frameCount.current)
|
|
95
|
+
});
|
|
96
|
+
lastFrameTime.current = now;
|
|
97
|
+
frameCount.current = 0;
|
|
98
|
+
};
|
|
99
|
+
var loop = function loop() {
|
|
100
|
+
if (isMonitoring.current) {
|
|
101
|
+
frameCount.current++;
|
|
102
|
+
rafId.current = requestAnimationFrame(loop);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
isMonitoring.current = true;
|
|
106
|
+
frameCount.current = 0;
|
|
107
|
+
lastFrameTime.current = performance.now();
|
|
108
|
+
if (intervalId.current) {
|
|
109
|
+
clearInterval(intervalId.current);
|
|
110
|
+
}
|
|
111
|
+
intervalId.current = setInterval(calculateFPS, 1500); // 每秒生成一个数据点
|
|
112
|
+
rafId.current = requestAnimationFrame(loop);
|
|
113
|
+
}, []);
|
|
114
|
+
var reportFrames = useCallback(function () {
|
|
115
|
+
if (frameData.current.length === 0) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
var send = function send() {
|
|
119
|
+
var payload = {
|
|
120
|
+
frames: frameData.current,
|
|
121
|
+
summary: {
|
|
122
|
+
avgFPS: frameData.current.reduce(function (a, b) {
|
|
123
|
+
return a + b.fps;
|
|
124
|
+
}, 0) / frameData.current.length,
|
|
125
|
+
maxFrameTime: Math.max.apply(Math, _toConsumableArray(frameData.current.map(function (f) {
|
|
126
|
+
return f.frameTime;
|
|
127
|
+
}))),
|
|
128
|
+
totalDropped: frameData.current.reduce(function (a, b) {
|
|
129
|
+
return a + b.droppedFrames;
|
|
130
|
+
}, 0)
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
if (onReport) {
|
|
134
|
+
onReport(payload); // 触发外部回调
|
|
135
|
+
}
|
|
136
|
+
frameData.current = [];
|
|
137
|
+
};
|
|
138
|
+
requestIdleCallback(send, {
|
|
139
|
+
timeout: 1000
|
|
140
|
+
}) || setTimeout(send, 0);
|
|
141
|
+
}, [onReport]); // 添加 onReport 依赖
|
|
142
|
+
|
|
143
|
+
useEffect(function () {
|
|
144
|
+
if (!isEnabledSpmReporter) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
var container = scrollContainerRef.current || window;
|
|
148
|
+
var handleScroll = function handleScroll() {
|
|
149
|
+
// const currentScroll =
|
|
150
|
+
// (container as Window).scrollY || (container as HTMLElement).scrollTop;
|
|
151
|
+
var currentScroll = container instanceof Window ? container.scrollY : container.scrollTop;
|
|
152
|
+
var scrollDelta = Math.abs(currentScroll - lastScrollPos.current);
|
|
153
|
+
if (scrollDelta > 10) {
|
|
154
|
+
if (!isMonitoring.current) {
|
|
155
|
+
startFrameCapture();
|
|
156
|
+
}
|
|
157
|
+
clearTimeout(scrollDebounceTimer.current);
|
|
158
|
+
scrollDebounceTimer.current = setTimeout(function () {
|
|
159
|
+
stopFrameCapture();
|
|
160
|
+
reportFrames();
|
|
161
|
+
}, 2000);
|
|
162
|
+
}
|
|
163
|
+
lastScrollPos.current = currentScroll;
|
|
164
|
+
};
|
|
165
|
+
container.addEventListener('scroll', handleScroll, {
|
|
166
|
+
passive: true
|
|
167
|
+
});
|
|
168
|
+
return function () {
|
|
169
|
+
container.removeEventListener('scroll', handleScroll);
|
|
170
|
+
stopFrameCapture();
|
|
171
|
+
};
|
|
172
|
+
}, [scrollContainerRef, startFrameCapture, stopFrameCapture, reportFrames, isEnabledSpmReporter]);
|
|
173
|
+
return {
|
|
174
|
+
frameData: frameData,
|
|
175
|
+
reportFrames: reportFrames
|
|
176
|
+
};
|
|
177
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@difizen/libro-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
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.15",
|
|
38
|
+
"@difizen/libro-common": "^0.3.15",
|
|
39
|
+
"@difizen/libro-shared-model": "^0.3.15",
|
|
40
|
+
"@difizen/libro-virtualized": "^0.3.15",
|
|
41
41
|
"@difizen/mana-app": "latest",
|
|
42
42
|
"@difizen/mana-l10n": "latest",
|
|
43
43
|
"@difizen/mana-react": "latest",
|
|
@@ -93,11 +93,11 @@ export class LibroCellView extends BaseView implements CellView {
|
|
|
93
93
|
) {
|
|
94
94
|
const cellTracker = (
|
|
95
95
|
this.cellService as LibroCellService
|
|
96
|
-
).libroViewTracker.
|
|
96
|
+
).libroViewTracker.getOrCreateTrackers({
|
|
97
97
|
id,
|
|
98
98
|
});
|
|
99
|
-
cellTracker
|
|
100
|
-
cellTracker
|
|
99
|
+
cellTracker['endTime'] = Date.now();
|
|
100
|
+
cellTracker['extra'].cellType = this.model.type;
|
|
101
101
|
(this.cellService as LibroCellService).libroViewTracker.tracker(cellTracker);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -110,11 +110,11 @@ export class LibroCellView extends BaseView implements CellView {
|
|
|
110
110
|
) {
|
|
111
111
|
const cellTracker = (
|
|
112
112
|
this.cellService as LibroCellService
|
|
113
|
-
).libroViewTracker.
|
|
113
|
+
).libroViewTracker.getOrCreateTrackers({
|
|
114
114
|
id,
|
|
115
115
|
});
|
|
116
|
-
cellTracker
|
|
117
|
-
cellTracker
|
|
116
|
+
cellTracker['endTime'] = Date.now();
|
|
117
|
+
cellTracker['extra'].cellType = this.model.type;
|
|
118
118
|
(this.cellService as LibroCellService).libroViewTracker.tracker(cellTracker);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -127,6 +127,30 @@ export abstract class LibroEditorCellView
|
|
|
127
127
|
if (e.status === 'ready') {
|
|
128
128
|
this.editor = this.editorView!.editor;
|
|
129
129
|
this.afterEditorReady();
|
|
130
|
+
if (this.parent.libroViewTracker.isEnabledSpmReporter) {
|
|
131
|
+
if (
|
|
132
|
+
this.parent.libroViewTracker.hasTracker(
|
|
133
|
+
this.parent.model.options['modelId'] || this.parent.model.options['id'],
|
|
134
|
+
)
|
|
135
|
+
) {
|
|
136
|
+
const libroTracker = this.parent.libroViewTracker.getOrCreateTrackers({
|
|
137
|
+
id:
|
|
138
|
+
this.parent.model.options['modelId'] || this.parent.model.options['id'],
|
|
139
|
+
});
|
|
140
|
+
libroTracker['endTime'] = Date.now();
|
|
141
|
+
libroTracker['extra'].cellsCount = this.parent.model.cells.length;
|
|
142
|
+
this.parent.libroViewTracker.tracker(libroTracker);
|
|
143
|
+
}
|
|
144
|
+
const id = this.options.id + this.parent.id + 'add';
|
|
145
|
+
if (this.options.id && this.parent.libroViewTracker.hasTracker(id)) {
|
|
146
|
+
const cellTracker = this.parent.libroViewTracker.getOrCreateTrackers({
|
|
147
|
+
id,
|
|
148
|
+
});
|
|
149
|
+
cellTracker['endTime'] = Date.now();
|
|
150
|
+
cellTracker['extra'].cellType = this.model.type;
|
|
151
|
+
this.parent.libroViewTracker.tracker(cellTracker);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
130
154
|
} else if (e.status === 'disposed') {
|
|
131
155
|
this.toDisposeOnEditor.dispose();
|
|
132
156
|
}
|
|
@@ -276,11 +276,11 @@ export class LibroCommandContribution implements CommandContribution {
|
|
|
276
276
|
libro.addCell(newCell, insertIndex);
|
|
277
277
|
if (this.libroViewTracker.isEnabledSpmReporter) {
|
|
278
278
|
const id = newCell.id + libro.id;
|
|
279
|
-
const libroTracker = this.libroViewTracker.
|
|
279
|
+
const libroTracker = this.libroViewTracker.getOrCreateTrackers({
|
|
280
280
|
id,
|
|
281
281
|
});
|
|
282
|
-
libroTracker
|
|
283
|
-
libroTracker
|
|
282
|
+
libroTracker['extra'].cellsCount = libro.model.cells.length;
|
|
283
|
+
libroTracker['extra'].cellOperation = 'add';
|
|
284
284
|
}
|
|
285
285
|
},
|
|
286
286
|
isVisible: (cell, libro, path) => {
|
package/src/libro-protocol.ts
CHANGED
package/src/libro-service.ts
CHANGED
|
@@ -144,17 +144,11 @@ export class LibroService implements NotebookService, Disposable {
|
|
|
144
144
|
return model;
|
|
145
145
|
}
|
|
146
146
|
async getOrCreateView(options: NotebookOption): Promise<NotebookView> {
|
|
147
|
-
if (this.libroViewTracker.isEnabledSpmReporter) {
|
|
148
|
-
this.libroViewTracker.getOrCreateSpmTracker({
|
|
149
|
-
id: options.modelId,
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
const model = this.getOrCreateModel(options);
|
|
153
147
|
const notebookViewPromise = this.viewManager.getOrCreateView<NotebookView>(
|
|
154
148
|
notebookViewFactoryId,
|
|
155
149
|
{
|
|
156
150
|
...(options || {}),
|
|
157
|
-
modelId:
|
|
151
|
+
modelId: options.modelId || options.id,
|
|
158
152
|
},
|
|
159
153
|
);
|
|
160
154
|
const notebookView = await notebookViewPromise;
|
|
@@ -46,38 +46,65 @@ export class Tracker implements ITracker {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
export class FpsTracker implements ITracker {
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
extra?: any;
|
|
52
|
+
id: string;
|
|
53
|
+
avgFPS: number;
|
|
54
|
+
maxFrameTime: number;
|
|
55
|
+
totalDropped: number;
|
|
56
|
+
|
|
57
|
+
constructor(id?: string, extra?: any) {
|
|
58
|
+
this.id = id || v4();
|
|
59
|
+
this.extra = extra || {};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
log() {
|
|
63
|
+
const result = {
|
|
64
|
+
id: this.id,
|
|
65
|
+
avgFPS: this.avgFPS,
|
|
66
|
+
maxFrameTime: this.maxFrameTime,
|
|
67
|
+
totalDropped: this.totalDropped,
|
|
68
|
+
extra: this.extra,
|
|
69
|
+
};
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
49
74
|
@singleton()
|
|
50
75
|
export class LibroViewTracker {
|
|
51
76
|
viewCache: Map<string, NotebookView> = new Map();
|
|
52
77
|
modelCache: Map<string, NotebookModel> = new Map();
|
|
53
|
-
|
|
78
|
+
trackers: Map<string, ITracker> = new Map();
|
|
54
79
|
isEnabledSpmReporter: boolean;
|
|
55
80
|
|
|
56
|
-
protected onTrackerEmitter: Emitter<
|
|
81
|
+
protected onTrackerEmitter: Emitter<Record<string, any>> = new Emitter();
|
|
57
82
|
get onTracker() {
|
|
58
83
|
return this.onTrackerEmitter.event;
|
|
59
84
|
}
|
|
60
85
|
|
|
61
|
-
|
|
86
|
+
getOrCreateTrackers(options: Options) {
|
|
62
87
|
const id = options.id || v4();
|
|
63
|
-
const exist = this.
|
|
88
|
+
const exist = this.trackers.get(id);
|
|
64
89
|
if (exist) {
|
|
65
|
-
if (!exist
|
|
66
|
-
exist
|
|
90
|
+
if (options['type'] !== 'fps' && !exist['startTime']) {
|
|
91
|
+
exist['startTime'] = Date.now();
|
|
67
92
|
}
|
|
68
93
|
return exist;
|
|
69
94
|
}
|
|
70
|
-
|
|
71
|
-
|
|
95
|
+
|
|
96
|
+
const tracker = options['type'] === 'fps' ? new FpsTracker(id) : new Tracker(id);
|
|
97
|
+
this.trackers.set(id, tracker);
|
|
72
98
|
return tracker;
|
|
73
99
|
}
|
|
74
100
|
|
|
75
|
-
tracker(tracker:
|
|
101
|
+
tracker(tracker: ITracker) {
|
|
76
102
|
const trackerLog = tracker.log();
|
|
103
|
+
this.trackers.delete(tracker.id);
|
|
77
104
|
this.onTrackerEmitter.fire(trackerLog);
|
|
78
105
|
}
|
|
79
106
|
|
|
80
107
|
hasTracker(id: string) {
|
|
81
|
-
return this.
|
|
108
|
+
return this.trackers.has(id);
|
|
82
109
|
}
|
|
83
110
|
}
|
package/src/libro-view.tsx
CHANGED
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
} from './libro-setting.js';
|
|
65
65
|
import { LibroViewTracker } from './libro-view-tracker.js';
|
|
66
66
|
import { LibroSlotManager, LibroSlotView } from './slot/index.js';
|
|
67
|
-
import { useSize } from './utils/index.js';
|
|
67
|
+
import { useFrameMonitor, useSize } from './utils/index.js';
|
|
68
68
|
import { VirtualizedManagerHelper } from './virtualized-manager-helper.js';
|
|
69
69
|
import type { VirtualizedManager } from './virtualized-manager.js';
|
|
70
70
|
import './index.less';
|
|
@@ -84,6 +84,19 @@ export const LibroContentComponent = memo(function LibroContentComponent() {
|
|
|
84
84
|
const HeaderRender = getOrigin(instance.headerRender);
|
|
85
85
|
const [headerVisible] = useConfigurationValue(HeaderToolbarVisible);
|
|
86
86
|
const [rightContentFixed] = useConfigurationValue(RightContentFixed);
|
|
87
|
+
useFrameMonitor(
|
|
88
|
+
libroViewContentRef,
|
|
89
|
+
instance.libroViewTracker.isEnabledSpmReporter,
|
|
90
|
+
(payload) => {
|
|
91
|
+
const fpsTracker = instance.libroViewTracker.getOrCreateTrackers({ type: 'fps' });
|
|
92
|
+
fpsTracker['avgFPS'] = payload.summary.avgFPS;
|
|
93
|
+
fpsTracker['maxFrameTime'] = payload.summary.maxFrameTime;
|
|
94
|
+
fpsTracker['totalDropped'] = payload.summary.totalDropped;
|
|
95
|
+
fpsTracker['extra'] = payload.frames;
|
|
96
|
+
fpsTracker['cells'] = instance.model.cells.length;
|
|
97
|
+
instance.libroViewTracker.tracker(fpsTracker);
|
|
98
|
+
},
|
|
99
|
+
);
|
|
87
100
|
|
|
88
101
|
const handleScroll = useCallback(() => {
|
|
89
102
|
instance.cellScrollEmitter.fire();
|
|
@@ -326,7 +339,7 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
326
339
|
@inject(LibroService) libroService: LibroService;
|
|
327
340
|
@inject(LibroSlotManager) libroSlotManager: LibroSlotManager;
|
|
328
341
|
@inject(LibroContextKey) contextKey: LibroContextKey;
|
|
329
|
-
@inject(LibroViewTracker)
|
|
342
|
+
@inject(LibroViewTracker) libroViewTracker: LibroViewTracker;
|
|
330
343
|
@inject(ViewManager) protected viewManager: ViewManager;
|
|
331
344
|
@inject(ConfigurationService) protected configurationService: ConfigurationService;
|
|
332
345
|
|
|
@@ -351,6 +364,8 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
351
364
|
@prop()
|
|
352
365
|
saving?: boolean;
|
|
353
366
|
|
|
367
|
+
options: NotebookOption;
|
|
368
|
+
|
|
354
369
|
onSaveEmitter: Emitter<boolean> = new Emitter();
|
|
355
370
|
get onSave() {
|
|
356
371
|
return this.onSaveEmitter.event;
|
|
@@ -387,6 +402,7 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
387
402
|
if (options.id) {
|
|
388
403
|
this.id = options.id;
|
|
389
404
|
}
|
|
405
|
+
this.options = options;
|
|
390
406
|
this.notebookService = notebookService;
|
|
391
407
|
this.model = this.notebookService.getOrCreateModel(options);
|
|
392
408
|
this.collapseService = collapseServiceFactory({ view: this });
|
|
@@ -454,14 +470,6 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
454
470
|
this.model.onChange?.();
|
|
455
471
|
}),
|
|
456
472
|
);
|
|
457
|
-
if (this.libroViewTracker.isEnabledSpmReporter) {
|
|
458
|
-
const libroTracker = this.libroViewTracker.getOrCreateSpmTracker({
|
|
459
|
-
id: this.model.id,
|
|
460
|
-
});
|
|
461
|
-
libroTracker.endTime = Date.now();
|
|
462
|
-
libroTracker.extra.cellsCount = this.model.cells.length;
|
|
463
|
-
this.libroViewTracker.tracker(libroTracker);
|
|
464
|
-
}
|
|
465
473
|
this.initializedDefer.resolve();
|
|
466
474
|
}, 0);
|
|
467
475
|
}
|
|
@@ -471,7 +479,11 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
471
479
|
override onViewMount = () => {
|
|
472
480
|
this.libroService.active = this;
|
|
473
481
|
this.libroSlotManager.setup(this);
|
|
474
|
-
|
|
482
|
+
if (this.libroViewTracker.isEnabledSpmReporter) {
|
|
483
|
+
this.libroViewTracker.getOrCreateTrackers({
|
|
484
|
+
id: this.options.modelId || this.options.id,
|
|
485
|
+
});
|
|
486
|
+
}
|
|
475
487
|
// this.libroService.libroPerformanceStatistics.setRenderEnd(new Date());
|
|
476
488
|
|
|
477
489
|
// console.log(
|
|
@@ -530,11 +542,11 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
530
542
|
addCell = async (option: CellOptions, position?: number) => {
|
|
531
543
|
if (this.libroViewTracker.isEnabledSpmReporter && option.id) {
|
|
532
544
|
const id = option.id + this.id;
|
|
533
|
-
const libroTracker = this.libroViewTracker.
|
|
545
|
+
const libroTracker = this.libroViewTracker.getOrCreateTrackers({
|
|
534
546
|
id: id + 'add',
|
|
535
547
|
});
|
|
536
|
-
libroTracker
|
|
537
|
-
libroTracker
|
|
548
|
+
libroTracker['extra'].cellsCount = this.model.cells.length;
|
|
549
|
+
libroTracker['extra'].cellOperation = 'add';
|
|
538
550
|
}
|
|
539
551
|
const cellView = await this.getCellViewByOption(option);
|
|
540
552
|
this.model.addCell(cellView, position);
|
|
@@ -543,11 +555,11 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
543
555
|
addCellAbove = async (option: CellOptions, position?: number) => {
|
|
544
556
|
if (this.libroViewTracker.isEnabledSpmReporter && option.id) {
|
|
545
557
|
const id = option.id + this.id;
|
|
546
|
-
const libroTracker = this.libroViewTracker.
|
|
558
|
+
const libroTracker = this.libroViewTracker.getOrCreateTrackers({
|
|
547
559
|
id: id + 'add',
|
|
548
560
|
});
|
|
549
|
-
libroTracker
|
|
550
|
-
libroTracker
|
|
561
|
+
libroTracker['extra'].cellsCount = this.model.cells.length;
|
|
562
|
+
libroTracker['extra'].cellOperation = 'add';
|
|
551
563
|
}
|
|
552
564
|
const cellView = await this.getCellViewByOption(option);
|
|
553
565
|
this.model.addCell(cellView, position, 'above');
|
|
@@ -575,11 +587,11 @@ export class LibroView extends BaseView implements NotebookView {
|
|
|
575
587
|
deleteCell = (cell: CellView) => {
|
|
576
588
|
if (this.libroViewTracker.isEnabledSpmReporter && cell.model.id) {
|
|
577
589
|
const id = cell.model.id + this.id;
|
|
578
|
-
const libroTracker = this.libroViewTracker.
|
|
590
|
+
const libroTracker = this.libroViewTracker.getOrCreateTrackers({
|
|
579
591
|
id: id + 'delete',
|
|
580
592
|
});
|
|
581
|
-
libroTracker
|
|
582
|
-
libroTracker
|
|
593
|
+
libroTracker['extra'].cellsCount = this.model.cells.length;
|
|
594
|
+
libroTracker['extra'].cellOperation = 'delete';
|
|
583
595
|
}
|
|
584
596
|
const deleteIndex = this.model.getCells().findIndex((item) => {
|
|
585
597
|
return equals(item, cell);
|
package/src/utils/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useUnmount } from '@difizen/mana-app';
|
|
2
2
|
import type { RefObject } from 'react';
|
|
3
|
+
import { useEffect } from 'react';
|
|
3
4
|
import { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
4
5
|
|
|
5
6
|
function useRafState<S>(initialState?: S) {
|
|
@@ -46,3 +47,144 @@ export function useSize(ref: RefObject<HTMLDivElement>): Size | undefined {
|
|
|
46
47
|
}, [ref, setSize]);
|
|
47
48
|
return size;
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
interface FrameMetrics {
|
|
52
|
+
timestamp: number;
|
|
53
|
+
fps: number;
|
|
54
|
+
frameTime: number;
|
|
55
|
+
droppedFrames: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const useFrameMonitor = (
|
|
59
|
+
scrollContainerRef: React.RefObject<HTMLElement>,
|
|
60
|
+
isEnabledSpmReporter: boolean,
|
|
61
|
+
onReport?: (payload: { frames: FrameMetrics[]; summary: any }) => void,
|
|
62
|
+
) => {
|
|
63
|
+
const frameData = useRef<FrameMetrics[]>([]);
|
|
64
|
+
const lastFrameTime = useRef(performance.now());
|
|
65
|
+
const frameCount = useRef(0);
|
|
66
|
+
const lastScrollPos = useRef(0);
|
|
67
|
+
const rafId = useRef<number>();
|
|
68
|
+
const isMonitoring = useRef(false);
|
|
69
|
+
// const reportTimeout = useRef<NodeJS.Timeout>();
|
|
70
|
+
const intervalId = useRef<NodeJS.Timeout>();
|
|
71
|
+
const scrollDebounceTimer = useRef<NodeJS.Timeout>();
|
|
72
|
+
|
|
73
|
+
const stopFrameCapture = useCallback(() => {
|
|
74
|
+
if (rafId.current) {
|
|
75
|
+
cancelAnimationFrame(rafId.current);
|
|
76
|
+
}
|
|
77
|
+
if (intervalId.current) {
|
|
78
|
+
clearInterval(intervalId.current);
|
|
79
|
+
}
|
|
80
|
+
isMonitoring.current = false;
|
|
81
|
+
frameCount.current = 0;
|
|
82
|
+
lastFrameTime.current = performance.now();
|
|
83
|
+
}, []);
|
|
84
|
+
|
|
85
|
+
const startFrameCapture = useCallback(() => {
|
|
86
|
+
if (isMonitoring.current) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const calculateFPS = () => {
|
|
91
|
+
if (!isMonitoring.current) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const now = performance.now();
|
|
95
|
+
const delta = now - lastFrameTime.current;
|
|
96
|
+
frameData.current.push({
|
|
97
|
+
timestamp: now,
|
|
98
|
+
fps: Math.round((frameCount.current * 1000) / delta),
|
|
99
|
+
frameTime: delta / frameCount.current,
|
|
100
|
+
droppedFrames: Math.max(0, Math.floor(delta / 16.67) - frameCount.current),
|
|
101
|
+
});
|
|
102
|
+
lastFrameTime.current = now;
|
|
103
|
+
frameCount.current = 0;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const loop = () => {
|
|
107
|
+
if (isMonitoring.current) {
|
|
108
|
+
frameCount.current++;
|
|
109
|
+
rafId.current = requestAnimationFrame(loop);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
isMonitoring.current = true;
|
|
114
|
+
frameCount.current = 0;
|
|
115
|
+
lastFrameTime.current = performance.now();
|
|
116
|
+
|
|
117
|
+
if (intervalId.current) {
|
|
118
|
+
clearInterval(intervalId.current);
|
|
119
|
+
}
|
|
120
|
+
intervalId.current = setInterval(calculateFPS, 1500); // 每秒生成一个数据点
|
|
121
|
+
rafId.current = requestAnimationFrame(loop);
|
|
122
|
+
}, []);
|
|
123
|
+
|
|
124
|
+
const reportFrames = useCallback(() => {
|
|
125
|
+
if (frameData.current.length === 0) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const send = () => {
|
|
130
|
+
const payload = {
|
|
131
|
+
frames: frameData.current,
|
|
132
|
+
summary: {
|
|
133
|
+
avgFPS:
|
|
134
|
+
frameData.current.reduce((a, b) => a + b.fps, 0) / frameData.current.length,
|
|
135
|
+
maxFrameTime: Math.max(...frameData.current.map((f) => f.frameTime)),
|
|
136
|
+
totalDropped: frameData.current.reduce((a, b) => a + b.droppedFrames, 0),
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
if (onReport) {
|
|
140
|
+
onReport(payload); // 触发外部回调
|
|
141
|
+
}
|
|
142
|
+
frameData.current = [];
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
requestIdleCallback(send, { timeout: 1000 }) || setTimeout(send, 0);
|
|
146
|
+
}, [onReport]); // 添加 onReport 依赖
|
|
147
|
+
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
if (!isEnabledSpmReporter) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const container = scrollContainerRef.current || (window as unknown as HTMLElement);
|
|
153
|
+
|
|
154
|
+
const handleScroll = () => {
|
|
155
|
+
// const currentScroll =
|
|
156
|
+
// (container as Window).scrollY || (container as HTMLElement).scrollTop;
|
|
157
|
+
const currentScroll =
|
|
158
|
+
container instanceof Window ? container.scrollY : container.scrollTop;
|
|
159
|
+
const scrollDelta = Math.abs(currentScroll - lastScrollPos.current);
|
|
160
|
+
|
|
161
|
+
if (scrollDelta > 10) {
|
|
162
|
+
if (!isMonitoring.current) {
|
|
163
|
+
startFrameCapture();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
clearTimeout(scrollDebounceTimer.current);
|
|
167
|
+
scrollDebounceTimer.current = setTimeout(() => {
|
|
168
|
+
stopFrameCapture();
|
|
169
|
+
reportFrames();
|
|
170
|
+
}, 2000);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
lastScrollPos.current = currentScroll;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
container.addEventListener('scroll', handleScroll, { passive: true });
|
|
177
|
+
return () => {
|
|
178
|
+
container.removeEventListener('scroll', handleScroll);
|
|
179
|
+
stopFrameCapture();
|
|
180
|
+
};
|
|
181
|
+
}, [
|
|
182
|
+
scrollContainerRef,
|
|
183
|
+
startFrameCapture,
|
|
184
|
+
stopFrameCapture,
|
|
185
|
+
reportFrames,
|
|
186
|
+
isEnabledSpmReporter,
|
|
187
|
+
]);
|
|
188
|
+
|
|
189
|
+
return { frameData, reportFrames };
|
|
190
|
+
};
|