@tableslayer/ui 0.0.1

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 (388) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +45 -0
  3. package/dist/components/Avatar/Avatar.svelte +82 -0
  4. package/dist/components/Avatar/Avatar.svelte.d.ts +4 -0
  5. package/dist/components/Avatar/AvatarFileInput.svelte +85 -0
  6. package/dist/components/Avatar/AvatarFileInput.svelte.d.ts +4 -0
  7. package/dist/components/Avatar/AvatarPopover.svelte +34 -0
  8. package/dist/components/Avatar/AvatarPopover.svelte.d.ts +4 -0
  9. package/dist/components/Avatar/index.d.ts +4 -0
  10. package/dist/components/Avatar/index.js +4 -0
  11. package/dist/components/Avatar/types.d.ts +21 -0
  12. package/dist/components/Avatar/types.js +1 -0
  13. package/dist/components/BrushSizeSlider/BrushSizeSlider.svelte +174 -0
  14. package/dist/components/BrushSizeSlider/BrushSizeSlider.svelte.d.ts +11 -0
  15. package/dist/components/BrushSizeSlider/index.d.ts +1 -0
  16. package/dist/components/BrushSizeSlider/index.js +1 -0
  17. package/dist/components/Button/Button.svelte +182 -0
  18. package/dist/components/Button/Button.svelte.d.ts +26 -0
  19. package/dist/components/Button/ConfirmActionButton.svelte +98 -0
  20. package/dist/components/Button/ConfirmActionButton.svelte.d.ts +4 -0
  21. package/dist/components/Button/IconButton.svelte +121 -0
  22. package/dist/components/Button/IconButton.svelte.d.ts +4 -0
  23. package/dist/components/Button/RadioButton.svelte +93 -0
  24. package/dist/components/Button/RadioButton.svelte.d.ts +15 -0
  25. package/dist/components/Button/index.d.ts +5 -0
  26. package/dist/components/Button/index.js +5 -0
  27. package/dist/components/Button/types.d.ts +55 -0
  28. package/dist/components/Button/types.js +1 -0
  29. package/dist/components/CardFan/CardFan.svelte +165 -0
  30. package/dist/components/CardFan/CardFan.svelte.d.ts +4 -0
  31. package/dist/components/CardFan/index.d.ts +2 -0
  32. package/dist/components/CardFan/index.js +2 -0
  33. package/dist/components/CardFan/types.d.ts +5 -0
  34. package/dist/components/CardFan/types.js +1 -0
  35. package/dist/components/CodeBlock/Code.svelte +7 -0
  36. package/dist/components/CodeBlock/Code.svelte.d.ts +4 -0
  37. package/dist/components/CodeBlock/CodeBlock.svelte +102 -0
  38. package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +4 -0
  39. package/dist/components/CodeBlock/index.d.ts +3 -0
  40. package/dist/components/CodeBlock/index.js +3 -0
  41. package/dist/components/CodeBlock/types.d.ts +9 -0
  42. package/dist/components/CodeBlock/types.js +1 -0
  43. package/dist/components/ColorMode/ColorMode.svelte +8 -0
  44. package/dist/components/ColorMode/ColorMode.svelte.d.ts +4 -0
  45. package/dist/components/ColorMode/index.d.ts +2 -0
  46. package/dist/components/ColorMode/index.js +1 -0
  47. package/dist/components/ColorMode/types.d.ts +10 -0
  48. package/dist/components/ColorMode/types.js +1 -0
  49. package/dist/components/ColorPicker/ColorPicker.svelte +838 -0
  50. package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +4 -0
  51. package/dist/components/ColorPicker/ColorPickerSwatch.svelte +32 -0
  52. package/dist/components/ColorPicker/ColorPickerSwatch.svelte.d.ts +6 -0
  53. package/dist/components/ColorPicker/index.d.ts +3 -0
  54. package/dist/components/ColorPicker/index.js +3 -0
  55. package/dist/components/ColorPicker/types.d.ts +60 -0
  56. package/dist/components/ColorPicker/types.js +1 -0
  57. package/dist/components/ContextMenu/ContextMenu.svelte +86 -0
  58. package/dist/components/ContextMenu/ContextMenu.svelte.d.ts +4 -0
  59. package/dist/components/ContextMenu/index.d.ts +2 -0
  60. package/dist/components/ContextMenu/index.js +2 -0
  61. package/dist/components/ContextMenu/types.d.ts +13 -0
  62. package/dist/components/ContextMenu/types.js +1 -0
  63. package/dist/components/DrawingSliders/DrawingSliders.svelte +379 -0
  64. package/dist/components/DrawingSliders/DrawingSliders.svelte.d.ts +16 -0
  65. package/dist/components/DrawingSliders/index.d.ts +1 -0
  66. package/dist/components/DrawingSliders/index.js +1 -0
  67. package/dist/components/Editor/Editor.svelte +825 -0
  68. package/dist/components/Editor/Editor.svelte.d.ts +11 -0
  69. package/dist/components/Editor/index.d.ts +1 -0
  70. package/dist/components/Editor/index.js +1 -0
  71. package/dist/components/FogSliders/FogSliders.svelte +33 -0
  72. package/dist/components/FogSliders/FogSliders.svelte.d.ts +7 -0
  73. package/dist/components/FogSliders/index.d.ts +1 -0
  74. package/dist/components/FogSliders/index.js +1 -0
  75. package/dist/components/Hr/Hr.svelte +15 -0
  76. package/dist/components/Hr/Hr.svelte.d.ts +3 -0
  77. package/dist/components/Hr/index.d.ts +1 -0
  78. package/dist/components/Hr/index.js +1 -0
  79. package/dist/components/Icon/Icon.svelte +6 -0
  80. package/dist/components/Icon/Icon.svelte.d.ts +4 -0
  81. package/dist/components/Icon/index.d.ts +2 -0
  82. package/dist/components/Icon/index.js +1 -0
  83. package/dist/components/Icon/types.d.ts +18 -0
  84. package/dist/components/Icon/types.js +1 -0
  85. package/dist/components/Input/DualInputSlider.svelte +126 -0
  86. package/dist/components/Input/DualInputSlider.svelte.d.ts +4 -0
  87. package/dist/components/Input/FileInput.svelte +176 -0
  88. package/dist/components/Input/FileInput.svelte.d.ts +21 -0
  89. package/dist/components/Input/FormControl.svelte +150 -0
  90. package/dist/components/Input/FormControl.svelte.d.ts +41 -0
  91. package/dist/components/Input/FormError.svelte +37 -0
  92. package/dist/components/Input/FormError.svelte.d.ts +13 -0
  93. package/dist/components/Input/Input.svelte +56 -0
  94. package/dist/components/Input/Input.svelte.d.ts +4 -0
  95. package/dist/components/Input/InputCheckbox.svelte +99 -0
  96. package/dist/components/Input/InputCheckbox.svelte.d.ts +4 -0
  97. package/dist/components/Input/InputSlider.svelte +86 -0
  98. package/dist/components/Input/InputSlider.svelte.d.ts +4 -0
  99. package/dist/components/Input/Label.svelte +19 -0
  100. package/dist/components/Input/Label.svelte.d.ts +4 -0
  101. package/dist/components/Input/index.d.ts +9 -0
  102. package/dist/components/Input/index.js +9 -0
  103. package/dist/components/Input/types.d.ts +33 -0
  104. package/dist/components/Input/types.js +1 -0
  105. package/dist/components/Link/Link.svelte +41 -0
  106. package/dist/components/Link/Link.svelte.d.ts +4 -0
  107. package/dist/components/Link/LinkBox.svelte +20 -0
  108. package/dist/components/Link/LinkBox.svelte.d.ts +4 -0
  109. package/dist/components/Link/LinkOverlay.svelte +23 -0
  110. package/dist/components/Link/LinkOverlay.svelte.d.ts +4 -0
  111. package/dist/components/Link/index.d.ts +4 -0
  112. package/dist/components/Link/index.js +4 -0
  113. package/dist/components/Link/types.d.ts +15 -0
  114. package/dist/components/Link/types.js +1 -0
  115. package/dist/components/Loading/Loader.svelte +60 -0
  116. package/dist/components/Loading/Loader.svelte.d.ts +3 -0
  117. package/dist/components/Loading/Skeleton.svelte +9 -0
  118. package/dist/components/Loading/Skeleton.svelte.d.ts +26 -0
  119. package/dist/components/Loading/index.d.ts +2 -0
  120. package/dist/components/Loading/index.js +2 -0
  121. package/dist/components/Logo/Logo.svelte +16 -0
  122. package/dist/components/Logo/Logo.svelte.d.ts +7 -0
  123. package/dist/components/Logo/index.d.ts +1 -0
  124. package/dist/components/Logo/index.js +1 -0
  125. package/dist/components/MarkerTooltip/MarkerTooltip.svelte +435 -0
  126. package/dist/components/MarkerTooltip/MarkerTooltip.svelte.d.ts +35 -0
  127. package/dist/components/MarkerTooltip/index.d.ts +1 -0
  128. package/dist/components/MarkerTooltip/index.js +1 -0
  129. package/dist/components/Menu/SelectorMenu.svelte +280 -0
  130. package/dist/components/Menu/SelectorMenu.svelte.d.ts +4 -0
  131. package/dist/components/Menu/index.d.ts +2 -0
  132. package/dist/components/Menu/index.js +2 -0
  133. package/dist/components/Menu/types.d.ts +20 -0
  134. package/dist/components/Menu/types.js +1 -0
  135. package/dist/components/MyCounterButton.svelte +11 -0
  136. package/dist/components/MyCounterButton.svelte.d.ts +3 -0
  137. package/dist/components/Panel/index.d.ts +2 -0
  138. package/dist/components/Panel/index.js +2 -0
  139. package/dist/components/Panel/panel.svelte +18 -0
  140. package/dist/components/Panel/panel.svelte.d.ts +4 -0
  141. package/dist/components/Panel/types.d.ts +7 -0
  142. package/dist/components/Panel/types.js +1 -0
  143. package/dist/components/PersistButton/PersistButton.svelte +100 -0
  144. package/dist/components/PersistButton/PersistButton.svelte.d.ts +12 -0
  145. package/dist/components/PersistButton/index.d.ts +1 -0
  146. package/dist/components/PersistButton/index.js +1 -0
  147. package/dist/components/Popover/Popover.svelte +81 -0
  148. package/dist/components/Popover/Popover.svelte.d.ts +6 -0
  149. package/dist/components/Popover/index.d.ts +2 -0
  150. package/dist/components/Popover/index.js +2 -0
  151. package/dist/components/Popover/types.d.ts +17 -0
  152. package/dist/components/Popover/types.js +1 -0
  153. package/dist/components/PropsTable/PropsTable.svelte +107 -0
  154. package/dist/components/PropsTable/PropsTable.svelte.d.ts +26 -0
  155. package/dist/components/RadialMenu/EffectPreview.svelte +36 -0
  156. package/dist/components/RadialMenu/EffectPreview.svelte.d.ts +9 -0
  157. package/dist/components/RadialMenu/EffectPreviewScene.svelte +194 -0
  158. package/dist/components/RadialMenu/EffectPreviewScene.svelte.d.ts +8 -0
  159. package/dist/components/RadialMenu/RadialMenu.svelte +503 -0
  160. package/dist/components/RadialMenu/RadialMenu.svelte.d.ts +4 -0
  161. package/dist/components/RadialMenu/RadialMenuItem.svelte +176 -0
  162. package/dist/components/RadialMenu/RadialMenuItem.svelte.d.ts +11 -0
  163. package/dist/components/RadialMenu/index.d.ts +2 -0
  164. package/dist/components/RadialMenu/index.js +2 -0
  165. package/dist/components/RadialMenu/types.d.ts +35 -0
  166. package/dist/components/RadialMenu/types.js +1 -0
  167. package/dist/components/Select/Select.svelte +342 -0
  168. package/dist/components/Select/Select.svelte.d.ts +4 -0
  169. package/dist/components/Select/index.d.ts +2 -0
  170. package/dist/components/Select/index.js +2 -0
  171. package/dist/components/Select/types.d.ts +24 -0
  172. package/dist/components/Select/types.js +1 -0
  173. package/dist/components/Spacer/Spacer.svelte +14 -0
  174. package/dist/components/Spacer/Spacer.svelte.d.ts +4 -0
  175. package/dist/components/Spacer/index.d.ts +2 -0
  176. package/dist/components/Spacer/index.js +2 -0
  177. package/dist/components/Spacer/types.d.ts +4 -0
  178. package/dist/components/Spacer/types.js +1 -0
  179. package/dist/components/Stage/components/AnnotationLayer/AnnotationLayer.svelte +445 -0
  180. package/dist/components/Stage/components/AnnotationLayer/AnnotationLayer.svelte.d.ts +19 -0
  181. package/dist/components/Stage/components/AnnotationLayer/AnnotationMaterial.svelte +167 -0
  182. package/dist/components/Stage/components/AnnotationLayer/AnnotationMaterial.svelte.d.ts +20 -0
  183. package/dist/components/Stage/components/AnnotationLayer/types.d.ts +121 -0
  184. package/dist/components/Stage/components/AnnotationLayer/types.js +71 -0
  185. package/dist/components/Stage/components/CursorLayer/CursorLayer.svelte +148 -0
  186. package/dist/components/Stage/components/CursorLayer/CursorLayer.svelte.d.ts +7 -0
  187. package/dist/components/Stage/components/CursorLayer/cursor.svg +26 -0
  188. package/dist/components/Stage/components/CursorLayer/index.d.ts +2 -0
  189. package/dist/components/Stage/components/CursorLayer/index.js +1 -0
  190. package/dist/components/Stage/components/CursorLayer/types.d.ts +28 -0
  191. package/dist/components/Stage/components/CursorLayer/types.js +1 -0
  192. package/dist/components/Stage/components/DrawingLayer/DrawingMaterial.svelte +364 -0
  193. package/dist/components/Stage/components/DrawingLayer/DrawingMaterial.svelte.d.ts +24 -0
  194. package/dist/components/Stage/components/DrawingLayer/types.d.ts +56 -0
  195. package/dist/components/Stage/components/DrawingLayer/types.js +23 -0
  196. package/dist/components/Stage/components/EdgeOverlayLayer/EdgeOverlayLayer.svelte +72 -0
  197. package/dist/components/Stage/components/EdgeOverlayLayer/EdgeOverlayLayer.svelte.d.ts +11 -0
  198. package/dist/components/Stage/components/EdgeOverlayLayer/types.d.ts +29 -0
  199. package/dist/components/Stage/components/EdgeOverlayLayer/types.js +1 -0
  200. package/dist/components/Stage/components/FogLayer/FogLayer.svelte +75 -0
  201. package/dist/components/Stage/components/FogLayer/FogLayer.svelte.d.ts +11 -0
  202. package/dist/components/Stage/components/FogLayer/types.d.ts +42 -0
  203. package/dist/components/Stage/components/FogLayer/types.js +1 -0
  204. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarLayer.svelte +249 -0
  205. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarLayer.svelte.d.ts +19 -0
  206. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarMaterial.svelte +200 -0
  207. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarMaterial.svelte.d.ts +18 -0
  208. package/dist/components/Stage/components/FogOfWarLayer/types.d.ts +143 -0
  209. package/dist/components/Stage/components/FogOfWarLayer/types.js +1 -0
  210. package/dist/components/Stage/components/GridLayer/GridLayer.svelte +20 -0
  211. package/dist/components/Stage/components/GridLayer/GridLayer.svelte.d.ts +12 -0
  212. package/dist/components/Stage/components/GridLayer/GridMaterial.svelte +69 -0
  213. package/dist/components/Stage/components/GridLayer/GridMaterial.svelte.d.ts +10 -0
  214. package/dist/components/Stage/components/GridLayer/types.d.ts +65 -0
  215. package/dist/components/Stage/components/GridLayer/types.js +10 -0
  216. package/dist/components/Stage/components/LayerInput/LayerInput.svelte +300 -0
  217. package/dist/components/Stage/components/LayerInput/LayerInput.svelte.d.ts +20 -0
  218. package/dist/components/Stage/components/MapLayer/MapLayer.svelte +196 -0
  219. package/dist/components/Stage/components/MapLayer/MapLayer.svelte.d.ts +24 -0
  220. package/dist/components/Stage/components/MapLayer/dataSources/GifDataSource.d.ts +93 -0
  221. package/dist/components/Stage/components/MapLayer/dataSources/GifDataSource.js +229 -0
  222. package/dist/components/Stage/components/MapLayer/dataSources/IMapDataSource.d.ts +51 -0
  223. package/dist/components/Stage/components/MapLayer/dataSources/IMapDataSource.js +1 -0
  224. package/dist/components/Stage/components/MapLayer/dataSources/ImageDataSource.d.ts +49 -0
  225. package/dist/components/Stage/components/MapLayer/dataSources/ImageDataSource.js +87 -0
  226. package/dist/components/Stage/components/MapLayer/dataSources/VideoDataSource.d.ts +52 -0
  227. package/dist/components/Stage/components/MapLayer/dataSources/VideoDataSource.js +141 -0
  228. package/dist/components/Stage/components/MapLayer/dataSources/dataSourceFactory.d.ts +21 -0
  229. package/dist/components/Stage/components/MapLayer/dataSources/dataSourceFactory.js +44 -0
  230. package/dist/components/Stage/components/MapLayer/dataSources/index.d.ts +15 -0
  231. package/dist/components/Stage/components/MapLayer/dataSources/index.js +14 -0
  232. package/dist/components/Stage/components/MapLayer/types.d.ts +54 -0
  233. package/dist/components/Stage/components/MapLayer/types.js +9 -0
  234. package/dist/components/Stage/components/MarkerLayer/MarkerLayer.svelte +398 -0
  235. package/dist/components/Stage/components/MarkerLayer/MarkerLayer.svelte.d.ts +24 -0
  236. package/dist/components/Stage/components/MarkerLayer/MarkerToken.svelte +262 -0
  237. package/dist/components/Stage/components/MarkerLayer/MarkerToken.svelte.d.ts +27 -0
  238. package/dist/components/Stage/components/MarkerLayer/types.d.ts +109 -0
  239. package/dist/components/Stage/components/MarkerLayer/types.js +21 -0
  240. package/dist/components/Stage/components/MeasurementLayer/MeasurementLayer.svelte +364 -0
  241. package/dist/components/Stage/components/MeasurementLayer/MeasurementLayer.svelte.d.ts +49 -0
  242. package/dist/components/Stage/components/MeasurementLayer/MeasurementManager.svelte +473 -0
  243. package/dist/components/Stage/components/MeasurementLayer/MeasurementManager.svelte.d.ts +24 -0
  244. package/dist/components/Stage/components/MeasurementLayer/measurements/BaseMeasurement.d.ts +150 -0
  245. package/dist/components/Stage/components/MeasurementLayer/measurements/BaseMeasurement.js +274 -0
  246. package/dist/components/Stage/components/MeasurementLayer/measurements/BeamMeasurement.d.ts +10 -0
  247. package/dist/components/Stage/components/MeasurementLayer/measurements/BeamMeasurement.js +58 -0
  248. package/dist/components/Stage/components/MeasurementLayer/measurements/CircleMeasurement.d.ts +9 -0
  249. package/dist/components/Stage/components/MeasurementLayer/measurements/CircleMeasurement.js +66 -0
  250. package/dist/components/Stage/components/MeasurementLayer/measurements/ConeMeasurement.d.ts +10 -0
  251. package/dist/components/Stage/components/MeasurementLayer/measurements/ConeMeasurement.js +103 -0
  252. package/dist/components/Stage/components/MeasurementLayer/measurements/LineMeasurement.d.ts +9 -0
  253. package/dist/components/Stage/components/MeasurementLayer/measurements/LineMeasurement.js +75 -0
  254. package/dist/components/Stage/components/MeasurementLayer/measurements/RectangleMeasurement.d.ts +9 -0
  255. package/dist/components/Stage/components/MeasurementLayer/measurements/RectangleMeasurement.js +73 -0
  256. package/dist/components/Stage/components/MeasurementLayer/measurements/index.d.ts +2 -0
  257. package/dist/components/Stage/components/MeasurementLayer/measurements/index.js +7 -0
  258. package/dist/components/Stage/components/MeasurementLayer/types.d.ts +76 -0
  259. package/dist/components/Stage/components/MeasurementLayer/types.js +9 -0
  260. package/dist/components/Stage/components/MeasurementLayer/utils/canvasDrawing.d.ts +83 -0
  261. package/dist/components/Stage/components/MeasurementLayer/utils/canvasDrawing.js +267 -0
  262. package/dist/components/Stage/components/MeasurementLayer/utils/distanceCalculations.d.ts +74 -0
  263. package/dist/components/Stage/components/MeasurementLayer/utils/distanceCalculations.js +130 -0
  264. package/dist/components/Stage/components/ParticleSystem/ParticleSystem.svelte +220 -0
  265. package/dist/components/Stage/components/ParticleSystem/ParticleSystem.svelte.d.ts +9 -0
  266. package/dist/components/Stage/components/ParticleSystem/particles/atlases/ash.png +0 -0
  267. package/dist/components/Stage/components/ParticleSystem/particles/atlases/leaves.png +0 -0
  268. package/dist/components/Stage/components/ParticleSystem/particles/atlases/rain.png +0 -0
  269. package/dist/components/Stage/components/ParticleSystem/particles/atlases/snow.png +0 -0
  270. package/dist/components/Stage/components/ParticleSystem/rng.d.ts +7 -0
  271. package/dist/components/Stage/components/ParticleSystem/rng.js +20 -0
  272. package/dist/components/Stage/components/ParticleSystem/types.d.ts +88 -0
  273. package/dist/components/Stage/components/ParticleSystem/types.js +37 -0
  274. package/dist/components/Stage/components/PerformanceDebugger/PerformanceDebugger.svelte +144 -0
  275. package/dist/components/Stage/components/PerformanceDebugger/PerformanceDebugger.svelte.d.ts +19 -0
  276. package/dist/components/Stage/components/PerformanceDebugger/index.d.ts +1 -0
  277. package/dist/components/Stage/components/PerformanceDebugger/index.js +1 -0
  278. package/dist/components/Stage/components/PerformanceOverlay/PerformanceOverlay.svelte +208 -0
  279. package/dist/components/Stage/components/PerformanceOverlay/PerformanceOverlay.svelte.d.ts +7 -0
  280. package/dist/components/Stage/components/PerformanceOverlay/index.d.ts +1 -0
  281. package/dist/components/Stage/components/PerformanceOverlay/index.js +1 -0
  282. package/dist/components/Stage/components/PointerInputManager/PointerInputManager.svelte +201 -0
  283. package/dist/components/Stage/components/PointerInputManager/PointerInputManager.svelte.d.ts +17 -0
  284. package/dist/components/Stage/components/Scene/Scene.svelte +651 -0
  285. package/dist/components/Stage/components/Scene/Scene.svelte.d.ts +88 -0
  286. package/dist/components/Stage/components/Scene/luts.d.ts +7 -0
  287. package/dist/components/Stage/components/Scene/luts.js +33 -0
  288. package/dist/components/Stage/components/Scene/types.d.ts +207 -0
  289. package/dist/components/Stage/components/Scene/types.js +35 -0
  290. package/dist/components/Stage/components/Stage/Stage.svelte +332 -0
  291. package/dist/components/Stage/components/Stage/Stage.svelte.d.ts +86 -0
  292. package/dist/components/Stage/components/Stage/types.d.ts +163 -0
  293. package/dist/components/Stage/components/Stage/types.js +5 -0
  294. package/dist/components/Stage/components/WeatherLayer/WeatherLayer.svelte +135 -0
  295. package/dist/components/Stage/components/WeatherLayer/WeatherLayer.svelte.d.ts +13 -0
  296. package/dist/components/Stage/components/WeatherLayer/presets/AshPreset.d.ts +3 -0
  297. package/dist/components/Stage/components/WeatherLayer/presets/AshPreset.js +69 -0
  298. package/dist/components/Stage/components/WeatherLayer/presets/LeavesPreset.d.ts +3 -0
  299. package/dist/components/Stage/components/WeatherLayer/presets/LeavesPreset.js +68 -0
  300. package/dist/components/Stage/components/WeatherLayer/presets/RainPreset.d.ts +3 -0
  301. package/dist/components/Stage/components/WeatherLayer/presets/RainPreset.js +67 -0
  302. package/dist/components/Stage/components/WeatherLayer/presets/SnowPreset.d.ts +3 -0
  303. package/dist/components/Stage/components/WeatherLayer/presets/SnowPreset.js +68 -0
  304. package/dist/components/Stage/components/WeatherLayer/presets/index.d.ts +5 -0
  305. package/dist/components/Stage/components/WeatherLayer/presets/index.js +5 -0
  306. package/dist/components/Stage/components/WeatherLayer/types.d.ts +31 -0
  307. package/dist/components/Stage/components/WeatherLayer/types.js +9 -0
  308. package/dist/components/Stage/helpers/clippingPlaneStore.svelte.d.ts +7 -0
  309. package/dist/components/Stage/helpers/clippingPlaneStore.svelte.js +23 -0
  310. package/dist/components/Stage/helpers/debugState.svelte.d.ts +10 -0
  311. package/dist/components/Stage/helpers/debugState.svelte.js +13 -0
  312. package/dist/components/Stage/helpers/grid.d.ts +72 -0
  313. package/dist/components/Stage/helpers/grid.js +444 -0
  314. package/dist/components/Stage/helpers/lazyBrush.d.ts +63 -0
  315. package/dist/components/Stage/helpers/lazyBrush.js +137 -0
  316. package/dist/components/Stage/helpers/performanceMetrics.svelte.d.ts +62 -0
  317. package/dist/components/Stage/helpers/performanceMetrics.svelte.js +165 -0
  318. package/dist/components/Stage/helpers/utils.d.ts +3 -0
  319. package/dist/components/Stage/helpers/utils.js +18 -0
  320. package/dist/components/Stage/index.d.ts +21 -0
  321. package/dist/components/Stage/index.js +21 -0
  322. package/dist/components/Stage/shaders/AnnotationEffects.frag +1070 -0
  323. package/dist/components/Stage/shaders/Annotations.frag +29 -0
  324. package/dist/components/Stage/shaders/Drawing.frag +83 -0
  325. package/dist/components/Stage/shaders/Drawing.vert +5 -0
  326. package/dist/components/Stage/shaders/Fog.frag +147 -0
  327. package/dist/components/Stage/shaders/FractalNoise.frag +96 -0
  328. package/dist/components/Stage/shaders/GridShader.frag +174 -0
  329. package/dist/components/Stage/shaders/Overlay.frag +23 -0
  330. package/dist/components/Stage/shaders/Overlay.vert +0 -0
  331. package/dist/components/Stage/shaders/Particles.frag +27 -0
  332. package/dist/components/Stage/shaders/Particles.vert +51 -0
  333. package/dist/components/Stage/shaders/ToolOutline.frag +59 -0
  334. package/dist/components/Stage/shaders/default.vert +8 -0
  335. package/dist/components/Stage/types.d.ts +4 -0
  336. package/dist/components/Stage/types.js +1 -0
  337. package/dist/components/Table/Table.svelte +16 -0
  338. package/dist/components/Table/Table.svelte.d.ts +4 -0
  339. package/dist/components/Table/Td.svelte +17 -0
  340. package/dist/components/Table/Td.svelte.d.ts +4 -0
  341. package/dist/components/Table/Th.svelte +18 -0
  342. package/dist/components/Table/Th.svelte.d.ts +4 -0
  343. package/dist/components/Table/index.d.ts +4 -0
  344. package/dist/components/Table/index.js +4 -0
  345. package/dist/components/Table/types.d.ts +11 -0
  346. package/dist/components/Table/types.js +1 -0
  347. package/dist/components/Text/Text.svelte +23 -0
  348. package/dist/components/Text/Text.svelte.d.ts +4 -0
  349. package/dist/components/Text/index.d.ts +2 -0
  350. package/dist/components/Text/index.js +2 -0
  351. package/dist/components/Text/types.d.ts +11 -0
  352. package/dist/components/Text/types.js +1 -0
  353. package/dist/components/Title/Title.svelte +54 -0
  354. package/dist/components/Title/Title.svelte.d.ts +4 -0
  355. package/dist/components/Title/index.d.ts +2 -0
  356. package/dist/components/Title/index.js +2 -0
  357. package/dist/components/Title/types.d.ts +8 -0
  358. package/dist/components/Title/types.js +1 -0
  359. package/dist/components/Toast/Toast.svelte +155 -0
  360. package/dist/components/Toast/Toast.svelte.d.ts +5 -0
  361. package/dist/components/Toast/index.d.ts +3 -0
  362. package/dist/components/Toast/index.js +5 -0
  363. package/dist/components/Toast/toastCookie.d.ts +7 -0
  364. package/dist/components/Toast/toastCookie.js +17 -0
  365. package/dist/components/Toast/types.d.ts +6 -0
  366. package/dist/components/Toast/types.js +1 -0
  367. package/dist/components/ToolTip/ToolTip.svelte +70 -0
  368. package/dist/components/ToolTip/ToolTip.svelte.d.ts +4 -0
  369. package/dist/components/ToolTip/index.d.ts +2 -0
  370. package/dist/components/ToolTip/index.js +2 -0
  371. package/dist/components/ToolTip/types.d.ts +14 -0
  372. package/dist/components/ToolTip/types.js +1 -0
  373. package/dist/components/index.d.ts +32 -0
  374. package/dist/components/index.js +32 -0
  375. package/dist/components/types.d.ts +0 -0
  376. package/dist/components/types.js +1 -0
  377. package/dist/index.d.ts +2 -0
  378. package/dist/index.js +2 -0
  379. package/dist/styles/globals.css +108 -0
  380. package/dist/styles/normalize.css +9 -0
  381. package/dist/styles/reset.css +133 -0
  382. package/dist/styles/utilities.css +179 -0
  383. package/dist/styles/vars.css +1103 -0
  384. package/dist/types/awareness.d.ts +16 -0
  385. package/dist/types/awareness.js +1 -0
  386. package/dist/utils/rle.d.ts +41 -0
  387. package/dist/utils/rle.js +201 -0
  388. package/package.json +110 -0
@@ -0,0 +1,24 @@
1
+ import * as THREE from 'three';
2
+ import type { Size } from '../../types';
3
+ import type { StageProps } from '../Stage/types';
4
+ interface Props {
5
+ props: StageProps;
6
+ onMapLoading: () => void;
7
+ onMapLoaded: (mapUrl: string, mapSize: Size) => void;
8
+ }
9
+ declare const MapLayer: import("svelte").Component<Props, {
10
+ getCompositeMapTexture: () => THREE.Texture | null;
11
+ fill: () => void;
12
+ fit: () => void;
13
+ mapSize: Size | null;
14
+ fogOfWar: {
15
+ clear: () => void;
16
+ reset: () => void;
17
+ toPng: () => Promise<Blob>;
18
+ toRLE: () => Promise<Uint8Array<ArrayBufferLike>>;
19
+ fromRLE: (rleData: Uint8Array, width: number, height: number) => Promise<void>;
20
+ isDrawing: () => boolean;
21
+ };
22
+ }, "">;
23
+ type MapLayer = ReturnType<typeof MapLayer>;
24
+ export default MapLayer;
@@ -0,0 +1,93 @@
1
+ import * as THREE from 'three';
2
+ import type { Size } from '../../../types';
3
+ import type { IMapDataSource } from './IMapDataSource';
4
+ /**
5
+ * Data source for loading and animating GIF images as textures in a 3D scene.
6
+ *
7
+ * This class implements the IMapDataSource interface to provide GIF animation
8
+ * capabilities for map layers. It handles GIF parsing, frame decompression,
9
+ * and real-time animation rendering using HTML5 Canvas and Three.js textures.
10
+ */
11
+ export declare class GifDataSource implements IMapDataSource {
12
+ /** Canvas element used for rendering the GIF frames */
13
+ private gifCanvas;
14
+ /** 2D rendering context for the main GIF canvas */
15
+ private gifCtx;
16
+ /** Temporary canvas used for patch rendering of individual frames */
17
+ private tempCanvas;
18
+ /** 2D rendering context for the temporary canvas */
19
+ private tempCtx;
20
+ /** Three.js texture created from the GIF canvas */
21
+ private texture;
22
+ /** Dimensions of the GIF image */
23
+ private size;
24
+ /** Array of decompressed GIF frames */
25
+ private frames;
26
+ /** Index of the currently displayed frame */
27
+ private currentFrameIndex;
28
+ /** Animation frame ID for canceling the animation loop */
29
+ private animationId;
30
+ /** Timestamp when the animation started for timing calculations */
31
+ private startTime;
32
+ /** Timestamp of the last frame render */
33
+ private lastFrameTime;
34
+ /** The total time the animation has been playing */
35
+ private totalPlayTime;
36
+ /**
37
+ * Gets the Three.js texture containing the animated GIF.
38
+ *
39
+ * @returns The canvas texture with the current frame, or null if not loaded
40
+ */
41
+ getTexture(): THREE.Texture | null;
42
+ /**
43
+ * Gets the dimensions of the GIF image.
44
+ *
45
+ * @returns The width and height of the GIF, or null if not loaded
46
+ */
47
+ getSize(): Size | null;
48
+ /**
49
+ * Loads and initializes a GIF from a URL.
50
+ *
51
+ * This method fetches the GIF data, parses it, decompresses the frames,
52
+ * sets up the rendering canvases, and starts the animation loop.
53
+ *
54
+ * @param url - The URL of the GIF file to load
55
+ * @returns A promise that resolves when the GIF is loaded and ready
56
+ * @throws Error if the GIF cannot be fetched, parsed, or has no frames
57
+ */
58
+ load(url: string): Promise<void>;
59
+ /**
60
+ * Starts the GIF animation loop.
61
+ *
62
+ * This method initializes the animation by setting up the rendering context,
63
+ * starting the timing mechanism, and beginning the animation frame loop.
64
+ * The animation automatically loops when all frames have been displayed.
65
+ */
66
+ private startAnimation;
67
+ /**
68
+ * Renders a specific frame of the GIF animation.
69
+ *
70
+ * This method handles frame disposal methods and delegates the actual
71
+ * drawing to the drawPatch method.
72
+ *
73
+ * @param frameIndex - The index of the frame to render
74
+ */
75
+ private renderFrame;
76
+ /**
77
+ * Draws a frame patch onto the main canvas.
78
+ *
79
+ * This method uses a temporary canvas to efficiently render individual
80
+ * frame patches at their correct positions within the GIF.
81
+ *
82
+ * @param frame - The frame object containing patch data and dimensions
83
+ */
84
+ private drawPatch;
85
+ /**
86
+ * Disposes of all resources used by this data source.
87
+ *
88
+ * This method stops the animation loop, disposes of the Three.js texture,
89
+ * clears all canvas references, and resets internal state. It should be
90
+ * called before loading a new GIF or when the data source is no longer needed.
91
+ */
92
+ dispose(): void;
93
+ }
@@ -0,0 +1,229 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { decompressFrames, parseGIF } from 'gifuct-js';
11
+ import * as THREE from 'three';
12
+ /**
13
+ * Data source for loading and animating GIF images as textures in a 3D scene.
14
+ *
15
+ * This class implements the IMapDataSource interface to provide GIF animation
16
+ * capabilities for map layers. It handles GIF parsing, frame decompression,
17
+ * and real-time animation rendering using HTML5 Canvas and Three.js textures.
18
+ */
19
+ export class GifDataSource {
20
+ constructor() {
21
+ /** Canvas element used for rendering the GIF frames */
22
+ this.gifCanvas = null;
23
+ /** 2D rendering context for the main GIF canvas */
24
+ this.gifCtx = null;
25
+ /** Temporary canvas used for patch rendering of individual frames */
26
+ this.tempCanvas = null;
27
+ /** 2D rendering context for the temporary canvas */
28
+ this.tempCtx = null;
29
+ /** Three.js texture created from the GIF canvas */
30
+ this.texture = null;
31
+ /** Dimensions of the GIF image */
32
+ this.size = null;
33
+ /** Array of decompressed GIF frames */
34
+ this.frames = [];
35
+ /** Index of the currently displayed frame */
36
+ this.currentFrameIndex = 0;
37
+ /** Animation frame ID for canceling the animation loop */
38
+ this.animationId = null;
39
+ /** Timestamp when the animation started for timing calculations */
40
+ this.startTime = 0;
41
+ /** Timestamp of the last frame render */
42
+ this.lastFrameTime = 0;
43
+ /** The total time the animation has been playing */
44
+ this.totalPlayTime = 0;
45
+ }
46
+ /**
47
+ * Gets the Three.js texture containing the animated GIF.
48
+ *
49
+ * @returns The canvas texture with the current frame, or null if not loaded
50
+ */
51
+ getTexture() {
52
+ return this.texture;
53
+ }
54
+ /**
55
+ * Gets the dimensions of the GIF image.
56
+ *
57
+ * @returns The width and height of the GIF, or null if not loaded
58
+ */
59
+ getSize() {
60
+ return this.size;
61
+ }
62
+ /**
63
+ * Loads and initializes a GIF from a URL.
64
+ *
65
+ * This method fetches the GIF data, parses it, decompresses the frames,
66
+ * sets up the rendering canvases, and starts the animation loop.
67
+ *
68
+ * @param url - The URL of the GIF file to load
69
+ * @returns A promise that resolves when the GIF is loaded and ready
70
+ * @throws Error if the GIF cannot be fetched, parsed, or has no frames
71
+ */
72
+ load(url) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ // Dispose of previous resources
75
+ this.dispose();
76
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
77
+ try {
78
+ // Fetch the GIF data
79
+ const response = yield fetch(url);
80
+ const arrayBuffer = yield response.arrayBuffer();
81
+ // Parse the GIF
82
+ const gif = parseGIF(arrayBuffer);
83
+ this.frames = decompressFrames(gif, true);
84
+ if (this.frames.length === 0) {
85
+ throw new Error('No frames found in GIF');
86
+ }
87
+ // Get dimensions from the first frame
88
+ const firstFrame = this.frames[0];
89
+ this.size = {
90
+ width: firstFrame.dims.width,
91
+ height: firstFrame.dims.height
92
+ };
93
+ // Create canvas for rendering
94
+ this.gifCanvas = document.createElement('canvas');
95
+ this.gifCanvas.width = this.size.width;
96
+ this.gifCanvas.height = this.size.height;
97
+ // Create temporary canvas for patch rendering
98
+ this.tempCanvas = document.createElement('canvas');
99
+ this.tempCtx = this.tempCanvas.getContext('2d');
100
+ // Create texture from canvas
101
+ this.texture = new THREE.CanvasTexture(this.gifCanvas);
102
+ this.texture.colorSpace = THREE.SRGBColorSpace;
103
+ // Start animation
104
+ this.startAnimation();
105
+ resolve();
106
+ }
107
+ catch (error) {
108
+ console.error('Failed to load GIF:', error);
109
+ reject(error);
110
+ }
111
+ }));
112
+ });
113
+ }
114
+ /**
115
+ * Starts the GIF animation loop.
116
+ *
117
+ * This method initializes the animation by setting up the rendering context,
118
+ * starting the timing mechanism, and beginning the animation frame loop.
119
+ * The animation automatically loops when all frames have been displayed.
120
+ */
121
+ startAnimation() {
122
+ if (!this.gifCanvas || this.frames.length === 0)
123
+ return;
124
+ this.gifCtx = this.gifCanvas.getContext('2d');
125
+ this.startTime = performance.now();
126
+ this.lastFrameTime = this.startTime;
127
+ this.currentFrameIndex = -1;
128
+ this.totalPlayTime = 0;
129
+ const animate = () => {
130
+ var _a;
131
+ this.animationId = requestAnimationFrame(animate);
132
+ const currentTime = performance.now();
133
+ const elapsedTime = currentTime - this.lastFrameTime;
134
+ this.lastFrameTime = currentTime;
135
+ const currentFrame = this.frames[this.currentFrameIndex];
136
+ const frameDelay = (_a = currentFrame === null || currentFrame === void 0 ? void 0 : currentFrame.delay) !== null && _a !== void 0 ? _a : 0;
137
+ this.totalPlayTime += elapsedTime;
138
+ // If the current frame has played for its duration, advance to the next frame
139
+ if (this.totalPlayTime >= frameDelay) {
140
+ this.totalPlayTime -= frameDelay;
141
+ this.currentFrameIndex++;
142
+ // Loop back to the beginning
143
+ if (this.currentFrameIndex >= this.frames.length) {
144
+ this.currentFrameIndex = 0;
145
+ }
146
+ this.renderFrame(this.currentFrameIndex);
147
+ // Update texture
148
+ if (this.texture) {
149
+ this.texture.needsUpdate = true;
150
+ }
151
+ }
152
+ };
153
+ // Start the animation loop
154
+ this.animationId = requestAnimationFrame(animate);
155
+ }
156
+ /**
157
+ * Renders a specific frame of the GIF animation.
158
+ *
159
+ * This method handles frame disposal methods and delegates the actual
160
+ * drawing to the drawPatch method.
161
+ *
162
+ * @param frameIndex - The index of the frame to render
163
+ */
164
+ renderFrame(frameIndex) {
165
+ const frame = this.frames[frameIndex];
166
+ // Clear canvas if disposal method requires it (like the example)
167
+ if (frame.disposalType === 2) {
168
+ this.gifCtx.clearRect(0, 0, this.gifCanvas.width, this.gifCanvas.height);
169
+ }
170
+ // Draw the patch using the temporary canvas approach
171
+ this.drawPatch(frame);
172
+ }
173
+ /**
174
+ * Draws a frame patch onto the main canvas.
175
+ *
176
+ * This method uses a temporary canvas to efficiently render individual
177
+ * frame patches at their correct positions within the GIF.
178
+ *
179
+ * @param frame - The frame object containing patch data and dimensions
180
+ */
181
+ drawPatch(frame) {
182
+ const dims = frame.dims;
183
+ // Resize temp canvas if needed
184
+ if (!this.tempCanvas || dims.width !== this.tempCanvas.width || dims.height !== this.tempCanvas.height) {
185
+ this.tempCanvas.width = dims.width;
186
+ this.tempCanvas.height = dims.height;
187
+ }
188
+ // Create ImageData for the patch
189
+ const frameImageData = this.tempCtx.createImageData(dims.width, dims.height);
190
+ // Set the patch data
191
+ frameImageData.data.set(frame.patch);
192
+ // Put the patch data on the temp canvas
193
+ this.tempCtx.putImageData(frameImageData, 0, 0);
194
+ // Draw the temp canvas onto the main canvas at the correct position
195
+ this.gifCtx.drawImage(this.tempCanvas, dims.left, dims.top);
196
+ }
197
+ /**
198
+ * Disposes of all resources used by this data source.
199
+ *
200
+ * This method stops the animation loop, disposes of the Three.js texture,
201
+ * clears all canvas references, and resets internal state. It should be
202
+ * called before loading a new GIF or when the data source is no longer needed.
203
+ */
204
+ dispose() {
205
+ // Stop animation
206
+ if (this.animationId) {
207
+ cancelAnimationFrame(this.animationId);
208
+ this.animationId = null;
209
+ }
210
+ // Dispose of texture
211
+ if (this.texture) {
212
+ this.texture.dispose();
213
+ this.texture = null;
214
+ }
215
+ // Clear canvas
216
+ if (this.gifCanvas) {
217
+ this.gifCanvas = null;
218
+ }
219
+ // Clear temp canvas
220
+ if (this.tempCanvas) {
221
+ this.tempCanvas = null;
222
+ this.tempCtx = null;
223
+ }
224
+ // Clear frames
225
+ this.frames = [];
226
+ this.currentFrameIndex = 0;
227
+ this.size = null;
228
+ }
229
+ }
@@ -0,0 +1,51 @@
1
+ import type * as THREE from 'three';
2
+ import type { Size } from '../../../types';
3
+ /**
4
+ * Interface for map data sources that provide textures for map layers.
5
+ *
6
+ * This interface defines the contract that all map data sources must implement.
7
+ * It provides a unified way to handle different types of media (images, videos, GIFs)
8
+ * as textures in a 3D map environment.
9
+ */
10
+ export interface IMapDataSource {
11
+ /**
12
+ * Gets the texture to be displayed on the map plane.
13
+ *
14
+ * This can be a static texture, a video texture, or a canvas texture
15
+ * depending on the implementation. The texture is used to render the
16
+ * data source on a 3D plane in the scene.
17
+ *
18
+ * @returns The texture to be displayed on the map plane, or null if not loaded
19
+ */
20
+ getTexture(): THREE.Texture | null;
21
+ /**
22
+ * Gets the dimensions of the map source.
23
+ *
24
+ * Returns the width and height of the data source, which is used
25
+ * to properly size and position the map layer in the 3D scene.
26
+ *
27
+ * @returns The dimensions of the map source, or null if not loaded
28
+ */
29
+ getSize(): Size | null;
30
+ /**
31
+ * Loads the data source from a URL.
32
+ *
33
+ * This method handles the loading of different media types (images, videos, GIFs)
34
+ * from a given URL. The implementation should handle any necessary parsing,
35
+ * decompression, or setup required for the specific media type.
36
+ *
37
+ * @param url - The URL of the data source to load
38
+ * @returns A promise that resolves when the data source is loaded and ready
39
+ * @throws Error if the data source cannot be loaded or processed
40
+ */
41
+ load(url: string): Promise<void>;
42
+ /**
43
+ * Cleans up resources used by the data source.
44
+ *
45
+ * This method should dispose of any textures, canvases, video elements,
46
+ * or other resources that were created during the loading process.
47
+ * It should be called when the data source is no longer needed to
48
+ * prevent memory leaks.
49
+ */
50
+ dispose(): void;
51
+ }
@@ -0,0 +1,49 @@
1
+ import * as THREE from 'three';
2
+ import type { Size } from '../../../types';
3
+ import type { IMapDataSource } from './IMapDataSource';
4
+ /**
5
+ * Data source for loading static images as textures in a 3D scene.
6
+ *
7
+ * This class implements the IMapDataSource interface to provide static image
8
+ * loading capabilities for map layers. It uses Three.js TextureLoader to load
9
+ * various image formats and create textures suitable for 3D rendering.
10
+ */
11
+ export declare class ImageDataSource implements IMapDataSource {
12
+ /** The loaded texture from the image file */
13
+ private texture;
14
+ /** Dimensions of the loaded image */
15
+ private size;
16
+ /** Three.js texture loader instance for loading images */
17
+ private loader;
18
+ /**
19
+ * Gets the Three.js texture containing the loaded image.
20
+ *
21
+ * @returns The texture with the loaded image, or null if not loaded
22
+ */
23
+ getTexture(): THREE.Texture | null;
24
+ /**
25
+ * Gets the dimensions of the loaded image.
26
+ *
27
+ * @returns The width and height of the image, or null if not loaded
28
+ */
29
+ getSize(): Size | null;
30
+ /**
31
+ * Loads an image from a URL and creates a texture.
32
+ *
33
+ * This method uses Three.js TextureLoader to load various image formats
34
+ * (JPG, PNG, WebP, etc.) and creates a texture with proper color space
35
+ * settings for 3D rendering.
36
+ *
37
+ * @param url - The URL of the image file to load
38
+ * @returns A promise that resolves when the image is loaded and ready
39
+ * @throws Error if the image cannot be loaded or processed
40
+ */
41
+ load(url: string): Promise<void>;
42
+ /**
43
+ * Disposes of the loaded texture and resets internal state.
44
+ *
45
+ * This method cleans up the Three.js texture to prevent memory leaks
46
+ * and resets the size information.
47
+ */
48
+ dispose(): void;
49
+ }
@@ -0,0 +1,87 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import * as THREE from 'three';
11
+ /**
12
+ * Data source for loading static images as textures in a 3D scene.
13
+ *
14
+ * This class implements the IMapDataSource interface to provide static image
15
+ * loading capabilities for map layers. It uses Three.js TextureLoader to load
16
+ * various image formats and create textures suitable for 3D rendering.
17
+ */
18
+ export class ImageDataSource {
19
+ constructor() {
20
+ /** The loaded texture from the image file */
21
+ this.texture = null;
22
+ /** Dimensions of the loaded image */
23
+ this.size = null;
24
+ /** Three.js texture loader instance for loading images */
25
+ this.loader = new THREE.TextureLoader();
26
+ }
27
+ /**
28
+ * Gets the Three.js texture containing the loaded image.
29
+ *
30
+ * @returns The texture with the loaded image, or null if not loaded
31
+ */
32
+ getTexture() {
33
+ return this.texture;
34
+ }
35
+ /**
36
+ * Gets the dimensions of the loaded image.
37
+ *
38
+ * @returns The width and height of the image, or null if not loaded
39
+ */
40
+ getSize() {
41
+ return this.size;
42
+ }
43
+ /**
44
+ * Loads an image from a URL and creates a texture.
45
+ *
46
+ * This method uses Three.js TextureLoader to load various image formats
47
+ * (JPG, PNG, WebP, etc.) and creates a texture with proper color space
48
+ * settings for 3D rendering.
49
+ *
50
+ * @param url - The URL of the image file to load
51
+ * @returns A promise that resolves when the image is loaded and ready
52
+ * @throws Error if the image cannot be loaded or processed
53
+ */
54
+ load(url) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ // Dispose of previous texture if it exists
57
+ this.dispose();
58
+ return new Promise((resolve, reject) => {
59
+ this.loader.load(url, (texture) => {
60
+ texture.colorSpace = THREE.SRGBColorSpace;
61
+ this.texture = texture;
62
+ this.size = {
63
+ width: texture.image.width,
64
+ height: texture.image.height
65
+ };
66
+ resolve();
67
+ }, undefined, (error) => {
68
+ console.error('Failed to load image:', error);
69
+ reject(error);
70
+ });
71
+ });
72
+ });
73
+ }
74
+ /**
75
+ * Disposes of the loaded texture and resets internal state.
76
+ *
77
+ * This method cleans up the Three.js texture to prevent memory leaks
78
+ * and resets the size information.
79
+ */
80
+ dispose() {
81
+ if (this.texture) {
82
+ this.texture.dispose();
83
+ this.texture = null;
84
+ }
85
+ this.size = null;
86
+ }
87
+ }
@@ -0,0 +1,52 @@
1
+ import * as THREE from 'three';
2
+ import type { Size } from '../../../types';
3
+ import type { IMapDataSource } from './IMapDataSource';
4
+ /**
5
+ * Data source for loading and playing video files as textures in a 3D scene.
6
+ *
7
+ * This class implements the IMapDataSource interface to provide video playback
8
+ * capabilities for map layers. It creates an HTML video element, sets up
9
+ * proper video attributes for web playback, and creates a Three.js VideoTexture
10
+ * for real-time video rendering in 3D space.
11
+ */
12
+ export declare class VideoDataSource implements IMapDataSource {
13
+ /** HTML video element used for video playback */
14
+ private videoElement;
15
+ /** Three.js video texture created from the video element */
16
+ private texture;
17
+ /** Dimensions of the video */
18
+ private size;
19
+ /**
20
+ * Gets the Three.js video texture containing the playing video.
21
+ *
22
+ * @returns The video texture with the current video frame, or null if not loaded
23
+ */
24
+ getTexture(): THREE.Texture | null;
25
+ /**
26
+ * Gets the dimensions of the loaded video.
27
+ *
28
+ * @returns The width and height of the video, or null if not loaded
29
+ */
30
+ getSize(): Size | null;
31
+ /**
32
+ * Loads a video from a URL and starts playback.
33
+ *
34
+ * This method creates an HTML video element with appropriate attributes
35
+ * for web playback (autoplay, muted, loop, etc.), sets up event listeners
36
+ * for loading and error handling, and creates a Three.js VideoTexture
37
+ * for real-time rendering in 3D space.
38
+ *
39
+ * @param url - The URL of the video file to load
40
+ * @returns A promise that resolves when the video is loaded and ready to play
41
+ * @throws Error if the video cannot be loaded or played
42
+ */
43
+ load(url: string): Promise<void>;
44
+ /**
45
+ * Disposes of the video element and texture, stopping playback.
46
+ *
47
+ * This method stops video playback, removes the video source,
48
+ * disposes of the Three.js texture, and cleans up all references
49
+ * to prevent memory leaks.
50
+ */
51
+ dispose(): void;
52
+ }