@canonical/react-ds-app-launchpad 0.7.1-experimental.0 → 0.9.0-experimental.10

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 (393) hide show
  1. package/dist/esm/ui/EditableBlock/Context.js +4 -0
  2. package/dist/esm/ui/EditableBlock/Context.js.map +1 -0
  3. package/dist/esm/ui/EditableBlock/EditableBlock.js +33 -0
  4. package/dist/esm/ui/EditableBlock/EditableBlock.js.map +1 -0
  5. package/dist/esm/ui/EditableBlock/EditableBlock.test.js +57 -0
  6. package/dist/esm/ui/EditableBlock/EditableBlock.test.js.map +1 -0
  7. package/dist/esm/ui/EditableBlock/hooks/index.js +2 -0
  8. package/dist/esm/ui/EditableBlock/hooks/index.js.map +1 -0
  9. package/dist/esm/ui/EditableBlock/hooks/useEditableBlock.js +11 -0
  10. package/dist/esm/ui/EditableBlock/hooks/useEditableBlock.js.map +1 -0
  11. package/dist/esm/ui/EditableBlock/index.js +3 -0
  12. package/dist/esm/ui/EditableBlock/index.js.map +1 -0
  13. package/dist/esm/ui/EditableBlock/styles.css +38 -0
  14. package/dist/esm/ui/EditableBlock/types.js.map +1 -0
  15. package/dist/esm/ui/FileTree/Context.js +4 -0
  16. package/dist/esm/ui/FileTree/Context.js.map +1 -0
  17. package/dist/esm/ui/FileTree/Provider.js +74 -0
  18. package/dist/esm/ui/FileTree/Provider.js.map +1 -0
  19. package/dist/esm/ui/FileTree/common/File/File.js +12 -0
  20. package/dist/esm/ui/FileTree/common/File/File.js.map +1 -0
  21. package/dist/esm/ui/FileTree/common/File/index.js +4 -0
  22. package/dist/esm/ui/FileTree/common/File/index.js.map +1 -0
  23. package/dist/esm/ui/FileTree/common/File/styles.css +4 -0
  24. package/dist/esm/ui/FileTree/common/File/types.js.map +1 -0
  25. package/dist/esm/ui/FileTree/common/Folder/Folder.js +12 -0
  26. package/dist/esm/ui/FileTree/common/Folder/Folder.js.map +1 -0
  27. package/dist/esm/ui/FileTree/common/Folder/index.js +4 -0
  28. package/dist/esm/ui/FileTree/common/Folder/index.js.map +1 -0
  29. package/dist/esm/ui/FileTree/common/Folder/styles.css +4 -0
  30. package/dist/esm/ui/FileTree/common/Folder/types.js +2 -0
  31. package/dist/esm/ui/FileTree/common/Folder/types.js.map +1 -0
  32. package/dist/esm/ui/FileTree/common/IndentationBlock/IndentationBlock.js +16 -0
  33. package/dist/esm/ui/FileTree/common/IndentationBlock/IndentationBlock.js.map +1 -0
  34. package/dist/esm/ui/FileTree/common/IndentationBlock/index.js +4 -0
  35. package/dist/esm/ui/FileTree/common/IndentationBlock/index.js.map +1 -0
  36. package/dist/esm/ui/FileTree/common/IndentationBlock/styles.css +32 -0
  37. package/dist/esm/ui/FileTree/common/IndentationBlock/types.js +2 -0
  38. package/dist/esm/ui/FileTree/common/IndentationBlock/types.js.map +1 -0
  39. package/dist/esm/ui/FileTree/common/Node/Context.js +10 -0
  40. package/dist/esm/ui/FileTree/common/Node/Context.js.map +1 -0
  41. package/dist/esm/ui/FileTree/common/Node/Provider.js +163 -0
  42. package/dist/esm/ui/FileTree/common/Node/Provider.js.map +1 -0
  43. package/dist/esm/ui/FileTree/common/Node/hooks/index.js +2 -0
  44. package/dist/esm/ui/FileTree/common/Node/hooks/index.js.map +1 -0
  45. package/dist/esm/ui/FileTree/common/Node/hooks/useNode.js +12 -0
  46. package/dist/esm/ui/FileTree/common/Node/hooks/useNode.js.map +1 -0
  47. package/dist/esm/ui/FileTree/common/Node/index.js +4 -0
  48. package/dist/esm/ui/FileTree/common/Node/index.js.map +1 -0
  49. package/dist/esm/ui/FileTree/common/Node/styles.css +60 -0
  50. package/dist/esm/ui/FileTree/common/Node/types.js +2 -0
  51. package/dist/esm/ui/FileTree/common/Node/types.js.map +1 -0
  52. package/dist/esm/ui/FileTree/common/SearchBox/SearchBox.js +31 -0
  53. package/dist/esm/ui/FileTree/common/SearchBox/SearchBox.js.map +1 -0
  54. package/dist/esm/ui/FileTree/common/SearchBox/index.js +4 -0
  55. package/dist/esm/ui/FileTree/common/SearchBox/index.js.map +1 -0
  56. package/dist/esm/ui/FileTree/common/SearchBox/styles.css +61 -0
  57. package/dist/esm/ui/FileTree/common/SearchBox/types.js +2 -0
  58. package/dist/esm/ui/FileTree/common/SearchBox/types.js.map +1 -0
  59. package/dist/esm/ui/FileTree/common/TreeView/TreeView.js +60 -0
  60. package/dist/esm/ui/FileTree/common/TreeView/TreeView.js.map +1 -0
  61. package/dist/esm/ui/FileTree/common/TreeView/index.js +4 -0
  62. package/dist/esm/ui/FileTree/common/TreeView/index.js.map +1 -0
  63. package/dist/esm/ui/FileTree/common/TreeView/types.js +2 -0
  64. package/dist/esm/ui/FileTree/common/TreeView/types.js.map +1 -0
  65. package/dist/esm/ui/FileTree/common/index.js +5 -0
  66. package/dist/esm/ui/FileTree/common/index.js.map +1 -0
  67. package/dist/esm/ui/FileTree/hooks/index.js +2 -0
  68. package/dist/esm/ui/FileTree/hooks/index.js.map +1 -0
  69. package/dist/esm/ui/FileTree/hooks/useFileTree.js +11 -0
  70. package/dist/esm/ui/FileTree/hooks/useFileTree.js.map +1 -0
  71. package/dist/esm/ui/FileTree/index.js +10 -0
  72. package/dist/esm/ui/FileTree/index.js.map +1 -0
  73. package/dist/esm/ui/FileTree/styles.css +47 -0
  74. package/dist/esm/ui/FileTree/types.js +2 -0
  75. package/dist/esm/ui/{Button → FileTree}/types.js.map +1 -1
  76. package/dist/esm/ui/FileTree/utils/hashNodeName.js +11 -0
  77. package/dist/esm/ui/FileTree/utils/hashNodeName.js.map +1 -0
  78. package/dist/esm/ui/FileTree/utils/index.js +2 -0
  79. package/dist/esm/ui/FileTree/utils/index.js.map +1 -0
  80. package/dist/esm/ui/GitDiffViewer/Context.js +4 -0
  81. package/dist/esm/ui/GitDiffViewer/Context.js.map +1 -0
  82. package/dist/esm/ui/GitDiffViewer/Provider.js +31 -0
  83. package/dist/esm/ui/GitDiffViewer/Provider.js.map +1 -0
  84. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/CodeDiffViewer.js +119 -0
  85. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/CodeDiffViewer.js.map +1 -0
  86. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/HighlighTheme.css +171 -0
  87. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/DiffLine.js +33 -0
  88. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/DiffLine.js.map +1 -0
  89. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/index.js +4 -0
  90. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/index.js.map +1 -0
  91. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/styles.css +111 -0
  92. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/types.js +2 -0
  93. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/types.js.map +1 -0
  94. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/index.js +2 -0
  95. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/common/index.js.map +1 -0
  96. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/index.js +4 -0
  97. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/index.js.map +1 -0
  98. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/styles.css +39 -0
  99. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/types.js +2 -0
  100. package/dist/esm/ui/GitDiffViewer/common/CodeDiffViewer/types.js.map +1 -0
  101. package/dist/esm/ui/GitDiffViewer/common/FileHeader/FileHeader.js +35 -0
  102. package/dist/esm/ui/GitDiffViewer/common/FileHeader/FileHeader.js.map +1 -0
  103. package/dist/esm/ui/GitDiffViewer/common/FileHeader/index.js +4 -0
  104. package/dist/esm/ui/GitDiffViewer/common/FileHeader/index.js.map +1 -0
  105. package/dist/esm/ui/GitDiffViewer/common/FileHeader/styles.css +75 -0
  106. package/dist/esm/ui/GitDiffViewer/common/FileHeader/types.js +2 -0
  107. package/dist/esm/ui/GitDiffViewer/common/FileHeader/types.js.map +1 -0
  108. package/dist/esm/ui/GitDiffViewer/common/index.js +3 -0
  109. package/dist/esm/ui/GitDiffViewer/common/index.js.map +1 -0
  110. package/dist/esm/ui/GitDiffViewer/hooks/index.js +2 -0
  111. package/dist/esm/ui/GitDiffViewer/hooks/index.js.map +1 -0
  112. package/dist/esm/ui/GitDiffViewer/hooks/useGitDiffViewer.js +11 -0
  113. package/dist/esm/ui/GitDiffViewer/hooks/useGitDiffViewer.js.map +1 -0
  114. package/dist/esm/ui/GitDiffViewer/index.js +9 -0
  115. package/dist/esm/ui/GitDiffViewer/index.js.map +1 -0
  116. package/dist/esm/ui/GitDiffViewer/styles.css +38 -0
  117. package/dist/esm/ui/GitDiffViewer/types.js +2 -0
  118. package/dist/esm/ui/GitDiffViewer/types.js.map +1 -0
  119. package/dist/esm/ui/GitDiffViewer/utils/index.js +2 -0
  120. package/dist/esm/ui/GitDiffViewer/utils/index.js.map +1 -0
  121. package/dist/esm/ui/GitDiffViewer/utils/parseGitDiff.js +73 -0
  122. package/dist/esm/ui/GitDiffViewer/utils/parseGitDiff.js.map +1 -0
  123. package/dist/esm/ui/MarkdownEditor/MarkdownEditor.js +74 -0
  124. package/dist/esm/ui/MarkdownEditor/MarkdownEditor.js.map +1 -0
  125. package/dist/esm/ui/MarkdownEditor/common/Toolbar/Toolbar.js +52 -0
  126. package/dist/esm/ui/MarkdownEditor/common/Toolbar/Toolbar.js.map +1 -0
  127. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/Button.js +19 -0
  128. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/Button.js.map +1 -0
  129. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/index.js +4 -0
  130. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/index.js.map +1 -0
  131. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/styles.css +17 -0
  132. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/types.js +2 -0
  133. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Button/types.js.map +1 -0
  134. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/Group.js +13 -0
  135. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/Group.js.map +1 -0
  136. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/index.js +4 -0
  137. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/index.js.map +1 -0
  138. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/styles.css +7 -0
  139. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/types.js +2 -0
  140. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Group/types.js.map +1 -0
  141. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/Separator.js +13 -0
  142. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/Separator.js.map +1 -0
  143. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/index.js +4 -0
  144. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/index.js.map +1 -0
  145. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/styles.css +7 -0
  146. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/types.js +2 -0
  147. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/Separator/types.js.map +1 -0
  148. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/index.js +4 -0
  149. package/dist/esm/ui/MarkdownEditor/common/Toolbar/common/index.js.map +1 -0
  150. package/dist/esm/ui/MarkdownEditor/common/Toolbar/index.js +9 -0
  151. package/dist/esm/ui/MarkdownEditor/common/Toolbar/index.js.map +1 -0
  152. package/dist/esm/ui/MarkdownEditor/common/Toolbar/styles.css +16 -0
  153. package/dist/esm/ui/MarkdownEditor/common/Toolbar/types.js +2 -0
  154. package/dist/esm/ui/MarkdownEditor/common/Toolbar/types.js.map +1 -0
  155. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/ViewModeTabs.js +34 -0
  156. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/ViewModeTabs.js.map +1 -0
  157. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/index.js +4 -0
  158. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/index.js.map +1 -0
  159. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/styles.css +42 -0
  160. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/types.js +2 -0
  161. package/dist/esm/ui/MarkdownEditor/common/ViewModeTabs/types.js.map +1 -0
  162. package/dist/esm/ui/MarkdownEditor/common/icons.js +10 -0
  163. package/dist/esm/ui/MarkdownEditor/common/icons.js.map +1 -0
  164. package/dist/esm/ui/MarkdownEditor/common/index.js +4 -0
  165. package/dist/esm/ui/MarkdownEditor/common/index.js.map +1 -0
  166. package/dist/esm/ui/MarkdownEditor/hooks/index.js +2 -0
  167. package/dist/esm/ui/MarkdownEditor/hooks/index.js.map +1 -0
  168. package/dist/esm/ui/MarkdownEditor/hooks/useEditor.js +277 -0
  169. package/dist/esm/ui/MarkdownEditor/hooks/useEditor.js.map +1 -0
  170. package/dist/esm/ui/MarkdownEditor/index.js +4 -0
  171. package/dist/esm/ui/MarkdownEditor/index.js.map +1 -0
  172. package/dist/esm/ui/MarkdownEditor/styles.css +69 -0
  173. package/dist/esm/ui/MarkdownEditor/types.js +2 -0
  174. package/dist/esm/ui/MarkdownEditor/types.js.map +1 -0
  175. package/dist/esm/ui/RelativeTime/RelativeTime.js +66 -0
  176. package/dist/esm/ui/RelativeTime/RelativeTime.js.map +1 -0
  177. package/dist/esm/ui/RelativeTime/index.js +4 -0
  178. package/dist/esm/ui/RelativeTime/index.js.map +1 -0
  179. package/dist/esm/ui/RelativeTime/types.js +2 -0
  180. package/dist/esm/ui/{Chip → RelativeTime}/types.js.map +1 -1
  181. package/dist/esm/ui/RelativeTime/utils/constants.js +6 -0
  182. package/dist/esm/ui/RelativeTime/utils/constants.js.map +1 -0
  183. package/dist/esm/ui/RelativeTime/utils/formatHumanTime.js +43 -0
  184. package/dist/esm/ui/RelativeTime/utils/formatHumanTime.js.map +1 -0
  185. package/dist/esm/ui/RelativeTime/utils/getOptimalUpdateInterval.js +24 -0
  186. package/dist/esm/ui/RelativeTime/utils/getOptimalUpdateInterval.js.map +1 -0
  187. package/dist/esm/ui/RelativeTime/utils/index.js +4 -0
  188. package/dist/esm/ui/RelativeTime/utils/index.js.map +1 -0
  189. package/dist/esm/ui/RelativeTime/utils/parseInstant.js +22 -0
  190. package/dist/esm/ui/RelativeTime/utils/parseInstant.js.map +1 -0
  191. package/dist/esm/ui/index.js +5 -1
  192. package/dist/esm/ui/index.js.map +1 -1
  193. package/dist/types/ui/EditableBlock/Context.d.ts +4 -0
  194. package/dist/types/ui/EditableBlock/Context.d.ts.map +1 -0
  195. package/dist/types/ui/EditableBlock/EditableBlock.d.ts +10 -0
  196. package/dist/types/ui/EditableBlock/EditableBlock.d.ts.map +1 -0
  197. package/dist/types/ui/EditableBlock/EditableBlock.test.d.ts +2 -0
  198. package/dist/types/ui/EditableBlock/EditableBlock.test.d.ts.map +1 -0
  199. package/dist/types/ui/EditableBlock/hooks/index.d.ts +2 -0
  200. package/dist/types/ui/EditableBlock/hooks/index.d.ts.map +1 -0
  201. package/dist/types/ui/EditableBlock/hooks/useEditableBlock.d.ts +4 -0
  202. package/dist/types/ui/EditableBlock/hooks/useEditableBlock.d.ts.map +1 -0
  203. package/dist/types/ui/EditableBlock/index.d.ts +3 -0
  204. package/dist/types/ui/EditableBlock/index.d.ts.map +1 -0
  205. package/dist/types/ui/EditableBlock/types.d.ts +24 -0
  206. package/dist/types/ui/EditableBlock/types.d.ts.map +1 -0
  207. package/dist/types/ui/FileTree/Context.d.ts +4 -0
  208. package/dist/types/ui/FileTree/Context.d.ts.map +1 -0
  209. package/dist/types/ui/FileTree/Provider.d.ts +7 -0
  210. package/dist/types/ui/FileTree/Provider.d.ts.map +1 -0
  211. package/dist/types/ui/FileTree/common/File/File.d.ts +10 -0
  212. package/dist/types/ui/FileTree/common/File/File.d.ts.map +1 -0
  213. package/dist/types/ui/FileTree/common/File/index.d.ts +3 -0
  214. package/dist/types/ui/FileTree/common/File/index.d.ts.map +1 -0
  215. package/dist/types/ui/FileTree/common/File/types.d.ts +16 -0
  216. package/dist/types/ui/FileTree/common/File/types.d.ts.map +1 -0
  217. package/dist/types/ui/FileTree/common/Folder/Folder.d.ts +10 -0
  218. package/dist/types/ui/FileTree/common/Folder/Folder.d.ts.map +1 -0
  219. package/dist/types/ui/FileTree/common/Folder/index.d.ts +3 -0
  220. package/dist/types/ui/FileTree/common/Folder/index.d.ts.map +1 -0
  221. package/dist/types/ui/FileTree/common/Folder/types.d.ts +16 -0
  222. package/dist/types/ui/FileTree/common/Folder/types.d.ts.map +1 -0
  223. package/dist/types/ui/FileTree/common/IndentationBlock/IndentationBlock.d.ts +10 -0
  224. package/dist/types/ui/FileTree/common/IndentationBlock/IndentationBlock.d.ts.map +1 -0
  225. package/dist/types/ui/FileTree/common/IndentationBlock/index.d.ts +3 -0
  226. package/dist/types/ui/FileTree/common/IndentationBlock/index.d.ts.map +1 -0
  227. package/dist/types/ui/FileTree/common/IndentationBlock/types.d.ts +12 -0
  228. package/dist/types/ui/FileTree/common/IndentationBlock/types.d.ts.map +1 -0
  229. package/dist/types/ui/FileTree/common/Node/Context.d.ts +5 -0
  230. package/dist/types/ui/FileTree/common/Node/Context.d.ts.map +1 -0
  231. package/dist/types/ui/FileTree/common/Node/Provider.d.ts +6 -0
  232. package/dist/types/ui/FileTree/common/Node/Provider.d.ts.map +1 -0
  233. package/dist/types/ui/FileTree/common/Node/hooks/index.d.ts +2 -0
  234. package/dist/types/ui/FileTree/common/Node/hooks/index.d.ts.map +1 -0
  235. package/dist/types/ui/FileTree/common/Node/hooks/useNode.d.ts +3 -0
  236. package/dist/types/ui/FileTree/common/Node/hooks/useNode.d.ts.map +1 -0
  237. package/dist/types/ui/FileTree/common/Node/index.d.ts +5 -0
  238. package/dist/types/ui/FileTree/common/Node/index.d.ts.map +1 -0
  239. package/dist/types/ui/FileTree/common/Node/types.d.ts +28 -0
  240. package/dist/types/ui/FileTree/common/Node/types.d.ts.map +1 -0
  241. package/dist/types/ui/FileTree/common/SearchBox/SearchBox.d.ts +10 -0
  242. package/dist/types/ui/FileTree/common/SearchBox/SearchBox.d.ts.map +1 -0
  243. package/dist/types/ui/FileTree/common/SearchBox/index.d.ts +3 -0
  244. package/dist/types/ui/FileTree/common/SearchBox/index.d.ts.map +1 -0
  245. package/dist/types/ui/FileTree/common/SearchBox/types.d.ts +12 -0
  246. package/dist/types/ui/FileTree/common/SearchBox/types.d.ts.map +1 -0
  247. package/dist/types/ui/FileTree/common/TreeView/TreeView.d.ts +16 -0
  248. package/dist/types/ui/FileTree/common/TreeView/TreeView.d.ts.map +1 -0
  249. package/dist/types/ui/FileTree/common/TreeView/index.d.ts +3 -0
  250. package/dist/types/ui/FileTree/common/TreeView/index.d.ts.map +1 -0
  251. package/dist/types/ui/FileTree/common/TreeView/types.d.ts +20 -0
  252. package/dist/types/ui/FileTree/common/TreeView/types.d.ts.map +1 -0
  253. package/dist/types/ui/FileTree/common/index.d.ts +5 -0
  254. package/dist/types/ui/FileTree/common/index.d.ts.map +1 -0
  255. package/dist/types/ui/FileTree/hooks/index.d.ts +2 -0
  256. package/dist/types/ui/FileTree/hooks/index.d.ts.map +1 -0
  257. package/dist/types/ui/FileTree/hooks/useFileTree.d.ts +3 -0
  258. package/dist/types/ui/FileTree/hooks/useFileTree.d.ts.map +1 -0
  259. package/dist/types/ui/FileTree/index.d.ts +5 -0
  260. package/dist/types/ui/FileTree/index.d.ts.map +1 -0
  261. package/dist/types/ui/FileTree/types.d.ts +69 -0
  262. package/dist/types/ui/FileTree/types.d.ts.map +1 -0
  263. package/dist/types/ui/FileTree/utils/hashNodeName.d.ts +3 -0
  264. package/dist/types/ui/FileTree/utils/hashNodeName.d.ts.map +1 -0
  265. package/dist/types/ui/FileTree/utils/index.d.ts +2 -0
  266. package/dist/types/ui/FileTree/utils/index.d.ts.map +1 -0
  267. package/dist/types/ui/GitDiffViewer/Context.d.ts +4 -0
  268. package/dist/types/ui/GitDiffViewer/Context.d.ts.map +1 -0
  269. package/dist/types/ui/GitDiffViewer/Provider.d.ts +5 -0
  270. package/dist/types/ui/GitDiffViewer/Provider.d.ts.map +1 -0
  271. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/CodeDiffViewer.d.ts +16 -0
  272. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/CodeDiffViewer.d.ts.map +1 -0
  273. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/DiffLine.d.ts +11 -0
  274. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/DiffLine.d.ts.map +1 -0
  275. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/index.d.ts +3 -0
  276. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/index.d.ts.map +1 -0
  277. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/types.d.ts +20 -0
  278. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/DiffLine/types.d.ts.map +1 -0
  279. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/index.d.ts +2 -0
  280. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/common/index.d.ts.map +1 -0
  281. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/index.d.ts +3 -0
  282. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/index.d.ts.map +1 -0
  283. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/types.d.ts +18 -0
  284. package/dist/types/ui/GitDiffViewer/common/CodeDiffViewer/types.d.ts.map +1 -0
  285. package/dist/types/ui/GitDiffViewer/common/FileHeader/FileHeader.d.ts +15 -0
  286. package/dist/types/ui/GitDiffViewer/common/FileHeader/FileHeader.d.ts.map +1 -0
  287. package/dist/types/ui/GitDiffViewer/common/FileHeader/index.d.ts +3 -0
  288. package/dist/types/ui/GitDiffViewer/common/FileHeader/index.d.ts.map +1 -0
  289. package/dist/types/ui/GitDiffViewer/common/FileHeader/types.d.ts +17 -0
  290. package/dist/types/ui/GitDiffViewer/common/FileHeader/types.d.ts.map +1 -0
  291. package/dist/types/ui/GitDiffViewer/common/index.d.ts +3 -0
  292. package/dist/types/ui/GitDiffViewer/common/index.d.ts.map +1 -0
  293. package/dist/types/ui/GitDiffViewer/hooks/index.d.ts +2 -0
  294. package/dist/types/ui/GitDiffViewer/hooks/index.d.ts.map +1 -0
  295. package/dist/types/ui/GitDiffViewer/hooks/useGitDiffViewer.d.ts +3 -0
  296. package/dist/types/ui/GitDiffViewer/hooks/useGitDiffViewer.d.ts.map +1 -0
  297. package/dist/types/ui/GitDiffViewer/index.d.ts +6 -0
  298. package/dist/types/ui/GitDiffViewer/index.d.ts.map +1 -0
  299. package/dist/types/ui/GitDiffViewer/types.d.ts +77 -0
  300. package/dist/types/ui/GitDiffViewer/types.d.ts.map +1 -0
  301. package/dist/types/ui/GitDiffViewer/utils/index.d.ts +2 -0
  302. package/dist/types/ui/GitDiffViewer/utils/index.d.ts.map +1 -0
  303. package/dist/types/ui/GitDiffViewer/utils/parseGitDiff.d.ts +4 -0
  304. package/dist/types/ui/GitDiffViewer/utils/parseGitDiff.d.ts.map +1 -0
  305. package/dist/types/ui/MarkdownEditor/MarkdownEditor.d.ts +10 -0
  306. package/dist/types/ui/MarkdownEditor/MarkdownEditor.d.ts.map +1 -0
  307. package/dist/types/ui/MarkdownEditor/common/Toolbar/Toolbar.d.ts +8 -0
  308. package/dist/types/ui/MarkdownEditor/common/Toolbar/Toolbar.d.ts.map +1 -0
  309. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Button/Button.d.ts +9 -0
  310. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Button/Button.d.ts.map +1 -0
  311. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Button/index.d.ts +3 -0
  312. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Button/index.d.ts.map +1 -0
  313. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Button/types.d.ts +14 -0
  314. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Button/types.d.ts.map +1 -0
  315. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Group/Group.d.ts +9 -0
  316. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Group/Group.d.ts.map +1 -0
  317. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Group/index.d.ts +3 -0
  318. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Group/index.d.ts.map +1 -0
  319. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Group/types.d.ts +14 -0
  320. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Group/types.d.ts.map +1 -0
  321. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Separator/Separator.d.ts +9 -0
  322. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Separator/Separator.d.ts.map +1 -0
  323. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Separator/index.d.ts +3 -0
  324. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Separator/index.d.ts.map +1 -0
  325. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Separator/types.d.ts +10 -0
  326. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/Separator/types.d.ts.map +1 -0
  327. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/index.d.ts +4 -0
  328. package/dist/types/ui/MarkdownEditor/common/Toolbar/common/index.d.ts.map +1 -0
  329. package/dist/types/ui/MarkdownEditor/common/Toolbar/index.d.ts +4 -0
  330. package/dist/types/ui/MarkdownEditor/common/Toolbar/index.d.ts.map +1 -0
  331. package/dist/types/ui/MarkdownEditor/common/Toolbar/types.d.ts +20 -0
  332. package/dist/types/ui/MarkdownEditor/common/Toolbar/types.d.ts.map +1 -0
  333. package/dist/types/ui/MarkdownEditor/common/ViewModeTabs/ViewModeTabs.d.ts +9 -0
  334. package/dist/types/ui/MarkdownEditor/common/ViewModeTabs/ViewModeTabs.d.ts.map +1 -0
  335. package/dist/types/ui/MarkdownEditor/common/ViewModeTabs/index.d.ts +3 -0
  336. package/dist/types/ui/MarkdownEditor/common/ViewModeTabs/index.d.ts.map +1 -0
  337. package/dist/types/ui/MarkdownEditor/common/ViewModeTabs/types.d.ts +14 -0
  338. package/dist/types/ui/MarkdownEditor/common/ViewModeTabs/types.d.ts.map +1 -0
  339. package/dist/types/ui/MarkdownEditor/common/icons.d.ts +9 -0
  340. package/dist/types/ui/MarkdownEditor/common/icons.d.ts.map +1 -0
  341. package/dist/types/ui/MarkdownEditor/common/index.d.ts +4 -0
  342. package/dist/types/ui/MarkdownEditor/common/index.d.ts.map +1 -0
  343. package/dist/types/ui/MarkdownEditor/hooks/index.d.ts +2 -0
  344. package/dist/types/ui/MarkdownEditor/hooks/index.d.ts.map +1 -0
  345. package/dist/types/ui/MarkdownEditor/hooks/useEditor.d.ts +40 -0
  346. package/dist/types/ui/MarkdownEditor/hooks/useEditor.d.ts.map +1 -0
  347. package/dist/types/ui/MarkdownEditor/index.d.ts +3 -0
  348. package/dist/types/ui/MarkdownEditor/index.d.ts.map +1 -0
  349. package/dist/types/ui/MarkdownEditor/types.d.ts +44 -0
  350. package/dist/types/ui/MarkdownEditor/types.d.ts.map +1 -0
  351. package/dist/types/ui/RelativeTime/RelativeTime.d.ts +11 -0
  352. package/dist/types/ui/RelativeTime/RelativeTime.d.ts.map +1 -0
  353. package/dist/types/ui/RelativeTime/index.d.ts +3 -0
  354. package/dist/types/ui/RelativeTime/index.d.ts.map +1 -0
  355. package/dist/types/ui/RelativeTime/types.d.ts +36 -0
  356. package/dist/types/ui/RelativeTime/types.d.ts.map +1 -0
  357. package/dist/types/ui/RelativeTime/utils/constants.d.ts +6 -0
  358. package/dist/types/ui/RelativeTime/utils/constants.d.ts.map +1 -0
  359. package/dist/types/ui/RelativeTime/utils/formatHumanTime.d.ts +21 -0
  360. package/dist/types/ui/RelativeTime/utils/formatHumanTime.d.ts.map +1 -0
  361. package/dist/types/ui/RelativeTime/utils/getOptimalUpdateInterval.d.ts +8 -0
  362. package/dist/types/ui/RelativeTime/utils/getOptimalUpdateInterval.d.ts.map +1 -0
  363. package/dist/types/ui/RelativeTime/utils/index.d.ts +4 -0
  364. package/dist/types/ui/RelativeTime/utils/index.d.ts.map +1 -0
  365. package/dist/types/ui/RelativeTime/utils/parseInstant.d.ts +9 -0
  366. package/dist/types/ui/RelativeTime/utils/parseInstant.d.ts.map +1 -0
  367. package/dist/types/ui/index.d.ts +5 -1
  368. package/dist/types/ui/index.d.ts.map +1 -1
  369. package/package.json +20 -19
  370. package/dist/esm/ui/Button/Button.js +0 -10
  371. package/dist/esm/ui/Button/Button.js.map +0 -1
  372. package/dist/esm/ui/Button/index.js +0 -2
  373. package/dist/esm/ui/Button/index.js.map +0 -1
  374. package/dist/esm/ui/Button/styles.css +0 -63
  375. package/dist/esm/ui/Chip/Chip.css +0 -79
  376. package/dist/esm/ui/Chip/Chip.js +0 -15
  377. package/dist/esm/ui/Chip/Chip.js.map +0 -1
  378. package/dist/esm/ui/Chip/index.js +0 -4
  379. package/dist/esm/ui/Chip/index.js.map +0 -1
  380. package/dist/types/ui/Button/Button.d.ts +0 -6
  381. package/dist/types/ui/Button/Button.d.ts.map +0 -1
  382. package/dist/types/ui/Button/index.d.ts +0 -3
  383. package/dist/types/ui/Button/index.d.ts.map +0 -1
  384. package/dist/types/ui/Button/types.d.ts +0 -15
  385. package/dist/types/ui/Button/types.d.ts.map +0 -1
  386. package/dist/types/ui/Chip/Chip.d.ts +0 -10
  387. package/dist/types/ui/Chip/Chip.d.ts.map +0 -1
  388. package/dist/types/ui/Chip/index.d.ts +0 -3
  389. package/dist/types/ui/Chip/index.d.ts.map +0 -1
  390. package/dist/types/ui/Chip/types.d.ts +0 -27
  391. package/dist/types/ui/Chip/types.d.ts.map +0 -1
  392. /package/dist/esm/ui/{Button → EditableBlock}/types.js +0 -0
  393. /package/dist/esm/ui/{Chip → FileTree/common/File}/types.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/Provider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,cAAc,CAAC;AAGtB,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AACxC,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAC5C,MAAM,sBAAsB,GAAG,YAAY,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAC,EAChB,EAAE,EACF,SAAS,EACT,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,GAAG,WAAW,EACA,EAA6B,EAAE;IAC7C,MAAM,EACJ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,yBAAyB,GAC1B,GAAG,WAAW,EAAE,CAAC;IAClB,MAAM,OAAO,GAAG,MAAM,CAAe;QACnC,IAAI;QACJ,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,WAAW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IAAI,CAAC,GAAG,CAAC,EACZ,IAAI,EAAC,UAAU,mBAEb,WAAW,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,mBAE7C,UAAU,EACzB,QAAQ,EAAE,CAAC,CAAC,EACZ,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,aAExB,KAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,GAAI,EAClC,cACE,SAAS,EAAE;4BACT,MAAM;4BACN,WAAW,CAAC,QAAQ;4BACpB,UAAU,IAAI,oBAAoB;yBACnC;6BACE,MAAM,CAAC,OAAO,CAAC;6BACf,IAAI,CAAC,GAAG,CAAC,GACZ,EACF,eAAM,SAAS,EAAC,UAAU,YAAE,IAAI,GAAQ,EACvC,MAAM,IAAI,cAAK,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAO,IAC9C,CACN,EACA,WAAW,CAAC,QAAQ,KAAK,QAAQ;gBAChC,CAAC,UAAU,IAAI,UAAU,KAAK,KAAK,CAAC;gBACpC,QAAQ,IACO,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as useNode } from "./useNode.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/ui/FileTree/common/Node/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { useContext } from "react";
2
+ import Context, { rootLevelEmptyContext } from "../Context.js";
3
+ const useNode = () => {
4
+ const context = useContext(Context);
5
+ if (!context) {
6
+ // if no folder parent is found, that means file is at root level
7
+ return rootLevelEmptyContext;
8
+ }
9
+ return context;
10
+ };
11
+ export default useNode;
12
+ //# sourceMappingURL=useNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNode.js","sourceRoot":"","sources":["../../../../../../../src/ui/FileTree/common/Node/hooks/useNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,EAAE,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,OAAO,GAAG,GAAG,EAAE;IACnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,iEAAiE;QACjE,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as Context } from "./Context.js";
2
+ export * from "./hooks/index.js";
3
+ export { default as Node } from "./Provider.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,60 @@
1
+ .ds.node {
2
+ list-style: none;
3
+ display: flex;
4
+ gap: var(--file-tree-node-items-gap);
5
+ align-items: center;
6
+ /* vertical padding is set on the indentation level */
7
+ padding: 0 var(--file-tree-node-horizontal-padding);
8
+ cursor: default;
9
+ color: var(--file-tree-node-text-color-default);
10
+
11
+ /* When the list is interactive we change colors on interactions */
12
+ &.selectable,
13
+ &.expandable {
14
+ cursor: pointer;
15
+ &:focus,
16
+ &:hover {
17
+ background-color: var(--file-tree-node-background-color-hover);
18
+ }
19
+ &:focus {
20
+ outline: 1px solid var(--file-tree-node-focus-outline-color);
21
+ outline-offset: -1px;
22
+ color: var(--file-tree-node-text-color-active);
23
+ & > .icon {
24
+ filter: opacity(1);
25
+ }
26
+ }
27
+ }
28
+
29
+ /* When the list is static we apply active colors */
30
+ &:not(.selectable):not(.expandable) {
31
+ color: var(--file-tree-node-text-color-active);
32
+ & > .icon {
33
+ filter: opacity(1);
34
+ }
35
+ }
36
+
37
+ & > .icon {
38
+ user-select: none;
39
+ width: var(--file-tree-node-icon-size);
40
+ filter: opacity(0.6);
41
+ &.file {
42
+ content: var(--file-tree-node-file-icon);
43
+ }
44
+ &.folder {
45
+ content: var(--file-tree-node-closed-folder-icon);
46
+ &.expanded {
47
+ content: var(--file-tree-node-opened-folder-icon);
48
+ }
49
+ }
50
+ }
51
+ & > .nodename {
52
+ flex: 1;
53
+ white-space: nowrap;
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ }
57
+ & > .marker {
58
+ display: inline-block;
59
+ }
60
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/Node/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import useFileTree from "../../hooks/useFileTree.js";
4
+ import "./styles.css";
5
+ const componentCssClassName = "ds search-box";
6
+ /**
7
+ * description of the SearchBox component
8
+ * @returns {React.ReactElement} - Rendered SearchBox
9
+ */
10
+ const SearchBox = ({ id, children, className, style, }) => {
11
+ const { searchQuery, onSearch } = useFileTree();
12
+ if (!onSearch) {
13
+ return null;
14
+ }
15
+ const handleSearch = useCallback((event) => {
16
+ event.preventDefault();
17
+ const formData = new FormData(event.currentTarget);
18
+ onSearch(formData.get("search"));
19
+ }, [onSearch]);
20
+ const handleReset = useCallback((event) => {
21
+ event.preventDefault();
22
+ onSearch("");
23
+ }, [onSearch]);
24
+ const handleInputUpdate = useCallback((event) => {
25
+ onSearch(event.currentTarget.value);
26
+ event.preventDefault();
27
+ }, [onSearch]);
28
+ return (_jsxs("form", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), onSubmit: handleSearch, onReset: handleReset, children: [_jsx("input", { value: searchQuery, onChange: handleInputUpdate, name: "search", className: "input", type: "search", placeholder: "Search", required: true, autoComplete: "off" }), _jsx("button", { type: "reset", className: "reset", children: _jsx("span", { className: "icon" }) }), _jsx("button", { type: "submit", className: "search", children: _jsx("span", { className: "icon" }) })] }));
29
+ };
30
+ export default SearchBox;
31
+ //# sourceMappingURL=SearchBox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchBox.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/SearchBox/SearchBox.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,cAAc,CAAC;AAGtB,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAE9C;;;GAGG;AACH,MAAM,SAAS,GAAG,CAAC,EACjB,EAAE,EACF,QAAQ,EACR,SAAS,EACT,KAAK,GACU,EAA6B,EAAE;IAC9C,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;IAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,YAAY,GAA4C,WAAW,CACvE,CAAC,KAAK,EAAE,EAAE;QACR,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACnD,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAW,CAAC,CAAC;IAC7C,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IACF,MAAM,WAAW,GAA4C,WAAW,CACtE,CAAC,KAAK,EAAE,EAAE;QACR,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEF,MAAM,iBAAiB,GACrB,WAAW,CACT,CAAC,KAAK,EAAE,EAAE;QACR,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACpC,KAAK,CAAC,cAAc,EAAE,CAAC;IACzB,CAAC,EACD,CAAC,QAAQ,CAAC,CACX,CAAC;IAEJ,OAAO,CACL,gBACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,aAEpB,gBACE,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,OAAO,EACjB,IAAI,EAAC,QAAQ,EACb,WAAW,EAAC,QAAQ,EACpB,QAAQ,QACR,YAAY,EAAC,KAAK,GAClB,EACF,iBAAQ,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,YACpC,eAAM,SAAS,EAAC,MAAM,GAAG,GAClB,EACT,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,QAAQ,YACtC,eAAM,SAAS,EAAC,MAAM,GAAG,GAClB,IACJ,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.4 */
2
+ export { default as SearchBox } from "./SearchBox.js";
3
+ export * from "./types.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/SearchBox/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,cAAc,YAAY,CAAC"}
@@ -0,0 +1,61 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.4 */
2
+
3
+ .ds.search-box {
4
+ display: flex;
5
+ align-items: center;
6
+ border-bottom: 1px solid var(--file-tree-search-box-border-color);
7
+ padding: var(--file-tree-search-box-vertical-padding)
8
+ var(--file-tree-search-box-horizontal-padding);
9
+ &:has(.input:focus) {
10
+ outline: 2px solid -webkit-focus-ring-color;
11
+ outline-offset: -2px;
12
+ box-sizing: border-box;
13
+ }
14
+ & > .input {
15
+ flex: 1 1 100%;
16
+
17
+ vertical-align: baseline;
18
+ font-size: 1rem;
19
+ line-height: var(--file-tree-search-box-line-height);
20
+ }
21
+
22
+ & > .input:not(:valid) ~ .reset {
23
+ display: none;
24
+ }
25
+ & > .search,
26
+ & > .reset {
27
+ cursor: pointer;
28
+ width: var(--file-tree-search-box-button-size);
29
+ height: var(--file-tree-search-box-button-size);
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ background-color: transparent;
34
+ border: none;
35
+ }
36
+ & > .search > .icon {
37
+ content: var(--file-tree-search-box-search-icon);
38
+ }
39
+
40
+ & > .reset > .icon {
41
+ content: var(--file-tree-search-box-reset-icon);
42
+ }
43
+
44
+ /* remove search input default appearance */
45
+ & > .input {
46
+ border: none;
47
+ background-color: transparent;
48
+ &::-webkit-search-cancel-button {
49
+ appearance: none;
50
+ }
51
+ &:-webkit-autofill,
52
+ &:-webkit-autofill:hover,
53
+ &:-internal-autofill-selected,
54
+ &:active,
55
+ &:focus {
56
+ background-color: transparent;
57
+ border-color: transparent;
58
+ outline: none;
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/SearchBox/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useId, useMemo } from "react";
3
+ import File from "../File/File.js";
4
+ import Folder from "../Folder/Folder.js";
5
+ /**
6
+ * Render a tree view of the given file tree data
7
+ *
8
+ * @example
9
+ * <FileTree>
10
+ * <FileTree.SearchBox />
11
+ * <FileTree.TreeView tree={treeData} />
12
+ * </FileTree>
13
+ *
14
+ * @returns {React.ReactElement} - Rendered TreeView
15
+ */
16
+ const TreeView = ({ tree, sortAlphabetically, defaultCollapsed = false, }) => {
17
+ const uid = useId();
18
+ const renderNode = useCallback((node, basePath = "") => {
19
+ const path = `${basePath}/${node.name}`;
20
+ switch (node.type) {
21
+ case "folder":
22
+ return (_jsx(Folder, { name: node.name, defaultOpen: !defaultCollapsed, children: node.children?.map((child) => renderNode(child, path)) }, `${uid}-${path}`));
23
+ case "file":
24
+ return (_jsx(File, { name: node.name, marker: node.marker }, `${uid}-${path}`));
25
+ }
26
+ }, [defaultCollapsed, uid]);
27
+ const sortedTree = useCallback((tree) => {
28
+ return [...tree]
29
+ .sort((a, b) => {
30
+ // folders first
31
+ if (a.type === "folder" && b.type === "file") {
32
+ return -1;
33
+ }
34
+ if (a.type === "file" && b.type === "folder") {
35
+ return 1;
36
+ }
37
+ // sort alphabetically
38
+ return a.name.localeCompare(b.name);
39
+ })
40
+ .map((node) => {
41
+ if (node.type === "folder" && node.children) {
42
+ // sort recursively folder children
43
+ return {
44
+ ...node,
45
+ children: sortedTree(node.children),
46
+ };
47
+ }
48
+ return node;
49
+ });
50
+ }, []);
51
+ const treeNode = useMemo(() => {
52
+ if (sortAlphabetically) {
53
+ return sortedTree(tree).map((node) => renderNode(node));
54
+ }
55
+ return tree.map((node) => renderNode(node));
56
+ }, [tree, sortAlphabetically, renderNode, sortedTree]);
57
+ return _jsx(_Fragment, { children: treeNode });
58
+ };
59
+ export default TreeView;
60
+ //# sourceMappingURL=TreeView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/TreeView/TreeView.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAGzC;;;;;;;;;;GAUG;AACH,MAAM,QAAQ,GAAG,CAAC,EAChB,IAAI,EACJ,kBAAkB,EAClB,gBAAgB,GAAG,KAAK,GACV,EAAsB,EAAE;IACtC,MAAM,GAAG,GAAG,KAAK,EAAE,CAAC;IAEpB,MAAM,UAAU,GAAG,WAAW,CAC5B,CAAC,IAAkB,EAAE,QAAQ,GAAG,EAAE,EAAE,EAAE;QACpC,MAAM,IAAI,GAAG,GAAG,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACxC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,QAAQ;gBACX,OAAO,CACL,KAAC,MAAM,IAEL,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,CAAC,gBAAgB,YAE7B,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,IAJlD,GAAG,GAAG,IAAI,IAAI,EAAE,CAKd,CACV,CAAC;YACJ,KAAK,MAAM;gBACT,OAAO,CACL,KAAC,IAAI,IAEH,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAFd,GAAG,GAAG,IAAI,IAAI,EAAE,CAGrB,CACH,CAAC;QACN,CAAC;IACH,CAAC,EACD,CAAC,gBAAgB,EAAE,GAAG,CAAC,CACxB,CAAC;IACF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,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;IACvD,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.4 */
2
+ export { default as TreeView } from "./TreeView.js";
3
+ export * from "./types.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/TreeView/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/ui/FileTree/common/TreeView/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from "./File/index.js";
2
+ export * from "./Folder/index.js";
3
+ export * from "./SearchBox/index.js";
4
+ export * from "./TreeView/index.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as useFileTree } from "./useFileTree.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { useContext } from "react";
2
+ import Context from "../Context.js";
3
+ const useFileTree = () => {
4
+ const context = useContext(Context);
5
+ if (!context) {
6
+ throw new Error("useFileTree must be used within a FileTree component");
7
+ }
8
+ return context;
9
+ };
10
+ export default useFileTree;
11
+ //# sourceMappingURL=useFileTree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFileTree.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/hooks/useFileTree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.1 */
2
+ export * from "./hooks/index.js";
3
+ import Provider from "./Provider.js";
4
+ import { File, Folder, SearchBox, TreeView } from "./common/index.js";
5
+ export const FileTree = Provider;
6
+ FileTree.SearchBox = SearchBox;
7
+ FileTree.File = File;
8
+ FileTree.TreeView = TreeView;
9
+ FileTree.Folder = Folder;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/FileTree/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,cAAc,kBAAkB,CAAC;AAOjC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGtE,MAAM,CAAC,MAAM,QAAQ,GAAG,QAA6B,CAAC;AACtD,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;AAC/B,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;AACrB,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -0,0 +1,47 @@
1
+ /* @canonical/generator-ds 0.9.0-experimental.1 */
2
+
3
+ .ds.file-tree {
4
+ --file-tree-container-border-color: #c4c4c4;
5
+
6
+ --file-tree-node-icon-size: 16px;
7
+ --file-tree-node-text-color-default: rgba(0, 0, 0, 0.6);
8
+ --file-tree-node-text-color-active: #000000;
9
+
10
+ --file-tree-node-background-color: #ffffff;
11
+ --file-tree-node-background-color-hover: #f2f2f2;
12
+ --file-tree-node-focus-outline-color: #878787;
13
+
14
+ --file-tree-node-indent-width: 16px;
15
+ --file-tree-node-indent-bar-color: #efefef;
16
+ --file-tree-node-indent-bar-width: 1px;
17
+ --file-tree-node-items-gap: 8px;
18
+ --file-tree-node-horizontal-padding: 8px;
19
+ --file-tree-node-vertical-padding: 2px;
20
+
21
+ --file-tree-node-file-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.99194 2.5H4.5V13.5H11.5V7.00806H9.24194C7.9993 7.00806 6.99194 6.0007 6.99194 4.75806V2.5ZM10.8869 5.50806L8.49194 3.1127V4.75806C8.49194 5.17227 8.82773 5.50806 9.24194 5.50806H10.8869ZM3 2.5C3 1.67157 3.67157 1 4.5 1H8.08647C8.35172 1 8.60609 1.10538 8.79364 1.29295L12.7072 5.20712C12.8947 5.39465 13 5.64898 13 5.91417V13.5C13 14.3284 12.3284 15 11.5 15H4.5C3.67157 15 3 14.3284 3 13.5V2.5ZM5.65837 8.48389H10.4917V9.98389H5.65837V8.48389ZM5.65837 10.7339V12.2339H10.4917V10.7339H5.65837Z' fill='black'/%3E%3C/svg%3E%0A");
22
+ --file-tree-node-closed-folder-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 5H13.5C14.3284 5 15 5.67157 15 6.5V12.5C15 13.3284 14.3284 14 13.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H8.5C9.32843 2 10 2.67157 10 3.5V5ZM8.5 3.5V5H2.5V3.5H8.5ZM2.5 12.5L2.5 6.5H13.5V12.5H2.5Z' fill='black'/%3E%3C/svg%3E%0A");
23
+ --file-tree-node-opened-folder-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 5.46408V3.60693H2.5V8.66667L2.94235 7.09388C3.12429 6.44696 3.7143 6 4.38632 6H11.5V5.46408H6ZM13 6H14.0216C15.0862 6 15.812 7.07821 15.4113 8.06457L13.38 13.0646C13.1503 13.6301 12.6007 14 11.9903 14H2.98007C2.97153 14 2.963 13.9999 2.9545 13.9998H2.5C1.67157 13.9998 1 13.3282 1 12.4998V3.60693C1 2.77851 1.67157 2.10693 2.5 2.10693H6C6.82843 2.10693 7.5 2.77851 7.5 3.60693V3.96408H11.5C12.3284 3.96408 13 4.63565 13 5.46408V6ZM4.38632 7.5H14.0216L11.9903 12.5H2.98007L4.38632 7.5Z' fill='black'/%3E%3C/svg%3E%0A");
24
+
25
+ --file-tree-search-box-vertical-padding: 6px;
26
+ --file-tree-search-box-horizontal-padding: 8px;
27
+
28
+ --file-tree-search-box-line-height: 24px;
29
+ --file-tree-search-box-button-size: 24px;
30
+ --file-tree-search-box-border-color: #6c6c6c;
31
+
32
+ --file-tree-search-box-search-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.96399 1C8.08013 1.00013 9.17384 1.31346 10.1207 1.90436C11.0676 2.49526 11.8297 3.34002 12.3203 4.34256C12.8109 5.34511 13.0103 6.4652 12.8959 7.57547C12.7815 8.68573 12.3578 9.7416 11.673 10.623L15.976 14.928L14.916 15.988L10.61 11.683C9.85937 12.2631 8.98121 12.6558 8.0484 12.8284C7.1156 13.001 6.15506 12.9487 5.24655 12.6757C4.33805 12.4026 3.50777 11.9168 2.82467 11.2586C2.14157 10.6003 1.62534 9.7886 1.31886 8.89083C1.01237 7.99305 0.924467 7.03512 1.06244 6.09656C1.20042 5.158 1.5603 4.26589 2.11219 3.49431C2.66409 2.72273 3.39208 2.09393 4.23573 1.66012C5.07938 1.22631 6.01434 1.00001 6.96299 1H6.96399ZM6.96399 2.5C6.37221 2.49114 5.78458 2.60005 5.23528 2.82039C4.68598 3.04072 4.18598 3.36809 3.76436 3.78344C3.34274 4.19879 3.00793 4.69384 2.7794 5.23978C2.55087 5.78572 2.43318 6.37166 2.43318 6.9635C2.43318 7.55534 2.55087 8.14128 2.7794 8.68722C3.00793 9.23316 3.34274 9.72821 3.76436 10.1436C4.18598 10.5589 4.68598 10.8863 5.23528 11.1066C5.78458 11.327 6.37221 11.4359 6.96399 11.427C8.13621 11.4095 9.25448 10.9315 10.0772 10.0963C10.9 9.26115 11.3612 8.13585 11.3612 6.9635C11.3612 5.79115 10.9 4.66585 10.0772 3.83069C9.25448 2.99553 8.13621 2.51755 6.96399 2.5Z' fill='black'/%3E%3C/svg%3E%0A");
33
+ --file-tree-search-box-reset-icon: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' fill-rule='nonzero' d='M13.041 1.898l1.06 1.06L9.062 8l5.04 5.042-1.06 1.06L8 9.062 2.96 14.1l-1.06-1.06L6.938 8 1.9 2.96l1.06-1.06 5.04 5.04z'/%3E%3C/svg%3E");
34
+
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 0;
38
+ border: 1px solid var(--file-tree-container-border-color);
39
+ overflow: auto;
40
+ padding: 0;
41
+ margin: 0;
42
+
43
+ ul {
44
+ margin: 0;
45
+ padding: 0;
46
+ }
47
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/Button/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/ui/FileTree/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ const hashNodeName = (name) => {
2
+ let hash = 0;
3
+ for (let i = 0; i < name.length; i++) {
4
+ const char = name.charCodeAt(i);
5
+ hash = (hash << 5) - hash + char;
6
+ hash |= 0;
7
+ }
8
+ return hash;
9
+ };
10
+ export default hashNodeName;
11
+ //# sourceMappingURL=hashNodeName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hashNodeName.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/utils/hashNodeName.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IACpC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QACjC,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as hashNodeName } from "./hashNodeName.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ui/FileTree/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { createContext } from "react";
2
+ const GitDiffViewerContext = createContext(null);
3
+ export default GitDiffViewerContext;
4
+ //# sourceMappingURL=Context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../src/ui/GitDiffViewer/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,oBAAoB,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAC;AAExE,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useState } from "react";
3
+ import Context from "./Context.js";
4
+ import "./styles.css";
5
+ const componentCssClassName = "ds git-diff-viewer";
6
+ const Provider = ({ id, className, style, children, ...contextOptions }) => {
7
+ const [addCommentEnabled, setAddCommentEnabled] = useState(false);
8
+ const [addCommentOpenLocations, setAddCommentOpenLocations] = useState(new Set());
9
+ const toggleAddCommentLocation = useCallback((lineNumber) => {
10
+ if (!addCommentEnabled) {
11
+ return;
12
+ }
13
+ const newSet = new Set(addCommentOpenLocations);
14
+ if (newSet.has(lineNumber)) {
15
+ newSet.delete(lineNumber);
16
+ }
17
+ else {
18
+ newSet.add(lineNumber);
19
+ }
20
+ setAddCommentOpenLocations(newSet);
21
+ }, [addCommentOpenLocations, addCommentEnabled]);
22
+ return (_jsx(Context.Provider, { value: {
23
+ ...contextOptions,
24
+ addCommentEnabled,
25
+ setAddCommentEnabled,
26
+ addCommentOpenLocations,
27
+ toggleAddCommentLocation,
28
+ }, children: _jsx("div", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: children }) }));
29
+ };
30
+ export default Provider;
31
+ //# sourceMappingURL=Provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../../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MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,YAEtE,QAAQ,GACL,GACW,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,119 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment, useCallback, useEffect, useMemo, useRef } from "react";
3
+ import { useGitDiffViewer } from "../../hooks/index.js";
4
+ import { DiffLine } from "./common/index.js";
5
+ import "./styles.css";
6
+ // TODO: decide where to put this once we provide an external syntax highlighter option
7
+ import hljs from "highlight.js";
8
+ import "./HighlighTheme.css";
9
+ const componentCssClassName = "ds code-diff-viewer";
10
+ const tableWidthCSSVar = "--table-width";
11
+ /**
12
+ * Displays a diff in a table format with line numbers and syntax highlighting.
13
+ * With option to add comments to specific lines and interactive gutter for adding comments.
14
+ *
15
+ * @returns {React.ReactElement} - Rendered CodeDiffViewer
16
+ */
17
+ const CodeDiffViewer = ({ id, AddComment, className, style, }) => {
18
+ const { isCollapsed, diff, addCommentEnabled, setAddCommentEnabled, addCommentOpenLocations, toggleAddCommentLocation, lineDecorations, } = useGitDiffViewer();
19
+ const tableRef = useRef(null);
20
+ // TODO: temporary syntax highlighting
21
+ // replace with a proper syntax highlighter
22
+ // add support for option to have external syntax highlighter
23
+ const diffCodeLanguage = useMemo(() => {
24
+ const extension = diff?.newPath.split(".").pop();
25
+ const mapping = {
26
+ js: "javascript",
27
+ jsx: "javascript",
28
+ ts: "typescript",
29
+ tsx: "typescript",
30
+ css: "css",
31
+ scss: "scss",
32
+ html: "xml",
33
+ py: "python",
34
+ java: "java",
35
+ // Add more mappings as needed
36
+ };
37
+ return mapping[extension || ""] || "plaintext";
38
+ }, [diff?.newPath]);
39
+ const highlight = useCallback((code) => {
40
+ if (hljs.getLanguage(diffCodeLanguage)) {
41
+ return hljs.highlight(code, { language: diffCodeLanguage }).value;
42
+ }
43
+ return hljs.highlight(code, { language: "plaintext" }).value;
44
+ }, [diffCodeLanguage]);
45
+ const highlightedLines = useMemo(() => {
46
+ if (!diff)
47
+ return [];
48
+ return diff.hunks.map((hunk) => {
49
+ return hunk.lines.map((line) => {
50
+ return highlight(line.content);
51
+ });
52
+ });
53
+ }, [diff, highlight]);
54
+ /**
55
+ * Observe the table for size changes and update the CSS variable
56
+ */
57
+ useEffect(() => {
58
+ // SSR check
59
+ if (typeof ResizeObserver === "undefined")
60
+ return;
61
+ if (!tableRef.current)
62
+ return;
63
+ const resizeObserver = new ResizeObserver(() => {
64
+ if (!tableRef.current)
65
+ return;
66
+ const tableWidth = tableRef.current?.clientWidth ?? 0;
67
+ tableRef.current.style.cssText = `${tableWidthCSSVar}: ${tableWidth}px`;
68
+ });
69
+ // Observe the table for size changes
70
+ resizeObserver.observe(tableRef.current);
71
+ // Cleanup on unmount
72
+ return () => {
73
+ resizeObserver.disconnect();
74
+ };
75
+ }, []);
76
+ useEffect(() => {
77
+ if (AddComment && !addCommentEnabled) {
78
+ setAddCommentEnabled(true);
79
+ }
80
+ else if (!AddComment && addCommentEnabled) {
81
+ setAddCommentEnabled(false);
82
+ }
83
+ }, [AddComment, addCommentEnabled, setAddCommentEnabled]);
84
+ if (isCollapsed) {
85
+ return null;
86
+ }
87
+ return (_jsx("div", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: diff.hunks.map((hunk, hunkIndex) => {
88
+ // We'll track the counters for old and new lines
89
+ // as we iterate through each hunk.
90
+ let oldLineCounter = hunk.oldStart;
91
+ let newLineCounter = hunk.newStart;
92
+ return (_jsx("div", { className: "diff-hunk", children: _jsx("table", { className: "diff-table", ref: tableRef, tabIndex: -1, children: _jsxs("tbody", { children: [_jsx(DiffLine, { type: "hunk", hunkHeader: hunk.header }), hunk.lines.map((line, lineIndex) => {
93
+ let lineNum1 = null;
94
+ let lineNum2 = null;
95
+ if (line.type === "remove") {
96
+ // Only the old line number advances
97
+ lineNum1 = oldLineCounter++;
98
+ }
99
+ else if (line.type === "add") {
100
+ // Only the new line number advances
101
+ lineNum2 = newLineCounter++;
102
+ }
103
+ else {
104
+ // context line => both lines advance
105
+ lineNum1 = oldLineCounter++;
106
+ lineNum2 = newLineCounter++;
107
+ }
108
+ const lineNumber = lineNum2 || lineNum1 || 0;
109
+ // For rendering, if lineNum1 or lineNum2 is null,
110
+ // you can display e.g. '+' or '-' or an empty cell.
111
+ return (_jsxs(Fragment, { children: [_jsx(DiffLine, { lineNum1: lineNum1, lineNum2: lineNum2, content: highlightedLines[hunkIndex][lineIndex], type: line.type }), lineNum2 && lineDecorations?.[lineNum2] && (_jsx("tr", { className: "line-decoration", children: _jsx("td", { className: "container", children: lineDecorations[lineNum2] }) })), lineNum2 &&
112
+ AddComment &&
113
+ addCommentOpenLocations.has(lineNum2) && (_jsx("tr", { className: "line-decoration", children: _jsx("td", { className: "container", children: _jsx(AddComment, { lineNumber: lineNumber, onClose: () => toggleAddCommentLocation(lineNumber) }) }) }))] }, `${diff.oldPath}-${hunkIndex}-${lineIndex}`));
114
+ })] }) }) }, `${diff.oldPath}-${hunkIndex}`));
115
+ }) }));
116
+ };
117
+ CodeDiffViewer.displayName = "GitDiffViewer.CodeDiff";
118
+ export default CodeDiffViewer;
119
+ //# sourceMappingURL=CodeDiffViewer.js.map