@medyll/idae-machine 0.135.2 → 0.136.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +555 -360
  3. package/cli.cjs +22 -0
  4. package/dist/__fixtures__/demoModel.d.ts +79 -0
  5. package/dist/__fixtures__/demoModel.js +146 -0
  6. package/dist/ai/frame/AiChatSession.svelte +152 -0
  7. package/dist/ai/frame/AiChatSession.svelte.d.ts +7 -0
  8. package/dist/ai/frame/index.d.ts +1 -0
  9. package/dist/ai/frame/index.js +2 -0
  10. package/dist/ai/index.d.ts +9 -0
  11. package/dist/ai/index.js +12 -0
  12. package/dist/ai/schema/ai-catalogs.d.ts +2 -0
  13. package/dist/ai/schema/ai-catalogs.js +86 -0
  14. package/dist/ai/schema/ai-chat-session.d.ts +2 -0
  15. package/dist/ai/schema/ai-chat-session.js +35 -0
  16. package/dist/ai/schema/ai-companion.d.ts +2 -0
  17. package/dist/ai/schema/ai-companion.js +25 -0
  18. package/dist/ai/schema/ai-message.d.ts +2 -0
  19. package/dist/ai/schema/ai-message.js +20 -0
  20. package/dist/ai/schema/ai-tool-call.d.ts +2 -0
  21. package/dist/ai/schema/ai-tool-call.js +18 -0
  22. package/dist/ai/schema/ai-user-prompt.d.ts +2 -0
  23. package/dist/ai/schema/ai-user-prompt.js +17 -0
  24. package/dist/ai/schema/tag.d.ts +2 -0
  25. package/dist/ai/schema/tag.js +14 -0
  26. package/dist/ai/streamIntoRecord.d.ts +31 -0
  27. package/dist/ai/streamIntoRecord.js +79 -0
  28. package/dist/config.d.ts +17 -0
  29. package/dist/config.js +19 -0
  30. package/dist/data-ui/controls/AlphabetFilter.svelte +114 -0
  31. package/dist/data-ui/controls/AlphabetFilter.svelte.d.ts +10 -0
  32. package/dist/data-ui/controls/ButtonAction.svelte +151 -0
  33. package/dist/data-ui/controls/ButtonAction.svelte.d.ts +18 -0
  34. package/dist/data-ui/controls/DataFind.svelte +174 -0
  35. package/dist/data-ui/controls/DataFind.svelte.d.ts +10 -0
  36. package/dist/data-ui/controls/DataGroup.svelte +150 -0
  37. package/dist/data-ui/controls/DataGroup.svelte.d.ts +7 -0
  38. package/dist/data-ui/controls/DataSort.svelte +78 -0
  39. package/dist/data-ui/controls/DataSort.svelte.d.ts +9 -0
  40. package/dist/data-ui/controls/DataToolbar.svelte +67 -0
  41. package/dist/data-ui/controls/DataToolbar.svelte.d.ts +11 -0
  42. package/dist/data-ui/controls/Find.svelte +38 -0
  43. package/dist/data-ui/controls/Find.svelte.d.ts +9 -0
  44. package/dist/data-ui/controls/FkFilter.svelte +94 -0
  45. package/dist/data-ui/controls/FkFilter.svelte.d.ts +11 -0
  46. package/dist/data-ui/controls/Group.svelte +36 -0
  47. package/dist/data-ui/controls/Group.svelte.d.ts +8 -0
  48. package/dist/data-ui/controls/ListMode.svelte +79 -0
  49. package/dist/data-ui/controls/ListMode.svelte.d.ts +10 -0
  50. package/dist/data-ui/controls/Sort.svelte +100 -0
  51. package/dist/data-ui/controls/Sort.svelte.d.ts +8 -0
  52. package/dist/data-ui/data/DataCount.svelte +67 -0
  53. package/dist/data-ui/data/DataCount.svelte.d.ts +36 -0
  54. package/dist/data-ui/data/DataFk.svelte +54 -0
  55. package/dist/data-ui/data/DataFk.svelte.d.ts +11 -0
  56. package/dist/data-ui/data/DataForm.svelte +191 -0
  57. package/dist/data-ui/data/DataForm.svelte.d.ts +15 -0
  58. package/dist/data-ui/data/DataList.svelte +645 -0
  59. package/dist/data-ui/data/DataList.svelte.d.ts +75 -0
  60. package/dist/data-ui/data/DataListFk.svelte +111 -0
  61. package/dist/data-ui/data/DataListFk.svelte.d.ts +13 -0
  62. package/dist/data-ui/data/DataListRfk.svelte +111 -0
  63. package/dist/data-ui/data/DataListRfk.svelte.d.ts +13 -0
  64. package/dist/data-ui/data/DataRecord.svelte +167 -0
  65. package/dist/data-ui/data/DataRecord.svelte.d.ts +22 -0
  66. package/dist/data-ui/data/DataRfk.svelte +73 -0
  67. package/dist/data-ui/data/DataRfk.svelte.d.ts +15 -0
  68. package/dist/data-ui/data/index.d.ts +7 -0
  69. package/dist/data-ui/data/index.js +8 -0
  70. package/dist/data-ui/field/DataField.svelte +343 -0
  71. package/dist/data-ui/field/DataField.svelte.d.ts +33 -0
  72. package/dist/{form/FieldInPlace.svelte → data-ui/field/DataFieldEdit.svelte} +103 -98
  73. package/dist/{form/FieldInPlace.svelte.d.ts → data-ui/field/DataFieldEdit.svelte.d.ts} +5 -5
  74. package/dist/data-ui/field/index.d.ts +2 -0
  75. package/dist/data-ui/field/index.js +3 -0
  76. package/dist/data-ui/field/snippets/FieldAiPrompt.svelte +145 -0
  77. package/dist/data-ui/field/snippets/FieldAiPrompt.svelte.d.ts +14 -0
  78. package/dist/data-ui/field/snippets/FieldBoolean.svelte +43 -0
  79. package/dist/data-ui/field/snippets/FieldBoolean.svelte.d.ts +12 -0
  80. package/dist/data-ui/field/snippets/FieldColor.svelte +48 -0
  81. package/dist/data-ui/field/snippets/FieldColor.svelte.d.ts +10 -0
  82. package/dist/data-ui/field/snippets/FieldCurrency.svelte +105 -0
  83. package/dist/data-ui/field/snippets/FieldCurrency.svelte.d.ts +15 -0
  84. package/dist/data-ui/field/snippets/FieldEmail.svelte +77 -0
  85. package/dist/data-ui/field/snippets/FieldEmail.svelte.d.ts +14 -0
  86. package/dist/data-ui/field/snippets/FieldIcon.svelte +73 -0
  87. package/dist/data-ui/field/snippets/FieldIcon.svelte.d.ts +11 -0
  88. package/dist/data-ui/field/snippets/FieldSelect.svelte +71 -0
  89. package/dist/data-ui/field/snippets/FieldSelect.svelte.d.ts +15 -0
  90. package/dist/data-ui/field/snippets/FieldText.svelte +52 -0
  91. package/dist/data-ui/field/snippets/FieldText.svelte.d.ts +13 -0
  92. package/dist/data-ui/field/snippets/FieldTextarea.svelte +50 -0
  93. package/dist/data-ui/field/snippets/FieldTextarea.svelte.d.ts +13 -0
  94. package/dist/data-ui/field/snippets/index.d.ts +9 -0
  95. package/dist/data-ui/field/snippets/index.js +10 -0
  96. package/dist/data-ui/fragments/ContextMenu.svelte +109 -0
  97. package/dist/data-ui/fragments/ContextMenu.svelte.d.ts +4 -0
  98. package/dist/data-ui/fragments/ContextMenuContent.svelte +275 -0
  99. package/dist/data-ui/fragments/ContextMenuContent.svelte.d.ts +8 -0
  100. package/dist/data-ui/fragments/Frame.svelte +43 -0
  101. package/dist/data-ui/fragments/Frame.svelte.d.ts +10 -0
  102. package/dist/data-ui/fragments/InfoLine.svelte +123 -0
  103. package/dist/data-ui/fragments/InfoLine.svelte.d.ts +12 -0
  104. package/dist/data-ui/fragments/Selector.svelte +56 -0
  105. package/dist/data-ui/fragments/Selector.svelte.d.ts +10 -0
  106. package/dist/{fragments → data-ui/fragments}/Skeleton.svelte +21 -21
  107. package/dist/data-ui/fragments/Tile.svelte +126 -0
  108. package/dist/data-ui/fragments/Tile.svelte.d.ts +14 -0
  109. package/dist/data-ui/fragments/contextMenu.svelte.d.ts +22 -0
  110. package/dist/data-ui/fragments/contextMenu.svelte.js +31 -0
  111. package/dist/data-ui/fragments/dialog/Dialog.svelte +185 -0
  112. package/dist/data-ui/fragments/dialog/Dialog.svelte.d.ts +29 -0
  113. package/dist/data-ui/fragments/dialog/dialog.svelte.d.ts +27 -0
  114. package/dist/data-ui/fragments/dialog/dialog.svelte.js +41 -0
  115. package/dist/data-ui/fragments/index.d.ts +11 -0
  116. package/dist/data-ui/fragments/index.js +11 -0
  117. package/dist/data-ui/utils/__tests__/HostProbe.svelte +18 -0
  118. package/dist/data-ui/utils/__tests__/HostProbe.svelte.d.ts +8 -0
  119. package/dist/data-ui/utils/data-utils.d.ts +29 -0
  120. package/dist/data-ui/utils/data-utils.js +83 -0
  121. package/dist/data-ui/utils/dataRelationUtils.d.ts +37 -0
  122. package/dist/data-ui/utils/dataRelationUtils.js +125 -0
  123. package/dist/data-ui/utils/diagramUtils.d.ts +6 -0
  124. package/dist/data-ui/utils/diagramUtils.js +131 -0
  125. package/dist/data-ui/utils/draggable.d.ts +15 -0
  126. package/dist/data-ui/utils/draggable.js +61 -0
  127. package/dist/data-ui/utils/menuPrefs.d.ts +80 -0
  128. package/dist/data-ui/utils/menuPrefs.js +119 -0
  129. package/dist/data-ui/utils/useMachinePrefs.svelte.d.ts +38 -0
  130. package/dist/data-ui/utils/useMachinePrefs.svelte.js +117 -0
  131. package/dist/data-ui/utils/useMenuTree.svelte.d.ts +26 -0
  132. package/dist/data-ui/utils/useMenuTree.svelte.js +68 -0
  133. package/dist/data-ui/utils/useRecordData.svelte.d.ts +22 -0
  134. package/dist/data-ui/utils/useRecordData.svelte.js +50 -0
  135. package/dist/data-ui/utils/useViewFields.svelte.d.ts +22 -0
  136. package/dist/data-ui/utils/useViewFields.svelte.js +59 -0
  137. package/dist/demo/.gitkeep +0 -0
  138. package/dist/demo/demo-status.json +9 -0
  139. package/dist/idae/boot.d.ts +28 -0
  140. package/dist/idae/boot.js +43 -0
  141. package/dist/idae/bridge/register.d.ts +4 -0
  142. package/dist/idae/bridge/register.js +15 -0
  143. package/dist/idae/capabilities/Capabilities.d.ts +10 -0
  144. package/dist/idae/capabilities/Capabilities.js +34 -0
  145. package/dist/idae/codefield/CodeFieldConvention.d.ts +3 -0
  146. package/dist/idae/codefield/CodeFieldConvention.js +25 -0
  147. package/dist/idae/fieldcatalog/defaultFieldTypesDef.d.ts +2 -0
  148. package/dist/idae/fieldcatalog/defaultFieldTypesDef.js +104 -0
  149. package/dist/idae/frames/FrameCatalog.d.ts +31 -0
  150. package/dist/idae/frames/FrameCatalog.js +31 -0
  151. package/dist/idae/index.d.ts +14 -0
  152. package/dist/idae/index.js +13 -0
  153. package/dist/idae/menu/IdaeMenuManager.d.ts +79 -0
  154. package/dist/idae/menu/IdaeMenuManager.js +108 -0
  155. package/dist/idae/menu/IdaeMenuStore.d.ts +77 -0
  156. package/dist/idae/menu/IdaeMenuStore.js +68 -0
  157. package/dist/idae/menu/menuSnapshot.d.ts +30 -0
  158. package/dist/idae/menu/menuSnapshot.js +30 -0
  159. package/dist/idae/meta/MetaModelProvider.d.ts +11 -0
  160. package/dist/idae/meta/MetaModelProvider.js +43 -0
  161. package/dist/idae/relations/RelationPolicy.d.ts +19 -0
  162. package/dist/idae/relations/RelationPolicy.js +125 -0
  163. package/dist/idae/rights/RightsPolicy.d.ts +16 -0
  164. package/dist/idae/rights/RightsPolicy.js +80 -0
  165. package/dist/idae/userscope/UserScopePolicy.d.ts +9 -0
  166. package/dist/idae/userscope/UserScopePolicy.js +42 -0
  167. package/dist/idae/userscope/navTracking.d.ts +11 -0
  168. package/dist/idae/userscope/navTracking.js +15 -0
  169. package/dist/index.d.ts +68 -35
  170. package/dist/index.js +82 -36
  171. package/dist/main/__tests__/_relationTestUtils.d.ts +12 -0
  172. package/dist/main/__tests__/_relationTestUtils.js +53 -0
  173. package/dist/main/__tests__/helpers/mockCollection.d.ts +21 -0
  174. package/dist/main/__tests__/helpers/mockCollection.js +27 -0
  175. package/dist/main/api/types.d.ts +29 -0
  176. package/dist/main/ext/hooks.d.ts +32 -0
  177. package/dist/main/ext/hooks.js +31 -0
  178. package/dist/main/ext/interfaces.d.ts +69 -0
  179. package/dist/main/ext/interfaces.js +3 -0
  180. package/dist/main/ext/registry.d.ts +29 -0
  181. package/dist/main/ext/registry.js +30 -0
  182. package/dist/main/frame/MachineFrameManager.d.ts +187 -0
  183. package/dist/main/frame/MachineFrameManager.js +403 -0
  184. package/dist/main/frame/contextMenuSetup.d.ts +9 -0
  185. package/dist/main/frame/contextMenuSetup.js +42 -0
  186. package/dist/main/frame/frameUrl.d.ts +1 -0
  187. package/dist/main/frame/frameUrl.js +8 -0
  188. package/dist/main/frame/frameUtils.d.ts +16 -0
  189. package/dist/main/frame/frameUtils.js +26 -0
  190. package/dist/main/frame/linkParser.d.ts +9 -0
  191. package/dist/main/frame/linkParser.js +15 -0
  192. package/dist/main/index.d.ts +15 -0
  193. package/dist/main/index.js +19 -0
  194. package/dist/main/machine/MachineAction.d.ts +62 -0
  195. package/dist/main/machine/MachineAction.js +96 -0
  196. package/dist/main/machine/MachineError.js +2 -2
  197. package/dist/main/machine/MachineFieldType.d.ts +25 -6
  198. package/dist/main/machine/MachineFieldType.js +118 -27
  199. package/dist/main/machine/MachineFkFold.d.ts +34 -0
  200. package/dist/main/machine/MachineFkFold.js +57 -0
  201. package/dist/main/machine/MachineRecordIdentity.d.ts +26 -0
  202. package/dist/main/machine/MachineRecordIdentity.js +44 -0
  203. package/dist/main/machine/MachineRights.d.ts +50 -0
  204. package/dist/main/machine/MachineRights.js +133 -0
  205. package/dist/main/machine/MachineRouter.d.ts +56 -0
  206. package/dist/main/machine/MachineRouter.js +250 -0
  207. package/dist/main/machine/MachineScheme.d.ts +40 -70
  208. package/dist/main/machine/MachineScheme.js +107 -94
  209. package/dist/main/machine/MachineSchemeField.js +32 -16
  210. package/dist/main/machine/MachineSchemeFieldForge.d.ts +11 -11
  211. package/dist/main/machine/MachineSchemeFieldForge.js +33 -21
  212. package/dist/main/machine/MachineSchemeFieldValues.d.ts +8 -9
  213. package/dist/main/machine/MachineSchemeFieldValues.js +12 -9
  214. package/dist/main/machine/MachineSchemeValidate.d.ts +69 -13
  215. package/dist/main/machine/MachineSchemeValidate.js +173 -46
  216. package/dist/main/machine/MachineSchemeValues.d.ts +32 -21
  217. package/dist/main/machine/MachineSchemeValues.js +132 -104
  218. package/dist/main/machine/SchemeFieldDefaultValues.d.ts +4 -2
  219. package/dist/main/machine/SchemeFieldDefaultValues.js +8 -2
  220. package/dist/main/machine/authState.svelte.d.ts +11 -0
  221. package/dist/main/machine/authState.svelte.js +17 -0
  222. package/dist/main/machine/fieldBuilder.d.ts +23 -0
  223. package/dist/main/machine/fieldBuilder.d.ts.map +1 -0
  224. package/dist/main/machine/fieldBuilder.js +10 -0
  225. package/dist/main/machine/fieldBuilder.js.map +1 -0
  226. package/dist/main/machine/machineLabel.d.ts +11 -0
  227. package/dist/main/machine/machineLabel.js +23 -0
  228. package/dist/main/machine/validateRules.d.ts +38 -0
  229. package/dist/main/machine/validateRules.js +109 -0
  230. package/dist/main/machine.d.ts +207 -68
  231. package/dist/main/machine.js +482 -96
  232. package/dist/main/machineDb.d.ts +21 -8
  233. package/dist/main/machineDb.js +33 -4
  234. package/dist/main/machineIdbAdapter.d.ts +83 -0
  235. package/dist/main/machineIdbAdapter.js +347 -0
  236. package/dist/main/machineModelBuilder.d.ts +31 -0
  237. package/dist/main/machineModelBuilder.js +58 -0
  238. package/dist/main/machineParserForge.d.ts +9 -18
  239. package/dist/main/machineParserForge.js +92 -35
  240. package/dist/main/machineSchemaCache.d.ts +8 -0
  241. package/dist/main/machineSchemaCache.js +58 -0
  242. package/dist/main/machineSchemaDoctor.d.ts +17 -0
  243. package/dist/main/machineSchemaDoctor.js +73 -0
  244. package/dist/main/machineSchemaLoader.d.ts +18 -0
  245. package/dist/main/machineSchemaLoader.js +43 -0
  246. package/dist/main/machineSeed.d.ts +21 -0
  247. package/dist/main/machineSeed.js +44 -0
  248. package/dist/main/router/componentRegistry.d.ts +35 -0
  249. package/dist/main/router/componentRegistry.js +35 -0
  250. package/dist/main/router/urlParser.d.ts +17 -0
  251. package/dist/main/router/urlParser.js +41 -0
  252. package/dist/main/warmupUtils.d.ts +40 -0
  253. package/dist/main/warmupUtils.js +73 -0
  254. package/dist/mcp/MachineMcpClient.d.ts +43 -0
  255. package/dist/mcp/MachineMcpClient.js +175 -0
  256. package/dist/shell/Frame.svelte +67 -0
  257. package/dist/shell/Frame.svelte.d.ts +11 -0
  258. package/dist/shell/auth/Login.svelte +244 -0
  259. package/dist/shell/auth/Login.svelte.d.ts +3 -0
  260. package/dist/shell/frame/dashboard/Dashboard.svelte +0 -0
  261. package/dist/shell/frame/dashboard/Dashboard.svelte.d.ts +26 -0
  262. package/dist/shell/frame/diagram/Diagram.svelte +244 -0
  263. package/dist/shell/frame/diagram/Diagram.svelte.d.ts +9 -0
  264. package/dist/shell/frame/explorer/Explorer.svelte +86 -0
  265. package/dist/shell/frame/explorer/Explorer.svelte.d.ts +29 -0
  266. package/dist/shell/frame/explorer/ExplorerContent.svelte +126 -0
  267. package/dist/shell/frame/explorer/ExplorerContent.svelte.d.ts +32 -0
  268. package/dist/shell/frame/index.d.ts +8 -0
  269. package/dist/shell/frame/index.js +9 -0
  270. package/dist/shell/frame/main-menu-content/MainMenuContent.svelte +100 -0
  271. package/dist/shell/frame/main-menu-content/MainMenuContent.svelte.d.ts +6 -0
  272. package/dist/shell/frame/planning/Planning.svelte +426 -0
  273. package/dist/shell/frame/planning/Planning.svelte.d.ts +12 -0
  274. package/dist/shell/frame/rbac/RbacMatrix.svelte +197 -0
  275. package/dist/shell/frame/rbac/RbacMatrix.svelte.d.ts +7 -0
  276. package/dist/shell/frame/space/Space.svelte +554 -0
  277. package/dist/shell/frame/space/Space.svelte.d.ts +8 -0
  278. package/dist/shell/frame/synthesis/Synthesis.svelte +383 -0
  279. package/dist/shell/frame/synthesis/Synthesis.svelte.d.ts +8 -0
  280. package/dist/shell/frame/today/Today.svelte +174 -0
  281. package/dist/shell/frame/today/Today.svelte.d.ts +3 -0
  282. package/dist/shell/layout/App.svelte +30 -0
  283. package/dist/shell/layout/App.svelte.d.ts +3 -0
  284. package/dist/shell/layout/Breadcrumb.svelte +67 -0
  285. package/dist/shell/layout/Breadcrumb.svelte.d.ts +12 -0
  286. package/dist/shell/layout/Columner.svelte +214 -0
  287. package/dist/shell/layout/Columner.svelte.d.ts +16 -0
  288. package/dist/shell/layout/DevResetPanel.svelte +194 -0
  289. package/dist/shell/layout/DevResetPanel.svelte.d.ts +7 -0
  290. package/dist/shell/layout/Fiche.svelte +111 -0
  291. package/dist/shell/layout/Fiche.svelte.d.ts +7 -0
  292. package/dist/shell/layout/FicheUpdate.svelte +53 -0
  293. package/dist/shell/layout/FicheUpdate.svelte.d.ts +7 -0
  294. package/dist/shell/layout/MainMenu.svelte +256 -0
  295. package/dist/shell/layout/MainMenu.svelte.d.ts +6 -0
  296. package/dist/shell/layout/MenuSettings.svelte +182 -0
  297. package/dist/shell/layout/MenuSettings.svelte.d.ts +6 -0
  298. package/dist/shell/layout/RecordTimeline.svelte +199 -0
  299. package/dist/shell/layout/RecordTimeline.svelte.d.ts +8 -0
  300. package/dist/shell/layout/RecordToolbar.svelte +39 -0
  301. package/dist/shell/layout/RecordToolbar.svelte.d.ts +7 -0
  302. package/dist/shell/layout/TaskBar.svelte +118 -0
  303. package/dist/shell/layout/TaskBar.svelte.d.ts +7 -0
  304. package/dist/shell/layout/TemplateShell.svelte +48 -0
  305. package/dist/shell/layout/TemplateShell.svelte.d.ts +15 -0
  306. package/dist/shell/layout/ThemeToggle.svelte +46 -0
  307. package/dist/shell/layout/ThemeToggle.svelte.d.ts +3 -0
  308. package/dist/shell/layout/index.d.ts +8 -0
  309. package/dist/shell/layout/index.js +9 -0
  310. package/dist/storage/ApiStorageAdapter.d.ts +41 -0
  311. package/dist/storage/ApiStorageAdapter.js +111 -0
  312. package/dist/storage/IdbStorageAdapter.d.ts +31 -0
  313. package/dist/storage/IdbStorageAdapter.js +72 -0
  314. package/dist/storage/MemoryStorageAdapter.d.ts +33 -0
  315. package/dist/storage/MemoryStorageAdapter.js +132 -0
  316. package/dist/storage/README.md +222 -0
  317. package/dist/storage/StorageAdapter.d.ts +75 -0
  318. package/dist/storage/StorageAdapter.js +7 -0
  319. package/dist/storage/demo/storage-demo.d.ts +22 -0
  320. package/dist/storage/demo/storage-demo.js +107 -0
  321. package/dist/storage/index.d.ts +9 -0
  322. package/dist/storage/index.js +9 -0
  323. package/dist/types/entity-types.d.ts +444 -0
  324. package/dist/types/entity-types.js +16 -0
  325. package/dist/types/index.d.ts +7 -0
  326. package/dist/types/index.js +6 -0
  327. package/dist/types/machine-model.d.ts +198 -0
  328. package/dist/types/machine-model.js +5 -0
  329. package/dist/types/qoolie-svelte.d.ts +11 -0
  330. package/dist/types/schema-utils.d.ts +32 -0
  331. package/dist/types/schema-utils.js +103 -0
  332. package/dist/utils/generateCode.d.ts +5 -0
  333. package/dist/utils/generateCode.js +9 -0
  334. package/dist/utils/logger.d.ts +10 -0
  335. package/dist/utils/logger.js +20 -0
  336. package/package.json +59 -33
  337. package/cli.js +0 -46
  338. package/dist/db/CrudService.d.ts +0 -9
  339. package/dist/db/CrudService.js +0 -45
  340. package/dist/demo/dbSchema.d.ts +0 -446
  341. package/dist/demo/dbSchema.js +0 -449
  342. package/dist/demo/testScheme.d.ts +0 -56
  343. package/dist/demo/testScheme.js +0 -42
  344. package/dist/form/CreateUpdate.svelte +0 -219
  345. package/dist/form/CreateUpdate.svelte.d.ts +0 -27
  346. package/dist/form/DataProvider.svelte +0 -23
  347. package/dist/form/DataProvider.svelte.d.ts +0 -7
  348. package/dist/form/FieldValue.svelte +0 -148
  349. package/dist/form/FieldValue.svelte.d.ts +0 -34
  350. package/dist/form/types.d.ts +0 -17
  351. package/dist/fragments/Confirm.svelte +0 -73
  352. package/dist/fragments/Confirm.svelte.d.ts +0 -7
  353. package/dist/fragments/Frame.svelte +0 -19
  354. package/dist/fragments/Frame.svelte.d.ts +0 -32
  355. package/dist/fragments/InfoLine.svelte +0 -21
  356. package/dist/fragments/InfoLine.svelte.d.ts +0 -35
  357. package/dist/fragments/Selector.svelte +0 -26
  358. package/dist/fragments/Selector.svelte.d.ts +0 -38
  359. package/dist/main/machine/MachineSchemeField.d.ts +0 -19
  360. package/dist/types/appschemeTypes.d.ts +0 -71
  361. package/dist/types/appschemeTypes.js +0 -83
  362. package/dist/ui/CollectionButton.svelte +0 -29
  363. package/dist/ui/CollectionButton.svelte.d.ts +0 -29
  364. package/dist/ui/CollectionFks.svelte +0 -24
  365. package/dist/ui/CollectionFks.svelte.d.ts +0 -9
  366. package/dist/ui/CollectionList.svelte +0 -100
  367. package/dist/ui/CollectionList.svelte.d.ts +0 -36
  368. package/dist/ui/CollectionListFieldValues.svelte +0 -59
  369. package/dist/ui/CollectionListFieldValues.svelte.d.ts +0 -9
  370. package/dist/ui/CollectionListMenu.svelte +0 -39
  371. package/dist/ui/CollectionListMenu.svelte.d.ts +0 -34
  372. package/dist/ui/CollectionReverseFks.svelte +0 -37
  373. package/dist/ui/CollectionReverseFks.svelte.d.ts +0 -14
  374. /package/dist/{fragments → data-ui/fragments}/Skeleton.svelte.d.ts +0 -0
  375. /package/dist/{form → main/api}/types.js +0 -0
@@ -0,0 +1,150 @@
1
+ <!--
2
+ DataGroup.svelte
3
+ Group-by control. Menu lists FK fields whose target collection has isGroup or isType flag.
4
+ Click sets/clears groupBy.
5
+
6
+ @prop {string} collection - Source collection name
7
+ @prop {string|undefined} groupBy - Bindable group field name (FK field key)
8
+ -->
9
+ <script module lang="ts">
10
+ export interface DataGroupProps {
11
+ collection: string;
12
+ groupBy?: string | undefined;
13
+ }
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ import { machine } from '../../main/machine.js';
18
+
19
+ let {
20
+ collection,
21
+ groupBy = $bindable(undefined)
22
+ }: DataGroupProps = $props();
23
+
24
+ let open = $state(false);
25
+
26
+ // Any field or FK relation can be a grouping axis. Plain fields group on
27
+ // their raw value; FK fields resolve their label via DataList (parseFkGroupKey).
28
+ const groupableFields = $derived.by(() => {
29
+ const collLogic = machine.logic.collection(collection);
30
+ if (!collLogic) return [] as { field: string; label: string }[];
31
+ const fields = (collLogic.fields ?? {}) as Record<string, { type?: string }>;
32
+ const fks = (collLogic.fks ?? {}) as Record<string, unknown>;
33
+ const out: { field: string; label: string }[] = [];
34
+ const seen = new Set<string>();
35
+ const SKIP_TYPES = new Set(['id', 'json', 'password']);
36
+ for (const [name, def] of Object.entries(fields)) {
37
+ if (name.startsWith('_')) continue;
38
+ if (SKIP_TYPES.has(def?.type ?? '')) continue;
39
+ out.push({ field: name, label: name });
40
+ seen.add(name);
41
+ }
42
+ // FK relations not already declared as a flat field (e.g. engine meta fks).
43
+ for (const fkName of Object.keys(fks)) {
44
+ if (seen.has(fkName)) continue;
45
+ out.push({ field: `fks.${fkName}`, label: fkName });
46
+ }
47
+ return out;
48
+ });
49
+
50
+ function pick(field: string | undefined): void {
51
+ groupBy = field;
52
+ open = false;
53
+ }
54
+
55
+ const label = $derived(groupBy ? `Group: ${groupBy}` : 'Group');
56
+ </script>
57
+
58
+ <div class="data-group">
59
+ <button
60
+ type="button"
61
+ class="data-group-btn"
62
+ class:active={!!groupBy}
63
+ onclick={() => (open = !open)}
64
+ >
65
+ {label} ▾
66
+ </button>
67
+ {#if open}
68
+ <ul class="data-group-menu" role="menu">
69
+ {#each groupableFields as opt (opt.field)}
70
+ <li>
71
+ <button type="button" class="data-group-item" onclick={() => pick(opt.field)}>
72
+ {opt.label}
73
+ </button>
74
+ </li>
75
+ {/each}
76
+ {#if groupableFields.length === 0}
77
+ <li class="data-group-empty">No groupable fields</li>
78
+ {/if}
79
+ {#if groupBy}
80
+ <li class="data-group-sep"></li>
81
+ <li>
82
+ <button type="button" class="data-group-item clear" onclick={() => pick(undefined)}>
83
+ Clear grouping
84
+ </button>
85
+ </li>
86
+ {/if}
87
+ </ul>
88
+ {/if}
89
+ </div>
90
+
91
+ <style>
92
+ @layer components {
93
+ .data-group {
94
+ position: relative;
95
+ display: inline-block;
96
+ }
97
+ .data-group-btn {
98
+ padding: var(--pad-xs) var(--pad-sm);
99
+ border: var(--border-width) solid var(--color-border);
100
+ background: var(--color-surface);
101
+ border-radius: var(--radius-sm);
102
+ cursor: pointer;
103
+ font-size: var(--text-sm);
104
+ }
105
+ .data-group-btn.active {
106
+ background: var(--color-primary);
107
+ color: var(--default-color-surface-light);
108
+ border-color: var(--color-primary);
109
+ }
110
+ .data-group-menu {
111
+ position: absolute;
112
+ top: 100%;
113
+ left: 0;
114
+ margin: var(--marg-xs) 0 0;
115
+ padding: var(--pad-xs) 0;
116
+ list-style: none;
117
+ background: var(--color-surface-overlay);
118
+ border: var(--border-width) solid var(--color-border);
119
+ border-radius: var(--radius-sm);
120
+ box-shadow: var(--shadow-md);
121
+ min-width: calc(var(--gutter-3xl) * 2.5);
122
+ z-index: var(--z-dropdown);
123
+ }
124
+ .data-group-item {
125
+ width: 100%;
126
+ text-align: left;
127
+ padding: var(--pad-xs) var(--pad-sm);
128
+ background: transparent;
129
+ border: none;
130
+ cursor: pointer;
131
+ font-size: var(--text-sm);
132
+ }
133
+ .data-group-item:hover {
134
+ background: var(--color-surface-hover);
135
+ }
136
+ .data-group-item.clear {
137
+ color: var(--color-text-muted);
138
+ }
139
+ .data-group-empty {
140
+ padding: var(--pad-xs) var(--pad-sm);
141
+ color: var(--color-text-muted);
142
+ font-size: var(--text-sm);
143
+ }
144
+ .data-group-sep {
145
+ height: var(--border-width);
146
+ background: var(--color-border);
147
+ margin: var(--marg-xs) 0;
148
+ }
149
+ }
150
+ </style>
@@ -0,0 +1,7 @@
1
+ export interface DataGroupProps {
2
+ collection: string;
3
+ groupBy?: string | undefined;
4
+ }
5
+ declare const DataGroup: import("svelte").Component<DataGroupProps, {}, "groupBy">;
6
+ type DataGroup = ReturnType<typeof DataGroup>;
7
+ export default DataGroup;
@@ -0,0 +1,78 @@
1
+ <!--
2
+ DataSort.svelte
3
+ Single-field sort control. Click cycles none → asc → desc → none.
4
+ Designed to be stacked (multi-sort): each instance mutates a shared bindable `sortBy` array.
5
+
6
+ @prop {string} field - Field name to sort by
7
+ @prop {string} [title] - Display label (defaults to field)
8
+ @prop {SortBy[]} sortBy - Bindable array. Entry is upserted/removed for this field.
9
+ -->
10
+ <script module lang="ts">
11
+ import type { SortBy } from '../../types/index.js';
12
+
13
+ export interface DataSortProps {
14
+ field: string;
15
+ title?: string;
16
+ sortBy?: SortBy[];
17
+ }
18
+ </script>
19
+
20
+ <script lang="ts">
21
+ let {
22
+ field,
23
+ title,
24
+ sortBy = $bindable([])
25
+ }: DataSortProps = $props();
26
+
27
+ const current = $derived(sortBy.find(s => s.field === field)?.direction ?? 'none');
28
+
29
+ function next(dir: 'none' | 'asc' | 'desc'): 'none' | 'asc' | 'desc' {
30
+ return dir === 'none' ? 'asc' : dir === 'asc' ? 'desc' : 'none';
31
+ }
32
+
33
+ function cycle(): void {
34
+ const nextDir = next(current);
35
+ const others = sortBy.filter(s => s.field !== field);
36
+ sortBy = nextDir === 'none' ? others : [...others, { field, direction: nextDir }];
37
+ }
38
+
39
+ const icon = $derived(
40
+ current === 'asc' ? '↑' : current === 'desc' ? '↓' : '↕'
41
+ );
42
+ </script>
43
+
44
+ <button
45
+ type="button"
46
+ class="data-sort-btn"
47
+ class:active={current !== 'none'}
48
+ onclick={cycle}
49
+ title="Sort by {title ?? field}"
50
+ >
51
+ <span class="data-sort-label">{title ?? field}</span>
52
+ <span class="data-sort-icon">{icon}</span>
53
+ </button>
54
+
55
+ <style>
56
+ @layer components {
57
+ .data-sort-btn {
58
+ display: inline-flex;
59
+ align-items: center;
60
+ gap: var(--gutter-xs);
61
+ padding: var(--pad-xs) var(--pad-sm);
62
+ border: var(--border-width) solid var(--color-border);
63
+ background: var(--color-surface);
64
+ border-radius: var(--radius-sm);
65
+ cursor: pointer;
66
+ font-size: var(--text-sm);
67
+ }
68
+ .data-sort-btn.active {
69
+ background: var(--color-primary);
70
+ color: var(--default-color-surface-light);
71
+ border-color: var(--color-primary);
72
+ }
73
+ .data-sort-icon {
74
+ font-size: var(--text-xs);
75
+ opacity: 0.7;
76
+ }
77
+ }
78
+ </style>
@@ -0,0 +1,9 @@
1
+ import type { SortBy } from '../../types/index.js';
2
+ export interface DataSortProps {
3
+ field: string;
4
+ title?: string;
5
+ sortBy?: SortBy[];
6
+ }
7
+ declare const DataSort: import("svelte").Component<DataSortProps, {}, "sortBy">;
8
+ type DataSort = ReturnType<typeof DataSort>;
9
+ export default DataSort;
@@ -0,0 +1,67 @@
1
+ <!--
2
+ DataToolbar.svelte
3
+ Pure layout wrapper for data list controls (sort, group, find, mode switch, etc.).
4
+ No data logic — composition only. Lives in data-ui so data-ui/data stays layer-pure.
5
+
6
+ @snippet sort
7
+ @snippet group
8
+ @snippet find
9
+ @snippet extras - free area (mode switcher, custom buttons…)
10
+ @snippet default - if provided, replaces all named slots
11
+ -->
12
+ <script module lang="ts">
13
+ import type { Snippet } from 'svelte';
14
+
15
+ export interface DataToolbarProps {
16
+ sort?: Snippet;
17
+ group?: Snippet;
18
+ find?: Snippet;
19
+ extras?: Snippet;
20
+ children?: Snippet;
21
+ }
22
+ </script>
23
+
24
+ <script lang="ts">
25
+ let {
26
+ sort,
27
+ group,
28
+ find,
29
+ extras,
30
+ children
31
+ }: DataToolbarProps = $props();
32
+ </script>
33
+
34
+ <div class="data-toolbar">
35
+ {#if children}
36
+ {@render children()}
37
+ {:else}
38
+ {#if find}<div class="data-toolbar-slot">{@render find()}</div>{/if}
39
+ {#if sort}<div class="data-toolbar-slot">{@render sort()}</div>{/if}
40
+ {#if group}<div class="data-toolbar-slot">{@render group()}</div>{/if}
41
+ {#if extras}<div class="data-toolbar-slot data-toolbar-extras">{@render extras()}</div>{/if}
42
+ {/if}
43
+ </div>
44
+
45
+ <style>
46
+ @layer components {
47
+ .data-toolbar {
48
+ display: flex;
49
+ align-items: center;
50
+ gap: var(--gutter-xs);
51
+ flex-wrap: wrap;
52
+ min-height: var(--header-height);
53
+ padding: var(--pad-xs) var(--pad-sm);
54
+ border-bottom: var(--border-width) solid var(--color-border-strong);
55
+ background: var(--color-surface-alt);
56
+ }
57
+ .data-toolbar-slot {
58
+ display: inline-flex;
59
+ align-items: center;
60
+ gap: var(--gutter-xs);
61
+ min-width: 0;
62
+ }
63
+ .data-toolbar-extras {
64
+ margin-left: auto;
65
+ }
66
+ }
67
+ </style>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface DataToolbarProps {
3
+ sort?: Snippet;
4
+ group?: Snippet;
5
+ find?: Snippet;
6
+ extras?: Snippet;
7
+ children?: Snippet;
8
+ }
9
+ declare const DataToolbar: import("svelte").Component<DataToolbarProps, {}, "">;
10
+ type DataToolbar = ReturnType<typeof DataToolbar>;
11
+ export default DataToolbar;
@@ -0,0 +1,38 @@
1
+ <!--
2
+ Find.svelte
3
+ Composable search control — prefs-aware wrapper around DataFind.
4
+ Shares the same prefs store as the matching <DataList collection> (mediator).
5
+
6
+ @prop {string} collection
7
+ @prop {string} [prefsScope] - override scope (must match the DataList's)
8
+ @prop {boolean} [usePrefs=true]
9
+ -->
10
+ <script module lang="ts">
11
+ export interface FindProps {
12
+ collection: string;
13
+ prefsScope?: string;
14
+ usePrefs?: boolean;
15
+ advanced?: boolean;
16
+ }
17
+ </script>
18
+
19
+ <script lang="ts">
20
+ import {
21
+ useMachinePrefs,
22
+ dataListPrefsScope,
23
+ dataListPrefsDefaults
24
+ } from '../utils/useMachinePrefs.svelte.js';
25
+ import DataFind from './DataFind.svelte';
26
+
27
+ let {
28
+ collection,
29
+ prefsScope,
30
+ usePrefs = true,
31
+ advanced = false
32
+ }: FindProps = $props();
33
+
34
+ const scope = $derived(dataListPrefsScope(collection, prefsScope));
35
+ const prefs = useMachinePrefs(() => scope, dataListPrefsDefaults(), () => usePrefs);
36
+ </script>
37
+
38
+ <DataFind {collection} {advanced} bind:where={() => prefs.get('find'), (v) => prefs.set('find', v)} />
@@ -0,0 +1,9 @@
1
+ export interface FindProps {
2
+ collection: string;
3
+ prefsScope?: string;
4
+ usePrefs?: boolean;
5
+ advanced?: boolean;
6
+ }
7
+ declare const Find: import("svelte").Component<FindProps, {}, "">;
8
+ type Find = ReturnType<typeof Find>;
9
+ export default Find;
@@ -0,0 +1,94 @@
1
+ <!--
2
+ FkFilter.svelte
3
+ Single-FK select filter. Options are the target collection's records, labeled via
4
+ its presentation template. Emits a where fragment matching whichever convention the
5
+ source collection actually stores the relation in: the flat scalar field resolved via
6
+ scheme.findFkField (e.g. `category: "compact"` — the common case in real/seed data),
7
+ falling back to the nested join snapshot dot path (`fks.<fkName>.code`) when no flat
8
+ field is registered. Same nested-then-flat priority as dataRelationUtils.resolveForwardRelations.
9
+
10
+ @prop {string} collection - source collection (owns the FK)
11
+ @prop {string} fkName - key in scheme.fks
12
+ @prop {Where|undefined} [where] - $bindable
13
+ @prop {string|undefined} [value] - $bindable selected target code
14
+ @prop {string} [label] - defaults to fkName
15
+ -->
16
+ <script module lang="ts">
17
+ import type { Where } from '../../types/index.js';
18
+
19
+ export interface FkFilterProps {
20
+ collection: string;
21
+ fkName: string;
22
+ where?: Where | undefined;
23
+ value?: string | undefined;
24
+ label?: string;
25
+ }
26
+ </script>
27
+
28
+ <script lang="ts">
29
+ import { machine } from '../../main/machine.js';
30
+
31
+ let {
32
+ collection,
33
+ fkName,
34
+ where = $bindable(undefined),
35
+ value = $bindable(undefined),
36
+ label
37
+ }: FkFilterProps = $props();
38
+
39
+ const scheme = machine.logic.collection(collection);
40
+ const targetCollection = scheme?.fks?.[fkName]?.code;
41
+ // findFkField matches on the TARGET collection, so a source declaring two FKs to the
42
+ // same target resolves both to the first one — filtering by either then narrows the
43
+ // same field. No current model does this; revisit here if one starts to.
44
+ const fieldInfo = targetCollection ? (scheme?.findFkField(targetCollection) ?? null) : null;
45
+ const targetIndexKey = fieldInfo?.targetIndex ?? 'code';
46
+
47
+ // Setup-time subscription — fkName/targetCollection are fixed per instance.
48
+ const targetStore = targetCollection ? machine.store<Record<string, unknown>>(targetCollection) : null;
49
+ const targetScheme = targetCollection ? machine.logic.collection(targetCollection) : null;
50
+
51
+ const options = $derived.by(() => {
52
+ if (!targetStore || !targetScheme) return [];
53
+ return (targetStore.records as Record<string, unknown>[])
54
+ .map((record) => ({
55
+ key: String(record[targetIndexKey] ?? record.code ?? record.id ?? ''),
56
+ label: targetScheme.collectionValues.presentation(record) || String(record.code ?? record.id ?? '')
57
+ }))
58
+ .sort((a, b) => a.label.localeCompare(b.label));
59
+ });
60
+
61
+ function select(next: string): void {
62
+ value = next || undefined;
63
+ if (!value) {
64
+ where = undefined;
65
+ } else {
66
+ where = fieldInfo ? { [fieldInfo.fieldName]: value } : { [`fks.${fkName}.code`]: value };
67
+ }
68
+ }
69
+ </script>
70
+
71
+ <label class="fk-filter">
72
+ <span class="fk-filter-label">{label ?? fkName}</span>
73
+ <select class="form-select" value={value ?? ''} onchange={(e) => select(e.currentTarget.value)}>
74
+ <option value="">Tous</option>
75
+ {#each options as option (option.key)}
76
+ <option value={option.key}>{option.label}</option>
77
+ {/each}
78
+ </select>
79
+ </label>
80
+
81
+ <style>
82
+ @layer components {
83
+ .fk-filter {
84
+ display: flex;
85
+ flex-direction: column;
86
+ gap: var(--gutter-xs);
87
+ }
88
+ .fk-filter-label {
89
+ font-size: var(--text-xs);
90
+ color: var(--color-text-muted);
91
+ text-transform: capitalize;
92
+ }
93
+ }
94
+ </style>
@@ -0,0 +1,11 @@
1
+ import type { Where } from '../../types/index.js';
2
+ export interface FkFilterProps {
3
+ collection: string;
4
+ fkName: string;
5
+ where?: Where | undefined;
6
+ value?: string | undefined;
7
+ label?: string;
8
+ }
9
+ declare const FkFilter: import("svelte").Component<FkFilterProps, {}, "value" | "where">;
10
+ type FkFilter = ReturnType<typeof FkFilter>;
11
+ export default FkFilter;
@@ -0,0 +1,36 @@
1
+ <!--
2
+ Group.svelte
3
+ Composable group-by control — prefs-aware wrapper around DataGroup.
4
+ Shares the same prefs store as the matching <DataList collection> (mediator).
5
+
6
+ @prop {string} collection
7
+ @prop {string} [prefsScope] - override scope (must match the DataList's)
8
+ @prop {boolean} [usePrefs=true]
9
+ -->
10
+ <script module lang="ts">
11
+ export interface GroupProps {
12
+ collection: string;
13
+ prefsScope?: string;
14
+ usePrefs?: boolean;
15
+ }
16
+ </script>
17
+
18
+ <script lang="ts">
19
+ import {
20
+ useMachinePrefs,
21
+ dataListPrefsScope,
22
+ dataListPrefsDefaults
23
+ } from '../utils/useMachinePrefs.svelte.js';
24
+ import DataGroup from './DataGroup.svelte';
25
+
26
+ let {
27
+ collection,
28
+ prefsScope,
29
+ usePrefs = true
30
+ }: GroupProps = $props();
31
+
32
+ const scope = $derived(dataListPrefsScope(collection, prefsScope));
33
+ const prefs = useMachinePrefs(() => scope, dataListPrefsDefaults(), () => usePrefs);
34
+ </script>
35
+
36
+ <DataGroup {collection} bind:groupBy={() => prefs.get('groupBy'), (v) => prefs.set('groupBy', v)} />
@@ -0,0 +1,8 @@
1
+ export interface GroupProps {
2
+ collection: string;
3
+ prefsScope?: string;
4
+ usePrefs?: boolean;
5
+ }
6
+ declare const Group: import("svelte").Component<GroupProps, {}, "">;
7
+ type Group = ReturnType<typeof Group>;
8
+ export default Group;
@@ -0,0 +1,79 @@
1
+ <!--
2
+ ListMode.svelte
3
+ Composable list/table/grid mode switcher — prefs-aware.
4
+ Shares the same prefs store as the matching <DataList collection> (mediator).
5
+
6
+ @prop {string} collection
7
+ @prop {string} [prefsScope] - override scope (must match the DataList's)
8
+ @prop {boolean} [usePrefs=true]
9
+ @prop {Array<'list'|'table'|'grid'|'accordion'>} [modes] - which modes to offer
10
+ -->
11
+ <script module lang="ts">
12
+ export interface ListModeProps {
13
+ collection: string;
14
+ prefsScope?: string;
15
+ usePrefs?: boolean;
16
+ modes?: Array<'list' | 'table' | 'grid' | 'accordion'>;
17
+ onModeChange?: (mode: 'list' | 'table' | 'grid' | 'accordion') => void;
18
+ }
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import {
23
+ useMachinePrefs,
24
+ dataListPrefsScope,
25
+ dataListPrefsDefaults
26
+ } from '../utils/useMachinePrefs.svelte.js';
27
+
28
+ let {
29
+ collection,
30
+ prefsScope,
31
+ usePrefs = true,
32
+ modes = ['list', 'table', 'grid', 'accordion'],
33
+ onModeChange
34
+ }: ListModeProps = $props();
35
+
36
+ const scope = $derived(dataListPrefsScope(collection, prefsScope));
37
+ const prefs = useMachinePrefs(() => scope, dataListPrefsDefaults(), () => usePrefs);
38
+
39
+ const current = $derived(prefs.slots.mode ?? 'list');
40
+ </script>
41
+
42
+ <div class="mode-switcher">
43
+ {#each modes as m (m)}
44
+ <button
45
+ type="button"
46
+ class="mode-btn"
47
+ class:active={current === m}
48
+ onclick={() => {
49
+ prefs.set('mode', m);
50
+ onModeChange?.(m);
51
+ }}
52
+ >
53
+ {m}
54
+ </button>
55
+ {/each}
56
+ </div>
57
+
58
+ <style>
59
+ @layer components {
60
+ .mode-switcher {
61
+ display: flex;
62
+ gap: 0;
63
+ }
64
+ .mode-btn {
65
+ padding: var(--pad-xs) var(--pad-sm);
66
+ border: var(--border-width) solid var(--color-border);
67
+ background: var(--color-surface);
68
+ cursor: pointer;
69
+ border-radius: 0;
70
+ font-size: var(--text-sm);
71
+ text-transform: capitalize;
72
+ }
73
+ .mode-btn.active {
74
+ background: var(--color-primary);
75
+ color: var(--default-color-surface-light);
76
+ border-color: var(--color-primary);
77
+ }
78
+ }
79
+ </style>
@@ -0,0 +1,10 @@
1
+ export interface ListModeProps {
2
+ collection: string;
3
+ prefsScope?: string;
4
+ usePrefs?: boolean;
5
+ modes?: Array<'list' | 'table' | 'grid' | 'accordion'>;
6
+ onModeChange?: (mode: 'list' | 'table' | 'grid' | 'accordion') => void;
7
+ }
8
+ declare const ListMode: import("svelte").Component<ListModeProps, {}, "">;
9
+ type ListMode = ReturnType<typeof ListMode>;
10
+ export default ListMode;