@modern-js/devtools-client 2.58.3 → 2.59.0

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 (56) hide show
  1. package/dist/modern.config.json +1 -1
  2. package/dist/public/sw-proxy.js +1 -1
  3. package/dist/routes-manifest.json +85 -89
  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.01a2f79f.js → 130.57b4e2f8.js} +1 -1
  7. package/dist/static/js/{528.0757a5be.js → 36.0ac2cc73.js} +3 -3
  8. package/dist/static/js/916.88481abb.js +18 -0
  9. package/dist/static/js/{456.1b493c94.js.LICENSE.txt → 916.88481abb.js.LICENSE.txt} +9 -0
  10. package/dist/static/js/async/client_config/(toolkit).(type)/page.0b9ec173.js +1 -0
  11. package/dist/static/js/async/client_context/builder/page.97a9f6ba.js +1 -0
  12. package/dist/static/js/async/client_context/framework/page.cb88a53f.js +1 -0
  13. package/dist/static/js/async/client_doctor/page.4fc20b70.js +1 -0
  14. package/dist/static/js/async/client_headers/editor/page.48759920.js +1 -0
  15. package/dist/static/js/async/client_overview/page.f7fbcbf1.js +1 -0
  16. package/dist/static/js/async/client_pages/{page.b60b4ac0.js → page.10eafcdc.js} +1 -1
  17. package/dist/static/js/async/client_react/offscreen/page.204e68cc.js +1 -0
  18. package/dist/static/js/async/client_storage/preset/(id)/page.1639e302.js +1 -0
  19. package/dist/static/js/async/client_storage/preset/layout.c9908083.js +1 -0
  20. package/dist/static/js/async/client_storage/preset/page.bbd0b5b5.js +1 -0
  21. package/dist/static/js/{builder-runtime.37781fb3.js → builder-runtime.d5686ca7.js} +1 -1
  22. package/dist/static/js/client.142459dc.js +1 -0
  23. package/dist/static/js/components.92f2a1cc.js +1 -0
  24. package/dist/static/js/lib-polyfill.0e2f3e81.js +1 -0
  25. package/dist/static/js/mount.2892cbee.js +1 -0
  26. package/package.json +10 -10
  27. package/dist/static/js/456.1b493c94.js +0 -18
  28. package/dist/static/js/async/client_config/(toolkit).(type)/page.ea1b568d.js +0 -1
  29. package/dist/static/js/async/client_context/builder/page.8dd38b3c.js +0 -1
  30. package/dist/static/js/async/client_context/framework/page.fcdece63.js +0 -1
  31. package/dist/static/js/async/client_doctor/page.1169fa05.js +0 -1
  32. package/dist/static/js/async/client_headers/editor/page.1c47ad13.js +0 -1
  33. package/dist/static/js/async/client_overview/page.60df2c9b.js +0 -1
  34. package/dist/static/js/async/client_react/offscreen/page.eea7ad51.js +0 -1
  35. package/dist/static/js/async/client_storage/preset/(id)/page.7ce4693a.js +0 -1
  36. package/dist/static/js/async/client_storage/preset/layout.2b2908ac.js +0 -1
  37. package/dist/static/js/async/client_storage/preset/page.788552ca.js +0 -1
  38. package/dist/static/js/client.d3a0694e.js +0 -1
  39. package/dist/static/js/components.4fa01740.js +0 -1
  40. package/dist/static/js/lib-lodash.8ad2ccf0.js +0 -2
  41. package/dist/static/js/lib-lodash.8ad2ccf0.js.LICENSE.txt +0 -8
  42. package/dist/static/js/lib-polyfill.04944fd7.js +0 -1
  43. package/dist/static/js/mount.7d06ebc4.js +0 -1
  44. /package/dist/static/css/{528.09221f91.css → 36.3f29a5f2.css} +0 -0
  45. /package/dist/static/css/{456.dd13d5e1.css → 916.50ff5af8.css} +0 -0
  46. /package/dist/static/css/async/client_doctor/{page.7495ae2e.css → page.a9657414.css} +0 -0
  47. /package/dist/static/css/async/client_headers/editor/{page.eefd3ad3.css → page.dcac2787.css} +0 -0
  48. /package/dist/static/css/async/client_overview/{page.1124d48a.css → page.74569048.css} +0 -0
  49. /package/dist/static/css/async/client_pages/{page.b278053d.css → page.a162c80f.css} +0 -0
  50. /package/dist/static/css/async/client_storage/preset/(id)/{page.24f1112c.css → page.1bd7f811.css} +0 -0
  51. /package/dist/static/css/async/client_storage/preset/{layout.2aa19b14.css → layout.a01b4b93.css} +0 -0
  52. /package/dist/static/css/async/client_storage/preset/{page.2aa19b14.css → page.a01b4b93.css} +0 -0
  53. /package/dist/static/css/{client.ac9f19d9.css → client.d4289637.css} +0 -0
  54. /package/dist/static/css/{components.0bbd0e9d.css → components.aef88d4e.css} +0 -0
  55. /package/dist/static/css/{mount.cff5017b.css → mount.3dc6fd55.css} +0 -0
  56. /package/dist/static/js/{528.0757a5be.js.LICENSE.txt → 36.0ac2cc73.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("41663"),r=o("80557"),i=o("64542"),s=o("10487"),a=o("88739"),c=o("65872"),d=o("52493"),u=o.n(d),m=o("9880"),v=o.n(m),h=o("57662"),p=o("81733");let y=s.MessagePortChannel.wait(window,"channel:connect:client"),f=new i.S,g=(0,h.createBridge)(window,f),w=y.then(e=>{let t=(0,c.Hu)();return{remote:(0,a.Fu)({async activateReactDevtools(){(0,h.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=u().omit(n,Object.keys(r));return{client:r,server:i}},localStorage:async e=>(u().each(e,(e,t)=>{window.localStorage.setItem(t,e)}),(0,l._)({},window.localStorage)),sessionStorage:async e=>(u().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,p.sj)({loaded:!1}),b=v()();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"),j=o("5872"),x=o("71161");let C=(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},E=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 C(t.key,o)}),[l]=o.splice(n,1);return[t,l,o[0],o[1]]},Z=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}},N=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,j.useState)(),i=()=>{if(!l)return;l.moveable=!1;let{el:e}=l,[t]=E(Z(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=E({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,x.Z)("blur",i),(0,x.Z)("mouseup",i),(0,x.Z)("touchend",i),(0,x.Z)("mousemove",s),(0,x.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()}}}},R=(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 S=o("97137"),D=o("12320"),P=o("29214"),T=o("56573"),H=o("36339");let Y=e=>{var t;let o=null===(t=e.keepAlive)||void 0===t||t,{when:l}=e,r=(0,j.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 B=o("43730"),I=o("69809");let L=e=>{var t;let[o,l]=(0,B.Z)(()=>Promise.resolve(e.onClick()),[]);return(0,n.jsx)("button",{className:I.Z.container,onClick:l,"data-type":null!==(t=e.type)&&void 0!==t?t:"default",disabled:o.loading,children:e.children})};var O=o("7162"),X=o("93565"),U=o("79197"),F=o("9768"),W=o("38727");let K=e=>{var{src:t,onClose:o}=e,i=(0,X._)(e,["src","onClose"]);let{loaded:s}=(0,U.R)(k);return(0,n.jsxs)(D.xu,(0,r._)((0,l._)({className:W.Z.container},i),{children:[(0,n.jsx)("iframe",{className:W.Z.frame,src:t}),(0,n.jsx)(P.cu3,{className:W.Z.closeButton,onClick:o}),(0,n.jsx)("div",{className:W.Z.backdrop,style:{display:s?"none":void 0},children:(0,n.jsx)(F.g,{})})]}))},M=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},A=e=>{let t=M(),[o,i]=(0,T.Z)(!!t),[s,a]=(0,j.useState)(!1),c=N({clamp:!0}),[d]=(0,S.U)();(0,x.Z)("keydown",e=>{e.shiftKey&&e.altKey&&"KeyD"===e.code&&i()}),(0,j.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 R(w,1e4)).remote.pullUp("/react/components#inspecting")}catch(e){console.error(e),document.documentElement.style.removeProperty("cursor")}};return(0,H.Z)(async()=>{if(!!t)(await R(w,1e4)).remote.pullUp(t)},[]),(0,n.jsxs)(D.Q2,{appearance:d,className:d,hasBackground:!1,style:{height:0,width:0,minHeight:0,minWidth:0},children:[(0,n.jsx)(Y,{when:o,keepAlive:!0,load:s,children:(0,n.jsx)("div",{className:O.Z.container,children:(0,n.jsx)(K,{src:e.src,onClose:()=>i(!1),style:{pointerEvents:c.isDragging?"none":"auto"}})})}),(0,n.jsxs)(D.kC,(0,r._)((0,l._)({className:O.Z.fab},c.props),{align:"center",children:[(0,n.jsx)(L,{type:"primary",onClick:i,children:(0,n.jsx)("img",{className:O.Z.logo,src:e.logo})}),(0,n.jsx)(L,{onClick:u,children:(0,n.jsx)(P.aur,{})})]}))]})},q=()=>{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)(A,{logo:e.context.def.assets.logo,src:l.href})},J="container-bYVevn",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)(q,{}))};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Q):Q()}},function(e){var t=function(t){return e(e.s=t)};e.O(0,["126","130","567","58","916","991"],function(){return t("5256"),t("21934"),t("8087"),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.3",
3
+ "version": "2.59.0",
4
4
  "engines": {
5
5
  "node": ">=14.0.0"
6
6
  },
@@ -23,7 +23,7 @@
23
23
  "@radix-ui/react-tabs": "^1.0.4",
24
24
  "@radix-ui/react-toast": "^1.1.5",
25
25
  "@radix-ui/themes": "^3.0.5",
26
- "@rsbuild/core": "1.0.1-beta.14",
26
+ "@rsbuild/core": "1.0.1-rc.4",
27
27
  "@types/jest": "^29",
28
28
  "@types/lodash": "^4.14.202",
29
29
  "@types/node": "~16.11.7",
@@ -58,14 +58,14 @@
58
58
  "typescript": "~5.0.4",
59
59
  "ufo": "^1.3.0",
60
60
  "valtio": "^1.11.1",
61
- "@modern-js/app-tools": "2.58.3",
62
- "@modern-js/devtools-kit": "2.58.3",
63
- "@modern-js/plugin-proxy": "2.58.3",
64
- "@modern-js/runtime": "2.58.3",
65
- "@scripts/jest-config": "2.58.3",
66
- "@modern-js/utils": "2.58.3",
67
- "@modern-js/tsconfig": "2.58.3",
68
- "@modern-js/types": "2.58.3"
61
+ "@modern-js/devtools-kit": "2.59.0",
62
+ "@modern-js/app-tools": "2.59.0",
63
+ "@modern-js/plugin-proxy": "2.59.0",
64
+ "@modern-js/types": "2.59.0",
65
+ "@modern-js/runtime": "2.59.0",
66
+ "@modern-js/tsconfig": "2.59.0",
67
+ "@modern-js/utils": "2.59.0",
68
+ "@scripts/jest-config": "2.59.0"
69
69
  },
70
70
  "dependencies": {
71
71
  "cookie-es": "^1.0.0"