@fps-games/editor 0.2.1-beta.1 → 0.2.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +1 -1
  2. package/dist/agent-bridge/capabilities/ui-regions.js +16 -0
  3. package/dist/agent-bridge/capabilities/ui-regions.js.map +1 -1
  4. package/dist/build-info.json +43 -43
  5. package/dist/internal/material-preview.d.ts +22 -0
  6. package/dist/internal/material-preview.d.ts.map +1 -0
  7. package/dist/internal/material-preview.js +186 -0
  8. package/dist/internal/material-preview.js.map +1 -0
  9. package/dist/internal/project-model-preview.d.ts +4 -0
  10. package/dist/internal/project-model-preview.d.ts.map +1 -0
  11. package/dist/internal/project-model-preview.js +359 -0
  12. package/dist/internal/project-model-preview.js.map +1 -0
  13. package/dist/local-editor-agent-context.d.ts +12 -1
  14. package/dist/local-editor-agent-context.d.ts.map +1 -1
  15. package/dist/local-editor-agent-context.js +47 -0
  16. package/dist/local-editor-agent-context.js.map +1 -1
  17. package/dist/local-editor-harness.d.ts +15 -2
  18. package/dist/local-editor-harness.d.ts.map +1 -1
  19. package/dist/local-editor-harness.js +310 -21
  20. package/dist/local-editor-harness.js.map +1 -1
  21. package/dist/local-editor-tools.d.ts +1 -0
  22. package/dist/local-editor-tools.d.ts.map +1 -1
  23. package/dist/local-editor-tools.js +3 -0
  24. package/dist/local-editor-tools.js.map +1 -1
  25. package/dist/playable-local-editor-host.d.ts +4 -0
  26. package/dist/playable-local-editor-host.d.ts.map +1 -1
  27. package/dist/playable-local-editor-host.js +27 -0
  28. package/dist/playable-local-editor-host.js.map +1 -1
  29. package/dist/playable-product-scene-capabilities.d.ts.map +1 -1
  30. package/dist/playable-product-scene-capabilities.js +9 -3
  31. package/dist/playable-product-scene-capabilities.js.map +1 -1
  32. package/dist/playable-standard-project.d.ts.map +1 -1
  33. package/dist/playable-standard-project.js +5 -2
  34. package/dist/playable-standard-project.js.map +1 -1
  35. package/node_modules/@fps-games/babylon-renderer/package.json +7 -7
  36. package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js +24 -0
  37. package/node_modules/@fps-games/editor-babylon/dist/marker-overlay.js.map +1 -1
  38. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +10 -1
  39. package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
  40. package/node_modules/@fps-games/editor-babylon/dist/projection.js +96 -1
  41. package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
  42. package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.d.ts.map +1 -1
  43. package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.js +85 -22
  44. package/node_modules/@fps-games/editor-babylon/dist/scene-view-spatial-overlay-controller.js.map +1 -1
  45. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts +2 -0
  46. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.d.ts.map +1 -1
  47. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js +150 -4
  48. package/node_modules/@fps-games/editor-babylon/dist/selection-presentation-controller.js.map +1 -1
  49. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts +1 -0
  50. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.d.ts.map +1 -1
  51. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js +249 -15
  52. package/node_modules/@fps-games/editor-babylon/dist/transform-gizmo-controller.js.map +1 -1
  53. package/node_modules/@fps-games/editor-babylon/dist/types.d.ts +1 -1
  54. package/node_modules/@fps-games/editor-babylon/dist/types.d.ts.map +1 -1
  55. package/node_modules/@fps-games/editor-babylon/dist/types.js.map +1 -1
  56. package/node_modules/@fps-games/editor-babylon/package.json +6 -6
  57. package/node_modules/@fps-games/editor-browser/dist/index.d.ts +5 -0
  58. package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
  59. package/node_modules/@fps-games/editor-browser/dist/index.js +3 -0
  60. package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
  61. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.d.ts +35 -0
  62. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.d.ts.map +1 -0
  63. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.js +136 -0
  64. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-browser-continuity.js.map +1 -0
  65. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.d.ts +46 -0
  66. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.d.ts.map +1 -0
  67. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.js +283 -0
  68. package/node_modules/@fps-games/editor-browser/dist/local-editor-asset-filesystem.js.map +1 -0
  69. package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.d.ts +12 -0
  70. package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.d.ts.map +1 -0
  71. package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.js +67 -0
  72. package/node_modules/@fps-games/editor-browser/dist/local-editor-preview-cleanup-registry.js.map +1 -0
  73. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.d.ts +6 -0
  74. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.d.ts.map +1 -0
  75. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.js +9 -0
  76. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-open.js.map +1 -0
  77. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.d.ts +7 -0
  78. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.d.ts.map +1 -0
  79. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.js +20 -0
  80. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-file-preview.js.map +1 -0
  81. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.d.ts +9 -0
  82. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.d.ts.map +1 -0
  83. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.js +219 -0
  84. package/node_modules/@fps-games/editor-browser/dist/local-editor-project-media-thumbnail-cache.js.map +1 -0
  85. package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.d.ts +14 -0
  86. package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.d.ts.map +1 -0
  87. package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.js +42 -0
  88. package/node_modules/@fps-games/editor-browser/dist/local-editor-tool-presentation.js.map +1 -0
  89. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.d.ts.map +1 -1
  90. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js +2 -0
  91. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-asset-kind.js.map +1 -1
  92. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.d.ts +27 -0
  93. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.d.ts.map +1 -0
  94. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.js +288 -0
  95. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-console.js.map +1 -0
  96. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts +1 -1
  97. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.d.ts.map +1 -1
  98. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js +29 -0
  99. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-icons.js.map +1 -1
  100. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts +20 -1
  101. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.d.ts.map +1 -1
  102. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js +321 -60
  103. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-panels.js.map +1 -1
  104. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts +2 -1
  105. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -1
  106. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +4 -2
  107. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.map +1 -1
  108. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +63 -3
  109. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
  110. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.js.map +1 -1
  111. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts +9 -0
  112. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts.map +1 -1
  113. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js +88 -16
  114. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
  115. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +2 -1
  116. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
  117. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +1463 -356
  118. package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
  119. package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.d.ts +13 -0
  120. package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.d.ts.map +1 -0
  121. package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.js +15 -0
  122. package/node_modules/@fps-games/editor-browser/dist/local-editor-viewport-orientation.js.map +1 -0
  123. package/node_modules/@fps-games/editor-browser/package.json +7 -7
  124. package/node_modules/@fps-games/editor-core/dist/editor-tools.d.ts +1 -0
  125. package/node_modules/@fps-games/editor-core/dist/editor-tools.d.ts.map +1 -1
  126. package/node_modules/@fps-games/editor-core/dist/editor-tools.js +3 -1
  127. package/node_modules/@fps-games/editor-core/dist/editor-tools.js.map +1 -1
  128. package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts +11 -2
  129. package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts.map +1 -1
  130. package/node_modules/@fps-games/editor-core/dist/viewport-tools.js +12 -1
  131. package/node_modules/@fps-games/editor-core/dist/viewport-tools.js.map +1 -1
  132. package/node_modules/@fps-games/editor-core/package.json +6 -6
  133. package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
  134. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts +1 -0
  135. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.d.ts.map +1 -1
  136. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js +5 -0
  137. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/catalog.js.map +1 -1
  138. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.d.ts +1 -1
  139. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.d.ts.map +1 -1
  140. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.js +1 -1
  141. package/node_modules/@fps-games/editor-playable-sdk/dist/asset-library/index.js.map +1 -1
  142. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.d.ts.map +1 -1
  143. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.js +15 -1
  144. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/handler.js.map +1 -1
  145. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.d.ts.map +1 -1
  146. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.js +3 -0
  147. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/routes.js.map +1 -1
  148. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.d.ts +6 -1
  149. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.d.ts.map +1 -1
  150. package/node_modules/@fps-games/editor-playable-sdk/dist/authoring-server/types.js.map +1 -1
  151. package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +1 -0
  152. package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
  153. package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +1 -0
  154. package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
  155. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.d.ts +4 -0
  156. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.d.ts.map +1 -1
  157. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.js +10 -1
  158. package/node_modules/@fps-games/editor-playable-sdk/dist/product/scene-source.js.map +1 -1
  159. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.d.ts +4 -0
  160. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.d.ts.map +1 -0
  161. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.js +4 -0
  162. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/index.js.map +1 -0
  163. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.d.ts +4 -0
  164. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.d.ts.map +1 -0
  165. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.js +86 -0
  166. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/protocol.js.map +1 -0
  167. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.d.ts +9 -0
  168. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.d.ts.map +1 -0
  169. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.js +76 -0
  170. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/support.js.map +1 -0
  171. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.d.ts +34 -0
  172. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.d.ts.map +1 -0
  173. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.js +2 -0
  174. package/node_modules/@fps-games/editor-playable-sdk/dist/project-files/types.js.map +1 -0
  175. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts +4 -0
  176. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.d.ts.map +1 -1
  177. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js +40 -0
  178. package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/client.js.map +1 -1
  179. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +1 -0
  180. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
  181. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +1 -0
  182. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
  183. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts +1 -0
  184. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.d.ts.map +1 -1
  185. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js +94 -0
  186. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/product-authoring-api.js.map +1 -1
  187. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.d.ts +14 -0
  188. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.d.ts.map +1 -0
  189. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.js +101 -0
  190. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-file-handle.js.map +1 -0
  191. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.d.ts +23 -0
  192. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.d.ts.map +1 -0
  193. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.js +180 -0
  194. package/node_modules/@fps-games/editor-playable-sdk/dist/vite/project-files.js.map +1 -0
  195. package/node_modules/@fps-games/editor-playable-sdk/package.json +6 -6
  196. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts +23 -3
  197. package/node_modules/@fps-games/editor-protocol/dist/agent.d.ts.map +1 -1
  198. package/node_modules/@fps-games/editor-protocol/dist/agent.js.map +1 -1
  199. package/node_modules/@fps-games/editor-protocol/package.json +2 -2
  200. package/node_modules/@fps-games/editor-tooling/package.json +3 -3
  201. package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.d.ts.map +1 -1
  202. package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.js +103 -10
  203. package/node_modules/@fps-games/editor-ui/dist/editor-ui-theme.js.map +1 -1
  204. package/node_modules/@fps-games/editor-ui/package.json +1 -1
  205. package/node_modules/@fps-games/playable-assets/package.json +1 -1
  206. package/node_modules/@fps-games/playable-contracts/package.json +1 -1
  207. package/node_modules/@fps-games/playable-rendering/package.json +2 -2
  208. package/node_modules/@fps-games/playable-runtime/package.json +12 -12
  209. package/node_modules/@fps-games/playable-runtime-data/package.json +4 -4
  210. package/node_modules/@fps-games/playable-scene/package.json +2 -2
  211. package/node_modules/@fps-games/plugin-api/package.json +1 -1
  212. package/node_modules/@fps-games/plugin-assets/dist/version.d.ts +1 -1
  213. package/node_modules/@fps-games/plugin-assets/dist/version.js +1 -1
  214. package/node_modules/@fps-games/plugin-assets/dist/version.js.map +1 -1
  215. package/node_modules/@fps-games/plugin-assets/package.json +5 -5
  216. package/node_modules/@fps-games/plugin-hierarchy/dist/version.d.ts +1 -1
  217. package/node_modules/@fps-games/plugin-hierarchy/dist/version.js +1 -1
  218. package/node_modules/@fps-games/plugin-hierarchy/dist/version.js.map +1 -1
  219. package/node_modules/@fps-games/plugin-hierarchy/package.json +5 -5
  220. package/node_modules/@fps-games/plugin-host/package.json +2 -2
  221. package/node_modules/@fps-games/plugin-markers/dist/version.d.ts +1 -1
  222. package/node_modules/@fps-games/plugin-markers/dist/version.js +1 -1
  223. package/node_modules/@fps-games/plugin-markers/dist/version.js.map +1 -1
  224. package/node_modules/@fps-games/plugin-markers/package.json +5 -5
  225. package/node_modules/@fps-games/plugin-materials/dist/version.d.ts +1 -1
  226. package/node_modules/@fps-games/plugin-materials/dist/version.js +1 -1
  227. package/node_modules/@fps-games/plugin-materials/dist/version.js.map +1 -1
  228. package/node_modules/@fps-games/plugin-materials/package.json +5 -5
  229. package/node_modules/@fps-games/plugin-rendering/dist/version.d.ts +1 -1
  230. package/node_modules/@fps-games/plugin-rendering/dist/version.js +1 -1
  231. package/node_modules/@fps-games/plugin-rendering/dist/version.js.map +1 -1
  232. package/node_modules/@fps-games/plugin-rendering/package.json +5 -5
  233. package/node_modules/@fps-games/plugin-scene/dist/version.d.ts +1 -1
  234. package/node_modules/@fps-games/plugin-scene/dist/version.js +1 -1
  235. package/node_modules/@fps-games/plugin-scene/dist/version.js.map +1 -1
  236. package/node_modules/@fps-games/plugin-scene/package.json +5 -5
  237. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.d.ts +1 -1
  238. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js +1 -1
  239. package/node_modules/@fps-games/plugin-shadow-map-experiment/dist/version.js.map +1 -1
  240. package/node_modules/@fps-games/plugin-shadow-map-experiment/package.json +5 -5
  241. package/node_modules/@fps-games/plugin-shadows/dist/version.d.ts +1 -1
  242. package/node_modules/@fps-games/plugin-shadows/dist/version.js +1 -1
  243. package/node_modules/@fps-games/plugin-shadows/dist/version.js.map +1 -1
  244. package/node_modules/@fps-games/plugin-shadows/package.json +7 -7
  245. package/package.json +22 -22
@@ -0,0 +1,283 @@
1
+ import { resolveLocalEditorAssetBrowserTab, resolveLocalEditorBrowserAssetKind, } from './local-editor-ui-asset-kind.js';
2
+ import { resolveEditorProjectMediaSupport } from '@fps-games/editor-playable-sdk';
3
+ const EDITOR_ASSETS_PATH = '/@editor';
4
+ const EDITOR_PREFABS_PATH = `${EDITOR_ASSETS_PATH}/prefabs`;
5
+ const EDITOR_MATERIALS_PATH = `${EDITOR_ASSETS_PATH}/materials`;
6
+ const EDITOR_UNLINKED_PATH = `${EDITOR_ASSETS_PATH}/unlinked`;
7
+ export function createLocalEditorAssetFilesystemSnapshot(assets, projectFiles) {
8
+ const folders = new Map();
9
+ const entries = [];
10
+ const assetFolderPaths = new Map();
11
+ const linkedAssetIds = new Set();
12
+ folders.set('/', createFolder('/', null, projectFiles?.rootName ?? 'Project', 0, false));
13
+ for (const item of projectFiles?.entries ?? []) {
14
+ const itemPath = toBrowserPath(item.path);
15
+ const parentPath = toBrowserPath(item.parentPath ?? '');
16
+ if (item.kind === 'directory') {
17
+ ensureFolderPath(folders, itemPath, false);
18
+ entries.push({
19
+ id: `project-directory:${item.path}`,
20
+ path: itemPath,
21
+ parentPath,
22
+ label: item.name,
23
+ kind: 'directory',
24
+ virtual: false,
25
+ });
26
+ continue;
27
+ }
28
+ const asset = resolveProjectFileAsset(item.path, assets, linkedAssetIds);
29
+ if (asset) {
30
+ linkedAssetIds.add(asset.id);
31
+ assetFolderPaths.set(asset.id, parentPath);
32
+ }
33
+ entries.push({
34
+ id: asset?.id ?? `project-file:${item.path}`,
35
+ path: itemPath,
36
+ parentPath,
37
+ label: item.name,
38
+ kind: 'file',
39
+ ...(item.extension ? { extension: item.extension } : {}),
40
+ ...(asset ? { asset } : {}),
41
+ virtual: false,
42
+ });
43
+ }
44
+ const unlinkedAssets = assets.filter(asset => !linkedAssetIds.has(asset.id));
45
+ if (unlinkedAssets.length > 0) {
46
+ ensureVirtualEditorFolders(folders, entries, unlinkedAssets);
47
+ for (const asset of unlinkedAssets) {
48
+ const kind = resolveLocalEditorBrowserAssetKind(asset);
49
+ const parentPath = kind === 'prefab'
50
+ ? EDITOR_PREFABS_PATH
51
+ : kind === 'material'
52
+ ? EDITOR_MATERIALS_PATH
53
+ : EDITOR_UNLINKED_PATH;
54
+ assetFolderPaths.set(asset.id, parentPath);
55
+ entries.push({
56
+ id: asset.id,
57
+ path: `${parentPath}/${encodeURIComponent(asset.id)}`,
58
+ parentPath,
59
+ label: asset.label,
60
+ kind: 'asset',
61
+ asset,
62
+ virtual: true,
63
+ });
64
+ }
65
+ }
66
+ const orderedFolders = [...folders.values()].sort(compareFolders);
67
+ const orderedEntries = entries.sort(compareEntries);
68
+ for (const folder of orderedFolders) {
69
+ folder.descendantItemCount = orderedEntries.reduce((count, entry) => (entry.kind !== 'directory' && isPathWithin(entry.parentPath, folder.path) ? count + 1 : count), 0);
70
+ }
71
+ return {
72
+ rootPath: '/',
73
+ rootName: projectFiles?.rootName ?? 'Project',
74
+ folders: orderedFolders,
75
+ entries: orderedEntries,
76
+ assetFolderPaths,
77
+ truncated: projectFiles?.truncated === true,
78
+ };
79
+ }
80
+ export function filterLocalEditorAssetFilesystemEntries(snapshot, folderPath, recursive, tab = 'all') {
81
+ const selectedPath = resolveLocalEditorAssetFilesystemExistingFolderPath(snapshot, folderPath);
82
+ return snapshot.entries.filter((entry) => {
83
+ const inFolder = recursive
84
+ ? isPathWithin(entry.parentPath, selectedPath)
85
+ : entry.parentPath === selectedPath;
86
+ if (!inFolder)
87
+ return false;
88
+ if (tab === 'all')
89
+ return true;
90
+ if (entry.kind === 'directory')
91
+ return false;
92
+ return resolveLocalEditorAssetFilesystemEntryTab(entry) === tab;
93
+ });
94
+ }
95
+ export function resolveLocalEditorAssetFilesystemExistingFolderPath(snapshot, requestedFolderPath) {
96
+ return snapshot.folders.some(folder => folder.path === requestedFolderPath)
97
+ ? requestedFolderPath
98
+ : snapshot.rootPath;
99
+ }
100
+ export function resolveLocalEditorProjectMediaThumbnailKind(entry) {
101
+ if (entry.kind !== 'file')
102
+ return null;
103
+ const kind = resolveEditorProjectMediaSupport(entry.path)?.kind;
104
+ return kind === 'image' || kind === 'model' ? kind : null;
105
+ }
106
+ export function resolveLocalEditorProjectMediaThumbnailCacheKey(entry) {
107
+ if (resolveLocalEditorProjectMediaThumbnailKind(entry) !== 'model')
108
+ return null;
109
+ const contentHash = entry.asset?.contentHash?.trim();
110
+ return contentHash
111
+ ? `model:content:${contentHash}`
112
+ : `model:path:${entry.path}`;
113
+ }
114
+ export function filterLocalEditorAssetFilesystemAssets(snapshot, assets, folderPath, recursive) {
115
+ const selectedPath = resolveLocalEditorAssetFilesystemExistingFolderPath(snapshot, folderPath);
116
+ return assets.filter((asset) => {
117
+ const assetPath = snapshot.assetFolderPaths.get(asset.id);
118
+ if (!assetPath)
119
+ return false;
120
+ return recursive ? isPathWithin(assetPath, selectedPath) : assetPath === selectedPath;
121
+ });
122
+ }
123
+ export function resolveLocalEditorAssetFilesystemVisibleFolders(snapshot, expandedFolderPaths) {
124
+ const folderByPath = new Map(snapshot.folders.map(folder => [folder.path, folder]));
125
+ return snapshot.folders.filter((folder) => {
126
+ if (folder.path === '/')
127
+ return true;
128
+ let parentPath = folder.parentPath;
129
+ while (parentPath) {
130
+ if (!expandedFolderPaths.has(parentPath))
131
+ return false;
132
+ parentPath = folderByPath.get(parentPath)?.parentPath ?? null;
133
+ }
134
+ return true;
135
+ });
136
+ }
137
+ export function resolveLocalEditorAssetFilesystemEntryTab(entry) {
138
+ if (entry.asset)
139
+ return resolveLocalEditorAssetBrowserTab(entry.asset);
140
+ const extension = entry.extension?.toLowerCase() ?? '';
141
+ if (/^(glb|gltf|fbx|obj|dae|3ds)$/.test(extension))
142
+ return 'models';
143
+ if (/^(png|jpe?g|webp|gif|bmp|ktx2?|dds|hdr|exr)$/.test(extension))
144
+ return 'textures';
145
+ if (/^(mp3|wav|ogg|m4a|aac|flac)$/.test(extension))
146
+ return 'audio';
147
+ return null;
148
+ }
149
+ export function resolveLocalEditorAssetFilesystemFolderPath(snapshot, assetId) {
150
+ return snapshot.assetFolderPaths.get(assetId) ?? '/';
151
+ }
152
+ export function resolveLocalEditorAssetFilesystemParentPath(snapshot, folderPath) {
153
+ return snapshot.folders.find(folder => folder.path === folderPath)?.parentPath ?? null;
154
+ }
155
+ export function resolveLocalEditorAssetFilesystemBreadcrumbs(snapshot, folderPath) {
156
+ const folderByPath = new Map(snapshot.folders.map(folder => [folder.path, folder]));
157
+ const selectedFolder = folderByPath.get(folderPath) ?? folderByPath.get('/');
158
+ const breadcrumbs = [];
159
+ const visitedPaths = new Set();
160
+ let current = selectedFolder;
161
+ while (current && !visitedPaths.has(current.path)) {
162
+ visitedPaths.add(current.path);
163
+ breadcrumbs.unshift({
164
+ label: current.path === '/' ? snapshot.rootName : current.label,
165
+ path: current.path,
166
+ });
167
+ current = current.parentPath ? folderByPath.get(current.parentPath) : undefined;
168
+ }
169
+ return breadcrumbs;
170
+ }
171
+ function ensureVirtualEditorFolders(folders, entries, assets) {
172
+ addVirtualFolder(folders, entries, EDITOR_ASSETS_PATH, '/', 'Editor Assets');
173
+ if (assets.some(asset => resolveLocalEditorBrowserAssetKind(asset) === 'prefab')) {
174
+ addVirtualFolder(folders, entries, EDITOR_PREFABS_PATH, EDITOR_ASSETS_PATH, 'Prefabs');
175
+ }
176
+ if (assets.some(asset => resolveLocalEditorBrowserAssetKind(asset) === 'material')) {
177
+ addVirtualFolder(folders, entries, EDITOR_MATERIALS_PATH, EDITOR_ASSETS_PATH, 'Materials');
178
+ }
179
+ if (assets.some((asset) => {
180
+ const kind = resolveLocalEditorBrowserAssetKind(asset);
181
+ return kind !== 'prefab' && kind !== 'material';
182
+ })) {
183
+ addVirtualFolder(folders, entries, EDITOR_UNLINKED_PATH, EDITOR_ASSETS_PATH, 'Unlinked Assets');
184
+ }
185
+ }
186
+ function addVirtualFolder(folders, entries, path, parentPath, label) {
187
+ if (folders.has(path))
188
+ return;
189
+ folders.set(path, createFolder(path, parentPath, label, path.split('/').filter(Boolean).length, true));
190
+ entries.push({
191
+ id: `virtual-directory:${path}`,
192
+ path,
193
+ parentPath,
194
+ label,
195
+ kind: 'directory',
196
+ virtual: true,
197
+ });
198
+ }
199
+ function resolveProjectFileAsset(filePath, assets, linkedAssetIds) {
200
+ const normalizedFilePath = normalizeMatchPath(filePath);
201
+ const matches = assets.flatMap((asset) => {
202
+ if (linkedAssetIds.has(asset.id))
203
+ return [];
204
+ const sourcePaths = [asset.relativePath, asset.external?.assetPath, asset.external?.assetUrl]
205
+ .filter((value) => typeof value === 'string' && value.trim().length > 0)
206
+ .map(normalizeMatchPath)
207
+ .filter(Boolean);
208
+ const score = sourcePaths.reduce((best, sourcePath) => {
209
+ if (normalizedFilePath === sourcePath)
210
+ return Math.max(best, 10000 + sourcePath.length);
211
+ if (normalizedFilePath.endsWith(`/${sourcePath}`))
212
+ return Math.max(best, 1000 + sourcePath.length);
213
+ const trimmed = trimLeadingParentSegments(sourcePath);
214
+ if (trimmed && normalizedFilePath.endsWith(`/${trimmed}`))
215
+ return Math.max(best, 100 + trimmed.length);
216
+ return best;
217
+ }, 0);
218
+ return score > 0 ? [{ asset, score }] : [];
219
+ }).sort((a, b) => b.score - a.score || a.asset.id.localeCompare(b.asset.id));
220
+ return matches.length === 1 || matches[0]?.score !== matches[1]?.score
221
+ ? matches[0]?.asset
222
+ : undefined;
223
+ }
224
+ function normalizeMatchPath(value) {
225
+ return value
226
+ .replace(/^[a-z]+:\/\/[^/]+/i, '')
227
+ .replace(/\\/g, '/')
228
+ .split(/[?#]/, 1)[0]
229
+ .replace(/^\/+/, '')
230
+ .replace(/\/\.\//g, '/')
231
+ .toLowerCase();
232
+ }
233
+ function trimLeadingParentSegments(value) {
234
+ return value.replace(/^(?:\.\.\/)+/, '');
235
+ }
236
+ function toBrowserPath(value) {
237
+ const normalized = value.replace(/\\/g, '/').split('/').filter(Boolean).join('/');
238
+ return normalized ? `/${normalized}` : '/';
239
+ }
240
+ function ensureFolderPath(folders, path, virtual) {
241
+ const segments = path.split('/').filter(Boolean);
242
+ let currentPath = '';
243
+ for (let index = 0; index < segments.length; index += 1) {
244
+ const segment = segments[index];
245
+ const parentPath = currentPath || '/';
246
+ currentPath = `${currentPath}/${segment}`;
247
+ if (folders.has(currentPath))
248
+ continue;
249
+ folders.set(currentPath, createFolder(currentPath, parentPath, segment, index + 1, virtual));
250
+ }
251
+ }
252
+ function createFolder(path, parentPath, label, depth, virtual) {
253
+ return {
254
+ id: `asset-folder:${path}`,
255
+ path,
256
+ parentPath,
257
+ label,
258
+ depth,
259
+ descendantItemCount: 0,
260
+ virtual,
261
+ };
262
+ }
263
+ function isPathWithin(path, parentPath) {
264
+ return parentPath === '/' || path === parentPath || path.startsWith(`${parentPath}/`);
265
+ }
266
+ function compareFolders(a, b) {
267
+ if (a.path === '/')
268
+ return -1;
269
+ if (b.path === '/')
270
+ return 1;
271
+ if (a.virtual !== b.virtual)
272
+ return Number(a.virtual) - Number(b.virtual);
273
+ if (a.depth !== b.depth && (isPathWithin(b.path, a.path) || isPathWithin(a.path, b.path))) {
274
+ return a.depth - b.depth;
275
+ }
276
+ return a.path.localeCompare(b.path, undefined, { numeric: true, sensitivity: 'base' });
277
+ }
278
+ function compareEntries(a, b) {
279
+ return a.parentPath.localeCompare(b.parentPath, undefined, { numeric: true, sensitivity: 'base' })
280
+ || Number(b.kind === 'directory') - Number(a.kind === 'directory')
281
+ || a.label.localeCompare(b.label, undefined, { numeric: true, sensitivity: 'base' });
282
+ }
283
+ //# sourceMappingURL=local-editor-asset-filesystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-asset-filesystem.js","sourceRoot":"","sources":["../src/local-editor-asset-filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AA8ClF,MAAM,kBAAkB,GAAG,UAAU,CAAC;AACtC,MAAM,mBAAmB,GAAG,GAAG,kBAAkB,UAAU,CAAC;AAC5D,MAAM,qBAAqB,GAAG,GAAG,kBAAkB,YAAY,CAAC;AAChE,MAAM,oBAAoB,GAAG,GAAG,kBAAkB,WAAW,CAAC;AAE9D,MAAM,UAAU,wCAAw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AI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,cAAc,CAAC,CAAkC,EAAE,CAAkC;IAC5F,OAAO,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;WAC7F,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC;WAC/D,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import {\n resolveLocalEditorAssetBrowserTab,\n resolveLocalEditorBrowserAssetKind,\n} from './local-editor-ui-asset-kind';\nimport { resolveEditorProjectMediaSupport } from '@fps-games/editor-playable-sdk';\nimport type {\n LocalEditorAssetBrowserTab,\n LocalEditorBrowserProjectFileSnapshot,\n LocalEditorBrowserUiAssetItem,\n} from './local-editor-ui-types';\n\nexport type LocalEditorAssetFilesystemViewMode = 'grid' | 'list';\n\nexport interface LocalEditorAssetFilesystemFolder {\n id: string;\n path: string;\n parentPath: string | null;\n label: string;\n depth: number;\n descendantItemCount: number;\n virtual: boolean;\n}\n\nexport interface LocalEditorAssetFilesystemEntry {\n id: string;\n path: string;\n parentPath: string;\n label: string;\n kind: 'directory' | 'file' | 'asset';\n extension?: string;\n asset?: LocalEditorBrowserUiAssetItem;\n virtual: boolean;\n}\n\nexport interface LocalEditorAssetFilesystemSnapshot {\n rootPath: '/';\n rootName: string;\n folders: LocalEditorAssetFilesystemFolder[];\n entries: LocalEditorAssetFilesystemEntry[];\n assetFolderPaths: ReadonlyMap<string, string>;\n truncated: boolean;\n}\n\nexport type LocalEditorProjectMediaThumbnailKind = 'image' | 'model';\n\nexport interface LocalEditorAssetFilesystemBreadcrumb {\n label: string;\n path: string;\n}\n\nconst EDITOR_ASSETS_PATH = '/@editor';\nconst EDITOR_PREFABS_PATH = `${EDITOR_ASSETS_PATH}/prefabs`;\nconst EDITOR_MATERIALS_PATH = `${EDITOR_ASSETS_PATH}/materials`;\nconst EDITOR_UNLINKED_PATH = `${EDITOR_ASSETS_PATH}/unlinked`;\n\nexport function createLocalEditorAssetFilesystemSnapshot(\n assets: readonly LocalEditorBrowserUiAssetItem[],\n projectFiles?: LocalEditorBrowserProjectFileSnapshot | null,\n): LocalEditorAssetFilesystemSnapshot {\n const folders = new Map<string, LocalEditorAssetFilesystemFolder>();\n const entries: LocalEditorAssetFilesystemEntry[] = [];\n const assetFolderPaths = new Map<string, string>();\n const linkedAssetIds = new Set<string>();\n folders.set('/', createFolder('/', null, projectFiles?.rootName ?? 'Project', 0, false));\n\n for (const item of projectFiles?.entries ?? []) {\n const itemPath = toBrowserPath(item.path);\n const parentPath = toBrowserPath(item.parentPath ?? '');\n if (item.kind === 'directory') {\n ensureFolderPath(folders, itemPath, false);\n entries.push({\n id: `project-directory:${item.path}`,\n path: itemPath,\n parentPath,\n label: item.name,\n kind: 'directory',\n virtual: false,\n });\n continue;\n }\n const asset = resolveProjectFileAsset(item.path, assets, linkedAssetIds);\n if (asset) {\n linkedAssetIds.add(asset.id);\n assetFolderPaths.set(asset.id, parentPath);\n }\n entries.push({\n id: asset?.id ?? `project-file:${item.path}`,\n path: itemPath,\n parentPath,\n label: item.name,\n kind: 'file',\n ...(item.extension ? { extension: item.extension } : {}),\n ...(asset ? { asset } : {}),\n virtual: false,\n });\n }\n\n const unlinkedAssets = assets.filter(asset => !linkedAssetIds.has(asset.id));\n if (unlinkedAssets.length > 0) {\n ensureVirtualEditorFolders(folders, entries, unlinkedAssets);\n for (const asset of unlinkedAssets) {\n const kind = resolveLocalEditorBrowserAssetKind(asset);\n const parentPath = kind === 'prefab'\n ? EDITOR_PREFABS_PATH\n : kind === 'material'\n ? EDITOR_MATERIALS_PATH\n : EDITOR_UNLINKED_PATH;\n assetFolderPaths.set(asset.id, parentPath);\n entries.push({\n id: asset.id,\n path: `${parentPath}/${encodeURIComponent(asset.id)}`,\n parentPath,\n label: asset.label,\n kind: 'asset',\n asset,\n virtual: true,\n });\n }\n }\n\n const orderedFolders = [...folders.values()].sort(compareFolders);\n const orderedEntries = entries.sort(compareEntries);\n for (const folder of orderedFolders) {\n folder.descendantItemCount = orderedEntries.reduce((count, entry) => (\n entry.kind !== 'directory' && isPathWithin(entry.parentPath, folder.path) ? count + 1 : count\n ), 0);\n }\n return {\n rootPath: '/',\n rootName: projectFiles?.rootName ?? 'Project',\n folders: orderedFolders,\n entries: orderedEntries,\n assetFolderPaths,\n truncated: projectFiles?.truncated === true,\n };\n}\n\nexport function filterLocalEditorAssetFilesystemEntries(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n folderPath: string,\n recursive: boolean,\n tab: LocalEditorAssetBrowserTab = 'all',\n): LocalEditorAssetFilesystemEntry[] {\n const selectedPath = resolveLocalEditorAssetFilesystemExistingFolderPath(snapshot, folderPath);\n return snapshot.entries.filter((entry) => {\n const inFolder = recursive\n ? isPathWithin(entry.parentPath, selectedPath)\n : entry.parentPath === selectedPath;\n if (!inFolder) return false;\n if (tab === 'all') return true;\n if (entry.kind === 'directory') return false;\n return resolveLocalEditorAssetFilesystemEntryTab(entry) === tab;\n });\n}\n\nexport function resolveLocalEditorAssetFilesystemExistingFolderPath(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n requestedFolderPath: string,\n): string {\n return snapshot.folders.some(folder => folder.path === requestedFolderPath)\n ? requestedFolderPath\n : snapshot.rootPath;\n}\n\nexport function resolveLocalEditorProjectMediaThumbnailKind(\n entry: LocalEditorAssetFilesystemEntry,\n): LocalEditorProjectMediaThumbnailKind | null {\n if (entry.kind !== 'file') return null;\n const kind = resolveEditorProjectMediaSupport(entry.path)?.kind;\n return kind === 'image' || kind === 'model' ? kind : null;\n}\n\nexport function resolveLocalEditorProjectMediaThumbnailCacheKey(\n entry: LocalEditorAssetFilesystemEntry,\n): string | null {\n if (resolveLocalEditorProjectMediaThumbnailKind(entry) !== 'model') return null;\n const contentHash = entry.asset?.contentHash?.trim();\n return contentHash\n ? `model:content:${contentHash}`\n : `model:path:${entry.path}`;\n}\n\nexport function filterLocalEditorAssetFilesystemAssets(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n assets: readonly LocalEditorBrowserUiAssetItem[],\n folderPath: string,\n recursive: boolean,\n): LocalEditorBrowserUiAssetItem[] {\n const selectedPath = resolveLocalEditorAssetFilesystemExistingFolderPath(snapshot, folderPath);\n return assets.filter((asset) => {\n const assetPath = snapshot.assetFolderPaths.get(asset.id);\n if (!assetPath) return false;\n return recursive ? isPathWithin(assetPath, selectedPath) : assetPath === selectedPath;\n });\n}\n\nexport function resolveLocalEditorAssetFilesystemVisibleFolders(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n expandedFolderPaths: ReadonlySet<string>,\n): LocalEditorAssetFilesystemFolder[] {\n const folderByPath = new Map(snapshot.folders.map(folder => [folder.path, folder]));\n return snapshot.folders.filter((folder) => {\n if (folder.path === '/') return true;\n let parentPath = folder.parentPath;\n while (parentPath) {\n if (!expandedFolderPaths.has(parentPath)) return false;\n parentPath = folderByPath.get(parentPath)?.parentPath ?? null;\n }\n return true;\n });\n}\n\nexport function resolveLocalEditorAssetFilesystemEntryTab(\n entry: LocalEditorAssetFilesystemEntry,\n): Exclude<LocalEditorAssetBrowserTab, 'all'> | null {\n if (entry.asset) return resolveLocalEditorAssetBrowserTab(entry.asset);\n const extension = entry.extension?.toLowerCase() ?? '';\n if (/^(glb|gltf|fbx|obj|dae|3ds)$/.test(extension)) return 'models';\n if (/^(png|jpe?g|webp|gif|bmp|ktx2?|dds|hdr|exr)$/.test(extension)) return 'textures';\n if (/^(mp3|wav|ogg|m4a|aac|flac)$/.test(extension)) return 'audio';\n return null;\n}\n\nexport function resolveLocalEditorAssetFilesystemFolderPath(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n assetId: string,\n): string {\n return snapshot.assetFolderPaths.get(assetId) ?? '/';\n}\n\nexport function resolveLocalEditorAssetFilesystemParentPath(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n folderPath: string,\n): string | null {\n return snapshot.folders.find(folder => folder.path === folderPath)?.parentPath ?? null;\n}\n\nexport function resolveLocalEditorAssetFilesystemBreadcrumbs(\n snapshot: LocalEditorAssetFilesystemSnapshot,\n folderPath: string,\n): LocalEditorAssetFilesystemBreadcrumb[] {\n const folderByPath = new Map(snapshot.folders.map(folder => [folder.path, folder]));\n const selectedFolder = folderByPath.get(folderPath) ?? folderByPath.get('/');\n const breadcrumbs: LocalEditorAssetFilesystemBreadcrumb[] = [];\n const visitedPaths = new Set<string>();\n let current = selectedFolder;\n while (current && !visitedPaths.has(current.path)) {\n visitedPaths.add(current.path);\n breadcrumbs.unshift({\n label: current.path === '/' ? snapshot.rootName : current.label,\n path: current.path,\n });\n current = current.parentPath ? folderByPath.get(current.parentPath) : undefined;\n }\n return breadcrumbs;\n}\n\nfunction ensureVirtualEditorFolders(\n folders: Map<string, LocalEditorAssetFilesystemFolder>,\n entries: LocalEditorAssetFilesystemEntry[],\n assets: readonly LocalEditorBrowserUiAssetItem[],\n): void {\n addVirtualFolder(folders, entries, EDITOR_ASSETS_PATH, '/', 'Editor Assets');\n if (assets.some(asset => resolveLocalEditorBrowserAssetKind(asset) === 'prefab')) {\n addVirtualFolder(folders, entries, EDITOR_PREFABS_PATH, EDITOR_ASSETS_PATH, 'Prefabs');\n }\n if (assets.some(asset => resolveLocalEditorBrowserAssetKind(asset) === 'material')) {\n addVirtualFolder(folders, entries, EDITOR_MATERIALS_PATH, EDITOR_ASSETS_PATH, 'Materials');\n }\n if (assets.some((asset) => {\n const kind = resolveLocalEditorBrowserAssetKind(asset);\n return kind !== 'prefab' && kind !== 'material';\n })) {\n addVirtualFolder(folders, entries, EDITOR_UNLINKED_PATH, EDITOR_ASSETS_PATH, 'Unlinked Assets');\n }\n}\n\nfunction addVirtualFolder(\n folders: Map<string, LocalEditorAssetFilesystemFolder>,\n entries: LocalEditorAssetFilesystemEntry[],\n path: string,\n parentPath: string,\n label: string,\n): void {\n if (folders.has(path)) return;\n folders.set(path, createFolder(path, parentPath, label, path.split('/').filter(Boolean).length, true));\n entries.push({\n id: `virtual-directory:${path}`,\n path,\n parentPath,\n label,\n kind: 'directory',\n virtual: true,\n });\n}\n\nfunction resolveProjectFileAsset(\n filePath: string,\n assets: readonly LocalEditorBrowserUiAssetItem[],\n linkedAssetIds: ReadonlySet<string>,\n): LocalEditorBrowserUiAssetItem | undefined {\n const normalizedFilePath = normalizeMatchPath(filePath);\n const matches = assets.flatMap((asset) => {\n if (linkedAssetIds.has(asset.id)) return [];\n const sourcePaths = [asset.relativePath, asset.external?.assetPath, asset.external?.assetUrl]\n .filter((value): value is string => typeof value === 'string' && value.trim().length > 0)\n .map(normalizeMatchPath)\n .filter(Boolean);\n const score = sourcePaths.reduce((best, sourcePath) => {\n if (normalizedFilePath === sourcePath) return Math.max(best, 10_000 + sourcePath.length);\n if (normalizedFilePath.endsWith(`/${sourcePath}`)) return Math.max(best, 1_000 + sourcePath.length);\n const trimmed = trimLeadingParentSegments(sourcePath);\n if (trimmed && normalizedFilePath.endsWith(`/${trimmed}`)) return Math.max(best, 100 + trimmed.length);\n return best;\n }, 0);\n return score > 0 ? [{ asset, score }] : [];\n }).sort((a, b) => b.score - a.score || a.asset.id.localeCompare(b.asset.id));\n return matches.length === 1 || matches[0]?.score !== matches[1]?.score\n ? matches[0]?.asset\n : undefined;\n}\n\nfunction normalizeMatchPath(value: string): string {\n return value\n .replace(/^[a-z]+:\\/\\/[^/]+/i, '')\n .replace(/\\\\/g, '/')\n .split(/[?#]/, 1)[0]\n .replace(/^\\/+/, '')\n .replace(/\\/\\.\\//g, '/')\n .toLowerCase();\n}\n\nfunction trimLeadingParentSegments(value: string): string {\n return value.replace(/^(?:\\.\\.\\/)+/, '');\n}\n\nfunction toBrowserPath(value: string): string {\n const normalized = value.replace(/\\\\/g, '/').split('/').filter(Boolean).join('/');\n return normalized ? `/${normalized}` : '/';\n}\n\nfunction ensureFolderPath(\n folders: Map<string, LocalEditorAssetFilesystemFolder>,\n path: string,\n virtual: boolean,\n): void {\n const segments = path.split('/').filter(Boolean);\n let currentPath = '';\n for (let index = 0; index < segments.length; index += 1) {\n const segment = segments[index];\n const parentPath = currentPath || '/';\n currentPath = `${currentPath}/${segment}`;\n if (folders.has(currentPath)) continue;\n folders.set(currentPath, createFolder(\n currentPath,\n parentPath,\n segment,\n index + 1,\n virtual,\n ));\n }\n}\n\nfunction createFolder(\n path: string,\n parentPath: string | null,\n label: string,\n depth: number,\n virtual: boolean,\n): LocalEditorAssetFilesystemFolder {\n return {\n id: `asset-folder:${path}`,\n path,\n parentPath,\n label,\n depth,\n descendantItemCount: 0,\n virtual,\n };\n}\n\nfunction isPathWithin(path: string, parentPath: string): boolean {\n return parentPath === '/' || path === parentPath || path.startsWith(`${parentPath}/`);\n}\n\nfunction compareFolders(a: LocalEditorAssetFilesystemFolder, b: LocalEditorAssetFilesystemFolder): number {\n if (a.path === '/') return -1;\n if (b.path === '/') return 1;\n if (a.virtual !== b.virtual) return Number(a.virtual) - Number(b.virtual);\n if (a.depth !== b.depth && (isPathWithin(b.path, a.path) || isPathWithin(a.path, b.path))) {\n return a.depth - b.depth;\n }\n return a.path.localeCompare(b.path, undefined, { numeric: true, sensitivity: 'base' });\n}\n\nfunction compareEntries(a: LocalEditorAssetFilesystemEntry, b: LocalEditorAssetFilesystemEntry): number {\n return a.parentPath.localeCompare(b.parentPath, undefined, { numeric: true, sensitivity: 'base' })\n || Number(b.kind === 'directory') - Number(a.kind === 'directory')\n || a.label.localeCompare(b.label, undefined, { numeric: true, sensitivity: 'base' });\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export type LocalEditorPreviewCleanup = () => void | Promise<void>;
2
+ export interface LocalEditorPreviewCleanupRegistry {
3
+ own(cleanup: LocalEditorPreviewCleanup): void;
4
+ disposeOwned(cleanup?: LocalEditorPreviewCleanup | null): void;
5
+ hasOwned(): boolean;
6
+ takeFailures(): unknown[];
7
+ }
8
+ export declare function canSkipLocalEditorPreviewCleanupPass(uiDisposed: boolean, registries: readonly Pick<LocalEditorPreviewCleanupRegistry, 'hasOwned'>[]): boolean;
9
+ export declare function createLocalEditorPreviewCleanupRegistry(options?: {
10
+ onTerminalFailure?: (error: unknown) => void;
11
+ }): LocalEditorPreviewCleanupRegistry;
12
+ //# sourceMappingURL=local-editor-preview-cleanup-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-preview-cleanup-registry.d.ts","sourceRoot":"","sources":["../src/local-editor-preview-cleanup-registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnE,MAAM,WAAW,iCAAiC;IAChD,GAAG,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC9C,YAAY,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/D,QAAQ,IAAI,OAAO,CAAC;IACpB,YAAY,IAAI,OAAO,EAAE,CAAC;CAC3B;AAED,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,OAAO,EACnB,UAAU,EAAE,SAAS,IAAI,CAAC,iCAAiC,EAAE,UAAU,CAAC,EAAE,GACzE,OAAO,CAET;AAED,wBAAgB,uCAAuC,CAAC,OAAO,GAAE;IAC/D,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,GAAG,iCAAiC,CAyDzC"}
@@ -0,0 +1,67 @@
1
+ export function canSkipLocalEditorPreviewCleanupPass(uiDisposed, registries) {
2
+ return uiDisposed && registries.every(registry => !registry.hasOwned());
3
+ }
4
+ export function createLocalEditorPreviewCleanupRegistry(options = {}) {
5
+ const owned = new Set();
6
+ const inFlight = new Set();
7
+ const failures = [];
8
+ const recordTerminalFailure = (error) => {
9
+ failures.push(error);
10
+ options.onTerminalFailure?.(error);
11
+ };
12
+ const invoke = (cleanup, retriesRemaining = 1) => {
13
+ if (inFlight.has(cleanup))
14
+ return;
15
+ inFlight.add(cleanup);
16
+ let result;
17
+ try {
18
+ result = cleanup();
19
+ }
20
+ catch (error) {
21
+ inFlight.delete(cleanup);
22
+ if (retriesRemaining > 0 && owned.has(cleanup))
23
+ invoke(cleanup, retriesRemaining - 1);
24
+ else
25
+ recordTerminalFailure(error);
26
+ return;
27
+ }
28
+ if (!result || typeof result.then !== 'function') {
29
+ owned.delete(cleanup);
30
+ inFlight.delete(cleanup);
31
+ return;
32
+ }
33
+ void Promise.resolve(result).then(() => {
34
+ owned.delete(cleanup);
35
+ inFlight.delete(cleanup);
36
+ }, (error) => {
37
+ inFlight.delete(cleanup);
38
+ if (retriesRemaining > 0) {
39
+ queueMicrotask(() => {
40
+ if (owned.has(cleanup))
41
+ invoke(cleanup, retriesRemaining - 1);
42
+ });
43
+ }
44
+ else {
45
+ recordTerminalFailure(error);
46
+ }
47
+ });
48
+ };
49
+ return {
50
+ own(cleanup) {
51
+ owned.add(cleanup);
52
+ },
53
+ disposeOwned(cleanup) {
54
+ if (cleanup)
55
+ owned.add(cleanup);
56
+ for (const ownedCleanup of owned)
57
+ invoke(ownedCleanup);
58
+ },
59
+ hasOwned() {
60
+ return owned.size > 0;
61
+ },
62
+ takeFailures() {
63
+ return failures.splice(0, failures.length);
64
+ },
65
+ };
66
+ }
67
+ //# sourceMappingURL=local-editor-preview-cleanup-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-preview-cleanup-registry.js","sourceRoot":"","sources":["../src/local-editor-preview-cleanup-registry.ts"],"names":[],"mappings":"AASA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AAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QACD,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YACrC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACtB,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE;YACX,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACzB,IAAI,gBAAgB,GAAG,CAAC,EAAE,CAAC;gBACzB,cAAc,CAAC,GAAG,EAAE;oBAClB,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;wBAAE,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,CAAC,CAAC,CAAC;gBAChE,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,qBAAqB,CAAC,KAAK,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,GAAG,CAAC,OAAO;YACT,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;QACD,YAAY,CAAC,OAAO;YAClB,IAAI,OAAO;gBAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAChC,KAAK,MAAM,YAAY,IAAI,KAAK;gBAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QACzD,CAAC;QACD,QAAQ;YACN,OAAO,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,YAAY;YACV,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["export type LocalEditorPreviewCleanup = () => void | Promise<void>;\n\nexport interface LocalEditorPreviewCleanupRegistry {\n own(cleanup: LocalEditorPreviewCleanup): void;\n disposeOwned(cleanup?: LocalEditorPreviewCleanup | null): void;\n hasOwned(): boolean;\n takeFailures(): unknown[];\n}\n\nexport function canSkipLocalEditorPreviewCleanupPass(\n uiDisposed: boolean,\n registries: readonly Pick<LocalEditorPreviewCleanupRegistry, 'hasOwned'>[],\n): boolean {\n return uiDisposed && registries.every(registry => !registry.hasOwned());\n}\n\nexport function createLocalEditorPreviewCleanupRegistry(options: {\n onTerminalFailure?: (error: unknown) => void;\n} = {}): LocalEditorPreviewCleanupRegistry {\n const owned = new Set<LocalEditorPreviewCleanup>();\n const inFlight = new Set<LocalEditorPreviewCleanup>();\n const failures: unknown[] = [];\n\n const recordTerminalFailure = (error: unknown): void => {\n failures.push(error);\n options.onTerminalFailure?.(error);\n };\n\n const invoke = (cleanup: LocalEditorPreviewCleanup, retriesRemaining = 1): void => {\n if (inFlight.has(cleanup)) return;\n inFlight.add(cleanup);\n let result: void | Promise<void>;\n try {\n result = cleanup();\n } catch (error) {\n inFlight.delete(cleanup);\n if (retriesRemaining > 0 && owned.has(cleanup)) invoke(cleanup, retriesRemaining - 1);\n else recordTerminalFailure(error);\n return;\n }\n if (!result || typeof (result as Promise<void>).then !== 'function') {\n owned.delete(cleanup);\n inFlight.delete(cleanup);\n return;\n }\n void Promise.resolve(result).then(() => {\n owned.delete(cleanup);\n inFlight.delete(cleanup);\n }, (error) => {\n inFlight.delete(cleanup);\n if (retriesRemaining > 0) {\n queueMicrotask(() => {\n if (owned.has(cleanup)) invoke(cleanup, retriesRemaining - 1);\n });\n } else {\n recordTerminalFailure(error);\n }\n });\n };\n\n return {\n own(cleanup) {\n owned.add(cleanup);\n },\n disposeOwned(cleanup) {\n if (cleanup) owned.add(cleanup);\n for (const ownedCleanup of owned) invoke(ownedCleanup);\n },\n hasOwned() {\n return owned.size > 0;\n },\n takeFailures() {\n return failures.splice(0, failures.length);\n },\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export type LocalEditorProjectFileOpenAction = 'media-preview' | 'text-preview';
2
+ export declare function resolveLocalEditorProjectFileOpenAction(relativePath: string, capabilities: {
3
+ mediaPreview: boolean;
4
+ textPreview: boolean;
5
+ }): LocalEditorProjectFileOpenAction | null;
6
+ //# sourceMappingURL=local-editor-project-file-open.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-project-file-open.d.ts","sourceRoot":"","sources":["../src/local-editor-project-file-open.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,gCAAgC,GAAG,eAAe,GAAG,cAAc,CAAC;AAEhF,wBAAgB,uCAAuC,CACrD,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,GAC5D,gCAAgC,GAAG,IAAI,CAIzC"}
@@ -0,0 +1,9 @@
1
+ import { isEditorProjectFilePreviewable, isEditorProjectMediaPreviewable, } from '@fps-games/editor-playable-sdk';
2
+ export function resolveLocalEditorProjectFileOpenAction(relativePath, capabilities) {
3
+ if (capabilities.mediaPreview && isEditorProjectMediaPreviewable(relativePath))
4
+ return 'media-preview';
5
+ if (capabilities.textPreview && isEditorProjectFilePreviewable(relativePath))
6
+ return 'text-preview';
7
+ return null;
8
+ }
9
+ //# sourceMappingURL=local-editor-project-file-open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-project-file-open.js","sourceRoot":"","sources":["../src/local-editor-project-file-open.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AAIxC,MAAM,UAAU,uCAAuC,CACrD,YAAoB,EACpB,YAA6D;IAE7D,IAAI,YAAY,CAAC,YAAY,IAAI,+BAA+B,CAAC,YAAY,CAAC;QAAE,OAAO,eAAe,CAAC;IACvG,IAAI,YAAY,CAAC,WAAW,IAAI,8BAA8B,CAAC,YAAY,CAAC;QAAE,OAAO,cAAc,CAAC;IACpG,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {\n isEditorProjectFilePreviewable,\n isEditorProjectMediaPreviewable,\n} from '@fps-games/editor-playable-sdk';\n\nexport type LocalEditorProjectFileOpenAction = 'media-preview' | 'text-preview';\n\nexport function resolveLocalEditorProjectFileOpenAction(\n relativePath: string,\n capabilities: { mediaPreview: boolean; textPreview: boolean },\n): LocalEditorProjectFileOpenAction | null {\n if (capabilities.mediaPreview && isEditorProjectMediaPreviewable(relativePath)) return 'media-preview';\n if (capabilities.textPreview && isEditorProjectFilePreviewable(relativePath)) return 'text-preview';\n return null;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export interface LocalEditorProjectFileSearchMatch {
2
+ start: number;
3
+ end: number;
4
+ }
5
+ export declare function findLocalEditorProjectFileSearchMatches(text: string, query: string, maxMatches?: number): LocalEditorProjectFileSearchMatch[];
6
+ export declare function toLocalEditorProjectRelativePath(browserPath: string): string;
7
+ //# sourceMappingURL=local-editor-project-file-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-project-file-preview.d.ts","sourceRoot":"","sources":["../src/local-editor-project-file-preview.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,uCAAuC,CACrD,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,SAAS,GAClB,iCAAiC,EAAE,CAarC;AAED,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5E"}
@@ -0,0 +1,20 @@
1
+ export function findLocalEditorProjectFileSearchMatches(text, query, maxMatches = 10000) {
2
+ const normalizedQuery = query.trim().toLocaleLowerCase();
3
+ if (!normalizedQuery || maxMatches <= 0)
4
+ return [];
5
+ const normalizedText = text.toLocaleLowerCase();
6
+ const matches = [];
7
+ let cursor = 0;
8
+ while (cursor <= normalizedText.length - normalizedQuery.length && matches.length < maxMatches) {
9
+ const start = normalizedText.indexOf(normalizedQuery, cursor);
10
+ if (start < 0)
11
+ break;
12
+ matches.push({ start, end: start + normalizedQuery.length });
13
+ cursor = start + Math.max(1, normalizedQuery.length);
14
+ }
15
+ return matches;
16
+ }
17
+ export function toLocalEditorProjectRelativePath(browserPath) {
18
+ return browserPath.replace(/^\/+/, '');
19
+ }
20
+ //# sourceMappingURL=local-editor-project-file-preview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-project-file-preview.js","sourceRoot":"","sources":["../src/local-editor-project-file-preview.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,uCAAuC,CACrD,IAAY,EACZ,KAAa,EACb,UAAU,GAAG,KAAM;IAEnB,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,iBAAiB,EAAE,CAAC;IACzD,IAAI,CAAC,eAAe,IAAI,UAAU,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACnD,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAChD,MAAM,OAAO,GAAwC,EAAE,CAAC;IACxD,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,MAAM,IAAI,cAAc,CAAC,MAAM,GAAG,eAAe,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;QAC/F,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QAC9D,IAAI,KAAK,GAAG,CAAC;YAAE,MAAM;QACrB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7D,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,WAAmB;IAClE,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC","sourcesContent":["export interface LocalEditorProjectFileSearchMatch {\n start: number;\n end: number;\n}\n\nexport function findLocalEditorProjectFileSearchMatches(\n text: string,\n query: string,\n maxMatches = 10_000,\n): LocalEditorProjectFileSearchMatch[] {\n const normalizedQuery = query.trim().toLocaleLowerCase();\n if (!normalizedQuery || maxMatches <= 0) return [];\n const normalizedText = text.toLocaleLowerCase();\n const matches: LocalEditorProjectFileSearchMatch[] = [];\n let cursor = 0;\n while (cursor <= normalizedText.length - normalizedQuery.length && matches.length < maxMatches) {\n const start = normalizedText.indexOf(normalizedQuery, cursor);\n if (start < 0) break;\n matches.push({ start, end: start + normalizedQuery.length });\n cursor = start + Math.max(1, normalizedQuery.length);\n }\n return matches;\n}\n\nexport function toLocalEditorProjectRelativePath(browserPath: string): string {\n return browserPath.replace(/^\\/+/, '');\n}\n"]}
@@ -0,0 +1,9 @@
1
+ export declare const LOCAL_EDITOR_PROJECT_MODEL_THUMBNAIL_PATH_CACHE_PREFIX = "model:path:";
2
+ export interface LocalEditorProjectModelThumbnailCache {
3
+ get(key: string): Promise<string | null>;
4
+ put(key: string, dataUrl: string): Promise<void>;
5
+ clearPathEntries(): Promise<void>;
6
+ dispose(): void;
7
+ }
8
+ export declare function createLocalEditorProjectModelThumbnailCache(ownerWindow: Window | null): LocalEditorProjectModelThumbnailCache;
9
+ //# sourceMappingURL=local-editor-project-media-thumbnail-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-editor-project-media-thumbnail-cache.d.ts","sourceRoot":"","sources":["../src/local-editor-project-media-thumbnail-cache.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sDAAsD,gBAAgB,CAAC;AAEpF,MAAM,WAAW,qCAAqC;IACpD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,2CAA2C,CACzD,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,qCAAqC,CAiMvC"}