@dimina-kit/devtools 0.4.0-dev.20260803105710 → 0.4.0-dev.20260828092243

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 (208) hide show
  1. package/dist/main/api.d.ts +1 -1
  2. package/dist/main/app/app.js +66 -2
  3. package/dist/main/index.bundle.js +1454 -540
  4. package/dist/main/ipc/index.d.ts +3 -0
  5. package/dist/main/ipc/index.js +3 -0
  6. package/dist/main/ipc/popover.js +1 -1
  7. package/dist/main/ipc/project-create.d.ts +15 -0
  8. package/dist/main/ipc/project-create.js +26 -0
  9. package/dist/main/ipc/projects.d.ts +1 -1
  10. package/dist/main/ipc/projects.js +11 -0
  11. package/dist/main/ipc/session.js +11 -0
  12. package/dist/main/ipc/settings.js +2 -1
  13. package/dist/main/ipc/simulator-module.d.ts +4 -3
  14. package/dist/main/ipc/simulator-module.js +4 -5
  15. package/dist/main/ipc/tooltip.d.ts +13 -0
  16. package/dist/main/ipc/tooltip.js +28 -0
  17. package/dist/main/ipc/views.d.ts +15 -1
  18. package/dist/main/ipc/views.js +61 -4
  19. package/dist/main/runtime/miniapp-runtime.d.ts +87 -19
  20. package/dist/main/services/layout/index.d.ts +11 -0
  21. package/dist/main/services/layout/index.js +23 -0
  22. package/dist/main/services/network-forward/frontend-dispatch.js +2 -1
  23. package/dist/main/services/notifications/renderer-notifier.d.ts +32 -1
  24. package/dist/main/services/notifications/renderer-notifier.js +29 -1
  25. package/dist/main/services/projects/project-repository.d.ts +4 -1
  26. package/dist/main/services/projects/project-repository.js +63 -5
  27. package/dist/main/services/simulator-current-page/index.d.ts +5 -3
  28. package/dist/main/services/simulator-current-page/index.js +8 -1
  29. package/dist/main/services/update/update-manager.d.ts +17 -3
  30. package/dist/main/services/update/update-manager.js +25 -6
  31. package/dist/main/services/views/clear-console-filter.d.ts +44 -0
  32. package/dist/main/services/views/clear-console-filter.js +86 -0
  33. package/dist/main/services/views/console-filter-test-fixtures.d.ts +94 -0
  34. package/dist/main/services/views/console-filter-test-fixtures.js +82 -0
  35. package/dist/main/services/views/console-filter.d.ts +79 -130
  36. package/dist/main/services/views/console-filter.js +140 -183
  37. package/dist/main/services/views/devtools-tabs.d.ts +24 -4
  38. package/dist/main/services/views/devtools-tabs.js +40 -21
  39. package/dist/main/services/views/host-dialog-port-channel.d.ts +18 -0
  40. package/dist/main/services/views/host-dialog-port-channel.js +15 -0
  41. package/dist/main/services/views/host-dialog-session-runtime.d.ts +10 -0
  42. package/dist/main/services/views/host-dialog-session-runtime.js +17 -0
  43. package/dist/main/services/views/host-dialog-view.d.ts +95 -0
  44. package/dist/main/services/views/host-dialog-view.js +147 -0
  45. package/dist/main/services/views/host-sidebar-port-channel.d.ts +18 -0
  46. package/dist/main/services/views/host-sidebar-port-channel.js +15 -0
  47. package/dist/main/services/views/host-sidebar-session-runtime.d.ts +10 -0
  48. package/dist/main/services/views/host-sidebar-session-runtime.js +17 -0
  49. package/dist/main/services/views/host-sidebar-view.d.ts +59 -0
  50. package/dist/main/services/views/host-sidebar-view.js +44 -0
  51. package/dist/main/services/views/host-slot-port-channel.d.ts +107 -0
  52. package/dist/main/services/views/host-slot-port-channel.js +261 -0
  53. package/dist/main/services/views/host-slot-session-runtime.d.ts +40 -0
  54. package/dist/main/services/views/host-slot-session-runtime.js +50 -0
  55. package/dist/main/services/views/host-slot-view.d.ts +109 -0
  56. package/dist/main/services/views/host-slot-view.js +147 -0
  57. package/dist/main/services/views/host-toolbar-port-channel.d.ts +6 -91
  58. package/dist/main/services/views/host-toolbar-port-channel.js +10 -243
  59. package/dist/main/services/views/host-toolbar-session-runtime.d.ts +5 -30
  60. package/dist/main/services/views/host-toolbar-session-runtime.js +9 -47
  61. package/dist/main/services/views/host-toolbar-view.d.ts +34 -7
  62. package/dist/main/services/views/host-toolbar-view.js +30 -237
  63. package/dist/main/services/views/managed-web-contents-view.d.ts +48 -0
  64. package/dist/main/services/views/managed-web-contents-view.js +123 -0
  65. package/dist/main/services/views/native-simulator-devtools-host.js +64 -45
  66. package/dist/main/services/views/native-simulator-view.js +6 -24
  67. package/dist/main/services/views/native-view-tree.d.ts +25 -0
  68. package/dist/main/services/views/native-view-tree.js +69 -0
  69. package/dist/main/services/views/overlay-panels-view.d.ts +50 -4
  70. package/dist/main/services/views/overlay-panels-view.js +226 -108
  71. package/dist/main/services/views/placement-reconciler.d.ts +18 -18
  72. package/dist/main/services/views/placement-reconciler.js +91 -29
  73. package/dist/main/services/views/placement-test-driver.d.ts +27 -0
  74. package/dist/main/services/views/placement-test-driver.js +29 -0
  75. package/dist/main/services/views/view-manager-devtools-host-test-fixtures.js +3 -1
  76. package/dist/main/services/views/view-manager.d.ts +14 -86
  77. package/dist/main/services/views/view-manager.js +41 -4
  78. package/dist/main/services/views/workbench-view.js +27 -20
  79. package/dist/main/services/workbench-coi-server.d.ts +11 -0
  80. package/dist/main/services/workbench-coi-server.js +32 -0
  81. package/dist/main/services/workspace/rebuild-status.d.ts +21 -8
  82. package/dist/main/services/workspace/rebuild-status.js +24 -8
  83. package/dist/main/utils/paths.d.ts +4 -0
  84. package/dist/main/utils/paths.js +4 -0
  85. package/dist/main/utils/sender-policy.d.ts +1 -1
  86. package/dist/main/utils/sender-policy.js +16 -1
  87. package/dist/main/utils/theme.d.ts +7 -2
  88. package/dist/main/utils/theme.js +8 -3
  89. package/dist/native-host/common/common.js +65 -62
  90. package/dist/native-host/container/pageFrame.css +1 -1
  91. package/dist/native-host/render/render.js +3226 -2898
  92. package/dist/native-host/service/service.js +2 -2
  93. package/dist/preload/runtime/host-dialog-advertiser.d.ts +22 -0
  94. package/dist/preload/runtime/host-dialog-advertiser.js +37 -0
  95. package/dist/preload/runtime/host-dialog-port.d.ts +44 -0
  96. package/dist/preload/runtime/host-dialog-port.js +53 -0
  97. package/dist/preload/runtime/host-dialog-runtime.d.ts +28 -0
  98. package/dist/preload/runtime/host-dialog-runtime.js +36 -0
  99. package/dist/preload/runtime/host-sidebar-advertiser.d.ts +19 -0
  100. package/dist/preload/runtime/host-sidebar-advertiser.js +35 -0
  101. package/dist/preload/runtime/host-sidebar-port.d.ts +44 -0
  102. package/dist/preload/runtime/host-sidebar-port.js +53 -0
  103. package/dist/preload/runtime/host-sidebar-runtime.d.ts +28 -0
  104. package/dist/preload/runtime/host-sidebar-runtime.js +36 -0
  105. package/dist/preload/runtime/host-slot-port-bridge.d.ts +18 -0
  106. package/dist/preload/runtime/host-slot-port-bridge.js +112 -0
  107. package/dist/preload/runtime/host-toolbar-advertiser.d.ts +5 -13
  108. package/dist/preload/runtime/host-toolbar-advertiser.js +18 -38
  109. package/dist/preload/runtime/host-toolbar-port.d.ts +9 -0
  110. package/dist/preload/runtime/host-toolbar-port.js +11 -95
  111. package/dist/preload/runtime/wait-for-slot-root.d.ts +20 -0
  112. package/dist/preload/runtime/wait-for-slot-root.js +52 -0
  113. package/dist/preload/windows/host-dialog-runtime.cjs +353 -0
  114. package/dist/preload/windows/host-dialog-runtime.cjs.map +7 -0
  115. package/dist/preload/windows/host-dialog-runtime.d.ts +2 -0
  116. package/dist/preload/windows/host-dialog-runtime.js +13 -0
  117. package/dist/preload/windows/host-sidebar-runtime.cjs +354 -0
  118. package/dist/preload/windows/host-sidebar-runtime.cjs.map +7 -0
  119. package/dist/preload/windows/host-sidebar-runtime.d.ts +2 -0
  120. package/dist/preload/windows/host-sidebar-runtime.js +13 -0
  121. package/dist/preload/windows/host-toolbar-runtime.cjs +134 -51
  122. package/dist/preload/windows/host-toolbar-runtime.cjs.map +3 -3
  123. package/dist/preload/windows/main.cjs +3176 -14
  124. package/dist/preload/windows/main.cjs.map +4 -4
  125. package/dist/preload/windows/main.css +428 -0
  126. package/dist/preload/windows/main.css.map +7 -0
  127. package/dist/preload/windows/simulator.cjs +5 -2
  128. package/dist/preload/windows/simulator.cjs.map +2 -2
  129. package/dist/preload/windows/simulator.js +5 -2
  130. package/dist/renderer/assets/button-DsNqZm7o.js +2 -0
  131. package/dist/renderer/assets/constants-D7DfVqMp.js +2 -0
  132. package/dist/renderer/assets/constants-D8zsejFq.js +2 -0
  133. package/dist/renderer/assets/createLucideIcon-CYJeT1ji.js +2 -0
  134. package/dist/renderer/assets/dialog-pT4qWmka.js +46 -0
  135. package/dist/renderer/assets/dist-o70xmpc1.js +2 -0
  136. package/dist/renderer/assets/hostSidebarDefault-NvGZlE9O.js +2 -0
  137. package/dist/renderer/assets/index-zErhG3ta.js +5 -0
  138. package/dist/renderer/assets/input-4QxTXMZN.js +2 -0
  139. package/dist/renderer/assets/ipc-channels-overlays-Blr5TNoB.js +2 -0
  140. package/dist/renderer/assets/jsx-runtime-B-3rq1y5.css +1 -0
  141. package/dist/renderer/assets/jsx-runtime-CqVdW3eg.js +9 -0
  142. package/dist/renderer/assets/popover-CJiSWwuE.js +2 -0
  143. package/dist/renderer/assets/project-api-DZ1Zi6EC.js +2 -0
  144. package/dist/renderer/assets/projectCreateDialog-DMWNhw_1.js +2 -0
  145. package/dist/renderer/assets/select-C86pNcsu.js +2 -0
  146. package/dist/renderer/assets/settings-BoI8mLT1.js +2 -0
  147. package/dist/renderer/assets/settings-api-Bs_g4NHs.js +2 -0
  148. package/dist/renderer/assets/settings-tab-bar-DHLLygqv.js +2 -0
  149. package/dist/renderer/assets/tooltip-BhAyY0T4.js +2 -0
  150. package/dist/renderer/assets/types-YYjkvane.js +2 -0
  151. package/dist/renderer/assets/updateDialog-DPum3wx1.js +2 -0
  152. package/dist/renderer/assets/utils-kfQov6Pa.js +2 -0
  153. package/dist/renderer/assets/view-api-DFhb2R8-.js +2 -0
  154. package/dist/renderer/assets/workbenchSettings-DrajRQUk.js +8 -0
  155. package/dist/renderer/entries/host-sidebar-default/index.html +21 -0
  156. package/dist/renderer/entries/main/index.html +15 -7
  157. package/dist/renderer/entries/popover/index.html +10 -6
  158. package/dist/renderer/entries/project-create-dialog/index.html +27 -0
  159. package/dist/renderer/entries/settings/index.html +10 -5
  160. package/dist/renderer/entries/tooltip/index.html +21 -0
  161. package/dist/renderer/entries/update-dialog/index.html +25 -0
  162. package/dist/renderer/entries/workbench-settings/index.html +11 -5
  163. package/dist/service-host/preload.cjs +10 -0
  164. package/dist/service-host/sync-impls/menu-button-geometry.js +1 -0
  165. package/dist/shared/constants.d.ts +22 -0
  166. package/dist/shared/constants.js +22 -0
  167. package/dist/shared/ipc-channels-overlays.d.ts +156 -0
  168. package/dist/shared/ipc-channels-overlays.js +186 -0
  169. package/dist/shared/ipc-channels.d.ts +1 -67
  170. package/dist/shared/ipc-channels.js +9 -81
  171. package/dist/shared/ipc-schemas.d.ts +52 -0
  172. package/dist/shared/ipc-schemas.js +64 -0
  173. package/dist/shared/simulator-route.d.ts +8 -0
  174. package/dist/shared/simulator-route.js +15 -0
  175. package/dist/shared/types.d.ts +17 -0
  176. package/dist/shared/view-ids.d.ts +9 -0
  177. package/dist/shared/view-ids.js +21 -0
  178. package/dist/simulator/assets/device-shell-CmtM1QxP.js +2 -0
  179. package/dist/simulator/assets/device-shell-iFZo1igL.css +1 -0
  180. package/dist/simulator/assets/{simulator-COIE6R49.js → simulator-CIobn3Mh.js} +6 -6
  181. package/dist/simulator/assets/{simulator-mini-app-BLn7XV8e.js → simulator-mini-app-CRe6n9br.js} +2 -2
  182. package/dist/simulator/assets/simulator-ui-BupATgKo.css +1 -0
  183. package/dist/simulator/assets/simulator-ui-C_cP602X.js +2 -0
  184. package/dist/simulator/simulator.html +3 -2
  185. package/dist/vscode-workbench/assets/__vite-browser-external-Bc1vizTf.js +1 -0
  186. package/dist/vscode-workbench/assets/{dist-oHcwN53f.js → dist-CMfmHflW.js} +3 -3
  187. package/dist/vscode-workbench/assets/{iconv-lite-umd-CLMLpdGm.js → iconv-lite-umd-Bx8CgaZq.js} +1 -1
  188. package/dist/vscode-workbench/assets/{index-BE3UJdoH.js → index-CdG6YWhW.js} +436 -436
  189. package/dist/vscode-workbench/assets/{jschardet-BICW8PLJ.js → jschardet-M0qgd2lN.js} +1 -1
  190. package/dist/vscode-workbench/index.html +21 -1
  191. package/package.json +9 -8
  192. package/dist/main/services/views/destroy-child-view.d.ts +0 -9
  193. package/dist/main/services/views/destroy-child-view.js +0 -23
  194. package/dist/renderer/assets/constants-EAMiwL9_.js +0 -2
  195. package/dist/renderer/assets/index-BBg3YI5b.js +0 -49
  196. package/dist/renderer/assets/input-xdmfv-eH.js +0 -2
  197. package/dist/renderer/assets/ipc-transport-B3EpmfNS.js +0 -9
  198. package/dist/renderer/assets/ipc-transport-Blac3sOj.css +0 -1
  199. package/dist/renderer/assets/popover-B88e2hkg.js +0 -2
  200. package/dist/renderer/assets/select-CD9CJyhI.js +0 -2
  201. package/dist/renderer/assets/settings-44hf0QtO.js +0 -2
  202. package/dist/renderer/assets/settings-api-pJKPuP1M.js +0 -2
  203. package/dist/renderer/assets/workbenchSettings-DKD5U1Ql.js +0 -8
  204. package/dist/simulator/assets/device-shell-Cw7c-IkG.js +0 -2
  205. package/dist/simulator/assets/device-shell-DbC5ccs8.css +0 -1
  206. package/dist/simulator/assets/jsx-runtime-DkKmJyBb.js +0 -2
  207. package/dist/simulator/device-shell/menu-button-geometry.js +0 -18
  208. package/dist/vscode-workbench/assets/__vite-browser-external-BON7qP59.js +0 -1
@@ -35,10 +35,14 @@
35
35
  */
36
36
  /**
37
37
  * Canonical DevTools panel view ids kept in the DEFAULT tab bar (stable front-end
38
- * ids, unchanged for many Chromium releases): `elements`, `console`, `network`,
39
- * `sources`. Sources stays so a source-link click that isn't routed to Monaco
40
- * (build/runtime chunks, framework frames) still has a panel to reveal in instead
41
- * of silently no-op'ing.
38
+ * ids, unchanged for many Chromium releases): `elements`, `console`, `sources`,
39
+ * `network`. Sources stays so a source-link click NOT routed to Monaco (build/
40
+ * runtime chunks, framework frames) still has a panel to reveal in instead of
41
+ * silently no-op'ing. ORDERING NOTE: these stay in DevTools' DEFAULT visual
42
+ * order (Sources between Console and Network). We deliberately do NOT move
43
+ * Sources after Network: reordering the DOM nodes desyncs the front-end's
44
+ * click→panel mapping (it indexes tabs by child position), which made clicking
45
+ * Network activate Sources.
42
46
  */
43
47
  export declare const DEVTOOLS_KEPT_VIEW_IDS: readonly string[];
44
48
  /**
@@ -47,4 +51,20 @@ export declare const DEVTOOLS_KEPT_VIEW_IDS: readonly string[];
47
51
  * (never interpolated as bare code), same discipline as the other injectors.
48
52
  */
49
53
  export declare function buildCustomizeTabsScript(keptIds?: readonly string[]): string;
54
+ /**
55
+ * Build the `executeJavaScript` source that forces the DevTools front-end to
56
+ * render its context menus as PAGE menus (soft menus) instead of asking the
57
+ * host via `showContextMenuAtPoint()`.
58
+ *
59
+ * The embedded DevTools front-end decides per-menu in `ContextMenu#show()`:
60
+ * `this.useSoftMenu || InspectorFrontendHostInstance.isHostedMode()`. On a
61
+ * self-built WebContentsView Electron leaves both false and does not answer
62
+ * `showContextMenuAtPoint()`, so right-click menus (复制为 cURL / Copy / …)
63
+ * never appear. Forcing the host-wide `isHostedMode()` true instead breaks the
64
+ * front-end's target data flow (Console/Network panels go empty), so we take
65
+ * the narrow path: patch the ContextMenu prototype so every menu shows as a
66
+ * page-rendered soft menu — same rendering the VS Code embedding uses, without
67
+ * touching the host-mode flag or any other front-end behaviour.
68
+ */
69
+ export declare function buildDevtoolsSoftMenuScript(): string;
50
70
  //# sourceMappingURL=devtools-tabs.d.ts.map
@@ -35,12 +35,16 @@
35
35
  */
36
36
  /**
37
37
  * Canonical DevTools panel view ids kept in the DEFAULT tab bar (stable front-end
38
- * ids, unchanged for many Chromium releases): `elements`, `console`, `network`,
39
- * `sources`. Sources stays so a source-link click that isn't routed to Monaco
40
- * (build/runtime chunks, framework frames) still has a panel to reveal in instead
41
- * of silently no-op'ing.
38
+ * ids, unchanged for many Chromium releases): `elements`, `console`, `sources`,
39
+ * `network`. Sources stays so a source-link click NOT routed to Monaco (build/
40
+ * runtime chunks, framework frames) still has a panel to reveal in instead of
41
+ * silently no-op'ing. ORDERING NOTE: these stay in DevTools' DEFAULT visual
42
+ * order (Sources between Console and Network). We deliberately do NOT move
43
+ * Sources after Network: reordering the DOM nodes desyncs the front-end's
44
+ * click→panel mapping (it indexes tabs by child position), which made clicking
45
+ * Network activate Sources.
42
46
  */
43
- export const DEVTOOLS_KEPT_VIEW_IDS = ['elements', 'console', 'network', 'sources'];
47
+ export const DEVTOOLS_KEPT_VIEW_IDS = ['elements', 'console', 'sources', 'network'];
44
48
  /**
45
49
  * Build the `executeJavaScript` source injected into the DevTools front-end
46
50
  * WebContents. The kept ids + display names are carried as JSON data literals
@@ -50,20 +54,15 @@ export function buildCustomizeTabsScript(keptIds = DEVTOOLS_KEPT_VIEW_IDS) {
50
54
  // Kept panels are matched by view id (registry path) and by visible NAME (DOM
51
55
  // fallback path); the DevTools UI may be EN or ZH, so include both.
52
56
  const NAME_MAP = {
53
- elements: ['Elements', '元素'], console: ['Console', '控制台'], network: ['Network', '网络'],
54
- sources: ['Sources', '来源', '源代码'],
57
+ elements: ['Elements', '元素'], console: ['Console', '控制台'],
58
+ sources: ['Sources', '来源', '源代码'], network: ['Network', '网络'],
55
59
  };
56
60
  const keepNames = keptIds.flatMap((id) => NAME_MAP[id] ?? [id]);
57
61
  const keepIdsJson = JSON.stringify(JSON.stringify([...keptIds]));
58
62
  const keepNamesJson = JSON.stringify(JSON.stringify(keepNames));
59
- const srcNamesJson = JSON.stringify(JSON.stringify(NAME_MAP.sources));
60
- const netNamesJson = JSON.stringify(JSON.stringify(NAME_MAP.network));
61
63
  return `(function(){try{
62
64
  var KEEPID = new Set(JSON.parse(${keepIdsJson}));
63
65
  var KEEPNAME = new Set(JSON.parse(${keepNamesJson}));
64
- var SRCNAME = new Set(JSON.parse(${srcNamesJson}));
65
- var NETNAME = new Set(JSON.parse(${netNamesJson}));
66
- var WANT_SOURCES_LAST = KEEPID.has('sources');
67
66
  // (1) Locale infobar — official host-preference suppression (NOT localStorage).
68
67
  try { var IFH=globalThis.InspectorFrontendHost; if(IFH&&typeof IFH.setPreference==='function'){ IFH.setPreference('disable-locale-info-bar','true'); } }catch(_){}
69
68
  function deepCollect(sel,cap){ var out=[],seen=0,stack=[document]; while(stack.length&&seen<(cap||40000)){ var root=stack.pop(); try{var m=root.querySelectorAll?root.querySelectorAll(sel):[];for(var i=0;i<m.length;i++)out.push(m[i]);}catch(_){} try{var all=root.querySelectorAll?root.querySelectorAll('*'):[];for(var j=0;j<all.length;j++){seen++;if(all[j].shadowRoot)stack.push(all[j].shadowRoot);}}catch(_){} } return out; }
@@ -94,15 +93,6 @@ export function buildCustomizeTabsScript(keptIds = DEVTOOLS_KEPT_VIEW_IDS) {
94
93
  if(!handled){ var FALL=['timeline','resources','heap-profiler','security','lighthouse','chrome-recorder','coverage','linear-memory-inspector','sensors','rendering','animations','autofill-view','medias','issues-pane']; for(var fr=0;fr<FALL.length;fr++){ try{ if(!KEEPID.has(FALL[fr])) maybeRemove(FALL[fr]); }catch(_){} } }
95
94
  } else { domFallback(); }
96
95
  })();
97
- // Keep Sources LAST in the bar (after Network). Default DevTools order puts
98
- // Sources between Console and Network; nudge it to just after Network. Runs in
99
- // BOTH paths (registry removal leaves the kept tabs in default order). Self-
100
- // stable: once Sources follows Network the condition no longer holds.
101
- if(WANT_SOURCES_LAST){ var ro=0,rt=setInterval(function(){ ro++; try{
102
- var tabs=deepCollect('[role="tab"]'),src=null,net=null;
103
- for(var i=0;i<tabs.length;i++){ var n=txt(tabs[i]); if(SRCNAME.has(n))src=tabs[i]; else if(NETNAME.has(n))net=tabs[i]; }
104
- if(src&&net&&src.parentElement&&src.parentElement===net.parentElement&&(src.compareDocumentPosition(net)&Node.DOCUMENT_POSITION_FOLLOWING)){ net.parentElement.insertBefore(src,net.nextSibling); }
105
- }catch(_){} if(ro>120)clearInterval(rt); },60); }
106
96
  // DOM fallback: only if the ESM module couldn't be resolved at all.
107
97
  function domFallback(){ var cachedBar=null;
108
98
  function findBar(){ if(cachedBar&&cachedBar.isConnected)return cachedBar; cachedBar=null; var tabs=deepCollect('[role="tab"]'); var a=null; for(var i=0;i<tabs.length;i++){if(KEEPNAME.has(txt(tabs[i]))){a=tabs[i];break;}} if(!a)return null; var p=a.parentElement; while(p){try{if(p.querySelectorAll('[role="tab"]').length>1){cachedBar=p;return p;}}catch(_){} p=p.parentElement;} cachedBar=a.parentElement; return cachedBar; }
@@ -110,4 +100,33 @@ export function buildCustomizeTabsScript(keptIds = DEVTOOLS_KEPT_VIEW_IDS) {
110
100
  var tr=0,t=setInterval(function(){tr++;try{apply();}catch(_){}if(tr>120)clearInterval(t);},60); try{apply();}catch(_){} }
111
101
  }catch(_){}})()`;
112
102
  }
103
+ /**
104
+ * Build the `executeJavaScript` source that forces the DevTools front-end to
105
+ * render its context menus as PAGE menus (soft menus) instead of asking the
106
+ * host via `showContextMenuAtPoint()`.
107
+ *
108
+ * The embedded DevTools front-end decides per-menu in `ContextMenu#show()`:
109
+ * `this.useSoftMenu || InspectorFrontendHostInstance.isHostedMode()`. On a
110
+ * self-built WebContentsView Electron leaves both false and does not answer
111
+ * `showContextMenuAtPoint()`, so right-click menus (复制为 cURL / Copy / …)
112
+ * never appear. Forcing the host-wide `isHostedMode()` true instead breaks the
113
+ * front-end's target data flow (Console/Network panels go empty), so we take
114
+ * the narrow path: patch the ContextMenu prototype so every menu shows as a
115
+ * page-rendered soft menu — same rendering the VS Code embedding uses, without
116
+ * touching the host-mode flag or any other front-end behaviour.
117
+ */
118
+ export function buildDevtoolsSoftMenuScript() {
119
+ return `(function(){
120
+ try {
121
+ var C = globalThis.EUI && globalThis.EUI.ContextMenu && globalThis.EUI.ContextMenu.ContextMenu;
122
+ if (C && C.prototype && typeof C.prototype.show === 'function') {
123
+ var origShow = C.prototype.show;
124
+ C.prototype.show = function() {
125
+ this.useSoftMenu = true;
126
+ return origShow.apply(this, arguments);
127
+ };
128
+ }
129
+ } catch (_) {}
130
+ })()`;
131
+ }
113
132
  //# sourceMappingURL=devtools-tabs.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotPortChannel` (see that
3
+ * module for the full per-load handshake / navigation-invalidation
4
+ * contract).
5
+ */
6
+ import type { WebContents } from 'electron';
7
+ import { type HostSlotMessageSubscription, type HostSlotPortChannel } from './host-slot-port-channel.js';
8
+ export type HostDialogMessageSubscription = HostSlotMessageSubscription;
9
+ export type HostDialogPortChannel = HostSlotPortChannel;
10
+ export declare function createHostDialogPortChannel(opts: {
11
+ /**
12
+ * Is `wc` still the manager's CURRENT live dialog webContents? Guards a
13
+ * stale wc's late `did-finish-load` from hijacking the channel after a
14
+ * rebuild swapped the view out underneath it.
15
+ */
16
+ isCurrent: (wc: WebContents) => boolean;
17
+ }): HostDialogPortChannel;
18
+ //# sourceMappingURL=host-dialog-port-channel.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotPortChannel` (see that
3
+ * module for the full per-load handshake / navigation-invalidation
4
+ * contract).
5
+ */
6
+ import { ViewChannel } from '../../../shared/ipc-channels-overlays.js';
7
+ import { createHostSlotPortChannel, } from './host-slot-port-channel.js';
8
+ export function createHostDialogPortChannel(opts) {
9
+ return createHostSlotPortChannel({
10
+ isCurrent: opts.isCurrent,
11
+ channel: ViewChannel.HostDialogPort,
12
+ logPrefix: '[host-dialog]',
13
+ });
14
+ }
15
+ //# sourceMappingURL=host-dialog-port-channel.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotSessionRuntime` (see that
3
+ * module for the full ref-counting contract). Kept as a thin, independently
4
+ * named wrapper — same rationale as `host-toolbar-session-runtime.ts` — so
5
+ * a dialog-focused test can `vi.resetModules()` this module's state without
6
+ * touching the toolbar/sidebar's independent ref-counts.
7
+ */
8
+ export declare function acquireHostDialogSessionRuntime(): void;
9
+ export declare function releaseHostDialogSessionRuntime(): void;
10
+ //# sourceMappingURL=host-dialog-session-runtime.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Dialog-specific instantiation of `createHostSlotSessionRuntime` (see that
3
+ * module for the full ref-counting contract). Kept as a thin, independently
4
+ * named wrapper — same rationale as `host-toolbar-session-runtime.ts` — so
5
+ * a dialog-focused test can `vi.resetModules()` this module's state without
6
+ * touching the toolbar/sidebar's independent ref-counts.
7
+ */
8
+ import { createHostSlotSessionRuntime } from './host-slot-session-runtime.js';
9
+ import { hostDialogRuntimePreloadPath } from '../../utils/paths.js';
10
+ const runtime = createHostSlotSessionRuntime(hostDialogRuntimePreloadPath);
11
+ export function acquireHostDialogSessionRuntime() {
12
+ runtime.acquire();
13
+ }
14
+ export function releaseHostDialogSessionRuntime() {
15
+ runtime.release();
16
+ }
17
+ //# sourceMappingURL=host-dialog-session-runtime.js.map
@@ -0,0 +1,95 @@
1
+ import type { WebContents } from 'electron';
2
+ import type { PlacementReconciler } from './placement-reconciler.js';
3
+ import type { ViewManagerContext } from './view-manager.js';
4
+ import type { HostDialogMessageSubscription } from './host-dialog-port-channel.js';
5
+ export type HostDialogAxis = 'block' | 'inline';
6
+ /**
7
+ * The control object the downstream host uses to own the dialog
8
+ * WebContentsView. Unlike `HostToolbarControl` / `HostSidebarControl`
9
+ * (persistent strips), the dialog is a by-demand overlay: no extent-mode
10
+ * setter (it always self-sizes from its own reverse advertiser, with a
11
+ * conservative default while unmeasured — see below) and an explicit
12
+ * `show()`/`hide()`/`isVisible()` surface instead of always being present
13
+ * once loaded.
14
+ */
15
+ export interface HostDialogControl {
16
+ /** Load a URL into the dialog view (lazy-creates the view). */
17
+ loadURL(url: string): Promise<void>;
18
+ /** Load a local file into the dialog view (lazy-creates the view). */
19
+ loadFile(path: string): Promise<void>;
20
+ /** The dialog view's live WebContents, or null if not yet created/destroyed. */
21
+ readonly webContents: WebContents | null;
22
+ /** Same contract as `HostToolbarControl.setPreloadPath`. */
23
+ setPreloadPath(path: string | null): void;
24
+ /**
25
+ * Register a host-side handler for messages the dialog PAGE sends via
26
+ * `window.diminaHostDialog.send(channel, payload)`. Same contract as
27
+ * `HostToolbarControl.onMessage`.
28
+ */
29
+ onMessage(channel: string, handler: (payload: unknown) => void): HostDialogMessageSubscription;
30
+ /** Same contract as `HostToolbarControl.onReady`. */
31
+ onReady(handler: () => void): HostDialogMessageSubscription;
32
+ /** Same contract as `HostToolbarControl.send`. */
33
+ send(channel: string, payload: unknown): boolean;
34
+ /**
35
+ * Show the dialog, centered in the main window using its self-advertised
36
+ * size on both axes (a conservative default for any axis not yet
37
+ * measured). Creates the view's placement if needed; does not (re)load
38
+ * content — the host must `loadURL`/`loadFile` first. Idempotent while
39
+ * already visible (re-centers with the latest measured extent instead of
40
+ * no-op, in case a resize happened while hidden).
41
+ */
42
+ show(): void;
43
+ /** Hide the dialog (kept alive, content preserved) without destroying the view. */
44
+ hide(): void;
45
+ /** Whether the dialog is currently shown. */
46
+ isVisible(): boolean;
47
+ }
48
+ /**
49
+ * The host-dialog slice of `ViewManager`'s public surface, split into its
50
+ * own file for the same file-length reason as sidebar's
51
+ * `HostSidebarViewManagerMembers` — a by-demand, dual-axis, main-centered
52
+ * overlay rather than a persistent strip.
53
+ */
54
+ export interface HostDialogViewManagerMembers {
55
+ /** Return the webContents ID of the host-dialog overlay if alive, else null. */
56
+ getHostDialogWebContentsId(): number | null;
57
+ /** Reverse size-advertiser sink for either axis; re-centers while visible. */
58
+ reportHostDialogMeasuredExtent(axis: HostDialogAxis, extent: number): void;
59
+ /** Host-facing control surface for the dialog WebContentsView. */
60
+ readonly hostDialog: HostDialogControl;
61
+ }
62
+ export interface HostDialogView {
63
+ readonly control: HostDialogControl;
64
+ /**
65
+ * Reverse size-advertiser sink for either axis. While visible, immediately
66
+ * re-centers with the newly measured extent; while hidden, just retains it
67
+ * for the next `show()`. Non-finite / non-positive reports are dropped —
68
+ * same fail-closed posture as the base slots' extent validation.
69
+ */
70
+ reportMeasuredExtent(axis: HostDialogAxis, extent: number): void;
71
+ getHostDialogWebContentsId(): number | null;
72
+ /**
73
+ * Re-center in the main window's CURRENT content rect, e.g. after a
74
+ * main-window resize. No-op while hidden — the next `show()` computes
75
+ * fresh bounds anyway, so there is nothing to reapply.
76
+ */
77
+ reposition(): void;
78
+ dispose(): void;
79
+ }
80
+ /**
81
+ * Host-dialog factory — its PLACEMENT is deliberately NOT built on
82
+ * `createHostSlotView`. That factory models a persistent, single-axis,
83
+ * renderer-anchored strip (`setBaseDesired`); the dialog is a by-demand,
84
+ * dual-axis, main-centered overlay (`setOverlayDesired` /
85
+ * `deleteOverlayDesired`), closer in shape to the settings/popover/tooltip
86
+ * overlays in `overlay-panels-view.ts` than to the toolbar/sidebar. It still
87
+ * doesn't reuse `createOverlayPanel` from that file: those panels load a
88
+ * FIXED renderer-dir entry and push typed data, whereas the dialog loads
89
+ * ARBITRARY host content and needs the toolbar/sidebar's `loadURL`/`loadFile`
90
+ * + gated port-channel surface. The underlying WebContentsView lazy-create /
91
+ * liveness / load / teardown lifecycle IS shared with the base slots though
92
+ * — see `managed-web-contents-view.ts`.
93
+ */
94
+ export declare function createHostDialogView(ctx: ViewManagerContext, reconciler: PlacementReconciler): HostDialogView;
95
+ //# sourceMappingURL=host-dialog-view.d.ts.map
@@ -0,0 +1,147 @@
1
+ import { HOST_DIALOG_RUNTIME_MARKER } from '../../../shared/constants.js';
2
+ import { VIEW_ID, VIEW_LAYER } from '../../../shared/view-ids.js';
3
+ import { acquireHostDialogSessionRuntime, releaseHostDialogSessionRuntime, } from './host-dialog-session-runtime.js';
4
+ import { createHostDialogPortChannel } from './host-dialog-port-channel.js';
5
+ import { createManagedWebContentsView } from './managed-web-contents-view.js';
6
+ // Shown immediately on `show()` for whichever axis hasn't been measured yet.
7
+ // The dialog is a by-demand overlay — there is no renderer placeholder to
8
+ // pre-report intrinsic size the way the toolbar/sidebar's forward anchor
9
+ // does, so the first show of a not-yet-measured axis has nothing to center
10
+ // against. Waiting/polling for the report would mask the async race (banned
11
+ // by this repo's timing rules); a conservative default plus a re-center the
12
+ // moment `reportMeasuredExtent` lands is the fail-safe alternative.
13
+ const DEFAULT_WIDTH = 480;
14
+ const DEFAULT_HEIGHT = 320;
15
+ /**
16
+ * Host-dialog factory — its PLACEMENT is deliberately NOT built on
17
+ * `createHostSlotView`. That factory models a persistent, single-axis,
18
+ * renderer-anchored strip (`setBaseDesired`); the dialog is a by-demand,
19
+ * dual-axis, main-centered overlay (`setOverlayDesired` /
20
+ * `deleteOverlayDesired`), closer in shape to the settings/popover/tooltip
21
+ * overlays in `overlay-panels-view.ts` than to the toolbar/sidebar. It still
22
+ * doesn't reuse `createOverlayPanel` from that file: those panels load a
23
+ * FIXED renderer-dir entry and push typed data, whereas the dialog loads
24
+ * ARBITRARY host content and needs the toolbar/sidebar's `loadURL`/`loadFile`
25
+ * + gated port-channel surface. The underlying WebContentsView lazy-create /
26
+ * liveness / load / teardown lifecycle IS shared with the base slots though
27
+ * — see `managed-web-contents-view.ts`.
28
+ */
29
+ export function createHostDialogView(ctx, reconciler) {
30
+ const port = createHostDialogPortChannel({
31
+ isCurrent: (wc) => managed.liveWebContents()?.id === wc.id,
32
+ });
33
+ let visible = false;
34
+ let width = DEFAULT_WIDTH;
35
+ let height = DEFAULT_HEIGHT;
36
+ const managed = createManagedWebContentsView({
37
+ reconciler,
38
+ viewId: VIEW_ID.hostDialog,
39
+ marker: HOST_DIALOG_RUNTIME_MARKER,
40
+ sessionRuntime: {
41
+ acquire: acquireHostDialogSessionRuntime,
42
+ release: releaseHostDialogSessionRuntime,
43
+ },
44
+ port,
45
+ onBroken: () => {
46
+ // Same "withdraw the stale desired placement" contract as hide(): a
47
+ // crashed dialog must not resurrect as a blank, content-less modal the
48
+ // next time something calls reposition() (e.g. a window resize).
49
+ visible = false;
50
+ reconciler.deleteOverlayDesired(VIEW_ID.hostDialog);
51
+ },
52
+ });
53
+ function computeBounds() {
54
+ const [winW = 0, winH = 0] = ctx.windows.mainWindow.getContentSize();
55
+ // Clamp to the window so a dialog whose advertised/default size exceeds
56
+ // the current content area still gets valid non-negative bounds instead
57
+ // of spilling off-window or going negative.
58
+ const w = Math.min(width, Math.max(1, winW));
59
+ const h = Math.min(height, Math.max(1, winH));
60
+ return {
61
+ x: Math.max(0, Math.round((winW - w) / 2)),
62
+ y: Math.max(0, Math.round((winH - h) / 2)),
63
+ width: w,
64
+ height: h,
65
+ };
66
+ }
67
+ function present() {
68
+ reconciler.setOverlayDesired(VIEW_ID.hostDialog, {
69
+ viewId: VIEW_ID.hostDialog,
70
+ placement: { visible: true, bounds: computeBounds() },
71
+ layer: VIEW_LAYER.hostDialog,
72
+ });
73
+ reconciler.reconcileNow();
74
+ }
75
+ function reportMeasuredExtent(axis, extent) {
76
+ if (!Number.isFinite(extent) || extent <= 0)
77
+ return;
78
+ if (axis === 'inline') {
79
+ width = extent;
80
+ }
81
+ else {
82
+ height = extent;
83
+ }
84
+ if (visible)
85
+ present();
86
+ }
87
+ // The host swaps content into the SAME dialog view via loadURL/loadFile
88
+ // (e.g. re-purposing one dialog for a different prompt) — width/height are
89
+ // this factory's own closure state, seeded once from the DEFAULT_*
90
+ // constants and only ever mutated by reportMeasuredExtent, so without a
91
+ // reset here a fresh, unmeasured document would inherit the PREVIOUS
92
+ // document's size until it happens to report its own. And while the
93
+ // dialog is currently VISIBLE, resetting the closure state alone doesn't
94
+ // reach the screen — the on-screen bounds only change via `present()` —
95
+ // so without the same `if (visible) present()` `reportMeasuredExtent`
96
+ // already does, the OLD document's bounds would stay displayed
97
+ // indefinitely (forever, if the new document never reports at all, e.g. a
98
+ // fixture missing `[data-host-dialog-root]`) instead of falling back to
99
+ // the default the moment the swap happens.
100
+ function resetMeasuredExtent() {
101
+ width = DEFAULT_WIDTH;
102
+ height = DEFAULT_HEIGHT;
103
+ if (visible)
104
+ present();
105
+ }
106
+ const control = {
107
+ loadURL: (url) => {
108
+ resetMeasuredExtent();
109
+ return managed.loadURL(url);
110
+ },
111
+ loadFile: (filePath) => {
112
+ resetMeasuredExtent();
113
+ return managed.loadFile(filePath);
114
+ },
115
+ get webContents() {
116
+ return managed.liveWebContents();
117
+ },
118
+ setPreloadPath: (path) => managed.setPreloadPath(path),
119
+ onMessage: (channel, handler) => port.onMessage(channel, handler),
120
+ onReady: (handler) => port.onReady(handler),
121
+ send: (channel, payload) => port.send(channel, payload),
122
+ show() {
123
+ managed.ensureView();
124
+ visible = true;
125
+ present();
126
+ },
127
+ hide() {
128
+ visible = false;
129
+ reconciler.deleteOverlayDesired(VIEW_ID.hostDialog);
130
+ reconciler.reconcileNow();
131
+ },
132
+ isVisible: () => visible,
133
+ };
134
+ reconciler.registerView(VIEW_ID.hostDialog, {
135
+ getView: () => managed.getView(),
136
+ ensureView: () => managed.ensureView(),
137
+ });
138
+ return {
139
+ control,
140
+ reportMeasuredExtent,
141
+ getHostDialogWebContentsId: () => managed.liveWebContents()?.id ?? null,
142
+ reposition: () => { if (visible)
143
+ present(); },
144
+ dispose: () => managed.dispose(),
145
+ };
146
+ }
147
+ //# sourceMappingURL=host-dialog-view.js.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Sidebar-specific instantiation of `createHostSlotPortChannel` (see that
3
+ * module for the full per-load handshake / navigation-invalidation
4
+ * contract).
5
+ */
6
+ import type { WebContents } from 'electron';
7
+ import { type HostSlotMessageSubscription, type HostSlotPortChannel } from './host-slot-port-channel.js';
8
+ export type HostSidebarMessageSubscription = HostSlotMessageSubscription;
9
+ export type HostSidebarPortChannel = HostSlotPortChannel;
10
+ export declare function createHostSidebarPortChannel(opts: {
11
+ /**
12
+ * Is `wc` still the manager's CURRENT live sidebar webContents? Guards a
13
+ * stale wc's late `did-finish-load` from hijacking the channel after a
14
+ * rebuild swapped the view out underneath it.
15
+ */
16
+ isCurrent: (wc: WebContents) => boolean;
17
+ }): HostSidebarPortChannel;
18
+ //# sourceMappingURL=host-sidebar-port-channel.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Sidebar-specific instantiation of `createHostSlotPortChannel` (see that
3
+ * module for the full per-load handshake / navigation-invalidation
4
+ * contract).
5
+ */
6
+ import { ViewChannel } from '../../../shared/ipc-channels-overlays.js';
7
+ import { createHostSlotPortChannel, } from './host-slot-port-channel.js';
8
+ export function createHostSidebarPortChannel(opts) {
9
+ return createHostSlotPortChannel({
10
+ isCurrent: opts.isCurrent,
11
+ channel: ViewChannel.HostSidebarPort,
12
+ logPrefix: '[host-sidebar]',
13
+ });
14
+ }
15
+ //# sourceMappingURL=host-sidebar-port-channel.js.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Sidebar-specific instantiation of `createHostSlotSessionRuntime` (see that
3
+ * module for the full ref-counting contract). Kept as a thin, independently
4
+ * named wrapper — same rationale as `host-toolbar-session-runtime.ts` — so
5
+ * a sidebar-focused test can `vi.resetModules()` this module's state without
6
+ * touching the toolbar's independent ref-count.
7
+ */
8
+ export declare function acquireHostSidebarSessionRuntime(): void;
9
+ export declare function releaseHostSidebarSessionRuntime(): void;
10
+ //# sourceMappingURL=host-sidebar-session-runtime.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Sidebar-specific instantiation of `createHostSlotSessionRuntime` (see that
3
+ * module for the full ref-counting contract). Kept as a thin, independently
4
+ * named wrapper — same rationale as `host-toolbar-session-runtime.ts` — so
5
+ * a sidebar-focused test can `vi.resetModules()` this module's state without
6
+ * touching the toolbar's independent ref-count.
7
+ */
8
+ import { createHostSlotSessionRuntime } from './host-slot-session-runtime.js';
9
+ import { hostSidebarRuntimePreloadPath } from '../../utils/paths.js';
10
+ const runtime = createHostSlotSessionRuntime(hostSidebarRuntimePreloadPath);
11
+ export function acquireHostSidebarSessionRuntime() {
12
+ runtime.acquire();
13
+ }
14
+ export function releaseHostSidebarSessionRuntime() {
15
+ runtime.release();
16
+ }
17
+ //# sourceMappingURL=host-sidebar-session-runtime.js.map
@@ -0,0 +1,59 @@
1
+ import type { HostSlotControl } from './host-slot-view.js';
2
+ import type { PlacementReconciler } from './placement-reconciler.js';
3
+ import type { ViewManagerContext } from './view-manager.js';
4
+ /**
5
+ * Width mode for the host-sidebar placeholder strip, mirroring
6
+ * `HostToolbarHeightMode` on the inline axis.
7
+ */
8
+ export type HostSidebarWidthMode = 'auto' | {
9
+ fixed: number;
10
+ };
11
+ /**
12
+ * The control object the downstream host uses to own the sidebar
13
+ * WebContentsView. Derives the shared members from `HostSlotControl` — see
14
+ * that interface for their contract, which carries over unchanged on the
15
+ * inline axis — and adds only `setWidthMode` in place of the base's
16
+ * `setExtentMode`, mirroring `HostToolbarControl.setHeightMode`.
17
+ */
18
+ export interface HostSidebarControl extends Omit<HostSlotControl, 'setExtentMode'> {
19
+ /**
20
+ * Pin or unpin the sidebar strip width. Same contract as
21
+ * `HostToolbarControl.setHeightMode` on the inline axis.
22
+ */
23
+ setWidthMode(mode: HostSidebarWidthMode): void;
24
+ }
25
+ /**
26
+ * The host-sidebar slice of `ViewManager`'s public surface, split into its
27
+ * own file (mixed in via `extends`) to keep view-manager.ts under the repo's
28
+ * file-length ratchet. Mirrors `hostToolbar`'s members on the inline axis;
29
+ * never coexists with a height-cycle dependency on settings/popover/tooltip.
30
+ */
31
+ export interface HostSidebarViewManagerMembers {
32
+ /** Return the webContents ID of the host-sidebar overlay if alive, else null. */
33
+ getHostSidebarWebContentsId(): number | null;
34
+ /** Return the last host-sidebar width NOTIFIED to the main-window renderer. */
35
+ getHostSidebarWidth(): number;
36
+ /** Reverse size-advertiser sink for the sidebar strip's inline (width) axis. */
37
+ setHostSidebarWidth(extent: number): void;
38
+ /** Host-facing control surface for the sidebar WebContentsView. */
39
+ readonly hostSidebar: HostSidebarControl;
40
+ }
41
+ export interface HostSidebarView {
42
+ readonly control: HostSidebarControl;
43
+ setHostSidebarWidth(extent: number): void;
44
+ getHostSidebarWidth(): number;
45
+ getHostSidebarWebContentsId(): number | null;
46
+ dispose(): void;
47
+ }
48
+ /**
49
+ * Sidebar-specific instantiation of `createHostSlotView` (see that module for
50
+ * the full lazy-create / port-channel / extent-mode contract). Symmetric to
51
+ * `createHostToolbarView` on the inline (width) axis instead of block
52
+ * (height) — the slot itself is axis-agnostic (a single advertised extent
53
+ * number); which CSS dimension it resizes is decided entirely by the host's
54
+ * renderer placeholder layout, not here. The sidebar never coexists with the
55
+ * settings/popover/tooltip overlays, so unlike the toolbar there is no
56
+ * `reapplyPresentOverlays` dependency to thread through.
57
+ */
58
+ export declare function createHostSidebarView(ctx: ViewManagerContext, reconciler: PlacementReconciler): HostSidebarView;
59
+ //# sourceMappingURL=host-sidebar-view.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { HOST_SIDEBAR_RUNTIME_MARKER } from '../../../shared/constants.js';
2
+ import { VIEW_ID, VIEW_LAYER } from '../../../shared/view-ids.js';
3
+ import { acquireHostSidebarSessionRuntime, releaseHostSidebarSessionRuntime, } from './host-sidebar-session-runtime.js';
4
+ import { createHostSidebarPortChannel } from './host-sidebar-port-channel.js';
5
+ import { createHostSlotView, deriveSlotControl } from './host-slot-view.js';
6
+ /**
7
+ * Sidebar-specific instantiation of `createHostSlotView` (see that module for
8
+ * the full lazy-create / port-channel / extent-mode contract). Symmetric to
9
+ * `createHostToolbarView` on the inline (width) axis instead of block
10
+ * (height) — the slot itself is axis-agnostic (a single advertised extent
11
+ * number); which CSS dimension it resizes is decided entirely by the host's
12
+ * renderer placeholder layout, not here. The sidebar never coexists with the
13
+ * settings/popover/tooltip overlays, so unlike the toolbar there is no
14
+ * `reapplyPresentOverlays` dependency to thread through.
15
+ */
16
+ export function createHostSidebarView(ctx, reconciler) {
17
+ const port = createHostSidebarPortChannel({
18
+ isCurrent: (wc) => slot.getWebContentsId() === wc.id,
19
+ });
20
+ const slot = createHostSlotView(reconciler, {
21
+ viewId: VIEW_ID.hostSidebar,
22
+ layer: VIEW_LAYER.hostSidebar,
23
+ marker: HOST_SIDEBAR_RUNTIME_MARKER,
24
+ sessionRuntime: {
25
+ acquire: acquireHostSidebarSessionRuntime,
26
+ release: releaseHostSidebarSessionRuntime,
27
+ },
28
+ portChannel: port,
29
+ setExtentModeErrorLabel: 'hostSidebar.setWidthMode',
30
+ }, {
31
+ onExtentChanged: (width) => ctx.notify.hostSidebarWidthChanged(width),
32
+ });
33
+ const control = deriveSlotControl(slot.control, {
34
+ setWidthMode: (mode) => slot.control.setExtentMode(mode),
35
+ });
36
+ return {
37
+ control,
38
+ setHostSidebarWidth: (extent) => slot.setExtent(extent),
39
+ getHostSidebarWidth: () => slot.getExtent(),
40
+ getHostSidebarWebContentsId: () => slot.getWebContentsId(),
41
+ dispose: () => slot.dispose(),
42
+ };
43
+ }
44
+ //# sourceMappingURL=host-sidebar-view.js.map