@dimina-kit/devtools 0.4.0-dev.20260615070430 → 0.4.0-dev.20260616024534

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 (60) hide show
  1. package/README.md +0 -82
  2. package/dist/main/api.d.ts +1 -1
  3. package/dist/main/app/app.d.ts +0 -4
  4. package/dist/main/app/app.js +11 -6
  5. package/dist/main/app/lifecycle.d.ts +1 -0
  6. package/dist/main/app/lifecycle.js +10 -0
  7. package/dist/main/index.bundle.js +111 -143
  8. package/dist/main/ipc/app.d.ts +1 -3
  9. package/dist/main/ipc/app.js +0 -80
  10. package/dist/main/runtime/miniapp-runtime.d.ts +4 -2
  11. package/dist/main/services/notifications/renderer-notifier.d.ts +0 -4
  12. package/dist/main/services/notifications/renderer-notifier.js +1 -7
  13. package/dist/main/services/safe-area/index.d.ts +6 -4
  14. package/dist/main/services/safe-area/index.js +20 -14
  15. package/dist/main/services/simulator-storage/index.js +4 -2
  16. package/dist/main/services/views/view-manager.js +40 -8
  17. package/dist/main/services/workbench-context.d.ts +10 -13
  18. package/dist/main/services/workbench-context.js +1 -4
  19. package/dist/main/services/workspace/workspace-service.js +13 -0
  20. package/dist/main/utils/theme.d.ts +15 -0
  21. package/dist/main/utils/theme.js +34 -1
  22. package/dist/main/windows/main-window/create.d.ts +6 -0
  23. package/dist/main/windows/main-window/create.js +5 -1
  24. package/dist/preload/runtime/native-host.d.ts +3 -0
  25. package/dist/preload/runtime/native-host.js +2 -0
  26. package/dist/preload/windows/host-toolbar-runtime.cjs.map +2 -2
  27. package/dist/preload/windows/main.cjs +3 -3
  28. package/dist/preload/windows/main.cjs.map +2 -2
  29. package/dist/preload/windows/simulator.cjs +1 -0
  30. package/dist/preload/windows/simulator.cjs.map +2 -2
  31. package/dist/preload/windows/simulator.js +1 -0
  32. package/dist/renderer/assets/index-BFwsvw4p.js +50 -0
  33. package/dist/renderer/assets/{input-J1MQ5fra.js → input-hGF71bn3.js} +2 -2
  34. package/dist/renderer/assets/{ipc-transport-21qDpt9Y.js → ipc-transport-BKWkvwKK.js} +2 -2
  35. package/dist/renderer/assets/ipc-transport-Cg1q1gwD.css +1 -0
  36. package/dist/renderer/assets/{popover-ChIUUEdj.js → popover-NNQNyjgI.js} +2 -2
  37. package/dist/renderer/assets/select-Bb1AKeSq.js +2 -0
  38. package/dist/renderer/assets/{settings-CGea5k_R.js → settings-7uwimev-.js} +2 -2
  39. package/dist/renderer/assets/settings-api-DkrPHroq.js +2 -0
  40. package/dist/renderer/assets/{workbenchSettings-CFrdVOiP.js → workbenchSettings-EaMYvKHG.js} +2 -2
  41. package/dist/renderer/entries/main/index.html +6 -6
  42. package/dist/renderer/entries/popover/index.html +5 -5
  43. package/dist/renderer/entries/settings/index.html +5 -5
  44. package/dist/renderer/entries/workbench-settings/index.html +4 -4
  45. package/dist/shared/ipc-channels.d.ts +1 -7
  46. package/dist/shared/ipc-channels.js +7 -6
  47. package/dist/shared/ipc-schemas.d.ts +0 -1
  48. package/dist/shared/ipc-schemas.js +0 -1
  49. package/dist/shared/types.d.ts +17 -61
  50. package/dist/simulator/assets/device-shell-BWX7Yopg.js +2 -0
  51. package/dist/simulator/assets/{device-shell-DsdcNEkt.css → device-shell-BiFE9Otv.css} +1 -1
  52. package/dist/simulator/assets/{simulator-mini-app-CYtW6bMd.js → simulator-mini-app-BfNuDF3R.js} +2 -2
  53. package/dist/simulator/assets/{simulator-cV1PERi6.js → simulator-sf-D0mhw.js} +3 -3
  54. package/dist/simulator/simulator.html +1 -1
  55. package/package.json +4 -4
  56. package/dist/renderer/assets/index-Bx4XqFQ2.js +0 -50
  57. package/dist/renderer/assets/ipc-transport-CVp38I_M.css +0 -1
  58. package/dist/renderer/assets/select-BgWAbMot.js +0 -2
  59. package/dist/renderer/assets/settings-api-Dit4oL6S.js +0 -2
  60. package/dist/simulator/assets/device-shell-BEnc2k-W.js +0 -2
@@ -0,0 +1 @@
1
+ *,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--font-family);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--font-family-mono);font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (width>=640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (width>=768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (width>=1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (width>=1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (width>=1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-3{bottom:.75rem}.left-0{left:0}.left-1\/2{left:50%}.left-2\.5{left:.625rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1\.5{right:.375rem}.right-4{right:1rem}.top-0{top:0}.top-1\.5{top:.375rem}.top-1\/2{top:50%}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1\.5{height:.375rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-28{height:7rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-72{height:18rem}.h-8{height:2rem}.h-\[10px\]{height:10px}.h-\[1px\]{height:1px}.h-\[30px\]{height:30px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-40{max-height:10rem}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:0}.min-h-\[188px\]{min-height:188px}.w-1\.5{width:.375rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-9{width:2.25rem}.w-\[10px\]{width:10px}.w-\[1px\]{width:1px}.w-\[340px\]{width:340px}.w-\[560px\]{width:560px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.min-w-2{min-width:.5rem}.max-w-16{max-width:4rem}.max-w-28{max-width:7rem}.max-w-\[180px\]{max-width:180px}.max-w-\[240px\]{max-width:240px}.max-w-\[280px\]{max-width:280px}.max-w-\[90vw\]{max-width:90vw}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-xs{max-width:20rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.origin-\[--radix-tooltip-content-transform-origin\]{transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{0%,to{opacity:1}50%{opacity:.3}}.animate-\[pulse_1s_infinite\]{animation:1s infinite pulse}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.cursor-text{cursor:text}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:var(--radius)}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-accent{border-color:var(--color-accent)}.border-black\/10{border-color:#0000001a}.border-border{border-color:var(--color-border)}.border-border-strong{border-color:var(--color-border-strong)}.border-border-subtle{border-color:var(--color-border-subtle)}.border-text-dim{border-color:var(--color-text-dim)}.border-transparent{border-color:#0000}.border-l-transparent{border-left-color:#0000}.border-t-transparent{border-top-color:#0000}.bg-accent{background-color:var(--color-accent)}.bg-bg{background-color:var(--color-bg)}.bg-bg-panel{background-color:var(--color-bg-panel)}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/70{background-color:#000000b3}.bg-black\/80{background-color:#000c}.bg-blue-500\/15{background-color:#3b82f626}.bg-border{background-color:var(--color-border)}.bg-overlay{background-color:var(--color-overlay)}.bg-sim-bg{background-color:var(--color-sim-bg)}.bg-sim-bottom{background-color:var(--color-sim-bottom)}.bg-status-error{background-color:var(--color-status-error)}.bg-status-warn{background-color:var(--color-status-warn)}.bg-surface{background-color:var(--color-surface)}.bg-surface-2{background-color:var(--color-surface-2)}.bg-surface-3{background-color:var(--color-surface-3)}.bg-surface-active{background-color:var(--color-surface-active)}.bg-surface-input{background-color:var(--color-surface-input)}.bg-surface-selected{background-color:var(--color-surface-selected)}.bg-surface-thumb{background-color:var(--color-surface-thumb)}.bg-transparent{background-color:#0000}.bg-warn-bg{background-color:var(--color-warn-bg)}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-px{padding-top:1px;padding-bottom:1px}.pl-8{padding-left:2rem}.pr-3{padding-right:.75rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.text-left{text-align:left}.text-center{text-align:center}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-family-mono)}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-\[18px\]{line-height:18px}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\[var\(--color-code-blue\)\]{color:var(--color-code-blue)}.text-\[var\(--color-status-warn\)\]{color:var(--color-status-warn)}.text-accent{color:var(--color-accent)}.text-amber-500{--tw-text-opacity:1;color:rgb(245 158 11/var(--tw-text-opacity,1))}.text-amber-600{--tw-text-opacity:1;color:rgb(217 119 6/var(--tw-text-opacity,1))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.text-border-subtle{color:var(--color-border-subtle)}.text-code-blue{color:var(--color-code-blue)}.text-code-keyword{color:var(--color-code-keyword)}.text-code-label{color:var(--color-code-label)}.text-code-orange{color:var(--color-code-orange)}.text-emerald-600{--tw-text-opacity:1;color:rgb(5 150 105/var(--tw-text-opacity,1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.text-status-error{color:var(--color-status-error)}.text-status-success{color:var(--color-status-success)}.text-text{color:var(--color-text)}.text-text-dim{color:var(--color-text-dim)}.text-text-muted{color:var(--color-text-muted)}.text-text-secondary{color:var(--color-text-secondary)}.text-transparent{color:#0000}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.placeholder-text-dim::placeholder{color:var(--color-text-dim)}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-\[0_8px_24px_var\(--color-overlay-heavy\)\]{--tw-shadow:0 8px 24px var(--color-overlay-heavy);--tw-shadow-colored:0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.outline-none{outline-offset:2px;outline:2px solid #0000}.outline{outline-style:solid}.ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.ring-offset-bg{--tw-ring-offset-color:var(--color-bg)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}:root{--color-accent:#7057ff;--color-accent-hover:#6c56eb;--color-bg:#1a1a1a;--color-bg-panel:#242424;--color-surface:#292929;--color-surface-2:#2c2e30;--color-surface-3:#36393a;--color-surface-active:#404244;--color-surface-input:#3d3d3d;--color-surface-selected:#333;--color-surface-thumb:#4a4a4a;--color-surface-splitter:#212121;--color-border:#3b3b3b;--color-border-subtle:#2e2e2e;--color-border-strong:#454545;--color-ring:var(--color-accent);--color-text:#e0e0e0;--color-text-secondary:#969696;--color-text-muted:#666;--color-text-dim:#545454;--color-text-white:#fff;--color-code-blue:#9adbfe;--color-code-orange:#ce9178;--color-code-label:#858585;--color-code-number:#b4cda7;--color-code-keyword:#579dd6;--color-status-warn:#f0a400;--color-status-error:#ff5768;--color-status-success:#21c45d;--color-status-ready:#7057ff;--color-danger-bg:#ff525226;--color-warn-bg:#f0a4001a;--color-warn-border:#f0a4004d;--color-overlay:#00000073;--color-overlay-heavy:#000000b3;--color-sim-bg:#121212;--color-sim-bottom:#171717;--color-sim-screen:#000;--color-phone-shell:#1c1c1c;--color-phone-border:#2d2d2e;--font-family:-apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;--font-family-mono:"Menlo", "Consolas", monospace;--font-size-xs:11px;--font-size-sm:12px;--font-size-base:13px;--font-size-md:14px;--font-size-lg:16px;--radius:4px;--radius-md:6px;--radius-lg:8px;--scrollbar-size:6px;--scrollbar-thumb:#454545;--header-h:40px;--splitter-w:4px}@media (prefers-color-scheme:light){:root{--color-accent:#7057ff;--color-accent-hover:#6c56eb;--color-bg:#fafafa;--color-bg-panel:#f0f0f0;--color-surface:#e8e8e8;--color-surface-2:#dfe0e2;--color-surface-3:#d8d9da;--color-surface-active:#caccce;--color-surface-input:#fff;--color-surface-selected:#dbdbdb;--color-surface-thumb:#b8b8b8;--color-surface-splitter:#e0e0e0;--color-border:#d1d1d1;--color-border-subtle:#dedede;--color-border-strong:#bdbdbd;--color-text:#1f1f1f;--color-text-secondary:#5c5c5c;--color-text-muted:#6b6b6b;--color-text-dim:gray;--color-text-white:#fff;--color-code-blue:#005499;--color-code-orange:#9a1919;--color-code-label:#6b6b6b;--color-code-number:#367c13;--color-code-keyword:#00c;--color-status-warn:#996900;--color-status-error:#cc0014;--color-status-success:#157a3a;--color-status-ready:#7057ff;--color-danger-bg:#ff52521f;--color-warn-bg:#f0a4001f;--color-warn-border:#f0a40059;--color-overlay:#0000004d;--color-overlay-heavy:#0009;--scrollbar-thumb:#b3b3b3;--color-sim-bg:#e8e8e8;--color-sim-bottom:#e0e0e0}}*,:before,:after{box-sizing:border-box}html,body{font-family:var(--font-family);background:var(--color-bg);color:var(--color-text);height:100vh;margin:0;padding:0;overflow:hidden}#root{flex-direction:column;height:100vh;display:flex;overflow:hidden}[role=separator]:focus,[role=separator]:focus-visible{outline:none}::-webkit-scrollbar{width:var(--scrollbar-size);height:var(--scrollbar-size)}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}.placeholder\:text-text-dim::placeholder{color:var(--color-text-dim)}.hover\:-translate-y-0\.5:hover{--tw-translate-y:-.125rem;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-accent:hover{border-color:var(--color-accent)}.hover\:border-border-subtle:hover{border-color:var(--color-border-subtle)}.hover\:bg-accent-hover:hover{background-color:var(--color-accent-hover)}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-danger-bg:hover{background-color:var(--color-danger-bg)}.hover\:bg-surface:hover{background-color:var(--color-surface)}.hover\:bg-surface-2:hover{background-color:var(--color-surface-2)}.hover\:bg-surface-3:hover{background-color:var(--color-surface-3)}.hover\:bg-surface-active:hover{background-color:var(--color-surface-active)}.hover\:bg-transparent:hover{background-color:#0000}.hover\:text-accent:hover{color:var(--color-accent)}.hover\:text-accent-hover:hover{color:var(--color-accent-hover)}.hover\:text-status-error:hover{color:var(--color-status-error)}.hover\:text-text:hover{color:var(--color-text)}.hover\:text-text-muted:hover{color:var(--color-text-muted)}.hover\:opacity-100:hover{opacity:1}.focus\:border-accent:focus{border-color:var(--color-accent)}.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus\:ring-accent:focus{--tw-ring-color:var(--color-accent)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\:outline-none:focus-visible{outline-offset:2px;outline:2px solid #0000}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-accent:focus-visible{--tw-ring-color:var(--color-accent)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.focus-visible\:ring-offset-bg:focus-visible{--tw-ring-offset-color:var(--color-bg)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-35:disabled{opacity:.35}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:bg-ring{background-color:var(--color-ring)}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true]{pointer-events:none}.data-\[state\=checked\]\:translate-x-\[18px\][data-state=checked]{--tw-translate-x:18px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-\[3px\][data-state=unchecked]{--tw-translate-x:3px;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[selected\=\'true\'\]\:bg-surface-active[data-selected=true]{background-color:var(--color-surface-active)}.data-\[state\=active\]\:bg-surface-selected[data-state=active]{background-color:var(--color-surface-selected)}.data-\[state\=checked\]\:bg-accent[data-state=checked]{background-color:var(--color-accent)}.data-\[state\=open\]\:bg-surface-3[data-state=open]{background-color:var(--color-surface-3)}.data-\[state\=open\]\:bg-surface-active[data-state=open],.data-\[state\=selected\]\:bg-surface-active[data-state=selected]{background-color:var(--color-surface-active)}.data-\[state\=unchecked\]\:bg-surface-3[data-state=unchecked]{background-color:var(--color-surface-3)}.data-\[selected\=true\]\:text-text[data-selected=true],.data-\[state\=active\]\:text-text[data-state=active]{color:var(--color-text)}.data-\[state\=open\]\:text-text-muted[data-state=open]{color:var(--color-text-muted)}.data-\[disabled\=true\]\:opacity-50[data-disabled=true]{opacity:.5}.data-\[state\=active\]\:shadow-sm[data-state=active]{--tw-shadow:0 1px 2px 0 #0000000d;--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000), var(--tw-ring-shadow,0 0 #0000), var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.group[data-resize-handle-active] .group-data-\[resize-handle-active\]\:bg-ring{background-color:var(--color-ring)}@media (width>=640px){.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:text-left{text-align:left}}@media (prefers-color-scheme:dark){.dark\:border-white\/10{border-color:#ffffff1a}.dark\:text-amber-400{--tw-text-opacity:1;color:rgb(251 191 36/var(--tw-text-opacity,1))}.dark\:text-blue-300{--tw-text-opacity:1;color:rgb(147 197 253/var(--tw-text-opacity,1))}.dark\:text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity,1))}.dark\:text-green-400{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity,1))}.dark\:text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.dark\:hover\:bg-white\/10:hover{background-color:#ffffff1a}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.hover\:\[\&\>td\]\:bg-surface>td:hover{background-color:var(--color-surface)}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-text-muted [cmdk-group-heading]{color:var(--color-text-muted)}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}
@@ -1,2 +1,2 @@
1
- import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,i as r,l as i,w as a}from"./ipc-transport-21qDpt9Y.js";import{t as o}from"./input-J1MQ5fra.js";import{i as s,s as c,t as l,y as u}from"./select-BgWAbMot.js";import{n as d}from"./constants-DI382mTP.js";function f(e){r(i.Relaunch,e)}var p=e(a(),1),m=e(n(),1),h=t();function g(){let[e,t]=(0,m.useState)({top:0,left:0}),[n,r]=(0,m.useState)({startPage:``,scene:d,queryParams:[]}),[i,a]=(0,m.useState)([]);(0,m.useEffect)(()=>c(e=>{a(e.pages),r(e.config);let n=window.innerWidth-340-8;t({top:e.top,left:Math.min(e.left,n)})}),[]);function p(){s()}function g(){r(e=>({...e,queryParams:[...e.queryParams,{key:``,value:``}]}))}function _(e){r(t=>({...t,queryParams:t.queryParams.filter((t,n)=>n!==e)}))}function v(e,t,n){r(r=>{let i=[...r.queryParams];return i[e]={...i[e]??{key:``,value:``},[t]:n},{...r,queryParams:i}})}function y(){f(n)}return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`fixed inset-0`,onClick:p}),(0,h.jsxs)(`div`,{className:`fixed w-[340px] bg-surface border border-border-strong rounded-md p-3.5 shadow-[0_8px_24px_var(--color-overlay-heavy)] z-10`,style:{top:e.top,left:e.left},onClick:e=>e.stopPropagation(),children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px]`,children:`启动页面`}),(0,h.jsx)(l,{className:`flex-1 min-w-0 bg-surface-input border-text-dim text-text text-[12px] py-0.5`,value:n.startPage,onChange:e=>r(t=>({...t,startPage:e.target.value})),children:i.map(e=>(0,h.jsx)(`option`,{value:e,children:e},e))})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px]`,children:`scene 值`}),(0,h.jsx)(o,{type:`number`,className:`w-20 bg-surface-input border-text-dim text-text text-[12px]`,value:n.scene,onChange:e=>r(t=>({...t,scene:Number(e.target.value)||1001}))})]}),(0,h.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px] pt-1`,children:`启动参数`}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5 flex-1`,children:[n.queryParams.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex gap-1.5 items-center`,children:[(0,h.jsx)(o,{className:`w-24 bg-surface-input border-text-dim text-text text-[12px]`,value:e.key,placeholder:`参数名`,onChange:e=>v(t,`key`,e.target.value)}),(0,h.jsx)(o,{className:`w-24 bg-surface-input border-text-dim text-text text-[12px]`,value:e.value,placeholder:`参数值`,onChange:e=>v(t,`value`,e.target.value)}),(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-text-secondary hover:text-status-error hover:bg-transparent`,onClick:()=>_(t),children:`×`})]},t)),(0,h.jsx)(u,{variant:`outline`,size:`xs`,className:`border-dashed border-text-dim text-text-secondary hover:border-accent hover:text-accent hover:bg-transparent`,onClick:g,children:`+ 添加参数`})]})]}),(0,h.jsx)(`div`,{className:`mt-3.5`,children:(0,h.jsx)(u,{onClick:y,children:`▶ 重新编译`})})]})]})}p.createRoot(document.getElementById(`root`)).render((0,h.jsx)(g,{}));
2
- //# sourceMappingURL=popover-ChIUUEdj.js.map
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,i as r,l as i,w as a}from"./ipc-transport-BKWkvwKK.js";import{t as o}from"./input-hGF71bn3.js";import{i as s,s as c,t as l,y as u}from"./select-Bb1AKeSq.js";import{n as d}from"./constants-DI382mTP.js";function f(e){r(i.Relaunch,e)}var p=e(a(),1),m=e(n(),1),h=t();function g(){let[e,t]=(0,m.useState)({top:0,left:0}),[n,r]=(0,m.useState)({startPage:``,scene:d,queryParams:[]}),[i,a]=(0,m.useState)([]);(0,m.useEffect)(()=>c(e=>{a(e.pages),r(e.config);let n=window.innerWidth-340-8;t({top:e.top,left:Math.min(e.left,n)})}),[]);function p(){s()}function g(){r(e=>({...e,queryParams:[...e.queryParams,{key:``,value:``}]}))}function _(e){r(t=>({...t,queryParams:t.queryParams.filter((t,n)=>n!==e)}))}function v(e,t,n){r(r=>{let i=[...r.queryParams];return i[e]={...i[e]??{key:``,value:``},[t]:n},{...r,queryParams:i}})}function y(){f(n)}return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`div`,{className:`fixed inset-0`,onClick:p}),(0,h.jsxs)(`div`,{className:`fixed w-[340px] bg-surface border border-border-strong rounded-md p-3.5 shadow-[0_8px_24px_var(--color-overlay-heavy)] z-10`,style:{top:e.top,left:e.left},onClick:e=>e.stopPropagation(),children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px]`,children:`启动页面`}),(0,h.jsx)(l,{className:`flex-1 min-w-0 bg-surface-input border-text-dim text-text text-[12px] py-0.5`,value:n.startPage,onChange:e=>r(t=>({...t,startPage:e.target.value})),children:i.map(e=>(0,h.jsx)(`option`,{value:e,children:e},e))})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px]`,children:`scene 值`}),(0,h.jsx)(o,{type:`number`,className:`w-20 bg-surface-input border-text-dim text-text text-[12px]`,value:n.scene,onChange:e=>r(t=>({...t,scene:Number(e.target.value)||1001}))})]}),(0,h.jsxs)(`div`,{className:`flex items-start gap-2.5 mb-3`,children:[(0,h.jsx)(`label`,{className:`w-16 shrink-0 text-code-label text-[12px] pt-1`,children:`启动参数`}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-1.5 flex-1`,children:[n.queryParams.map((e,t)=>(0,h.jsxs)(`div`,{className:`flex gap-1.5 items-center`,children:[(0,h.jsx)(o,{className:`w-24 bg-surface-input border-text-dim text-text text-[12px]`,value:e.key,placeholder:`参数名`,onChange:e=>v(t,`key`,e.target.value)}),(0,h.jsx)(o,{className:`w-24 bg-surface-input border-text-dim text-text text-[12px]`,value:e.value,placeholder:`参数值`,onChange:e=>v(t,`value`,e.target.value)}),(0,h.jsx)(u,{variant:`ghost`,size:`icon-sm`,className:`text-text-secondary hover:text-status-error hover:bg-transparent`,onClick:()=>_(t),children:`×`})]},t)),(0,h.jsx)(u,{variant:`outline`,size:`xs`,className:`border-dashed border-text-dim text-text-secondary hover:border-accent hover:text-accent hover:bg-transparent`,onClick:g,children:`+ 添加参数`})]})]}),(0,h.jsx)(`div`,{className:`mt-3.5`,children:(0,h.jsx)(u,{onClick:y,children:`▶ 重新编译`})})]})]})}p.createRoot(document.getElementById(`root`)).render((0,h.jsx)(g,{}));
2
+ //# sourceMappingURL=popover-NNQNyjgI.js.map
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,b as r,h as i,l as a,r as o,t as s,x as c}from"./ipc-transport-BKWkvwKK.js";import{i as l,n as u}from"./input-hGF71bn3.js";var d=e(n(),1),f=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,p=l,m=(e,t)=>n=>{if(t?.variants==null)return p(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=f(t)||f(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return p(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},h=t(),g=m(`inline-flex items-center justify-center gap-1.5 font-medium transition-colors focus:outline-none disabled:opacity-35 disabled:cursor-not-allowed whitespace-nowrap shrink-0`,{variants:{variant:{default:`bg-accent text-text-white hover:bg-accent-hover rounded`,ghost:`text-text-secondary hover:bg-surface-3 hover:text-text rounded`,outline:`border border-border text-text-muted hover:border-border-subtle hover:text-text rounded`,icon:`text-text-secondary hover:bg-surface-3 hover:text-text-muted rounded`,tab:`text-text-muted hover:text-text hover:bg-surface-3 rounded`,"tab-active":`text-text bg-surface-active rounded`,danger:`border border-transparent text-text-secondary hover:text-status-error hover:bg-danger-bg rounded-full`},size:{default:`h-7 px-4 text-[13px]`,sm:`h-6 px-3 text-[12px]`,xs:`h-5 px-2 text-[11px]`,icon:`h-7 w-7 p-0 text-[15px]`,"icon-sm":`h-6 w-6 p-0 text-[14px]`}},defaultVariants:{variant:`default`,size:`default`}}),_=d.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,h.jsx)(`button`,{ref:i,className:u(g({variant:t,size:n}),e),...r}));_.displayName=`Button`;var v=[{name:`iPhone SE`,width:375,height:667,pixelRatio:2,statusBarHeight:20,system:`iOS 15.0`,notchType:`none`,safeAreaInsets:{top:20,right:0,bottom:0,left:0}},{name:`iPhone X`,width:375,height:812,pixelRatio:3,statusBarHeight:44,system:`iOS 16.0`,notchType:`notch`,safeAreaInsets:{top:44,right:0,bottom:34,left:0}},{name:`iPhone 14`,width:390,height:844,pixelRatio:3,statusBarHeight:47,system:`iOS 16.0`,notchType:`notch`,safeAreaInsets:{top:47,right:0,bottom:34,left:0}},{name:`iPhone 14 Pro`,width:393,height:852,pixelRatio:3,statusBarHeight:54,system:`iOS 16.3`,notchType:`dynamic-island`,safeAreaInsets:{top:54,right:0,bottom:34,left:0}},{name:`iPhone 16 Pro`,width:402,height:874,pixelRatio:3,statusBarHeight:59,system:`iOS 18.0`,notchType:`dynamic-island`,safeAreaInsets:{top:59,right:0,bottom:34,left:0}},{name:`iPhone 17 Pro`,width:402,height:874,pixelRatio:3,statusBarHeight:59,system:`iOS 19.0`,notchType:`dynamic-island`,safeAreaInsets:{top:59,right:0,bottom:34,left:0}}],y=[25,50,75,100],b=1500;function x(e,t){return s(i.AttachNative,e,t)}function S(e){return s(i.SetNativeBounds,e)}function C(e){return s(i.SetDeviceInfo,e)}function w(e){return s(a.Show,e)}function T(){return s(a.Hide)}function E(e){return o(a.Closed,()=>e())}function D(e){return o(a.Init,t=>e(t))}function O(e){return o(a.Relaunch,t=>e(t))}function k(e){return o(c.NavigateBack,()=>e())}function A(e){return o(i.CurrentPage,t=>e(t))}function j(e){return s(r.SimulatorDevtoolsBounds,e)}function M(e){return s(r.HostToolbarBounds,e)}function N(e){return o(r.HostToolbarHeightChanged,t=>e(t))}function P(){return s(r.HostToolbarGetHeight)}var F=d.forwardRef(({className:e,children:t,...n},r)=>(0,h.jsx)(`select`,{ref:r,className:u(`bg-surface border border-border text-text-secondary`,`px-1.5 py-0.5 rounded text-[11px] cursor-pointer`,`focus:outline-none focus:border-accent`,e),...n,children:t}));F.displayName=`Select`;export{v as _,N as a,O as c,M as d,j as f,b as g,w as h,T as i,A as l,S as m,x as n,E as o,C as p,P as r,D as s,F as t,k as u,y as v,_ as y};
2
+ //# sourceMappingURL=select-Bb1AKeSq.js.map
@@ -1,2 +1,2 @@
1
- import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,w as r}from"./ipc-transport-21qDpt9Y.js";import{t as i}from"./input-J1MQ5fra.js";import{n as a,o,t as s}from"./settings-api-Dit4oL6S.js";var c=e(r(),1),l=e(n(),1),u=t(),d=[{id:`local`,label:`本地设置`},{id:`project`,label:`项目配置`}];function f(){let[e,t]=(0,l.useState)(`local`),[n,r]=(0,l.useState)(``),[c,f]=(0,l.useState)({startPage:``,scene:1001,queryParams:[]}),[p,m]=(0,l.useState)({uploadWithSourceMap:!1});(0,l.useEffect)(()=>o(e=>{r(e.projectPath),f(e.config),m({uploadWithSourceMap:!!e.projectSettings?.uploadWithSourceMap})}),[]);function h(e){let t={...c,...e};f(t),a(t)}function g(e){let t={...p,...e};m(t),s(t)}function _(e,t,n){return(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md border border-border bg-bg hover:bg-surface-3 transition-colors text-left`,children:[(0,u.jsx)(`span`,{className:`h-4 w-4 rounded-sm border flex items-center justify-center text-[11px] ${t?`bg-accent border-accent text-white`:`border-border bg-surface text-transparent`}`,children:`✓`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text`,children:e})]})}return(0,u.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,u.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:d.map(n=>(0,u.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${e===n.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>t(n.id),children:n.label},n.id))}),(0,u.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[e===`local`&&(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsx)(`div`,{className:`text-[12px] text-text-secondary`,children:`本地设置`}),_(`上传时启用 Sourcemap`,p.uploadWithSourceMap,e=>g({uploadWithSourceMap:e}))]}),e===`project`&&(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between py-2 border-b border-border`,children:[(0,u.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`本地目录`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text truncate ml-4 max-w-[180px]`,title:n,children:n})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`启动页面`}),(0,u.jsx)(i,{value:c.startPage,onChange:e=>h({startPage:e.target.value}),className:`w-full h-8 px-2 text-[12px]`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`Scene`}),(0,u.jsx)(i,{type:`number`,value:c.scene,onChange:e=>h({scene:parseInt(e.target.value||`1001`,10)}),className:`w-full h-8 px-2 text-[12px]`})]})]})]})]})}c.createRoot(document.getElementById(`root`)).render((0,u.jsx)(f,{}));
2
- //# sourceMappingURL=settings-CGea5k_R.js.map
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,w as r}from"./ipc-transport-BKWkvwKK.js";import{t as i}from"./input-hGF71bn3.js";import{n as a,o,t as s}from"./settings-api-DkrPHroq.js";var c=e(r(),1),l=e(n(),1),u=t(),d=[{id:`local`,label:`本地设置`},{id:`project`,label:`项目配置`}];function f(){let[e,t]=(0,l.useState)(`local`),[n,r]=(0,l.useState)(``),[c,f]=(0,l.useState)({startPage:``,scene:1001,queryParams:[]}),[p,m]=(0,l.useState)({uploadWithSourceMap:!1});(0,l.useEffect)(()=>o(e=>{r(e.projectPath),f(e.config),m({uploadWithSourceMap:!!e.projectSettings?.uploadWithSourceMap})}),[]);function h(e){let t={...c,...e};f(t),a(t)}function g(e){let t={...p,...e};m(t),s(t)}function _(e,t,n){return(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md border border-border bg-bg hover:bg-surface-3 transition-colors text-left`,children:[(0,u.jsx)(`span`,{className:`h-4 w-4 rounded-sm border flex items-center justify-center text-[11px] ${t?`bg-accent border-accent text-white`:`border-border bg-surface text-transparent`}`,children:`✓`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text`,children:e})]})}return(0,u.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,u.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:d.map(n=>(0,u.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${e===n.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>t(n.id),children:n.label},n.id))}),(0,u.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[e===`local`&&(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsx)(`div`,{className:`text-[12px] text-text-secondary`,children:`本地设置`}),_(`上传时启用 Sourcemap`,p.uploadWithSourceMap,e=>g({uploadWithSourceMap:e}))]}),e===`project`&&(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between py-2 border-b border-border`,children:[(0,u.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`本地目录`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text truncate ml-4 max-w-[180px]`,title:n,children:n})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`启动页面`}),(0,u.jsx)(i,{value:c.startPage,onChange:e=>h({startPage:e.target.value}),className:`w-full h-8 px-2 text-[12px]`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`Scene`}),(0,u.jsx)(i,{type:`number`,value:c.scene,onChange:e=>h({scene:parseInt(e.target.value||`1001`,10)}),className:`w-full h-8 px-2 text-[12px]`})]})]})]})]})}c.createRoot(document.getElementById(`root`)).render((0,u.jsx)(f,{}));
2
+ //# sourceMappingURL=settings-7uwimev-.js.map
@@ -0,0 +1,2 @@
1
+ import{S as e,i as t,n,p as r,r as i,t as a}from"./ipc-transport-BKWkvwKK.js";function o(e){return a(r.SetVisible,e)}function s(e){t(r.ConfigChanged,e)}function c(e){t(r.ProjectSettingsChanged,e)}function l(e){return i(r.Init,t=>e(t))}function u(){return n(e.Get)}function d(t){return a(e.Save,t)}function f(t){return a(e.SetTheme,t)}function p(t){return i(e.ThemeChanged,e=>t(e))}function m(){return n(e.GetCdpStatus)}function h(){return n(e.GetMcpStatus)}function g(t){return i(e.Init,e=>t(e))}export{u as a,g as c,f as d,h as i,d as l,s as n,l as o,m as r,p as s,c as t,o as u};
2
+ //# sourceMappingURL=settings-api-DkrPHroq.js.map
@@ -1,8 +1,8 @@
1
- import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,w as r}from"./ipc-transport-21qDpt9Y.js";import{t as i}from"./constants-DI382mTP.js";import{a,c as o,i as s,r as c,s as l,u}from"./settings-api-Dit4oL6S.js";var d=e(r(),1),f=e(n(),1),p=t(),m=[{id:`general`,label:`通用`},{id:`debug`,label:`调试`},{id:`mcp`,label:`MCP`}];function h({checked:e,onClick:t}){return(0,p.jsx)(`button`,{type:`button`,onClick:t,className:`relative inline-flex h-5 w-9 shrink-0 rounded-full transition-colors`,style:{background:e?`var(--color-accent)`:`var(--color-surface-3)`},children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform`,style:{marginTop:3,transform:e?`translateX(18px)`:`translateX(3px)`}})})}function g(){let[e,t]=(0,f.useState)({cdp:{enabled:!1,port:i},mcp:{enabled:!1,port:7789},compile:{watch:!0},theme:`system`}),[n,r]=(0,f.useState)(null),[d,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(`general`),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(String(i)),[C,w]=(0,f.useState)(`7789`);(0,f.useEffect)(()=>{let e=l(e=>{t(e.settings),S(String(e.settings.cdp.port)),w(String(e.settings.mcp.port))});return a().then(e=>{t(e),S(String(e.cdp.port)),w(String(e.mcp.port))}),c().then(r),s().then(g),e},[]);function T(){b(!0),window.setTimeout(()=>b(!1),2e3)}function E(){t(e=>({...e,cdp:{...e.cdp,enabled:!e.cdp.enabled}}))}function D(){t(e=>({...e,mcp:{...e.mcp,enabled:!e.mcp.enabled}}))}function O(n){let r={...e,theme:n};t(r),u(n),o(r)}function k(n){let r={...e,compile:{...e.compile,watch:n}};t(r),o(r).then(T)}async function A(){let n=parseInt(x,10);if(Number.isNaN(n)||n<1024||n>65535)return;let i=parseInt(C,10);if(Number.isNaN(i)||i<1024||i>65535)return;let a={...e,cdp:{...e.cdp,port:n},mcp:{...e.mcp,port:i}};t(a),await o(a),r(await c()),g(await s()),T()}let j=n&&!n.implicitDevDefault&&(e.cdp.enabled!==n.active||e.cdp.enabled&&n.active&&e.cdp.port!==n.activePort);return(0,p.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,p.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:m.map(e=>(0,p.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${_===e.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>v(e.id),children:e.label},e.id))}),(0,p.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[_===`general`&&(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`编译`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后,打开项目时会监听源文件改动并自动重新编译。关闭则只在打开/手动重新编译时构建。配置在下次打开项目时生效。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`监听文件变化自动编译`}),(0,p.jsx)(h,{checked:e.compile.watch,onClick:()=>k(!e.compile.watch)})]})]}),(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-3 bg-bg`,children:[(0,p.jsx)(`div`,{children:(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`外观`})}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`颜色模式`}),(0,p.jsx)(`div`,{className:`flex rounded overflow-hidden border border-border text-[11px]`,children:[`system`,`dark`,`light`].map((t,n)=>{let r=t===`system`?`跟随系统`:t===`dark`?`深色`:`浅色`,i=e.theme===t;return(0,p.jsx)(`button`,{onClick:()=>O(t),className:[`px-3 py-1 transition-colors`,n>0?`border-l border-border`:``,i?`bg-accent text-white`:`text-text-secondary hover:text-text hover:bg-surface-3`].join(` `),children:r},t)})})]})]}),y&&(0,p.jsx)(`div`,{className:`text-[11px] text-status-success`,children:`已保存`})]}),_===`debug`&&(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`DevTools Protocol`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后可通过 DevTools Protocol 连接调试模拟器。配置变更需要重启应用后生效。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 DevTools Protocol`}),(0,p.jsx)(h,{checked:e.cdp.enabled,onClick:E})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`调试端口`}),(0,p.jsx)(`input`,{type:`number`,min:1024,max:65535,value:x,onChange:e=>S(e.target.value),disabled:!e.cdp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.cdp.enabled?1:.4}}),(0,p.jsxs)(`span`,{className:`text-[11px] text-text-dim`,children:[`默认 `,9222]})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:n?.active?`var(--color-status-success)`:`var(--color-text-dim)`}}),(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:n?.active?`CDP 已激活 - 端口 ${n.activePort}`:`CDP 未激活`})]}),n?.implicitDevDefault&&(0,p.jsx)(`div`,{className:`text-[11px] text-text-dim`,children:`当前为开发模式默认端口`}),n?.active&&(0,p.jsxs)(`div`,{className:`text-[11px] text-text-dim font-mono`,children:[`调试地址: http://localhost:`,n.activePort]})]}),j&&(0,p.jsx)(`div`,{className:`rounded px-3 py-2 text-[12px] border bg-warn-bg text-[var(--color-status-warn)]`,children:`配置已变更,需要重启应用后生效`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`button`,{onClick:A,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),y&&(0,p.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]}),_===`mcp`&&(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`MCP 配置`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`AI 助手可以通过 MCP 连接当前开发工具,读取 console、截图、执行 JS、查看 DOM / Storage / 网络请求。启用后开发工具启动时会自动监听 SSE 端点,并自动启用 CDP。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 MCP 服务`}),(0,p.jsx)(h,{checked:e.mcp.enabled,onClick:D})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`SSE 端口`}),(0,p.jsx)(`input`,{type:`number`,min:1024,max:65535,value:C,onChange:e=>w(e.target.value),disabled:!e.mcp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.mcp.enabled?1:.4}}),(0,p.jsx)(`span`,{className:`text-[11px] text-text-dim`,children:`默认 7789`})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),e.mcp.enabled?d?.running?(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-status-success)`}}),(0,p.jsxs)(`span`,{className:`text-[12px] text-text-secondary`,children:[`MCP 已运行 - 端口 `,d.activePort]})]}):(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-status-error, #e54d4d)`}}),(0,p.jsxs)(`span`,{className:`text-[12px] text-text-secondary`,children:[`MCP 未运行`,d?.error===`port-in-use`?`(端口 ${d.configuredPort} 已被占用)`:d?.error?`(${d.error})`:``]})]}):(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-text-dim)`}}),(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`MCP 未启用`})]})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium mb-2 text-text-secondary`,children:"`.mcp.json` 示例(SSE 传输)"}),(0,p.jsx)(`pre`,{className:`text-[11px] whitespace-pre-wrap leading-relaxed text-[var(--color-code-blue)] font-mono`,children:`{
1
+ import{r as e}from"./chunk-DPI0Y_ll.js";import{C as t,E as n,w as r}from"./ipc-transport-BKWkvwKK.js";import{t as i}from"./constants-DI382mTP.js";import{a,c as o,d as s,i as c,l,r as u}from"./settings-api-DkrPHroq.js";var d=e(r(),1),f=e(n(),1),p=t(),m=[{id:`general`,label:`通用`},{id:`debug`,label:`调试`},{id:`mcp`,label:`MCP`}];function h({checked:e,onClick:t}){return(0,p.jsx)(`button`,{type:`button`,onClick:t,className:`relative inline-flex h-5 w-9 shrink-0 rounded-full transition-colors`,style:{background:e?`var(--color-accent)`:`var(--color-surface-3)`},children:(0,p.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform`,style:{marginTop:3,transform:e?`translateX(18px)`:`translateX(3px)`}})})}function g(){let[e,t]=(0,f.useState)({cdp:{enabled:!1,port:i},mcp:{enabled:!1,port:7789},compile:{watch:!0},theme:`system`}),[n,r]=(0,f.useState)(null),[d,g]=(0,f.useState)(null),[_,v]=(0,f.useState)(`general`),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(String(i)),[C,w]=(0,f.useState)(`7789`);(0,f.useEffect)(()=>{let e=o(e=>{t(e.settings),S(String(e.settings.cdp.port)),w(String(e.settings.mcp.port))});return a().then(e=>{t(e),S(String(e.cdp.port)),w(String(e.mcp.port))}),u().then(r),c().then(g),e},[]);function T(){b(!0),window.setTimeout(()=>b(!1),2e3)}function E(){t(e=>({...e,cdp:{...e.cdp,enabled:!e.cdp.enabled}}))}function D(){t(e=>({...e,mcp:{...e.mcp,enabled:!e.mcp.enabled}}))}function O(n){let r={...e,theme:n};t(r),s(n),l(r)}function k(n){let r={...e,compile:{...e.compile,watch:n}};t(r),l(r).then(T)}async function A(){let n=parseInt(x,10);if(Number.isNaN(n)||n<1024||n>65535)return;let i=parseInt(C,10);if(Number.isNaN(i)||i<1024||i>65535)return;let a={...e,cdp:{...e.cdp,port:n},mcp:{...e.mcp,port:i}};t(a),await l(a),r(await u()),g(await c()),T()}let j=n&&!n.implicitDevDefault&&(e.cdp.enabled!==n.active||e.cdp.enabled&&n.active&&e.cdp.port!==n.activePort);return(0,p.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,p.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:m.map(e=>(0,p.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${_===e.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>v(e.id),children:e.label},e.id))}),(0,p.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[_===`general`&&(0,p.jsxs)(`div`,{className:`space-y-4`,children:[(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`编译`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后,打开项目时会监听源文件改动并自动重新编译。关闭则只在打开/手动重新编译时构建。配置在下次打开项目时生效。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`监听文件变化自动编译`}),(0,p.jsx)(h,{checked:e.compile.watch,onClick:()=>k(!e.compile.watch)})]})]}),(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-3 bg-bg`,children:[(0,p.jsx)(`div`,{children:(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`外观`})}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`颜色模式`}),(0,p.jsx)(`div`,{className:`flex rounded overflow-hidden border border-border text-[11px]`,children:[`system`,`dark`,`light`].map((t,n)=>{let r=t===`system`?`跟随系统`:t===`dark`?`深色`:`浅色`,i=e.theme===t;return(0,p.jsx)(`button`,{onClick:()=>O(t),className:[`px-3 py-1 transition-colors`,n>0?`border-l border-border`:``,i?`bg-accent text-white`:`text-text-secondary hover:text-text hover:bg-surface-3`].join(` `),children:r},t)})})]})]}),y&&(0,p.jsx)(`div`,{className:`text-[11px] text-status-success`,children:`已保存`})]}),_===`debug`&&(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`DevTools Protocol`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后可通过 DevTools Protocol 连接调试模拟器。配置变更需要重启应用后生效。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 DevTools Protocol`}),(0,p.jsx)(h,{checked:e.cdp.enabled,onClick:E})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`调试端口`}),(0,p.jsx)(`input`,{type:`number`,min:1024,max:65535,value:x,onChange:e=>S(e.target.value),disabled:!e.cdp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.cdp.enabled?1:.4}}),(0,p.jsxs)(`span`,{className:`text-[11px] text-text-dim`,children:[`默认 `,9222]})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:n?.active?`var(--color-status-success)`:`var(--color-text-dim)`}}),(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:n?.active?`CDP 已激活 - 端口 ${n.activePort}`:`CDP 未激活`})]}),n?.implicitDevDefault&&(0,p.jsx)(`div`,{className:`text-[11px] text-text-dim`,children:`当前为开发模式默认端口`}),n?.active&&(0,p.jsxs)(`div`,{className:`text-[11px] text-text-dim font-mono`,children:[`调试地址: http://localhost:`,n.activePort]})]}),j&&(0,p.jsx)(`div`,{className:`rounded px-3 py-2 text-[12px] border bg-warn-bg text-[var(--color-status-warn)]`,children:`配置已变更,需要重启应用后生效`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`button`,{onClick:A,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),y&&(0,p.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]}),_===`mcp`&&(0,p.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`MCP 配置`}),(0,p.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`AI 助手可以通过 MCP 连接当前开发工具,读取 console、截图、执行 JS、查看 DOM / Storage / 网络请求。启用后开发工具启动时会自动监听 SSE 端点,并自动启用 CDP。`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 MCP 服务`}),(0,p.jsx)(h,{checked:e.mcp.enabled,onClick:D})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`SSE 端口`}),(0,p.jsx)(`input`,{type:`number`,min:1024,max:65535,value:C,onChange:e=>w(e.target.value),disabled:!e.mcp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.mcp.enabled?1:.4}}),(0,p.jsx)(`span`,{className:`text-[11px] text-text-dim`,children:`默认 7789`})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),e.mcp.enabled?d?.running?(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-status-success)`}}),(0,p.jsxs)(`span`,{className:`text-[12px] text-text-secondary`,children:[`MCP 已运行 - 端口 `,d.activePort]})]}):(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-status-error, #e54d4d)`}}),(0,p.jsxs)(`span`,{className:`text-[12px] text-text-secondary`,children:[`MCP 未运行`,d?.error===`port-in-use`?`(端口 ${d.configuredPort} 已被占用)`:d?.error?`(${d.error})`:``]})]}):(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:`var(--color-text-dim)`}}),(0,p.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`MCP 未启用`})]})]}),(0,p.jsxs)(`div`,{className:`rounded p-3 border border-border bg-surface`,children:[(0,p.jsx)(`div`,{className:`text-[11px] font-medium mb-2 text-text-secondary`,children:"`.mcp.json` 示例(SSE 传输)"}),(0,p.jsx)(`pre`,{className:`text-[11px] whitespace-pre-wrap leading-relaxed text-[var(--color-code-blue)] font-mono`,children:`{
2
2
  "mcpServers": {
3
3
  "dimina-devtools": {
4
4
  "url": "http://127.0.0.1:${e.mcp.port}/sse"
5
5
  }
6
6
  }
7
7
  }`})]}),(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`button`,{onClick:A,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),y&&(0,p.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]})]})]})}d.createRoot(document.getElementById(`root`)).render((0,p.jsx)(g,{}));
8
- //# sourceMappingURL=workbenchSettings-CFrdVOiP.js.map
8
+ //# sourceMappingURL=workbenchSettings-EaMYvKHG.js.map
@@ -28,17 +28,17 @@
28
28
  overflow: hidden;
29
29
  }
30
30
  </style>
31
- <script type="module" crossorigin src="../../assets/index-Bx4XqFQ2.js"></script>
31
+ <script type="module" crossorigin src="../../assets/index-BFwsvw4p.js"></script>
32
32
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
33
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-21qDpt9Y.js">
33
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BKWkvwKK.js">
34
34
  <link rel="modulepreload" crossorigin href="../../assets/editor.api2-BTaYmRq7.js">
35
35
  <link rel="modulepreload" crossorigin href="../../assets/monaco.contribution-B7rUMaEv.js">
36
- <link rel="modulepreload" crossorigin href="../../assets/input-J1MQ5fra.js">
37
- <link rel="modulepreload" crossorigin href="../../assets/select-BgWAbMot.js">
36
+ <link rel="modulepreload" crossorigin href="../../assets/input-hGF71bn3.js">
37
+ <link rel="modulepreload" crossorigin href="../../assets/select-Bb1AKeSq.js">
38
38
  <link rel="modulepreload" crossorigin href="../../assets/workers-CRBS0W-v.js">
39
- <link rel="modulepreload" crossorigin href="../../assets/settings-api-Dit4oL6S.js">
39
+ <link rel="modulepreload" crossorigin href="../../assets/settings-api-DkrPHroq.js">
40
40
  <link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
41
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-CVp38I_M.css">
41
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Cg1q1gwD.css">
42
42
  <link rel="stylesheet" crossorigin href="../../assets/editor-CWI9TnMM.css">
43
43
  </head>
44
44
  <body>
@@ -8,13 +8,13 @@
8
8
  <style>
9
9
  html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent !important; }
10
10
  </style>
11
- <script type="module" crossorigin src="../../assets/popover-ChIUUEdj.js"></script>
11
+ <script type="module" crossorigin src="../../assets/popover-NNQNyjgI.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
13
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-21qDpt9Y.js">
14
- <link rel="modulepreload" crossorigin href="../../assets/input-J1MQ5fra.js">
15
- <link rel="modulepreload" crossorigin href="../../assets/select-BgWAbMot.js">
13
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BKWkvwKK.js">
14
+ <link rel="modulepreload" crossorigin href="../../assets/input-hGF71bn3.js">
15
+ <link rel="modulepreload" crossorigin href="../../assets/select-Bb1AKeSq.js">
16
16
  <link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
17
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-CVp38I_M.css">
17
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Cg1q1gwD.css">
18
18
  </head>
19
19
  <body>
20
20
  <div id="root"></div>
@@ -5,12 +5,12 @@
5
5
  <!-- See main/index.html for CSP rationale. -->
6
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
7
7
  <title>Settings</title>
8
- <script type="module" crossorigin src="../../assets/settings-CGea5k_R.js"></script>
8
+ <script type="module" crossorigin src="../../assets/settings-7uwimev-.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
10
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-21qDpt9Y.js">
11
- <link rel="modulepreload" crossorigin href="../../assets/input-J1MQ5fra.js">
12
- <link rel="modulepreload" crossorigin href="../../assets/settings-api-Dit4oL6S.js">
13
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-CVp38I_M.css">
10
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BKWkvwKK.js">
11
+ <link rel="modulepreload" crossorigin href="../../assets/input-hGF71bn3.js">
12
+ <link rel="modulepreload" crossorigin href="../../assets/settings-api-DkrPHroq.js">
13
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Cg1q1gwD.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -6,12 +6,12 @@
6
6
  <!-- See entries/main/index.html for CSP rationale. -->
7
7
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
8
8
  <title>开发工具设置</title>
9
- <script type="module" crossorigin src="../../assets/workbenchSettings-CFrdVOiP.js"></script>
9
+ <script type="module" crossorigin src="../../assets/workbenchSettings-EaMYvKHG.js"></script>
10
10
  <link rel="modulepreload" crossorigin href="../../assets/chunk-DPI0Y_ll.js">
11
- <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-21qDpt9Y.js">
12
- <link rel="modulepreload" crossorigin href="../../assets/settings-api-Dit4oL6S.js">
11
+ <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-BKWkvwKK.js">
12
+ <link rel="modulepreload" crossorigin href="../../assets/settings-api-DkrPHroq.js">
13
13
  <link rel="modulepreload" crossorigin href="../../assets/constants-DI382mTP.js">
14
- <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-CVp38I_M.css">
14
+ <link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Cg1q1gwD.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -39,7 +39,6 @@ export interface NativeDeviceInfo {
39
39
  screenWidth: number;
40
40
  screenHeight: number;
41
41
  statusBarHeight: number;
42
- safeAreaBottom: number;
43
42
  notchType: NotchType;
44
43
  safeAreaInsets: SafeAreaInsets;
45
44
  }
@@ -131,6 +130,7 @@ export declare const WorkbenchSettingsChannel: {
131
130
  readonly GetCdpStatus: "workbenchSettings:getCdpStatus";
132
131
  readonly GetMcpStatus: "workbenchSettings:getMcpStatus";
133
132
  readonly Init: "workbenchSettings:init";
133
+ readonly ThemeChanged: "workbenchSettings:themeChanged";
134
134
  };
135
135
  export declare const ProjectChannel: {
136
136
  readonly Open: "project:open";
@@ -250,12 +250,6 @@ export declare const WindowChannel: {
250
250
  };
251
251
  export declare const AppChannel: {
252
252
  readonly GetBranding: "app:getBranding";
253
- readonly GetHeaderAvatar: "app:getHeaderAvatar";
254
- readonly InvokeHeaderAvatar: "app:invokeHeaderAvatar";
255
- readonly HeaderAvatarChanged: "app:headerAvatarChanged";
256
- readonly GetHeaderActions: "app:getHeaderActions";
257
- readonly InvokeHeaderAction: "app:invokeHeaderAction";
258
- readonly HeaderActionsChanged: "app:headerActionsChanged";
259
253
  };
260
254
  export declare const MiniappSnapshotChannel: {
261
255
  readonly Push: "miniapp-snapshot:push";
@@ -100,6 +100,13 @@ export const WorkbenchSettingsChannel = {
100
100
  GetCdpStatus: 'workbenchSettings:getCdpStatus',
101
101
  GetMcpStatus: 'workbenchSettings:getMcpStatus',
102
102
  Init: 'workbenchSettings:init',
103
+ // Main → renderer push: the active color scheme flipped (OS change or in-app
104
+ // SetTheme). Payload is `isDark: boolean`. The app's CSS reacts to
105
+ // `prefers-color-scheme` automatically; this exists for the few JS consumers
106
+ // (Monaco's theme) that can't observe that media change — Electron does NOT
107
+ // dispatch the renderer's `matchMedia('(prefers-color-scheme)')` change event
108
+ // for programmatic `nativeTheme.themeSource` assignments.
109
+ ThemeChanged: 'workbenchSettings:themeChanged',
103
110
  };
104
111
  // ── Project session ──────────────────────────────────────────────────────
105
112
  export const ProjectChannel = {
@@ -235,12 +242,6 @@ export const WindowChannel = {
235
242
  // ── App ──────────────────────────────────────────────────────────────────
236
243
  export const AppChannel = {
237
244
  GetBranding: 'app:getBranding',
238
- GetHeaderAvatar: 'app:getHeaderAvatar',
239
- InvokeHeaderAvatar: 'app:invokeHeaderAvatar',
240
- HeaderAvatarChanged: 'app:headerAvatarChanged',
241
- GetHeaderActions: 'app:getHeaderActions',
242
- InvokeHeaderAction: 'app:invokeHeaderAction',
243
- HeaderActionsChanged: 'app:headerActionsChanged',
244
245
  };
245
246
  // ── miniappSnapshot (unified panel snapshot framework) ───────────────────
246
247
  //
@@ -60,7 +60,6 @@ export declare const SimulatorSetDeviceInfoSchema: z.ZodTuple<[z.ZodObject<{
60
60
  screenWidth: z.ZodNumber;
61
61
  screenHeight: z.ZodNumber;
62
62
  statusBarHeight: z.ZodNumber;
63
- safeAreaBottom: z.ZodNumber;
64
63
  notchType: z.ZodEnum<{
65
64
  none: "none";
66
65
  notch: "notch";
@@ -93,7 +93,6 @@ export const SimulatorSetDeviceInfoSchema = z.tuple([
93
93
  screenWidth: z.number().int().min(100).max(4000),
94
94
  screenHeight: z.number().int().min(100).max(4000),
95
95
  statusBarHeight: z.number().finite().min(0).max(400),
96
- safeAreaBottom: z.number().finite().min(0).max(400),
97
96
  notchType: z.enum(['none', 'notch', 'dynamic-island']),
98
97
  safeAreaInsets: z.object({
99
98
  top: z.number().finite().min(0).max(400),
@@ -60,42 +60,6 @@ export interface CompilationAdapter {
60
60
  }
61
61
  export type BuiltinPanelId = 'wxml' | 'console' | 'appdata' | 'storage';
62
62
  export type BuiltinModuleId = 'projects' | 'session' | 'simulator' | 'popover' | 'settings';
63
- /**
64
- * Small, serialisable profile shape rendered by the built-in project header.
65
- * Hosts own the source of truth; devtools only reads this DTO and paints the
66
- * avatar slot in the fixed header toolbar.
67
- */
68
- export interface HeaderAvatarInfo {
69
- /** User-facing name used for tooltip/aria text and fallback initials. */
70
- displayName?: string;
71
- /** Explicit fallback text when the image is absent or fails to load. */
72
- displayInitial?: string;
73
- /** Image URL or data URL for the account avatar. */
74
- avatarUrl?: string;
75
- /** Optional tooltip override. Defaults to displayName or "用户头像". */
76
- tooltip?: string;
77
- }
78
- export type HeaderAvatarProvider = () => HeaderAvatarInfo | null | undefined | Promise<HeaderAvatarInfo | null | undefined>;
79
- export type HeaderActionPlacement = 'left' | 'center' | 'right';
80
- /**
81
- * Small, serialisable command shape rendered inside the built-in project
82
- * header. This is for compact host commands that must align with the
83
- * existing header groups; richer host-owned toolbar UIs should use the host
84
- * toolbar WCV.
85
- */
86
- export interface HeaderActionInfo {
87
- /** Stable command id passed back to `headerActionHandler`. */
88
- id: string;
89
- /** Short button label. Keep this compact; the header is height-constrained. */
90
- label: string;
91
- /** Optional tooltip override. Defaults to label. */
92
- tooltip?: string;
93
- /** Header group to render into. Defaults to right. */
94
- placement?: HeaderActionPlacement;
95
- /** Render as disabled while preserving layout. */
96
- disabled?: boolean;
97
- }
98
- export type HeaderActionsProvider = () => HeaderActionInfo[] | null | undefined | Promise<HeaderActionInfo[] | null | undefined>;
99
63
  export interface WorkbenchConfig {
100
64
  /** Window title, default 'Dimina DevTools' */
101
65
  appName?: string;
@@ -118,21 +82,6 @@ export interface WorkbenchConfig {
118
82
  }> | {
119
83
  appName: string;
120
84
  };
121
- /**
122
- * Optional host-owned profile provider for the built-in header avatar slot.
123
- * Return null/undefined to hide the slot.
124
- */
125
- headerAvatarProvider?: HeaderAvatarProvider;
126
- /** Optional click handler for the built-in header avatar slot. */
127
- headerAvatarActionHandler?: () => void | Promise<void>;
128
- /**
129
- * Optional compact host commands rendered inside the built-in project
130
- * header. Use this only for a handful of header-adjacent commands; use the
131
- * host toolbar WCV for richer/custom toolbar UI.
132
- */
133
- headerActionsProvider?: HeaderActionsProvider;
134
- /** Handles clicks from actions returned by `headerActionsProvider`. */
135
- headerActionHandler?: (id: string) => void | Promise<void>;
136
85
  /**
137
86
  * @deprecated Ignored. The devtools toolbar header is fixed at 40px
138
87
  * (`HEADER_H` in `shared/constants`). Hosts that need their own toolbar
@@ -159,6 +108,14 @@ export interface WorkbenchWindowConfig {
159
108
  height?: number;
160
109
  minWidth?: number;
161
110
  minHeight?: number;
111
+ /**
112
+ * Auto-show the main window on `ready-to-show`. Defaults to `true`. Set
113
+ * `false` when the host gates the window behind its own startup flow (e.g. a
114
+ * login screen) and wants to call `mainWindow.show()` itself once ready —
115
+ * avoids an un-authed window flashing on screen. Does not affect the test
116
+ * environment, which always uses `showInactive()` (e2e depends on it).
117
+ */
118
+ autoShow?: boolean;
162
119
  }
163
120
  export interface UpdateInfo {
164
121
  /** New version string (e.g. '1.2.0') */
@@ -203,16 +160,6 @@ export interface WorkbenchHostInstance {
203
160
  * The returned Disposable removes only the registration it created.
204
161
  */
205
162
  registerSimulatorApi(name: string, handler: SimulatorApiHandler): import('@dimina-kit/electron-deck/main').Disposable;
206
- /**
207
- * Ask the main renderer to re-read `headerAvatarProvider`. Hosts should call
208
- * this after their current-user state changes.
209
- */
210
- refreshHeaderAvatar(): void;
211
- /**
212
- * Ask the main renderer to re-read `headerActionsProvider`. Hosts should
213
- * call this after action labels/disabled states change.
214
- */
215
- refreshHeaderActions(): void;
216
163
  }
217
164
  /**
218
165
  * Pluggable backend for the project-list panel. Hosts may supply this to
@@ -266,6 +213,15 @@ export interface WorkbenchAppConfig extends WorkbenchConfig {
266
213
  onSetup?: (instance: WorkbenchHostInstance) => void | Promise<void>;
267
214
  /** Called before window close when a session is active. Session disposal happens automatically after this hook. */
268
215
  onBeforeClose?: (instance: WorkbenchHostInstance) => void | Promise<void>;
216
+ /**
217
+ * Called before a project is opened, BEFORE any side effect (session
218
+ * teardown, compile, dev-server). Use to gate the open on login/permission
219
+ * state. THROW to veto: `openProject` then resolves `{ success: false,
220
+ * error }`, leaves any currently-active session untouched, and never spins
221
+ * up the adapter. Resolve normally (or omit) to allow the open. The
222
+ * declarative alternative to monkey-patching `workspace.openProject`.
223
+ */
224
+ onBeforeOpenProject?: (projectPath: string) => void | Promise<void>;
269
225
  /** Custom update checker. If provided, enables the check-for-updates feature. */
270
226
  updateChecker?: UpdateChecker;
271
227
  /** Extra options applied when an updateChecker is provided. */
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./jsx-runtime-P6ZegaOf.js";import{t as n}from"./bridge-channels-BUQ5AbvJ.js";var r=e(),i=new Set([`audioListen`]);function a(e){return i.has(e)}function o(e,t,n,r){let i=e.apiRegistry[t];if(!i)return r({ok:!1,errMsg:`${t}:fail no handler`}),Promise.resolve();let o=a(t)||(n&&typeof n==`object`&&!Array.isArray(n)?n.keep===!0:!1);return new Promise(a=>{let s=!1,c=e=>{if(s){o&&e.ok&&r({...e,keep:!0});return}s=!0,r(o&&e.ok?{...e,keep:!0}:e),a()},l=Symbol(`sim-cb-success`),u=Symbol(`sim-cb-fail`),d=Symbol(`sim-cb-complete`),f=Object.create(e);f.createCallbackFunction=e=>{if(e!=null)return(...n)=>{let r=n[0];e===l?c({ok:!0,result:r}):e===u&&c({ok:!1,errMsg:r&&typeof r==`object`&&`errMsg`in r?String(r.errMsg):`${t}:fail`,result:r})}};let p=n&&typeof n==`object`&&!Array.isArray(n)?{...n}:{},m=p.success!==void 0&&p.success!==null,h=p.fail!==void 0&&p.fail!==null,g=p.complete!==void 0&&p.complete!==null;p.success=l,p.fail=u,g&&(p.complete=d);try{let e=i.call(f,p);if(e&&typeof e.then==`function`){Promise.resolve(e).then(e=>c({ok:!0,result:e}),e=>{c({ok:!1,errMsg:`${t}:fail ${e instanceof Error?e.message:String(e)}`})});return}!m&&!h&&(o?a():c({ok:!0,result:e}))}catch(e){c({ok:!1,errMsg:`${t}:fail ${e instanceof Error?e.message:String(e)}`})}})}var s=t();function c({platform:e,statusBarHeight:t,textStyle:n}){let r=e===`ios`?87:95,i=t+(e===`ios`?4:6),a=e===`ios`?7:10;return(0,s.jsxs)(`div`,{className:`menu-capsule menu-capsule--${n}`,style:{width:r,height:32,top:i,right:a},"aria-hidden":`true`,children:[(0,s.jsxs)(`div`,{className:`menu-capsule__more`,children:[(0,s.jsx)(`span`,{}),(0,s.jsx)(`span`,{}),(0,s.jsx)(`span`,{})]}),(0,s.jsx)(`div`,{className:`menu-capsule__divider`}),(0,s.jsx)(`div`,{className:`menu-capsule__close`,children:(0,s.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,fill:`none`,strokeLinecap:`round`})})})]})}var l={linear:`linear`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`};function u({state:e,stackDepth:t,platform:n,statusBarHeight:i,navBarHeight:a,onBack:o,onHome:u}){let d=(0,r.useMemo)(()=>{if(!e.colorAnimation||e.colorAnimation.durationMs<=0)return;let t=l[e.colorAnimation.timingFunc]??`linear`;return`background-color ${e.colorAnimation.durationMs}ms ${t}, color ${e.colorAnimation.durationMs}ms ${t}`},[e.colorAnimation]),f=e.style===`custom`,p=t>1,m=!p&&e.homeButtonVisible,h=n===`ios`?`center`:`left`,g={backgroundColor:e.backgroundColor,color:e.textStyle===`white`?`#ffffff`:`#000000`,height:i+a,paddingTop:i,transition:d};return(0,s.jsxs)(`header`,{className:`nav-bar nav-bar--${n} nav-bar--${e.textStyle}${f?` nav-bar--custom`:``}`,style:g,"aria-hidden":f,children:[!f&&(0,s.jsxs)(`div`,{className:`nav-bar__row`,style:{height:a,justifyContent:h===`center`?`center`:`flex-start`},children:[(p||m)&&(0,s.jsxs)(`div`,{className:`nav-bar__leading`,children:[p&&(0,s.jsx)(`button`,{type:`button`,className:`nav-bar__back`,"aria-label":`Back`,onClick:o,children:(0,s.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M15 18l-6-6 6-6`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),m&&(0,s.jsx)(`button`,{type:`button`,className:`nav-bar__home`,"aria-label":`Home`,onClick:u,children:(0,s.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`22`,height:`22`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M3 12l9-9 9 9M5 10v10h14V10`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),(0,s.jsxs)(`div`,{className:`nav-bar__title nav-bar__title--${h}`,style:{color:e.textStyle===`white`?`#ffffff`:`#000000`},children:[e.loading&&(0,s.jsx)(`span`,{className:`nav-bar__spinner`,"aria-hidden":`true`}),(0,s.jsx)(`span`,{className:`nav-bar__title-text`,children:e.title})]})]}),(0,s.jsx)(c,{platform:n,statusBarHeight:i,textStyle:e.textStyle})]})}function d(e){return{title:e?.title??``,backgroundColor:e?.backgroundColor??`#000000`,textStyle:e?.textStyle??`white`,style:e?.style??`default`,loading:e?.loading??!1,homeButtonVisible:e?.homeButtonVisible??!1,colorAnimation:e?.colorAnimation}}function f(e){switch(e){case`notch`:return{width:164,height:30,top:0,bottomOnly:!0};case`dynamic-island`:return{width:124,height:36,top:11,bottomOnly:!1};default:return null}}function p({height:e,notchType:t,textStyle:n}){let r=f(t);return(0,s.jsxs)(`div`,{className:`device-statusbar`,style:{height:e,color:n===`black`?`#000000`:`#ffffff`},"aria-hidden":`true`,children:[(0,s.jsx)(`span`,{className:`device-statusbar__time`,children:`9:41`}),r&&(0,s.jsx)(`div`,{className:`device-statusbar__notch`,style:{width:r.width,height:r.height,top:r.top,borderRadius:r.bottomOnly?`0 0 ${Math.round(r.height*.6)}px ${Math.round(r.height*.6)}px`:`${r.height/2}px`}}),(0,s.jsxs)(`div`,{className:`device-statusbar__icons`,children:[(0,s.jsx)(`span`,{className:`device-statusbar__signal`}),(0,s.jsx)(`span`,{className:`device-statusbar__wifi`}),(0,s.jsx)(`span`,{className:`device-statusbar__battery`})]})]})}function m({state:e,currentPath:t,resourceBaseUrl:n,appId:r,onSwitch:i,bottomInset:a=0}){if(!e.config||!e.visible)return null;let{color:o,selectedColor:c,backgroundColor:l,borderStyle:u,list:d}=e.config,f=o||`#999999`,p=c||`#1890ff`;return(0,s.jsx)(`div`,{className:`dmb-tab-bar`,style:{backgroundColor:l||`#ffffff`,borderTopColor:u===`white`?`#ffffff`:`#e0e0e0`,paddingBottom:a},role:`tablist`,"aria-label":`TabBar`,children:d.map((a,o)=>{let c=h(a.pagePath),l=c===t,u=g(l?a.selectedIconPath??a.iconPath:a.iconPath,n,r),d=e.badges[o]??``,m=e.redDots[o]??!1;return(0,s.jsxs)(`button`,{type:`button`,className:`dmb-tab-bar__item${l?` is-selected`:``}`,role:`tab`,"aria-selected":l,onClick:()=>i(c),children:[u&&(0,s.jsx)(`span`,{className:`dmb-tab-bar__icon-slot`,children:(0,s.jsx)(`img`,{className:`dmb-tab-bar__icon`,src:u,alt:``,onError:e=>{e.currentTarget.style.display=`none`}})}),(0,s.jsx)(`span`,{className:`dmb-tab-bar__text`,style:{color:l?p:f},children:a.text||``}),d&&(0,s.jsx)(`span`,{className:`dmb-tab-bar__badge`,children:d}),!d&&m&&(0,s.jsx)(`span`,{className:`dmb-tab-bar__red-dot`})]},`${c}-${o}`)})})}function h(e){return e?e.replace(/^\/+/,``):``}function g(e,t,n){if(!e)return null;let r=e.trim();if(!r)return null;if(/^(?:data:|blob:|https?:|\/\/)/i.test(r))return r;if(!t)return null;let i=r.replace(/^\/+/,``).replace(/^\.\//,``);return i.startsWith(`${n}/`)?_(t,i.slice(n.length+1)):_(t,i)}function _(e,t){return`${e.endsWith(`/`)?e:`${e}/`}${t.replace(/^\/+/,``)}`}function v(e){if(!e)return{config:null,visible:!1,badges:[],redDots:[]};let t=e.list.length;return{config:y(e),visible:!0,badges:Array.from({length:t},()=>``),redDots:Array.from({length:t},()=>!1)}}function y(e){return{...e,list:e.list.map(e=>({...e}))}}function b(e,t){switch(t.kind){case`reset`:return{state:v(t.config),ok:!0,errMsg:`reset:ok`};case`visibility`:return{state:{...e,visible:t.visible},ok:!0,errMsg:t.visible?`showTabBar:ok`:`hideTabBar:ok`};case`apply`:return x(e,t.name,t.params)}}function x(e,t,n){if(!e.config)return{state:e,ok:!1,errMsg:`${t}:fail tabBar not configured`};switch(t){case`setTabBarStyle`:return S(e,n);case`setTabBarItem`:return C(e,n);case`showTabBar`:return{state:{...e,visible:!0},ok:!0,errMsg:`showTabBar:ok`};case`hideTabBar`:return{state:{...e,visible:!1},ok:!0,errMsg:`hideTabBar:ok`};case`setTabBarBadge`:return w(e,n);case`removeTabBarBadge`:return T(e,n);case`showTabBarRedDot`:return E(e,n,!0);case`hideTabBarRedDot`:return E(e,n,!1)}}function S(e,t){if(!e.config)return{state:e,ok:!1,errMsg:`setTabBarStyle:fail tabBar not configured`};let n={...e.config},r=(e,t)=>{let r=O(t);r&&(n[e]=r)};return r(`color`,t.color),r(`selectedColor`,t.selectedColor),r(`backgroundColor`,t.backgroundColor),(t.borderStyle===`black`||t.borderStyle===`white`)&&(n.borderStyle=t.borderStyle),{state:{...e,config:n},ok:!0,errMsg:`setTabBarStyle:ok`}}function C(e,t){let n=D(e,t);if(n.err)return{state:e,ok:!1,errMsg:`setTabBarItem:fail ${n.err}`};if(!e.config)return{state:e,ok:!1,errMsg:`setTabBarItem:fail tabBar not configured`};let r=e.config.list[n.index],i={...r,text:typeof t.text==`string`?t.text:r.text,iconPath:typeof t.iconPath==`string`?t.iconPath:r.iconPath,selectedIconPath:typeof t.selectedIconPath==`string`?t.selectedIconPath:r.selectedIconPath},a=[...e.config.list];return a[n.index]=i,{state:{...e,config:{...e.config,list:a}},ok:!0,errMsg:`setTabBarItem:ok`}}function w(e,t){let n=D(e,t);if(n.err)return{state:e,ok:!1,errMsg:`setTabBarBadge:fail ${n.err}`};let r=[...e.badges];r[n.index]=String(t.text??``);let i=[...e.redDots];return i[n.index]=!1,{state:{...e,badges:r,redDots:i},ok:!0,errMsg:`setTabBarBadge:ok`}}function T(e,t){let n=D(e,t);if(n.err)return{state:e,ok:!1,errMsg:`removeTabBarBadge:fail ${n.err}`};let r=[...e.badges];return r[n.index]=``,{state:{...e,badges:r},ok:!0,errMsg:`removeTabBarBadge:ok`}}function E(e,t,n){let r=D(e,t);if(r.err)return{state:e,ok:!1,errMsg:`${n?`showTabBarRedDot`:`hideTabBarRedDot`}:fail ${r.err}`};let i=[...e.redDots];i[r.index]=n;let a=[...e.badges];return n&&(a[r.index]=``),{state:{...e,redDots:i,badges:a},ok:!0,errMsg:`${n?`showTabBarRedDot`:`hideTabBarRedDot`}:ok`}}function D(e,t){let n=e.config?.list??[],r=t.index,i=Number(r);return n.length?r==null||!Number.isInteger(i)||i<0||i>=n.length?{index:-1,err:`invalid index ${r}`}:{index:i,err:null}:{index:-1,err:`tabBar not configured`}}function O(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t.length>64?null:/[<>"';{}()\\]/.test(t)?/^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/-]+\)$/i.test(t)?t:null:t}function k(e){return e?e.replace(/^\/+/,``):``}function A(e){let[t,n]=(typeof e==`string`?e:``).split(`?`),r={};if(n)for(let e of n.split(`&`)){if(!e)continue;let t=e.indexOf(`=`),n=t>=0?e.slice(0,t):e,i=t>=0?e.slice(t+1):``;n&&(r[decodeURIComponent(n)]=decodeURIComponent(i))}return{pagePath:k(t),query:r}}function j(e){let t={};return e.isTab&&(t[e.pagePath]=[e]),{stack:[e],tabStacks:t,currentTabPath:e.isTab?e.pagePath:null}}function M(e){return e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:[...e.stack]}:e.tabStacks}function N(e,t){let n=e.stack[e.stack.length-1],r=[...e.stack,t];return{next:{...e,stack:r,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:r}:e.tabStacks},effects:n?[{kind:`lifecycle`,bridgeId:n.bridgeId,event:`pageHide`}]:[]}}function P(e,t){if(e.stack.length<=1)return{error:`no page to back`};let n=Math.min(Math.max(1,Number.isFinite(t)?t:1),e.stack.length-1),r=e.stack.slice(e.stack.length-n),i=e.stack.slice(0,e.stack.length-n),a=i[i.length-1],o={...e,stack:i,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:i}:e.tabStacks,currentTabPath:a.isTab?a.pagePath:e.currentTabPath},s=[];for(let e of r)s.push({kind:`lifecycle`,bridgeId:e.bridgeId,event:`pageUnload`}),s.push({kind:`closePage`,bridgeId:e.bridgeId});return s.push({kind:`lifecycle`,bridgeId:a.bridgeId,event:`pageShow`}),{next:o,effects:s}}function F(e,t){let n=e.stack[e.stack.length-1],r=[...e.stack.slice(0,e.stack.length-1),t],i={...e,stack:r,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:r}:e.tabStacks},a=[];return n&&(a.push({kind:`lifecycle`,bridgeId:n.bridgeId,event:`pageUnload`}),a.push({kind:`closePage`,bridgeId:n.bridgeId})),{next:i,effects:a}}function I(e,t){let n=new Set;for(let t of e.stack)n.add(t.bridgeId);for(let t of Object.values(e.tabStacks))for(let e of t)n.add(e.bridgeId);n.delete(t.bridgeId);let r=t.isTab?{[t.pagePath]:[t]}:{},i={stack:[t],tabStacks:r,currentTabPath:t.isTab?t.pagePath:null},a=[];for(let e of n)a.push({kind:`lifecycle`,bridgeId:e,event:`pageUnload`}),a.push({kind:`closePage`,bridgeId:e});return{next:i,effects:a}}function L(e,t,n){let r=e.stack[e.stack.length-1],i=M(e),a,o=i[t];if(o&&o.length>0)a=o;else if(n)a=[n];else throw Error(`[page-stack] switchTab to ${t} requires either a cached substack or a freshly-opened entry`);let s={...e,stack:a,tabStacks:{...i,[t]:a},currentTabPath:t},c=a[a.length-1],l=[];return r&&r.bridgeId!==c.bridgeId&&l.push({kind:`lifecycle`,bridgeId:r.bridgeId,event:`pageHide`}),n||l.push({kind:`lifecycle`,bridgeId:c.bridgeId,event:`pageShow`}),{next:s,effects:l}}function R(e){let t=new Map,n=e.stack[e.stack.length-1]?.bridgeId;for(let r of e.stack)t.set(r.bridgeId,{entry:r,visible:r.bridgeId===n});for(let n of Object.values(e.tabStacks))for(let e of n)t.has(e.bridgeId)||t.set(e.bridgeId,{entry:e,visible:!1});return Array.from(t.values())}function z(e,t){let n=e.navigationBarBackgroundColor??`#ffffff`,r=e.navigationBarTextStyle??`black`,i=e.navigationStyle??`default`;return d({title:e.navigationBarTitleText??t,backgroundColor:n,textStyle:r,style:i,homeButtonVisible:e.homeButton===!0})}function B(e,t,n){switch(t){case`setNavigationBarTitle`:return{...e,title:typeof n.title==`string`?n.title:e.title};case`setNavigationBarColor`:return H(e,n);case`showNavigationBarLoading`:return{...e,loading:!0};case`hideNavigationBarLoading`:return{...e,loading:!1};case`hideHomeButton`:return{...e,homeButtonVisible:!1};default:return e}}var V=[`linear`,`easeIn`,`easeOut`,`easeInOut`];function H(e,t){let n=typeof t.frontColor==`string`?t.frontColor.toLowerCase():void 0,r=n===`#ffffff`?`white`:n===`#000000`?`black`:e.textStyle,i=typeof t.backgroundColor==`string`?t.backgroundColor:e.backgroundColor,a=(()=>{let e=t.animation;if(!e||typeof e!=`object`)return;let n=e,r=typeof n.duration==`number`&&Number.isFinite(n.duration)?Math.max(0,n.duration):0,i=typeof n.timingFunc==`string`?n.timingFunc:`linear`;return{durationMs:r,timingFunc:V.includes(i)?i:`linear`}})();return{...e,textStyle:r,backgroundColor:i,colorAnimation:a}}function U(e,t,n){let r=e=>e.bridgeId===t?{...e,navBar:n(e.navBar)}:e,i=e.stack.map(r),a={};for(let[t,n]of Object.entries(e.tabStacks))a[t]=n.map(r);return{...e,stack:i,tabStacks:a}}var W=44,G=24,K=44;function q({miniApp:e,bridgeId:t,platform:i=`ios`}){let[a,c]=(0,r.useState)(()=>e.getInitialDevice());(0,r.useEffect)(()=>e.onSimulatorEvent(n.DEVICE_CHANGE,c),[e]);let l=a?.safeAreaInsets.top??(i===`ios`?W:G),d=a?.safeAreaInsets.bottom??0,f=a?.notchType??`none`,h=(0,r.useMemo)(()=>e.getRenderPreloadUrl(),[e]),g=(0,r.useMemo)(()=>e.getTabBarConfig(),[e]),_=(0,r.useMemo)(()=>({bridgeId:t,pagePath:k(e.pagePath),query:{...e.query},isTab:!!e.getTabBarConfig()?.list.some(t=>k(t.pagePath)===k(e.pagePath)),windowConfig:e.rootWindowConfig??{},navBar:z(e.rootWindowConfig??{},e.appId)}),[e,t]),[{shell:y,tabBar:x},S]=(0,r.useState)(()=>({shell:j(_),tabBar:v(g)})),C=(0,r.useRef)({shell:y,tabBar:x});(0,r.useEffect)(()=>{C.current={shell:y,tabBar:x}},[y,x]);let w=(0,r.useCallback)(t=>{for(let n of t)n.kind===`lifecycle`?e.notifyLifecycle(n.bridgeId,n.event):n.kind===`closePage`&&e.closePage(n.bridgeId)},[e]);(0,r.useEffect)(()=>e.onSimulatorEvent(n.NAV_BAR,e=>{S(t=>({...t,shell:U(t.shell,e.bridgeId,t=>B(t,e.name,e.params))}))}),[e]),(0,r.useEffect)(()=>e.onSimulatorEvent(n.TAB_ACTION,t=>{let n=b(C.current.tabBar,{kind:`apply`,name:t.name,params:t.params});S(e=>({...e,tabBar:n.state})),e.notifyNavCallback({ok:n.ok,errMsg:n.errMsg,callbacks:t.callbacks})}),[e]);let T=(0,r.useCallback)(async t=>{let n=(n,r)=>e.notifyNavCallback({ok:n,errMsg:r,callbacks:t.callbacks});try{switch(t.name){case`navigateTo`:await J(e,C,S,w,t,n);break;case`navigateBack`:Y(C,S,w,t,n);break;case`redirectTo`:await X(e,C,S,w,t,n);break;case`reLaunch`:await Z(e,C,S,w,t,n);break;case`switchTab`:await Q(e,C,S,w,t,n);break}}catch(e){n(!1,`${t.name}:fail ${e instanceof Error?e.message:String(e)}`)}},[e,w]);(0,r.useEffect)(()=>e.onSimulatorEvent(n.NAV_ACTION,e=>{T(e)}),[T,e]),(0,r.useEffect)(()=>e.onSimulatorEvent(n.API_CALL,t=>{o(e,t.name,t.params,n=>{e.notifyApiResponse({requestId:t.requestId,ok:n.ok,result:n.result,errMsg:n.errMsg,keep:n.keep})})}),[e]);let E=(0,r.useCallback)(()=>{if(C.current.shell.stack.length<=1)return;let t=C.current.shell.stack;T({appSessionId:e.appSessionId??``,bridgeId:t[t.length-1].bridgeId,name:`navigateBack`,params:{delta:1},callbacks:{}})},[e,T]),D=(0,r.useCallback)(t=>{let n=C.current.shell;t===n.currentTabPath&&n.stack.length===1||T({appSessionId:e.appSessionId??``,bridgeId:n.stack[n.stack.length-1].bridgeId,name:`switchTab`,params:{url:`/${t}`},callbacks:{}})},[e,T]),O=y.stack[y.stack.length-1],A=R(y);return(0,r.useEffect)(()=>{e.notifyActivePage(O.bridgeId)},[e,O.bridgeId]),(0,r.useEffect)(()=>{e.notifyPageStack(y.stack.map(e=>({pagePath:e.pagePath,query:e.query})))},[e,y.stack]),(0,s.jsx)(`main`,{className:`device-shell-root`,children:(0,s.jsxs)(`section`,{className:`device-shell`,"aria-label":`Dimina simulator`,style:a?{width:a.screenWidth,height:a.screenHeight}:void 0,children:[(0,s.jsx)(p,{height:l,notchType:f,textStyle:O.navBar.textStyle}),(0,s.jsx)(u,{state:O.navBar,stackDepth:y.stack.length,platform:i,statusBarHeight:l,navBarHeight:K,onBack:E}),(0,s.jsx)(`div`,{className:`device-shell__viewport`,children:A.map(({entry:t,visible:n})=>(0,s.jsx)(`webview`,{className:`device-shell__webview`,src:e.createRenderHostUrl(t.bridgeId,t.pagePath,t.isTab),preload:h,allowpopups:`true`,style:{display:n?`flex`:`none`,zIndex:n?100:1}},t.bridgeId))}),O.isTab&&(0,s.jsx)(m,{state:x,currentPath:y.currentTabPath,resourceBaseUrl:e.resourceBaseUrl,appId:e.appId,onSwitch:D,bottomInset:d}),d>0&&(0,s.jsx)(`div`,{className:`device-shell__home-indicator`,style:{height:d},"aria-hidden":`true`})]})})}async function J(e,t,n,r,i,a){let{pagePath:o,query:s}=A(i.params.url);if(!o){a(!1,`navigateTo:fail invalid url`);return}if(e.getTabBarConfig()?.list.some(e=>k(e.pagePath)===o)){a(!1,`navigateTo:fail can not navigateTo a tabbar page`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:z(c.windowConfig,e.appId)},{next:u,effects:d}=N(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`navigateTo:ok`)}function Y(e,t,n,r,i){let a=r.params.delta,o=Number.isFinite(Number(a))?Number(a):1,s=P(e.current.shell,o);if(`error`in s){i(!1,`navigateBack:fail ${s.error}`);return}t(e=>({...e,shell:s.next})),n(s.effects),i(!0,`navigateBack:ok`)}async function X(e,t,n,r,i,a){let{pagePath:o,query:s}=A(i.params.url);if(!o){a(!1,`redirectTo:fail invalid url`);return}if(e.getTabBarConfig()?.list.some(e=>k(e.pagePath)===o)){a(!1,`redirectTo:fail can not redirectTo a tabbar page`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:z(c.windowConfig,e.appId)},{next:u,effects:d}=F(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`redirectTo:ok`)}async function Z(e,t,n,r,i,a){let{pagePath:o,query:s}=A(i.params.url);if(!o){a(!1,`reLaunch:fail invalid url`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:z(c.windowConfig,e.appId)},{next:u,effects:d}=I(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`reLaunch:ok`)}async function Q(e,t,n,r,i,a){let{pagePath:o}=A(i.params.url);if(!o){a(!1,`switchTab:fail invalid url`);return}if(!e.getTabBarConfig()?.list.some(e=>k(e.pagePath)===o)){a(!1,`switchTab:fail not a tabBar page: ${o}`);return}let s=t.current.shell.tabStacks[o],c=null;if(!s||s.length===0){let t=await e.openPage(o,{});c={bridgeId:t.bridgeId,pagePath:t.pagePath,query:{},isTab:!0,windowConfig:t.windowConfig,navBar:z(t.windowConfig,e.appId)}}let{next:l,effects:u}=L(t.current.shell,o,c);n(e=>({...e,shell:l})),r(u),a(!0,`switchTab:ok`)}export{q as DeviceShell};
2
+ //# sourceMappingURL=device-shell-BWX7Yopg.js.map
@@ -1 +1 @@
1
- .menu-capsule{-webkit-backdrop-filter:blur(4px);box-sizing:border-box;pointer-events:none;background:#fff9;border:.5px solid #00000014;border-radius:16px;align-items:center;display:flex;position:absolute;overflow:hidden}.menu-capsule--white{color:#fff;background:#ffffff26;border-color:#fff6}.menu-capsule--black{color:#000;background:#ffffffd9;border-color:#00000014}.menu-capsule__more,.menu-capsule__close{flex:1;justify-content:center;align-items:center;display:flex}.menu-capsule__more{gap:3px}.menu-capsule__more span{background:currentColor;border-radius:50%;width:4px;height:4px}.menu-capsule__divider{opacity:.4;background:currentColor;width:.5px;height:16px}.menu-capsule__close svg{color:currentColor}.nav-bar{box-sizing:border-box;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,sans-serif;display:flex;position:relative}.nav-bar--custom{z-index:200;pointer-events:none;position:absolute;top:0;left:0;right:0;background-color:#0000!important}.nav-bar--custom .menu-capsule{pointer-events:auto}.nav-bar__row{align-items:center;padding:0 12px;display:flex;position:relative}.nav-bar__leading{z-index:1;align-items:center;gap:6px;display:flex;position:absolute;top:0;bottom:0;left:8px}.nav-bar__back,.nav-bar__home{cursor:pointer;width:32px;height:32px;color:inherit;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:flex}.nav-bar__title{flex:1;align-items:center;gap:6px;min-width:0;font-size:17px;font-weight:500;display:flex}.nav-bar__title--center{justify-content:center}.nav-bar__title--left{justify-content:flex-start;padding-left:48px}.nav-bar__title-text{text-overflow:ellipsis;white-space:nowrap;max-width:60%;overflow:hidden}.nav-bar__spinner{border:2px solid;border-right-color:#0000;border-radius:50%;width:14px;height:14px;animation:.8s linear infinite nav-bar-spin}@keyframes nav-bar-spin{to{transform:rotate(360deg)}}.device-statusbar{z-index:300;box-sizing:border-box;pointer-events:none;letter-spacing:.2px;justify-content:space-between;align-items:center;padding:0 28px;font:600 14px/1 -apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,sans-serif;display:flex;position:absolute;top:0;left:0;right:0}.device-statusbar__time{font-variant-numeric:tabular-nums}.device-statusbar__notch{background:#000;position:absolute;left:50%;transform:translate(-50%)}.device-statusbar__icons{align-items:center;gap:6px;display:inline-flex}.device-statusbar__signal,.device-statusbar__wifi,.device-statusbar__battery{background:currentColor;display:block}.device-statusbar__signal{width:17px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat}.device-statusbar__wifi{border-radius:1px;width:16px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat}.device-statusbar__battery{background:0 0;border:1px solid;border-radius:3px;width:25px;height:12px;position:relative}.device-statusbar__battery:before{content:"";background:currentColor;border-radius:1px;position:absolute;inset:2px 8px 2px 2px}.device-statusbar__battery:after{content:"";background:currentColor;border-radius:0 1px 1px 0;width:2px;position:absolute;top:3px;bottom:3px;right:-3px}.dmb-tab-bar{width:100%;height:50px;padding-bottom:env(safe-area-inset-bottom,0px);box-sizing:content-box;z-index:9;border-top:1px solid #e0e0e0;flex-shrink:0;justify-content:space-around;align-items:stretch;display:flex}.dmb-tab-bar__item{cursor:pointer;font:inherit;color:inherit;background:0 0;border:0;outline:none;flex-direction:column;flex:1;justify-content:center;align-items:center;padding:4px 0 2px;display:flex;position:relative}.dmb-tab-bar__item:focus-visible{outline-offset:-2px;outline:2px solid #1890ff}.dmb-tab-bar__icon-slot{justify-content:center;align-items:center;width:24px;height:24px;margin-bottom:2px;display:flex}.dmb-tab-bar__icon{-o-object-fit:contain;object-fit:contain;max-width:100%;max-height:100%}.dmb-tab-bar__text{-webkit-user-select:none;user-select:none;font-size:11px;line-height:1}.dmb-tab-bar__badge{color:#fff;text-align:center;background:#f43f5e;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;position:absolute;top:0;right:calc(50% - 22px)}.dmb-tab-bar__red-dot{background:#f43f5e;border-radius:50%;width:8px;height:8px;position:absolute;top:4px;right:calc(50% - 16px)}.device-shell-root{color:#101418;box-sizing:border-box;background:#121212;width:100%;height:100vh;padding:24px;display:flex;overflow:auto}.device-shell{background:#f8fafc;border:1px solid #1014182e;border-radius:38px;flex-direction:column;flex:none;min-height:0;margin:auto;display:flex;position:relative;overflow:hidden;box-shadow:0 18px 50px #10141838}.device-shell__status-bar{letter-spacing:0;color:#111827;background:#f8fafc;flex:0 0 42px;justify-content:space-between;align-items:center;padding:0 28px;font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:flex}.device-shell__status-icons{align-items:center;gap:5px;display:inline-flex}.device-shell__status-icons span{background:#111827;display:block}.device-shell__status-icons span:first-child{border-radius:2px;width:16px;height:10px}.device-shell__status-icons span:nth-child(2){border-radius:50%;width:12px;height:12px}.device-shell__status-icons span:nth-child(3){border-radius:3px;width:20px;height:10px}.device-shell__viewport{background:#fff;flex:auto;min-height:0;position:relative}.device-shell__webview{background:#fff;border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.device-shell__home-indicator{background:#f8fafc;flex:0 0 28px;position:relative}.device-shell__home-indicator:before{content:"";background:#111827;border-radius:999px;width:118px;height:4px;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}
1
+ .menu-capsule{-webkit-backdrop-filter:blur(4px);box-sizing:border-box;pointer-events:none;background:#fff9;border:.5px solid #00000014;border-radius:16px;align-items:center;display:flex;position:absolute;overflow:hidden}.menu-capsule--white{color:#fff;background:#ffffff26;border-color:#fff6}.menu-capsule--black{color:#000;background:#ffffffd9;border-color:#00000014}.menu-capsule__more,.menu-capsule__close{flex:1;justify-content:center;align-items:center;display:flex}.menu-capsule__more{gap:3px}.menu-capsule__more span{background:currentColor;border-radius:50%;width:4px;height:4px}.menu-capsule__divider{opacity:.4;background:currentColor;width:.5px;height:16px}.menu-capsule__close svg{color:currentColor}.nav-bar{box-sizing:border-box;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,sans-serif;display:flex;position:relative}.nav-bar--custom{z-index:200;pointer-events:none;position:absolute;top:0;left:0;right:0;background-color:#0000!important}.nav-bar--custom .menu-capsule{pointer-events:auto}.nav-bar__row{align-items:center;padding:0 12px;display:flex;position:relative}.nav-bar__leading{z-index:1;align-items:center;gap:6px;display:flex;position:absolute;top:0;bottom:0;left:8px}.nav-bar__back,.nav-bar__home{cursor:pointer;width:32px;height:32px;color:inherit;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:flex}.nav-bar__title{flex:1;align-items:center;gap:6px;min-width:0;font-size:17px;font-weight:500;display:flex}.nav-bar__title--center{justify-content:center}.nav-bar__title--left{justify-content:flex-start;padding-left:48px}.nav-bar__title-text{text-overflow:ellipsis;white-space:nowrap;max-width:60%;overflow:hidden}.nav-bar__spinner{border:2px solid;border-right-color:#0000;border-radius:50%;width:14px;height:14px;animation:.8s linear infinite nav-bar-spin}@keyframes nav-bar-spin{to{transform:rotate(360deg)}}.device-statusbar{z-index:300;box-sizing:border-box;pointer-events:none;letter-spacing:.2px;justify-content:space-between;align-items:center;padding:0 28px;font:600 14px/1 -apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,sans-serif;display:flex;position:absolute;top:0;left:0;right:0}.device-statusbar__time{font-variant-numeric:tabular-nums}.device-statusbar__notch{background:#000;position:absolute;left:50%;transform:translate(-50%)}.device-statusbar__icons{align-items:center;gap:6px;display:inline-flex}.device-statusbar__signal,.device-statusbar__wifi,.device-statusbar__battery{background:currentColor;display:block}.device-statusbar__signal{width:17px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat}.device-statusbar__wifi{border-radius:1px;width:16px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat}.device-statusbar__battery{background:0 0;border:1px solid;border-radius:3px;width:25px;height:12px;position:relative}.device-statusbar__battery:before{content:"";background:currentColor;border-radius:1px;position:absolute;inset:2px 8px 2px 2px}.device-statusbar__battery:after{content:"";background:currentColor;border-radius:0 1px 1px 0;width:2px;position:absolute;top:3px;bottom:3px;right:-3px}.dmb-tab-bar{box-sizing:content-box;z-index:9;border-top:1px solid #e0e0e0;flex-shrink:0;justify-content:space-around;align-items:stretch;width:100%;height:50px;display:flex}.dmb-tab-bar__item{cursor:pointer;font:inherit;color:inherit;background:0 0;border:0;outline:none;flex-direction:column;flex:1;justify-content:center;align-items:center;padding:4px 0 2px;display:flex;position:relative}.dmb-tab-bar__item:focus-visible{outline-offset:-2px;outline:2px solid #1890ff}.dmb-tab-bar__icon-slot{justify-content:center;align-items:center;width:24px;height:24px;margin-bottom:2px;display:flex}.dmb-tab-bar__icon{-o-object-fit:contain;object-fit:contain;max-width:100%;max-height:100%}.dmb-tab-bar__text{-webkit-user-select:none;user-select:none;font-size:11px;line-height:1}.dmb-tab-bar__badge{color:#fff;text-align:center;background:#f43f5e;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;position:absolute;top:0;right:calc(50% - 22px)}.dmb-tab-bar__red-dot{background:#f43f5e;border-radius:50%;width:8px;height:8px;position:absolute;top:4px;right:calc(50% - 16px)}.device-shell-root{color:#101418;box-sizing:border-box;background:#121212;width:100%;height:100vh;padding:24px;display:flex;overflow:auto}@media (prefers-color-scheme:light){.device-shell-root{background:#e8e8e8}}.device-shell{background:#f8fafc;border:1px solid #1014182e;border-radius:38px;flex-direction:column;flex:none;min-height:0;margin:auto;display:flex;position:relative;overflow:hidden;box-shadow:0 18px 50px #10141838}.device-shell__status-bar{letter-spacing:0;color:#111827;background:#f8fafc;flex:0 0 42px;justify-content:space-between;align-items:center;padding:0 28px;font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:flex}.device-shell__status-icons{align-items:center;gap:5px;display:inline-flex}.device-shell__status-icons span{background:#111827;display:block}.device-shell__status-icons span:first-child{border-radius:2px;width:16px;height:10px}.device-shell__status-icons span:nth-child(2){border-radius:50%;width:12px;height:12px}.device-shell__status-icons span:nth-child(3){border-radius:3px;width:20px;height:10px}.device-shell__viewport{background:#fff;flex:auto;min-height:0;position:relative}.device-shell__webview{background:#fff;border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.device-shell__home-indicator{pointer-events:none;z-index:200;position:absolute;bottom:0;left:0;right:0}.device-shell__home-indicator:before{content:"";background:#111827;border-radius:999px;width:118px;height:4px;position:absolute;bottom:8px;left:50%;transform:translate(-50%)}
@@ -1,2 +1,2 @@
1
- import{t as e}from"./bridge-channels-BUQ5AbvJ.js";var t=class{appId;scene;pagePath;query;apiRegistry={};appSessionId=null;bridgeId=null;resourceBaseUrl=null;serviceWcId=null;manifest=null;rootWindowConfig=null;platform;apiNamespaces;currentDevice=null;unsubscribeDeviceChange=null;constructor(e){this.appId=e.appId,this.scene=e.scene,this.pagePath=e.pagePath,this.query={...e.query??{}},this.apiNamespaces=e.apiNamespaces??[],this.platform=e.platform??`ios`}registerApi(e,t){this.apiRegistry[e]=t}invokeApi(e,t){let n=this.apiRegistry[e];if(n)return n.call(this,t)}async spawn(){let t=n();this.unsubscribeDeviceChange??=t.onSimulatorEvent(e.DEVICE_CHANGE,e=>{this.currentDevice=e});let r=await t.spawn({appId:this.appId,scene:this.scene,pagePath:this.pagePath,query:this.query,apiNamespaces:this.apiNamespaces,hostEnvSnapshot:this.getHostEnvSnapshot(),resourceBaseUrl:`${window.location.origin}/`});return this.appSessionId=r.appSessionId,this.bridgeId=r.bridgeId,this.resourceBaseUrl=r.resourceBaseUrl,this.serviceWcId=r.serviceWcId,this.manifest=r.manifest,this.rootWindowConfig=r.rootWindowConfig,r.bridgeId}dispose(){this.unsubscribeDeviceChange?.(),this.unsubscribeDeviceChange=null,this.currentDevice=null,this.appSessionId&&(n().dispose(this.appSessionId),this.appSessionId=null,this.bridgeId=null,this.resourceBaseUrl=null,this.serviceWcId=null,this.manifest=null,this.rootWindowConfig=null)}async openPage(e,t={}){let r=this.requireAppSessionId();return n().openPage({appSessionId:r,pagePath:e,query:t})}closePage(e){this.appSessionId&&n().closePage(e)}notifyLifecycle(e,t){let r=this.appSessionId;r&&n().notifyLifecycle({appSessionId:r,bridgeId:e,event:t})}notifyNavCallback(e){let t=this.appSessionId;t&&n().notifyNavCallback({appSessionId:t,...e})}notifyApiResponse(e){let t=this.appSessionId;t&&n().notifyApiResponse({appSessionId:t,...e})}notifyActivePage(e){let t=this.appSessionId;t&&n().notifyActivePage({appSessionId:t,bridgeId:e})}notifyPageStack(e){let t=this.appSessionId;t&&n().notifyPageStack({appSessionId:t,stack:e})}getTabBarConfig(){return this.manifest?.tabBar??null}getInitialDevice(){return n().device??null}getDeviceMetrics(){let e=this.currentDevice??this.getInitialDevice();if(e)return{pixelRatio:e.pixelRatio,screenWidth:e.screenWidth,screenHeight:e.screenHeight,statusBarHeight:e.statusBarHeight,safeAreaBottom:e.safeAreaBottom};let t=this.getHostEnvSnapshot();return{pixelRatio:t.pixelRatio,screenWidth:t.screenWidth,screenHeight:t.screenHeight,statusBarHeight:t.statusBarHeight,safeAreaBottom:0}}getHostEnvSnapshot(){let e=this.getInitialDevice(),t=e?.screenWidth??390,n=e?.screenHeight??844,i=e?.pixelRatio??2,a=navigator.language||`zh-CN`,o=e?.statusBarHeight??(this.platform===`ios`?44:24);return{brand:this.platform===`ios`?`iPhone`:`Android`,model:this.platform===`ios`?`iPhone`:`Android`,platform:this.platform,system:this.platform===`ios`?`iOS 16.0`:`Android 13`,version:`8.0.5`,SDKVersion:`3.0.0`,pixelRatio:i,screenWidth:t,screenHeight:n,windowWidth:t,windowHeight:n,statusBarHeight:o,language:a,theme:r()?`dark`:`light`}}createRenderHostUrl(e,t){return n().createRenderHostUrl({bridgeId:e,appId:this.appId,pagePath:t??this.pagePath})}getRenderPreloadUrl(){return n().renderPreloadUrl}onSimulatorEvent(e,t){return n().onSimulatorEvent(e,t)}requireAppSessionId(){if(!this.appSessionId)throw Error(`[simulator] miniApp has not been spawned yet`);return this.appSessionId}};function n(){let e=window.__diminaNativeHost;if(!e)throw Error(`[simulator] native host bridge is unavailable`);return e}function r(){return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}export{t as SimulatorMiniApp};
2
- //# sourceMappingURL=simulator-mini-app-CYtW6bMd.js.map
1
+ import{t as e}from"./bridge-channels-BUQ5AbvJ.js";var t=class{appId;scene;pagePath;query;apiRegistry={};appSessionId=null;bridgeId=null;resourceBaseUrl=null;serviceWcId=null;manifest=null;rootWindowConfig=null;platform;apiNamespaces;currentDevice=null;unsubscribeDeviceChange=null;constructor(e){this.appId=e.appId,this.scene=e.scene,this.pagePath=e.pagePath,this.query={...e.query??{}},this.apiNamespaces=e.apiNamespaces??[],this.platform=e.platform??`ios`}registerApi(e,t){this.apiRegistry[e]=t}invokeApi(e,t){let n=this.apiRegistry[e];if(n)return n.call(this,t)}async spawn(){let t=n();this.unsubscribeDeviceChange??=t.onSimulatorEvent(e.DEVICE_CHANGE,e=>{this.currentDevice=e});let r=await t.spawn({appId:this.appId,scene:this.scene,pagePath:this.pagePath,query:this.query,apiNamespaces:this.apiNamespaces,hostEnvSnapshot:this.getHostEnvSnapshot(),resourceBaseUrl:`${window.location.origin}/`});return this.appSessionId=r.appSessionId,this.bridgeId=r.bridgeId,this.resourceBaseUrl=r.resourceBaseUrl,this.serviceWcId=r.serviceWcId,this.manifest=r.manifest,this.rootWindowConfig=r.rootWindowConfig,r.bridgeId}dispose(){this.unsubscribeDeviceChange?.(),this.unsubscribeDeviceChange=null,this.currentDevice=null,this.appSessionId&&(n().dispose(this.appSessionId),this.appSessionId=null,this.bridgeId=null,this.resourceBaseUrl=null,this.serviceWcId=null,this.manifest=null,this.rootWindowConfig=null)}async openPage(e,t={}){let r=this.requireAppSessionId();return n().openPage({appSessionId:r,pagePath:e,query:t})}closePage(e){this.appSessionId&&n().closePage(e)}notifyLifecycle(e,t){let r=this.appSessionId;r&&n().notifyLifecycle({appSessionId:r,bridgeId:e,event:t})}notifyNavCallback(e){let t=this.appSessionId;t&&n().notifyNavCallback({appSessionId:t,...e})}notifyApiResponse(e){let t=this.appSessionId;t&&n().notifyApiResponse({appSessionId:t,...e})}notifyActivePage(e){let t=this.appSessionId;t&&n().notifyActivePage({appSessionId:t,bridgeId:e})}notifyPageStack(e){let t=this.appSessionId;t&&n().notifyPageStack({appSessionId:t,stack:e})}getTabBarConfig(){return this.manifest?.tabBar??null}getInitialDevice(){return n().device??null}getDeviceMetrics(){let e=this.currentDevice??this.getInitialDevice();if(e)return{pixelRatio:e.pixelRatio,screenWidth:e.screenWidth,screenHeight:e.screenHeight,statusBarHeight:e.statusBarHeight,safeAreaInsets:e.safeAreaInsets};let t=this.getHostEnvSnapshot();return{pixelRatio:t.pixelRatio,screenWidth:t.screenWidth,screenHeight:t.screenHeight,statusBarHeight:t.statusBarHeight,safeAreaInsets:{top:0,right:0,bottom:0,left:0}}}getHostEnvSnapshot(){let e=this.getInitialDevice(),t=e?.screenWidth??390,n=e?.screenHeight??844,i=e?.pixelRatio??2,a=navigator.language||`zh-CN`,o=e?.statusBarHeight??(this.platform===`ios`?44:24);return{brand:this.platform===`ios`?`iPhone`:`Android`,model:this.platform===`ios`?`iPhone`:`Android`,platform:this.platform,system:this.platform===`ios`?`iOS 16.0`:`Android 13`,version:`8.0.5`,SDKVersion:`3.0.0`,pixelRatio:i,screenWidth:t,screenHeight:n,windowWidth:t,windowHeight:n,statusBarHeight:o,language:a,theme:r()?`dark`:`light`}}createRenderHostUrl(e,t,r){return n().createRenderHostUrl({bridgeId:e,appId:this.appId,pagePath:t??this.pagePath,isTab:r})}getRenderPreloadUrl(){return n().renderPreloadUrl}onSimulatorEvent(e,t){return n().onSimulatorEvent(e,t)}requireAppSessionId(){if(!this.appSessionId)throw Error(`[simulator] miniApp has not been spawned yet`);return this.appSessionId}};function n(){let e=window.__diminaNativeHost;if(!e)throw Error(`[simulator] native host bridge is unavailable`);return e}function r(){return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1}export{t as SimulatorMiniApp};
2
+ //# sourceMappingURL=simulator-mini-app-BfNuDF3R.js.map