@modern-js/devtools-client 2.58.0 → 2.58.2

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.
Files changed (51) hide show
  1. package/dist/modern.config.json +1 -279
  2. package/dist/public/sw-proxy.js +1 -1
  3. package/dist/routes-manifest.json +86 -86
  4. package/dist/static/html/client/index.html +3 -3
  5. package/dist/static/html/mount/index.html +3 -3
  6. package/dist/static/js/{130.a055ee6f.js → 130.4d7909c0.js} +1 -1
  7. package/dist/static/js/456.1b493c94.js +18 -0
  8. package/dist/static/js/{37.3b6855a6.js → 528.0757a5be.js} +3 -3
  9. package/dist/static/js/async/client_config/(toolkit).(type)/{page.f4f25669.js → page.e44d0d9c.js} +1 -1
  10. package/dist/static/js/async/client_context/builder/{page.fa63dd48.js → page.f7717f3f.js} +1 -1
  11. package/dist/static/js/async/client_context/framework/{page.1e92d092.js → page.5ccc0a92.js} +1 -1
  12. package/dist/static/js/async/client_doctor/{page.1bce9053.js → page.298f37a3.js} +1 -1
  13. package/dist/static/js/async/client_headers/editor/page.1683de25.js +1 -0
  14. package/dist/static/js/async/client_headers/welcome/page.3c8b3f1b.js +1 -0
  15. package/dist/static/js/async/client_overview/page.5e39c429.js +1 -0
  16. package/dist/static/js/async/client_pages/{page.a4020deb.js → page.47f412c0.js} +1 -1
  17. package/dist/static/js/async/client_react/offscreen/page.eea7ad51.js +1 -0
  18. package/dist/static/js/async/client_storage/preset/(id)/{page.d9ba689e.js → page.809f2586.js} +1 -1
  19. package/dist/static/js/async/client_storage/preset/layout.c9ad0e98.js +1 -0
  20. package/dist/static/js/async/client_storage/preset/page.ff5bddca.js +1 -0
  21. package/dist/static/js/{builder-runtime.694bc54b.js → builder-runtime.c254aec0.js} +1 -1
  22. package/dist/static/js/client.bd139d6f.js +1 -0
  23. package/dist/static/js/components.4fa01740.js +1 -0
  24. package/dist/static/js/lib-polyfill.04944fd7.js +1 -0
  25. package/dist/static/js/mount.691cfe25.js +1 -0
  26. package/package.json +12 -14
  27. package/dist/static/js/396.3a03c91e.js +0 -18
  28. package/dist/static/js/async/client_headers/editor/page.4194fbba.js +0 -1
  29. package/dist/static/js/async/client_headers/welcome/page.7fec5e79.js +0 -1
  30. package/dist/static/js/async/client_overview/page.8f02d776.js +0 -1
  31. package/dist/static/js/async/client_react/offscreen/page.2511e7a7.js +0 -1
  32. package/dist/static/js/async/client_storage/preset/layout.f6253a54.js +0 -1
  33. package/dist/static/js/async/client_storage/preset/page.4f048c94.js +0 -1
  34. package/dist/static/js/client.28c8f27c.js +0 -1
  35. package/dist/static/js/components.75879e60.js +0 -1
  36. package/dist/static/js/lib-polyfill.3df5a348.js +0 -1
  37. package/dist/static/js/mount.02a9d3ac.js +0 -1
  38. /package/dist/static/css/{396.861d0891.css → 456.dd13d5e1.css} +0 -0
  39. /package/dist/static/css/{37.e744b37c.css → 528.09221f91.css} +0 -0
  40. /package/dist/static/css/async/client_doctor/{page.f1527f16.css → page.7495ae2e.css} +0 -0
  41. /package/dist/static/css/async/client_headers/editor/{page.47215f0e.css → page.eefd3ad3.css} +0 -0
  42. /package/dist/static/css/async/client_overview/{page.a2667b2a.css → page.1124d48a.css} +0 -0
  43. /package/dist/static/css/async/client_pages/{page.1e9bbc9d.css → page.b278053d.css} +0 -0
  44. /package/dist/static/css/async/client_storage/preset/(id)/{page.79a266f3.css → page.24f1112c.css} +0 -0
  45. /package/dist/static/css/async/client_storage/preset/{layout.d4eb2799.css → layout.2aa19b14.css} +0 -0
  46. /package/dist/static/css/async/client_storage/preset/{page.d4eb2799.css → page.2aa19b14.css} +0 -0
  47. /package/dist/static/css/{client.d5e84e85.css → client.ac9f19d9.css} +0 -0
  48. /package/dist/static/css/{components.41191267.css → components.625b4936.css} +0 -0
  49. /package/dist/static/css/{mount.8fe89093.css → mount.cff5017b.css} +0 -0
  50. /package/dist/static/js/{396.3a03c91e.js.LICENSE.txt → 456.1b493c94.js.LICENSE.txt} +0 -0
  51. /package/dist/static/js/{37.3b6855a6.js.LICENSE.txt → 528.0757a5be.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkmodernjsDevtools=self.webpackChunkmodernjsDevtools||[]).push([["400"],{96747:function(e,t,o){var n=o("86834"),l=o("789"),r=o("74679"),i=o("10487"),s=o("88739"),a=o("65872"),c=o("9880"),d=o.n(c),u=o("81733"),m=o("57662"),v=o("52493"),h=o.n(v),p=o("64542");let y=i.MessagePortChannel.wait(window,"channel:connect:client"),f=new p.S,g=(0,m.createBridge)(window,f),w=y.then(e=>{let t=(0,a.Hu)();return{remote:(0,s.Fu)({async activateReactDevtools(){(0,m.activate)(window,{bridge:g})},async onFinishRender(){await t.callHook("onFinishRender")},async cookies(e){let t=await fetch("/__devtools/api/cookies",{method:"POST",body:JSON.stringify({setCookies:e})}),{cookies:n}=await t.json();if(!n||"object"!=typeof n)throw TypeError("No cookies returned from server");let{parse:l}=await o.e("883").then(o.bind(o,10851)),r=l(document.cookie),i=h().omit(n,Object.keys(r));return{client:r,server:i}},localStorage:async e=>(h().each(e,(e,t)=>{window.localStorage.setItem(t,e)}),(0,l._)({},window.localStorage)),sessionStorage:async e=>(h().each(e,(e,t)=>{window.sessionStorage.setItem(t,e)}),(0,l._)({},window.sessionStorage))},(0,r._)((0,l._)({},e.handlers),{timeout:500})),hooks:t}}),k=(0,u.sj)({loaded:!1}),b=d()();w.then(e=>{let{remote:t,hooks:o}=e;f.bindRemote(t,"sendReactDevtoolsData"),o.hook("onFinishRender",async()=>{k.loaded=!0,b.resolve()})});var _=o("60182");let j="container-bYVevn";var x=o("12320"),C=o("5872"),E=o("56573"),Z=o("71161"),N=o("36339"),R=o("29214");let S=e=>{var t;let o=null===(t=e.keepAlive)||void 0===t||t,{when:l}=e,r=(0,C.useRef)(!1);l&&(r.current=!0);let i=e.load||(o?r.current:l);return i?(0,n.jsx)("div",{style:{display:!o||l?"unset":"none"},children:e.children}):null};var D=o("93037"),P=o("45230"),T=o("79197"),H=o("9768"),Y=o("22296");let B=e=>{var{src:t,onClose:o}=e,i=(0,P._)(e,["src","onClose"]);let{loaded:s}=(0,T.R)(k);return(0,n.jsxs)(x.xu,(0,r._)((0,l._)({className:Y.Z.container},i),{children:[(0,n.jsx)("iframe",{className:Y.Z.frame,src:t}),(0,n.jsx)(R.cu3,{className:Y.Z.closeButton,onClick:o}),(0,n.jsx)("div",{className:Y.Z.backdrop,style:{display:s?"none":void 0},children:(0,n.jsx)(H.g,{})})]}))};var I=o("43730"),L=o("14609");let O=e=>{var t;let[o,l]=(0,I.Z)(()=>Promise.resolve(e.onClick()),[]);return(0,n.jsx)("button",{className:L.Z.container,onClick:l,"data-type":null!==(t=e.type)&&void 0!==t?t:"default",disabled:o.loading,children:e.children})},X=(e,t)=>{var o,n;return null!==(n=null===(o=({top:["left","right"],bottom:["left","right"],left:["top","bottom"],right:["top","bottom"]})[e])||void 0===o?void 0:o.includes(t))&&void 0!==n&&n},U=e=>{let[t,...o]=[{key:"top",value:e.top},{key:"bottom",value:e.bottom},{key:"left",value:e.left},{key:"right",value:e.right}].sort((e,t)=>e.value-t.value),n=o.findIndex(e=>{let{key:o}=e;return X(t.key,o)}),[l]=o.splice(n,1);return[t,l,o[0],o[1]]},F=e=>{let{top:t,left:o,height:n,width:l}=e.getBoundingClientRect();return{top:t,left:o,bottom:window.innerHeight-t-n,right:window.innerWidth-o-l}},W=e=>{var t;let o=null!==(t=null==e?void 0:e.margin)&&void 0!==t?t:"10px",n="number"==typeof o?"".concat(o,"px"):o,[l,r]=(0,C.useState)(),i=()=>{if(!l)return;l.moveable=!1;let{el:e}=l,[t]=U(F(e));e.style.transition="".concat(t.key," 200ms"),requestIdleCallback(()=>{r(void 0),e.style[t.key]=n}),e.addEventListener("transitionend",()=>e.style.transition="",{once:!0})},s=t=>{let o="touches"in t?t.touches[0]:t;if(!(null==l?void 0:l.moveable))return;let{startX:r,startY:i}=l;(r-o.clientX)**2+(i-o.clientY)**2>9&&(l.clickable=!1);let{width:s,height:a}=l.el.getBoundingClientRect(),c=o.clientY-l.offsetY,d=o.clientX-l.offsetX,u=U({top:c,left:d,bottom:window.innerHeight-c-a,right:window.innerWidth-d-s}).map(e=>{let{key:t,value:o}=e;return{key:t,value:"".concat(o,"px")}});if(null==e?void 0:e.clamp)for(let e of u){let t=["top","bottom"].includes(e.key)?window.innerHeight-a:window.innerWidth-s;e.value="clamp(".concat(n,", ").concat(e.value,", ").concat(t,"px)")}let[m,v,...h]=u,{style:p}=l.el;p.transition="",p[m.key]=m.value,p[v.key]=v.value,p[h[0].key]="auto",p[h[1].key]="auto"};(0,Z.Z)("blur",i),(0,Z.Z)("mouseup",i),(0,Z.Z)("touchend",i),(0,Z.Z)("mousemove",s),(0,Z.Z)("touchmove",s);let a=e=>{let t="touches"in e?e.touches[0]:e,o=e.currentTarget,n=o.getBoundingClientRect(),l=t.clientX-n.left;r({el:o,clickable:!0,moveable:!0,offsetX:l,offsetY:t.clientY-n.top,startX:t.clientX,startY:t.clientY})};return{isDragging:!!l,props:{onMouseDown:a,onTouchStart:a,onClickCapture:e=>{(null==l?void 0:l.clickable)||e.stopPropagation()}}}},K=(e,t)=>new Promise((o,n)=>{let l=!0,r=setTimeout(()=>{l=!1,n(Error("Promise Timeout"))},t);e.then(e=>{l&&o(e),clearTimeout(r)}),e.catch(n)});var M=o("97137");let A=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,{hash:o}=t,n=null===(e=o.match(/^#\/__devtools(.*)/))||void 0===e?void 0:e[1];return"string"!=typeof n?null:""===n?"/":n},q=e=>{let t=A(),[o,i]=(0,E.Z)(!!t),[s,a]=(0,C.useState)(!1),c=W({clamp:!0}),[d]=(0,M.U)();(0,Z.Z)("keydown",e=>{e.shiftKey&&e.altKey&&"KeyD"===e.code&&i()}),(0,C.useEffect)(()=>{f.hook("receive",e=>{"startInspectingNative"===e.event&&(i(!1),document.documentElement.style.setProperty("cursor","cell"))});let e=e=>{"stopInspectingNative"===e.event&&(i(!0),document.documentElement.style.removeProperty("cursor"))};return f.hook("send",e),()=>{f.removeHook("send",e)}},[]);let u=async()=>{document.documentElement.style.setProperty("cursor","wait"),i(!1),a(!0);try{(await K(w,1e4)).remote.pullUp("/react/components#inspecting")}catch(e){console.error(e),document.documentElement.style.removeProperty("cursor")}};return(0,N.Z)(async()=>{if(!!t)(await K(w,1e4)).remote.pullUp(t)},[]),(0,n.jsxs)(x.Q2,{appearance:d,className:d,hasBackground:!1,style:{height:0,width:0,minHeight:0,minWidth:0},children:[(0,n.jsx)(S,{when:o,keepAlive:!0,load:s,children:(0,n.jsx)("div",{className:D.Z.container,children:(0,n.jsx)(B,{src:e.src,onClose:()=>i(!1),style:{pointerEvents:c.isDragging?"none":"auto"}})})}),(0,n.jsxs)(x.kC,(0,r._)((0,l._)({className:D.Z.fab},c.props),{align:"center",children:[(0,n.jsx)(O,{type:"primary",onClick:i,children:(0,n.jsx)("img",{className:D.Z.logo,src:e.logo})}),(0,n.jsx)(O,{onClick:u,children:(0,n.jsx)(R.aur,{})})]}))]})},J=()=>{let e=window.__modern_js_devtools_manifest;if(!e)throw TypeError("Devtools manifest is not found");let t=e.client;if(!t)throw TypeError("Devtools client source is not found");let o=e.source,l=new URL(t,location.href);if(o){let e=new URL(o,location.href);l.searchParams.set("src",e.href)}return(0,n.jsx)(q,{logo:e.context.def.assets.logo,src:l.href})},Q=()=>{let e=document.createElement("div");e.className="_modern_js_devtools_container",document.body.appendChild(e);let t=e.attachShadow({mode:"closed"}),o=document.getElementById("_modern_js_devtools_styles");if(!(o instanceof HTMLTemplateElement))throw Error("template not found");t.appendChild(o.content);let l=document.createElement("div");l.classList.add("_modern_js_devtools_mountpoint","theme-register",j),t.appendChild(l),(0,_.createRoot)(l).render((0,n.jsx)(J,{}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Q):Q()}},function(e){var t=function(t){return e(e.s=t)};e.O(0,["126","130","456","567","58","707","991"],function(){return t("5256"),t("78197"),t("9835"),t("28651"),t("96747")}),e.O()}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/devtools-client",
3
- "version": "2.58.0",
3
+ "version": "2.58.2",
4
4
  "engines": {
5
5
  "node": ">=14.0.0"
6
6
  },
@@ -21,8 +21,9 @@
21
21
  "@radix-ui/react-icons": "^1.3.0",
22
22
  "@radix-ui/react-popover": "^1.0.7",
23
23
  "@radix-ui/react-tabs": "^1.0.4",
24
+ "@radix-ui/react-toast": "^1.1.5",
24
25
  "@radix-ui/themes": "^3.0.5",
25
- "@rsbuild/core": "1.0.1-beta.9",
26
+ "@rsbuild/core": "1.0.1-beta.14",
26
27
  "@types/jest": "^29",
27
28
  "@types/lodash": "^4.14.202",
28
29
  "@types/node": "~16.11.7",
@@ -31,6 +32,7 @@
31
32
  "@types/react-dom": "^18",
32
33
  "birpc": "0.2.13",
33
34
  "clsx": "^1.2.1",
35
+ "flatted": "^3.2.9",
34
36
  "hookable": "^5.5.3",
35
37
  "jest": "^29",
36
38
  "lodash": "^4.17.21",
@@ -55,19 +57,15 @@
55
57
  "type-fest": "^4.1.0",
56
58
  "typescript": "~5.0.4",
57
59
  "ufo": "^1.3.0",
58
- "@radix-ui/react-toast": "^1.1.5",
59
60
  "valtio": "^1.11.1",
60
- "flatted": "^3.2.9",
61
- "@modern-js-app/eslint-config": "2.58.0",
62
- "@modern-js/app-tools": "2.58.0",
63
- "@modern-js/eslint-config": "2.58.0",
64
- "@modern-js/devtools-kit": "2.58.0",
65
- "@modern-js/runtime": "2.58.0",
66
- "@modern-js/types": "2.58.0",
67
- "@modern-js/plugin-proxy": "2.58.0",
68
- "@modern-js/tsconfig": "2.58.0",
69
- "@modern-js/utils": "2.58.0",
70
- "@scripts/jest-config": "2.58.0"
61
+ "@modern-js/app-tools": "2.58.2",
62
+ "@modern-js/devtools-kit": "2.58.2",
63
+ "@modern-js/plugin-proxy": "2.58.2",
64
+ "@modern-js/runtime": "2.58.2",
65
+ "@modern-js/tsconfig": "2.58.2",
66
+ "@modern-js/types": "2.58.2",
67
+ "@modern-js/utils": "2.58.2",
68
+ "@scripts/jest-config": "2.58.2"
71
69
  },
72
70
  "dependencies": {
73
71
  "cookie-es": "^1.0.0"