|
187 | 187 | DevToolMessageEnum["changed"] = "changed"; |
188 | 188 | DevToolMessageEnum["highlight"] = "highlight"; |
189 | 189 | DevToolMessageEnum["trigger"] = "trigger"; |
| 190 | + DevToolMessageEnum["running"] = "running"; |
190 | 191 | DevToolMessageEnum["triggerStatus"] = "triggerStatus"; |
191 | 192 | DevToolMessageEnum["hmr"] = "hmr"; |
192 | 193 | DevToolMessageEnum["hmrStatus"] = "hmrStatus"; |
|
3135 | 3136 | DevToolMessageEnum["changed"] = "changed"; |
3136 | 3137 | DevToolMessageEnum["highlight"] = "highlight"; |
3137 | 3138 | DevToolMessageEnum["trigger"] = "trigger"; |
| 3139 | + DevToolMessageEnum["running"] = "running"; |
3138 | 3140 | DevToolMessageEnum["triggerStatus"] = "triggerStatus"; |
3139 | 3141 | DevToolMessageEnum["hmr"] = "hmr"; |
3140 | 3142 | DevToolMessageEnum["hmrStatus"] = "hmrStatus"; |
|
3162 | 3164 | var DevToolSource = "@my-react/devtool"; |
3163 | 3165 |
|
3164 | 3166 | var patchEvent = function (dispatch, runtime) { |
3165 | | - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; |
| 3167 | + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; |
3166 | 3168 | if (dispatch["$$hasDevToolEvent"]) |
3167 | 3169 | return; |
3168 | 3170 | dispatch["$$hasDevToolEvent"] = true; |
|
3283 | 3285 | runtime._error[id].push(args); |
3284 | 3286 | runtime.notifyError(); |
3285 | 3287 | }; |
| 3288 | + var onFiberRun = function (fiber) { |
| 3289 | + var id = getPlainNodeIdByFiber(fiber); |
| 3290 | + if (!id) |
| 3291 | + return; |
| 3292 | + if (!runtime._selectNode) |
| 3293 | + return; |
| 3294 | + var selectTree = runtime._selectNode._t || []; |
| 3295 | + if (!selectTree.includes(id)) |
| 3296 | + return; |
| 3297 | + runtime.notifyRunning(id); |
| 3298 | + }; |
3286 | 3299 | var onPerformanceWarn = function (fiber) { |
3287 | 3300 | var id = getPlainNodeIdByFiber(fiber); |
3288 | 3301 | if (!id) |
|
3323 | 3336 | (_d = dispatch.onPerformanceWarn) === null || _d === void 0 ? void 0 : _d.call(dispatch, onPerformanceWarn); |
3324 | 3337 | (_e = dispatch.onFiberChange) === null || _e === void 0 ? void 0 : _e.call(dispatch, onChange); |
3325 | 3338 | (_f = dispatch.onFiberUpdate) === null || _f === void 0 ? void 0 : _f.call(dispatch, onFiberUpdate); |
3326 | | - (_g = dispatch.onFiberHMR) === null || _g === void 0 ? void 0 : _g.call(dispatch, onFiberHMR); |
3327 | | - (_h = dispatch.onDOMUpdate) === null || _h === void 0 ? void 0 : _h.call(dispatch, onDOMUpdate); |
3328 | | - (_j = dispatch.onDOMAppend) === null || _j === void 0 ? void 0 : _j.call(dispatch, onDOMAppend); |
3329 | | - (_k = dispatch.onDOMSetRef) === null || _k === void 0 ? void 0 : _k.call(dispatch, onDOMSetRef); |
3330 | | - (_l = dispatch.onFiberError) === null || _l === void 0 ? void 0 : _l.call(dispatch, onFiberError); |
3331 | | - (_m = dispatch.onFiberWarn) === null || _m === void 0 ? void 0 : _m.call(dispatch, onFiberWarn); |
| 3339 | + (_g = dispatch.onAfterFiberRun) === null || _g === void 0 ? void 0 : _g.call(dispatch, onFiberRun); |
| 3340 | + (_h = dispatch.onFiberHMR) === null || _h === void 0 ? void 0 : _h.call(dispatch, onFiberHMR); |
| 3341 | + (_j = dispatch.onDOMUpdate) === null || _j === void 0 ? void 0 : _j.call(dispatch, onDOMUpdate); |
| 3342 | + (_k = dispatch.onDOMAppend) === null || _k === void 0 ? void 0 : _k.call(dispatch, onDOMAppend); |
| 3343 | + (_l = dispatch.onDOMSetRef) === null || _l === void 0 ? void 0 : _l.call(dispatch, onDOMSetRef); |
| 3344 | + (_m = dispatch.onFiberError) === null || _m === void 0 ? void 0 : _m.call(dispatch, onFiberError); |
| 3345 | + (_o = dispatch.onFiberWarn) === null || _o === void 0 ? void 0 : _o.call(dispatch, onFiberWarn); |
3332 | 3346 | } |
3333 | 3347 | else { |
3334 | 3348 | var originalAfterCommit_1 = dispatch.afterCommit; |
|
4048 | 4062 | function initialize() { |
4049 | 4063 | canvas = window.document.createElement("canvas"); |
4050 | 4064 | canvas.setAttribute("popover", "manual"); |
4051 | | - canvas.style.cssText = "\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n background-color: transparent;\n outline: none;\n box-shadow: none;\n border: none;\n "; |
| 4065 | + canvas.style.cssText = "\n xx-background-color: red;\n xx-opacity: 0.5;\n bottom: 0;\n left: 0;\n pointer-events: none;\n position: fixed;\n right: 0;\n top: 0;\n padding: 0;\n background-color: transparent;\n outline: none;\n box-shadow: none;\n border: none;\n "; |
4052 | 4066 | canvas.setAttribute("data-update", "@my-react"); |
4053 | 4067 | var root = window.document.documentElement; |
4054 | 4068 | root.insertBefore(canvas, root.firstChild); |
|
4192 | 4206 | this._hoverId = ""; |
4193 | 4207 | this._selectId = ""; |
4194 | 4208 | this._selectDom = null; |
| 4209 | + this._selectNode = null; |
4195 | 4210 | this._hasSelectChange = false; |
4196 | 4211 | this._tempDomHoverId = ""; |
4197 | 4212 | this._domHoverId = ""; |
|
4489 | 4504 | return; |
4490 | 4505 | var fiber = getFiberNodeById(id); |
4491 | 4506 | if (fiber) { |
4492 | | - this._notify({ type: exports.DevToolMessageEnum.detail, data: inspectFiber(fiber) }); |
| 4507 | + var detailNode = inspectFiber(fiber); |
| 4508 | + this._selectNode = detailNode; |
| 4509 | + this._notify({ type: exports.DevToolMessageEnum.detail, data: detailNode }); |
4493 | 4510 | } |
4494 | 4511 | else { |
4495 | 4512 | this._notify({ type: exports.DevToolMessageEnum.detail, data: null }); |
4496 | 4513 | } |
4497 | 4514 | }; |
| 4515 | + DevToolCore.prototype.notifyRunning = function (id) { |
| 4516 | + if (!this.hasEnable) |
| 4517 | + return; |
| 4518 | + this._notify({ type: exports.DevToolMessageEnum.running, data: id }); |
| 4519 | + }; |
4498 | 4520 | DevToolCore.prototype.notifySelectSync = function () { |
4499 | 4521 | if (!this.hasEnable) |
4500 | 4522 | return; |
|
0 commit comments