fuma 2.0.50 → 2.1.0

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 (338) hide show
  1. package/dist/action/index.d.ts +2 -5
  2. package/dist/action/index.js +2 -5
  3. package/dist/action/list/handlers.d.ts +6 -6
  4. package/dist/action/list/handlers.js +6 -5
  5. package/dist/action/list/index.d.ts +1 -1
  6. package/dist/action/list/index.js +11 -5
  7. package/dist/action/list/trigger.js +6 -2
  8. package/dist/action/list/utils.js +1 -1
  9. package/dist/action/tip.js +2 -2
  10. package/dist/command/command.svelte.d.ts +16 -0
  11. package/dist/command/command.svelte.js +68 -0
  12. package/dist/command/index.d.ts +1 -0
  13. package/dist/command/index.js +1 -0
  14. package/dist/data.d.ts +87 -0
  15. package/dist/data.js +51 -0
  16. package/dist/index.d.ts +5 -5
  17. package/dist/index.js +5 -5
  18. package/dist/input/InputBoolean.svelte +107 -0
  19. package/dist/input/InputBoolean.svelte.d.ts +12 -0
  20. package/dist/input/InputNumber.svelte +33 -0
  21. package/dist/input/InputNumber.svelte.d.ts +10 -0
  22. package/dist/input/InputRadio.svelte +56 -0
  23. package/dist/input/InputRadio.svelte.d.ts +11 -0
  24. package/dist/input/InputRange.svelte +30 -0
  25. package/dist/input/InputRange.svelte.d.ts +10 -0
  26. package/dist/input/InputRelation.svelte +119 -0
  27. package/dist/input/InputRelation.svelte.d.ts +39 -0
  28. package/dist/input/InputSelect.svelte +113 -0
  29. package/dist/input/InputSelect.svelte.d.ts +37 -0
  30. package/dist/input/InputSelectNative.svelte +56 -0
  31. package/dist/input/InputSelectNative.svelte.d.ts +12 -0
  32. package/dist/input/InputString.svelte +48 -0
  33. package/dist/input/InputString.svelte.d.ts +11 -0
  34. package/dist/input/InputTextarea.svelte +47 -0
  35. package/dist/input/InputTextarea.svelte.d.ts +11 -0
  36. package/dist/input/Issues.svelte +21 -0
  37. package/dist/input/Issues.svelte.d.ts +7 -0
  38. package/dist/input/index.d.ts +11 -0
  39. package/dist/input/index.js +10 -0
  40. package/dist/input/type.d.ts +5 -0
  41. package/dist/input/type.js +1 -0
  42. package/dist/popover/Popover.svelte +50 -0
  43. package/dist/popover/index.d.ts +2 -0
  44. package/dist/popover/index.js +2 -0
  45. package/dist/popover/popover.svelte.d.ts +26 -0
  46. package/dist/popover/popover.svelte.js +101 -0
  47. package/dist/remote/useForm.d.ts +6 -0
  48. package/dist/remote/useForm.js +22 -0
  49. package/dist/search/Spans.svelte +15 -0
  50. package/dist/search/Spans.svelte.d.ts +7 -0
  51. package/dist/search/index.d.ts +2 -0
  52. package/dist/search/index.js +2 -0
  53. package/dist/search/search.js +96 -0
  54. package/dist/server/index.d.ts +0 -4
  55. package/dist/server/index.js +0 -4
  56. package/dist/server/parseQuery.js +1 -1
  57. package/dist/server/sse.js +4 -4
  58. package/dist/server/table.js +1 -1
  59. package/dist/state/index.d.ts +1 -0
  60. package/dist/state/index.js +1 -0
  61. package/dist/state/param.svelte.d.ts +18 -0
  62. package/dist/state/param.svelte.js +66 -0
  63. package/dist/ui/button/ButtonDelete.svelte +49 -28
  64. package/dist/ui/button/ButtonDelete.svelte.d.ts +12 -31
  65. package/dist/ui/button/index.d.ts +0 -1
  66. package/dist/ui/button/index.js +0 -1
  67. package/dist/ui/copy/ButtonCopy.svelte +43 -0
  68. package/dist/ui/copy/ButtonCopy.svelte.d.ts +17 -0
  69. package/dist/ui/copy/index.d.ts +2 -0
  70. package/dist/ui/copy/index.js +2 -0
  71. package/dist/ui/copy/useCopy.svelte.d.ts +10 -0
  72. package/dist/ui/copy/useCopy.svelte.js +36 -0
  73. package/dist/ui/dialog/Dialog.svelte +56 -26
  74. package/dist/ui/dialog/Dialog.svelte.d.ts +14 -35
  75. package/dist/ui/dialog/index.d.ts +0 -1
  76. package/dist/ui/dialog/index.js +0 -1
  77. package/dist/ui/drawer/Drawer.svelte +53 -45
  78. package/dist/ui/drawer/Drawer.svelte.d.ts +8 -63
  79. package/dist/ui/drawer/drawerFly.js +1 -1
  80. package/dist/ui/drawer/useLayer.svelte.d.ts +5 -0
  81. package/dist/ui/drawer/useLayer.svelte.js +33 -0
  82. package/dist/ui/index.d.ts +4 -12
  83. package/dist/ui/index.js +4 -12
  84. package/dist/ui/menu/ContextMenu.svelte +27 -26
  85. package/dist/ui/menu/ContextMenu.svelte.d.ts +9 -35
  86. package/dist/ui/menu/DropDown.svelte +44 -26
  87. package/dist/ui/menu/DropDown.svelte.d.ts +18 -43
  88. package/dist/ui/menu/DropDownMenu.svelte +51 -41
  89. package/dist/ui/menu/DropDownMenu.svelte.d.ts +7 -29
  90. package/dist/ui/menu/dropdown.css +4 -4
  91. package/dist/ui/menu/index.d.ts +1 -1
  92. package/dist/ui/menu/index.js +2 -1
  93. package/dist/ui/mode/ToggleMode.svelte +25 -14
  94. package/dist/ui/mode/ToggleMode.svelte.d.ts +10 -35
  95. package/dist/ui/mode/index.d.ts +1 -1
  96. package/dist/ui/mode/index.js +1 -1
  97. package/dist/ui/mode/useMode.svelte.d.ts +8 -0
  98. package/dist/ui/mode/useMode.svelte.js +40 -0
  99. package/dist/ui/pagination/Pagination.svelte +18 -14
  100. package/dist/ui/pagination/Pagination.svelte.d.ts +4 -18
  101. package/dist/ui/range/RangePicker.svelte +3 -2
  102. package/dist/ui/range/RangePickerButton.svelte +49 -37
  103. package/dist/ui/range/RangePickerButton.svelte.d.ts +7 -21
  104. package/dist/ui/range/index.d.ts +1 -1
  105. package/dist/ui/range/index.js +1 -1
  106. package/dist/ui/table/Table.svelte +15 -21
  107. package/dist/ui/table/Table.svelte.d.ts +1 -1
  108. package/dist/ui/table/TableBody.svelte +1 -1
  109. package/dist/ui/table/TableBody.svelte.d.ts +1 -1
  110. package/dist/ui/table/TableFieldsEdition.svelte +90 -78
  111. package/dist/ui/table/TableFieldsEdition.svelte.d.ts +14 -13
  112. package/dist/ui/table/TableHead.svelte +1 -1
  113. package/dist/ui/table/TableViewSelect.svelte +69 -69
  114. package/dist/ui/table/TableViewSelect.svelte.d.ts +10 -23
  115. package/dist/ui/table/cell/TableCellArray.svelte +1 -1
  116. package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
  117. package/dist/ui/table/cell/index.d.ts +1 -1
  118. package/dist/ui/table/cell/index.js +1 -1
  119. package/dist/ui/table/head/OrderButtons.svelte +18 -13
  120. package/dist/ui/table/head/OrderButtons.svelte.d.ts +11 -23
  121. package/dist/ui/table/head/TableHeadBoolean.svelte +3 -3
  122. package/dist/ui/table/head/TableHeadDate.svelte +41 -53
  123. package/dist/ui/table/head/TableHeadDate.svelte.d.ts +1 -1
  124. package/dist/ui/table/head/TableHeadDefault.svelte +2 -1
  125. package/dist/ui/table/head/TableHeadNumber.svelte +94 -108
  126. package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +13 -10
  127. package/dist/ui/table/head/TableHeadSelect.svelte +55 -52
  128. package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +13 -10
  129. package/dist/ui/table/head/TableHeadString.svelte +28 -34
  130. package/dist/ui/table/head/index.d.ts +3 -3
  131. package/dist/ui/table/head/index.js +3 -3
  132. package/dist/ui/table/index.d.ts +5 -5
  133. package/dist/ui/table/index.js +4 -5
  134. package/dist/utils/csv.js +1 -1
  135. package/dist/utils/eventEmitter.d.ts +2 -2
  136. package/dist/utils/eventEmitter.js +18 -11
  137. package/dist/utils/index.d.ts +4 -6
  138. package/dist/utils/index.js +4 -6
  139. package/dist/utils/normalizePath.js +1 -1
  140. package/dist/utils/options.d.ts +6 -5
  141. package/dist/utils/options.js +3 -2
  142. package/dist/utils/tippy.d.ts +1 -1
  143. package/dist/utils/tippy.js +1 -1
  144. package/dist/validation/index.d.ts +0 -1
  145. package/dist/validation/index.js +0 -1
  146. package/dist/validation/zod.d.ts +12 -393
  147. package/dist/validation/zod.js +22 -82
  148. package/package.json +111 -134
  149. package/dist/action/heightScreen.d.ts +0 -10
  150. package/dist/action/heightScreen.js +0 -24
  151. package/dist/action/portal.d.ts +0 -3
  152. package/dist/action/portal.js +0 -9
  153. package/dist/action/selector.d.ts +0 -15
  154. package/dist/action/selector.js +0 -71
  155. package/dist/api/client.d.ts +0 -3
  156. package/dist/api/client.js +0 -24
  157. package/dist/api/config.d.ts +0 -46
  158. package/dist/api/config.js +0 -7
  159. package/dist/api/index.d.ts +0 -3
  160. package/dist/api/index.js +0 -3
  161. package/dist/api/server.d.ts +0 -11
  162. package/dist/api/server.js +0 -17
  163. package/dist/private/Meta.svelte +0 -16
  164. package/dist/private/Meta.svelte.d.ts +0 -30
  165. package/dist/private/api.d.ts +0 -61
  166. package/dist/private/api.js +0 -10
  167. package/dist/private/constant.d.ts +0 -14
  168. package/dist/private/constant.js +0 -6
  169. package/dist/private/model.d.ts +0 -70
  170. package/dist/private/model.js +0 -25
  171. package/dist/private/prisma.d.ts +0 -2
  172. package/dist/private/prisma.js +0 -2
  173. package/dist/private/store.d.ts +0 -1
  174. package/dist/private/store.js +0 -2
  175. package/dist/server/auth.d.ts +0 -12
  176. package/dist/server/auth.js +0 -15
  177. package/dist/server/formAction.d.ts +0 -13
  178. package/dist/server/formAction.js +0 -8
  179. package/dist/server/json.d.ts +0 -1
  180. package/dist/server/json.js +0 -16
  181. package/dist/server/parseFormData.d.ts +0 -10
  182. package/dist/server/parseFormData.js +0 -85
  183. package/dist/server/try.d.ts +0 -9
  184. package/dist/server/try.js +0 -41
  185. package/dist/store/index.d.ts +0 -2
  186. package/dist/store/index.js +0 -2
  187. package/dist/store/isSmallScreen.d.ts +0 -1
  188. package/dist/store/isSmallScreen.js +0 -14
  189. package/dist/store/param.d.ts +0 -22
  190. package/dist/store/param.js +0 -61
  191. package/dist/store/session.d.ts +0 -1
  192. package/dist/store/session.js +0 -13
  193. package/dist/ui/badge/Badge.svelte +0 -9
  194. package/dist/ui/badge/Badge.svelte.d.ts +0 -21
  195. package/dist/ui/badge/index.d.ts +0 -1
  196. package/dist/ui/badge/index.js +0 -1
  197. package/dist/ui/button/ButtonCopy.svelte +0 -59
  198. package/dist/ui/button/ButtonCopy.svelte.d.ts +0 -27
  199. package/dist/ui/card/Card.svelte +0 -43
  200. package/dist/ui/card/Card.svelte.d.ts +0 -41
  201. package/dist/ui/card/CardBasic.svelte +0 -15
  202. package/dist/ui/card/CardBasic.svelte.d.ts +0 -31
  203. package/dist/ui/card/CardCollapse.svelte +0 -71
  204. package/dist/ui/card/CardCollapse.svelte.d.ts +0 -39
  205. package/dist/ui/card/CardFullScreen.svelte +0 -31
  206. package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -38
  207. package/dist/ui/card/CardLink.svelte +0 -22
  208. package/dist/ui/card/CardLink.svelte.d.ts +0 -31
  209. package/dist/ui/card/index.d.ts +0 -5
  210. package/dist/ui/card/index.js +0 -5
  211. package/dist/ui/context.d.ts +0 -6
  212. package/dist/ui/context.js +0 -12
  213. package/dist/ui/dialog/DialogConfirm.svelte +0 -24
  214. package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -35
  215. package/dist/ui/drawer/layers.d.ts +0 -7
  216. package/dist/ui/drawer/layers.js +0 -68
  217. package/dist/ui/form/Form.svelte +0 -168
  218. package/dist/ui/form/Form.svelte.d.ts +0 -62
  219. package/dist/ui/form/FormInput.svelte +0 -15
  220. package/dist/ui/form/FormSection.svelte +0 -78
  221. package/dist/ui/form/FormSection.svelte.d.ts +0 -39
  222. package/dist/ui/form/form.d.ts +0 -37
  223. package/dist/ui/form/form.js +0 -57
  224. package/dist/ui/form/formInput.js +0 -33
  225. package/dist/ui/form/index.d.ts +0 -3
  226. package/dist/ui/form/index.js +0 -3
  227. package/dist/ui/icon/Icon.svelte +0 -53
  228. package/dist/ui/icon/Icon.svelte.d.ts +0 -29
  229. package/dist/ui/icon/index.d.ts +0 -1
  230. package/dist/ui/icon/index.js +0 -1
  231. package/dist/ui/input/FormControl.svelte +0 -77
  232. package/dist/ui/input/FormControl.svelte.d.ts +0 -34
  233. package/dist/ui/input/InputBoolean.svelte +0 -33
  234. package/dist/ui/input/InputBoolean.svelte.d.ts +0 -46
  235. package/dist/ui/input/InputCheckboxs.svelte +0 -71
  236. package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -57
  237. package/dist/ui/input/InputCheckboxsMenu.svelte +0 -106
  238. package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -59
  239. package/dist/ui/input/InputCheckboxsTree.svelte +0 -18
  240. package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +0 -25
  241. package/dist/ui/input/InputCheckboxsTreeNodes.svelte +0 -68
  242. package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +0 -27
  243. package/dist/ui/input/InputCombo.svelte +0 -99
  244. package/dist/ui/input/InputCombo.svelte.d.ts +0 -59
  245. package/dist/ui/input/InputDate.svelte +0 -47
  246. package/dist/ui/input/InputDate.svelte.d.ts +0 -46
  247. package/dist/ui/input/InputDateTime.svelte +0 -41
  248. package/dist/ui/input/InputDateTime.svelte.d.ts +0 -23
  249. package/dist/ui/input/InputImage.svelte +0 -116
  250. package/dist/ui/input/InputImage.svelte.d.ts +0 -48
  251. package/dist/ui/input/InputImagePreview.svelte +0 -60
  252. package/dist/ui/input/InputImagePreview.svelte.d.ts +0 -27
  253. package/dist/ui/input/InputNumber.svelte +0 -31
  254. package/dist/ui/input/InputNumber.svelte.d.ts +0 -23
  255. package/dist/ui/input/InputOptionInParam.svelte +0 -36
  256. package/dist/ui/input/InputOptionInParam.svelte.d.ts +0 -24
  257. package/dist/ui/input/InputOptions.svelte +0 -85
  258. package/dist/ui/input/InputOptions.svelte.d.ts +0 -21
  259. package/dist/ui/input/InputPassword.svelte +0 -25
  260. package/dist/ui/input/InputPassword.svelte.d.ts +0 -45
  261. package/dist/ui/input/InputRadio.svelte +0 -84
  262. package/dist/ui/input/InputRadio.svelte.d.ts +0 -56
  263. package/dist/ui/input/InputRelation.svelte +0 -171
  264. package/dist/ui/input/InputRelation.svelte.d.ts +0 -76
  265. package/dist/ui/input/InputRelations.svelte +0 -166
  266. package/dist/ui/input/InputRelations.svelte.d.ts +0 -55
  267. package/dist/ui/input/InputSearch.svelte +0 -59
  268. package/dist/ui/input/InputSearch.svelte.d.ts +0 -29
  269. package/dist/ui/input/InputSelect.svelte +0 -84
  270. package/dist/ui/input/InputSelect.svelte.d.ts +0 -29
  271. package/dist/ui/input/InputText.svelte +0 -46
  272. package/dist/ui/input/InputText.svelte.d.ts +0 -30
  273. package/dist/ui/input/InputTextarea.svelte +0 -23
  274. package/dist/ui/input/InputTextarea.svelte.d.ts +0 -23
  275. package/dist/ui/input/InputTime.svelte +0 -47
  276. package/dist/ui/input/InputTime.svelte.d.ts +0 -46
  277. package/dist/ui/input/RelationAfter.svelte +0 -34
  278. package/dist/ui/input/RelationAfter.svelte.d.ts +0 -26
  279. package/dist/ui/input/SelectorList.svelte +0 -50
  280. package/dist/ui/input/SelectorList.svelte.d.ts +0 -49
  281. package/dist/ui/input/action.d.ts +0 -13
  282. package/dist/ui/input/action.js +0 -56
  283. package/dist/ui/input/index.d.ts +0 -26
  284. package/dist/ui/input/index.js +0 -26
  285. package/dist/ui/input/textRich/InputTextRich.svelte +0 -72
  286. package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -48
  287. package/dist/ui/input/textRich/SuggesionList.svelte +0 -25
  288. package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +0 -23
  289. package/dist/ui/input/textRich/ToolMark.svelte +0 -22
  290. package/dist/ui/input/textRich/ToolMark.svelte.d.ts +0 -25
  291. package/dist/ui/input/textRich/ToolMarkColor.svelte +0 -36
  292. package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +0 -23
  293. package/dist/ui/input/textRich/ToolMarkLink.svelte +0 -72
  294. package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +0 -21
  295. package/dist/ui/input/textRich/ToolMenu.svelte +0 -66
  296. package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +0 -33
  297. package/dist/ui/input/textRich/ToolMenuAlign.svelte +0 -50
  298. package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +0 -21
  299. package/dist/ui/input/textRich/ToolMenuInsert.svelte +0 -54
  300. package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +0 -23
  301. package/dist/ui/input/textRich/ToolMenuNode.svelte +0 -60
  302. package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +0 -21
  303. package/dist/ui/input/textRich/ToolsBar.svelte +0 -61
  304. package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +0 -24
  305. package/dist/ui/input/textRich/extensions.d.ts +0 -2
  306. package/dist/ui/input/textRich/extensions.js +0 -62
  307. package/dist/ui/input/textRich/indent.d.ts +0 -13
  308. package/dist/ui/input/textRich/indent.js +0 -112
  309. package/dist/ui/input/textRich/index.d.ts +0 -3
  310. package/dist/ui/input/textRich/index.js +0 -3
  311. package/dist/ui/input/textRich/suggestion.d.ts +0 -7
  312. package/dist/ui/input/textRich/suggestion.js +0 -55
  313. package/dist/ui/input/textRich/tiptapParser.d.ts +0 -4
  314. package/dist/ui/input/textRich/tiptapParser.js +0 -29
  315. package/dist/ui/input/types.d.ts +0 -15
  316. package/dist/ui/input/types.js +0 -1
  317. package/dist/ui/login/Login.svelte +0 -99
  318. package/dist/ui/login/Login.svelte.d.ts +0 -20
  319. package/dist/ui/login/index.d.ts +0 -1
  320. package/dist/ui/login/index.js +0 -1
  321. package/dist/ui/placeholder/Placeholder.svelte +0 -12
  322. package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -30
  323. package/dist/ui/placeholder/PlaceholderImage.svelte +0 -16
  324. package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -30
  325. package/dist/ui/placeholder/index.d.ts +0 -2
  326. package/dist/ui/placeholder/index.js +0 -2
  327. package/dist/ui/tabs/Tabs.svelte +0 -32
  328. package/dist/ui/tabs/Tabs.svelte.d.ts +0 -22
  329. package/dist/ui/tabs/TabsIcon.svelte +0 -60
  330. package/dist/ui/tabs/TabsIcon.svelte.d.ts +0 -24
  331. package/dist/ui/tabs/index.d.ts +0 -8
  332. package/dist/ui/tabs/index.js +0 -2
  333. package/dist/utils/avatar.d.ts +0 -1
  334. package/dist/utils/avatar.js +0 -5
  335. package/dist/utils/component.d.ts +0 -6
  336. package/dist/utils/component.js +0 -3
  337. package/dist/validation/form.d.ts +0 -34
  338. package/dist/validation/form.js +0 -103
@@ -1,30 +0,0 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
15
- default: any;
16
- } ? Props extends Record<string, never> ? any : {
17
- children?: any;
18
- } : {});
19
- declare const Meta: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
20
- name?: string;
21
- description?: string;
22
- }, {
23
- default: {};
24
- }>, {
25
- [evt: string]: CustomEvent<any>;
26
- }, {
27
- default: {};
28
- }, {}, string>;
29
- type Meta = InstanceType<typeof Meta>;
30
- export default Meta;
@@ -1,61 +0,0 @@
1
- import type { Prisma } from '@prisma/client';
2
- export declare const apiConfig: {
3
- Tag: (search: string) => {
4
- where: {
5
- name: {
6
- contains: string;
7
- };
8
- };
9
- };
10
- Post: (search: string) => {
11
- where: {
12
- tags: {
13
- some: {
14
- name: {
15
- contains: string;
16
- };
17
- };
18
- };
19
- };
20
- include: {
21
- tags: true;
22
- };
23
- };
24
- PostType: (search: string) => {
25
- where: {
26
- name: {
27
- contains: string;
28
- };
29
- };
30
- };
31
- };
32
- export declare const api: import("../api/config.js").ApiClient<Prisma.TypeMap<import("@prisma/client/runtime/library").DefaultArgs, {}>, {
33
- Tag: (search: string) => {
34
- where: {
35
- name: {
36
- contains: string;
37
- };
38
- };
39
- };
40
- Post: (search: string) => {
41
- where: {
42
- tags: {
43
- some: {
44
- name: {
45
- contains: string;
46
- };
47
- };
48
- };
49
- };
50
- include: {
51
- tags: true;
52
- };
53
- };
54
- PostType: (search: string) => {
55
- where: {
56
- name: {
57
- contains: string;
58
- };
59
- };
60
- };
61
- }>;
@@ -1,10 +0,0 @@
1
- import { useApiClient } from '../api/client.js';
2
- export const apiConfig = {
3
- Tag: (search) => ({ where: { name: { contains: search } } }),
4
- Post: (search) => ({
5
- where: { tags: { some: { name: { contains: search } } } },
6
- include: { tags: true }
7
- }),
8
- PostType: (search) => ({ where: { name: { contains: search } } })
9
- };
10
- export const api = useApiClient(apiConfig);
@@ -1,14 +0,0 @@
1
- export declare const POST_PUBLICATION: {
2
- private: {
3
- label: string;
4
- icon: string;
5
- };
6
- friends: {
7
- label: string;
8
- icon: string;
9
- };
10
- public: {
11
- label: string;
12
- icon: string;
13
- };
14
- };
@@ -1,6 +0,0 @@
1
- import { mdiAccountGroup, mdiFileLockOutline, mdiWeb } from '@mdi/js';
2
- export const POST_PUBLICATION = {
3
- private: { label: 'Private', icon: mdiFileLockOutline },
4
- friends: { label: 'Friends', icon: mdiAccountGroup },
5
- public: { label: 'Public', icon: mdiWeb }
6
- };
@@ -1,70 +0,0 @@
1
- export declare const modelPost: {
2
- title: import("zod").ZodString;
3
- content: import("zod").ZodString;
4
- isFavourite: import("zod").ZodBoolean;
5
- likeCount: import("zod").ZodNumber;
6
- writingAt: import("zod").ZodDate;
7
- writingDuration: import("zod").ZodDate;
8
- isInteressing: import("zod").ZodOptional<import("zod").ZodBoolean>;
9
- viewCounter: import("zod").ZodOptional<import("zod").ZodNumber>;
10
- publishedAt: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
11
- publishedAtTime: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
12
- publication: import("zod").ZodEnum<{
13
- private: "private";
14
- friends: "friends";
15
- public: "public";
16
- }>;
17
- type: import("zod").ZodPipe<import("zod").ZodObject<{
18
- id: import("zod").ZodString;
19
- }, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
20
- connect: {
21
- id: string;
22
- };
23
- }, {
24
- id: string;
25
- }>>;
26
- tags: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodObject<{
27
- id: import("zod").ZodString;
28
- }, import("zod/v4/core").$strip>>, import("zod").ZodTransform<Partial<Record<"set" | "delete" | "connect" | "disconnect", {
29
- id: string;
30
- }[]>>, {
31
- id: string;
32
- }[]>>;
33
- };
34
- export declare const modelPostUpdate: {
35
- id: import("zod").ZodString;
36
- tags: import("zod").ZodPipe<import("zod").ZodArray<import("zod").ZodObject<{
37
- id: import("zod").ZodString;
38
- }, import("zod/v4/core").$strip>>, import("zod").ZodTransform<Partial<Record<"set" | "delete" | "connect" | "disconnect", {
39
- id: string;
40
- }[]>>, {
41
- id: string;
42
- }[]>>;
43
- title: import("zod").ZodString;
44
- content: import("zod").ZodString;
45
- isFavourite: import("zod").ZodBoolean;
46
- likeCount: import("zod").ZodNumber;
47
- writingAt: import("zod").ZodDate;
48
- writingDuration: import("zod").ZodDate;
49
- isInteressing: import("zod").ZodOptional<import("zod").ZodBoolean>;
50
- viewCounter: import("zod").ZodOptional<import("zod").ZodNumber>;
51
- publishedAt: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
52
- publishedAtTime: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodDate>>;
53
- publication: import("zod").ZodEnum<{
54
- private: "private";
55
- friends: "friends";
56
- public: "public";
57
- }>;
58
- type: import("zod").ZodPipe<import("zod").ZodObject<{
59
- id: import("zod").ZodString;
60
- }, import("zod/v4/core").$strip>, import("zod").ZodTransform<{
61
- connect: {
62
- id: string;
63
- };
64
- }, {
65
- id: string;
66
- }>>;
67
- };
68
- export declare const modelTag: {
69
- name: import("zod").ZodString;
70
- };
@@ -1,25 +0,0 @@
1
- import { toTuple, z } from '../validation/zod.js';
2
- import { POST_PUBLICATION } from './constant.js';
3
- export const modelPost = {
4
- title: z.string().min(1, 'Required'),
5
- content: z.string().min(10),
6
- isFavourite: z.boolean(),
7
- likeCount: z.number(),
8
- writingAt: z.date(),
9
- writingDuration: z.date(),
10
- isInteressing: z.boolean().optional(),
11
- viewCounter: z.number().optional(),
12
- publishedAt: z.date().optional().nullable(),
13
- publishedAtTime: z.date().optional().nullable(),
14
- publication: z.enum(toTuple(POST_PUBLICATION)),
15
- type: z.relation.connect,
16
- tags: z.relations.connect
17
- };
18
- export const modelPostUpdate = {
19
- ...modelPost,
20
- id: z.string(),
21
- tags: z.relations.set
22
- };
23
- export const modelTag = {
24
- name: z.string().min(1, 'Required')
25
- };
@@ -1,2 +0,0 @@
1
- import { PrismaClient } from '@prisma/client';
2
- export declare const prisma: PrismaClient<import("@prisma/client").Prisma.PrismaClientOptions, never, import("@prisma/client/runtime/library").DefaultArgs>;
@@ -1,2 +0,0 @@
1
- import { PrismaClient } from '@prisma/client';
2
- export const prisma = new PrismaClient();
@@ -1 +0,0 @@
1
- export declare let drawerTransitionX: import("svelte/store").Writable<number>;
@@ -1,2 +0,0 @@
1
- import { writable } from 'svelte/store';
2
- export let drawerTransitionX = writable(0);
@@ -1,12 +0,0 @@
1
- import { Lucia } from 'lucia';
2
- export declare const lucia: Lucia<Record<never, never>, {
3
- username: string;
4
- }>;
5
- declare module 'lucia' {
6
- interface Register {
7
- Lucia: typeof lucia;
8
- DatabaseUserAttributes: {
9
- username: string;
10
- };
11
- }
12
- }
@@ -1,15 +0,0 @@
1
- import { Lucia } from 'lucia';
2
- import { dev } from '$app/environment';
3
- import { PrismaAdapter } from '@lucia-auth/adapter-prisma';
4
- import { prisma } from '../private/prisma.js';
5
- const adapter = new PrismaAdapter(prisma.session, prisma.user);
6
- export const lucia = new Lucia(adapter, {
7
- sessionCookie: {
8
- attributes: {
9
- secure: !dev
10
- }
11
- },
12
- getUserAttributes: (attributes) => ({
13
- username: attributes.username
14
- })
15
- });
@@ -1,13 +0,0 @@
1
- import type { z } from 'zod';
2
- import type { RequestEvent } from '@sveltejs/kit';
3
- export declare function formAction<E extends RequestEvent, Shape extends z.core.$ZodShape = z.core.$ZodShape, ReturnType extends unknown = unknown>(shapes: Shape | Shape[], func: (arg: E & {
4
- event: E;
5
- data: z.core.$InferObjectOutput<Shape, {}>;
6
- formData: FormData;
7
- }) => Promise<ReturnType>, options?: {
8
- redirectTo?: string | URL | ((res: ReturnType) => string | URL | undefined);
9
- }): (event: E) => Promise<import("@sveltejs/kit").ActionFailure<{
10
- message: string;
11
- } | {
12
- issues: import("./parseFormData.js").Issue[];
13
- }> | ReturnType>;
@@ -1,8 +0,0 @@
1
- import { parseFormData } from './parseFormData.js';
2
- import { tryOrFail } from './try.js';
3
- export function formAction(shapes, func, options = {}) {
4
- return (event) => tryOrFail(async () => {
5
- const { data, formData } = await parseFormData(event.request, shapes); //, options.validation)
6
- return func({ ...event, event, data, formData });
7
- }, options.redirectTo);
8
- }
@@ -1 +0,0 @@
1
- export declare function json(data: unknown, init?: ResponseInit): Response;
@@ -1,16 +0,0 @@
1
- import * as devalue from 'devalue';
2
- export function json(data, init) {
3
- const body = devalue.stringify(data);
4
- const headers = new Headers(init?.headers);
5
- if (!headers.has('content-length')) {
6
- headers.set('content-length', encoder.encode(body).byteLength.toString());
7
- }
8
- if (!headers.has('content-type')) {
9
- headers.set('content-type', 'application/json');
10
- }
11
- return new Response(body, {
12
- ...init,
13
- headers,
14
- });
15
- }
16
- const encoder = new TextEncoder();
@@ -1,10 +0,0 @@
1
- import z from 'zod';
2
- export type Issue = z.core.$ZodIssue & {
3
- received: string;
4
- expected: string;
5
- unionErrors?: z.ZodError[];
6
- };
7
- export declare function parseFormData<Shape extends z.core.$ZodShape>(requestOrFormData: Request | FormData, shapes: Shape | Shape[]): Promise<{
8
- data: z.z.core.$InferObjectOutput<{ -readonly [P in keyof Shape]: Shape[P]; }, {}>;
9
- formData: FormData;
10
- }>;
@@ -1,85 +0,0 @@
1
- import { USE_COERCE_BOOLEAN, USE_COERCE_DATE, USE_COERCE_JSON, USE_COERCE_NUMBER } from '../utils/constant.js';
2
- import { jsonParse } from '../utils/jsonParse.js';
3
- import z from 'zod';
4
- export async function parseFormData(requestOrFormData, shapes
5
- //validation?: (arg: z.core.output<Shape>, ctx: z.core.$RefinementCtx<z.core.output<Shape>>) => void
6
- ) {
7
- const formData = requestOrFormData instanceof Request ? await requestOrFormData.formData() : requestOrFormData;
8
- const [firstShap, ...unionShaps] = Array.isArray(shapes) ? shapes : [shapes];
9
- const shema = z.object(firstShap); //.superRefine(validation)
10
- unionShaps.forEach((shap) => shema.or(z.object(shap)));
11
- const formDataFlateObject = Object.fromEntries(formData);
12
- const formDataFlateObjectCoerced = coerceFlateData(formDataFlateObject);
13
- const formDataObject = flateToNeestedObject(formDataFlateObjectCoerced);
14
- const parsed = shema.safeParse(formDataObject);
15
- if (parsed.success === false) {
16
- const issueToPOJO = (issue) => ({
17
- message: issue.message,
18
- path: issue.path,
19
- code: issue.code,
20
- received: issue.received,
21
- expected: issue.expected,
22
- unionErrors: issue.unionErrors?.map((err) => err.flatten())
23
- });
24
- const issues = parsed.error.issues.map(issueToPOJO);
25
- throw { issues };
26
- }
27
- return { data: parsed.data, formData };
28
- }
29
- function coerceFlateData(flateData) {
30
- const isNotDefined = (value) => value === '' || value === 'null' || value === 'undefined';
31
- const coerceMap = {
32
- [USE_COERCE_JSON]: (value) => jsonParse(value, {}),
33
- [USE_COERCE_DATE]: (value) => (isNotDefined(value) ? null : new Date(value)),
34
- [USE_COERCE_NUMBER]: (value) => (isNotDefined(value) ? null : +value),
35
- [USE_COERCE_BOOLEAN]: (value) => value === 'true'
36
- };
37
- function coerceValue(value) {
38
- if (typeof value !== 'string')
39
- return value;
40
- const coerce = Object.entries(coerceMap).find(([TOKEN]) => value.startsWith(TOKEN));
41
- if (!coerce)
42
- return value;
43
- return coerce[1](value.replace(coerce[0], ''));
44
- }
45
- return Object.entries(flateData).reduce((acc, [key, value]) => ({ ...acc, [key]: coerceValue(value) }), {});
46
- }
47
- function flateToNeestedObject(flatObject) {
48
- const obj = {};
49
- Object.entries(flatObject).forEach(([key, value]) => {
50
- set(obj, key, value);
51
- });
52
- return obj;
53
- }
54
- function set(obj, path, value) {
55
- if (typeof path === 'number')
56
- path = [path];
57
- if (!path || path.length === 0)
58
- return obj;
59
- if (typeof path === 'string')
60
- return set(obj, path.split('.').map(getKey), value);
61
- const currentPath = path[0];
62
- const currentValue = obj[currentPath];
63
- if (path.length === 1) {
64
- if (currentValue === undefined) {
65
- obj[currentPath] = value;
66
- }
67
- return currentValue;
68
- }
69
- if (currentValue === undefined) {
70
- //check if we assume an array
71
- if (typeof path[1] === 'number') {
72
- obj[currentPath] = [];
73
- }
74
- else {
75
- obj[currentPath] = {};
76
- }
77
- }
78
- return set(obj[currentPath], path.slice(1), value);
79
- }
80
- function getKey(key) {
81
- const intKey = parseInt(key);
82
- if (intKey.toString() === key)
83
- return intKey;
84
- return key;
85
- }
@@ -1,9 +0,0 @@
1
- import { type ActionFailure } from '@sveltejs/kit';
2
- import type { Issue } from './parseFormData.js';
3
- export declare function tryOrFail<T = unknown>(func: () => Promise<T>,
4
- /** You can redirect on success */
5
- redirectTo?: string | URL | ((res: T) => string | URL | undefined)): Promise<T | ActionFailure<{
6
- message: string;
7
- } | {
8
- issues: Issue[];
9
- }>>;
@@ -1,41 +0,0 @@
1
- import { fail, redirect } from '@sveltejs/kit';
2
- export async function tryOrFail(func,
3
- /** You can redirect on success */
4
- redirectTo) {
5
- let result = null;
6
- let isSuccess = false;
7
- try {
8
- result = await func();
9
- isSuccess = true;
10
- return result;
11
- }
12
- catch (error) {
13
- // Handle Classic error
14
- if ('status' in error && 'body' in error && 'message' in error.body) {
15
- return fail(error.status, { message: error.body.message });
16
- }
17
- // Handle Prisma error
18
- if ('meta' in error && error.meta && 'cause' in error.meta) {
19
- return fail(400, { message: error.meta.cause });
20
- }
21
- // Handle parseFormData error
22
- if ('issues' in error) {
23
- return fail(400, { issues: error.issues });
24
- }
25
- const { message } = error;
26
- return fail(400, { message });
27
- }
28
- finally {
29
- if (isSuccess && redirectTo) {
30
- if (typeof redirectTo === 'string' || redirectTo instanceof URL)
31
- redirect(302, redirectTo);
32
- else if (result) {
33
- const url = redirectTo(result);
34
- if (url)
35
- redirect(302, url);
36
- return result;
37
- }
38
- console.warn('No result can be provide in redirectTo() function. Please use a simple string.');
39
- }
40
- }
41
- }
@@ -1,2 +0,0 @@
1
- export * from './isSmallScreen.js';
2
- export * from './param.js';
@@ -1,2 +0,0 @@
1
- export * from './isSmallScreen.js';
2
- export * from './param.js';
@@ -1 +0,0 @@
1
- export declare const isSmallScreen: import("svelte/store").Readable<boolean>;
@@ -1,14 +0,0 @@
1
- import { browser } from '$app/environment';
2
- import { readable } from 'svelte/store';
3
- const getValue = () => browser && document.body.clientWidth < 600;
4
- export const isSmallScreen = readable(getValue(), (set) => {
5
- if (!browser)
6
- return;
7
- const update = () => {
8
- set(getValue());
9
- };
10
- window.addEventListener('resize', update);
11
- return () => {
12
- window.removeEventListener('resize', update);
13
- };
14
- });
@@ -1,22 +0,0 @@
1
- export declare const param: import("svelte/store").Readable<{
2
- with: (params: Record<string, string | number>, ...keysToRemove: string[]) => string;
3
- without: (...keys: string[]) => string;
4
- toggle: (params: Record<string, string>, ...keysToRemove: string[]) => string;
5
- /** Check if key exist in url params */
6
- has: (key: string) => boolean;
7
- get: (key: string) => string | null;
8
- /** Check if value match in url params */
9
- hasValue: (key: string, value: string) => boolean;
10
- page: import("@sveltejs/kit").Page<Record<string, string>, string | null>;
11
- }>;
12
- export declare const urlParam: import("svelte/store").Readable<{
13
- with: (params: Record<string, string | number>, ...keysToRemove: string[]) => string;
14
- without: (...keys: string[]) => string;
15
- toggle: (params: Record<string, string>, ...keysToRemove: string[]) => string;
16
- /** Check if key exist in url params */
17
- has: (key: string) => boolean;
18
- get: (key: string) => string | null;
19
- /** Check if value match in url params */
20
- hasValue: (key: string, value: string) => boolean;
21
- page: import("@sveltejs/kit").Page<Record<string, string>, string | null>;
22
- }>;
@@ -1,61 +0,0 @@
1
- import { derived } from 'svelte/store';
2
- import { page } from '$app/stores';
3
- export const param = derived(page, (_page) => {
4
- /** Return new url with new params */
5
- const _with = (params, ...keysToRemove) => {
6
- const url = new URL(_page.url);
7
- Object.entries(params).forEach(([key, value]) => url.searchParams.set(key, String(value)));
8
- keysToRemove.forEach((key) => url.searchParams.delete(key));
9
- return url.search;
10
- };
11
- /** Return new url without params keys provided */
12
- const without = (...keys) => {
13
- const url = new URL(_page.url);
14
- keys.forEach((key) => url.searchParams.delete(key));
15
- return url.search;
16
- };
17
- /** Return new url with toggle params */
18
- const toggle = (params, ...keysToRemove) => {
19
- const url = new URL(_page.url);
20
- Object.entries(params).forEach(([key, value]) => {
21
- if (url.searchParams.get(key) === value)
22
- url.searchParams.delete(key);
23
- else
24
- url.searchParams.set(key, value);
25
- });
26
- keysToRemove.forEach((key) => url.searchParams.delete(key));
27
- return url.search;
28
- };
29
- return {
30
- with: _with,
31
- without,
32
- toggle,
33
- /** Check if key exist in url params */
34
- has: (key) => _page.url.searchParams.has(key),
35
- get: (key) => _page.url.searchParams.get(key),
36
- /** Check if value match in url params */
37
- hasValue: (key, value) => _page.url.searchParams.get(key) === value,
38
- page: _page
39
- };
40
- });
41
- export const urlParam = derived(param, (_param) => {
42
- const { pathname } = _param.page.url;
43
- /** Return new url with new params */
44
- const _with = (params, ...keysToRemove) => {
45
- return pathname + _param.with(params, ...keysToRemove);
46
- };
47
- /** Return new url without params keys provided */
48
- const without = (...keys) => {
49
- return pathname + _param.without(...keys);
50
- };
51
- /** Return new url with toggle params */
52
- const toggle = (params, ...keysToRemove) => {
53
- return pathname + _param.toggle(params, ...keysToRemove);
54
- };
55
- return {
56
- ..._param,
57
- with: _with,
58
- without,
59
- toggle
60
- };
61
- });
@@ -1 +0,0 @@
1
- export declare function sessionStore<T>(key: string, value: T): import("svelte/store").Writable<T>;
@@ -1,13 +0,0 @@
1
- import { writable } from 'svelte/store';
2
- import { browser } from '$app/environment';
3
- import { jsonParse } from '../utils/index.js';
4
- export function sessionStore(key, value) {
5
- if (!browser)
6
- return writable(value);
7
- const initialValue = jsonParse(sessionStorage.getItem(key), value);
8
- const store = writable(initialValue);
9
- store.subscribe((newValue) => {
10
- sessionStorage.setItem(key, JSON.stringify(newValue));
11
- });
12
- return store;
13
- }
@@ -1,9 +0,0 @@
1
- <script lang="ts">
2
- let klass = ''
3
- export { klass as class }
4
- export let content: string
5
- </script>
6
-
7
- <span class="badge mr-1 whitespace-nowrap {klass}">
8
- {content}
9
- </span>
@@ -1,21 +0,0 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: Props & {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const Badge: $$__sveltets_2_IsomorphicComponent<{
15
- class?: string;
16
- content: string;
17
- }, {
18
- [evt: string]: CustomEvent<any>;
19
- }, {}, {}, string>;
20
- type Badge = InstanceType<typeof Badge>;
21
- export default Badge;
@@ -1 +0,0 @@
1
- export { default as Badge } from './Badge.svelte';
@@ -1 +0,0 @@
1
- export { default as Badge } from './Badge.svelte';