classicy 0.5.4 → 0.5.5

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 (229) hide show
  1. package/package.json +1 -1
  2. package/dist/3c6dd90084fa516904c8.svg +0 -35
  3. package/dist/README.md +0 -211
  4. package/dist/SystemFolder/ControlPanels/AppManager/ClassicyAppManager.d.ts +0 -91
  5. package/dist/SystemFolder/ControlPanels/AppManager/ClassicyAppManagerContext.d.ts +0 -11
  6. package/dist/SystemFolder/ControlPanels/AppearanceManager/ClassicyAppearance.d.ts +0 -111
  7. package/dist/SystemFolder/ControlPanels/AppearanceManager/ClassicyAppearanceManager.d.ts +0 -2
  8. package/dist/SystemFolder/ControlPanels/AppearanceManager/ClassicyColors.d.ts +0 -2
  9. package/dist/SystemFolder/ControlPanels/AppearanceManager/ClassicySize.d.ts +0 -4
  10. package/dist/SystemFolder/ControlPanels/ClassicyControlPanels.d.ts +0 -2
  11. package/dist/SystemFolder/ControlPanels/DateAndTimeManager/ClassicyDateAndTimeManager.d.ts +0 -4
  12. package/dist/SystemFolder/ControlPanels/SoundManager/ClassicySoundManager.d.ts +0 -3
  13. package/dist/SystemFolder/ControlPanels/SoundManager/ClassicySoundManagerContext.d.ts +0 -78
  14. package/dist/SystemFolder/Finder/Finder.d.ts +0 -2
  15. package/dist/SystemFolder/Finder/FinderContext.d.ts +0 -2
  16. package/dist/SystemFolder/QuickTime/MoviePlayer/MoviePlayer.d.ts +0 -15
  17. package/dist/SystemFolder/QuickTime/MoviePlayer/MoviePlayerContext.d.ts +0 -15
  18. package/dist/SystemFolder/QuickTime/PictureViewer/PictureViewer.d.ts +0 -12
  19. package/dist/SystemFolder/QuickTime/PictureViewer/PictureViewerContext.d.ts +0 -9
  20. package/dist/SystemFolder/SystemResources/AboutWindow/ClassicyAboutWindow.d.ts +0 -12
  21. package/dist/SystemFolder/SystemResources/App/ClassicyApp.d.ts +0 -13
  22. package/dist/SystemFolder/SystemResources/App/ClassicyAppUtils.d.ts +0 -20
  23. package/dist/SystemFolder/SystemResources/Boot/ClassicyBoot.d.ts +0 -3
  24. package/dist/SystemFolder/SystemResources/Button/ClassicyButton.d.ts +0 -12
  25. package/dist/SystemFolder/SystemResources/Checkbox/ClassicyCheckbox.d.ts +0 -12
  26. package/dist/SystemFolder/SystemResources/ContextualMenu/ClassicyContextualMenu.d.ts +0 -11
  27. package/dist/SystemFolder/SystemResources/ControlGroup/ClassicyControlGroup.d.ts +0 -9
  28. package/dist/SystemFolder/SystemResources/ControlLabel/ClassicyControlLabel.d.ts +0 -17
  29. package/dist/SystemFolder/SystemResources/DatePicker/ClassicyDatePicker.d.ts +0 -14
  30. package/dist/SystemFolder/SystemResources/DatePicker/ClassicyDatePickerUtils.d.ts +0 -2
  31. package/dist/SystemFolder/SystemResources/Desktop/ClassicyDesktop.d.ts +0 -8
  32. package/dist/SystemFolder/SystemResources/Desktop/ClassicyDesktopIcon.d.ts +0 -14
  33. package/dist/SystemFolder/SystemResources/Desktop/ClassicyDesktopIconContext.d.ts +0 -4
  34. package/dist/SystemFolder/SystemResources/Desktop/ClassicyDesktopManager.d.ts +0 -29
  35. package/dist/SystemFolder/SystemResources/Desktop/ClassicyDesktopWindowManagerContext.d.ts +0 -3
  36. package/dist/SystemFolder/SystemResources/Desktop/MenuBar/ClassicyDesktopMenuBar.d.ts +0 -4
  37. package/dist/SystemFolder/SystemResources/Desktop/MenuBar/Widgets/Sound/ClassicyDesktopMenuWidgetSound.d.ts +0 -8
  38. package/dist/SystemFolder/SystemResources/Desktop/MenuBar/Widgets/Time/ClassicyDesktopMenuWidgetTime.d.ts +0 -4
  39. package/dist/SystemFolder/SystemResources/Disclosure/ClassicyDisclosure.d.ts +0 -10
  40. package/dist/SystemFolder/SystemResources/File/ClassicyFileBrowser.d.ts +0 -12
  41. package/dist/SystemFolder/SystemResources/File/ClassicyFileBrowserUtils.d.ts +0 -6
  42. package/dist/SystemFolder/SystemResources/File/ClassicyFileBrowserViewIcons.d.ts +0 -11
  43. package/dist/SystemFolder/SystemResources/File/ClassicyFileBrowserViewTable.d.ts +0 -14
  44. package/dist/SystemFolder/SystemResources/File/ClassicyFileSystem.d.ts +0 -28
  45. package/dist/SystemFolder/SystemResources/File/ClassicyFileSystemModel.d.ts +0 -36
  46. package/dist/SystemFolder/SystemResources/File/DefaultClassicyFileSystem.d.ts +0 -93
  47. package/dist/SystemFolder/SystemResources/Icon/ClassicyIcon.d.ts +0 -14
  48. package/dist/SystemFolder/SystemResources/Input/ClassicyInput.d.ts +0 -15
  49. package/dist/SystemFolder/SystemResources/Menu/ClassicyMenu.d.ts +0 -29
  50. package/dist/SystemFolder/SystemResources/PopUpMenu/ClassicyPopUpMenu.d.ts +0 -18
  51. package/dist/SystemFolder/SystemResources/ProgressBar/ClassicyProgressBar.d.ts +0 -1
  52. package/dist/SystemFolder/SystemResources/QuickTime/QuickTimeMovieEmbed.d.ts +0 -16
  53. package/dist/SystemFolder/SystemResources/QuickTime/QuickTimeUtils.d.ts +0 -2
  54. package/dist/SystemFolder/SystemResources/RadioInput/ClassicyRadioInput.d.ts +0 -20
  55. package/dist/SystemFolder/SystemResources/RichTextEditor/ClassicyRichTextEditor.d.ts +0 -9
  56. package/dist/SystemFolder/SystemResources/Tabs/ClassicyTabs.d.ts +0 -11
  57. package/dist/SystemFolder/SystemResources/TextEditor/ClassicyTextEditor.d.ts +0 -1
  58. package/dist/SystemFolder/SystemResources/TimePicker/ClassicyTimePicker.d.ts +0 -15
  59. package/dist/SystemFolder/SystemResources/Window/ClassicyWindow.d.ts +0 -29
  60. package/dist/SystemFolder/SystemResources/Window/ClassicyWindowContext.d.ts +0 -18
  61. package/dist/assets/img/icons/control-panels/appearance-manager/app.png +0 -0
  62. package/dist/assets/img/icons/control-panels/appearance-manager/platinum.png +0 -0
  63. package/dist/assets/img/icons/control-panels/date-time-manager/date-time-manager.png +0 -0
  64. package/dist/assets/img/icons/control-panels/sound-manager/app.png +0 -0
  65. package/dist/assets/img/icons/control-panels/sound-manager/sound-33.png +0 -0
  66. package/dist/assets/img/icons/control-panels/sound-manager/sound-66.png +0 -0
  67. package/dist/assets/img/icons/control-panels/sound-manager/sound-off.png +0 -0
  68. package/dist/assets/img/icons/control-panels/sound-manager/sound-on.png +0 -0
  69. package/dist/assets/img/icons/system/apple.png +0 -0
  70. package/dist/assets/img/icons/system/drives/disk.png +0 -0
  71. package/dist/assets/img/icons/system/files/file.png +0 -0
  72. package/dist/assets/img/icons/system/folders/directory.png +0 -0
  73. package/dist/assets/img/icons/system/mac.png +0 -0
  74. package/dist/assets/img/icons/system/macos.png +0 -0
  75. package/dist/assets/img/icons/system/quicktime/cc.png +0 -0
  76. package/dist/assets/img/icons/system/quicktime/movie.png +0 -0
  77. package/dist/assets/img/icons/system/quicktime/player.png +0 -0
  78. package/dist/assets/img/wallpapers/azul_dark.png +0 -0
  79. package/dist/assets/img/wallpapers/azul_extra_light.png +0 -0
  80. package/dist/assets/img/wallpapers/azul_light.png +0 -0
  81. package/dist/assets/img/wallpapers/bondi.png +0 -0
  82. package/dist/assets/img/wallpapers/bondi_dark.png +0 -0
  83. package/dist/assets/img/wallpapers/bondi_extra_dark.png +0 -0
  84. package/dist/assets/img/wallpapers/bondi_light.png +0 -0
  85. package/dist/assets/img/wallpapers/bondi_medium.png +0 -0
  86. package/dist/assets/img/wallpapers/bossanova_bondi.png +0 -0
  87. package/dist/assets/img/wallpapers/bossanova_poppy.png +0 -0
  88. package/dist/assets/img/wallpapers/bossanova_poppy_2.png +0 -0
  89. package/dist/assets/img/wallpapers/bubbles_bondi.png +0 -0
  90. package/dist/assets/img/wallpapers/bubbles_poppy.png +0 -0
  91. package/dist/assets/img/wallpapers/candy_bar.png +0 -0
  92. package/dist/assets/img/wallpapers/candy_bar_azul.png +0 -0
  93. package/dist/assets/img/wallpapers/candy_bar_pistachio.png +0 -0
  94. package/dist/assets/img/wallpapers/candy_bar_sunny.png +0 -0
  95. package/dist/assets/img/wallpapers/default.png +0 -0
  96. package/dist/assets/img/wallpapers/diagonals_bondi.png +0 -0
  97. package/dist/assets/img/wallpapers/diagonals_bondi_dark.png +0 -0
  98. package/dist/assets/img/wallpapers/diagonals_poppy.png +0 -0
  99. package/dist/assets/img/wallpapers/flat_peanuts.png +0 -0
  100. package/dist/assets/img/wallpapers/flat_peanuts_poppy.png +0 -0
  101. package/dist/assets/img/wallpapers/french_blue_dark.png +0 -0
  102. package/dist/assets/img/wallpapers/french_blue_light.png +0 -0
  103. package/dist/assets/img/wallpapers/macos.png +0 -0
  104. package/dist/assets/img/wallpapers/peanuts_azul.png +0 -0
  105. package/dist/assets/img/wallpapers/peanuts_pistachio.png +0 -0
  106. package/dist/assets/img/wallpapers/pistachio_dark.png +0 -0
  107. package/dist/assets/img/wallpapers/pistachio_light.png +0 -0
  108. package/dist/assets/img/wallpapers/pistachio_medium.png +0 -0
  109. package/dist/assets/img/wallpapers/poppy.png +0 -0
  110. package/dist/assets/img/wallpapers/poppy_dark.png +0 -0
  111. package/dist/assets/img/wallpapers/poppy_light.png +0 -0
  112. package/dist/assets/img/wallpapers/poppy_medium.png +0 -0
  113. package/dist/assets/img/wallpapers/rio_azul.png +0 -0
  114. package/dist/assets/img/wallpapers/rio_pistachio.png +0 -0
  115. package/dist/assets/img/wallpapers/ripple_azul.png +0 -0
  116. package/dist/assets/img/wallpapers/ripple_bondi.png +0 -0
  117. package/dist/assets/img/wallpapers/ripple_poppy.png +0 -0
  118. package/dist/assets/img/wallpapers/sunny.png +0 -0
  119. package/dist/assets/img/wallpapers/sunny_dark.png +0 -0
  120. package/dist/assets/img/wallpapers/sunny_light.png +0 -0
  121. package/dist/assets/img/wallpapers/waves_azul.png +0 -0
  122. package/dist/assets/img/wallpapers/waves_bondi.png +0 -0
  123. package/dist/assets/img/wallpapers/waves_sunny.png +0 -0
  124. package/dist/assets/sounds/platinum/platinum.ac3 +0 -0
  125. package/dist/assets/sounds/platinum/platinum.json +0 -174
  126. package/dist/assets/sounds/platinum/platinum.m4a +0 -0
  127. package/dist/assets/sounds/platinum/platinum.mp3 +0 -0
  128. package/dist/assets/sounds/platinum/platinum.ogg +0 -0
  129. package/dist/e7dead02eb942a2c597f.svg +0 -49
  130. package/dist/index.d.ts +0 -57
  131. package/dist/index.js.LICENSE.txt +0 -75
  132. package/dist/package.json +0 -93
  133. package/src/SystemFolder/ControlPanels/AppManager/ClassicyAppManager.ts +0 -327
  134. package/src/SystemFolder/ControlPanels/AppManager/ClassicyAppManagerContext.tsx +0 -73
  135. package/src/SystemFolder/ControlPanels/AppearanceManager/ClassicyAppearance.ts +0 -165
  136. package/src/SystemFolder/ControlPanels/AppearanceManager/ClassicyAppearanceManager.tsx +0 -420
  137. package/src/SystemFolder/ControlPanels/AppearanceManager/ClassicyColors.ts +0 -10
  138. package/src/SystemFolder/ControlPanels/AppearanceManager/ClassicySize.ts +0 -24
  139. package/src/SystemFolder/ControlPanels/AppearanceManager/styles/appearance.scss +0 -182
  140. package/src/SystemFolder/ControlPanels/AppearanceManager/styles/assets.scss +0 -13
  141. package/src/SystemFolder/ControlPanels/AppearanceManager/styles/fonts.scss +0 -90
  142. package/src/SystemFolder/ControlPanels/AppearanceManager/styles/scrollbars.scss +0 -296
  143. package/src/SystemFolder/ControlPanels/AppearanceManager/styles/themes.json +0 -1430
  144. package/src/SystemFolder/ControlPanels/ClassicyControlPanels.tsx +0 -16
  145. package/src/SystemFolder/ControlPanels/DateAndTimeManager/ClassicyDateAndTimeManager.tsx +0 -304
  146. package/src/SystemFolder/ControlPanels/SoundManager/ClassicySoundManager.scss +0 -18
  147. package/src/SystemFolder/ControlPanels/SoundManager/ClassicySoundManager.tsx +0 -159
  148. package/src/SystemFolder/ControlPanels/SoundManager/ClassicySoundManagerContext.tsx +0 -196
  149. package/src/SystemFolder/ControlPanels/SoundManager/ClassicySoundManagerLabels.json +0 -182
  150. package/src/SystemFolder/Finder/Finder.tsx +0 -232
  151. package/src/SystemFolder/Finder/FinderContext.tsx +0 -47
  152. package/src/SystemFolder/QuickTime/MoviePlayer/MoviePlayer.tsx +0 -141
  153. package/src/SystemFolder/QuickTime/MoviePlayer/MoviePlayerContext.tsx +0 -69
  154. package/src/SystemFolder/QuickTime/PictureViewer/PictureViewer.tsx +0 -130
  155. package/src/SystemFolder/QuickTime/PictureViewer/PictureViewerContext.tsx +0 -67
  156. package/src/SystemFolder/SystemResources/AboutWindow/ClassicyAboutWindow.scss +0 -10
  157. package/src/SystemFolder/SystemResources/AboutWindow/ClassicyAboutWindow.tsx +0 -56
  158. package/src/SystemFolder/SystemResources/App/ClassicyApp.tsx +0 -131
  159. package/src/SystemFolder/SystemResources/App/ClassicyAppUtils.tsx +0 -25
  160. package/src/SystemFolder/SystemResources/Boot/ClassicyBoot.scss +0 -9
  161. package/src/SystemFolder/SystemResources/Boot/ClassicyBoot.tsx +0 -11
  162. package/src/SystemFolder/SystemResources/Button/ClassicyButton.scss +0 -57
  163. package/src/SystemFolder/SystemResources/Button/ClassicyButton.tsx +0 -58
  164. package/src/SystemFolder/SystemResources/Checkbox/ClassicyCheckbox.scss +0 -90
  165. package/src/SystemFolder/SystemResources/Checkbox/ClassicyCheckbox.tsx +0 -58
  166. package/src/SystemFolder/SystemResources/ContextualMenu/ClassicyContextualMenu.scss +0 -11
  167. package/src/SystemFolder/SystemResources/ContextualMenu/ClassicyContextualMenu.tsx +0 -25
  168. package/src/SystemFolder/SystemResources/ControlGroup/ClassicyControlGroup.scss +0 -22
  169. package/src/SystemFolder/SystemResources/ControlGroup/ClassicyControlGroup.tsx +0 -28
  170. package/src/SystemFolder/SystemResources/ControlLabel/ClassicyControlLabel.scss +0 -28
  171. package/src/SystemFolder/SystemResources/ControlLabel/ClassicyControlLabel.tsx +0 -99
  172. package/src/SystemFolder/SystemResources/DatePicker/ClassicyDatePicker.scss +0 -50
  173. package/src/SystemFolder/SystemResources/DatePicker/ClassicyDatePicker.tsx +0 -191
  174. package/src/SystemFolder/SystemResources/DatePicker/ClassicyDatePickerUtils.tsx +0 -22
  175. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktop.scss +0 -52
  176. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktop.tsx +0 -209
  177. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktopIcon.scss +0 -115
  178. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktopIcon.tsx +0 -185
  179. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktopIconContext.tsx +0 -178
  180. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktopManager.tsx +0 -161
  181. package/src/SystemFolder/SystemResources/Desktop/ClassicyDesktopWindowManagerContext.tsx +0 -211
  182. package/src/SystemFolder/SystemResources/Desktop/MenuBar/ClassicyDesktopMenuBar.scss +0 -76
  183. package/src/SystemFolder/SystemResources/Desktop/MenuBar/ClassicyDesktopMenuBar.tsx +0 -74
  184. package/src/SystemFolder/SystemResources/Desktop/MenuBar/Widgets/Sound/ClassicyDesktopMenuWidgetSound.scss +0 -16
  185. package/src/SystemFolder/SystemResources/Desktop/MenuBar/Widgets/Sound/ClassicyDesktopMenuWidgetSound.tsx +0 -60
  186. package/src/SystemFolder/SystemResources/Desktop/MenuBar/Widgets/Time/ClassicyDesktopMenuWidgetTime.scss +0 -27
  187. package/src/SystemFolder/SystemResources/Desktop/MenuBar/Widgets/Time/ClassicyDesktopMenuWidgetTime.tsx +0 -141
  188. package/src/SystemFolder/SystemResources/Disclosure/ClassicyDisclosure.scss +0 -88
  189. package/src/SystemFolder/SystemResources/Disclosure/ClassicyDisclosure.tsx +0 -88
  190. package/src/SystemFolder/SystemResources/File/ClassicyFileBrowser.tsx +0 -56
  191. package/src/SystemFolder/SystemResources/File/ClassicyFileBrowserUtils.ts +0 -47
  192. package/src/SystemFolder/SystemResources/File/ClassicyFileBrowserViewIcons.tsx +0 -90
  193. package/src/SystemFolder/SystemResources/File/ClassicyFileBrowserViewTable.scss +0 -92
  194. package/src/SystemFolder/SystemResources/File/ClassicyFileBrowserViewTable.tsx +0 -235
  195. package/src/SystemFolder/SystemResources/File/ClassicyFileSystem.ts +0 -338
  196. package/src/SystemFolder/SystemResources/File/ClassicyFileSystemModel.ts +0 -62
  197. package/src/SystemFolder/SystemResources/File/DefaultClassicyFileSystem.ts +0 -111
  198. package/src/SystemFolder/SystemResources/Icon/ClassicyIcon.scss +0 -119
  199. package/src/SystemFolder/SystemResources/Icon/ClassicyIcon.tsx +0 -115
  200. package/src/SystemFolder/SystemResources/Input/ClassicyInput.scss +0 -38
  201. package/src/SystemFolder/SystemResources/Input/ClassicyInput.tsx +0 -60
  202. package/src/SystemFolder/SystemResources/Menu/ClassicyMenu.scss +0 -187
  203. package/src/SystemFolder/SystemResources/Menu/ClassicyMenu.tsx +0 -127
  204. package/src/SystemFolder/SystemResources/PopUpMenu/ClassicyPopUpMenu.scss +0 -122
  205. package/src/SystemFolder/SystemResources/PopUpMenu/ClassicyPopUpMenu.tsx +0 -63
  206. package/src/SystemFolder/SystemResources/ProgressBar/ClassicyProgressBar.scss +0 -70
  207. package/src/SystemFolder/SystemResources/ProgressBar/ClassicyProgressBar.tsx +0 -29
  208. package/src/SystemFolder/SystemResources/QuickTime/QuickTimeMovieEmbed.scss +0 -217
  209. package/src/SystemFolder/SystemResources/QuickTime/QuickTimeMovieEmbed.tsx +0 -310
  210. package/src/SystemFolder/SystemResources/QuickTime/QuickTimeUtils.ts +0 -27
  211. package/src/SystemFolder/SystemResources/QuickTime/thumb-slider.svg +0 -1
  212. package/src/SystemFolder/SystemResources/QuickTime/volume-slider.svg +0 -8
  213. package/src/SystemFolder/SystemResources/RadioInput/ClassicyRadioInput.scss +0 -125
  214. package/src/SystemFolder/SystemResources/RadioInput/ClassicyRadioInput.tsx +0 -103
  215. package/src/SystemFolder/SystemResources/RichTextEditor/ClassicyRichTextEditor.scss +0 -52
  216. package/src/SystemFolder/SystemResources/RichTextEditor/ClassicyRichTextEditor.tsx +0 -52
  217. package/src/SystemFolder/SystemResources/Tabs/ClassicyTabs.scss +0 -59
  218. package/src/SystemFolder/SystemResources/Tabs/ClassicyTabs.tsx +0 -77
  219. package/src/SystemFolder/SystemResources/Tabs/tab.svg +0 -4
  220. package/src/SystemFolder/SystemResources/TextEditor/ClassicyTextEditor.scss +0 -18
  221. package/src/SystemFolder/SystemResources/TextEditor/ClassicyTextEditor.tsx +0 -14
  222. package/src/SystemFolder/SystemResources/TimePicker/ClassicyTimePicker.scss +0 -53
  223. package/src/SystemFolder/SystemResources/TimePicker/ClassicyTimePicker.tsx +0 -221
  224. package/src/SystemFolder/SystemResources/Window/ClassicyWindow.scss +0 -377
  225. package/src/SystemFolder/SystemResources/Window/ClassicyWindow.tsx +0 -535
  226. package/src/SystemFolder/SystemResources/Window/ClassicyWindowContext.ts +0 -19
  227. package/src/custom.d.ts +0 -90
  228. package/src/index.tsx +0 -57
  229. /package/{dist/index.js → index.js} +0 -0
@@ -1,235 +0,0 @@
1
- import {capitalizeFirst, iconImageByType} from '@/SystemFolder/SystemResources/File/ClassicyFileBrowserUtils'
2
- import './ClassicyFileBrowserViewTable.scss'
3
- import {ClassicyFileSystem} from '@/SystemFolder/SystemResources/File/ClassicyFileSystem'
4
- import {ClassicyFileSystemEntryMetadata} from '@/SystemFolder/SystemResources/File/ClassicyFileSystemModel'
5
- import {createColumnHelper, flexRender, getCoreRowModel, getSortedRowModel, useReactTable,} from '@tanstack/react-table'
6
- import classNames from 'classnames'
7
- import React, {RefObject, useMemo, useState} from 'react'
8
- import arrowUpIcon from 'img/ui/menu-dropdown-arrow-up.svg'
9
-
10
- type ClassicyFileBrowserViewTableProps = {
11
- fs: ClassicyFileSystem
12
- path: string
13
- appId: string
14
- iconSize?: number
15
- dirOnClickFunc?: any
16
- fileOnClickFunc?: any
17
- holderRef?: RefObject<HTMLDivElement | null>
18
- }
19
-
20
- type ColumnSort = {
21
- id: string
22
- desc: boolean
23
- }
24
- type SortingState = ColumnSort[]
25
-
26
- export const ClassicyFileBrowserViewTable: React.FC<ClassicyFileBrowserViewTableProps> = ({
27
- fs,
28
- path,
29
- iconSize = 64,
30
- appId,
31
- dirOnClickFunc = () => {
32
- },
33
- fileOnClickFunc = () => {
34
- },
35
- }) => {
36
- const [selectedRow, setSelectedRow] = useState<string>()
37
- const [sorting, setSorting] = useState<SortingState>([{id: '_name', desc: false}])
38
-
39
- const openFileOrFolder = (properties: ClassicyFileSystemEntryMetadata, path: string, filename: string) => {
40
- switch (properties['_type']) {
41
- case 'directory': {
42
- return dirOnClickFunc(path + ':' + filename)
43
- }
44
- case 'file': {
45
- return fileOnClickFunc(path + ':' + filename)
46
- }
47
- default: {
48
- return () => {
49
- }
50
- }
51
- }
52
- }
53
-
54
- const fileList = useMemo<ClassicyFileSystemEntryMetadata[]>(() => {
55
- const a: [string, ClassicyFileSystemEntryMetadata][] = Object.entries(
56
- fs.filterByType(path, ['file', 'directory'])
57
- )
58
- const directoryListing = a.map(([d, e]) => {
59
- let g = e
60
- g['_name'] = d
61
- g['_path'] = path + ':' + d
62
- return g
63
- })
64
-
65
- return Object.entries(directoryListing).map((entry) => {
66
- let filteredValues = {} as Record<string, any>
67
- const filteredKeyArray: [string, string][] = Object.entries(
68
- entry[1]).filter((key) => key[0].startsWith('_')
69
- )
70
- for (const [key, value] of filteredKeyArray) {
71
- filteredValues[key] = value
72
- }
73
-
74
- return filteredValues as ClassicyFileSystemEntryMetadata
75
- })
76
- }, [path, fs])
77
-
78
- const columnHelper = createColumnHelper<ClassicyFileSystemEntryMetadata>()
79
-
80
- const columns = useMemo(
81
- () => [
82
- columnHelper.accessor((row) => row._name, {
83
- id: '_name',
84
- cell: (info) => (
85
- <div className={"classicyFileBrowserViewTableRowContainer"}>
86
- <img
87
- src={info.row.original['_icon'] || iconImageByType(info.row.original['_type'])}
88
- width={iconSize}
89
- alt={info.row.original['_path']}
90
- className={"classicyFileBrowserViewTableRowIcon"}
91
- />
92
- <span className={"classicyFileBrowserViewTableRowIconLabel"}>
93
- {info.getValue()}
94
- </span>
95
- </div>
96
- ),
97
- header: () => <span>Filename</span>,
98
- enableResizing: true,
99
- }),
100
- columnHelper.accessor((row) => row._type, {
101
- id: '_type',
102
- cell: (info) => <span>{capitalizeFirst(info.getValue())}</span>,
103
- header: () => <span>File Type</span>,
104
- enableResizing: true,
105
- }),
106
- columnHelper.accessor((row) => row._size, {
107
- id: '_size',
108
- cell: (info) =>
109
- <span>{info.getValue() != undefined ? (fs.formatSize(info.getValue() ?? 0)) : ""}</span>,
110
- header: () => <span>Size</span>,
111
- enableResizing: true,
112
- }),
113
- ],
114
- []
115
- )
116
-
117
- const table = useReactTable({
118
- data: fileList,
119
- columns,
120
- getCoreRowModel: getCoreRowModel(),
121
- getSortedRowModel: getSortedRowModel(),
122
- state: {
123
- sorting,
124
- },
125
- onSortingChange: setSorting,
126
- columnResizeMode: 'onChange',
127
- })
128
-
129
- return (
130
- <div
131
- key={appId + '_filebrowser_' + path}
132
- className={"classicyFileBrowserViewTableContainer"}
133
- >
134
- <table style={{}} className={"classicyFileBrowserViewTable"}>
135
- <thead className={classNames("classicyFileBrowserViewTableHeader")}>
136
- {table.getHeaderGroups().map((headerGroup) => (
137
- <tr
138
- key={headerGroup.id}
139
- className={"classicyFileBrowserViewTableColumnHeaderGroup"}
140
- >
141
- {headerGroup.headers.map((header) => (
142
- <th
143
- key={header.id}
144
- align={'left'}
145
- className={classNames(
146
- "classicyFileBrowserViewTableColumnHeader",
147
- header.column.getIsResizing() ? 'isResizing' : '',
148
- header.id == sorting[0].id
149
- ? "classicyFileBrowserViewTableColumnHeaderSelected"
150
- : ''
151
- )}
152
- style={{
153
- width: header.id === '_icon' ? iconSize : 'auto',
154
- }}
155
- onClick={() => {
156
- if (
157
- header.column.getIsSorted() == false ||
158
- header.column.getIsSorted() == 'desc'
159
- ) {
160
- header.column.toggleSorting(false, false)
161
- } else {
162
- header.column.toggleSorting(true, false)
163
- }
164
- }}
165
- >
166
- {!header.isPlaceholder &&
167
- flexRender(header.column.columnDef.header, header.getContext())}
168
- {header.id == sorting[0].id && (
169
- <img
170
- src={`${arrowUpIcon}`}
171
- alt={'Up Arrow'}
172
- style={{
173
- margin: '0 var(--window-padding-size)',
174
- transform: `rotate(${sorting[0].desc ? '0deg' : '180deg'})`,
175
- height: "calc(var(--ui-font-size) * 0.5)"
176
-
177
- }}
178
- />
179
- )}
180
- {header.column.getCanResize() && (
181
- <div
182
- onMouseDown={header.getResizeHandler()}
183
- onTouchStart={header.getResizeHandler()}
184
- className={classNames(
185
- "resizer",
186
- header.column.getIsResizing()
187
- ? "isResizing"
188
- : ''
189
- )}
190
- ></div>
191
- )}
192
- </th>
193
- ))}
194
- </tr>
195
- ))}
196
- </thead>
197
- <tbody className={"classicyFileBrowserViewTableContent"}>
198
- {table.getRowModel().rows.map((row) => (
199
- <tr
200
- key={row.id}
201
- className={classNames(
202
- "classicyFileBrowserViewTableRow",
203
- selectedRow === row.id
204
- ? "classicyFileBrowserViewTableRowSelected"
205
- : null
206
- )}
207
- onDoubleClick={() => openFileOrFolder(row.original, path, (row.original._name ?? ""))}
208
- onClick={() => setSelectedRow(row.id)}
209
- >
210
- {row.getVisibleCells().map((cell) => (
211
- <td key={cell.id} style={{width: cell.column.getSize(), margin: 0, padding: 0}}>
212
- {flexRender(cell.column.columnDef.cell, cell.getContext())}
213
- </td>
214
- ))}
215
- </tr>
216
- ))}
217
- </tbody>
218
- <tfoot>
219
- {table.getFooterGroups().map((footerGroup) => (
220
- <tr key={footerGroup.id}>
221
- {footerGroup.headers.map((header) => (
222
- <th key={header.id}>
223
- {header.isPlaceholder
224
- ? null
225
- : flexRender(header.column.columnDef.footer, header.getContext())}
226
- </th>
227
- ))}
228
- </tr>
229
- ))}
230
- </tfoot>
231
- </table>
232
- <div className="h-4"/>
233
- </div>
234
- )
235
- }
@@ -1,338 +0,0 @@
1
- import { sha512 } from 'sha512-crypt-ts'
2
- import { DefaultFSContent } from '@/SystemFolder/SystemResources/File/DefaultClassicyFileSystem'
3
- import {
4
- ClassicyFileSystemEntry,
5
- ClassicyFileSystemEntryFileType,
6
- ClassicyFileSystemEntryMetadata,
7
- } from '@/SystemFolder/SystemResources/File/ClassicyFileSystemModel'
8
- import directoryIcon from 'img/icons/system/folders/directory.png'
9
-
10
- export type ClassicyPathOrFileSystemEntry = string | ClassicyFileSystemEntry
11
-
12
- export class ClassicyFileSystem {
13
- storageKey: string
14
- fs: ClassicyFileSystemEntry
15
- separator: string
16
-
17
- constructor(storageKey: string = 'classicyStorage', defaultFS: any = DefaultFSContent, separator: string = ':') {
18
- this.storageKey = storageKey
19
- this.fs = defaultFS
20
-
21
- const retrieved = localStorage.getItem(this.storageKey)
22
- if (typeof window !== 'undefined' && retrieved) {
23
- const parsed = JSON.parse(retrieved)
24
- if (parsed) {
25
- this.fs = parsed
26
- }
27
- }
28
-
29
- this.separator = separator
30
- localStorage.setItem(this.storageKey, this.snapshot())
31
- }
32
-
33
- load(data: string) {
34
- this.fs = JSON.parse(data) as ClassicyFileSystemEntry
35
- }
36
-
37
- snapshot(): string {
38
- return JSON.stringify(this.fs, null, 2)
39
- }
40
-
41
- pathArray = (path: string) => {
42
- return [...path.split(this.separator)].filter((v) => v !== '')
43
- }
44
-
45
- resolve(path: string): ClassicyFileSystemEntry {
46
- return this.pathArray(path).reduce((prev, curr) => prev?.[curr], this.fs)
47
- }
48
-
49
- formatSize(bytes: number, measure: 'bits' | 'bytes' = 'bytes', decimals: number = 2): string {
50
- if (!+bytes) {
51
- return '0 ' + measure
52
- }
53
- const sizes =
54
- measure === 'bits'
55
- ? ['Bits', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb', 'Eb', 'Zb', 'Yb']
56
- : ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
57
-
58
- const i = Math.floor(Math.log(bytes) / Math.log(1024))
59
- bytes = measure === 'bits' ? bytes * 8 : bytes
60
-
61
- return `${parseFloat((bytes / Math.pow(1024, i)).toFixed(Math.max(0, decimals)))} ${sizes[i]}`
62
- }
63
-
64
- filterMetadata(content: ClassicyFileSystemEntry, mode: 'only' | 'remove' = 'remove') {
65
- let items = {} as ClassicyFileSystemEntry
66
-
67
- Object.entries(content).forEach(([key, value]) => {
68
- switch (mode) {
69
- case 'only': {
70
- if (key.startsWith('_')) {
71
- items[key] = value
72
- }
73
- break
74
- }
75
- default: {
76
- if (!key.startsWith('_')) {
77
- items[key] = value
78
- }
79
- break
80
- }
81
- }
82
- })
83
- return items
84
- }
85
-
86
- filterByType(
87
- path: string,
88
- byType: string | string[] = ['file', 'directory'],
89
- showInvisible: boolean = true
90
- ): ClassicyFileSystemEntry {
91
- let filteredItems = {} as ClassicyFileSystemEntry
92
- if (!this.resolve(path)) return filteredItems
93
- Object.entries(this.resolve(path)).forEach(([b, a]) => {
94
- if (a['_invisible'] === true && !showInvisible) {
95
- return
96
- }
97
- if (byType.includes(a['_type'])) {
98
- filteredItems[b] = a
99
- }
100
- })
101
- return filteredItems
102
- }
103
-
104
- statFile(path: string): ClassicyFileSystemEntry {
105
- let item = this.resolve(path)
106
- item['_size'] = this.size(path)
107
- return item
108
- }
109
-
110
- size(path: ClassicyPathOrFileSystemEntry): number {
111
- if (typeof path === 'string') {
112
- const contents = this.readFile(path)
113
- if (contents != undefined) {
114
- return new Blob(contents.split('')).size
115
- }
116
- } else if ('_data' in path) {
117
- return new Blob((path['_data'] as string).split('')).size
118
- }
119
-
120
- return -1
121
- }
122
-
123
- hash(path: ClassicyPathOrFileSystemEntry): string | undefined {
124
- if (typeof path === 'string') {
125
- const contents = this.readFile(path)
126
- if (contents == undefined) {
127
- return
128
- }
129
- return sha512.crypt(contents, '')
130
- }
131
-
132
- if ('_data' in path) {
133
- return sha512.crypt(path['_data'], '')
134
- }
135
- return
136
- }
137
-
138
- readFile(path: ClassicyPathOrFileSystemEntry): string | undefined {
139
- if (typeof path === 'string') {
140
- let item: ClassicyFileSystemEntry = this.resolve(path)
141
- return this.readFile(item)
142
- }
143
-
144
- if ('_data' in path) {
145
- return path['_data'] as string
146
- }
147
-
148
- return
149
- }
150
-
151
- writeFile(path: string, data: string, metaData?: ClassicyFileSystemEntryMetadata) {
152
- const updateObjProp = (obj: Record<string, any>, value: string, propPath: string) => {
153
- const [head, ...rest] = propPath.split(':')
154
-
155
- rest.length ? updateObjProp(obj[head], value, rest.join(':')) : (obj[head] = value)
156
- }
157
-
158
- let directoryPath = path.split(':')
159
- if (!this.resolve(directoryPath.join(':'))) {
160
- this.mkDir(directoryPath.join(':'))
161
- }
162
-
163
- return updateObjProp(this.fs, data, path)
164
-
165
- // let directoryPath = path.split(':')
166
- // const filename = directoryPath.pop()
167
- // if (!this.resolve(directoryPath.join(':'))) {
168
- // this.mkDir(directoryPath.join(':'))
169
- // }
170
- //
171
- // let pathArray = []
172
- // let cs: ClassicyFileSystemEntry
173
- // return directoryPath.map((p) => {
174
- // pathArray.push(p)
175
- //
176
- // const dir = this.resolve(directoryPath.join(':'))
177
- // cs[p] = dir
178
- // return dir
179
- // })
180
- //
181
- // let newDirectoryObject = metaData
182
- // ? metaData
183
- // : {
184
- // _type: 'file',
185
- // _icon: `/img/icons/system/files/file.png`,
186
- // }
187
- //
188
- // newDirectoryObject['_data'] = data
189
- //
190
- // let current
191
- // let reference = current
192
- // const parts: string[] = this.pathArray(path)
193
- //
194
- // for (let i = parts.length - 1; i >= 0; i--) {
195
- // reference = current
196
- // current = i === 0 ? {} : newDirectoryObject
197
- // current[parts[i]] =
198
- // i === parts.length - 1 ? newDirectoryObject : reference
199
- // }
200
- //
201
- // this.fs = this.deepMerge(current, this.fs)
202
- // }
203
- }
204
-
205
- rmDir(path: string) {
206
- return this.deletePropertyPath(this.fs, path)
207
- }
208
-
209
- mkDir(path: string) {
210
- const parts: string[] = this.pathArray(path)
211
-
212
- const newDirectoryObject = () => {
213
- return {
214
- _type: 'directory',
215
- _icon: directoryIcon,
216
- } as ClassicyFileSystemEntry
217
- }
218
-
219
- let current = {} as ClassicyFileSystemEntry
220
- let reference
221
-
222
- for (let i = parts.length - 1; i >= 0; i--) {
223
- reference = current
224
- current = i === 0 ? {} as ClassicyFileSystemEntry : newDirectoryObject()
225
- current[parts[i]] = i === parts.length - 1 ? newDirectoryObject() : reference
226
- }
227
-
228
- this.fs = this.deepMerge(current, this.fs)
229
- }
230
-
231
- calculateSizeDir(path: ClassicyPathOrFileSystemEntry | string): number {
232
- const gatherSizes = (entry: ClassicyFileSystemEntry, field: string, value: string): any[] => {
233
- let results: string[] = []
234
- for (const key in entry) {
235
- if (key === field && entry[key] === value) {
236
- results.push(String(this.size(entry)))
237
- } else if (typeof entry[key] === 'object' && entry[key] !== null) {
238
- results = results.concat(gatherSizes(entry[key] as ClassicyFileSystemEntry, field, value))
239
- }
240
- }
241
- return results
242
- }
243
-
244
- if (typeof path === 'string') {
245
- path = this.resolve(path)
246
- }
247
-
248
- return gatherSizes(path, '_type', 'file').reduce((a, c) => a + +c, 0)
249
- }
250
-
251
- countVisibleFiles(path: string): number {
252
- const visibleFiles: boolean[] = Object.entries(this.filterMetadata(this.resolve(path)))
253
- .map(([_, b]) => {
254
- return !b['_invisible']
255
- })
256
- .filter(function (element) {
257
- return element || undefined
258
- })
259
- return visibleFiles.length
260
- }
261
-
262
- countInvisibleFilesInDir(path: string): number {
263
- const invisibleFiles: boolean[] = Object.entries(this.filterMetadata(this.resolve(path)))
264
- .map(([a, b]) => {
265
- return b['_invisible']
266
- })
267
- .filter(function (element) {
268
- return element === false
269
- })
270
- return invisibleFiles.length
271
- }
272
-
273
- statDir(path: string): ClassicyFileSystemEntry | undefined {
274
- let current: ClassicyFileSystemEntry = this.resolve(path)
275
- if (!current) {
276
- return
277
- }
278
- let metaData = this.filterMetadata(current, 'only')
279
-
280
- let name = path.split(this.separator).slice(-1)
281
-
282
- let returnValue: ClassicyFileSystemEntry = {
283
- _count: this.countVisibleFiles(path),
284
- _countHidden: this.countInvisibleFilesInDir(path),
285
- _name: name[0],
286
- _path: path,
287
- _size: this.calculateSizeDir(current),
288
- _type: ClassicyFileSystemEntryFileType.Directory,
289
- }
290
-
291
- Object.entries(metaData).forEach(([key, value]) => {
292
- returnValue[key] = value
293
- })
294
-
295
- return returnValue
296
- }
297
-
298
- private deepMerge(source: ClassicyFileSystemEntry, target: ClassicyFileSystemEntry): ClassicyFileSystemEntry {
299
- Object.keys(target).forEach((key) => {
300
- const sourceKeyIsObject = source[key] instanceof Object
301
- const targetKeyIsObject = target[key] instanceof Object
302
-
303
- if (sourceKeyIsObject && targetKeyIsObject) {
304
- const sourceKeyIsArray = source[key] instanceof Array
305
- const targetKeyIsArray = target[key] instanceof Array
306
-
307
- if (sourceKeyIsArray && targetKeyIsArray) {
308
- source[key] = Array.from(new Set(source[key].concat(target[key])))
309
- } else if (!sourceKeyIsArray && !targetKeyIsArray) {
310
- this.deepMerge(source[key], target[key])
311
- } else {
312
- source[key] = target[key]
313
- }
314
- } else {
315
- source[key] = target[key]
316
- }
317
- })
318
- return source
319
- }
320
-
321
- private deletePropertyPath(fileSystem: ClassicyFileSystemEntry, path: string): ClassicyFileSystemEntry | undefined {
322
- const pathToArray = path.split(':')
323
-
324
- for (let i = 0; i < pathToArray.length - 1; i++) {
325
- fileSystem = fileSystem[pathToArray[i]]
326
- if (typeof fileSystem === 'undefined') {
327
- return
328
- }
329
- }
330
-
331
- const updatedPath = pathToArray.pop()
332
- if (updatedPath) {
333
- delete fileSystem[updatedPath]
334
- }
335
-
336
- return fileSystem
337
- }
338
- }
@@ -1,62 +0,0 @@
1
- import { ReactNode } from 'react'
2
-
3
- export enum ClassicyFileSystemEntryFileType {
4
- File = 'file',
5
- Shortcut = 'shortcut',
6
- AppShortcut = 'app_shortcut',
7
- Drive = 'drive',
8
- Directory = 'directory',
9
- }
10
-
11
- export type ClassicyFileSystemEntryMetadata = {
12
- // The type of file
13
- _type: ClassicyFileSystemEntryFileType
14
- _mimeType?: string
15
-
16
- // The Creator and Format are used to determine which application to open the file with.
17
- _creator?: string
18
- _format?: string
19
-
20
- // Standard fields
21
- _label?: string
22
- _comments?: string
23
-
24
- // The URL if the file is a 'shortcut' type
25
- _url?: string
26
-
27
- // Icon data
28
- _icon?: string
29
- _badge?: ReactNode
30
-
31
- // Modification data
32
- _createdOn?: Date
33
- _modifiedOn?: Date
34
- _versions?: ClassicyFileSystemEntry[]
35
-
36
- // Entry Settings
37
- _readOnly?: boolean // The file cannot be modified. It's name can be changed.
38
- _nameLocked?: boolean // If true, the name cannot be changed.
39
- _trashed?: boolean // If true, this entry is in the trash and will not show, except in the Trash.
40
- _system?: boolean // The file is a system file and cannot be modified. It is also marked with an additional icon.
41
- _invisible?: boolean // The file is not normally visible, but can be accessed by apps.
42
-
43
- // Folders
44
- // Used for stat-ing directories
45
- _count?: number
46
- _countHidden?: number
47
- _path?: string
48
-
49
- // Files
50
- // The contents of the file.
51
- _data?: any
52
-
53
- // Used for stat-ing directories and files.
54
- _size?: number
55
-
56
- // Optional useful field for storing the name.
57
- _name?: string
58
- }
59
-
60
- export type ClassicyFileSystemEntry = {
61
- [entry: string]: any
62
- } & ClassicyFileSystemEntryMetadata