@fps-games/editor 0.2.1-beta.3 → 0.2.1-beta.4

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 (514) hide show
  1. package/dist/build-info.json +44 -44
  2. package/dist/editor-commands/capabilities/assets.d.ts +8 -0
  3. package/dist/editor-commands/capabilities/assets.d.ts.map +1 -0
  4. package/dist/{agent-bridge → editor-commands}/capabilities/assets.js +41 -41
  5. package/dist/editor-commands/capabilities/assets.js.map +1 -0
  6. package/dist/editor-commands/capabilities/editor-state.d.ts +5 -0
  7. package/dist/editor-commands/capabilities/editor-state.d.ts.map +1 -0
  8. package/dist/{agent-bridge → editor-commands}/capabilities/editor-state.js +22 -22
  9. package/dist/editor-commands/capabilities/editor-state.js.map +1 -0
  10. package/dist/editor-commands/capabilities/hierarchy.d.ts +4 -0
  11. package/dist/editor-commands/capabilities/hierarchy.d.ts.map +1 -0
  12. package/dist/{agent-bridge → editor-commands}/capabilities/hierarchy.js +5 -5
  13. package/dist/editor-commands/capabilities/hierarchy.js.map +1 -0
  14. package/dist/editor-commands/capabilities/host-lifecycle.d.ts +11 -0
  15. package/dist/editor-commands/capabilities/host-lifecycle.d.ts.map +1 -0
  16. package/dist/editor-commands/capabilities/host-lifecycle.js +149 -0
  17. package/dist/editor-commands/capabilities/host-lifecycle.js.map +1 -0
  18. package/dist/editor-commands/capabilities/prefabs.d.ts +5 -0
  19. package/dist/editor-commands/capabilities/prefabs.d.ts.map +1 -0
  20. package/dist/{agent-bridge → editor-commands}/capabilities/prefabs.js +93 -93
  21. package/dist/editor-commands/capabilities/prefabs.js.map +1 -0
  22. package/dist/editor-commands/capabilities/scene-objects.d.ts +8 -0
  23. package/dist/editor-commands/capabilities/scene-objects.d.ts.map +1 -0
  24. package/dist/editor-commands/capabilities/scene-objects.js +480 -0
  25. package/dist/editor-commands/capabilities/scene-objects.js.map +1 -0
  26. package/dist/editor-commands/capabilities/selection.d.ts +5 -0
  27. package/dist/editor-commands/capabilities/selection.d.ts.map +1 -0
  28. package/dist/editor-commands/capabilities/selection.js +60 -0
  29. package/dist/editor-commands/capabilities/selection.js.map +1 -0
  30. package/dist/editor-commands/capabilities/shadows.d.ts +5 -0
  31. package/dist/editor-commands/capabilities/shadows.d.ts.map +1 -0
  32. package/dist/{agent-bridge → editor-commands}/capabilities/shadows.js +74 -74
  33. package/dist/editor-commands/capabilities/shadows.js.map +1 -0
  34. package/dist/editor-commands/capabilities/transform.d.ts +5 -0
  35. package/dist/editor-commands/capabilities/transform.d.ts.map +1 -0
  36. package/dist/editor-commands/capabilities/transform.js +164 -0
  37. package/dist/editor-commands/capabilities/transform.js.map +1 -0
  38. package/dist/editor-commands/capabilities/ui-regions.d.ts +4 -0
  39. package/dist/editor-commands/capabilities/ui-regions.d.ts.map +1 -0
  40. package/dist/{agent-bridge → editor-commands}/capabilities/ui-regions.js +55 -57
  41. package/dist/editor-commands/capabilities/ui-regions.js.map +1 -0
  42. package/dist/editor-commands/capabilities/viewport.d.ts +5 -0
  43. package/dist/editor-commands/capabilities/viewport.d.ts.map +1 -0
  44. package/dist/{agent-bridge → editor-commands}/capabilities/viewport.js +100 -100
  45. package/dist/editor-commands/capabilities/viewport.js.map +1 -0
  46. package/dist/editor-commands/command-sources.d.ts +7 -0
  47. package/dist/editor-commands/command-sources.d.ts.map +1 -0
  48. package/dist/editor-commands/command-sources.js +34 -0
  49. package/dist/editor-commands/command-sources.js.map +1 -0
  50. package/dist/editor-commands/diagnostics.d.ts +12 -0
  51. package/dist/editor-commands/diagnostics.d.ts.map +1 -0
  52. package/dist/{agent-bridge → editor-commands}/diagnostics.js +4 -4
  53. package/dist/editor-commands/diagnostics.js.map +1 -0
  54. package/dist/{agent-bridge → editor-commands}/index.d.ts +1 -1
  55. package/dist/editor-commands/index.d.ts.map +1 -0
  56. package/dist/{agent-bridge → editor-commands}/index.js +1 -1
  57. package/dist/editor-commands/index.js.map +1 -0
  58. package/dist/editor-commands/register.d.ts +4 -0
  59. package/dist/editor-commands/register.d.ts.map +1 -0
  60. package/dist/{agent-bridge → editor-commands}/register.js +323 -286
  61. package/dist/editor-commands/register.js.map +1 -0
  62. package/dist/{agent-bridge → editor-commands}/shared.d.ts +80 -80
  63. package/dist/editor-commands/shared.d.ts.map +1 -0
  64. package/dist/{agent-bridge → editor-commands}/shared.js +29 -29
  65. package/dist/editor-commands/shared.js.map +1 -0
  66. package/dist/editor-commands/source-types.d.ts +110 -0
  67. package/dist/editor-commands/source-types.d.ts.map +1 -0
  68. package/dist/editor-commands/source-types.js.map +1 -0
  69. package/dist/editor-plugin-commands.d.ts +4 -0
  70. package/dist/editor-plugin-commands.d.ts.map +1 -0
  71. package/dist/editor-plugin-commands.js +18 -0
  72. package/dist/editor-plugin-commands.js.map +1 -0
  73. package/dist/index.d.ts +2 -2
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/local-editor-commands.d.ts +2 -0
  78. package/dist/local-editor-commands.d.ts.map +1 -0
  79. package/dist/local-editor-commands.js +2 -0
  80. package/dist/local-editor-commands.js.map +1 -0
  81. package/dist/local-editor-harness.d.ts +35 -21
  82. package/dist/local-editor-harness.d.ts.map +1 -1
  83. package/dist/local-editor-harness.js +1721 -367
  84. package/dist/local-editor-harness.js.map +1 -1
  85. package/dist/local-editor-prefab-stage-transaction.d.ts +2 -1
  86. package/dist/local-editor-prefab-stage-transaction.d.ts.map +1 -1
  87. package/dist/local-editor-prefab-stage-transaction.js +6 -5
  88. package/dist/local-editor-prefab-stage-transaction.js.map +1 -1
  89. package/dist/local-editor-scene-view-interaction-runtime.d.ts.map +1 -1
  90. package/dist/local-editor-scene-view-interaction-runtime.js +2 -5
  91. package/dist/local-editor-scene-view-interaction-runtime.js.map +1 -1
  92. package/dist/playable-local-editor-entry.d.ts +10 -0
  93. package/dist/playable-local-editor-entry.d.ts.map +1 -1
  94. package/dist/playable-local-editor-entry.js +10 -2
  95. package/dist/playable-local-editor-entry.js.map +1 -1
  96. package/dist/playable-local-editor-host.d.ts +3 -32
  97. package/dist/playable-local-editor-host.d.ts.map +1 -1
  98. package/dist/playable-local-editor-host.js +6 -70
  99. package/dist/playable-local-editor-host.js.map +1 -1
  100. package/dist/playable-product-local-editor.d.ts +1 -2
  101. package/dist/playable-product-local-editor.d.ts.map +1 -1
  102. package/dist/playable-product-local-editor.js +0 -1
  103. package/dist/playable-product-local-editor.js.map +1 -1
  104. package/dist/playable-product-projection-preview.d.ts.map +1 -1
  105. package/dist/playable-product-projection-preview.js +1 -1
  106. package/dist/playable-product-projection-preview.js.map +1 -1
  107. package/dist/playable-product-scene-capabilities.d.ts +0 -2
  108. package/dist/playable-product-scene-capabilities.d.ts.map +1 -1
  109. package/dist/playable-product-scene-capabilities.js +33 -6
  110. package/dist/playable-product-scene-capabilities.js.map +1 -1
  111. package/dist/playable-runtime-babylon.d.ts +4 -0
  112. package/dist/playable-runtime-babylon.d.ts.map +1 -1
  113. package/dist/playable-runtime-babylon.js +4 -0
  114. package/dist/playable-runtime-babylon.js.map +1 -1
  115. package/dist/playable-sdk.d.ts +1 -1
  116. package/dist/playable-sdk.d.ts.map +1 -1
  117. package/dist/playable-sdk.js.map +1 -1
  118. package/dist/playable-standard-project.d.ts +0 -2
  119. package/dist/playable-standard-project.d.ts.map +1 -1
  120. package/dist/playable-standard-project.js +1 -2
  121. package/dist/playable-standard-project.js.map +1 -1
  122. package/dist/project-service-projection.d.ts +16 -0
  123. package/dist/project-service-projection.d.ts.map +1 -0
  124. package/dist/project-service-projection.js +67 -0
  125. package/dist/project-service-projection.js.map +1 -0
  126. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.d.ts +18 -0
  127. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.d.ts.map +1 -1
  128. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.js +54 -18
  129. package/node_modules/@fps-games/babylon-renderer/dist/post-process/babylon-default-pipeline.js.map +1 -1
  130. package/node_modules/@fps-games/babylon-renderer/package.json +9 -9
  131. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +1 -0
  132. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
  133. package/node_modules/@fps-games/editor-babylon/dist/projection.js +1 -1
  134. package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
  135. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts.map +1 -1
  136. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js +127 -13
  137. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js.map +1 -1
  138. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
  139. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +66 -1
  140. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
  141. package/node_modules/@fps-games/editor-babylon/package.json +6 -6
  142. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.d.ts +32 -0
  143. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.d.ts.map +1 -0
  144. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.js +254 -0
  145. package/node_modules/@fps-games/editor-browser/dist/editor-command-service-client.js.map +1 -0
  146. package/node_modules/@fps-games/editor-browser/dist/index.d.ts +3 -1
  147. package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
  148. package/node_modules/@fps-games/editor-browser/dist/index.js +2 -0
  149. package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
  150. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.d.ts +68 -0
  151. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.d.ts.map +1 -0
  152. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.js +650 -0
  153. package/node_modules/@fps-games/editor-browser/dist/local-editor-command-center.js.map +1 -0
  154. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.d.ts +1 -0
  155. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.d.ts.map +1 -1
  156. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.js +22 -0
  157. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-formal-surface-visibility.js.map +1 -1
  158. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts +8 -0
  159. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
  160. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +117 -6
  161. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
  162. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +14 -1
  163. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
  164. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +100 -1
  165. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
  166. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +8 -1
  167. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
  168. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +75 -2
  169. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
  170. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +37 -12
  171. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
  172. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.js.map +1 -1
  173. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +25 -2
  174. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
  175. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +332 -107
  176. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
  177. package/node_modules/@fps-games/editor-browser/package.json +7 -7
  178. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.d.ts +107 -0
  179. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.d.ts.map +1 -0
  180. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.js +1211 -0
  181. package/node_modules/@fps-games/editor-core/dist/editor-authoring-host.js.map +1 -0
  182. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.d.ts +34 -0
  183. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.d.ts.map +1 -0
  184. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.js +260 -0
  185. package/node_modules/@fps-games/editor-core/dist/editor-command-capability-adapter.js.map +1 -0
  186. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.d.ts +9 -0
  187. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.d.ts.map +1 -0
  188. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.js +14 -0
  189. package/node_modules/@fps-games/editor-core/dist/editor-command-composed-authority.js.map +1 -0
  190. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.d.ts +18 -0
  191. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.d.ts.map +1 -0
  192. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.js +113 -0
  193. package/node_modules/@fps-games/editor-core/dist/editor-command-observability.js.map +1 -0
  194. package/node_modules/@fps-games/editor-core/dist/editor-command-system.d.ts +82 -0
  195. package/node_modules/@fps-games/editor-core/dist/editor-command-system.d.ts.map +1 -0
  196. package/node_modules/@fps-games/editor-core/dist/editor-command-system.js +1098 -0
  197. package/node_modules/@fps-games/editor-core/dist/editor-command-system.js.map +1 -0
  198. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.d.ts +6 -7
  199. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.d.ts.map +1 -1
  200. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.js +62 -103
  201. package/node_modules/@fps-games/editor-core/dist/editor-plugin-host.js.map +1 -1
  202. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.d.ts +30 -0
  203. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.d.ts.map +1 -0
  204. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.js +540 -0
  205. package/node_modules/@fps-games/editor-core/dist/editor-service-gateway.js.map +1 -0
  206. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.d.ts +9 -0
  207. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.d.ts.map +1 -0
  208. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.js +61 -0
  209. package/node_modules/@fps-games/editor-core/dist/editor-session-authority.js.map +1 -0
  210. package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts +55 -0
  211. package/node_modules/@fps-games/editor-core/dist/editor-session.d.ts.map +1 -1
  212. package/node_modules/@fps-games/editor-core/dist/editor-session.js +247 -6
  213. package/node_modules/@fps-games/editor-core/dist/editor-session.js.map +1 -1
  214. package/node_modules/@fps-games/editor-core/dist/index.d.ts +6 -2
  215. package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
  216. package/node_modules/@fps-games/editor-core/dist/index.js +6 -2
  217. package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
  218. package/node_modules/@fps-games/editor-core/package.json +6 -6
  219. package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts +0 -1
  220. package/node_modules/@fps-games/editor-forge-play/dist/index.d.ts.map +1 -1
  221. package/node_modules/@fps-games/editor-forge-play/dist/index.js +0 -1
  222. package/node_modules/@fps-games/editor-forge-play/dist/index.js.map +1 -1
  223. package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
  224. package/node_modules/@fps-games/editor-playable-sdk/dist/bridge-command/protocol.d.ts +2 -0
  225. package/node_modules/@fps-games/editor-playable-sdk/dist/bridge-command/protocol.d.ts.map +1 -1
  226. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
  227. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +41 -1
  228. package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
  229. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.d.ts +27 -1
  230. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.d.ts.map +1 -1
  231. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play-types.js.map +1 -1
  232. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.d.ts +2 -0
  233. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.d.ts.map +1 -1
  234. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js +214 -7
  235. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/forge-play.js.map +1 -1
  236. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.d.ts +1 -0
  237. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.d.ts.map +1 -1
  238. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.js +11 -3
  239. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/host-controller.js.map +1 -1
  240. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.d.ts +2 -4
  241. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.d.ts.map +1 -1
  242. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.js +0 -1
  243. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/index.js.map +1 -1
  244. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.d.ts.map +1 -1
  245. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js +77 -31
  246. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/lifecycle.js.map +1 -1
  247. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.d.ts +8 -1
  248. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.d.ts.map +1 -1
  249. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/types.js.map +1 -1
  250. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.d.ts +21 -1
  251. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.d.ts.map +1 -1
  252. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.js +90 -4
  253. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/asset-fields.js.map +1 -1
  254. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts +27 -1
  255. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.d.ts.map +1 -1
  256. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js +161 -1
  257. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/binding.js.map +1 -1
  258. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.d.ts +2 -2
  259. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.d.ts.map +1 -1
  260. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.js +5 -92
  261. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/inspector.js.map +1 -1
  262. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.d.ts +7 -0
  263. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.d.ts.map +1 -1
  264. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.js +26 -9
  265. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/scene-inspector.js.map +1 -1
  266. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.d.ts +9 -0
  267. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.d.ts.map +1 -1
  268. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.js +19 -8
  269. package/node_modules/@fps-games/editor-playable-sdk/dist/material-binding/slot-inspector.js.map +1 -1
  270. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.d.ts +5 -0
  271. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.d.ts.map +1 -1
  272. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.js +16 -4
  273. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/material-override-inspector.js.map +1 -1
  274. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.d.ts +9 -0
  275. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.d.ts.map +1 -1
  276. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.js +12 -2
  277. package/node_modules/@fps-games/editor-playable-sdk/dist/prefab-stage/stage-inspector.js.map +1 -1
  278. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.d.ts +2 -1
  279. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.d.ts.map +1 -1
  280. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.js +10 -5
  281. package/node_modules/@fps-games/editor-playable-sdk/dist/product/ground-decal.js.map +1 -1
  282. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.d.ts +1 -0
  283. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.d.ts.map +1 -1
  284. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.js +1 -0
  285. package/node_modules/@fps-games/editor-playable-sdk/dist/product/index.js.map +1 -1
  286. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.d.ts +17 -82
  287. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.d.ts.map +1 -1
  288. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.js +53 -57
  289. package/node_modules/@fps-games/editor-playable-sdk/dist/product/project-host-services.js.map +1 -1
  290. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.d.ts.map +1 -1
  291. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.js +3 -2
  292. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-session.js.map +1 -1
  293. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.d.ts +10 -0
  294. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.d.ts.map +1 -0
  295. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.js +256 -0
  296. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-authoring-commands.js.map +1 -0
  297. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.d.ts.map +1 -1
  298. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.js +7 -5
  299. package/node_modules/@fps-games/editor-playable-sdk/dist/product/standard-scene-assembly.js.map +1 -1
  300. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts.map +1 -1
  301. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +8 -0
  302. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
  303. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts +1 -0
  304. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.d.ts.map +1 -1
  305. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/types.js.map +1 -1
  306. package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js +134 -12
  307. package/node_modules/@fps-games/editor-playable-sdk/dist/upgrade-doctor/inspectors.js.map +1 -1
  308. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.d.ts.map +1 -1
  309. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.js +47 -0
  310. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-scene-workflow.js.map +1 -1
  311. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.d.ts +27 -0
  312. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.d.ts.map +1 -0
  313. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.js +592 -0
  314. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/editor-service-vite.js.map +1 -0
  315. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +3 -1
  316. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
  317. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +2 -1
  318. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
  319. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.d.ts.map +1 -1
  320. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js +61 -6
  321. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/plugin.js.map +1 -1
  322. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.d.ts +0 -2
  323. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.d.ts.map +1 -1
  324. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.js +1 -10
  325. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-adapter.js.map +1 -1
  326. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts.map +1 -1
  327. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js +21 -0
  328. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js.map +1 -1
  329. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.d.ts +13 -0
  330. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.d.ts.map +1 -0
  331. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.js +18 -0
  332. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-authoring-backend.js.map +1 -0
  333. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.d.ts +28 -0
  334. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.d.ts.map +1 -0
  335. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.js +863 -0
  336. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-editor-service.js.map +1 -0
  337. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts +2 -0
  338. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.d.ts.map +1 -1
  339. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/types.js.map +1 -1
  340. package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
  341. package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.d.ts +1626 -0
  342. package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.d.ts.map +1 -0
  343. package/node_modules/@fps-games/editor-protocol/dist/{agent-bridge.js → editor-command-capabilities.js} +766 -620
  344. package/node_modules/@fps-games/editor-protocol/dist/editor-command-capabilities.js.map +1 -0
  345. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.d.ts +69 -0
  346. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.d.ts.map +1 -0
  347. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.js +22 -0
  348. package/node_modules/@fps-games/editor-protocol/dist/editor-command-trace.js.map +1 -0
  349. package/node_modules/@fps-games/editor-protocol/dist/editor-command.d.ts +136 -0
  350. package/node_modules/@fps-games/editor-protocol/dist/editor-command.d.ts.map +1 -0
  351. package/node_modules/@fps-games/editor-protocol/dist/editor-command.js +2 -0
  352. package/node_modules/@fps-games/editor-protocol/dist/editor-command.js.map +1 -0
  353. package/node_modules/@fps-games/editor-protocol/dist/editor-service.d.ts +225 -0
  354. package/node_modules/@fps-games/editor-protocol/dist/editor-service.d.ts.map +1 -0
  355. package/node_modules/@fps-games/editor-protocol/dist/editor-service.js +4 -0
  356. package/node_modules/@fps-games/editor-protocol/dist/editor-service.js.map +1 -0
  357. package/node_modules/@fps-games/editor-protocol/dist/index.d.ts +6 -3
  358. package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
  359. package/node_modules/@fps-games/editor-protocol/dist/index.js +6 -3
  360. package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
  361. package/node_modules/@fps-games/editor-protocol/package.json +2 -2
  362. package/node_modules/@fps-games/editor-tooling/package.json +3 -3
  363. package/node_modules/@fps-games/editor-ui/package.json +1 -1
  364. package/node_modules/@fps-games/playable-assets/package.json +1 -1
  365. package/node_modules/@fps-games/playable-contracts/package.json +1 -1
  366. package/node_modules/@fps-games/playable-rendering/package.json +2 -2
  367. package/node_modules/@fps-games/playable-runtime/package.json +12 -12
  368. package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
  369. package/node_modules/@fps-games/playable-scene/package.json +2 -2
  370. package/node_modules/@fps-games/plugin-api/package.json +1 -1
  371. package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
  372. package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
  373. package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
  374. package/node_modules/@fps-games/plugin-assets/package.json +6 -6
  375. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.d.ts +1 -0
  376. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.d.ts.map +1 -1
  377. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.js +78 -4
  378. package/node_modules/@fps-games/plugin-hierarchy/dist/kernel.js.map +1 -1
  379. package/node_modules/@fps-games/plugin-hierarchy/dist/version.d.ts +1 -1
  380. package/node_modules/@fps-games/plugin-hierarchy/dist/version.js +1 -1
  381. package/node_modules/@fps-games/plugin-hierarchy/dist/version.js.map +1 -1
  382. package/node_modules/@fps-games/plugin-hierarchy/package.json +5 -5
  383. package/node_modules/@fps-games/plugin-host/package.json +2 -2
  384. package/node_modules/@fps-games/plugin-markers/dist/version.d.ts +1 -1
  385. package/node_modules/@fps-games/plugin-markers/dist/version.js +1 -1
  386. package/node_modules/@fps-games/plugin-markers/dist/version.js.map +1 -1
  387. package/node_modules/@fps-games/plugin-markers/package.json +5 -5
  388. package/node_modules/@fps-games/plugin-materials/dist/version.d.ts +1 -1
  389. package/node_modules/@fps-games/plugin-materials/dist/version.js +1 -1
  390. package/node_modules/@fps-games/plugin-materials/dist/version.js.map +1 -1
  391. package/node_modules/@fps-games/plugin-materials/package.json +5 -5
  392. package/node_modules/@fps-games/plugin-rendering/dist/version.d.ts +1 -1
  393. package/node_modules/@fps-games/plugin-rendering/dist/version.js +1 -1
  394. package/node_modules/@fps-games/plugin-rendering/dist/version.js.map +1 -1
  395. package/node_modules/@fps-games/plugin-rendering/package.json +5 -5
  396. package/node_modules/@fps-games/plugin-scene/dist/version.d.ts +1 -1
  397. package/node_modules/@fps-games/plugin-scene/dist/version.js +1 -1
  398. package/node_modules/@fps-games/plugin-scene/dist/version.js.map +1 -1
  399. package/node_modules/@fps-games/plugin-scene/package.json +5 -5
  400. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.d.ts +1 -1
  401. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js +1 -1
  402. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js.map +1 -1
  403. package/node_modules/@fps-games/plugin-shadow-map-experiment/package.json +5 -5
  404. package/node_modules/@fps-games/plugin-shadows/dist/version.d.ts +1 -1
  405. package/node_modules/@fps-games/plugin-shadows/dist/version.js +1 -1
  406. package/node_modules/@fps-games/plugin-shadows/dist/version.js.map +1 -1
  407. package/node_modules/@fps-games/plugin-shadows/package.json +7 -7
  408. package/package.json +23 -23
  409. package/dist/agent-bridge/capabilities/assets.d.ts +0 -8
  410. package/dist/agent-bridge/capabilities/assets.d.ts.map +0 -1
  411. package/dist/agent-bridge/capabilities/assets.js.map +0 -1
  412. package/dist/agent-bridge/capabilities/editor-state.d.ts +0 -5
  413. package/dist/agent-bridge/capabilities/editor-state.d.ts.map +0 -1
  414. package/dist/agent-bridge/capabilities/editor-state.js.map +0 -1
  415. package/dist/agent-bridge/capabilities/hierarchy.d.ts +0 -4
  416. package/dist/agent-bridge/capabilities/hierarchy.d.ts.map +0 -1
  417. package/dist/agent-bridge/capabilities/hierarchy.js.map +0 -1
  418. package/dist/agent-bridge/capabilities/host-lifecycle.d.ts +0 -11
  419. package/dist/agent-bridge/capabilities/host-lifecycle.d.ts.map +0 -1
  420. package/dist/agent-bridge/capabilities/host-lifecycle.js +0 -149
  421. package/dist/agent-bridge/capabilities/host-lifecycle.js.map +0 -1
  422. package/dist/agent-bridge/capabilities/prefabs.d.ts +0 -5
  423. package/dist/agent-bridge/capabilities/prefabs.d.ts.map +0 -1
  424. package/dist/agent-bridge/capabilities/prefabs.js.map +0 -1
  425. package/dist/agent-bridge/capabilities/scene-objects.d.ts +0 -8
  426. package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +0 -1
  427. package/dist/agent-bridge/capabilities/scene-objects.js +0 -480
  428. package/dist/agent-bridge/capabilities/scene-objects.js.map +0 -1
  429. package/dist/agent-bridge/capabilities/selection.d.ts +0 -5
  430. package/dist/agent-bridge/capabilities/selection.d.ts.map +0 -1
  431. package/dist/agent-bridge/capabilities/selection.js +0 -60
  432. package/dist/agent-bridge/capabilities/selection.js.map +0 -1
  433. package/dist/agent-bridge/capabilities/shadows.d.ts +0 -5
  434. package/dist/agent-bridge/capabilities/shadows.d.ts.map +0 -1
  435. package/dist/agent-bridge/capabilities/shadows.js.map +0 -1
  436. package/dist/agent-bridge/capabilities/transform.d.ts +0 -5
  437. package/dist/agent-bridge/capabilities/transform.d.ts.map +0 -1
  438. package/dist/agent-bridge/capabilities/transform.js +0 -164
  439. package/dist/agent-bridge/capabilities/transform.js.map +0 -1
  440. package/dist/agent-bridge/capabilities/ui-regions.d.ts +0 -4
  441. package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +0 -1
  442. package/dist/agent-bridge/capabilities/ui-regions.js.map +0 -1
  443. package/dist/agent-bridge/capabilities/viewport.d.ts +0 -5
  444. package/dist/agent-bridge/capabilities/viewport.d.ts.map +0 -1
  445. package/dist/agent-bridge/capabilities/viewport.js.map +0 -1
  446. package/dist/agent-bridge/capability-sources.d.ts +0 -7
  447. package/dist/agent-bridge/capability-sources.d.ts.map +0 -1
  448. package/dist/agent-bridge/capability-sources.js +0 -34
  449. package/dist/agent-bridge/capability-sources.js.map +0 -1
  450. package/dist/agent-bridge/diagnostics.d.ts +0 -12
  451. package/dist/agent-bridge/diagnostics.d.ts.map +0 -1
  452. package/dist/agent-bridge/diagnostics.js.map +0 -1
  453. package/dist/agent-bridge/index.d.ts.map +0 -1
  454. package/dist/agent-bridge/index.js.map +0 -1
  455. package/dist/agent-bridge/register.d.ts +0 -4
  456. package/dist/agent-bridge/register.d.ts.map +0 -1
  457. package/dist/agent-bridge/register.js.map +0 -1
  458. package/dist/agent-bridge/shared.d.ts.map +0 -1
  459. package/dist/agent-bridge/shared.js.map +0 -1
  460. package/dist/agent-bridge/source-types.d.ts +0 -110
  461. package/dist/agent-bridge/source-types.d.ts.map +0 -1
  462. package/dist/agent-bridge/source-types.js.map +0 -1
  463. package/dist/editor-plugin-agent-capabilities.d.ts +0 -4
  464. package/dist/editor-plugin-agent-capabilities.d.ts.map +0 -1
  465. package/dist/editor-plugin-agent-capabilities.js +0 -64
  466. package/dist/editor-plugin-agent-capabilities.js.map +0 -1
  467. package/dist/local-editor-agent-actions.d.ts +0 -43
  468. package/dist/local-editor-agent-actions.d.ts.map +0 -1
  469. package/dist/local-editor-agent-actions.js +0 -321
  470. package/dist/local-editor-agent-actions.js.map +0 -1
  471. package/dist/local-editor-agent-bridge-transport.d.ts +0 -129
  472. package/dist/local-editor-agent-bridge-transport.d.ts.map +0 -1
  473. package/dist/local-editor-agent-bridge-transport.js +0 -403
  474. package/dist/local-editor-agent-bridge-transport.js.map +0 -1
  475. package/dist/local-editor-agent-bridge.d.ts +0 -2
  476. package/dist/local-editor-agent-bridge.d.ts.map +0 -1
  477. package/dist/local-editor-agent-bridge.js +0 -2
  478. package/dist/local-editor-agent-bridge.js.map +0 -1
  479. package/dist/local-editor-agent-context.d.ts +0 -68
  480. package/dist/local-editor-agent-context.d.ts.map +0 -1
  481. package/dist/local-editor-agent-context.js +0 -716
  482. package/dist/local-editor-agent-context.js.map +0 -1
  483. package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts +0 -22
  484. package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts.map +0 -1
  485. package/node_modules/@fps-games/editor-core/dist/agent-bridge.js +0 -106
  486. package/node_modules/@fps-games/editor-core/dist/agent-bridge.js.map +0 -1
  487. package/node_modules/@fps-games/editor-core/dist/agent-interaction.d.ts +0 -17
  488. package/node_modules/@fps-games/editor-core/dist/agent-interaction.d.ts.map +0 -1
  489. package/node_modules/@fps-games/editor-core/dist/agent-interaction.js +0 -14
  490. package/node_modules/@fps-games/editor-core/dist/agent-interaction.js.map +0 -1
  491. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.d.ts +0 -23
  492. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.d.ts.map +0 -1
  493. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.js +0 -47
  494. package/node_modules/@fps-games/editor-forge-play/dist/agent-transport.js.map +0 -1
  495. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.d.ts +0 -112
  496. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.d.ts.map +0 -1
  497. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.js +0 -159
  498. package/node_modules/@fps-games/editor-playable-sdk/dist/local-harness/agent-descriptions.js.map +0 -1
  499. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.d.ts +0 -15
  500. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.d.ts.map +0 -1
  501. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.js +0 -76
  502. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/session-metadata.js.map +0 -1
  503. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts +0 -1622
  504. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts.map +0 -1
  505. package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js.map +0 -1
  506. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts +0 -68
  507. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts.map +0 -1
  508. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js +0 -23
  509. package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js.map +0 -1
  510. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +0 -187
  511. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +0 -1
  512. package/node_modules/@fps-games/editor-protocol/dist/agent.js +0 -5
  513. package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +0 -1
  514. /package/dist/{agent-bridge → editor-commands}/source-types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"local-editor-ui-hierarchy-controller.js","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAUN,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wCAAwC,GAKzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qCAAqC,GACtC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qCAAqC,EACrC,sCAAsC,EACtC,2CAA2C,GAC5C,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,mCAAmC,GACpC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,yCAAyC,GAC1C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,qCAAqC,EAAE,MAAM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archyJsonValue,\n type HierarchyKernel,\n type HierarchyNodeSnapshot,\n type HierarchyOperationResult,\n type HierarchyOperationDescriptor,\n type HierarchyOperationContext,\n type HierarchyViewModel,\n} from '@fps-games/plugin-hierarchy';\nimport {\n resolveLocalEditorHierarchyDragOperation,\n type LocalEditorHierarchyDragLayout,\n type LocalEditorHierarchyDragLayoutRow,\n type LocalEditorHierarchyDragOperation,\n type LocalEditorHierarchyDropPreview,\n} from './local-editor-ui-hierarchy-drag-policy';\nimport {\n resolveLocalEditorHierarchyAutoScroll,\n} from './local-editor-ui-hierarchy-auto-scroll';\nimport {\n clearLocalEditorStructuredDragSession,\n createLocalEditorStructuredDragSession,\n hasLocalEditorStructuredDragSessionFeedback,\n} from './local-editor-ui-structured-drag-session';\nimport {\n LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT,\n renderLocalEditorHierarchyPanel,\n syncLocalEditorHierarchyDropPreview,\n} from './local-editor-ui-hierarchy-view';\nimport {\n createLocalEditorViewportRevealController,\n} from './local-editor-ui-dock-panel';\nimport { createLocalEditorHierarchyViewAdapter } from './local-editor-ui-hierarchy-view-adapter';\nimport type { LocalEditorContextMenuController } from './local-editor-ui-context-menu';\nimport type { LocalEditorWorkbenchInputRouter } from './local-editor-ui-input-router';\nimport type {\n LocalEditorBrowserUiState,\n LocalEditorContextMenuItem,\n} from './local-editor-ui-types';\n\nconst HIERARCHY_DRAG_INDENT_WIDTH = 16;\n\nexport function createHierarchyEnabledOperationRequest(\n node: Pick<HierarchyNodeSnapshot, 'authoredEnabled'> | null | undefined,\n directEnabled: boolean | undefined,\n): Readonly<{ operationId: 'hierarchy.node.set-enabled' | 'hierarchy.node.set-visible'; input: Readonly<Record<string, boolean>> }> {\n const nextValue = directEnabled === false;\n return node?.authoredEnabled === undefined\n ? Object.freeze({ operationId: 'hierarchy.node.set-visible', input: Object.freeze({ visible: nextValue }) })\n : Object.freeze({ operationId: 'hierarchy.node.set-enabled', input: Object.freeze({ enabled: nextValue }) });\n}\n\nexport function createHierarchyOperationMenuItems(\n operations: readonly HierarchyOperationDescriptor[],\n): LocalEditorContextMenuItem[] {\n type MenuPresentation = Readonly<{\n path: readonly Readonly<{ id: string; label: string; order?: number }>[];\n group: string;\n order: number;\n }>;\n interface MenuNode {\n id: string;\n label: string;\n order: number;\n children: Map<string, MenuNode>;\n operations: Array<{ operation: HierarchyOperationDescriptor; presentation: MenuPresentation; sourceIndex: number }>;\n }\n const root: MenuNode = { id: '', label: '', order: 0, children: new Map(), operations: [] };\n const operationIds = new Set<string>();\n for (const operation of operations) {\n if (operationIds.has(operation.id)) throw new Error(`Duplicate Hierarchy operation id: ${operation.id}.`);\n operationIds.add(operation.id);\n }\n operations.forEach((operation, sourceIndex) => {\n if (operation.menu === false) return;\n const presentation = resolveHierarchyOperationMenuPresentation(operation);\n let parent = root;\n for (const segment of presentation.path) {\n const existing = parent.children.get(segment.id);\n if (existing && (existing.label !== segment.label || existing.order !== (segment.order ?? 0))) {\n throw new Error(`Hierarchy menu path conflict for segment ${segment.id}.`);\n }\n const node = existing ?? {\n id: segment.id, label: segment.label, order: segment.order ?? 0, children: new Map(), operations: [],\n };\n parent.children.set(segment.id, node);\n parent = node;\n }\n parent.operations.push({ operation, presentation, sourceIndex });\n });\n const materialize = (node: MenuNode, parentPath: readonly string[] = []): LocalEditorContextMenuItem[] => {\n const entries = [\n ...[...node.children.values()].map(child => ({ kind: 'path' as const, order: child.order, group: `path:${child.id}`, sourceIndex: -1, child })),\n ...node.operations.map(entry => ({\n kind: 'operation' as const,\n order: entry.presentation.order,\n group: entry.presentation.group,\n sourceIndex: entry.sourceIndex,\n operation: entry.operation,\n })),\n ].sort((left, right) => left.order - right.order || left.sourceIndex - right.sourceIndex);\n return entries.map((entry, index) => {\n const previous = entries[index - 1];\n const separatorBefore = index > 0 && previous?.group !== entry.group;\n if (entry.kind === 'path') {\n const path = [...parentPath, entry.child.id];\n const presentationId = `hierarchy.menu.path:${path.map(segment => encodeURIComponent(segment)).join('/')}`;\n if (operationIds.has(presentationId)) {\n throw new Error(`Hierarchy operation id conflicts with menu presentation id: ${presentationId}.`);\n }\n return {\n id: presentationId,\n label: entry.child.label,\n separatorBefore,\n children: materialize(entry.child, path),\n };\n }\n const operation = entry.operation;\n return {\n id: operation.id, label: operation.label, shortcut: operation.shortcut, danger: operation.danger,\n disabled: !!operation.disabledReason, disabledReason: operation.disabledReason, separatorBefore,\n };\n });\n };\n return materialize(root);\n\n function resolveHierarchyOperationMenuPresentation(operation: HierarchyOperationDescriptor): MenuPresentation {\n if (operation.menu !== undefined && operation.menu !== false) {\n return {\n path: operation.menu.path ?? [],\n group: operation.menu.group ?? '',\n order: operation.menu.order ?? 0,\n };\n }\n const placement = operation.placement ?? 'bottom';\n const placementOrder: Record<NonNullable<HierarchyOperationDescriptor['placement']>, number> = {\n top: -100,\n 'after-primary': 5,\n 'after-edit': 15,\n 'after-create': 25,\n 'after-clipboard': 45,\n bottom: 100,\n };\n return { path: [], group: `legacy:${placement}`, order: placementOrder[placement] };\n }\n}\n\nexport function createHierarchyToolbarCreateMenuItems(\n operations: readonly HierarchyOperationDescriptor[],\n): LocalEditorContextMenuItem[] {\n const createOperations = operations.flatMap(operation => {\n if (operation.menu === false || !operation.menu?.path?.length || operation.menu.path[0]?.id !== 'create') return [];\n return [{\n ...operation,\n menu: {\n ...operation.menu,\n path: operation.menu.path.slice(1),\n },\n } satisfies HierarchyOperationDescriptor];\n });\n return createHierarchyOperationMenuItems(createOperations);\n}\n\nexport function canUseHierarchyProviderReparent(\n model: HierarchyViewModel | null,\n operationAvailable = model?.operations.some(operation => operation.id === 'hierarchy.node.reparent') === true,\n): boolean {\n return !!model\n && !model.snapshot.readonly\n && model.snapshot.capabilities.reparent === true\n && operationAvailable;\n}\n\nexport function matchesHierarchyOperationShortcut(\n event: Pick<KeyboardEvent, 'key' | 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'>,\n shortcut: string,\n): boolean {\n const tokens = shortcut.toLowerCase().split('+').map(token => token.trim()).filter(Boolean);\n const keyToken = tokens[tokens.length - 1];\n if (!keyToken) return false;\n const primary = event.metaKey || event.ctrlKey;\n if (tokens.includes('ctrl/cmd') !== primary) return false;\n if (tokens.includes('alt') !== event.altKey) return false;\n if (tokens.includes('shift') !== event.shiftKey) return false;\n const key = event.key.toLowerCase();\n return keyToken === 'delete'\n ? key === 'delete' || key === 'backspace'\n : keyToken === key;\n}\n\nexport interface LocalEditorHierarchyController<TDocument = unknown> {\n render(state: LocalEditorBrowserUiState<TDocument>): void;\n handleEditShortcut(event: KeyboardEvent): boolean;\n handleDeleteShortcut(event: KeyboardEvent): boolean;\n dispose(): void;\n}\n\nexport interface LocalEditorHierarchyControllerOptions<TDocument = unknown> {\n doc: Document;\n panel: HTMLElement;\n inputRouter: LocalEditorWorkbenchInputRouter;\n contextMenu: LocalEditorContextMenuController;\n kernel: HierarchyKernel;\n onOperationResult?: (result: HierarchyOperationResult) => void;\n getState: () => LocalEditorBrowserUiState<TDocument> | null;\n requestRender: () => void;\n onBeforeOpenContextMenu?: () => void;\n requestOperationInput?: (\n operation: HierarchyOperationDescriptor,\n context: HierarchyOperationContext,\n ) => Promise<Readonly<Record<string, HierarchyJsonValue>> | null>;\n}\n\ninterface BrowserHierarchyScopeMetadata {\n scopeId: string;\n revision: number;\n kind: string;\n title: string;\n searchPlaceholder: string;\n selectedIds: readonly string[];\n activeId: string | null;\n readonly: boolean;\n}\n\nexport function createLocalEditorHierarchyController<TDocument = unknown>(\n options: LocalEditorHierarchyControllerOptions<TDocument>,\n): LocalEditorHierarchyController<TDocument> {\n const { doc, panel, inputRouter, contextMenu, getState, requestRender, kernel } = options;\n let hierarchyRootDrop = false;\n const hierarchyDragSession = createLocalEditorStructuredDragSession<\n LocalEditorHierarchyDragOperation,\n LocalEditorHierarchyDropPreview\n >();\n let hierarchyShortcutScopeActive = false;\n let hierarchySearchComposition: HierarchyCompositionSession<HTMLInputElement> | null = null;\n let hierarchyRenameComposition: HierarchyCompositionSession<HTMLInputElement> | null = null;\n let nativeHierarchyDragActive = false;\n let lastRenderedActiveId: string | null | undefined;\n let lastRenderedScopeId: string | null | undefined;\n let pendingHierarchyScrollId: string | null = null;\n let currentBridgeState: LocalEditorBrowserUiState<TDocument> | null = null;\n let currentKernelViewModel: HierarchyViewModel | null = null;\n let cachedVisibleIds: {\n projection: HierarchyViewModel['projection'];\n ids: readonly string[];\n } | null = null;\n let renderedHierarchyAuthority: Readonly<{ token: number; scopeKey: string; revision: number }> | null = null;\n let renderedHierarchyProjection: HierarchyViewModel['projection'] | null = null;\n let renderedHierarchyDragId: string | null = null;\n let hierarchyRenderReplacingRenameInput = false;\n let pendingHierarchyDragOver: DragEvent | null = null;\n let hierarchyDragOverFrame: number | null = null;\n let hierarchyViewportRectFrame = -1;\n let hierarchyViewportRect: DOMRect | null = null;\n let hierarchyHoverExpandTimer: number | null = null;\n let hierarchyHoverExpandId: string | null = null;\n let lastHierarchyDropPreviewKey = '';\n\n function cancelPendingHierarchyDragOver(): void {\n if (hierarchyDragOverFrame !== null) doc.defaultView?.cancelAnimationFrame(hierarchyDragOverFrame);\n hierarchyDragOverFrame = null;\n pendingHierarchyDragOver = null;\n }\n const treeViewportReveal = createLocalEditorViewportRevealController<string>({\n getViewport: findHierarchyTreeViewport,\n margin: 4,\n });\n\n const renderPanel = (state: LocalEditorBrowserUiState<TDocument>): void => {\n const scope = resolveScope(state);\n const toolbarOperations = currentKernelViewModel\n ? kernel.listOperations({\n scopeKey: currentKernelViewModel.snapshot.scopeKey,\n expectedRevision: currentKernelViewModel.snapshot.revision,\n contextNodeId: null,\n targetIds: [],\n activeId: currentKernelViewModel.snapshot.activeId,\n }, currentKernelViewModel.authorityToken)\n : [];\n const scopeChanged = scope.scopeId !== lastRenderedScopeId;\n if (scopeChanged) {\n hierarchySearchComposition = null;\n hierarchyRenameComposition = null;\n clearHierarchyDragFeedback();\n }\n const activeIdChanged = scope.activeId !== lastRenderedActiveId || scopeChanged;\n const treeScrollSnapshot = treeViewportReveal.captureScrollSnapshot();\n const activeRenameInput = doc.activeElement instanceof HTMLInputElement\n && doc.activeElement.dataset.editorHierarchyRenameInput\n ? doc.activeElement\n : null;\n const renameFocus = activeRenameInput\n ? {\n id: activeRenameInput.dataset.editorHierarchyRenameInput!,\n start: activeRenameInput.selectionStart,\n end: activeRenameInput.selectionEnd,\n direction: activeRenameInput.selectionDirection,\n }\n : null;\n const activeSearchInput = doc.activeElement instanceof HTMLInputElement\n && doc.activeElement.dataset.editorHierarchySearch != null\n ? doc.activeElement\n : null;\n const searchFocus = activeSearchInput\n ? {\n start: activeSearchInput.selectionStart,\n end: activeSearchInput.selectionEnd,\n direction: activeSearchInput.selectionDirection,\n }\n : null;\n if (activeIdChanged) {\n pendingHierarchyScrollId = null;\n lastRenderedActiveId = scope.activeId;\n lastRenderedScopeId = scope.scopeId;\n }\n hierarchyRenderReplacingRenameInput = renameFocus !== null;\n try {\n renderLocalEditorHierarchyPanel(doc, panel, {\n viewModel: currentKernelViewModel!,\n presentationRevision: `${currentKernelViewModel!.snapshot.structureRevision}:${JSON.stringify(currentKernelViewModel!.snapshot.capabilities)}`,\n rename: currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n ? currentKernelViewModel.state.rename\n : null,\n dragId: currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n ? currentKernelViewModel.state.dragId\n : null,\n dropPreview: hierarchyDragSession.preview,\n rootDrop: hierarchyRootDrop,\n searchQuery: currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n ? currentKernelViewModel.state.searchQuery\n : getScopeSearch(scope.scopeId),\n title: scope.title,\n searchPlaceholder: scope.searchPlaceholder,\n showCreateMenu: createHierarchyToolbarCreateMenuItems(toolbarOperations).length > 0,\n });\n if (renameFocus) {\n const replacement = [...panel.querySelectorAll<HTMLInputElement>('[data-editor-hierarchy-rename-input]')]\n .find(input => input.dataset.editorHierarchyRenameInput === renameFocus.id);\n replacement?.focus({ preventScroll: true });\n if (replacement && renameFocus.start !== null && renameFocus.end !== null) {\n replacement.setSelectionRange(renameFocus.start, renameFocus.end, renameFocus.direction ?? undefined);\n }\n }\n if (searchFocus) {\n const replacement = panel.querySelector<HTMLInputElement>('input[data-editor-hierarchy-search]');\n replacement?.focus({ preventScroll: true });\n if (replacement && searchFocus.start !== null && searchFocus.end !== null) {\n replacement.setSelectionRange(searchFocus.start, searchFocus.end, searchFocus.direction ?? undefined);\n }\n }\n } finally {\n hierarchyRenderReplacingRenameInput = false;\n }\n treeViewportReveal.restoreScrollSnapshot(treeScrollSnapshot);\n const suppressActiveScroll = scope.activeId\n ? treeViewportReveal.consumeRevealSuppression(scope.activeId, { clearWhenDifferent: activeIdChanged })\n : false;\n if (activeIdChanged && scope.activeId && !suppressActiveScroll && shouldAutoScrollActiveHierarchyNode()) {\n scheduleActiveHierarchyScroll(scope.activeId);\n }\n lastRenderedActiveId = scope.activeId;\n lastRenderedScopeId = scope.scopeId;\n };\n\n const hierarchyViewAdapter = createLocalEditorHierarchyViewAdapter(model => {\n currentKernelViewModel = model;\n if (currentBridgeState && model) {\n const compositionActive = (\n hierarchySearchComposition?.scopeKey === model.snapshot.scopeKey\n && panel.contains(hierarchySearchComposition.input)\n ) || (\n hierarchyRenameComposition?.scopeKey === model.snapshot.scopeKey\n && panel.contains(hierarchyRenameComposition.input)\n );\n if (shouldDeferHierarchyDomRender({\n renderedAuthority: renderedHierarchyAuthority,\n renderedProjection: renderedHierarchyProjection,\n renderedDragId: renderedHierarchyDragId,\n model,\n nativeDragActive: nativeHierarchyDragActive,\n compositionActive,\n })) {\n return;\n }\n if (renderedHierarchyAuthority\n && !isHierarchyRenderedAuthorityCurrent(renderedHierarchyAuthority, model)) {\n nativeHierarchyDragActive = false;\n hierarchySearchComposition = null;\n hierarchyRenameComposition = null;\n clearHierarchyDragFeedback();\n }\n // Invalidate the old DOM before attempting replacement. If rendering\n // throws, events from that old DOM cannot retain write authority.\n renderedHierarchyAuthority = null;\n renderedHierarchyProjection = null;\n renderPanel(currentBridgeState);\n renderedHierarchyAuthority = Object.freeze({\n token: model.authorityToken,\n scopeKey: model.snapshot.scopeKey,\n revision: model.snapshot.revision,\n });\n renderedHierarchyProjection = model.projection;\n renderedHierarchyDragId = model.state.dragId;\n } else if (!model) {\n panel.textContent = '';\n const unavailable = doc.createElement('div');\n unavailable.textContent = 'Hierarchy scope unavailable.';\n unavailable.style.cssText = 'padding:12px;color:var(--fps-editor-muted);font-size:11px';\n panel.appendChild(unavailable);\n renderedHierarchyAuthority = null;\n renderedHierarchyProjection = null;\n renderedHierarchyDragId = null;\n }\n });\n const detachKernelView = kernel.attachView(hierarchyViewAdapter.adapter);\n const dispatchHierarchyIntent = async (intent: HierarchyIntent): Promise<HierarchyOperationResult> => {\n const authority = renderedHierarchyAuthority;\n const result = await hierarchyViewAdapter.dispatch({\n ...intent,\n expectedAuthorityToken: authority?.token ?? -1,\n expectedScopeKey: authority?.scopeKey ?? '',\n expectedRevision: authority?.revision ?? -1,\n });\n if (!result.ok || result.diagnostics.length > 0) options.onOperationResult?.(result);\n return result;\n };\n const executeCurrentHierarchyOperation = (\n operationId: string,\n input?: Readonly<Record<string, HierarchyJsonValue>>,\n context?: Partial<Pick<HierarchyOperationContext, 'contextNodeId' | 'targetIds' | 'activeId'>>,\n ): Promise<HierarchyOperationResult> => {\n const model = currentKernelViewModel;\n const authority = renderedHierarchyAuthority;\n if (!model || !authority\n || model.authorityToken !== authority.token\n || model.snapshot.scopeKey !== authority.scopeKey\n || model.snapshot.revision !== authority.revision) {\n return Promise.resolve({\n ok: false,\n changed: false,\n revision: model?.snapshot.revision ?? 0,\n diagnostics: [{ code: 'hierarchy.operation.view-authority-changed', message: 'Hierarchy view authority changed.', severity: 'error' }],\n });\n }\n return dispatchHierarchyIntent({\n type: 'operation.execute',\n operationId,\n expectedAuthorityToken: authority.token,\n context: {\n scopeKey: authority.scopeKey,\n expectedRevision: authority.revision,\n contextNodeId: context?.contextNodeId === undefined ? model.snapshot.activeId : context.contextNodeId,\n targetIds: context?.targetIds ?? model.snapshot.selectedIds,\n activeId: context?.activeId === undefined ? model.snapshot.activeId : context.activeId,\n },\n ...(input ? { input } : {}),\n });\n };\n const executePresentedHierarchyOperation = async (\n operation: HierarchyOperationDescriptor,\n context: HierarchyOperationContext,\n expectedAuthorityToken: number,\n ): Promise<void> => {\n let input = operation.payload;\n if (operation.inputPresentation) {\n const requested = await options.requestOperationInput?.(operation, context) ?? null;\n if (!requested) return;\n if (!isHierarchyMenuAuthorityCurrent(kernel.getViewModel(), expectedAuthorityToken, context)) return;\n input = Object.freeze({ ...(operation.payload ?? {}), ...requested });\n }\n await dispatchHierarchyIntent({\n type: 'operation.execute',\n operationId: operation.id,\n expectedAuthorityToken,\n context,\n ...(input ? { input } : {}),\n });\n };\n const render = (state: LocalEditorBrowserUiState<TDocument>): void => {\n currentBridgeState = state;\n kernel.refresh();\n };\n\n const onClick = (event: MouseEvent): void => {\n const target = event.target instanceof HTMLElement ? event.target : null;\n if (target?.closest('[data-editor-hierarchy-rename-input]')) return;\n if (target?.closest('input[data-editor-hierarchy-search]')) {\n return;\n }\n const enabledToggle = target?.closest<HTMLElement>('[data-editor-hierarchy-enabled-toggle]');\n const enabledToggleId = enabledToggle?.dataset.editorHierarchyEnabledToggle;\n if (enabledToggleId) {\n event.preventDefault();\n event.stopPropagation();\n toggleHierarchyItemEnabled(enabledToggleId, enabledToggle);\n return;\n }\n const toggle = target?.closest<HTMLElement>('[data-editor-hierarchy-toggle]')?.dataset.editorHierarchyToggle;\n if (toggle) {\n event.preventDefault();\n event.stopPropagation();\n toggleExpanded(toggle);\n return;\n }\n const createMenuButton = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-create-menu]');\n if (createMenuButton) {\n event.preventDefault();\n event.stopPropagation();\n openHierarchyCreateMenu(createMenuButton);\n return;\n }\n const hierarchyButton = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n const hierarchyId = hierarchyButton?.dataset.editorHierarchyId;\n if (hierarchyId) {\n if (treeViewportReveal.isElementVisible(hierarchyButton)) {\n treeViewportReveal.suppressNextReveal(hierarchyId);\n }\n event.preventDefault();\n event.stopPropagation();\n selectHierarchyItemFromClick(hierarchyId, event);\n return;\n }\n if (shouldClearSelectionFromBlankClick(event, target)) {\n event.preventDefault();\n void dispatchHierarchyIntent({ type: 'selection', targetId: null, modifier: 'replace' });\n }\n };\n\n const onContextMenu = (event: MouseEvent): void => {\n void openHierarchyContextMenu(event);\n };\n\n const onDocumentPointerDown = (event: PointerEvent): void => {\n hierarchyShortcutScopeActive = isEventInsideHierarchyPanel(event);\n };\n\n const onDocumentFocusIn = (event: FocusEvent): void => {\n hierarchyShortcutScopeActive = isEventInsideHierarchyPanel(event);\n };\n\n const onDoubleClick = (event: MouseEvent): void => {\n const target = event.target instanceof HTMLElement ? event.target : null;\n if (target?.closest('[data-editor-hierarchy-toggle]')) return;\n const hierarchyButton = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n const id = hierarchyButton?.dataset.editorHierarchyId;\n if (!id) return;\n event.preventDefault();\n event.stopPropagation();\n void (async () => {\n const selection = await dispatchHierarchyIntent({ type: 'selection', targetId: id, modifier: 'replace' });\n if (!selection.ok) return;\n kernel.refresh();\n const refreshed = kernel.getViewModel()?.snapshot;\n if (!refreshed || !refreshed.selectedIds.includes(id) || refreshed.activeId !== id) return;\n if (!refreshed.primaryOperationId) return;\n await dispatchHierarchyIntent({ type: 'primary', targetId: id });\n })();\n };\n\n const onInput = (event: Event): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (input?.dataset.editorHierarchySearch != null) {\n if (!isHierarchyCompositionSessionCurrent(hierarchySearchComposition, input, resolveCurrentScopeKey())\n && !isComposingInputEvent(event)) {\n void dispatchHierarchyIntent({ type: 'search.change', value: input.value });\n }\n return;\n }\n if (!input?.dataset.editorHierarchyRenameInput || !currentKernelViewModel?.state.rename) return;\n if (isHierarchyCompositionSessionCurrent(hierarchyRenameComposition, input, resolveCurrentScopeKey())\n || isComposingInputEvent(event)) return;\n void dispatchHierarchyIntent({ type: 'rename.change', value: input.value });\n };\n\n const onKeyDown = (event: KeyboardEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (input?.dataset.editorHierarchySearch != null) {\n if (event.isComposing\n || isHierarchyCompositionSessionCurrent(hierarchySearchComposition, input, resolveCurrentScopeKey())) return;\n const scopeId = resolveScopeForCurrentState()?.scopeId ?? 'scene';\n if (event.key !== 'Escape' || getScopeSearch(scopeId).length === 0) return;\n event.preventDefault();\n void dispatchHierarchyIntent({ type: 'search.change', value: '' });\n return;\n }\n if (!input?.dataset.editorHierarchyRenameInput) return;\n if (event.isComposing\n || isHierarchyCompositionSessionCurrent(hierarchyRenameComposition, input, resolveCurrentScopeKey())) return;\n if (event.key === 'Enter') {\n event.preventDefault();\n commitHierarchyRename(input.dataset.editorHierarchyRenameInput, input.value);\n return;\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n void dispatchHierarchyIntent({ type: 'rename.cancel' });\n }\n };\n\n const onCompositionStart = (event: CompositionEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n const scopeKey = resolveCurrentScopeKey();\n if (input?.dataset.editorHierarchySearch != null) hierarchySearchComposition = { input, scopeKey };\n if (input?.dataset.editorHierarchyRenameInput) hierarchyRenameComposition = { input, scopeKey };\n };\n\n const onCompositionEnd = (event: CompositionEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (input?.dataset.editorHierarchySearch != null) {\n const isCurrent = isHierarchyCompositionSessionCurrent(\n hierarchySearchComposition,\n input,\n resolveCurrentScopeKey(),\n );\n hierarchySearchComposition = null;\n if (!isCurrent) return;\n void dispatchHierarchyIntent({ type: 'search.change', value: input.value });\n return;\n }\n if (!input?.dataset.editorHierarchyRenameInput) return;\n const isCurrent = isHierarchyCompositionSessionCurrent(\n hierarchyRenameComposition,\n input,\n resolveCurrentScopeKey(),\n );\n hierarchyRenameComposition = null;\n if (!isCurrent) return;\n const renameId = input.dataset.editorHierarchyRenameInput;\n void (async () => {\n await dispatchHierarchyIntent({ type: 'rename.change', value: input.value });\n const renameInputs = [...panel.querySelectorAll<HTMLInputElement>('[data-editor-hierarchy-rename-input]')];\n const currentInput = renameInputs.find(candidate => candidate.dataset.editorHierarchyRenameInput === renameId);\n if (shouldCommitHierarchyRenameAfterCompositionEnd(doc.activeElement, renameInputs, renameId)) {\n commitHierarchyRename(renameId, currentInput?.value ?? input.value);\n }\n })();\n };\n\n const onFocusOut = (event: FocusEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (!input?.dataset.editorHierarchyRenameInput) return;\n if (hierarchyRenderReplacingRenameInput) return;\n if (isHierarchyCompositionSessionCurrent(hierarchyRenameComposition, input, resolveCurrentScopeKey())) return;\n commitHierarchyRename(input.dataset.editorHierarchyRenameInput, input.value);\n };\n\n const onDragStart = (event: DragEvent): void => {\n const state = getState();\n const target = event.target instanceof HTMLElement ? event.target : null;\n const button = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n const id = button?.dataset.editorHierarchyId;\n if (!id || !state) return;\n const viewModel = currentKernelViewModel;\n const node = viewModel?.snapshot.nodeById.get(id);\n if (!viewModel || !node?.draggable || node.editorLocked === true) {\n event.preventDefault();\n return;\n }\n const draggedIds = resolveDraggedIds(viewModel, id);\n if (draggedIds.length === 0) {\n event.preventDefault();\n return;\n }\n const authority = renderedHierarchyAuthority;\n const reparentAvailable = !!authority\n && viewModel.authorityToken === authority.token\n && kernel.listOperations({\n scopeKey: authority.scopeKey,\n expectedRevision: authority.revision,\n contextNodeId: id,\n targetIds: draggedIds,\n activeId: id,\n }, authority.token).some(operation => operation.id === 'hierarchy.node.reparent');\n if (!canUseHierarchyProviderReparent(viewModel, reparentAvailable)) {\n event.preventDefault();\n return;\n }\n event.dataTransfer?.setData('text/plain', draggedIds.join(','));\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move';\n nativeHierarchyDragActive = true;\n void dispatchHierarchyIntent({ type: 'drag.begin', targetId: id });\n if (currentKernelViewModel?.state.dragId !== id\n || !sameHierarchyIdSet(draggedIds, currentKernelViewModel.state.dragIds)) {\n nativeHierarchyDragActive = false;\n event.preventDefault();\n return;\n }\n };\n\n const processHierarchyDragOver = (event: DragEvent, frameTime?: number): void => {\n const state = getState();\n const target = event.target instanceof HTMLElement ? event.target : null;\n const draggedIds = readDraggedIds(event);\n if (!state || draggedIds.length === 0) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!sameHierarchyIdSet(draggedIds, currentKernelViewModel?.state.dragIds ?? [])) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!nativeHierarchyDragActive || !canUseHierarchyProviderReparent(currentKernelViewModel, true)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n const viewModel = currentKernelViewModel;\n if (!viewModel) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!isInsideHierarchyTreeViewport(target)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n hierarchyDragSession.pointer = { x: event.clientX, y: event.clientY };\n const viewportRect = measureHierarchyViewportRect(frameTime);\n updateHierarchyAutoScroll(viewportRect);\n const operation = resolveHierarchyDragOperation(event, viewModel, draggedIds, viewportRect);\n if (!operation || operation.status === 'idle') {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n event.preventDefault();\n hierarchyDragSession.operation = operation;\n updateHierarchyHoverExpand(operation, viewModel);\n const canSubmitDrop = operation.status === 'valid'\n && nativeHierarchyDragActive\n && canUseHierarchyProviderReparent(currentKernelViewModel, true);\n if (event.dataTransfer) event.dataTransfer.dropEffect = canSubmitDrop ? 'move' : 'none';\n if (operation.status !== 'valid' || !operation.slot || !operation.resolution?.ok) {\n hierarchyDragSession.preview = operation.preview;\n hierarchyRootDrop = false;\n syncHierarchyDropPreview();\n return;\n }\n if (operation.slot.placement === 'root') {\n hierarchyDragSession.preview = operation.preview;\n hierarchyRootDrop = true;\n syncHierarchyDropPreview();\n return;\n }\n hierarchyDragSession.preview = operation.preview;\n hierarchyRootDrop = false;\n syncHierarchyDropPreview();\n };\n\n const onDragOver = (event: DragEvent): void => {\n if (readDraggedIds(event).length > 0 && isInsideHierarchyTreeViewport(event.target instanceof HTMLElement ? event.target : null)) {\n event.preventDefault();\n }\n pendingHierarchyDragOver = event;\n if (hierarchyDragOverFrame !== null) return;\n hierarchyDragOverFrame = doc.defaultView?.requestAnimationFrame(frameTime => {\n hierarchyDragOverFrame = null;\n const latest = pendingHierarchyDragOver;\n pendingHierarchyDragOver = null;\n if (latest) processHierarchyDragOver(latest, frameTime);\n }) ?? null;\n if (hierarchyDragOverFrame === null) {\n const latest = pendingHierarchyDragOver;\n pendingHierarchyDragOver = null;\n if (latest) processHierarchyDragOver(latest);\n }\n };\n\n const onDragLeave = (event: DragEvent): void => {\n if (!panel.contains(event.relatedTarget as Node | null)) {\n cancelPendingHierarchyDragOver();\n clearHierarchyDragFeedback();\n requestRender();\n }\n };\n\n const onDragEnd = (): void => {\n cancelPendingHierarchyDragOver();\n nativeHierarchyDragActive = false;\n void dispatchHierarchyIntent({ type: 'drag.cancel' });\n clearHierarchyDragFeedback();\n requestRender();\n };\n\n const onDrop = (event: DragEvent): void => {\n cancelPendingHierarchyDragOver();\n const state = getState();\n const target = event.target instanceof HTMLElement ? event.target : null;\n const draggedIds = readDraggedIds(event);\n if (!state || draggedIds.length === 0) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!sameHierarchyIdSet(draggedIds, currentKernelViewModel?.state.dragIds ?? [])) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!nativeHierarchyDragActive || !canUseHierarchyProviderReparent(currentKernelViewModel, true)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n const viewModel = currentKernelViewModel;\n if (!viewModel) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!isInsideHierarchyTreeViewport(target)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n const operation = resolveHierarchyDragOperation(event, viewModel, draggedIds);\n if (!operation || operation.status !== 'valid' || !operation.slot || !operation.resolution?.ok) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n event.preventDefault();\n nativeHierarchyDragActive = false;\n const committedDraggedIds = operation.resolution.draggedIds;\n const dragContextNodeId = currentKernelViewModel?.state.dragId && committedDraggedIds.includes(currentKernelViewModel.state.dragId)\n ? currentKernelViewModel.state.dragId\n : committedDraggedIds[0] ?? null;\n clearHierarchyDragFeedback();\n expandDropParent(operation.resolution);\n void executeCurrentHierarchyOperation(\n 'hierarchy.node.reparent',\n {\n draggedIds: committedDraggedIds,\n targetId: operation.slot.targetId,\n placement: operation.slot.placement,\n parentId: operation.resolution.parentId,\n beforeId: operation.resolution.beforeId,\n afterId: operation.resolution.afterId,\n preserveWorldTransform: true,\n },\n { contextNodeId: dragContextNodeId, targetIds: committedDraggedIds, activeId: dragContextNodeId },\n );\n };\n\n panel.addEventListener('click', onClick);\n panel.addEventListener('contextmenu', onContextMenu);\n panel.addEventListener('dblclick', onDoubleClick);\n panel.addEventListener('input', onInput);\n panel.addEventListener('keydown', onKeyDown);\n panel.addEventListener('compositionstart', onCompositionStart);\n panel.addEventListener('compositionend', onCompositionEnd);\n panel.addEventListener('focusout', onFocusOut);\n panel.addEventListener('dragstart', onDragStart);\n panel.addEventListener('dragover', onDragOver);\n panel.addEventListener('dragleave', onDragLeave);\n panel.addEventListener('dragend', onDragEnd);\n panel.addEventListener('drop', onDrop);\n doc.addEventListener('pointerdown', onDocumentPointerDown, { capture: true });\n doc.addEventListener('focusin', onDocumentFocusIn, { capture: true });\n\n return {\n render,\n handleDeleteShortcut(event) {\n return handleDeleteShortcut(event);\n },\n handleEditShortcut(event) {\n return handleEditShortcut(event);\n },\n dispose() {\n nativeHierarchyDragActive = false;\n hierarchySearchComposition = null;\n hierarchyRenameComposition = null;\n detachKernelView();\n clearHierarchyDragFeedback();\n panel.removeEventListener('click', onClick);\n panel.removeEventListener('contextmenu', onContextMenu);\n panel.removeEventListener('dblclick', onDoubleClick);\n panel.removeEventListener('input', onInput);\n panel.removeEventListener('keydown', onKeyDown);\n panel.removeEventListener('compositionstart', onCompositionStart);\n panel.removeEventListener('compositionend', onCompositionEnd);\n panel.removeEventListener('focusout', onFocusOut);\n panel.removeEventListener('dragstart', onDragStart);\n panel.removeEventListener('dragover', onDragOver);\n panel.removeEventListener('dragleave', onDragLeave);\n panel.removeEventListener('dragend', onDragEnd);\n panel.removeEventListener('drop', onDrop);\n cancelPendingHierarchyDragOver();\n doc.removeEventListener('pointerdown', onDocumentPointerDown, { capture: true });\n doc.removeEventListener('focusin', onDocumentFocusIn, { capture: true });\n },\n };\n\n function handleDeleteShortcut(event: KeyboardEvent): boolean {\n return handleOperationShortcut(event);\n }\n\n function handleEditShortcut(event: KeyboardEvent): boolean {\n return handleOperationShortcut(event);\n }\n\n function handleOperationShortcut(event: KeyboardEvent): boolean {\n const operation = currentKernelViewModel?.operations.find(candidate => (\n !!candidate.shortcut\n && matchesHierarchyOperationShortcut(event, candidate.shortcut)\n && (candidate.shortcutScope !== 'hierarchy' || isHierarchyShortcutScope(event))\n ));\n if (!operation) return false;\n event.preventDefault();\n if (operation.disabledReason) return true;\n if (operation.id === 'hierarchy.node.rename') {\n const targetId = currentKernelViewModel?.snapshot.activeId;\n if (targetId) beginHierarchyRename(targetId);\n return true;\n }\n const input = operation.id === 'hierarchy.selection.all'\n ? { visibleIds: currentKernelViewModel\n ? currentKernelViewModel.projection.getRange(0, currentKernelViewModel.projection.totalCount - 1)\n : [] }\n : operation.payload;\n void executeCurrentHierarchyOperation(operation.id, input);\n return true;\n }\n\n function isComposingInputEvent(event: Event): boolean {\n return (event as Event & { isComposing?: boolean }).isComposing === true;\n }\n\n function resolveCurrentScopeKey(): string {\n return currentKernelViewModel?.snapshot.scopeKey ?? renderedHierarchyAuthority?.scopeKey ?? '';\n }\n\n function resolveScope(state: LocalEditorBrowserUiState<TDocument>): BrowserHierarchyScopeMetadata {\n const snapshot = currentKernelViewModel?.snapshot;\n return snapshot\n ? {\n scopeId: snapshot.scopeKey,\n revision: snapshot.revision,\n kind: snapshot.scopeType,\n title: snapshot.title,\n searchPlaceholder: snapshot.searchPlaceholder,\n selectedIds: snapshot.selectedIds,\n activeId: snapshot.activeId,\n readonly: snapshot.readonly,\n }\n : {\n scopeId: 'hierarchy:unavailable',\n revision: 0,\n kind: 'unavailable',\n title: 'Hierarchy',\n searchPlaceholder: 'Hierarchy unavailable',\n selectedIds: [],\n activeId: null,\n readonly: true,\n };\n }\n\n function resolveScopeForCurrentState(): BrowserHierarchyScopeMetadata | null {\n const state = getState();\n return state ? resolveScope(state) : null;\n }\n\n function getScopeSearch(scopeId: string): string {\n if (currentKernelViewModel?.snapshot.scopeKey === scopeId) return currentKernelViewModel.state.searchQuery;\n return '';\n }\n\n function resolveVisibleIds(): readonly string[] {\n const projection = currentKernelViewModel?.projection;\n if (!projection) return [];\n if (cachedVisibleIds?.projection === projection) return cachedVisibleIds.ids;\n const ids = projection.getRange(0, projection.totalCount - 1);\n cachedVisibleIds = { projection, ids };\n return ids;\n }\n\n function selectHierarchyItemFromClick(id: string, event: MouseEvent): void {\n const toggle = event.metaKey || event.ctrlKey;\n const range = event.shiftKey && !toggle;\n void dispatchHierarchyIntent({\n type: 'selection',\n targetId: id,\n modifier: range ? 'range' : toggle ? 'toggle' : 'replace',\n });\n }\n\n function toggleHierarchyItemEnabled(id: string, toggle: HTMLElement): void {\n if (toggle.dataset.editorHierarchyEnabledToggleDisabled === 'true') return;\n const state = getState();\n if (!state) return;\n const snapshot = currentKernelViewModel?.snapshot;\n const node = snapshot?.nodeById.get(id);\n if (!snapshot || !node || node.editorLocked === true) return;\n const directEnabled = node.authoredEnabled ?? node.editorVisible;\n const request = createHierarchyEnabledOperationRequest(node, directEnabled);\n void executeCurrentHierarchyOperation(\n request.operationId,\n request.input,\n { contextNodeId: id, targetIds: [id], activeId: id },\n );\n }\n\n function resolveDraggedIds(\n viewModel: HierarchyViewModel,\n draggedId: string,\n ): string[] {\n const selectedIds = viewModel.snapshot.selectedIds.includes(draggedId)\n ? viewModel.snapshot.selectedIds\n : [draggedId];\n return [...viewModel.projection.getTopLevelSelection(selectedIds)];\n }\n\n function readDraggedIds(event: DragEvent): string[] {\n return resolveHierarchyTransportDragIds(\n event.dataTransfer?.getData('text/plain'),\n currentKernelViewModel?.state.dragIds ?? [],\n );\n }\n\n function toggleExpanded(id: string): void {\n void dispatchHierarchyIntent({ type: 'disclosure.toggle', targetId: id });\n }\n\n function expandNode(id: string | null | undefined): void {\n if (!id) return;\n void dispatchHierarchyIntent({ type: 'disclosure.expand', targetId: id });\n }\n\n function shouldAutoScrollActiveHierarchyNode(): boolean {\n return !currentKernelViewModel?.state.rename\n && !currentKernelViewModel?.state.dragId\n && !hasHierarchyDragFeedback();\n }\n\n function scheduleActiveHierarchyScroll(activeId: string): void {\n pendingHierarchyScrollId = activeId;\n setTimeout(() => {\n if (pendingHierarchyScrollId !== activeId) return;\n pendingHierarchyScrollId = null;\n const viewport = findHierarchyTreeViewport();\n let row = findHierarchyRow(activeId);\n if (!row && viewport && currentKernelViewModel) {\n const index = currentKernelViewModel.projection.indexOf(activeId);\n if (index >= 0) {\n const rowTop = index * LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n const rowBottom = rowTop + LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n if (rowTop < viewport.scrollTop) viewport.scrollTop = rowTop;\n else if (rowBottom > viewport.scrollTop + viewport.clientHeight) {\n viewport.scrollTop = Math.max(0, rowBottom - viewport.clientHeight);\n }\n row = findHierarchyRow(activeId);\n }\n }\n if (!row) return;\n if (viewport) {\n treeViewportReveal.revealElement(row, { behavior: 'smooth' });\n return;\n }\n try {\n row.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'smooth' });\n } catch {\n row.scrollIntoView();\n }\n }, 0);\n }\n\n function findHierarchyRow(id: string): HTMLElement | null {\n for (const row of panel.querySelectorAll<HTMLElement>('[data-editor-hierarchy-id]')) {\n if (row.dataset.editorHierarchyId === id) return row;\n }\n return null;\n }\n\n function findHierarchyTreeViewport(): HTMLElement | null {\n return panel.querySelector<HTMLElement>('[data-editor-hierarchy-tree-viewport]');\n }\n\n function isInsideHierarchyTreeViewport(target: HTMLElement | null): boolean {\n return !!target?.closest('[data-editor-hierarchy-tree-viewport]');\n }\n\n function armHierarchyAutoScroll(): void {\n if (hierarchyDragSession.autoScrollFrame !== null) return;\n hierarchyDragSession.autoScrollFrame = doc.defaultView?.requestAnimationFrame(tickHierarchyAutoScroll) ?? null;\n }\n\n function stopHierarchyAutoScroll(): void {\n if (hierarchyDragSession.autoScrollFrame !== null) {\n doc.defaultView?.cancelAnimationFrame(hierarchyDragSession.autoScrollFrame);\n }\n hierarchyDragSession.autoScrollFrame = null;\n }\n\n function clearHierarchyDragFeedback(): void {\n cancelPendingHierarchyDragOver();\n hierarchyRootDrop = false;\n lastHierarchyDropPreviewKey = '';\n stopHierarchyAutoScroll();\n clearHierarchyHoverExpand();\n clearLocalEditorStructuredDragSession(hierarchyDragSession);\n }\n\n function clearHierarchyHoverExpand(): void {\n if (hierarchyHoverExpandTimer !== null) doc.defaultView?.clearTimeout(hierarchyHoverExpandTimer);\n hierarchyHoverExpandTimer = null;\n hierarchyHoverExpandId = null;\n }\n\n function updateHierarchyHoverExpand(\n operation: LocalEditorHierarchyDragOperation,\n viewModel: HierarchyViewModel,\n ): void {\n const targetId = operation.status === 'valid' && operation.slot?.placement === 'inside'\n ? operation.slot.targetId\n : null;\n const node = targetId ? viewModel.snapshot.nodeById.get(targetId) : null;\n const expanded = targetId ? !viewModel.state.collapsedIds.has(targetId) : false;\n const childCount = targetId ? viewModel.snapshot.childrenByParentId.get(targetId)?.length ?? 0 : 0;\n if (!targetId || !node || expanded || childCount === 0) {\n clearHierarchyHoverExpand();\n return;\n }\n if (hierarchyHoverExpandId === targetId && hierarchyHoverExpandTimer !== null) return;\n clearHierarchyHoverExpand();\n hierarchyHoverExpandId = targetId;\n hierarchyHoverExpandTimer = doc.defaultView?.setTimeout(() => {\n const id = hierarchyHoverExpandId;\n hierarchyHoverExpandTimer = null;\n hierarchyHoverExpandId = null;\n if (id) expandNode(id);\n }, 600) ?? null;\n }\n\n function hasHierarchyDragFeedback(): boolean {\n return hierarchyRootDrop\n || hasLocalEditorStructuredDragSessionFeedback(hierarchyDragSession);\n }\n\n function clearHierarchyDragFeedbackAndRender(): void {\n const hadFeedback = hasHierarchyDragFeedback();\n clearHierarchyDragFeedback();\n if (hadFeedback) syncHierarchyDropPreview();\n }\n\n function syncHierarchyDropPreview(): void {\n const preview = hierarchyDragSession.preview;\n const key = [\n hierarchyRootDrop, preview?.kind ?? '', preview?.targetId ?? '', preview?.placement ?? '', preview?.valid ?? '',\n ].join(':');\n if (key === lastHierarchyDropPreviewKey) return;\n lastHierarchyDropPreviewKey = key;\n syncLocalEditorHierarchyDropPreview(doc, panel, {\n dropPreview: hierarchyDragSession.preview,\n rootDrop: hierarchyRootDrop,\n });\n }\n\n function tickHierarchyAutoScroll(frameTime: number): void {\n hierarchyDragSession.autoScrollFrame = null;\n if (!hierarchyDragSession.pointer) return;\n const viewport = findHierarchyTreeViewport();\n if (!viewport) return;\n const rect = measureHierarchyViewportRect(frameTime);\n if (!rect) return;\n const scroll = resolveLocalEditorHierarchyAutoScroll({\n pointerY: hierarchyDragSession.pointer.y,\n viewportTop: rect.top,\n viewportBottom: rect.bottom,\n viewportHeight: rect.height,\n scrollTop: viewport.scrollTop,\n scrollHeight: viewport.scrollHeight,\n clientHeight: viewport.clientHeight,\n });\n if (scroll.speed !== 0) {\n viewport.scrollTop += scroll.speed;\n requestRender();\n armHierarchyAutoScroll();\n }\n }\n\n function updateHierarchyAutoScroll(measuredRect?: DOMRect): void {\n const viewport = findHierarchyTreeViewport();\n if (!viewport || !hierarchyDragSession.pointer) {\n stopHierarchyAutoScroll();\n return;\n }\n const rect = measuredRect ?? viewport.getBoundingClientRect();\n const scroll = resolveLocalEditorHierarchyAutoScroll({\n pointerY: hierarchyDragSession.pointer.y,\n viewportTop: rect.top,\n viewportBottom: rect.bottom,\n viewportHeight: rect.height,\n scrollTop: viewport.scrollTop,\n scrollHeight: viewport.scrollHeight,\n clientHeight: viewport.clientHeight,\n });\n if (scroll.speed === 0) {\n stopHierarchyAutoScroll();\n return;\n }\n armHierarchyAutoScroll();\n }\n\n function measureHierarchyViewportRect(frameTime?: number): DOMRect | undefined {\n if (frameTime !== undefined && hierarchyViewportRectFrame === frameTime && hierarchyViewportRect) {\n return hierarchyViewportRect;\n }\n const rect = findHierarchyTreeViewport()?.getBoundingClientRect();\n if (frameTime !== undefined && rect) {\n hierarchyViewportRectFrame = frameTime;\n hierarchyViewportRect = rect;\n }\n return rect;\n }\n\n function resolveHierarchyDragOperation(\n event: DragEvent,\n viewModel: HierarchyViewModel,\n draggedIds: readonly string[],\n measuredRect?: DOMRect,\n ): LocalEditorHierarchyDragOperation | null {\n const layout = createHierarchyDragLayout(viewModel, measuredRect);\n if (!layout) return null;\n return resolveLocalEditorHierarchyDragOperation({\n layout,\n pointer: { x: event.clientX, y: event.clientY },\n draggedIds,\n resolveDrop: input => viewModel.projection.resolveDrop(input),\n });\n }\n\n function createHierarchyDragLayout(viewModel: HierarchyViewModel, measuredRect?: DOMRect): LocalEditorHierarchyDragLayout | null {\n const viewport = findHierarchyTreeViewport();\n const projection = viewModel.projection;\n if (!viewport || !projection) return null;\n const viewportRect = measuredRect ?? viewport.getBoundingClientRect();\n const rows: LocalEditorHierarchyDragLayoutRow[] = [];\n const start = Math.max(0, Math.floor(viewport.scrollTop / LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT));\n const count = Math.min(\n projection.totalCount - start,\n Math.ceil(viewportRect.height / LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT) + 1,\n );\n for (let offset = 0; offset < Math.max(0, count); offset += 1) {\n const index = start + offset;\n const projected = projection.getRow(index);\n if (!projected) continue;\n const node = viewModel.snapshot.nodeById.get(projected.id);\n if (!node) continue;\n const canAcceptInside = node.canHaveChildren && node.editorLocked !== true;\n rows.push({\n id: projected.id,\n depth: projected.depth,\n parentId: node.parentId,\n canHaveChildren: canAcceptInside,\n canAcceptInside,\n rect: {\n left: viewportRect.left,\n top: viewportRect.top + index * LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT - viewport.scrollTop,\n width: viewportRect.width,\n height: LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT,\n },\n });\n }\n return {\n rows,\n viewport: {\n left: viewportRect.left,\n top: viewportRect.top,\n width: viewportRect.width,\n height: viewportRect.height,\n },\n indentWidth: HIERARCHY_DRAG_INDENT_WIDTH,\n };\n }\n\n function expandDropParent(resolved: HierarchyDropResolution): void {\n if (resolved.placement === 'inside') expandNode(resolved.parentId);\n }\n\n function commitHierarchyRename(id: string, value: string): void {\n const rename = currentKernelViewModel?.state.rename;\n if (!rename || rename.id !== id) return;\n void (async () => {\n await dispatchHierarchyIntent({ type: 'rename.change', value });\n await dispatchHierarchyIntent({ type: 'rename.commit' });\n })();\n }\n\n async function openHierarchyContextMenu(event: MouseEvent): Promise<void> {\n const target = inputRouter.claimContextMenu(event);\n const hadHierarchyFeedback = hasHierarchyDragFeedback();\n clearHierarchyDragFeedback();\n if (!target) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n const state = getState();\n if (!state || state.mode !== 'editor' || state.busy) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n let scope = resolveScope(state);\n const hierarchyButton = target.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n let node = hierarchyButton?.dataset.editorHierarchyId\n ? currentKernelViewModel?.snapshot.nodeById.get(hierarchyButton.dataset.editorHierarchyId)\n : undefined;\n if (node && !scope.selectedIds.includes(node.id) && node.selectable && node.editorLocked !== true) {\n const selection = await dispatchHierarchyIntent({ type: 'selection', targetId: node.id, modifier: 'replace' });\n if (!selection.ok) return;\n kernel.refresh();\n const refreshedState = getState() ?? state;\n scope = resolveScope(refreshedState);\n if (!scope.selectedIds.includes(node.id) || scope.activeId !== node.id) return;\n node = hierarchyButton?.dataset.editorHierarchyId\n ? currentKernelViewModel?.snapshot.nodeById.get(hierarchyButton.dataset.editorHierarchyId)\n : undefined;\n }\n const operationContext = Object.freeze({\n scopeKey: scope.scopeId,\n expectedRevision: scope.revision,\n contextNodeId: node?.id ?? null,\n targetIds: Object.freeze([...scope.selectedIds]),\n activeId: scope.activeId,\n });\n const expectedAuthorityToken = renderedHierarchyAuthority?.token;\n const providerOperations = kernel.listOperations(operationContext, expectedAuthorityToken);\n if (expectedAuthorityToken === undefined\n || currentKernelViewModel?.authorityToken !== expectedAuthorityToken\n || currentKernelViewModel.snapshot.scopeKey !== operationContext.scopeKey\n || currentKernelViewModel.snapshot.revision !== operationContext.expectedRevision) return;\n if (providerOperations.length === 0) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n options.onBeforeOpenContextMenu?.();\n const menuItems = createHierarchyOperationMenuItems(providerOperations);\n if (menuItems.length === 0) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n\n contextMenu.open({\n x: event.clientX,\n y: event.clientY,\n items: menuItems,\n onAction(item) {\n if (!isHierarchyMenuAuthorityCurrent(\n kernel.getViewModel(),\n expectedAuthorityToken,\n operationContext,\n )) return;\n const operation = providerOperations.find(candidate => candidate.id === item.id);\n if (operation) {\n if (operation.id === 'hierarchy.node.rename' && operationContext.contextNodeId) {\n const latest = kernel.getViewModel();\n if (latest?.authorityToken === expectedAuthorityToken\n && latest.snapshot.scopeKey === operationContext.scopeKey\n && latest.snapshot.revision === operationContext.expectedRevision) {\n beginHierarchyRename(operationContext.contextNodeId);\n }\n return;\n }\n void executePresentedHierarchyOperation(operation, operationContext, expectedAuthorityToken);\n }\n },\n });\n if (hadHierarchyFeedback) requestRender();\n }\n\n function openHierarchyCreateMenu(button: HTMLButtonElement): void {\n const state = getState();\n if (!state || state.mode !== 'editor' || state.busy) return;\n const model = currentKernelViewModel;\n if (!model) return;\n const scope = resolveScope(state);\n const activeNode = model.snapshot.activeId\n ? model.snapshot.nodeById.get(model.snapshot.activeId)\n : undefined;\n const parentNode = activeNode?.canHaveChildren === true && activeNode.editorLocked !== true\n ? activeNode\n : undefined;\n const operationContext = Object.freeze({\n scopeKey: scope.scopeId,\n expectedRevision: scope.revision,\n contextNodeId: parentNode?.id ?? null,\n targetIds: Object.freeze(parentNode ? [parentNode.id] : []),\n activeId: parentNode?.id ?? scope.activeId,\n });\n const expectedAuthorityToken = renderedHierarchyAuthority?.token;\n const operations = kernel.listOperations(operationContext, expectedAuthorityToken);\n if (expectedAuthorityToken === undefined\n || !isHierarchyMenuAuthorityCurrent(model, expectedAuthorityToken, operationContext)) return;\n const items = createHierarchyToolbarCreateMenuItems(operations);\n if (items.length === 0) return;\n options.onBeforeOpenContextMenu?.();\n const rect = button.getBoundingClientRect();\n contextMenu.open({\n x: rect.left,\n y: rect.bottom,\n items,\n onAction(item) {\n if (!isHierarchyMenuAuthorityCurrent(kernel.getViewModel(), expectedAuthorityToken, operationContext)) return;\n hierarchyShortcutScopeActive = true;\n const operation = operations.find(candidate => candidate.id === item.id);\n if (!operation) return;\n if (parentNode) expandNode(parentNode.id);\n void executePresentedHierarchyOperation(operation, operationContext, expectedAuthorityToken);\n },\n });\n }\n\n function shouldClearSelectionFromBlankClick(event: MouseEvent, target: HTMLElement | null): boolean {\n if (event.button !== 0 || event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) return false;\n if (!target?.closest('[data-editor-hierarchy-root-drop]')) return false;\n if (currentKernelViewModel?.state.rename || currentKernelViewModel?.state.dragId || hasHierarchyDragFeedback()) return false;\n const state = getState();\n if (!state) return false;\n const scope = resolveScope(state);\n return currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n && currentKernelViewModel.snapshot.capabilities.clearSelection === true\n && scope.selectedIds.length > 0;\n }\n\n function isHierarchyShortcutScope(event: KeyboardEvent): boolean {\n const target = event.target instanceof Node ? event.target : null;\n const activeElement = doc.activeElement;\n return hierarchyShortcutScopeActive\n || (target !== null && panel.contains(target))\n || (activeElement !== null && panel.contains(activeElement));\n }\n\n function isEventInsideHierarchyPanel(event: Event): boolean {\n const target = event.target instanceof Node ? event.target : null;\n return target !== null && panel.contains(target);\n }\n\n function beginHierarchyRename(id: string): void {\n const node = currentKernelViewModel?.snapshot.nodeById.get(id);\n if (!node?.renamable || node.editorLocked === true) return;\n const projectionIndex = currentKernelViewModel?.projection.indexOf(id) ?? -1;\n const viewport = findHierarchyTreeViewport();\n if (viewport && projectionIndex >= 0) {\n const rowTop = projectionIndex * LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n const rowBottom = rowTop + LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n if (rowTop < viewport.scrollTop || rowBottom > viewport.scrollTop + viewport.clientHeight) {\n viewport.scrollTop = Math.max(\n 0,\n rowTop - Math.max(0, viewport.clientHeight - LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT) / 2,\n );\n }\n }\n void dispatchHierarchyIntent({ type: 'rename.begin', targetId: id });\n }\n\n}\n\nexport function shouldCommitHierarchyRenameAfterCompositionEnd(\n activeElement: Element | null,\n renameInputs: readonly HTMLInputElement[],\n renameId: string,\n): boolean {\n const currentInput = renameInputs.find(input => input.dataset.editorHierarchyRenameInput === renameId) ?? null;\n return currentInput === null || activeElement !== currentInput;\n}\n\nexport function isHierarchyMenuAuthorityCurrent(\n model: HierarchyViewModel | null,\n expectedAuthorityToken: number,\n context: HierarchyOperationContext,\n): boolean {\n return model?.authorityToken === expectedAuthorityToken\n && model.snapshot.scopeKey === context.scopeKey\n && model.snapshot.revision === context.expectedRevision;\n}\n\nexport function sameHierarchyIdSet(left: readonly string[], right: readonly string[]): boolean {\n if (left.length !== right.length) return false;\n if (new Set(left).size !== left.length || new Set(right).size !== right.length) return false;\n const expected = new Set(right);\n return left.every(id => expected.has(id));\n}\n\nexport function resolveHierarchyTransportDragIds(\n dataTransferValue: string | null | undefined,\n frozenDragIds: readonly string[],\n): string[] {\n const dataTransferIds = dataTransferValue?.split(',')\n .map(id => id.trim())\n .filter(Boolean) ?? [];\n return dataTransferIds.length > 0 ? dataTransferIds : [...frozenDragIds];\n}\n\nexport interface HierarchyCompositionSession<TInput extends object = object> {\n readonly input: TInput;\n readonly scopeKey: string;\n}\n\nexport function isHierarchyCompositionSessionCurrent<TInput extends object>(\n session: HierarchyCompositionSession<TInput> | null,\n input: TInput,\n scopeKey: string,\n): boolean {\n return session?.input === input && session.scopeKey === scopeKey;\n}\n\nexport interface HierarchyRenderedAuthority {\n readonly token: number;\n readonly scopeKey: string;\n readonly revision: number;\n}\n\nexport function isHierarchyRenderedAuthorityCurrent(\n authority: HierarchyRenderedAuthority,\n model: HierarchyViewModel,\n): boolean {\n return authority.token === model.authorityToken\n && authority.scopeKey === model.snapshot.scopeKey\n && authority.revision === model.snapshot.revision;\n}\n\nexport function shouldDeferHierarchyDomRender(input: {\n readonly renderedAuthority: HierarchyRenderedAuthority | null;\n readonly renderedProjection: HierarchyViewModel['projection'] | null;\n readonly renderedDragId: string | null;\n readonly model: HierarchyViewModel;\n readonly nativeDragActive: boolean;\n readonly compositionActive: boolean;\n}): boolean {\n return input.renderedAuthority !== null\n && isHierarchyRenderedAuthorityCurrent(input.renderedAuthority, input.model)\n && (\n input.compositionActive\n || (input.nativeDragActive\n && input.renderedProjection === input.model.projection\n && input.renderedDragId === input.model.state.dragId)\n );\n}\n"]}
1
+ {"version":3,"file":"local-editor-ui-hierarchy-controller.js","sourceRoot":"","sources":["../src/local-editor-ui-hierarchy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAUN,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,wCAAwC,GAKzC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qCAAqC,GACtC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qCAAqC,EACrC,sCAAsC,EACtC,2CAA2C,GAC5C,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,6CAA6C,EAC7C,mC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AC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;IAC7C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {\n type HierarchyIntent,\n type HierarchyDropResolution,\n type HierarchyJsonValue,\n type HierarchyKernel,\n type HierarchyNodeSnapshot,\n type HierarchyOperationResult,\n type HierarchyOperationDescriptor,\n type HierarchyOperationContext,\n type HierarchyViewModel,\n} from '@fps-games/plugin-hierarchy';\nimport {\n resolveLocalEditorHierarchyDragOperation,\n type LocalEditorHierarchyDragLayout,\n type LocalEditorHierarchyDragLayoutRow,\n type LocalEditorHierarchyDragOperation,\n type LocalEditorHierarchyDropPreview,\n} from './local-editor-ui-hierarchy-drag-policy';\nimport {\n resolveLocalEditorHierarchyAutoScroll,\n} from './local-editor-ui-hierarchy-auto-scroll';\nimport {\n clearLocalEditorStructuredDragSession,\n createLocalEditorStructuredDragSession,\n hasLocalEditorStructuredDragSessionFeedback,\n} from './local-editor-ui-structured-drag-session';\nimport {\n LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT,\n renderLocalEditorHierarchyPanel,\n syncLocalEditorHierarchySelectionPresentation,\n syncLocalEditorHierarchyDropPreview,\n} from './local-editor-ui-hierarchy-view';\nimport {\n createLocalEditorViewportRevealController,\n} from './local-editor-ui-dock-panel';\nimport { createLocalEditorHierarchyViewAdapter } from './local-editor-ui-hierarchy-view-adapter';\nimport type { LocalEditorContextMenuController } from './local-editor-ui-context-menu';\nimport type { LocalEditorWorkbenchInputRouter } from './local-editor-ui-input-router';\nimport type {\n LocalEditorBrowserUiState,\n LocalEditorContextMenuItem,\n} from './local-editor-ui-types';\n\nconst HIERARCHY_DRAG_INDENT_WIDTH = 16;\n\nexport function createHierarchyEnabledOperationRequest(\n node: Pick<HierarchyNodeSnapshot, 'authoredEnabled'> | null | undefined,\n directEnabled: boolean | undefined,\n): Readonly<{ operationId: 'hierarchy.node.set-enabled' | 'hierarchy.node.set-visible'; input: Readonly<Record<string, boolean>> }> {\n const nextValue = directEnabled === false;\n return node?.authoredEnabled === undefined\n ? Object.freeze({ operationId: 'hierarchy.node.set-visible', input: Object.freeze({ visible: nextValue }) })\n : Object.freeze({ operationId: 'hierarchy.node.set-enabled', input: Object.freeze({ enabled: nextValue }) });\n}\n\nexport function createHierarchyOperationMenuItems(\n operations: readonly HierarchyOperationDescriptor[],\n): LocalEditorContextMenuItem[] {\n type MenuPresentation = Readonly<{\n path: readonly Readonly<{ id: string; label: string; order?: number }>[];\n group: string;\n order: number;\n }>;\n interface MenuNode {\n id: string;\n label: string;\n order: number;\n children: Map<string, MenuNode>;\n operations: Array<{ operation: HierarchyOperationDescriptor; presentation: MenuPresentation; sourceIndex: number }>;\n }\n const root: MenuNode = { id: '', label: '', order: 0, children: new Map(), operations: [] };\n const operationIds = new Set<string>();\n for (const operation of operations) {\n if (operationIds.has(operation.id)) throw new Error(`Duplicate Hierarchy operation id: ${operation.id}.`);\n operationIds.add(operation.id);\n }\n operations.forEach((operation, sourceIndex) => {\n if (operation.menu === false) return;\n const presentation = resolveHierarchyOperationMenuPresentation(operation);\n let parent = root;\n for (const segment of presentation.path) {\n const existing = parent.children.get(segment.id);\n if (existing && (existing.label !== segment.label || existing.order !== (segment.order ?? 0))) {\n throw new Error(`Hierarchy menu path conflict for segment ${segment.id}.`);\n }\n const node = existing ?? {\n id: segment.id, label: segment.label, order: segment.order ?? 0, children: new Map(), operations: [],\n };\n parent.children.set(segment.id, node);\n parent = node;\n }\n parent.operations.push({ operation, presentation, sourceIndex });\n });\n const materialize = (node: MenuNode, parentPath: readonly string[] = []): LocalEditorContextMenuItem[] => {\n const entries = [\n ...[...node.children.values()].map(child => ({ kind: 'path' as const, order: child.order, group: `path:${child.id}`, sourceIndex: -1, child })),\n ...node.operations.map(entry => ({\n kind: 'operation' as const,\n order: entry.presentation.order,\n group: entry.presentation.group,\n sourceIndex: entry.sourceIndex,\n operation: entry.operation,\n })),\n ].sort((left, right) => left.order - right.order || left.sourceIndex - right.sourceIndex);\n return entries.map((entry, index) => {\n const previous = entries[index - 1];\n const separatorBefore = index > 0 && previous?.group !== entry.group;\n if (entry.kind === 'path') {\n const path = [...parentPath, entry.child.id];\n const presentationId = `hierarchy.menu.path:${path.map(segment => encodeURIComponent(segment)).join('/')}`;\n if (operationIds.has(presentationId)) {\n throw new Error(`Hierarchy operation id conflicts with menu presentation id: ${presentationId}.`);\n }\n return {\n id: presentationId,\n label: entry.child.label,\n separatorBefore,\n children: materialize(entry.child, path),\n };\n }\n const operation = entry.operation;\n return {\n id: operation.id, label: operation.label, shortcut: operation.shortcut, danger: operation.danger,\n disabled: !!operation.disabledReason, disabledReason: operation.disabledReason, separatorBefore,\n };\n });\n };\n return materialize(root);\n\n function resolveHierarchyOperationMenuPresentation(operation: HierarchyOperationDescriptor): MenuPresentation {\n if (operation.menu !== undefined && operation.menu !== false) {\n return {\n path: operation.menu.path ?? [],\n group: operation.menu.group ?? '',\n order: operation.menu.order ?? 0,\n };\n }\n const placement = operation.placement ?? 'bottom';\n const placementOrder: Record<NonNullable<HierarchyOperationDescriptor['placement']>, number> = {\n top: -100,\n 'after-primary': 5,\n 'after-edit': 15,\n 'after-create': 25,\n 'after-clipboard': 45,\n bottom: 100,\n };\n return { path: [], group: `legacy:${placement}`, order: placementOrder[placement] };\n }\n}\n\nexport function createHierarchyToolbarCreateMenuItems(\n operations: readonly HierarchyOperationDescriptor[],\n): LocalEditorContextMenuItem[] {\n const createOperations = operations.flatMap(operation => {\n if (operation.menu === false || !operation.menu?.path?.length || operation.menu.path[0]?.id !== 'create') return [];\n return [{\n ...operation,\n menu: {\n ...operation.menu,\n path: operation.menu.path.slice(1),\n },\n } satisfies HierarchyOperationDescriptor];\n });\n return createHierarchyOperationMenuItems(createOperations);\n}\n\nexport function canUseHierarchyProviderReparent(\n model: HierarchyViewModel | null,\n operationAvailable = model?.operations.some(operation => operation.id === 'hierarchy.node.reparent') === true,\n): boolean {\n return !!model\n && !model.snapshot.readonly\n && model.snapshot.capabilities.reparent === true\n && operationAvailable;\n}\n\nexport function matchesHierarchyOperationShortcut(\n event: Pick<KeyboardEvent, 'key' | 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey'>,\n shortcut: string,\n): boolean {\n const tokens = shortcut.toLowerCase().split('+').map(token => token.trim()).filter(Boolean);\n const keyToken = tokens[tokens.length - 1];\n if (!keyToken) return false;\n const primary = event.metaKey || event.ctrlKey;\n if (tokens.includes('ctrl/cmd') !== primary) return false;\n if (tokens.includes('alt') !== event.altKey) return false;\n if (tokens.includes('shift') !== event.shiftKey) return false;\n const key = event.key.toLowerCase();\n return keyToken === 'delete'\n ? key === 'delete' || key === 'backspace'\n : keyToken === key;\n}\n\nexport interface LocalEditorHierarchyController<TDocument = unknown> {\n render(state: LocalEditorBrowserUiState<TDocument>): void;\n syncSelectionPresentation(\n state: LocalEditorBrowserUiState<TDocument>,\n ): LocalEditorHierarchySelectionPresentation | null;\n handleEditShortcut(event: KeyboardEvent): boolean;\n handleDeleteShortcut(event: KeyboardEvent): boolean;\n dispose(): void;\n}\n\nexport interface LocalEditorHierarchySelectionPresentation {\n readonly scopeId: string;\n readonly selectedIds: readonly string[];\n readonly activeId: string | null;\n readonly activeLabel: string | null;\n}\n\nexport interface LocalEditorHierarchyControllerOptions<TDocument = unknown> {\n doc: Document;\n panel: HTMLElement;\n inputRouter: LocalEditorWorkbenchInputRouter;\n contextMenu: LocalEditorContextMenuController;\n kernel: HierarchyKernel;\n onOperationResult?: (result: HierarchyOperationResult) => void;\n getState: () => LocalEditorBrowserUiState<TDocument> | null;\n requestRender: () => void;\n onBeforeOpenContextMenu?: () => void;\n requestOperationInput?: (\n operation: HierarchyOperationDescriptor,\n context: HierarchyOperationContext,\n ) => Promise<Readonly<Record<string, HierarchyJsonValue>> | null>;\n}\n\ninterface BrowserHierarchyScopeMetadata {\n scopeId: string;\n revision: number;\n kind: string;\n title: string;\n searchPlaceholder: string;\n selectedIds: readonly string[];\n activeId: string | null;\n readonly: boolean;\n}\n\nexport function createLocalEditorHierarchyController<TDocument = unknown>(\n options: LocalEditorHierarchyControllerOptions<TDocument>,\n): LocalEditorHierarchyController<TDocument> {\n const { doc, panel, inputRouter, contextMenu, getState, requestRender, kernel } = options;\n let hierarchyRootDrop = false;\n const hierarchyDragSession = createLocalEditorStructuredDragSession<\n LocalEditorHierarchyDragOperation,\n LocalEditorHierarchyDropPreview\n >();\n let hierarchyShortcutScopeActive = false;\n let hierarchySearchComposition: HierarchyCompositionSession<HTMLInputElement> | null = null;\n let hierarchyRenameComposition: HierarchyCompositionSession<HTMLInputElement> | null = null;\n let nativeHierarchyDragActive = false;\n let lastRenderedActiveId: string | null | undefined;\n let lastRenderedScopeId: string | null | undefined;\n let pendingHierarchyScrollId: string | null = null;\n let currentBridgeState: LocalEditorBrowserUiState<TDocument> | null = null;\n let currentKernelViewModel: HierarchyViewModel | null = null;\n let cachedVisibleIds: {\n projection: HierarchyViewModel['projection'];\n ids: readonly string[];\n } | null = null;\n let renderedHierarchyAuthority: Readonly<{ token: number; scopeKey: string; revision: number }> | null = null;\n let renderedHierarchyProjection: HierarchyViewModel['projection'] | null = null;\n let renderedHierarchyViewModel: HierarchyViewModel | null = null;\n let renderedHierarchyDragId: string | null = null;\n let hierarchyRenderReplacingRenameInput = false;\n let pendingHierarchyDragOver: DragEvent | null = null;\n let hierarchyDragOverFrame: number | null = null;\n let hierarchyViewportRectFrame = -1;\n let hierarchyViewportRect: DOMRect | null = null;\n let hierarchyHoverExpandTimer: number | null = null;\n let hierarchyHoverExpandId: string | null = null;\n let lastHierarchyDropPreviewKey = '';\n\n function cancelPendingHierarchyDragOver(): void {\n if (hierarchyDragOverFrame !== null) doc.defaultView?.cancelAnimationFrame(hierarchyDragOverFrame);\n hierarchyDragOverFrame = null;\n pendingHierarchyDragOver = null;\n }\n const treeViewportReveal = createLocalEditorViewportRevealController<string>({\n getViewport: findHierarchyTreeViewport,\n margin: 4,\n });\n\n const renderPanel = (state: LocalEditorBrowserUiState<TDocument>): void => {\n const scope = resolveScope(state);\n const toolbarOperations = currentKernelViewModel\n ? kernel.listOperations({\n scopeKey: currentKernelViewModel.snapshot.scopeKey,\n expectedRevision: currentKernelViewModel.snapshot.revision,\n contextNodeId: null,\n targetIds: [],\n activeId: currentKernelViewModel.snapshot.activeId,\n }, currentKernelViewModel.authorityToken)\n : [];\n const scopeChanged = scope.scopeId !== lastRenderedScopeId;\n if (scopeChanged) {\n hierarchySearchComposition = null;\n hierarchyRenameComposition = null;\n clearHierarchyDragFeedback();\n }\n const activeIdChanged = scope.activeId !== lastRenderedActiveId || scopeChanged;\n const treeScrollSnapshot = treeViewportReveal.captureScrollSnapshot();\n const activeRenameInput = doc.activeElement instanceof HTMLInputElement\n && doc.activeElement.dataset.editorHierarchyRenameInput\n ? doc.activeElement\n : null;\n const renameFocus = activeRenameInput\n ? {\n id: activeRenameInput.dataset.editorHierarchyRenameInput!,\n start: activeRenameInput.selectionStart,\n end: activeRenameInput.selectionEnd,\n direction: activeRenameInput.selectionDirection,\n }\n : null;\n const activeSearchInput = doc.activeElement instanceof HTMLInputElement\n && doc.activeElement.dataset.editorHierarchySearch != null\n ? doc.activeElement\n : null;\n const searchFocus = activeSearchInput\n ? {\n start: activeSearchInput.selectionStart,\n end: activeSearchInput.selectionEnd,\n direction: activeSearchInput.selectionDirection,\n }\n : null;\n if (activeIdChanged) {\n pendingHierarchyScrollId = null;\n lastRenderedActiveId = scope.activeId;\n lastRenderedScopeId = scope.scopeId;\n }\n hierarchyRenderReplacingRenameInput = renameFocus !== null;\n try {\n renderLocalEditorHierarchyPanel(doc, panel, {\n viewModel: currentKernelViewModel!,\n presentationRevision: `${currentKernelViewModel!.snapshot.structureRevision}:${JSON.stringify(currentKernelViewModel!.snapshot.capabilities)}`,\n rename: currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n ? currentKernelViewModel.state.rename\n : null,\n dragId: currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n ? currentKernelViewModel.state.dragId\n : null,\n dropPreview: hierarchyDragSession.preview,\n rootDrop: hierarchyRootDrop,\n searchQuery: currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n ? currentKernelViewModel.state.searchQuery\n : getScopeSearch(scope.scopeId),\n title: scope.title,\n searchPlaceholder: scope.searchPlaceholder,\n showCreateMenu: createHierarchyToolbarCreateMenuItems(toolbarOperations).length > 0,\n });\n if (renameFocus) {\n const replacement = [...panel.querySelectorAll<HTMLInputElement>('[data-editor-hierarchy-rename-input]')]\n .find(input => input.dataset.editorHierarchyRenameInput === renameFocus.id);\n replacement?.focus({ preventScroll: true });\n if (replacement && renameFocus.start !== null && renameFocus.end !== null) {\n replacement.setSelectionRange(renameFocus.start, renameFocus.end, renameFocus.direction ?? undefined);\n }\n }\n if (searchFocus) {\n const replacement = panel.querySelector<HTMLInputElement>('input[data-editor-hierarchy-search]');\n replacement?.focus({ preventScroll: true });\n if (replacement && searchFocus.start !== null && searchFocus.end !== null) {\n replacement.setSelectionRange(searchFocus.start, searchFocus.end, searchFocus.direction ?? undefined);\n }\n }\n } finally {\n hierarchyRenderReplacingRenameInput = false;\n }\n treeViewportReveal.restoreScrollSnapshot(treeScrollSnapshot);\n const suppressActiveScroll = scope.activeId\n ? treeViewportReveal.consumeRevealSuppression(scope.activeId, { clearWhenDifferent: activeIdChanged })\n : false;\n if (activeIdChanged && scope.activeId && !suppressActiveScroll && shouldAutoScrollActiveHierarchyNode()) {\n scheduleActiveHierarchyScroll(scope.activeId);\n }\n lastRenderedActiveId = scope.activeId;\n lastRenderedScopeId = scope.scopeId;\n };\n\n const hierarchyViewAdapter = createLocalEditorHierarchyViewAdapter(model => {\n currentKernelViewModel = model;\n if (currentBridgeState && model) {\n const compositionActive = (\n hierarchySearchComposition?.scopeKey === model.snapshot.scopeKey\n && panel.contains(hierarchySearchComposition.input)\n ) || (\n hierarchyRenameComposition?.scopeKey === model.snapshot.scopeKey\n && panel.contains(hierarchyRenameComposition.input)\n );\n if (shouldDeferHierarchyDomRender({\n renderedAuthority: renderedHierarchyAuthority,\n renderedProjection: renderedHierarchyProjection,\n renderedDragId: renderedHierarchyDragId,\n model,\n nativeDragActive: nativeHierarchyDragActive,\n compositionActive,\n })) {\n return;\n }\n if (\n renderedHierarchyViewModel\n && canApplyLocalEditorHierarchySelectionPresentation(renderedHierarchyViewModel, model)\n ) {\n let presentationApplied = false;\n try {\n presentationApplied = syncLocalEditorHierarchySelectionPresentation(panel, {\n viewModel: model,\n previousSelectedIds: renderedHierarchyViewModel.snapshot.selectedIds,\n previousActiveId: renderedHierarchyViewModel.snapshot.activeId,\n });\n } catch {\n presentationApplied = false;\n }\n if (presentationApplied) {\n const activeIdChanged = model.snapshot.activeId !== lastRenderedActiveId;\n if (activeIdChanged) {\n pendingHierarchyScrollId = null;\n const suppressActiveScroll = model.snapshot.activeId\n ? treeViewportReveal.consumeRevealSuppression(model.snapshot.activeId, { clearWhenDifferent: true })\n : false;\n if (model.snapshot.activeId\n && !suppressActiveScroll\n && shouldAutoScrollActiveHierarchyNode()) {\n scheduleActiveHierarchyScroll(model.snapshot.activeId);\n }\n }\n lastRenderedActiveId = model.snapshot.activeId;\n lastRenderedScopeId = model.snapshot.scopeKey;\n renderedHierarchyAuthority = createHierarchyRenderedAuthority(model);\n renderedHierarchyProjection = model.projection;\n renderedHierarchyViewModel = model;\n renderedHierarchyDragId = model.state.dragId;\n return;\n }\n }\n if (renderedHierarchyAuthority\n && !isHierarchyRenderedAuthorityCurrent(renderedHierarchyAuthority, model)) {\n nativeHierarchyDragActive = false;\n hierarchySearchComposition = null;\n hierarchyRenameComposition = null;\n clearHierarchyDragFeedback();\n }\n // Invalidate the old DOM before attempting replacement. If rendering\n // throws, events from that old DOM cannot retain write authority.\n renderedHierarchyAuthority = null;\n renderedHierarchyProjection = null;\n renderedHierarchyViewModel = null;\n renderPanel(currentBridgeState);\n renderedHierarchyAuthority = createHierarchyRenderedAuthority(model);\n renderedHierarchyProjection = model.projection;\n renderedHierarchyViewModel = model;\n renderedHierarchyDragId = model.state.dragId;\n } else if (!model) {\n panel.textContent = '';\n const unavailable = doc.createElement('div');\n unavailable.textContent = 'Hierarchy scope unavailable.';\n unavailable.style.cssText = 'padding:12px;color:var(--fps-editor-muted);font-size:11px';\n panel.appendChild(unavailable);\n renderedHierarchyAuthority = null;\n renderedHierarchyProjection = null;\n renderedHierarchyViewModel = null;\n renderedHierarchyDragId = null;\n }\n });\n const detachKernelView = kernel.attachView(hierarchyViewAdapter.adapter);\n const dispatchHierarchyIntent = async (intent: HierarchyIntent): Promise<HierarchyOperationResult> => {\n const authority = renderedHierarchyAuthority;\n const result = await hierarchyViewAdapter.dispatch({\n ...intent,\n expectedAuthorityToken: authority?.token ?? -1,\n expectedScopeKey: authority?.scopeKey ?? '',\n expectedRevision: authority?.revision ?? -1,\n });\n if (!result.ok || result.diagnostics.length > 0) options.onOperationResult?.(result);\n return result;\n };\n const executeCurrentHierarchyOperation = (\n operationId: string,\n input?: Readonly<Record<string, HierarchyJsonValue>>,\n context?: Partial<Pick<HierarchyOperationContext, 'contextNodeId' | 'targetIds' | 'activeId'>>,\n ): Promise<HierarchyOperationResult> => {\n const model = currentKernelViewModel;\n const authority = renderedHierarchyAuthority;\n if (!model || !authority\n || model.authorityToken !== authority.token\n || model.snapshot.scopeKey !== authority.scopeKey\n || model.snapshot.revision !== authority.revision) {\n return Promise.resolve({\n ok: false,\n changed: false,\n revision: model?.snapshot.revision ?? 0,\n diagnostics: [{ code: 'hierarchy.operation.view-authority-changed', message: 'Hierarchy view authority changed.', severity: 'error' }],\n });\n }\n return dispatchHierarchyIntent({\n type: 'operation.execute',\n operationId,\n expectedAuthorityToken: authority.token,\n context: {\n scopeKey: authority.scopeKey,\n expectedRevision: authority.revision,\n contextNodeId: context?.contextNodeId === undefined ? model.snapshot.activeId : context.contextNodeId,\n targetIds: context?.targetIds ?? model.snapshot.selectedIds,\n activeId: context?.activeId === undefined ? model.snapshot.activeId : context.activeId,\n },\n ...(input ? { input } : {}),\n });\n };\n const executePresentedHierarchyOperation = async (\n operation: HierarchyOperationDescriptor,\n context: HierarchyOperationContext,\n expectedAuthorityToken: number,\n ): Promise<void> => {\n let input = operation.payload;\n if (operation.inputPresentation) {\n const requested = await options.requestOperationInput?.(operation, context) ?? null;\n if (!requested) return;\n if (!isHierarchyMenuAuthorityCurrent(kernel.getViewModel(), expectedAuthorityToken, context)) return;\n input = Object.freeze({ ...(operation.payload ?? {}), ...requested });\n }\n await dispatchHierarchyIntent({\n type: 'operation.execute',\n operationId: operation.id,\n expectedAuthorityToken,\n context,\n ...(input ? { input } : {}),\n });\n };\n const render = (state: LocalEditorBrowserUiState<TDocument>): void => {\n currentBridgeState = state;\n kernel.refresh();\n };\n const syncSelectionPresentation = (\n state: LocalEditorBrowserUiState<TDocument>,\n ): LocalEditorHierarchySelectionPresentation | null => {\n currentBridgeState = state;\n const latest = kernel.getViewModel();\n let model = currentKernelViewModel;\n if (\n model?.providerId !== latest?.providerId\n || model?.authorityToken !== latest?.authorityToken\n || model?.snapshot !== latest?.snapshot\n || model?.state !== latest?.state\n || model?.projection !== latest?.projection\n ) {\n kernel.refresh();\n model = currentKernelViewModel;\n }\n if (!model) return null;\n const activeNode = model.snapshot.activeId\n ? model.snapshot.nodeById.get(model.snapshot.activeId)\n : null;\n return Object.freeze({\n scopeId: model.snapshot.scopeKey,\n selectedIds: Object.freeze([...model.snapshot.selectedIds]),\n activeId: model.snapshot.activeId,\n activeLabel: activeNode?.label ?? null,\n });\n };\n\n const onClick = (event: MouseEvent): void => {\n const target = event.target instanceof HTMLElement ? event.target : null;\n if (target?.closest('[data-editor-hierarchy-rename-input]')) return;\n if (target?.closest('input[data-editor-hierarchy-search]')) {\n return;\n }\n const enabledToggle = target?.closest<HTMLElement>('[data-editor-hierarchy-enabled-toggle]');\n const enabledToggleId = enabledToggle?.dataset.editorHierarchyEnabledToggle;\n if (enabledToggleId) {\n event.preventDefault();\n event.stopPropagation();\n toggleHierarchyItemEnabled(enabledToggleId, enabledToggle);\n return;\n }\n const toggle = target?.closest<HTMLElement>('[data-editor-hierarchy-toggle]')?.dataset.editorHierarchyToggle;\n if (toggle) {\n event.preventDefault();\n event.stopPropagation();\n toggleExpanded(toggle);\n return;\n }\n const createMenuButton = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-create-menu]');\n if (createMenuButton) {\n event.preventDefault();\n event.stopPropagation();\n openHierarchyCreateMenu(createMenuButton);\n return;\n }\n const hierarchyButton = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n const hierarchyId = hierarchyButton?.dataset.editorHierarchyId;\n if (hierarchyId) {\n if (treeViewportReveal.isElementVisible(hierarchyButton)) {\n treeViewportReveal.suppressNextReveal(hierarchyId);\n }\n event.preventDefault();\n event.stopPropagation();\n selectHierarchyItemFromClick(hierarchyId, event);\n return;\n }\n if (shouldClearSelectionFromBlankClick(event, target)) {\n event.preventDefault();\n void dispatchHierarchyIntent({ type: 'selection', targetId: null, modifier: 'replace' });\n }\n };\n\n const onContextMenu = (event: MouseEvent): void => {\n void openHierarchyContextMenu(event);\n };\n\n const onDocumentPointerDown = (event: PointerEvent): void => {\n hierarchyShortcutScopeActive = isEventInsideHierarchyPanel(event);\n };\n\n const onDocumentFocusIn = (event: FocusEvent): void => {\n hierarchyShortcutScopeActive = isEventInsideHierarchyPanel(event);\n };\n\n const onDoubleClick = (event: MouseEvent): void => {\n const target = event.target instanceof HTMLElement ? event.target : null;\n if (target?.closest('[data-editor-hierarchy-toggle]')) return;\n const hierarchyButton = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n const id = hierarchyButton?.dataset.editorHierarchyId;\n if (!id) return;\n event.preventDefault();\n event.stopPropagation();\n void (async () => {\n const selection = await dispatchHierarchyIntent({ type: 'selection', targetId: id, modifier: 'replace' });\n if (!selection.ok) return;\n kernel.refresh();\n const refreshed = kernel.getViewModel()?.snapshot;\n if (!refreshed || !refreshed.selectedIds.includes(id) || refreshed.activeId !== id) return;\n if (!refreshed.primaryOperationId) return;\n await dispatchHierarchyIntent({ type: 'primary', targetId: id });\n })();\n };\n\n const onInput = (event: Event): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (input?.dataset.editorHierarchySearch != null) {\n if (!isHierarchyCompositionSessionCurrent(hierarchySearchComposition, input, resolveCurrentScopeKey())\n && !isComposingInputEvent(event)) {\n void dispatchHierarchyIntent({ type: 'search.change', value: input.value });\n }\n return;\n }\n if (!input?.dataset.editorHierarchyRenameInput || !currentKernelViewModel?.state.rename) return;\n if (isHierarchyCompositionSessionCurrent(hierarchyRenameComposition, input, resolveCurrentScopeKey())\n || isComposingInputEvent(event)) return;\n void dispatchHierarchyIntent({ type: 'rename.change', value: input.value });\n };\n\n const onKeyDown = (event: KeyboardEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (input?.dataset.editorHierarchySearch != null) {\n if (event.isComposing\n || isHierarchyCompositionSessionCurrent(hierarchySearchComposition, input, resolveCurrentScopeKey())) return;\n const scopeId = resolveScopeForCurrentState()?.scopeId ?? 'scene';\n if (event.key !== 'Escape' || getScopeSearch(scopeId).length === 0) return;\n event.preventDefault();\n void dispatchHierarchyIntent({ type: 'search.change', value: '' });\n return;\n }\n if (!input?.dataset.editorHierarchyRenameInput) return;\n if (event.isComposing\n || isHierarchyCompositionSessionCurrent(hierarchyRenameComposition, input, resolveCurrentScopeKey())) return;\n if (event.key === 'Enter') {\n event.preventDefault();\n commitHierarchyRename(input.dataset.editorHierarchyRenameInput, input.value);\n return;\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n void dispatchHierarchyIntent({ type: 'rename.cancel' });\n }\n };\n\n const onCompositionStart = (event: CompositionEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n const scopeKey = resolveCurrentScopeKey();\n if (input?.dataset.editorHierarchySearch != null) hierarchySearchComposition = { input, scopeKey };\n if (input?.dataset.editorHierarchyRenameInput) hierarchyRenameComposition = { input, scopeKey };\n };\n\n const onCompositionEnd = (event: CompositionEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (input?.dataset.editorHierarchySearch != null) {\n const isCurrent = isHierarchyCompositionSessionCurrent(\n hierarchySearchComposition,\n input,\n resolveCurrentScopeKey(),\n );\n hierarchySearchComposition = null;\n if (!isCurrent) return;\n void dispatchHierarchyIntent({ type: 'search.change', value: input.value });\n return;\n }\n if (!input?.dataset.editorHierarchyRenameInput) return;\n const isCurrent = isHierarchyCompositionSessionCurrent(\n hierarchyRenameComposition,\n input,\n resolveCurrentScopeKey(),\n );\n hierarchyRenameComposition = null;\n if (!isCurrent) return;\n const renameId = input.dataset.editorHierarchyRenameInput;\n void (async () => {\n await dispatchHierarchyIntent({ type: 'rename.change', value: input.value });\n const renameInputs = [...panel.querySelectorAll<HTMLInputElement>('[data-editor-hierarchy-rename-input]')];\n const currentInput = renameInputs.find(candidate => candidate.dataset.editorHierarchyRenameInput === renameId);\n if (shouldCommitHierarchyRenameAfterCompositionEnd(doc.activeElement, renameInputs, renameId)) {\n commitHierarchyRename(renameId, currentInput?.value ?? input.value);\n }\n })();\n };\n\n const onFocusOut = (event: FocusEvent): void => {\n const input = event.target instanceof HTMLInputElement ? event.target : null;\n if (!input?.dataset.editorHierarchyRenameInput) return;\n if (hierarchyRenderReplacingRenameInput) return;\n if (isHierarchyCompositionSessionCurrent(hierarchyRenameComposition, input, resolveCurrentScopeKey())) return;\n commitHierarchyRename(input.dataset.editorHierarchyRenameInput, input.value);\n };\n\n const onDragStart = (event: DragEvent): void => {\n const state = getState();\n const target = event.target instanceof HTMLElement ? event.target : null;\n const button = target?.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n const id = button?.dataset.editorHierarchyId;\n if (!id || !state) return;\n const viewModel = currentKernelViewModel;\n const node = viewModel?.snapshot.nodeById.get(id);\n if (!viewModel || !node?.draggable || node.editorLocked === true) {\n event.preventDefault();\n return;\n }\n const draggedIds = resolveDraggedIds(viewModel, id);\n if (draggedIds.length === 0) {\n event.preventDefault();\n return;\n }\n const authority = renderedHierarchyAuthority;\n const reparentAvailable = !!authority\n && viewModel.authorityToken === authority.token\n && kernel.listOperations({\n scopeKey: authority.scopeKey,\n expectedRevision: authority.revision,\n contextNodeId: id,\n targetIds: draggedIds,\n activeId: id,\n }, authority.token).some(operation => operation.id === 'hierarchy.node.reparent');\n if (!canUseHierarchyProviderReparent(viewModel, reparentAvailable)) {\n event.preventDefault();\n return;\n }\n event.dataTransfer?.setData('text/plain', draggedIds.join(','));\n if (event.dataTransfer) event.dataTransfer.effectAllowed = 'move';\n nativeHierarchyDragActive = true;\n void dispatchHierarchyIntent({ type: 'drag.begin', targetId: id });\n if (currentKernelViewModel?.state.dragId !== id\n || !sameHierarchyIdSet(draggedIds, currentKernelViewModel.state.dragIds)) {\n nativeHierarchyDragActive = false;\n event.preventDefault();\n return;\n }\n };\n\n const processHierarchyDragOver = (event: DragEvent, frameTime?: number): void => {\n const state = getState();\n const target = event.target instanceof HTMLElement ? event.target : null;\n const draggedIds = readDraggedIds(event);\n if (!state || draggedIds.length === 0) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!sameHierarchyIdSet(draggedIds, currentKernelViewModel?.state.dragIds ?? [])) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!nativeHierarchyDragActive || !canUseHierarchyProviderReparent(currentKernelViewModel, true)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n const viewModel = currentKernelViewModel;\n if (!viewModel) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!isInsideHierarchyTreeViewport(target)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n hierarchyDragSession.pointer = { x: event.clientX, y: event.clientY };\n const viewportRect = measureHierarchyViewportRect(frameTime);\n updateHierarchyAutoScroll(viewportRect);\n const operation = resolveHierarchyDragOperation(event, viewModel, draggedIds, viewportRect);\n if (!operation || operation.status === 'idle') {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n event.preventDefault();\n hierarchyDragSession.operation = operation;\n updateHierarchyHoverExpand(operation, viewModel);\n const canSubmitDrop = operation.status === 'valid'\n && nativeHierarchyDragActive\n && canUseHierarchyProviderReparent(currentKernelViewModel, true);\n if (event.dataTransfer) event.dataTransfer.dropEffect = canSubmitDrop ? 'move' : 'none';\n if (operation.status !== 'valid' || !operation.slot || !operation.resolution?.ok) {\n hierarchyDragSession.preview = operation.preview;\n hierarchyRootDrop = false;\n syncHierarchyDropPreview();\n return;\n }\n if (operation.slot.placement === 'root') {\n hierarchyDragSession.preview = operation.preview;\n hierarchyRootDrop = true;\n syncHierarchyDropPreview();\n return;\n }\n hierarchyDragSession.preview = operation.preview;\n hierarchyRootDrop = false;\n syncHierarchyDropPreview();\n };\n\n const onDragOver = (event: DragEvent): void => {\n if (readDraggedIds(event).length > 0 && isInsideHierarchyTreeViewport(event.target instanceof HTMLElement ? event.target : null)) {\n event.preventDefault();\n }\n pendingHierarchyDragOver = event;\n if (hierarchyDragOverFrame !== null) return;\n hierarchyDragOverFrame = doc.defaultView?.requestAnimationFrame(frameTime => {\n hierarchyDragOverFrame = null;\n const latest = pendingHierarchyDragOver;\n pendingHierarchyDragOver = null;\n if (latest) processHierarchyDragOver(latest, frameTime);\n }) ?? null;\n if (hierarchyDragOverFrame === null) {\n const latest = pendingHierarchyDragOver;\n pendingHierarchyDragOver = null;\n if (latest) processHierarchyDragOver(latest);\n }\n };\n\n const onDragLeave = (event: DragEvent): void => {\n if (!panel.contains(event.relatedTarget as Node | null)) {\n cancelPendingHierarchyDragOver();\n clearHierarchyDragFeedback();\n requestRender();\n }\n };\n\n const onDragEnd = (): void => {\n cancelPendingHierarchyDragOver();\n nativeHierarchyDragActive = false;\n void dispatchHierarchyIntent({ type: 'drag.cancel' });\n clearHierarchyDragFeedback();\n requestRender();\n };\n\n const onDrop = (event: DragEvent): void => {\n cancelPendingHierarchyDragOver();\n const state = getState();\n const target = event.target instanceof HTMLElement ? event.target : null;\n const draggedIds = readDraggedIds(event);\n if (!state || draggedIds.length === 0) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!sameHierarchyIdSet(draggedIds, currentKernelViewModel?.state.dragIds ?? [])) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!nativeHierarchyDragActive || !canUseHierarchyProviderReparent(currentKernelViewModel, true)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n const viewModel = currentKernelViewModel;\n if (!viewModel) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n if (!isInsideHierarchyTreeViewport(target)) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n const operation = resolveHierarchyDragOperation(event, viewModel, draggedIds);\n if (!operation || operation.status !== 'valid' || !operation.slot || !operation.resolution?.ok) {\n clearHierarchyDragFeedbackAndRender();\n return;\n }\n event.preventDefault();\n nativeHierarchyDragActive = false;\n const committedDraggedIds = operation.resolution.draggedIds;\n const dragContextNodeId = currentKernelViewModel?.state.dragId && committedDraggedIds.includes(currentKernelViewModel.state.dragId)\n ? currentKernelViewModel.state.dragId\n : committedDraggedIds[0] ?? null;\n clearHierarchyDragFeedback();\n expandDropParent(operation.resolution);\n void executeCurrentHierarchyOperation(\n 'hierarchy.node.reparent',\n {\n draggedIds: committedDraggedIds,\n targetId: operation.slot.targetId,\n placement: operation.slot.placement,\n parentId: operation.resolution.parentId,\n beforeId: operation.resolution.beforeId,\n afterId: operation.resolution.afterId,\n preserveWorldTransform: true,\n },\n { contextNodeId: dragContextNodeId, targetIds: committedDraggedIds, activeId: dragContextNodeId },\n );\n };\n\n panel.addEventListener('click', onClick);\n panel.addEventListener('contextmenu', onContextMenu);\n panel.addEventListener('dblclick', onDoubleClick);\n panel.addEventListener('input', onInput);\n panel.addEventListener('keydown', onKeyDown);\n panel.addEventListener('compositionstart', onCompositionStart);\n panel.addEventListener('compositionend', onCompositionEnd);\n panel.addEventListener('focusout', onFocusOut);\n panel.addEventListener('dragstart', onDragStart);\n panel.addEventListener('dragover', onDragOver);\n panel.addEventListener('dragleave', onDragLeave);\n panel.addEventListener('dragend', onDragEnd);\n panel.addEventListener('drop', onDrop);\n doc.addEventListener('pointerdown', onDocumentPointerDown, { capture: true });\n doc.addEventListener('focusin', onDocumentFocusIn, { capture: true });\n\n return {\n render,\n syncSelectionPresentation,\n handleDeleteShortcut(event) {\n return handleDeleteShortcut(event);\n },\n handleEditShortcut(event) {\n return handleEditShortcut(event);\n },\n dispose() {\n nativeHierarchyDragActive = false;\n hierarchySearchComposition = null;\n hierarchyRenameComposition = null;\n detachKernelView();\n clearHierarchyDragFeedback();\n panel.removeEventListener('click', onClick);\n panel.removeEventListener('contextmenu', onContextMenu);\n panel.removeEventListener('dblclick', onDoubleClick);\n panel.removeEventListener('input', onInput);\n panel.removeEventListener('keydown', onKeyDown);\n panel.removeEventListener('compositionstart', onCompositionStart);\n panel.removeEventListener('compositionend', onCompositionEnd);\n panel.removeEventListener('focusout', onFocusOut);\n panel.removeEventListener('dragstart', onDragStart);\n panel.removeEventListener('dragover', onDragOver);\n panel.removeEventListener('dragleave', onDragLeave);\n panel.removeEventListener('dragend', onDragEnd);\n panel.removeEventListener('drop', onDrop);\n cancelPendingHierarchyDragOver();\n doc.removeEventListener('pointerdown', onDocumentPointerDown, { capture: true });\n doc.removeEventListener('focusin', onDocumentFocusIn, { capture: true });\n },\n };\n\n function handleDeleteShortcut(event: KeyboardEvent): boolean {\n return handleOperationShortcut(event);\n }\n\n function handleEditShortcut(event: KeyboardEvent): boolean {\n return handleOperationShortcut(event);\n }\n\n function handleOperationShortcut(event: KeyboardEvent): boolean {\n const operation = currentKernelViewModel?.operations.find(candidate => (\n !!candidate.shortcut\n && matchesHierarchyOperationShortcut(event, candidate.shortcut)\n && (candidate.shortcutScope !== 'hierarchy' || isHierarchyShortcutScope(event))\n ));\n if (!operation) return false;\n event.preventDefault();\n if (operation.disabledReason) return true;\n if (operation.id === 'hierarchy.node.rename') {\n const targetId = currentKernelViewModel?.snapshot.activeId;\n if (targetId) beginHierarchyRename(targetId);\n return true;\n }\n const input = operation.id === 'hierarchy.selection.all'\n ? { visibleIds: currentKernelViewModel\n ? currentKernelViewModel.projection.getRange(0, currentKernelViewModel.projection.totalCount - 1)\n : [] }\n : operation.payload;\n void executeCurrentHierarchyOperation(operation.id, input);\n return true;\n }\n\n function isComposingInputEvent(event: Event): boolean {\n return (event as Event & { isComposing?: boolean }).isComposing === true;\n }\n\n function resolveCurrentScopeKey(): string {\n return currentKernelViewModel?.snapshot.scopeKey ?? renderedHierarchyAuthority?.scopeKey ?? '';\n }\n\n function resolveScope(state: LocalEditorBrowserUiState<TDocument>): BrowserHierarchyScopeMetadata {\n const snapshot = currentKernelViewModel?.snapshot;\n return snapshot\n ? {\n scopeId: snapshot.scopeKey,\n revision: snapshot.revision,\n kind: snapshot.scopeType,\n title: snapshot.title,\n searchPlaceholder: snapshot.searchPlaceholder,\n selectedIds: snapshot.selectedIds,\n activeId: snapshot.activeId,\n readonly: snapshot.readonly,\n }\n : {\n scopeId: 'hierarchy:unavailable',\n revision: 0,\n kind: 'unavailable',\n title: 'Hierarchy',\n searchPlaceholder: 'Hierarchy unavailable',\n selectedIds: [],\n activeId: null,\n readonly: true,\n };\n }\n\n function resolveScopeForCurrentState(): BrowserHierarchyScopeMetadata | null {\n const state = getState();\n return state ? resolveScope(state) : null;\n }\n\n function getScopeSearch(scopeId: string): string {\n if (currentKernelViewModel?.snapshot.scopeKey === scopeId) return currentKernelViewModel.state.searchQuery;\n return '';\n }\n\n function resolveVisibleIds(): readonly string[] {\n const projection = currentKernelViewModel?.projection;\n if (!projection) return [];\n if (cachedVisibleIds?.projection === projection) return cachedVisibleIds.ids;\n const ids = projection.getRange(0, projection.totalCount - 1);\n cachedVisibleIds = { projection, ids };\n return ids;\n }\n\n function selectHierarchyItemFromClick(id: string, event: MouseEvent): void {\n const toggle = event.metaKey || event.ctrlKey;\n const range = event.shiftKey && !toggle;\n void dispatchHierarchyIntent({\n type: 'selection',\n targetId: id,\n modifier: range ? 'range' : toggle ? 'toggle' : 'replace',\n });\n }\n\n function toggleHierarchyItemEnabled(id: string, toggle: HTMLElement): void {\n if (toggle.dataset.editorHierarchyEnabledToggleDisabled === 'true') return;\n const state = getState();\n if (!state) return;\n const snapshot = currentKernelViewModel?.snapshot;\n const node = snapshot?.nodeById.get(id);\n if (!snapshot || !node || node.editorLocked === true) return;\n const directEnabled = node.authoredEnabled ?? node.editorVisible;\n const request = createHierarchyEnabledOperationRequest(node, directEnabled);\n void executeCurrentHierarchyOperation(\n request.operationId,\n request.input,\n { contextNodeId: id, targetIds: [id], activeId: id },\n );\n }\n\n function resolveDraggedIds(\n viewModel: HierarchyViewModel,\n draggedId: string,\n ): string[] {\n const selectedIds = viewModel.snapshot.selectedIds.includes(draggedId)\n ? viewModel.snapshot.selectedIds\n : [draggedId];\n return [...viewModel.projection.getTopLevelSelection(selectedIds)];\n }\n\n function readDraggedIds(event: DragEvent): string[] {\n return resolveHierarchyTransportDragIds(\n event.dataTransfer?.getData('text/plain'),\n currentKernelViewModel?.state.dragIds ?? [],\n );\n }\n\n function toggleExpanded(id: string): void {\n void dispatchHierarchyIntent({ type: 'disclosure.toggle', targetId: id });\n }\n\n function expandNode(id: string | null | undefined): void {\n if (!id) return;\n void dispatchHierarchyIntent({ type: 'disclosure.expand', targetId: id });\n }\n\n function shouldAutoScrollActiveHierarchyNode(): boolean {\n return !currentKernelViewModel?.state.rename\n && !currentKernelViewModel?.state.dragId\n && !hasHierarchyDragFeedback();\n }\n\n function scheduleActiveHierarchyScroll(activeId: string): void {\n pendingHierarchyScrollId = activeId;\n setTimeout(() => {\n if (pendingHierarchyScrollId !== activeId) return;\n pendingHierarchyScrollId = null;\n const viewport = findHierarchyTreeViewport();\n let row = findHierarchyRow(activeId);\n if (!row && viewport && currentKernelViewModel) {\n const index = currentKernelViewModel.projection.indexOf(activeId);\n if (index >= 0) {\n const rowTop = index * LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n const rowBottom = rowTop + LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n if (rowTop < viewport.scrollTop) viewport.scrollTop = rowTop;\n else if (rowBottom > viewport.scrollTop + viewport.clientHeight) {\n viewport.scrollTop = Math.max(0, rowBottom - viewport.clientHeight);\n }\n row = findHierarchyRow(activeId);\n }\n }\n if (!row) return;\n if (viewport) {\n treeViewportReveal.revealElement(row, { behavior: 'smooth' });\n return;\n }\n try {\n row.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'smooth' });\n } catch {\n row.scrollIntoView();\n }\n }, 0);\n }\n\n function findHierarchyRow(id: string): HTMLElement | null {\n for (const row of panel.querySelectorAll<HTMLElement>('[data-editor-hierarchy-id]')) {\n if (row.dataset.editorHierarchyId === id) return row;\n }\n return null;\n }\n\n function findHierarchyTreeViewport(): HTMLElement | null {\n return panel.querySelector<HTMLElement>('[data-editor-hierarchy-tree-viewport]');\n }\n\n function isInsideHierarchyTreeViewport(target: HTMLElement | null): boolean {\n return !!target?.closest('[data-editor-hierarchy-tree-viewport]');\n }\n\n function armHierarchyAutoScroll(): void {\n if (hierarchyDragSession.autoScrollFrame !== null) return;\n hierarchyDragSession.autoScrollFrame = doc.defaultView?.requestAnimationFrame(tickHierarchyAutoScroll) ?? null;\n }\n\n function stopHierarchyAutoScroll(): void {\n if (hierarchyDragSession.autoScrollFrame !== null) {\n doc.defaultView?.cancelAnimationFrame(hierarchyDragSession.autoScrollFrame);\n }\n hierarchyDragSession.autoScrollFrame = null;\n }\n\n function clearHierarchyDragFeedback(): void {\n cancelPendingHierarchyDragOver();\n hierarchyRootDrop = false;\n lastHierarchyDropPreviewKey = '';\n stopHierarchyAutoScroll();\n clearHierarchyHoverExpand();\n clearLocalEditorStructuredDragSession(hierarchyDragSession);\n }\n\n function clearHierarchyHoverExpand(): void {\n if (hierarchyHoverExpandTimer !== null) doc.defaultView?.clearTimeout(hierarchyHoverExpandTimer);\n hierarchyHoverExpandTimer = null;\n hierarchyHoverExpandId = null;\n }\n\n function updateHierarchyHoverExpand(\n operation: LocalEditorHierarchyDragOperation,\n viewModel: HierarchyViewModel,\n ): void {\n const targetId = operation.status === 'valid' && operation.slot?.placement === 'inside'\n ? operation.slot.targetId\n : null;\n const node = targetId ? viewModel.snapshot.nodeById.get(targetId) : null;\n const expanded = targetId ? !viewModel.state.collapsedIds.has(targetId) : false;\n const childCount = targetId ? viewModel.snapshot.childrenByParentId.get(targetId)?.length ?? 0 : 0;\n if (!targetId || !node || expanded || childCount === 0) {\n clearHierarchyHoverExpand();\n return;\n }\n if (hierarchyHoverExpandId === targetId && hierarchyHoverExpandTimer !== null) return;\n clearHierarchyHoverExpand();\n hierarchyHoverExpandId = targetId;\n hierarchyHoverExpandTimer = doc.defaultView?.setTimeout(() => {\n const id = hierarchyHoverExpandId;\n hierarchyHoverExpandTimer = null;\n hierarchyHoverExpandId = null;\n if (id) expandNode(id);\n }, 600) ?? null;\n }\n\n function hasHierarchyDragFeedback(): boolean {\n return hierarchyRootDrop\n || hasLocalEditorStructuredDragSessionFeedback(hierarchyDragSession);\n }\n\n function clearHierarchyDragFeedbackAndRender(): void {\n const hadFeedback = hasHierarchyDragFeedback();\n clearHierarchyDragFeedback();\n if (hadFeedback) syncHierarchyDropPreview();\n }\n\n function syncHierarchyDropPreview(): void {\n const preview = hierarchyDragSession.preview;\n const key = [\n hierarchyRootDrop, preview?.kind ?? '', preview?.targetId ?? '', preview?.placement ?? '', preview?.valid ?? '',\n ].join(':');\n if (key === lastHierarchyDropPreviewKey) return;\n lastHierarchyDropPreviewKey = key;\n syncLocalEditorHierarchyDropPreview(doc, panel, {\n dropPreview: hierarchyDragSession.preview,\n rootDrop: hierarchyRootDrop,\n });\n }\n\n function tickHierarchyAutoScroll(frameTime: number): void {\n hierarchyDragSession.autoScrollFrame = null;\n if (!hierarchyDragSession.pointer) return;\n const viewport = findHierarchyTreeViewport();\n if (!viewport) return;\n const rect = measureHierarchyViewportRect(frameTime);\n if (!rect) return;\n const scroll = resolveLocalEditorHierarchyAutoScroll({\n pointerY: hierarchyDragSession.pointer.y,\n viewportTop: rect.top,\n viewportBottom: rect.bottom,\n viewportHeight: rect.height,\n scrollTop: viewport.scrollTop,\n scrollHeight: viewport.scrollHeight,\n clientHeight: viewport.clientHeight,\n });\n if (scroll.speed !== 0) {\n viewport.scrollTop += scroll.speed;\n requestRender();\n armHierarchyAutoScroll();\n }\n }\n\n function updateHierarchyAutoScroll(measuredRect?: DOMRect): void {\n const viewport = findHierarchyTreeViewport();\n if (!viewport || !hierarchyDragSession.pointer) {\n stopHierarchyAutoScroll();\n return;\n }\n const rect = measuredRect ?? viewport.getBoundingClientRect();\n const scroll = resolveLocalEditorHierarchyAutoScroll({\n pointerY: hierarchyDragSession.pointer.y,\n viewportTop: rect.top,\n viewportBottom: rect.bottom,\n viewportHeight: rect.height,\n scrollTop: viewport.scrollTop,\n scrollHeight: viewport.scrollHeight,\n clientHeight: viewport.clientHeight,\n });\n if (scroll.speed === 0) {\n stopHierarchyAutoScroll();\n return;\n }\n armHierarchyAutoScroll();\n }\n\n function measureHierarchyViewportRect(frameTime?: number): DOMRect | undefined {\n if (frameTime !== undefined && hierarchyViewportRectFrame === frameTime && hierarchyViewportRect) {\n return hierarchyViewportRect;\n }\n const rect = findHierarchyTreeViewport()?.getBoundingClientRect();\n if (frameTime !== undefined && rect) {\n hierarchyViewportRectFrame = frameTime;\n hierarchyViewportRect = rect;\n }\n return rect;\n }\n\n function resolveHierarchyDragOperation(\n event: DragEvent,\n viewModel: HierarchyViewModel,\n draggedIds: readonly string[],\n measuredRect?: DOMRect,\n ): LocalEditorHierarchyDragOperation | null {\n const layout = createHierarchyDragLayout(viewModel, measuredRect);\n if (!layout) return null;\n return resolveLocalEditorHierarchyDragOperation({\n layout,\n pointer: { x: event.clientX, y: event.clientY },\n draggedIds,\n resolveDrop: input => viewModel.projection.resolveDrop(input),\n });\n }\n\n function createHierarchyDragLayout(viewModel: HierarchyViewModel, measuredRect?: DOMRect): LocalEditorHierarchyDragLayout | null {\n const viewport = findHierarchyTreeViewport();\n const projection = viewModel.projection;\n if (!viewport || !projection) return null;\n const viewportRect = measuredRect ?? viewport.getBoundingClientRect();\n const rows: LocalEditorHierarchyDragLayoutRow[] = [];\n const start = Math.max(0, Math.floor(viewport.scrollTop / LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT));\n const count = Math.min(\n projection.totalCount - start,\n Math.ceil(viewportRect.height / LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT) + 1,\n );\n for (let offset = 0; offset < Math.max(0, count); offset += 1) {\n const index = start + offset;\n const projected = projection.getRow(index);\n if (!projected) continue;\n const node = viewModel.snapshot.nodeById.get(projected.id);\n if (!node) continue;\n const canAcceptInside = node.canHaveChildren && node.editorLocked !== true;\n rows.push({\n id: projected.id,\n depth: projected.depth,\n parentId: node.parentId,\n canHaveChildren: canAcceptInside,\n canAcceptInside,\n rect: {\n left: viewportRect.left,\n top: viewportRect.top + index * LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT - viewport.scrollTop,\n width: viewportRect.width,\n height: LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT,\n },\n });\n }\n return {\n rows,\n viewport: {\n left: viewportRect.left,\n top: viewportRect.top,\n width: viewportRect.width,\n height: viewportRect.height,\n },\n indentWidth: HIERARCHY_DRAG_INDENT_WIDTH,\n };\n }\n\n function expandDropParent(resolved: HierarchyDropResolution): void {\n if (resolved.placement === 'inside') expandNode(resolved.parentId);\n }\n\n function commitHierarchyRename(id: string, value: string): void {\n const rename = currentKernelViewModel?.state.rename;\n if (!rename || rename.id !== id) return;\n void (async () => {\n await dispatchHierarchyIntent({ type: 'rename.change', value });\n await dispatchHierarchyIntent({ type: 'rename.commit' });\n })();\n }\n\n async function openHierarchyContextMenu(event: MouseEvent): Promise<void> {\n const target = inputRouter.claimContextMenu(event);\n const hadHierarchyFeedback = hasHierarchyDragFeedback();\n clearHierarchyDragFeedback();\n if (!target) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n const state = getState();\n if (!state || state.mode !== 'editor' || state.busy) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n let scope = resolveScope(state);\n const hierarchyButton = target.closest<HTMLButtonElement>('[data-editor-hierarchy-id]');\n let node = hierarchyButton?.dataset.editorHierarchyId\n ? currentKernelViewModel?.snapshot.nodeById.get(hierarchyButton.dataset.editorHierarchyId)\n : undefined;\n if (node && !scope.selectedIds.includes(node.id) && node.selectable && node.editorLocked !== true) {\n const selection = await dispatchHierarchyIntent({ type: 'selection', targetId: node.id, modifier: 'replace' });\n if (!selection.ok) return;\n kernel.refresh();\n const refreshedState = getState() ?? state;\n scope = resolveScope(refreshedState);\n if (!scope.selectedIds.includes(node.id) || scope.activeId !== node.id) return;\n node = hierarchyButton?.dataset.editorHierarchyId\n ? currentKernelViewModel?.snapshot.nodeById.get(hierarchyButton.dataset.editorHierarchyId)\n : undefined;\n }\n const operationContext = Object.freeze({\n scopeKey: scope.scopeId,\n expectedRevision: scope.revision,\n contextNodeId: node?.id ?? null,\n targetIds: Object.freeze([...scope.selectedIds]),\n activeId: scope.activeId,\n });\n const expectedAuthorityToken = renderedHierarchyAuthority?.token;\n const providerOperations = kernel.listOperations(operationContext, expectedAuthorityToken);\n if (expectedAuthorityToken === undefined\n || currentKernelViewModel?.authorityToken !== expectedAuthorityToken\n || currentKernelViewModel.snapshot.scopeKey !== operationContext.scopeKey\n || currentKernelViewModel.snapshot.revision !== operationContext.expectedRevision) return;\n if (providerOperations.length === 0) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n options.onBeforeOpenContextMenu?.();\n const menuItems = createHierarchyOperationMenuItems(providerOperations);\n if (menuItems.length === 0) {\n if (hadHierarchyFeedback) requestRender();\n return;\n }\n\n contextMenu.open({\n x: event.clientX,\n y: event.clientY,\n items: menuItems,\n onAction(item) {\n if (!isHierarchyMenuAuthorityCurrent(\n kernel.getViewModel(),\n expectedAuthorityToken,\n operationContext,\n )) return;\n const operation = providerOperations.find(candidate => candidate.id === item.id);\n if (operation) {\n if (operation.id === 'hierarchy.node.rename' && operationContext.contextNodeId) {\n const latest = kernel.getViewModel();\n if (latest?.authorityToken === expectedAuthorityToken\n && latest.snapshot.scopeKey === operationContext.scopeKey\n && latest.snapshot.revision === operationContext.expectedRevision) {\n beginHierarchyRename(operationContext.contextNodeId);\n }\n return;\n }\n void executePresentedHierarchyOperation(operation, operationContext, expectedAuthorityToken);\n }\n },\n });\n if (hadHierarchyFeedback) requestRender();\n }\n\n function openHierarchyCreateMenu(button: HTMLButtonElement): void {\n const state = getState();\n if (!state || state.mode !== 'editor' || state.busy) return;\n const model = currentKernelViewModel;\n if (!model) return;\n const scope = resolveScope(state);\n const activeNode = model.snapshot.activeId\n ? model.snapshot.nodeById.get(model.snapshot.activeId)\n : undefined;\n const parentNode = activeNode?.canHaveChildren === true && activeNode.editorLocked !== true\n ? activeNode\n : undefined;\n const operationContext = Object.freeze({\n scopeKey: scope.scopeId,\n expectedRevision: scope.revision,\n contextNodeId: parentNode?.id ?? null,\n targetIds: Object.freeze(parentNode ? [parentNode.id] : []),\n activeId: parentNode?.id ?? scope.activeId,\n });\n const expectedAuthorityToken = renderedHierarchyAuthority?.token;\n const operations = kernel.listOperations(operationContext, expectedAuthorityToken);\n if (expectedAuthorityToken === undefined\n || !isHierarchyMenuAuthorityCurrent(model, expectedAuthorityToken, operationContext)) return;\n const items = createHierarchyToolbarCreateMenuItems(operations);\n if (items.length === 0) return;\n options.onBeforeOpenContextMenu?.();\n const rect = button.getBoundingClientRect();\n contextMenu.open({\n x: rect.left,\n y: rect.bottom,\n items,\n onAction(item) {\n if (!isHierarchyMenuAuthorityCurrent(kernel.getViewModel(), expectedAuthorityToken, operationContext)) return;\n hierarchyShortcutScopeActive = true;\n const operation = operations.find(candidate => candidate.id === item.id);\n if (!operation) return;\n if (parentNode) expandNode(parentNode.id);\n void executePresentedHierarchyOperation(operation, operationContext, expectedAuthorityToken);\n },\n });\n }\n\n function shouldClearSelectionFromBlankClick(event: MouseEvent, target: HTMLElement | null): boolean {\n if (event.button !== 0 || event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) return false;\n if (!target?.closest('[data-editor-hierarchy-root-drop]')) return false;\n if (currentKernelViewModel?.state.rename || currentKernelViewModel?.state.dragId || hasHierarchyDragFeedback()) return false;\n const state = getState();\n if (!state) return false;\n const scope = resolveScope(state);\n return currentKernelViewModel?.snapshot.scopeKey === scope.scopeId\n && currentKernelViewModel.snapshot.capabilities.clearSelection === true\n && scope.selectedIds.length > 0;\n }\n\n function isHierarchyShortcutScope(event: KeyboardEvent): boolean {\n const target = event.target instanceof Node ? event.target : null;\n const activeElement = doc.activeElement;\n return hierarchyShortcutScopeActive\n || (target !== null && panel.contains(target))\n || (activeElement !== null && panel.contains(activeElement));\n }\n\n function isEventInsideHierarchyPanel(event: Event): boolean {\n const target = event.target instanceof Node ? event.target : null;\n return target !== null && panel.contains(target);\n }\n\n function beginHierarchyRename(id: string): void {\n const node = currentKernelViewModel?.snapshot.nodeById.get(id);\n if (!node?.renamable || node.editorLocked === true) return;\n const projectionIndex = currentKernelViewModel?.projection.indexOf(id) ?? -1;\n const viewport = findHierarchyTreeViewport();\n if (viewport && projectionIndex >= 0) {\n const rowTop = projectionIndex * LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n const rowBottom = rowTop + LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT;\n if (rowTop < viewport.scrollTop || rowBottom > viewport.scrollTop + viewport.clientHeight) {\n viewport.scrollTop = Math.max(\n 0,\n rowTop - Math.max(0, viewport.clientHeight - LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT) / 2,\n );\n }\n }\n void dispatchHierarchyIntent({ type: 'rename.begin', targetId: id });\n }\n\n}\n\nexport function shouldCommitHierarchyRenameAfterCompositionEnd(\n activeElement: Element | null,\n renameInputs: readonly HTMLInputElement[],\n renameId: string,\n): boolean {\n const currentInput = renameInputs.find(input => input.dataset.editorHierarchyRenameInput === renameId) ?? null;\n return currentInput === null || activeElement !== currentInput;\n}\n\nexport function isHierarchyMenuAuthorityCurrent(\n model: HierarchyViewModel | null,\n expectedAuthorityToken: number,\n context: HierarchyOperationContext,\n): boolean {\n return model?.authorityToken === expectedAuthorityToken\n && model.snapshot.scopeKey === context.scopeKey\n && model.snapshot.revision === context.expectedRevision;\n}\n\nexport function sameHierarchyIdSet(left: readonly string[], right: readonly string[]): boolean {\n if (left.length !== right.length) return false;\n if (new Set(left).size !== left.length || new Set(right).size !== right.length) return false;\n const expected = new Set(right);\n return left.every(id => expected.has(id));\n}\n\nexport function resolveHierarchyTransportDragIds(\n dataTransferValue: string | null | undefined,\n frozenDragIds: readonly string[],\n): string[] {\n const dataTransferIds = dataTransferValue?.split(',')\n .map(id => id.trim())\n .filter(Boolean) ?? [];\n return dataTransferIds.length > 0 ? dataTransferIds : [...frozenDragIds];\n}\n\nexport interface HierarchyCompositionSession<TInput extends object = object> {\n readonly input: TInput;\n readonly scopeKey: string;\n}\n\nexport function isHierarchyCompositionSessionCurrent<TInput extends object>(\n session: HierarchyCompositionSession<TInput> | null,\n input: TInput,\n scopeKey: string,\n): boolean {\n return session?.input === input && session.scopeKey === scopeKey;\n}\n\nexport interface HierarchyRenderedAuthority {\n readonly token: number;\n readonly scopeKey: string;\n readonly revision: number;\n}\n\nfunction createHierarchyRenderedAuthority(\n model: HierarchyViewModel,\n): HierarchyRenderedAuthority {\n return Object.freeze({\n token: model.authorityToken,\n scopeKey: model.snapshot.scopeKey,\n revision: model.snapshot.revision,\n });\n}\n\nexport function canApplyLocalEditorHierarchySelectionPresentation(\n previous: HierarchyViewModel,\n next: HierarchyViewModel,\n): boolean {\n const previousSnapshot = previous.snapshot;\n const nextSnapshot = next.snapshot;\n const selectionChanged = previousSnapshot.activeId !== nextSnapshot.activeId\n || !sameHierarchyStringArray(previousSnapshot.selectedIds, nextSnapshot.selectedIds);\n return selectionChanged\n && previous.providerId === next.providerId\n && previous.authorityToken === next.authorityToken\n && previousSnapshot.scopeKey === nextSnapshot.scopeKey\n && nextSnapshot.revision >= previousSnapshot.revision\n && previousSnapshot.scopeType === nextSnapshot.scopeType\n && previousSnapshot.structureRevision === nextSnapshot.structureRevision\n && previousSnapshot.rootIds === nextSnapshot.rootIds\n && previousSnapshot.nodeById === nextSnapshot.nodeById\n && previousSnapshot.childrenByParentId === nextSnapshot.childrenByParentId\n && previousSnapshot.title === nextSnapshot.title\n && previousSnapshot.searchPlaceholder === nextSnapshot.searchPlaceholder\n && previousSnapshot.readonly === nextSnapshot.readonly\n && previousSnapshot.primaryOperationId === nextSnapshot.primaryOperationId\n && sameHierarchyBooleanRecord(previousSnapshot.capabilities, nextSnapshot.capabilities)\n && previous.projection === next.projection\n && previous.state.searchQuery === next.state.searchQuery\n && sameHierarchyRenameState(previous.state.rename, next.state.rename)\n && previous.state.dragId === next.state.dragId\n && sameHierarchyStringArray(previous.state.dragIds, next.state.dragIds);\n}\n\nexport function isHierarchyRenderedAuthorityCurrent(\n authority: HierarchyRenderedAuthority,\n model: HierarchyViewModel,\n): boolean {\n return authority.token === model.authorityToken\n && authority.scopeKey === model.snapshot.scopeKey\n && authority.revision === model.snapshot.revision;\n}\n\nexport function shouldDeferHierarchyDomRender(input: {\n readonly renderedAuthority: HierarchyRenderedAuthority | null;\n readonly renderedProjection: HierarchyViewModel['projection'] | null;\n readonly renderedDragId: string | null;\n readonly model: HierarchyViewModel;\n readonly nativeDragActive: boolean;\n readonly compositionActive: boolean;\n}): boolean {\n return input.renderedAuthority !== null\n && isHierarchyRenderedAuthorityCurrent(input.renderedAuthority, input.model)\n && (\n input.compositionActive\n || (input.nativeDragActive\n && input.renderedProjection === input.model.projection\n && input.renderedDragId === input.model.state.dragId)\n );\n}\n\nfunction sameHierarchyRenameState(\n left: HierarchyViewModel['state']['rename'],\n right: HierarchyViewModel['state']['rename'],\n): boolean {\n return left === right\n || (!!left && !!right && left.id === right.id && left.value === right.value);\n}\n\nfunction sameHierarchyStringArray(\n left: readonly string[],\n right: readonly string[],\n): boolean {\n return left === right\n || (left.length === right.length && left.every((value, index) => value === right[index]));\n}\n\nfunction sameHierarchyBooleanRecord(\n left: Readonly<Record<string, boolean | undefined>>,\n right: Readonly<Record<string, boolean | undefined>>,\n): boolean {\n if (left === right) return true;\n const keys = new Set([...Object.keys(left), ...Object.keys(right)]);\n for (const key of keys) {\n if (left[key] !== right[key]) return false;\n }\n return true;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { HierarchyViewModel } from '@fps-games/plugin-hierarchy';
1
+ import type { HierarchyScopeSnapshot, HierarchyViewModel } from '@fps-games/plugin-hierarchy';
2
2
  import type { LocalEditorHierarchyDropPreview } from './local-editor-ui-hierarchy-drag-policy';
3
3
  export interface LocalEditorHierarchyViewInput {
4
4
  title?: string;
@@ -15,7 +15,20 @@ export interface LocalEditorHierarchyViewInput {
15
15
  rootDrop: boolean;
16
16
  searchQuery: string;
17
17
  }
18
+ export interface LocalEditorHierarchySelectionPresentationInput {
19
+ viewModel: HierarchyViewModel;
20
+ previousSelectedIds: readonly string[];
21
+ previousActiveId: string | null;
22
+ }
18
23
  export declare const LOCAL_EDITOR_HIERARCHY_ROW_HEIGHT = 26;
19
24
  export declare function renderLocalEditorHierarchyPanel(doc: Document, panel: HTMLElement, input: LocalEditorHierarchyViewInput): void;
25
+ export declare function syncLocalEditorHierarchySelectionPresentation(panel: HTMLElement, input: LocalEditorHierarchySelectionPresentationInput): boolean;
26
+ export declare function syncLocalEditorHierarchyMountedRowSelectionPresentation(rows: ReadonlyMap<string, HTMLElement>, previousSelectedIds: readonly string[], previousActiveId: string | null, selectedIds: readonly string[], activeId: string | null): void;
27
+ export declare function applyLocalEditorHierarchyLabelPresentation(kernel: LocalEditorHierarchyLabelPresentationKernel, rows: ReadonlyMap<string, HTMLElement>, labels: Readonly<Record<string, string>>): HierarchyScopeSnapshot | null;
28
+ export declare function syncLocalEditorHierarchyLabelPresentation(panel: HTMLElement, kernel: LocalEditorHierarchyLabelPresentationKernel, labels: Readonly<Record<string, string>>): boolean;
29
+ export declare function canApplyLocalEditorHierarchyLabelPresentationSnapshot(previous: Pick<HierarchyScopeSnapshot, 'scopeKey' | 'revision' | 'structureRevision' | 'selectedIds' | 'activeId'>, next: Pick<HierarchyScopeSnapshot, 'scopeKey' | 'revision' | 'structureRevision' | 'selectedIds' | 'activeId'>): boolean;
30
+ export interface LocalEditorHierarchyLabelPresentationKernel {
31
+ patchNodeLabels(labels: Readonly<Record<string, string>>): HierarchyScopeSnapshot | null;
32
+ }
20
33
  export declare function syncLocalEditorHierarchyDropPreview(doc: Document, panel: HTMLElement, input: Pick<LocalEditorHierarchyViewInput, 'dropPreview' | 'rootDrop'>): void;
21
34
  //# sourceMappingURL=local-editor-ui-hierarchy-view.d.ts.map