rimecms 1.1.6 → 1.3.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 (1087) hide show
  1. package/dist/adapter-sqlite/area.server.d.ts +2 -3
  2. package/dist/adapter-sqlite/area.server.js +2 -3
  3. package/dist/adapter-sqlite/auth.server.d.ts +2 -8
  4. package/dist/adapter-sqlite/auth.server.js +2 -8
  5. package/dist/adapter-sqlite/blocks.server.d.ts +2 -23
  6. package/dist/adapter-sqlite/blocks.server.js +15 -93
  7. package/dist/adapter-sqlite/collection.server.d.ts +2 -5
  8. package/dist/adapter-sqlite/collection.server.js +2 -5
  9. package/dist/adapter-sqlite/columns.server.d.ts +9 -9
  10. package/dist/adapter-sqlite/columns.server.js +41 -39
  11. package/dist/adapter-sqlite/connect.server.js +1 -1
  12. package/dist/adapter-sqlite/constant.d.ts +16 -0
  13. package/dist/adapter-sqlite/constant.js +16 -0
  14. package/dist/adapter-sqlite/db-move.server.d.ts +31 -0
  15. package/dist/adapter-sqlite/db-move.server.js +102 -0
  16. package/dist/adapter-sqlite/drizzle-config.server.d.ts +9 -0
  17. package/dist/adapter-sqlite/drizzle-config.server.js +39 -0
  18. package/dist/adapter-sqlite/generate-schema/column.server.js +37 -45
  19. package/dist/adapter-sqlite/generate-schema/index.server.d.ts +0 -1
  20. package/dist/adapter-sqlite/generate-schema/index.server.js +11 -20
  21. package/dist/adapter-sqlite/generate-schema/relations/junction.server.d.ts +7 -7
  22. package/dist/adapter-sqlite/generate-schema/relations/junction.server.js +9 -11
  23. package/dist/adapter-sqlite/generate-schema/root.server.d.ts +8 -11
  24. package/dist/adapter-sqlite/generate-schema/root.server.js +7 -14
  25. package/dist/adapter-sqlite/generate-schema/templates.server.d.ts +16 -26
  26. package/dist/adapter-sqlite/generate-schema/templates.server.js +25 -25
  27. package/dist/adapter-sqlite/generate-schema/write.server.d.ts +31 -0
  28. package/dist/adapter-sqlite/generate-schema/write.server.js +120 -28
  29. package/dist/adapter-sqlite/hooks.server.d.ts +3 -0
  30. package/dist/adapter-sqlite/hooks.server.js +64 -0
  31. package/dist/adapter-sqlite/index.server.d.ts +14 -6
  32. package/dist/adapter-sqlite/index.server.js +23 -8
  33. package/dist/adapter-sqlite/index.server.test-d.d.ts +1 -0
  34. package/dist/adapter-sqlite/index.server.test-d.js +8 -0
  35. package/dist/adapter-sqlite/locales.server.js +2 -3
  36. package/dist/adapter-sqlite/naming.server.d.ts +14 -10
  37. package/dist/adapter-sqlite/naming.server.js +11 -13
  38. package/dist/adapter-sqlite/order-by.server.d.ts +7 -1
  39. package/dist/adapter-sqlite/order-by.server.js +14 -16
  40. package/dist/adapter-sqlite/paths.server.d.ts +1 -1
  41. package/dist/adapter-sqlite/paths.server.js +15 -24
  42. package/dist/adapter-sqlite/read.server.d.ts +10 -13
  43. package/dist/adapter-sqlite/read.server.js +31 -14
  44. package/dist/adapter-sqlite/relations.server.d.ts +5 -0
  45. package/dist/adapter-sqlite/relations.server.js +36 -15
  46. package/dist/adapter-sqlite/repeatable.server.d.ts +9 -0
  47. package/dist/adapter-sqlite/repeatable.server.js +79 -0
  48. package/dist/adapter-sqlite/rows.server.d.ts +2 -3
  49. package/dist/adapter-sqlite/select.server.d.ts +2 -2
  50. package/dist/adapter-sqlite/select.server.js +21 -32
  51. package/dist/adapter-sqlite/table.server.d.ts +2 -2
  52. package/dist/adapter-sqlite/table.server.js +12 -10
  53. package/dist/adapter-sqlite/transaction.server.d.ts +21 -0
  54. package/dist/adapter-sqlite/transaction.server.js +26 -0
  55. package/dist/adapter-sqlite/transform.server.d.ts +9 -0
  56. package/dist/adapter-sqlite/transform.server.js +21 -16
  57. package/dist/adapter-sqlite/tree.server.d.ts +2 -23
  58. package/dist/adapter-sqlite/tree.server.js +12 -93
  59. package/dist/adapter-sqlite/types.server.d.ts +5 -4
  60. package/dist/adapter-sqlite/where.server.js +117 -78
  61. package/dist/adapter-sqlite/write.server.d.ts +6 -51
  62. package/dist/adapter-sqlite/write.server.js +30 -45
  63. package/dist/core/adapter.d.ts +53 -28
  64. package/dist/core/auth/access.d.ts +11 -26
  65. package/dist/core/auth/access.js +13 -23
  66. package/dist/core/auth/augment.d.ts +4 -5
  67. package/dist/core/auth/augment.js +11 -21
  68. package/dist/core/auth/augment.server.js +2 -1
  69. package/dist/core/auth/better-auth/config.server.d.ts +8 -11
  70. package/dist/core/auth/better-auth/config.server.js +39 -11
  71. package/dist/core/auth/better-auth/hooks.server.js +33 -24
  72. package/dist/core/auth/better-auth/instance.server.d.ts +15 -26
  73. package/dist/core/auth/better-auth/instance.server.js +2 -11
  74. package/dist/core/auth/better-auth/permissions.d.ts +8 -1
  75. package/dist/core/auth/better-auth/permissions.js +7 -3
  76. package/dist/core/auth/better-auth-tables.server.d.ts +18 -5
  77. package/dist/core/auth/better-auth-tables.server.js +29 -10
  78. package/dist/core/auth/configure.d.ts +2 -2
  79. package/dist/core/auth/configure.js +2 -2
  80. package/dist/core/auth/constant.d.ts +15 -0
  81. package/dist/core/auth/constant.js +15 -0
  82. package/dist/core/auth/constant.server.d.ts +4 -8
  83. package/dist/core/auth/constant.server.js +4 -8
  84. package/dist/core/auth/enabled.js +1 -1
  85. package/dist/core/auth/handler/index.server.d.ts +2 -2
  86. package/dist/core/auth/handler/index.server.js +78 -58
  87. package/dist/core/auth/hooks/augment-fields-password.server.d.ts +3 -18
  88. package/dist/core/auth/hooks/augment-fields-password.server.js +4 -19
  89. package/dist/core/auth/hooks/create-better-auth-user.server.js +44 -46
  90. package/dist/core/auth/hooks/delete-better-auth-user.server.d.ts +5 -1
  91. package/dist/core/auth/hooks/delete-better-auth-user.server.js +15 -16
  92. package/dist/core/auth/hooks/forward-roles.server.d.ts +12 -8
  93. package/dist/core/auth/hooks/forward-roles.server.js +54 -39
  94. package/dist/core/auth/hooks/index.server.d.ts +3 -3
  95. package/dist/core/auth/hooks/index.server.js +3 -3
  96. package/dist/core/auth/hooks/prevent-superadmin-deletion.server.d.ts +2 -3
  97. package/dist/core/auth/hooks/prevent-superadmin-deletion.server.js +2 -3
  98. package/dist/core/auth/hooks/prevent-superadmin-mutation.server.d.ts +3 -2
  99. package/dist/core/auth/hooks/prevent-superadmin-mutation.server.js +8 -6
  100. package/dist/core/auth/hooks/sign-in-new-user.server.d.ts +5 -7
  101. package/dist/core/auth/hooks/sign-in-new-user.server.js +6 -10
  102. package/dist/core/auth/staff/configure.js +5 -3
  103. package/dist/core/auth/staff/configure.server.js +6 -6
  104. package/dist/core/auth/staff/derive.d.ts +2 -21
  105. package/dist/core/auth/staff/derive.js +19 -19
  106. package/dist/core/auth/tables.d.ts +0 -20
  107. package/dist/core/auth/tables.js +4 -21
  108. package/dist/core/auth/types.d.ts +2 -4
  109. package/dist/core/auth/user.server.d.ts +30 -16
  110. package/dist/core/auth/user.server.js +43 -17
  111. package/dist/core/boot.server.d.ts +15 -17
  112. package/dist/core/boot.server.js +23 -9
  113. package/dist/core/codegen.server.d.ts +4 -6
  114. package/dist/core/codegen.server.js +44 -19
  115. package/dist/core/config/build.d.ts +5 -7
  116. package/dist/core/config/build.js +4 -6
  117. package/dist/core/config/build.server.d.ts +2 -15
  118. package/dist/core/config/build.server.js +2 -3
  119. package/dist/core/config/client.test-d.d.ts +1 -0
  120. package/dist/core/config/client.test-d.js +13 -0
  121. package/dist/core/config/configure.d.ts +4 -8
  122. package/dist/core/config/configure.js +4 -8
  123. package/dist/core/config/context.server.d.ts +1 -5
  124. package/dist/core/config/context.server.js +5 -15
  125. package/dist/core/config/hooks.test-d.d.ts +1 -0
  126. package/dist/core/config/hooks.test-d.js +9 -0
  127. package/dist/core/config/index.server.d.ts +5 -1
  128. package/dist/core/config/index.server.js +5 -1
  129. package/dist/core/config/inference.spec-d.d.ts +1 -0
  130. package/dist/core/config/inference.spec-d.js +21 -0
  131. package/dist/core/config/types.d.ts +30 -46
  132. package/dist/core/config/validate.server.d.ts +2 -2
  133. package/dist/core/config/validate.server.js +43 -66
  134. package/dist/core/constants.d.ts +11 -4
  135. package/dist/core/constants.js +11 -4
  136. package/dist/core/constants.server.d.ts +1 -1
  137. package/dist/core/constants.server.js +1 -1
  138. package/dist/core/cors/configure.server.d.ts +6 -4
  139. package/dist/core/cors/configure.server.js +9 -8
  140. package/dist/core/cors/handler.server.d.ts +5 -5
  141. package/dist/core/cors/handler.server.js +24 -18
  142. package/dist/core/cors/module.server.js +2 -2
  143. package/dist/core/dev/cache.server.d.ts +17 -0
  144. package/dist/core/dev/cache.server.js +7 -6
  145. package/dist/core/dev/cli/commands/build.d.ts +2 -3
  146. package/dist/core/dev/cli/commands/build.js +35 -18
  147. package/dist/core/dev/cli/commands/clear.server.d.ts +5 -0
  148. package/dist/core/dev/cli/commands/clear.server.js +23 -8
  149. package/dist/core/dev/cli/commands/generate-exports.server.d.ts +3 -5
  150. package/dist/core/dev/cli/commands/generate-exports.server.js +9 -15
  151. package/dist/core/dev/cli/commands/generate.server.js +14 -7
  152. package/dist/core/dev/cli/commands/init.server.d.ts +3 -1
  153. package/dist/core/dev/cli/commands/init.server.js +78 -123
  154. package/dist/core/dev/cli/commands/uploads-move.server.d.ts +33 -0
  155. package/dist/core/dev/cli/commands/uploads-move.server.js +122 -0
  156. package/dist/core/dev/cli/index.js +40 -7
  157. package/dist/core/dev/cli/templates/build.d.ts +1 -1
  158. package/dist/core/dev/cli/templates/build.js +16 -32
  159. package/dist/core/dev/cli/templates/env.d.ts +19 -0
  160. package/dist/core/dev/cli/templates/env.js +92 -0
  161. package/dist/core/dev/cli/templates/init.d.ts +35 -19
  162. package/dist/core/dev/cli/templates/init.js +97 -79
  163. package/dist/core/dev/cli/util/adapter-hooks.server.d.ts +15 -0
  164. package/dist/core/dev/cli/util/adapter-hooks.server.js +17 -0
  165. package/dist/core/dev/cli/util/package-manager.server.d.ts +7 -2
  166. package/dist/core/dev/cli/util/package-manager.server.js +14 -32
  167. package/dist/core/dev/cli/util/project-name.d.ts +15 -0
  168. package/dist/core/dev/cli/util/project-name.js +28 -0
  169. package/dist/core/dev/codegen/routes/common.server.d.ts +41 -20
  170. package/dist/core/dev/codegen/routes/common.server.js +96 -74
  171. package/dist/core/dev/codegen/routes/custom-css.server.d.ts +0 -10
  172. package/dist/core/dev/codegen/routes/custom-css.server.js +9 -55
  173. package/dist/core/dev/codegen/routes/index.server.d.ts +21 -6
  174. package/dist/core/dev/codegen/routes/index.server.js +59 -38
  175. package/dist/core/dev/codegen/routes/util.server.d.ts +12 -8
  176. package/dist/core/dev/codegen/routes/util.server.js +12 -14
  177. package/dist/core/dev/codegen/runtime/index.server.d.ts +9 -25
  178. package/dist/core/dev/codegen/runtime/index.server.js +5 -35
  179. package/dist/core/dev/codegen/runtime/parse-exports.server.d.ts +2 -2
  180. package/dist/core/dev/codegen/runtime/parse-exports.server.js +2 -2
  181. package/dist/core/dev/codegen/sanitize/index.server.d.ts +21 -0
  182. package/dist/core/dev/codegen/sanitize/index.server.js +307 -408
  183. package/dist/core/dev/codegen/types/contributions.server.d.ts +1 -6
  184. package/dist/core/dev/codegen/types/contributions.server.js +1 -2
  185. package/dist/core/dev/codegen/types/index.server.d.ts +29 -3
  186. package/dist/core/dev/codegen/types/index.server.js +50 -59
  187. package/dist/core/dev/codegen/types/templates.server.d.ts +3 -1
  188. package/dist/core/dev/codegen/types/templates.server.js +20 -29
  189. package/dist/core/dev/config-memo.server.d.ts +17 -2
  190. package/dist/core/dev/config-memo.server.js +50 -23
  191. package/dist/core/dev/constants.server.d.ts +23 -2
  192. package/dist/core/dev/constants.server.js +38 -13
  193. package/dist/core/dev/deny-storage.server.d.ts +18 -0
  194. package/dist/core/dev/deny-storage.server.js +29 -0
  195. package/dist/core/dev/ensure.server.d.ts +1 -22
  196. package/dist/core/dev/ensure.server.js +6 -25
  197. package/dist/core/dev/env.server.d.ts +17 -0
  198. package/dist/core/dev/env.server.js +18 -0
  199. package/dist/core/dev/version.server.d.ts +2 -2
  200. package/dist/core/dev/version.server.js +21 -3
  201. package/dist/core/dev/vite.server.d.ts +11 -0
  202. package/dist/core/dev/vite.server.js +36 -23
  203. package/dist/core/errors/handler.server.d.ts +20 -56
  204. package/dist/core/errors/handler.server.js +50 -80
  205. package/dist/core/errors/index.d.ts +15 -4
  206. package/dist/core/errors/index.js +38 -27
  207. package/dist/core/fields/builders/boolean-builder.d.ts +1 -8
  208. package/dist/core/fields/builders/boolean-builder.js +3 -14
  209. package/dist/core/fields/builders/field-builder.d.ts +6 -7
  210. package/dist/core/fields/builders/field-builder.js +3 -4
  211. package/dist/core/fields/builders/form-field-builder.d.ts +40 -9
  212. package/dist/core/fields/builders/form-field-builder.js +59 -11
  213. package/dist/core/fields/builders/select-builder.d.ts +3 -6
  214. package/dist/core/fields/builders/select-builder.js +19 -28
  215. package/dist/core/fields/complete.d.ts +2 -2
  216. package/dist/core/fields/complete.js +4 -4
  217. package/dist/core/fields/empty.d.ts +9 -4
  218. package/dist/core/fields/empty.js +29 -5
  219. package/dist/core/fields/initial.d.ts +2 -1
  220. package/dist/core/fields/initial.js +9 -1
  221. package/dist/core/fields/localize.d.ts +12 -0
  222. package/dist/core/fields/localize.js +14 -0
  223. package/dist/core/fields/types.d.ts +8 -7
  224. package/dist/core/fields/types.test-d.js +2 -1
  225. package/dist/core/fields/unique.server.d.ts +13 -0
  226. package/dist/core/fields/unique.server.js +37 -0
  227. package/dist/core/fields/util.d.ts +12 -30
  228. package/dist/core/fields/util.js +18 -48
  229. package/dist/core/fields/validate.d.ts +20 -7
  230. package/dist/core/fields/validate.js +21 -14
  231. package/dist/core/fields/walk.d.ts +5 -9
  232. package/dist/core/fields/walk.js +9 -9
  233. package/dist/core/handler.server.d.ts +1 -1
  234. package/dist/core/handler.server.js +18 -5
  235. package/dist/core/i18n/en/common.d.ts +1 -15
  236. package/dist/core/i18n/en/common.js +5 -19
  237. package/dist/core/i18n/en/errors.d.ts +25 -8
  238. package/dist/core/i18n/en/errors.js +25 -9
  239. package/dist/core/i18n/en/fields.d.ts +2 -7
  240. package/dist/core/i18n/en/fields.js +4 -8
  241. package/dist/core/i18n/fr/common.d.ts +1 -16
  242. package/dist/core/i18n/fr/common.js +5 -20
  243. package/dist/core/i18n/fr/errors.d.ts +25 -7
  244. package/dist/core/i18n/fr/errors.js +25 -7
  245. package/dist/core/i18n/fr/fields.d.ts +2 -7
  246. package/dist/core/i18n/fr/fields.js +4 -8
  247. package/dist/core/i18n/index.d.ts +2 -6
  248. package/dist/core/i18n/index.js +2 -2
  249. package/dist/core/i18n/register.server.d.ts +4 -0
  250. package/dist/core/i18n/register.server.js +14 -27
  251. package/dist/core/locale/copy.server.d.ts +12 -6
  252. package/dist/core/locale/copy.server.js +94 -44
  253. package/dist/core/locale/request.server.d.ts +14 -0
  254. package/dist/core/locale/request.server.js +34 -0
  255. package/dist/core/locale/types.d.ts +2 -2
  256. package/dist/core/logger.server.d.ts +10 -0
  257. package/dist/core/logger.server.js +138 -126
  258. package/dist/core/panel/configure.d.ts +10 -9
  259. package/dist/core/panel/configure.js +11 -13
  260. package/dist/core/panel/types.d.ts +2 -2
  261. package/dist/core/pipeline/build-document.server.d.ts +2 -3
  262. package/dist/core/pipeline/build-document.server.js +11 -8
  263. package/dist/core/pipeline/build.server.d.ts +3 -17
  264. package/dist/core/pipeline/build.server.js +10 -21
  265. package/dist/core/pipeline/define-hook.d.ts +12 -12
  266. package/dist/core/pipeline/define-hook.js +12 -12
  267. package/dist/core/pipeline/extract-data.server.d.ts +4 -12
  268. package/dist/core/pipeline/extract-data.server.js +29 -46
  269. package/dist/core/pipeline/hooks/authorize.server.js +1 -4
  270. package/dist/core/pipeline/hooks/complete-new-rows.server.d.ts +17 -0
  271. package/dist/core/pipeline/hooks/complete-new-rows.server.js +35 -0
  272. package/dist/core/pipeline/hooks/get-original-document.server.d.ts +4 -1
  273. package/dist/core/pipeline/hooks/get-original-document.server.js +9 -4
  274. package/dist/core/pipeline/hooks/normalize-resolved-references.server.d.ts +14 -3
  275. package/dist/core/pipeline/hooks/normalize-resolved-references.server.js +29 -19
  276. package/dist/core/pipeline/hooks/original-config-map.server.js +1 -1
  277. package/dist/core/pipeline/hooks/process-document-fields.server.d.ts +15 -2
  278. package/dist/core/pipeline/hooks/process-document-fields.server.js +39 -16
  279. package/dist/core/pipeline/hooks/resolve-content-owner.server.d.ts +1 -9
  280. package/dist/core/pipeline/hooks/resolve-content-owner.server.js +1 -9
  281. package/dist/core/pipeline/hooks/set-default-values.server.d.ts +1 -11
  282. package/dist/core/pipeline/hooks/set-default-values.server.js +8 -5
  283. package/dist/core/pipeline/hooks/set-document-locale.server.d.ts +2 -2
  284. package/dist/core/pipeline/hooks/set-document-locale.server.js +3 -7
  285. package/dist/core/pipeline/hooks/set-document-type.server.d.ts +2 -1
  286. package/dist/core/pipeline/hooks/set-document-type.server.js +2 -1
  287. package/dist/core/pipeline/hooks/sort-document-props.server.js +2 -2
  288. package/dist/core/pipeline/hooks/validate-fields.server.d.ts +13 -8
  289. package/dist/core/pipeline/hooks/validate-fields.server.js +126 -91
  290. package/dist/core/pipeline/persist/blocks/extract.server.js +7 -4
  291. package/dist/core/pipeline/persist/blocks/index.server.d.ts +2 -7
  292. package/dist/core/pipeline/persist/blocks/index.server.js +5 -15
  293. package/dist/core/pipeline/persist/relations/diff.server.d.ts +10 -2
  294. package/dist/core/pipeline/persist/relations/diff.server.js +45 -38
  295. package/dist/core/pipeline/persist/relations/index.server.d.ts +6 -15
  296. package/dist/core/pipeline/persist/relations/index.server.js +2 -8
  297. package/dist/core/pipeline/persist/repeatable.server.d.ts +46 -0
  298. package/dist/core/pipeline/persist/repeatable.server.js +48 -0
  299. package/dist/core/pipeline/persist/tree/extract.server.js +2 -2
  300. package/dist/core/pipeline/persist/tree/index.server.d.ts +4 -5
  301. package/dist/core/pipeline/persist/tree/index.server.js +5 -12
  302. package/dist/core/pipeline/populate-relations.server.d.ts +5 -2
  303. package/dist/core/pipeline/populate-relations.server.js +13 -4
  304. package/dist/core/pipeline/query.d.ts +31 -6
  305. package/dist/core/pipeline/query.js +90 -9
  306. package/dist/core/pipeline/run.server.d.ts +7 -8
  307. package/dist/core/pipeline/run.server.js +29 -27
  308. package/dist/core/pipeline/seen-by.server.d.ts +19 -0
  309. package/dist/core/pipeline/seen-by.server.js +19 -0
  310. package/dist/core/pipeline/types.d.ts +10 -19
  311. package/dist/core/pipeline/types.js +0 -9
  312. package/dist/core/pipeline/without-denied-fields.d.ts +43 -0
  313. package/dist/core/pipeline/without-denied-fields.js +114 -0
  314. package/dist/core/pipeline/without-row-keys.d.ts +18 -0
  315. package/dist/core/pipeline/without-row-keys.js +26 -0
  316. package/dist/core/plugins/api-init/index.server.d.ts +5 -0
  317. package/dist/core/plugins/api-init/index.server.js +18 -31
  318. package/dist/core/plugins/cache/HeaderButton.svelte +1 -1
  319. package/dist/core/plugins/cache/cache.server.d.ts +0 -1
  320. package/dist/core/plugins/cache/cache.server.js +18 -33
  321. package/dist/core/plugins/cache/handler.server.d.ts +1 -1
  322. package/dist/core/plugins/cache/handler.server.js +13 -5
  323. package/dist/core/plugins/cache/index.js +2 -2
  324. package/dist/core/plugins/cache/module.js +2 -2
  325. package/dist/core/plugins/cache/module.server.d.ts +3 -3
  326. package/dist/core/plugins/cache/module.server.js +4 -4
  327. package/dist/core/plugins/configure.d.ts +2 -2
  328. package/dist/core/plugins/configure.js +7 -3
  329. package/dist/core/plugins/defaults/module.d.ts +3 -4
  330. package/dist/core/plugins/defaults/module.js +3 -6
  331. package/dist/core/plugins/defaults/module.server.js +1 -1
  332. package/dist/core/plugins/index.d.ts +1 -1
  333. package/dist/core/plugins/mailer/index.server.d.ts +5 -0
  334. package/dist/core/plugins/mailer/index.server.js +9 -3
  335. package/dist/core/plugins/plugins.server.d.ts +1 -1
  336. package/dist/core/plugins/plugins.server.js +0 -1
  337. package/dist/core/plugins/sse/bus.server.js +25 -14
  338. package/dist/core/plugins/sse/client.js +21 -5
  339. package/dist/core/prototype/area/api.server.d.ts +3 -4
  340. package/dist/core/prototype/area/api.server.js +11 -23
  341. package/dist/core/prototype/area/augment-label.d.ts +1 -2
  342. package/dist/core/prototype/area/augment-label.js +1 -2
  343. package/dist/core/prototype/area/definition.d.ts +1 -1
  344. package/dist/core/prototype/area/definition.js +2 -2
  345. package/dist/core/prototype/area/definition.server.js +0 -15
  346. package/dist/core/prototype/area/hooks.server.d.ts +6 -9
  347. package/dist/core/prototype/area/hooks.server.js +13 -13
  348. package/dist/core/prototype/area/operations/find.d.ts +2 -10
  349. package/dist/core/prototype/area/operations/find.js +2 -9
  350. package/dist/core/prototype/area/operations/update.d.ts +5 -19
  351. package/dist/core/prototype/area/operations/update.js +7 -6
  352. package/dist/core/prototype/area/rest/endpoint.server.d.ts +1 -1
  353. package/dist/core/prototype/area/rest/endpoint.server.js +3 -5
  354. package/dist/core/prototype/area/rest/get.server.js +3 -25
  355. package/dist/core/prototype/area/rest/index.server.d.ts +1 -1
  356. package/dist/core/prototype/area/rest/index.server.js +1 -1
  357. package/dist/core/prototype/area/rest/lock.server.js +11 -28
  358. package/dist/core/prototype/area/rest/update.server.js +4 -32
  359. package/dist/core/prototype/collection/api.server.d.ts +6 -18
  360. package/dist/core/prototype/collection/api.server.js +20 -40
  361. package/dist/core/prototype/collection/augment-label.d.ts +2 -1
  362. package/dist/core/prototype/collection/can-duplicate.d.ts +15 -0
  363. package/dist/core/prototype/collection/can-duplicate.js +11 -0
  364. package/dist/core/prototype/collection/definition.d.ts +6 -8
  365. package/dist/core/prototype/collection/definition.js +14 -18
  366. package/dist/core/prototype/collection/definition.server.d.ts +1 -2
  367. package/dist/core/prototype/collection/definition.server.js +2 -14
  368. package/dist/core/prototype/collection/hooks.server.d.ts +5 -6
  369. package/dist/core/prototype/collection/hooks.server.js +23 -14
  370. package/dist/core/prototype/collection/nested/hooks/add-children.server.js +10 -17
  371. package/dist/core/prototype/collection/nested/hooks/index.server.d.ts +3 -2
  372. package/dist/core/prototype/collection/nested/hooks/index.server.js +3 -2
  373. package/dist/core/prototype/collection/nested/hooks/refuse-cyclic-parent.server.d.ts +10 -0
  374. package/dist/core/prototype/collection/nested/hooks/refuse-cyclic-parent.server.js +30 -0
  375. package/dist/core/prototype/collection/nested/module.d.ts +3 -2
  376. package/dist/core/prototype/collection/nested/module.js +3 -2
  377. package/dist/core/prototype/collection/nested/module.server.d.ts +1 -2
  378. package/dist/core/prototype/collection/nested/module.server.js +1 -2
  379. package/dist/core/prototype/collection/nested/tree.d.ts +3 -2
  380. package/dist/core/prototype/collection/nested/tree.js +3 -6
  381. package/dist/core/prototype/collection/operations/create.js +6 -3
  382. package/dist/core/prototype/collection/operations/delete-by-id.js +2 -4
  383. package/dist/core/prototype/collection/operations/delete.js +16 -2
  384. package/dist/core/prototype/collection/operations/duplicate.d.ts +25 -0
  385. package/dist/core/prototype/collection/operations/duplicate.js +98 -73
  386. package/dist/core/prototype/collection/operations/find-by-id.d.ts +2 -12
  387. package/dist/core/prototype/collection/operations/find-by-id.js +4 -10
  388. package/dist/core/prototype/collection/operations/find-by-ids.d.ts +2 -0
  389. package/dist/core/prototype/collection/operations/find-by-ids.js +16 -9
  390. package/dist/core/prototype/collection/operations/find.js +4 -1
  391. package/dist/core/prototype/collection/operations/update-by-id.d.ts +5 -17
  392. package/dist/core/prototype/collection/operations/update-by-id.js +6 -8
  393. package/dist/core/prototype/collection/operations/update-slug-by-id.d.ts +4 -2
  394. package/dist/core/prototype/collection/operations/update-slug-by-id.js +24 -5
  395. package/dist/core/prototype/collection/rest/create.server.js +4 -20
  396. package/dist/core/prototype/collection/rest/delete-by-id.server.js +2 -9
  397. package/dist/core/prototype/collection/rest/delete.server.d.ts +3 -1
  398. package/dist/core/prototype/collection/rest/delete.server.js +10 -27
  399. package/dist/core/prototype/collection/rest/duplicate.server.d.ts +1 -0
  400. package/dist/core/prototype/collection/rest/duplicate.server.js +8 -13
  401. package/dist/core/prototype/collection/rest/endpoint.server.d.ts +10 -14
  402. package/dist/core/prototype/collection/rest/endpoint.server.js +10 -15
  403. package/dist/core/prototype/collection/rest/get-by-id.server.js +5 -32
  404. package/dist/core/prototype/collection/rest/get.server.js +5 -32
  405. package/dist/core/prototype/collection/rest/index.server.d.ts +3 -3
  406. package/dist/core/prototype/collection/rest/index.server.js +3 -3
  407. package/dist/core/prototype/collection/rest/lock.server.js +11 -31
  408. package/dist/core/prototype/collection/rest/update-by-id.server.js +6 -36
  409. package/dist/core/prototype/collection/rest/update-slug-by-id.server.d.ts +4 -1
  410. package/dist/core/prototype/collection/rest/update-slug-by-id.server.js +10 -14
  411. package/dist/core/prototype/collection/thumbnail/augment.js +1 -5
  412. package/dist/core/prototype/collection/thumbnail/find-thumbnail.d.ts +3 -9
  413. package/dist/core/prototype/collection/thumbnail/find-thumbnail.js +4 -4
  414. package/dist/core/prototype/collection/thumbnail/hooks/index.server.d.ts +1 -2
  415. package/dist/core/prototype/collection/thumbnail/hooks/index.server.js +1 -2
  416. package/dist/core/prototype/collection/thumbnail/hooks/set-document-thumbnail.server.js +12 -5
  417. package/dist/core/prototype/collection/upload/boot/index.server.d.ts +4 -5
  418. package/dist/core/prototype/collection/upload/boot/index.server.js +4 -5
  419. package/dist/core/prototype/collection/upload/constant.d.ts +14 -2
  420. package/dist/core/prototype/collection/upload/constant.js +14 -2
  421. package/dist/core/prototype/collection/upload/directories/configure.d.ts +2 -4
  422. package/dist/core/prototype/collection/upload/directories/configure.js +2 -4
  423. package/dist/core/prototype/collection/upload/directories/configure.server.d.ts +2 -2
  424. package/dist/core/prototype/collection/upload/directories/configure.server.js +2 -9
  425. package/dist/core/prototype/collection/upload/directories/derive.d.ts +1 -2
  426. package/dist/core/prototype/collection/upload/directories/derive.js +1 -3
  427. package/dist/core/prototype/collection/upload/directories/pipeline.server.d.ts +3 -3
  428. package/dist/core/prototype/collection/upload/directories/pipeline.server.js +3 -3
  429. package/dist/core/prototype/collection/upload/disk/delete.server.d.ts +26 -6
  430. package/dist/core/prototype/collection/upload/disk/delete.server.js +64 -57
  431. package/dist/core/prototype/collection/upload/disk/medias.server.d.ts +56 -0
  432. package/dist/core/prototype/collection/upload/disk/medias.server.js +54 -0
  433. package/dist/core/prototype/collection/upload/disk/save.server.d.ts +26 -24
  434. package/dist/core/prototype/collection/upload/disk/save.server.js +44 -30
  435. package/dist/core/prototype/collection/upload/doc-type.d.ts +2 -2
  436. package/dist/core/prototype/collection/upload/doc-type.js +3 -3
  437. package/dist/core/prototype/collection/upload/ensure.server.d.ts +4 -3
  438. package/dist/core/prototype/collection/upload/ensure.server.js +11 -9
  439. package/dist/core/prototype/collection/upload/handler.server.d.ts +34 -0
  440. package/dist/core/prototype/collection/upload/handler.server.js +143 -0
  441. package/dist/core/prototype/collection/upload/hooks/clean-up-files.server.d.ts +13 -8
  442. package/dist/core/prototype/collection/upload/hooks/clean-up-files.server.js +32 -11
  443. package/dist/core/prototype/collection/upload/hooks/convert-base64.server.js +2 -0
  444. package/dist/core/prototype/collection/upload/hooks/extract-path.server.d.ts +2 -3
  445. package/dist/core/prototype/collection/upload/hooks/extract-path.server.js +2 -3
  446. package/dist/core/prototype/collection/upload/hooks/handle-path-creation.server.d.ts +2 -3
  447. package/dist/core/prototype/collection/upload/hooks/handle-path-creation.server.js +12 -20
  448. package/dist/core/prototype/collection/upload/hooks/index.server.d.ts +2 -3
  449. package/dist/core/prototype/collection/upload/hooks/index.server.js +2 -3
  450. package/dist/core/prototype/collection/upload/hooks/populate-sizes.server.d.ts +7 -1
  451. package/dist/core/prototype/collection/upload/hooks/populate-sizes.server.js +16 -6
  452. package/dist/core/prototype/collection/upload/hooks/process-file-upload.server.d.ts +9 -15
  453. package/dist/core/prototype/collection/upload/hooks/process-file-upload.server.js +24 -36
  454. package/dist/core/prototype/collection/upload/hooks/update-directory-children.server.d.ts +8 -4
  455. package/dist/core/prototype/collection/upload/hooks/update-directory-children.server.js +22 -9
  456. package/dist/core/prototype/collection/upload/module.js +34 -34
  457. package/dist/core/prototype/collection/upload/module.server.d.ts +1 -2
  458. package/dist/core/prototype/collection/upload/module.server.js +1 -2
  459. package/dist/core/prototype/collection/upload/naming.d.ts +2 -5
  460. package/dist/core/prototype/collection/upload/naming.js +4 -8
  461. package/dist/core/prototype/collection/upload/types.d.ts +11 -4
  462. package/dist/core/prototype/collection/upload/util/converter.server.d.ts +5 -12
  463. package/dist/core/prototype/collection/upload/util/converter.server.js +14 -11
  464. package/dist/core/prototype/collection/upload/util/mime.js +0 -2
  465. package/dist/core/prototype/collection/upload/util/path.d.ts +1 -12
  466. package/dist/core/prototype/collection/upload/util/path.js +6 -20
  467. package/dist/core/prototype/collection/upload/validate-config.server.d.ts +11 -0
  468. package/dist/core/prototype/collection/upload/validate-config.server.js +30 -0
  469. package/dist/core/prototype/define.d.ts +16 -24
  470. package/dist/core/prototype/define.js +9 -8
  471. package/dist/core/prototype/naming.d.ts +13 -5
  472. package/dist/core/prototype/naming.js +14 -6
  473. package/dist/core/prototype/shared/api.server.d.ts +12 -0
  474. package/dist/core/prototype/shared/api.server.js +22 -0
  475. package/dist/core/prototype/shared/metas/fields.js +1 -0
  476. package/dist/core/prototype/shared/metas/hooks/delete-panel-lock-metas.server.js +1 -1
  477. package/dist/core/prototype/shared/metas/hooks/index.server.d.ts +2 -1
  478. package/dist/core/prototype/shared/metas/hooks/index.server.js +2 -1
  479. package/dist/core/prototype/shared/metas/hooks/stamp-authorship.server.js +11 -7
  480. package/dist/core/prototype/shared/metas/lock-answer.server.d.ts +16 -0
  481. package/dist/core/prototype/shared/metas/lock-answer.server.js +24 -0
  482. package/dist/core/prototype/shared/metas/lock.server.d.ts +1 -2
  483. package/dist/core/prototype/shared/metas/lock.server.js +9 -9
  484. package/dist/core/prototype/shared/metas/module.d.ts +2 -10
  485. package/dist/core/prototype/shared/metas/module.js +2 -10
  486. package/dist/core/prototype/shared/metas/module.server.d.ts +0 -3
  487. package/dist/core/prototype/shared/metas/module.server.js +1 -4
  488. package/dist/core/prototype/shared/operations/read-args.d.ts +14 -0
  489. package/dist/core/prototype/shared/operations/read-args.js +1 -0
  490. package/dist/core/prototype/shared/operations/row-query.d.ts +13 -0
  491. package/dist/core/prototype/shared/operations/row-query.js +16 -0
  492. package/dist/core/prototype/shared/operations/update-args.d.ts +16 -0
  493. package/dist/core/prototype/shared/operations/update-args.js +1 -0
  494. package/dist/core/prototype/shared/rest/params.server.d.ts +52 -0
  495. package/dist/core/prototype/shared/rest/params.server.js +87 -0
  496. package/dist/core/prototype/shared/title/augment.d.ts +2 -2
  497. package/dist/core/prototype/shared/title/augment.js +4 -4
  498. package/dist/core/prototype/shared/title/find-title.d.ts +3 -14
  499. package/dist/core/prototype/shared/title/find-title.js +5 -5
  500. package/dist/core/prototype/shared/title/hooks/index.server.d.ts +2 -4
  501. package/dist/core/prototype/shared/title/hooks/index.server.js +2 -4
  502. package/dist/core/prototype/shared/title/hooks/set-document-title.server.js +23 -18
  503. package/dist/core/prototype/shared/title/select.d.ts +2 -2
  504. package/dist/core/prototype/shared/title/select.js +7 -3
  505. package/dist/core/prototype/shared/url/addresses.server.d.ts +3 -5
  506. package/dist/core/prototype/shared/url/addresses.server.js +14 -8
  507. package/dist/core/prototype/shared/url/area.server.d.ts +19 -0
  508. package/dist/core/prototype/shared/url/area.server.js +33 -0
  509. package/dist/core/prototype/shared/url/enabled.d.ts +1 -2
  510. package/dist/core/prototype/shared/url/enabled.js +1 -2
  511. package/dist/core/prototype/shared/url/format.server.d.ts +1 -1
  512. package/dist/core/prototype/shared/url/format.server.js +3 -3
  513. package/dist/core/prototype/shared/url/hooks/index.server.d.ts +3 -5
  514. package/dist/core/prototype/shared/url/hooks/index.server.js +3 -5
  515. package/dist/core/prototype/shared/url/hooks/set-live-url.server.d.ts +5 -1
  516. package/dist/core/prototype/shared/url/hooks/set-live-url.server.js +12 -5
  517. package/dist/core/prototype/shared/url/hooks/sync-area-url.server.d.ts +5 -0
  518. package/dist/core/prototype/shared/url/hooks/sync-area-url.server.js +15 -0
  519. package/dist/core/prototype/shared/url/locales.server.d.ts +3 -0
  520. package/dist/core/prototype/shared/url/locales.server.js +5 -0
  521. package/dist/core/prototype/shared/versions/augment.d.ts +3 -3
  522. package/dist/core/prototype/shared/versions/augment.js +4 -7
  523. package/dist/core/prototype/shared/versions/auto-saves.server.js +2 -3
  524. package/dist/core/prototype/shared/versions/configure.server.js +17 -11
  525. package/dist/core/prototype/shared/versions/constant.d.ts +1 -7
  526. package/dist/core/prototype/shared/versions/constant.js +1 -7
  527. package/dist/core/prototype/shared/versions/doc-type.d.ts +1 -2
  528. package/dist/core/prototype/shared/versions/doc-type.js +1 -2
  529. package/dist/core/prototype/shared/versions/enabled.d.ts +1 -2
  530. package/dist/core/prototype/shared/versions/enabled.js +1 -2
  531. package/dist/core/prototype/shared/versions/hooks/demote-other-versions.d.ts +1 -1
  532. package/dist/core/prototype/shared/versions/hooks/demote-other-versions.js +1 -1
  533. package/dist/core/prototype/shared/versions/hooks/handle-new-version.server.d.ts +1 -1
  534. package/dist/core/prototype/shared/versions/hooks/handle-new-version.server.js +59 -31
  535. package/dist/core/prototype/shared/versions/hooks/index.server.d.ts +2 -4
  536. package/dist/core/prototype/shared/versions/hooks/index.server.js +2 -4
  537. package/dist/core/prototype/shared/versions/hooks/prevent-last-version-deletion.server.d.ts +4 -3
  538. package/dist/core/prototype/shared/versions/hooks/prevent-last-version-deletion.server.js +10 -4
  539. package/dist/core/prototype/shared/versions/module.server.js +2 -3
  540. package/dist/core/prototype/shared/versions/naming.d.ts +0 -4
  541. package/dist/core/prototype/shared/versions/naming.js +1 -5
  542. package/dist/core/prototype/shared/versions/retire-auto-saves.server.js +2 -3
  543. package/dist/core/prototype/shared/versions/strategy.d.ts +0 -2
  544. package/dist/core/prototype/shared/versions/strategy.js +1 -3
  545. package/dist/core/prototype/shared/versions/types.d.ts +3 -11
  546. package/dist/core/prototype/shared/versions/write-plan.d.ts +4 -6
  547. package/dist/core/prototype/shared/versions/write-plan.js +4 -6
  548. package/dist/core/prototype/types.d.ts +5 -9
  549. package/dist/core/prototype/when.js +3 -4
  550. package/dist/core/rime.server.d.ts +4 -13
  551. package/dist/core/rime.server.js +10 -46
  552. package/dist/core/routes/constants.d.ts +0 -4
  553. package/dist/core/routes/constants.js +4 -4
  554. package/dist/core/routes/context.server.d.ts +15 -3
  555. package/dist/core/routes/context.server.js +24 -6
  556. package/dist/core/routes/handler.server.d.ts +4 -5
  557. package/dist/core/routes/handler.server.js +14 -36
  558. package/dist/core/routes/panel-navigation.d.ts +5 -9
  559. package/dist/core/routes/panel-navigation.js +13 -21
  560. package/dist/core/routes/util.d.ts +3 -2
  561. package/dist/core/routes/util.js +6 -7
  562. package/dist/fields/blocks/component/AddBlockButton.svelte +1 -1
  563. package/dist/fields/blocks/component/Block.svelte +24 -17
  564. package/dist/fields/blocks/component/Block.svelte.d.ts +1 -1
  565. package/dist/fields/blocks/component/Blocks.svelte +11 -19
  566. package/dist/fields/blocks/component/Cell.svelte +4 -10
  567. package/dist/fields/blocks/component/Cell.svelte.d.ts +3 -4
  568. package/dist/fields/blocks/component/focus/BlocksFocus.svelte +12 -6
  569. package/dist/fields/blocks/component/focus/DefaultRender.svelte +1 -1
  570. package/dist/fields/blocks/component/focus/Inspector.svelte +3 -1
  571. package/dist/fields/blocks/component/focus/Layers.svelte +12 -26
  572. package/dist/fields/blocks/component/focus/Layers.svelte.d.ts +0 -2
  573. package/dist/fields/blocks/component/focus/LayersList.svelte +5 -1
  574. package/dist/fields/blocks/component/focus/Palette.svelte +5 -33
  575. package/dist/fields/blocks/component/focus/Palette.svelte.d.ts +0 -2
  576. package/dist/fields/blocks/component/focus/Renders.svelte +12 -4
  577. package/dist/fields/blocks/component/focus/StageAdd.svelte +1 -1
  578. package/dist/fields/blocks/component/focus/focus.svelte.d.ts +2 -13
  579. package/dist/fields/blocks/component/focus/focus.svelte.js +13 -23
  580. package/dist/fields/blocks/component/picker/BlockTile.svelte +2 -2
  581. package/dist/fields/blocks/component/picker/BlockTile.svelte.d.ts +1 -1
  582. package/dist/fields/blocks/index.d.ts +20 -28
  583. package/dist/fields/blocks/index.js +39 -41
  584. package/dist/fields/blocks/render.test-d.d.ts +1 -0
  585. package/dist/fields/blocks/render.test-d.js +6 -0
  586. package/dist/fields/checkbox/index.js +1 -1
  587. package/dist/fields/combobox/component/ComboBox.svelte +4 -2
  588. package/dist/fields/combobox/index.d.ts +1 -3
  589. package/dist/fields/combobox/index.js +1 -7
  590. package/dist/fields/component/index.d.ts +17 -0
  591. package/dist/fields/component/index.js +20 -1
  592. package/dist/fields/date/component/Cell.svelte +1 -1
  593. package/dist/fields/date/component/Date.svelte +3 -10
  594. package/dist/fields/date/index.d.ts +1 -3
  595. package/dist/fields/date/index.js +8 -7
  596. package/dist/fields/email/component/Email.svelte +1 -2
  597. package/dist/fields/email/component/props.d.ts +0 -1
  598. package/dist/fields/email/index.d.ts +2 -2
  599. package/dist/fields/email/index.js +4 -9
  600. package/dist/fields/group/component/Group.svelte +4 -6
  601. package/dist/fields/group/index.d.ts +3 -15
  602. package/dist/fields/group/index.js +4 -15
  603. package/dist/fields/link/component/Cell.svelte +1 -1
  604. package/dist/fields/link/component/Link.svelte +10 -6
  605. package/dist/fields/link/component/RessourceInput.svelte +5 -5
  606. package/dist/fields/link/component/RessourceInput.svelte.d.ts +1 -1
  607. package/dist/fields/link/index.d.ts +2 -54
  608. package/dist/fields/link/index.js +17 -20
  609. package/dist/fields/link/module.js +1 -0
  610. package/dist/fields/link/module.server.d.ts +12 -0
  611. package/dist/fields/link/module.server.js +44 -41
  612. package/dist/fields/link/types.d.ts +5 -0
  613. package/dist/fields/link/util.d.ts +12 -0
  614. package/dist/fields/link/util.js +16 -0
  615. package/dist/fields/number/component/Number.svelte +2 -2
  616. package/dist/fields/number/component/Number.svelte.d.ts +0 -1
  617. package/dist/fields/number/index.d.ts +1 -48
  618. package/dist/fields/number/index.js +13 -15
  619. package/dist/fields/radio/index.d.ts +1 -1
  620. package/dist/fields/radio/index.js +9 -8
  621. package/dist/fields/relation/component/Cell.svelte +3 -3
  622. package/dist/fields/relation/component/Relation.svelte +7 -10
  623. package/dist/fields/relation/component/RelationInline.svelte +30 -31
  624. package/dist/fields/relation/component/default/Default.svelte +2 -2
  625. package/dist/fields/relation/component/types.d.ts +0 -1
  626. package/dist/fields/relation/component/upload/Browse.svelte +38 -50
  627. package/dist/fields/relation/component/upload/Browse.svelte.d.ts +1 -1
  628. package/dist/fields/relation/component/upload/Upload.svelte +22 -39
  629. package/dist/fields/relation/component/upload/Upload.svelte.d.ts +1 -1
  630. package/dist/fields/relation/exists.server.d.ts +12 -0
  631. package/dist/fields/relation/exists.server.js +24 -0
  632. package/dist/fields/relation/fetch.d.ts +6 -4
  633. package/dist/fields/relation/fetch.js +13 -6
  634. package/dist/fields/relation/index.d.ts +6 -7
  635. package/dist/fields/relation/index.js +7 -11
  636. package/dist/fields/relation/populate.d.ts +4 -3
  637. package/dist/fields/relation/populate.js +8 -7
  638. package/dist/fields/relation/relation.d.ts +6 -2
  639. package/dist/fields/relation/relation.js +5 -3
  640. package/dist/fields/relation/value.d.ts +2 -1
  641. package/dist/fields/repeatable/DefaultLocaleButton.svelte +18 -0
  642. package/dist/fields/repeatable/DefaultLocaleButton.svelte.d.ts +7 -0
  643. package/dist/fields/repeatable/RepeatableActions.svelte +111 -0
  644. package/dist/fields/repeatable/RepeatableActions.svelte.d.ts +15 -0
  645. package/dist/fields/repeatable.d.ts +19 -0
  646. package/dist/fields/repeatable.js +56 -0
  647. package/dist/fields/rich-text/component/Cell.svelte +6 -3
  648. package/dist/fields/rich-text/component/RichText.svelte +1 -9
  649. package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +3 -1
  650. package/dist/fields/rich-text/component/bubble-menu/icon-button/icon-button.svelte +9 -11
  651. package/dist/fields/rich-text/component/bubble-menu/node-selector/node-selector.svelte +5 -9
  652. package/dist/fields/rich-text/component/context.svelte.d.ts +2 -10
  653. package/dist/fields/rich-text/component/context.svelte.js +1 -23
  654. package/dist/fields/rich-text/component/drag-handle/drag-handle.svelte +10 -9
  655. package/dist/fields/rich-text/component/drag-handle/drag-handle.svelte.d.ts +1 -4
  656. package/dist/fields/rich-text/component/styles/editor.css +5 -5
  657. package/dist/fields/rich-text/component/suggestion/suggestion.svelte +3 -11
  658. package/dist/fields/rich-text/core/build-editor-config.js +0 -1
  659. package/dist/fields/rich-text/core/content.d.ts +20 -0
  660. package/dist/fields/rich-text/core/content.js +29 -0
  661. package/dist/fields/rich-text/core/extensions/current-node/current-node.js +1 -3
  662. package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.d.ts +4 -16
  663. package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle-plugin.js +18 -98
  664. package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.d.ts +1 -49
  665. package/dist/fields/rich-text/core/extensions/drag-handle/drag-handle.js +0 -50
  666. package/dist/fields/rich-text/core/extensions/drag-handle/helpers/dragHandler.js +1 -8
  667. package/dist/fields/rich-text/core/extensions/drag-handle/helpers/findNextElementFromCursor.js +2 -2
  668. package/dist/fields/rich-text/core/extensions/drag-handle/index.d.ts +0 -2
  669. package/dist/fields/rich-text/core/extensions/drag-handle/index.js +0 -2
  670. package/dist/fields/rich-text/core/features/blockquote.js +1 -1
  671. package/dist/fields/rich-text/core/features/bold.js +1 -2
  672. package/dist/fields/rich-text/core/features/bullet-list.js +1 -1
  673. package/dist/fields/rich-text/core/features/fields/extension.d.ts +0 -8
  674. package/dist/fields/rich-text/core/features/fields/extension.js +2 -14
  675. package/dist/fields/rich-text/core/features/fields/fields.svelte +5 -5
  676. package/dist/fields/rich-text/core/features/fields/fields.svelte.d.ts +2 -2
  677. package/dist/fields/rich-text/core/features/fields/index.js +7 -2
  678. package/dist/fields/rich-text/core/features/heading.d.ts +1 -0
  679. package/dist/fields/rich-text/core/features/heading.js +16 -9
  680. package/dist/fields/rich-text/core/features/hr/hr.js +2 -1
  681. package/dist/fields/rich-text/core/features/index.d.ts +0 -15
  682. package/dist/fields/rich-text/core/features/index.js +0 -12
  683. package/dist/fields/rich-text/core/features/italic.js +1 -1
  684. package/dist/fields/rich-text/core/features/json-attribute.d.ts +11 -0
  685. package/dist/fields/rich-text/core/features/json-attribute.js +29 -0
  686. package/dist/fields/rich-text/core/features/link/component/link-selector.svelte +36 -58
  687. package/dist/fields/rich-text/core/features/link/index.js +2 -2
  688. package/dist/fields/rich-text/core/features/ordered-list.js +1 -1
  689. package/dist/fields/rich-text/core/features/paragraph.js +1 -1
  690. package/dist/fields/rich-text/core/features/pick-dialog.svelte +41 -0
  691. package/dist/fields/rich-text/core/features/pick-dialog.svelte.d.ts +33 -0
  692. package/dist/fields/rich-text/core/features/resource/index.js +1 -1
  693. package/dist/fields/rich-text/core/features/resource/resource.svelte +8 -23
  694. package/dist/fields/rich-text/core/features/upload/index.js +7 -2
  695. package/dist/fields/rich-text/core/features/upload/upload-extension.d.ts +0 -8
  696. package/dist/fields/rich-text/core/features/upload/upload-extension.js +13 -16
  697. package/dist/fields/rich-text/core/features/upload/upload.svelte +10 -28
  698. package/dist/fields/rich-text/core/render-rich-text.svelte +18 -5
  699. package/dist/fields/rich-text/core/rich-text-editor-core.svelte +38 -17
  700. package/dist/fields/rich-text/core/rich-text-editor-core.svelte.d.ts +1 -1
  701. package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.d.ts +0 -1
  702. package/dist/fields/rich-text/core/svelte/node-view-renderer.svelte.js +1 -1
  703. package/dist/fields/rich-text/core/svelte/node-view-wrapper.svelte +1 -0
  704. package/dist/fields/rich-text/core/svelte/renderer.d.ts +5 -0
  705. package/dist/fields/rich-text/core/svelte/renderer.js +14 -3
  706. package/dist/fields/rich-text/core/types.d.ts +14 -12
  707. package/dist/fields/rich-text/index.d.ts +22 -15
  708. package/dist/fields/rich-text/index.js +81 -52
  709. package/dist/fields/rich-text/json.d.ts +2 -1
  710. package/dist/fields/rich-text/json.js +55 -23
  711. package/dist/fields/rich-text/module.d.ts +9 -0
  712. package/dist/fields/rich-text/module.js +7 -0
  713. package/dist/fields/rich-text/module.server.d.ts +28 -0
  714. package/dist/fields/rich-text/module.server.js +90 -0
  715. package/dist/fields/rich-text/reference-nodes.d.ts +55 -0
  716. package/dist/fields/rich-text/reference-nodes.js +68 -0
  717. package/dist/fields/rich-text/sanitize.d.ts +9 -1
  718. package/dist/fields/rich-text/sanitize.js +25 -25
  719. package/dist/fields/select/component/Select.svelte +2 -1
  720. package/dist/fields/select/index.d.ts +1 -5
  721. package/dist/fields/select/index.js +1 -6
  722. package/dist/fields/slug/component/Slug.svelte +2 -2
  723. package/dist/fields/slug/index.d.ts +3 -53
  724. package/dist/fields/slug/index.js +2 -15
  725. package/dist/fields/slug/module.d.ts +4 -0
  726. package/dist/fields/slug/module.js +2 -0
  727. package/dist/fields/slug/module.server.d.ts +12 -0
  728. package/dist/fields/slug/module.server.js +19 -0
  729. package/dist/fields/tabs/component/Tabs.svelte +12 -18
  730. package/dist/fields/tabs/index.d.ts +6 -0
  731. package/dist/fields/tabs/index.js +22 -2
  732. package/dist/fields/text/component/Text.svelte +1 -8
  733. package/dist/fields/text/component/TextInline.svelte +2 -3
  734. package/dist/fields/text/index.d.ts +2 -51
  735. package/dist/fields/text/index.js +4 -20
  736. package/dist/fields/text/module.d.ts +4 -0
  737. package/dist/fields/text/module.js +2 -0
  738. package/dist/fields/text/module.server.d.ts +12 -0
  739. package/dist/fields/text/module.server.js +19 -0
  740. package/dist/fields/textarea/component/TextArea.svelte +5 -6
  741. package/dist/fields/textarea/component/props.d.ts +1 -2
  742. package/dist/fields/textarea/index.d.ts +2 -49
  743. package/dist/fields/textarea/index.js +2 -20
  744. package/dist/fields/time/component/Time.svelte +1 -1
  745. package/dist/fields/time/index.d.ts +1 -3
  746. package/dist/fields/time/index.js +1 -6
  747. package/dist/fields/toggle/index.d.ts +1 -46
  748. package/dist/fields/toggle/index.js +0 -13
  749. package/dist/fields/tree/component/AddItemButton.svelte +3 -3
  750. package/dist/fields/tree/component/AddItemButton.svelte.d.ts +2 -2
  751. package/dist/fields/tree/component/Cell.svelte +10 -12
  752. package/dist/fields/tree/component/Cell.svelte.d.ts +6 -4
  753. package/dist/fields/tree/component/Tree.svelte +15 -17
  754. package/dist/fields/tree/component/TreeBlock.svelte +22 -21
  755. package/dist/fields/tree/index.js +12 -28
  756. package/dist/fields/tree/util.d.ts +23 -0
  757. package/dist/fields/tree/util.js +19 -0
  758. package/dist/fields/types.d.ts +15 -0
  759. package/dist/live/Consumer.svelte +9 -13
  760. package/dist/live/LiveEdit.svelte +2 -2
  761. package/dist/live/LiveEdit.svelte.d.ts +1 -1
  762. package/dist/live/context.svelte.d.ts +12 -11
  763. package/dist/live/context.svelte.js +51 -49
  764. package/dist/panel/components/Root.svelte +5 -5
  765. package/dist/panel/components/fields/Error.svelte +2 -17
  766. package/dist/panel/components/fields/FieldsPreview.svelte +2 -2
  767. package/dist/panel/components/fields/FieldsPreview.svelte.d.ts +1 -1
  768. package/dist/panel/components/fields/Hint.svelte +1 -1
  769. package/dist/panel/components/fields/Hint.svelte.d.ts +1 -1
  770. package/dist/panel/components/fields/Label.svelte +6 -8
  771. package/dist/panel/components/fields/RenderFields.svelte +18 -17
  772. package/dist/panel/components/fields/RenderFields.svelte.d.ts +3 -3
  773. package/dist/panel/components/fields/index.d.ts +3 -3
  774. package/dist/panel/components/sections/auth/AuthForm.svelte +2 -10
  775. package/dist/panel/components/sections/collection/Empty.svelte +1 -1
  776. package/dist/panel/components/sections/collection/Empty.svelte.d.ts +1 -1
  777. package/dist/panel/components/sections/collection/bulk-upload/BulkUploadDialog.svelte +1 -1
  778. package/dist/panel/components/sections/collection/bulk-upload/DropZone.svelte +1 -1
  779. package/dist/panel/components/sections/collection/bulk-upload/PageDrop.svelte +2 -1
  780. package/dist/panel/components/sections/collection/folder/FolderEdit.svelte +2 -2
  781. package/dist/panel/components/sections/collection/folder/FolderEdit.svelte.d.ts +2 -2
  782. package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +13 -9
  783. package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +1 -1
  784. package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +3 -4
  785. package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +12 -8
  786. package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte.d.ts +2 -2
  787. package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +6 -12
  788. package/dist/panel/components/sections/collection/header/ButtonCreate.svelte.d.ts +1 -1
  789. package/dist/panel/components/sections/collection/header/DisplayMode.svelte +3 -1
  790. package/dist/panel/components/sections/collection/header/FilterMenu.svelte +1 -1
  791. package/dist/panel/components/sections/collection/header/SearchInput.svelte +1 -1
  792. package/dist/panel/components/sections/collection/header/SelectUI.svelte +3 -1
  793. package/dist/panel/components/sections/collection/list/header/Header.svelte +4 -6
  794. package/dist/panel/components/sections/collection/list/header/Header.svelte.d.ts +17 -2
  795. package/dist/panel/components/sections/collection/list/row/Row.svelte +3 -2
  796. package/dist/panel/components/sections/collection/tree/CollectionTree.svelte +6 -10
  797. package/dist/panel/components/sections/collection/tree/CollectionTree.svelte.d.ts +1 -1
  798. package/dist/panel/components/sections/collection/tree/CollectionTreeNode.svelte +10 -4
  799. package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +2 -2
  800. package/dist/panel/components/sections/commands/CommandButton.svelte +1 -1
  801. package/dist/panel/components/sections/commands/CommandPalette.svelte +8 -8
  802. package/dist/panel/components/sections/document/AuthAPIKeyDialog.svelte +15 -9
  803. package/dist/panel/components/sections/document/AuthFooter.svelte +15 -22
  804. package/dist/panel/components/sections/document/AutoSaveBanner.svelte +4 -6
  805. package/dist/panel/components/sections/document/ButtonSave.svelte +5 -19
  806. package/dist/panel/components/sections/document/ButtonStatus.svelte +12 -15
  807. package/dist/panel/components/sections/document/ChangeSlugDialog.svelte +2 -2
  808. package/dist/panel/components/sections/document/ChangeSlugDialog.svelte.d.ts +1 -1
  809. package/dist/panel/components/sections/document/Document.svelte +16 -28
  810. package/dist/panel/components/sections/document/Document.svelte.d.ts +1 -2
  811. package/dist/panel/components/sections/document/DocumentChildren.svelte +4 -3
  812. package/dist/panel/components/sections/document/DocumentChildren.svelte.d.ts +1 -1
  813. package/dist/panel/components/sections/document/DocumentUrl.svelte +5 -3
  814. package/dist/panel/components/sections/document/DocumentUrl.svelte.d.ts +1 -1
  815. package/dist/panel/components/sections/document/Header.svelte +11 -9
  816. package/dist/panel/components/sections/document/Header.svelte.d.ts +3 -3
  817. package/dist/panel/components/sections/document/Settings.svelte +40 -24
  818. package/dist/panel/components/sections/document/Versions.svelte +8 -5
  819. package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +13 -21
  820. package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte +6 -7
  821. package/dist/panel/components/sections/document/upload-header/drop-zone/DropZone.svelte.d.ts +2 -2
  822. package/dist/panel/components/sections/document/versions-list.d.ts +3 -2
  823. package/dist/panel/components/sections/document/versions-list.js +3 -2
  824. package/dist/panel/components/sections/live/LiveEditPanel.svelte +1 -1
  825. package/dist/panel/components/sections/live/LiveEditPanel.svelte.d.ts +1 -1
  826. package/dist/panel/components/sections/live/LiveFloatingUI.svelte +7 -2
  827. package/dist/panel/components/sections/live/LiveFloatingUI.svelte.d.ts +1 -1
  828. package/dist/panel/components/sections/page-layout/Page.svelte +2 -14
  829. package/dist/panel/components/sections/page-layout/Page.svelte.d.ts +0 -1
  830. package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +7 -4
  831. package/dist/panel/components/ui/button/button.svelte +8 -2
  832. package/dist/panel/components/ui/button/index.d.ts +1 -1
  833. package/dist/panel/components/ui/button/index.js +1 -1
  834. package/dist/panel/components/ui/calendar/calendar-months.svelte +0 -6
  835. package/dist/panel/components/ui/calendar/calendar-next-button.svelte +2 -2
  836. package/dist/panel/components/ui/calendar/calendar-prev-button.svelte +2 -2
  837. package/dist/panel/components/ui/calendar/calendar.css +0 -3
  838. package/dist/panel/components/ui/calendar/calendar.svelte.d.ts +1 -1
  839. package/dist/panel/components/ui/card-resource/card-resource.svelte +11 -7
  840. package/dist/panel/components/ui/checkbox/checkbox.svelte +1 -1
  841. package/dist/panel/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
  842. package/dist/panel/components/ui/checkbox/index.d.ts +1 -1
  843. package/dist/panel/components/ui/checkbox/index.js +1 -1
  844. package/dist/panel/components/ui/command/command-dialog.css +0 -38
  845. package/dist/panel/components/ui/command/command-empty.svelte +1 -1
  846. package/dist/panel/components/ui/command/command-group.css +0 -10
  847. package/dist/panel/components/ui/command/command-input-select.svelte +2 -2
  848. package/dist/panel/components/ui/command/command-input.svelte +2 -14
  849. package/dist/panel/components/ui/command/index.d.ts +1 -4
  850. package/dist/panel/components/ui/command/index.js +1 -16
  851. package/dist/panel/components/ui/context-menu/ContextMenu.svelte +4 -17
  852. package/dist/panel/components/ui/context-menu/ContextMenu.svelte.d.ts +2 -3
  853. package/dist/panel/components/ui/context-menu/context-menu.css +1 -1
  854. package/dist/panel/components/ui/dialog/dialog-content.css +0 -9
  855. package/dist/panel/components/ui/dialog/dialog-content.svelte +3 -3
  856. package/dist/panel/components/ui/dialog/dialog-content.svelte.d.ts +1 -1
  857. package/dist/panel/components/ui/dialog/index.d.ts +1 -3
  858. package/dist/panel/components/ui/dialog/index.js +1 -5
  859. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-content.css +1 -1
  860. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -3
  861. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +1 -4
  862. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
  863. package/dist/panel/components/ui/dropdown-menu/index.js +1 -7
  864. package/dist/panel/components/ui/input/index.d.ts +1 -20
  865. package/dist/panel/components/ui/input/index.js +1 -1
  866. package/dist/panel/components/ui/input/input.svelte +0 -1
  867. package/dist/panel/components/ui/kbd/Kbd.svelte +9 -11
  868. package/dist/panel/components/ui/label/index.d.ts +1 -1
  869. package/dist/panel/components/ui/label/index.js +1 -1
  870. package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte +9 -16
  871. package/dist/panel/components/ui/language-switcher/LanguageSwitcher.svelte.d.ts +1 -0
  872. package/dist/panel/components/ui/nav/Nav.svelte +3 -2
  873. package/dist/panel/components/ui/nav/Nav.svelte.d.ts +1 -1
  874. package/dist/panel/components/ui/nav/NavGroup.svelte +8 -2
  875. package/dist/panel/components/ui/nav/NavGroup.svelte.d.ts +1 -1
  876. package/dist/panel/components/ui/nav/NavItem.svelte +3 -3
  877. package/dist/panel/components/ui/nav/NavItem.svelte.d.ts +1 -1
  878. package/dist/panel/components/ui/nav/UserButton.svelte +5 -2
  879. package/dist/panel/components/ui/page-header/PageHeader.svelte +36 -72
  880. package/dist/panel/components/ui/page-header/PageHeader.svelte.d.ts +0 -4
  881. package/dist/panel/components/ui/popover/index.d.ts +1 -2
  882. package/dist/panel/components/ui/popover/index.js +1 -4
  883. package/dist/panel/components/ui/radio-group/index.d.ts +1 -1
  884. package/dist/panel/components/ui/radio-group/index.js +1 -3
  885. package/dist/panel/components/ui/radio-row-group/index.d.ts +1 -1
  886. package/dist/panel/components/ui/radio-row-group/index.js +1 -3
  887. package/dist/panel/components/ui/scroll-area/scroll-area-scrollbar.svelte +0 -2
  888. package/dist/panel/components/ui/scroll-area/scroll-area.svelte +3 -15
  889. package/dist/panel/components/ui/scroll-area/scroll-area.svelte.d.ts +2 -7
  890. package/dist/panel/components/ui/sheet/index.d.ts +1 -58
  891. package/dist/panel/components/ui/sheet/index.js +2 -59
  892. package/dist/panel/components/ui/sheet/sheet-content.svelte +1 -1
  893. package/dist/panel/components/ui/sheet/sheet-overlay.svelte +0 -2
  894. package/dist/panel/components/ui/sheet/sheet-overlay.svelte.d.ts +1 -3
  895. package/dist/panel/components/ui/sheet/sheet.css +0 -56
  896. package/dist/panel/components/ui/sonner/sonner.css +1 -0
  897. package/dist/panel/components/ui/spin-loader/SpinLoader.svelte +1 -1
  898. package/dist/panel/components/ui/switch/index.d.ts +1 -1
  899. package/dist/panel/components/ui/switch/index.js +1 -1
  900. package/dist/panel/components/ui/switch/switch.svelte.d.ts +1 -1
  901. package/dist/panel/components/ui/tabs/index.d.ts +1 -1
  902. package/dist/panel/components/ui/tabs/index.js +1 -5
  903. package/dist/panel/components/ui/tag/tag.svelte +5 -9
  904. package/dist/panel/components/ui/tooltip/index.js +1 -3
  905. package/dist/panel/components/ui/tooltip/tooltip-content.svelte +1 -0
  906. package/dist/panel/context/api-proxy.svelte.d.ts +1 -5
  907. package/dist/panel/context/api-proxy.svelte.js +13 -21
  908. package/dist/panel/context/blocks-ops.d.ts +53 -10
  909. package/dist/panel/context/blocks-ops.js +133 -21
  910. package/dist/panel/context/bulk-delete.d.ts +15 -0
  911. package/dist/panel/context/bulk-delete.js +14 -0
  912. package/dist/panel/context/collection.svelte.d.ts +9 -20
  913. package/dist/panel/context/collection.svelte.js +50 -101
  914. package/dist/panel/context/config.svelte.d.ts +1 -3
  915. package/dist/panel/context/config.svelte.js +0 -2
  916. package/dist/panel/context/documentForm.svelte.d.ts +4 -90
  917. package/dist/panel/context/documentForm.svelte.js +120 -156
  918. package/dist/panel/context/errors.svelte.d.ts +1 -14
  919. package/dist/panel/context/errors.svelte.js +2 -15
  920. package/dist/panel/context/form.svelte.d.ts +3 -56
  921. package/dist/panel/context/form.svelte.js +3 -23
  922. package/dist/panel/context/livePanel.svelte.d.ts +0 -1
  923. package/dist/panel/context/locale.svelte.js +6 -19
  924. package/dist/panel/context/nav.svelte.d.ts +0 -2
  925. package/dist/panel/context/nav.svelte.js +1 -1
  926. package/dist/panel/index.d.ts +0 -5
  927. package/dist/panel/pages/area/Area.svelte +2 -19
  928. package/dist/panel/pages/area/actions.server.js +12 -46
  929. package/dist/panel/pages/area/load.server.js +8 -12
  930. package/dist/panel/pages/aria.server.d.ts +7 -0
  931. package/dist/panel/pages/aria.server.js +6 -0
  932. package/dist/panel/pages/auth/fields.d.ts +7 -4
  933. package/dist/panel/pages/auth/fields.js +12 -5
  934. package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +4 -11
  935. package/dist/panel/pages/auth/forgot-password/load.server.d.ts +0 -1
  936. package/dist/panel/pages/auth/forgot-password/load.server.js +0 -1
  937. package/dist/panel/pages/auth/reset-password/ResetPassword.svelte +13 -14
  938. package/dist/panel/pages/auth/reset-password/load.server.d.ts +0 -1
  939. package/dist/panel/pages/auth/reset-password/load.server.js +1 -2
  940. package/dist/panel/pages/auth/sign-in/SignIn.svelte +23 -27
  941. package/dist/panel/pages/auth/sign-in/actions.server.js +4 -6
  942. package/dist/panel/pages/collection/Collection.svelte.d.ts +2 -3
  943. package/dist/panel/pages/collection/CollectionPage.svelte +94 -103
  944. package/dist/panel/pages/collection/CollectionPage.svelte.d.ts +3 -3
  945. package/dist/panel/pages/collection/load.server.d.ts +0 -3
  946. package/dist/panel/pages/collection/load.server.js +9 -23
  947. package/dist/panel/pages/collection-document/CollectionDocument.svelte +2 -24
  948. package/dist/panel/pages/collection-document/actions.server.js +23 -65
  949. package/dist/panel/pages/collection-document/load.server.d.ts +0 -3
  950. package/dist/panel/pages/collection-document/load.server.js +13 -28
  951. package/dist/panel/pages/dashboard/Dashboard.svelte +3 -3
  952. package/dist/panel/pages/dashboard/DashboardCollection.svelte +7 -11
  953. package/dist/panel/pages/dashboard/DashboardRow.svelte +13 -0
  954. package/dist/panel/pages/dashboard/load.server.js +2 -2
  955. package/dist/panel/pages/dashboard/types.d.ts +0 -2
  956. package/dist/panel/pages/live/Live.svelte +34 -65
  957. package/dist/panel/pages/live/Live.svelte.d.ts +2 -2
  958. package/dist/panel/pages/live/load.server.js +3 -4
  959. package/dist/panel/pages/shared/DocumentPage.svelte +26 -0
  960. package/dist/panel/pages/shared/DocumentPage.svelte.d.ts +9 -0
  961. package/dist/panel/pages/shared/save.server.d.ts +33 -0
  962. package/dist/panel/pages/shared/save.server.js +41 -0
  963. package/dist/panel/style/font.css +2 -2
  964. package/dist/panel/style/index.css +2 -2
  965. package/dist/panel/types.d.ts +0 -2
  966. package/dist/panel/util/Sortable.js +1 -2
  967. package/dist/panel/util/auth.js +2 -4
  968. package/dist/panel/util/dataError.js +0 -1
  969. package/dist/panel/util/dataFocused.js +0 -1
  970. package/dist/panel/util/error-text.d.ts +1 -0
  971. package/dist/panel/util/error-text.js +1 -0
  972. package/dist/panel/util/live.server.d.ts +3 -2
  973. package/dist/panel/util/live.server.js +3 -2
  974. package/dist/panel/util/locale-cookie.d.ts +10 -0
  975. package/dist/panel/util/locale-cookie.js +20 -0
  976. package/dist/panel/util/title.d.ts +12 -0
  977. package/dist/panel/util/title.js +18 -0
  978. package/dist/panel/util/upload-file.d.ts +0 -9
  979. package/dist/panel/util/upload-file.js +3 -2
  980. package/dist/panel/util/upload.js +4 -1
  981. package/dist/panel/util/uploader.svelte.d.ts +19 -0
  982. package/dist/panel/util/uploader.svelte.js +40 -0
  983. package/dist/panel/util/url.d.ts +38 -0
  984. package/dist/panel/util/url.js +44 -1
  985. package/dist/server.d.ts +2 -1
  986. package/dist/server.js +2 -1
  987. package/dist/types.d.ts +1 -0
  988. package/dist/util/file.d.ts +18 -7
  989. package/dist/util/file.js +32 -20
  990. package/dist/util/form-data.d.ts +21 -0
  991. package/dist/util/form-data.js +38 -0
  992. package/dist/util/function.d.ts +1 -1
  993. package/dist/util/function.js +1 -1
  994. package/dist/util/index.d.ts +5 -5
  995. package/dist/util/index.js +5 -5
  996. package/dist/util/object.d.ts +1 -1
  997. package/dist/util/object.js +11 -15
  998. package/dist/util/random.d.ts +6 -3
  999. package/dist/util/random.js +9 -4
  1000. package/dist/util/state.d.ts +4 -5
  1001. package/dist/util/state.js +17 -42
  1002. package/dist/util/string.d.ts +54 -18
  1003. package/dist/util/string.js +75 -40
  1004. package/dist/util/types.d.ts +1 -13
  1005. package/dist/util/types.js +2 -36
  1006. package/dist/util/url.d.ts +12 -0
  1007. package/dist/util/url.js +13 -0
  1008. package/package.json +36 -18
  1009. package/dist/core/pipeline/hook-name.server.d.ts +0 -11
  1010. package/dist/core/pipeline/hook-name.server.js +0 -14
  1011. package/dist/core/pipeline/persist/blocks/diff.server.d.ts +0 -15
  1012. package/dist/core/pipeline/persist/blocks/diff.server.js +0 -69
  1013. package/dist/core/pipeline/persist/tree/diff.server.d.ts +0 -20
  1014. package/dist/core/pipeline/persist/tree/diff.server.js +0 -51
  1015. package/dist/core/prototype/index.d.ts +0 -14
  1016. package/dist/core/prototype/index.js +0 -14
  1017. package/dist/core/prototype/shared/url/hooks/set-area-url.server.d.ts +0 -2
  1018. package/dist/core/prototype/shared/url/hooks/set-area-url.server.js +0 -8
  1019. package/dist/core/routes/constants.server.d.ts +0 -5
  1020. package/dist/core/routes/constants.server.js +0 -9
  1021. package/dist/fields/blocks/component/BlockActions.svelte +0 -98
  1022. package/dist/fields/blocks/component/BlockActions.svelte.d.ts +0 -10
  1023. package/dist/fields/blocks/component/ToggleBlockButton.svelte +0 -20
  1024. package/dist/fields/blocks/component/ToggleBlockButton.svelte.d.ts +0 -7
  1025. package/dist/fields/number/component/number.css +0 -92
  1026. package/dist/fields/relation/module.d.ts +0 -5
  1027. package/dist/fields/relation/module.js +0 -4
  1028. package/dist/fields/relation/module.server.d.ts +0 -5
  1029. package/dist/fields/relation/module.server.js +0 -44
  1030. package/dist/fields/tree/component/ToggleBlockButton.svelte +0 -20
  1031. package/dist/fields/tree/component/ToggleBlockButton.svelte.d.ts +0 -7
  1032. package/dist/fields/tree/component/TreeBlockActions.svelte +0 -87
  1033. package/dist/fields/tree/component/TreeBlockActions.svelte.d.ts +0 -10
  1034. package/dist/fields/tree/index.d.ts +0 -119
  1035. package/dist/panel/components/sections/collection/folder/Folder.svelte +0 -73
  1036. package/dist/panel/components/sections/collection/folder/Folder.svelte.d.ts +0 -7
  1037. package/dist/panel/components/sections/unauthorized/Unauthorized.svelte +0 -30
  1038. package/dist/panel/components/sections/unauthorized/Unauthorized.svelte.d.ts +0 -26
  1039. package/dist/panel/components/ui/card/card-content.svelte +0 -26
  1040. package/dist/panel/components/ui/card/card-content.svelte.d.ts +0 -6
  1041. package/dist/panel/components/ui/card/card-description.svelte +0 -23
  1042. package/dist/panel/components/ui/card/card-description.svelte.d.ts +0 -6
  1043. package/dist/panel/components/ui/card/card-footer.svelte +0 -26
  1044. package/dist/panel/components/ui/card/card-footer.svelte.d.ts +0 -6
  1045. package/dist/panel/components/ui/card/card-header.svelte +0 -24
  1046. package/dist/panel/components/ui/card/card-header.svelte.d.ts +0 -6
  1047. package/dist/panel/components/ui/card/card-title.svelte +0 -33
  1048. package/dist/panel/components/ui/card/card-title.svelte.d.ts +0 -10
  1049. package/dist/panel/components/ui/card/card.svelte +0 -46
  1050. package/dist/panel/components/ui/card/card.svelte.d.ts +0 -6
  1051. package/dist/panel/components/ui/card/index.d.ts +0 -8
  1052. package/dist/panel/components/ui/card/index.js +0 -9
  1053. package/dist/panel/components/ui/card-document/card-document.svelte +0 -111
  1054. package/dist/panel/components/ui/card-document/card-document.svelte.d.ts +0 -7
  1055. package/dist/panel/components/ui/command/command-separator.css +0 -6
  1056. package/dist/panel/components/ui/command/command-separator.svelte +0 -12
  1057. package/dist/panel/components/ui/command/command-separator.svelte.d.ts +0 -5
  1058. package/dist/panel/components/ui/dialog/dialog-description.css +0 -4
  1059. package/dist/panel/components/ui/dialog/dialog-description.svelte +0 -12
  1060. package/dist/panel/components/ui/dialog/dialog-description.svelte.d.ts +0 -5
  1061. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -81
  1062. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +0 -8
  1063. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.css +0 -10
  1064. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -18
  1065. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +0 -8
  1066. package/dist/panel/components/ui/kbd/index.d.ts +0 -1
  1067. package/dist/panel/components/ui/kbd/index.js +0 -1
  1068. package/dist/panel/components/ui/scroll-area/index.d.ts +0 -3
  1069. package/dist/panel/components/ui/scroll-area/index.js +0 -5
  1070. package/dist/panel/components/ui/separator/index.d.ts +0 -2
  1071. package/dist/panel/components/ui/separator/index.js +0 -4
  1072. package/dist/panel/components/ui/separator/separator.svelte +0 -34
  1073. package/dist/panel/components/ui/separator/separator.svelte.d.ts +0 -4
  1074. package/dist/panel/components/ui/sheet/sheet-description.svelte +0 -11
  1075. package/dist/panel/components/ui/sheet/sheet-description.svelte.d.ts +0 -4
  1076. package/dist/panel/components/ui/sheet/sheet-footer.svelte +0 -17
  1077. package/dist/panel/components/ui/sheet/sheet-footer.svelte.d.ts +0 -6
  1078. package/dist/panel/components/ui/sheet/sheet-header.svelte +0 -17
  1079. package/dist/panel/components/ui/sheet/sheet-header.svelte.d.ts +0 -6
  1080. package/dist/panel/components/ui/sheet/sheet-title.svelte +0 -11
  1081. package/dist/panel/components/ui/sheet/sheet-title.svelte.d.ts +0 -4
  1082. package/dist/panel/util/dataVisible.d.ts +0 -3
  1083. package/dist/panel/util/dataVisible.js +0 -15
  1084. package/dist/panel/util/disabled.d.ts +0 -3
  1085. package/dist/panel/util/disabled.js +0 -15
  1086. package/dist/util/coerce.d.ts +0 -12
  1087. package/dist/util/coerce.js +0 -38
@@ -1,20 +1,12 @@
1
- import { STAFF_SLUG } from './tables.js';
1
+ import { STAFF_SLUG } from './constant.js';
2
2
  /**
3
- * The three reads auth needs about its own rows.
4
- *
5
- * They were `adapter.auth.isSuperAdmin`, `.getBetterAuthUserId` and `.getUserAttributes` — a third
6
- * of a facade on the `Adapter` interface, for one feature. Each is
7
- * `select … from <a prototype's table> where <a column> = ?`, which is what `findMany` already is;
8
- * what made them look like adapter work was that all three named a collection called `staff` and
9
- * the database layer was the only place that name appeared.
10
- *
11
- * It appears here instead, once, as `STAFF_SLUG` — and it belongs here because this feature is
12
- * what derives that collection (`staff/configure.ts`).
3
+ * The reads auth needs about its own rows.
13
4
  *
14
5
  * > **These read rows, not documents.** `adapter.collection(slug).findMany` runs no hooks and no
15
- * > access checks, which is deliberate and load-bearing: all three run *during* authentication,
16
- * > before there is a user to check anything against. Going through `rime.collection(slug).find()`
17
- * > would recurse — the access check needs the user this call is resolving.
6
+ * > access checks. Most of them run *during* authentication, before there is a user to check
7
+ * > anything against: going through `rime.collection(slug).find()` would recurse, since the access
8
+ * > check needs the user this call is resolving. The others read the private fields a document
9
+ * > never carries.
18
10
  */
19
11
  /**
20
12
  * Whether this staff member is the super-admin.
@@ -41,12 +33,23 @@ export const betterAuthUserId = async (adapter, args) => {
41
33
  });
42
34
  return row?.authUserId ?? null;
43
35
  };
36
+ /** The better-auth api key a collection row holds and the user that created it, or `null`. */
37
+ export const betterAuthApiKey = async (adapter, args) => {
38
+ const [row] = await adapter.collection(args.slug).findMany({
39
+ query: { where: { id: { equals: args.id } } },
40
+ select: ['apiKeyId', 'authUserId'],
41
+ limit: 1
42
+ });
43
+ if (!row?.apiKeyId) {
44
+ return null;
45
+ }
46
+ return { keyId: row.apiKeyId, userId: row.authUserId };
47
+ };
44
48
  /**
45
49
  * The session user, read off the collection row a better-auth user is linked to.
46
50
  *
47
- * The members are named rather than spread, which is what the hand-written `db.select()` did too:
48
- * this object becomes `event.locals.user` and reaches the client through `toPublicUser`, so what
49
- * it carries is a decision, not whatever the read happened to return.
51
+ * The members are named rather than spread: this object becomes `event.locals.user` and reaches
52
+ * the client through `toPublicUser`.
50
53
  */
51
54
  export const userAttributes = async (adapter, args) => {
52
55
  const isStaff = args.slug === STAFF_SLUG;
@@ -71,3 +74,26 @@ export const userAttributes = async (adapter, args) => {
71
74
  isStaff
72
75
  };
73
76
  };
77
+ /**
78
+ * The user of a request made with an api key: the document that holds the key, found by the key's
79
+ * id in its `apiKeyId`, with the roles the key carries. It is not staff, so the panel stays closed
80
+ * to it, and it has no email. `slugs` are the api-key collections, asked in turn.
81
+ *
82
+ * ```ts
83
+ * apiKeyUser(adapter, { slugs: ['apps'], apiKeyId: 'k1', roles: ['sync'] })
84
+ * // { id: 'app1', name: 'Sync job', email: '', roles: ['sync'], isStaff: false }
85
+ * ```
86
+ */
87
+ export const apiKeyUser = async (adapter, args) => {
88
+ for (const slug of args.slugs) {
89
+ const [row] = await adapter.collection(slug).findMany({
90
+ query: { where: { apiKeyId: { equals: args.apiKeyId } } },
91
+ select: ['id', 'name'],
92
+ limit: 1
93
+ });
94
+ if (row) {
95
+ return { id: row.id, name: row.name, email: '', roles: args.roles, isStaff: false };
96
+ }
97
+ }
98
+ return undefined;
99
+ };
@@ -1,7 +1,8 @@
1
1
  import type { Config } from './config/types.js';
2
2
  import type { BuildConfig } from './config/index.server.js';
3
3
  /**
4
- * Phase 2 of three — everything that happens once, when the process starts.
4
+ * Phases 1 and 2 of three: codegen (dev only, step 4), then everything that happens once, when the
5
+ * process starts.
5
6
  *
6
7
  * A numbered sequence rather than a list of uniform steps, because each one feeds the next: the
7
8
  * config context feeds the adapter, the adapter feeds better-auth. Two of those dependencies —
@@ -31,7 +32,6 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
31
32
  getBySlug: (slug: string) => import("./config/types.js").BuiltArea | import("./config/types.js").BuiltCollection;
32
33
  isCollection: (slug?: string) => slug is import("./prototype/types.js").CollectionSlug;
33
34
  isArea: (slug?: string) => slug is import("./prototype/types.js").AreaSlug;
34
- getDocumentPrototype(slug: import("./prototype/types.js").PrototypeSlug): "area" | "collection";
35
35
  };
36
36
  adapter: import("./adapter.js").Adapter;
37
37
  auth: import("better-auth").Auth<{
@@ -1286,7 +1286,7 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
1286
1286
  $Infer: {
1287
1287
  body: {
1288
1288
  userId: string;
1289
- role: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[];
1289
+ role: "staff" | "admin" | "user" | ("staff" | "admin" | "user")[];
1290
1290
  };
1291
1291
  };
1292
1292
  };
@@ -1375,7 +1375,7 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
1375
1375
  email: string;
1376
1376
  password?: string | undefined;
1377
1377
  name: string;
1378
- role?: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[] | undefined;
1378
+ role?: "staff" | "admin" | "user" | ("staff" | "admin" | "user")[] | undefined;
1379
1379
  data?: Record<string, any> | undefined;
1380
1380
  };
1381
1381
  };
@@ -1999,7 +1999,7 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
1999
1999
  };
2000
2000
  } & {
2001
2001
  userId?: string | undefined;
2002
- role?: "user" | "staff" | "admin" | undefined;
2002
+ role?: "staff" | "admin" | "user" | undefined;
2003
2003
  };
2004
2004
  };
2005
2005
  };
@@ -2099,7 +2099,8 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
2099
2099
  readonly session: readonly ["list", "revoke", "delete"];
2100
2100
  }>;
2101
2101
  staff: import("better-auth/plugins").Role<import("better-auth/plugins").ExactRoleStatements<{
2102
- readonly user: ["create", "list", "delete"];
2102
+ readonly user: [];
2103
+ readonly session: [];
2103
2104
  }>, {
2104
2105
  readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
2105
2106
  readonly session: readonly ["list", "revoke", "delete"];
@@ -3357,7 +3358,7 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
3357
3358
  $Infer: {
3358
3359
  body: {
3359
3360
  userId: string;
3360
- role: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[];
3361
+ role: "staff" | "admin" | "user" | ("staff" | "admin" | "user")[];
3361
3362
  };
3362
3363
  };
3363
3364
  };
@@ -3446,7 +3447,7 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
3446
3447
  email: string;
3447
3448
  password?: string | undefined;
3448
3449
  name: string;
3449
- role?: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[] | undefined;
3450
+ role?: "staff" | "admin" | "user" | ("staff" | "admin" | "user")[] | undefined;
3450
3451
  data?: Record<string, any> | undefined;
3451
3452
  };
3452
3453
  };
@@ -4070,7 +4071,7 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
4070
4071
  };
4071
4072
  } & {
4072
4073
  userId?: string | undefined;
4073
- role?: "user" | "staff" | "admin" | undefined;
4074
+ role?: "staff" | "admin" | "user" | undefined;
4074
4075
  };
4075
4076
  };
4076
4077
  };
@@ -4170,7 +4171,8 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
4170
4171
  readonly session: readonly ["list", "revoke", "delete"];
4171
4172
  }>;
4172
4173
  staff: import("better-auth/plugins").Role<import("better-auth/plugins").ExactRoleStatements<{
4173
- readonly user: ["create", "list", "delete"];
4174
+ readonly user: [];
4175
+ readonly session: [];
4174
4176
  }>, {
4175
4177
  readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "impersonate-admins", "delete", "set-password", "set-email", "get", "update"];
4176
4178
  readonly session: readonly ["list", "revoke", "delete"];
@@ -4181,7 +4183,9 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
4181
4183
  plugins: any;
4182
4184
  } ? C["$auth"]["plugins"] : []];
4183
4185
  database: unknown;
4184
- baseURL: any;
4186
+ baseURL: string;
4187
+ secret: string;
4188
+ disabledPaths: string[];
4185
4189
  rateLimit: {
4186
4190
  readonly enabled: boolean;
4187
4191
  readonly window: 10;
@@ -4199,12 +4203,6 @@ export declare const bootRime: <const C extends Config>(config: BuildConfig<C>)
4199
4203
  };
4200
4204
  user: {
4201
4205
  readonly modelName: "authUsers";
4202
- readonly changeEmail: {
4203
- readonly enabled: true;
4204
- };
4205
- readonly deleteUser: {
4206
- readonly enabled: true;
4207
- };
4208
4206
  readonly additionalFields: {
4209
4207
  readonly type: {
4210
4208
  readonly type: "string";
@@ -1,4 +1,6 @@
1
- import { dev } from '$app/environment';
1
+ import { dev } from '$app/env';
2
+ import { RIME_LOG_LEVEL, RIME_LOG_TO_FILE, RIME_LOG_TO_FILE_MAX_DAYS } from '$app/env/private';
3
+ import { logger } from './logger.server.js';
2
4
  import { createAuthInstance } from './auth/better-auth/instance.server.js';
3
5
  import { bootUpload } from './prototype/collection/upload/boot/index.server.js';
4
6
  import { createConfigContext } from './config/context.server.js';
@@ -6,7 +8,8 @@ import i18n from './i18n/index.js';
6
8
  import { registerTranslation } from './i18n/register.server.js';
7
9
  import { area } from './prototype/area/definition.server.js';
8
10
  /**
9
- * Phase 2 of three — everything that happens once, when the process starts.
11
+ * Phases 1 and 2 of three: codegen (dev only, step 4), then everything that happens once, when the
12
+ * process starts.
10
13
  *
11
14
  * A numbered sequence rather than a list of uniform steps, because each one feeds the next: the
12
15
  * config context feeds the adapter, the adapter feeds better-auth. Two of those dependencies —
@@ -14,8 +17,14 @@ import { area } from './prototype/area/definition.server.js';
14
17
  * else, which is why the order is written out.
15
18
  */
16
19
  export const bootRime = async (config) => {
17
- // 1. Plugins, flattened to a name -> actions map. First because codegen and better-auth both
18
- // read it (the mailer plugin supplies better-auth's transport).
20
+ // 0. The logger's level and file.
21
+ logger.configure({
22
+ level: RIME_LOG_LEVEL,
23
+ toFile: RIME_LOG_TO_FILE,
24
+ maxDays: RIME_LOG_TO_FILE_MAX_DAYS
25
+ });
26
+ // 1. Plugins, flattened to a name -> actions map. Better-auth reads it: the mailer plugin
27
+ // supplies its transport.
19
28
  const plugins = Object.fromEntries(config.plugins.map((plugin) => [plugin.name, plugin.actions ?? {}])
20
29
  // Named as `BuildConfig<C>['$InferPluginsServer']`, the same way `Rime` declares it, so the
21
30
  // two agree. `typeof config.$InferPluginsServer` looks equivalent and is not: indexing the
@@ -23,11 +32,16 @@ export const bootRime = async (config) => {
23
32
  );
24
33
  // 2. The config interface — every lookup by slug, the locale list, the raw config.
25
34
  const configCtx = createConfigContext(config);
26
- // 3. Upload makes sure the static directory it writes into exists.
35
+ // 3. Upload makes sure the folder of each upload collection exists.
27
36
  bootUpload(config);
28
- // 4. Phase 1, in dev only: write routes, schema and types. Before the adapter, which imports
29
- // the schema this produces.
37
+ // 4. Phase 1, in dev only: the adapter's files, then routes, schema and types. Before the
38
+ // adapter, which imports the schema this produces.
30
39
  if (dev) {
40
+ // `rime clear` imports the adapter's hooks from this record, with no config loaded
41
+ const devCache = await import('./dev/cache.server.js').then((m) => m.default);
42
+ devCache.set('adapter-hooks', config.$adapter.hooks.module);
43
+ // Its folder in place, before codegen runs drizzle-kit on it
44
+ await config.$adapter.hooks.boot();
31
45
  const runCodegen = await import('./codegen.server.js').then((m) => m.runCodegen);
32
46
  await runCodegen({ config, generateSchema: config.$adapter.generateSchema });
33
47
  }
@@ -37,8 +51,8 @@ export const bootRime = async (config) => {
37
51
  // collection handle or an area handle; `adapter.collection(slug)` and `adapter.area(slug)`
38
52
  // serve them from then on.
39
53
  //
40
- // The first step here that touches the database, deliberately: a prototype whose tables are
41
- // missing fails at boot, naming itself, instead of on whichever request first reaches it.
54
+ // A prototype whose table is missing from the generated schema fails here, at boot, naming
55
+ // itself, instead of on the first request that reaches it.
42
56
  for (const prototypeConfig of [...config.collections, ...config.areas]) {
43
57
  adapter.registerPrototype(prototypeConfig);
44
58
  }
@@ -3,13 +3,11 @@ import type { BuildConfig } from './config/index.server.js';
3
3
  /**
4
4
  * Phase 1 of three — everything rime writes to disk, in the order it writes it.
5
5
  *
6
- * This is to a build what pipeline.server.ts is to a request: the one place the sequence is
7
- * written down. Unlike the hook pipeline it cannot be a flat array, because each step's output
8
- * is the next step's input on disk — drizzle.config.ts must be current before generateSchema
9
- * shells out to drizzle-kit, which reads it straight off the filesystem.
6
+ * The one place the build sequence is written down. Unlike the hook pipeline in `core/pipeline/`
7
+ * it cannot be a flat array, because each step's output is the next step's input on disk: the
8
+ * schema is written before the types that declare its module.
10
9
  *
11
- * Runs *inside* boot, and only under `dev`. That is deliberate, not a leftover: in development
12
- * codegen is on the fly — editing a collection invalidates the config module, the app reboots,
10
+ * Runs *inside* boot, and only under `dev`: in development codegen is on the fly — editing a collection invalidates the config module, the app reboots,
13
11
  * and this runs again as part of that reload. There is no separate codegen program, and
14
12
  * `rime generate` is simply a boot in a throwaway Vite server (dev/cli/commands/generate.server.ts).
15
13
  *
@@ -1,21 +1,42 @@
1
1
  import devCache from './dev/cache.server.js';
2
- import { regenerateDrizzleConfig, regenerateHooks } from './dev/cli/templates/init.js';
2
+ import { regenerateHooks, regenerateParams } from './dev/cli/templates/init.js';
3
3
  import generateRoutes from './dev/codegen/routes/index.server.js';
4
4
  import generateTypes from './dev/codegen/types/index.server.js';
5
5
  import { RimeError } from './errors/index.js';
6
6
  import validate from './config/validate.server.js';
7
- import writeMemo from './dev/config-memo.server.js';
7
+ import configMemo from './dev/config-memo.server.js';
8
8
  import { logger } from './logger.server.js';
9
+ /** How long a `rime generate` run may hold the `.cli` marker before it counts as stale. */
10
+ const CLI_MARKER_MAX_AGE_MS = 10 * 60 * 1000;
11
+ /**
12
+ * Whether a `rime generate` process is running. The `.cli` marker holds its process id and the
13
+ * time it started, `'48213 1767225600000'`. A marker with no time, or older than
14
+ * `CLI_MARKER_MAX_AGE_MS`, is stale.
15
+ */
16
+ const cliRunning = () => {
17
+ const [pid, startedAt] = String(devCache.get('.cli') || '')
18
+ .split(' ')
19
+ .map(Number);
20
+ if (!pid || !startedAt || Date.now() - startedAt > CLI_MARKER_MAX_AGE_MS)
21
+ return false;
22
+ try {
23
+ // Signal 0 sends nothing: it throws ESRCH when no process has that id, EPERM when one does
24
+ // but belongs to another user
25
+ process.kill(pid, 0);
26
+ return true;
27
+ }
28
+ catch (error) {
29
+ return error.code === 'EPERM';
30
+ }
31
+ };
9
32
  /**
10
33
  * Phase 1 of three — everything rime writes to disk, in the order it writes it.
11
34
  *
12
- * This is to a build what pipeline.server.ts is to a request: the one place the sequence is
13
- * written down. Unlike the hook pipeline it cannot be a flat array, because each step's output
14
- * is the next step's input on disk — drizzle.config.ts must be current before generateSchema
15
- * shells out to drizzle-kit, which reads it straight off the filesystem.
35
+ * The one place the build sequence is written down. Unlike the hook pipeline in `core/pipeline/`
36
+ * it cannot be a flat array, because each step's output is the next step's input on disk: the
37
+ * schema is written before the types that declare its module.
16
38
  *
17
- * Runs *inside* boot, and only under `dev`. That is deliberate, not a leftover: in development
18
- * codegen is on the fly — editing a collection invalidates the config module, the app reboots,
39
+ * Runs *inside* boot, and only under `dev`: in development codegen is on the fly — editing a collection invalidates the config module, the app reboots,
19
40
  * and this runs again as part of that reload. There is no separate codegen program, and
20
41
  * `rime generate` is simply a boot in a throwaway Vite server (dev/cli/commands/generate.server.ts).
21
42
  *
@@ -28,12 +49,13 @@ export const runCodegen = async (args) => {
28
49
  // running dev server reloading off the CLI's file writes). Skip our own generation this cycle
29
50
  // rather than racing it or blocking this request on it — the next natural reload picks up
30
51
  // whatever the CLI produced.
31
- if (process.env.RIME_CLI !== 'true' && devCache.get('.cli')) {
32
- logger.debug('Skipping generation, `rime generate` is already running');
52
+ if (process.env.RIME_CLI !== 'true' && cliRunning()) {
53
+ logger.warn('Skipping generation: `rime generate` holds node_modules/.rime/.cli.txt. Delete it if no generate runs.');
33
54
  return;
34
55
  }
35
56
  // 1. Has anything changed since the last run? Everything below is skipped if not.
36
- const changed = writeMemo(config);
57
+ const memo = configMemo(config);
58
+ const changed = !devCache.matches('config', memo);
37
59
  // 2. Reject a config that cannot produce a coherent schema, before writing any of it.
38
60
  if (!validate(config)) {
39
61
  throw new RimeError('Config not valid');
@@ -44,15 +66,18 @@ export const runCodegen = async (args) => {
44
66
  }
45
67
  // 3. SvelteKit routes — the (rime) panel tree and /api, plus the param matchers.
46
68
  generateRoutes(config);
47
- // 4. drizzle.config.ts, before generateSchema: it shells out to drizzle-kit generate/migrate,
48
- // which read the schema path straight off disk — stale here means the wrong (or missing)
49
- // schema file.
50
- regenerateDrizzleConfig();
51
- // 5. The drizzle schema. Owned by the adapter, which is why it arrives as an argument: this
52
- // is the one codegen step rime does not implement itself.
69
+ // 4. The drizzle schema. Owned by the adapter, which is why it arrives as an argument: this
70
+ // is the one codegen step rime does not implement itself. The adapter keeps its own
71
+ // drizzle.config.ts current.
53
72
  await generateSchema(config);
54
- // 6. app.generated.d.ts — the types that carry collection and area slugs into consumer code.
73
+ // 5. app.generated.d.ts — the types that carry collection and area slugs into consumer code.
55
74
  await generateTypes(config);
56
- // 7. src/hooks.server.ts, if the consumer has not written one.
75
+ // 6. src/hooks.server.ts, if the consumer has not written one.
57
76
  regenerateHooks();
77
+ // 7. src/params.ts, if the consumer has not written one — the file that spreads the matchers
78
+ // generateRoutes wrote.
79
+ regenerateParams();
80
+ // 8. Every step wrote its files: the next boot with this config has nothing to do. A step that
81
+ // threw leaves the memo unstored, so the next boot runs them again.
82
+ devCache.remember('config', memo);
58
83
  };
@@ -1,11 +1,6 @@
1
1
  import type { BuiltArea, BuiltCollection, SanitizedConfigClient } from './types.js';
2
2
  /**
3
3
  * Both prototype lists exist, empty if the author named none, so nothing downstream guards them.
4
- *
5
- * Was two `configure` props on the definitions, folded by `configureWithPrototypes`, with the
6
- * result's *type* declared through a `PrototypeConfigure` merging target and replayed by a
7
- * recursive `ApplyPrototypeConfigure`. Three mechanisms for two `?? []`, and the type they
8
- * produced is the one an object literal infers on its own.
9
4
  */
10
5
  export declare const withPrototypeLists: <T extends {
11
6
  collections?: BuiltCollection[];
@@ -14,10 +9,13 @@ export declare const withPrototypeLists: <T extends {
14
9
  collections: BuiltCollection[];
15
10
  areas: BuiltArea[];
16
11
  };
17
- /** The client chain, same three layers as build.server.ts — see the note there. */
12
+ /**
13
+ * The client chain: steps 1 to 3 of `augmentConfig` in build.server.ts, without
14
+ * `resolvePipelines`.
15
+ */
18
16
  export declare const buildConfigClient: <C extends SanitizedConfigClient>(config: C) => C & {
19
17
  collections: BuiltCollection[];
20
18
  areas: BuiltArea[];
21
- } & Pick<import("./types.js").BuiltConfig, "panel" | "$trustedOrigins" | "$tables" | "icons"> & {
19
+ } & Pick<import("./types.js").BuiltConfig, "$trustedOrigins" | "panel" | "icons" | "$tables"> & {
22
20
  readonly plugins: import("../plugins/index.js").Plugin[];
23
21
  };
@@ -2,18 +2,16 @@ import { configureConfig } from './configure.js';
2
2
  import { configurePlugins } from '../plugins/configure.js';
3
3
  /**
4
4
  * Both prototype lists exist, empty if the author named none, so nothing downstream guards them.
5
- *
6
- * Was two `configure` props on the definitions, folded by `configureWithPrototypes`, with the
7
- * result's *type* declared through a `PrototypeConfigure` merging target and replayed by a
8
- * recursive `ApplyPrototypeConfigure`. Three mechanisms for two `?? []`, and the type they
9
- * produced is the one an object literal infers on its own.
10
5
  */
11
6
  export const withPrototypeLists = (config) => ({
12
7
  ...config,
13
8
  collections: config.collections ?? [],
14
9
  areas: config.areas ?? []
15
10
  });
16
- /** The client chain, same three layers as build.server.ts — see the note there. */
11
+ /**
12
+ * The client chain: steps 1 to 3 of `augmentConfig` in build.server.ts, without
13
+ * `resolvePipelines`.
14
+ */
17
15
  export const buildConfigClient = (config) => {
18
16
  const withLists = withPrototypeLists(config);
19
17
  const configured = configureConfig(withLists);
@@ -6,7 +6,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
6
6
  * The config chain, one named step at a time:
7
7
  *
8
8
  * 1. `withPrototypeLists` — `collections` and `areas` exist, empty if the author named none.
9
- * 2. `configureConfig` — the five whole-config steps, in `config/configure.ts`.
9
+ * 2. `configureConfig` — the six whole-config steps, in `config/configure.ts`.
10
10
  * 3. `configurePlugins` — the plugin layer, which can add collections of its own.
11
11
  * 4. `resolvePipelines` — every prototype config's `$hooks`, last.
12
12
  *
@@ -16,7 +16,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
16
16
  declare function augmentConfig<T extends Config>(config: T): T & {
17
17
  collections: import("./types.js").BuiltCollection[];
18
18
  areas: import("./types.js").BuiltArea[];
19
- } & Pick<import("./types.js").BuiltConfig, "panel" | "$trustedOrigins" | "$tables" | "icons"> & {
19
+ } & Pick<import("./types.js").BuiltConfig, "$trustedOrigins" | "panel" | "icons" | "$tables"> & {
20
20
  readonly plugins: import("../plugins/index.js").Plugin[];
21
21
  };
22
22
  type InferCollections<C> = C extends {
@@ -33,16 +33,6 @@ type InferAreas<C> = C extends {
33
33
  slug: infer N;
34
34
  } ? N extends string ? N : never : never]: K;
35
35
  } : Record<string, never>;
36
- type InferCollectionsSlug<C> = C extends {
37
- collections?: readonly any[];
38
- } ? NonNullable<C['collections']>[number] extends {
39
- slug: infer N;
40
- } ? N extends string ? N : never : never : Array<never>;
41
- type InferAreasSlug<C> = C extends {
42
- areas?: readonly any[];
43
- } ? NonNullable<C['areas']>[number] extends {
44
- slug: infer N;
45
- } ? N extends string ? N : never : never : Array<never>;
46
36
  type InferCorePlugins<C extends Config> = {
47
37
  cache: import('../plugins/cache/module.server.js').CacheActions;
48
38
  sse: import('../plugins/sse/index.server.js').SSEActions;
@@ -60,11 +50,8 @@ export type BuildConfig<C extends Config = Config> = ReturnType<typeof augmentCo
60
50
  readonly $InferAuthPlugins: C['$auth'] extends {
61
51
  plugins: any;
62
52
  } ? C['$auth']['plugins'] : [];
63
- readonly $InferRoutes: C['$routes'] extends Record<string, any> ? C['$routes'] : unknown;
64
53
  readonly $InferPluginsServer: InferPluginsServer<C>;
65
54
  readonly $InferCollections: InferCollections<C>;
66
55
  readonly $InferAreas: InferAreas<C>;
67
- readonly $InferAreasSlug: InferAreasSlug<C>;
68
- readonly $InferCollectionsSlug: InferCollectionsSlug<C>;
69
56
  };
70
57
  export {};
@@ -11,7 +11,7 @@ export const buildConfig = (config) => {
11
11
  * The config chain, one named step at a time:
12
12
  *
13
13
  * 1. `withPrototypeLists` — `collections` and `areas` exist, empty if the author named none.
14
- * 2. `configureConfig` — the five whole-config steps, in `config/configure.ts`.
14
+ * 2. `configureConfig` — the six whole-config steps, in `config/configure.ts`.
15
15
  * 3. `configurePlugins` — the plugin layer, which can add collections of its own.
16
16
  * 4. `resolvePipelines` — every prototype config's `$hooks`, last.
17
17
  *
@@ -23,8 +23,7 @@ function augmentConfig(config) {
23
23
  const configured = configureConfig(withLists);
24
24
  const withPlugins = configurePlugins(configured);
25
25
  // Last, so *every* prototype config gets its pipeline from the same line — authored, derived by
26
- // a feature, or added by a plugin. A plugin's own collection used to arrive after this ran and
27
- // so carried no pipeline at all: its first create failed on `missing configMap @create`.
26
+ // a feature, or added by a plugin.
28
27
  //
29
28
  // A plugin appending to a collection's `$hooks` still lands where it should — `buildPipeline`
30
29
  // reads `$hooks` as the consumer layer and appends it after the placed hooks either way.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { describe, expectTypeOf, it } from 'vitest';
2
+ describe('the client config types', () => {
3
+ it('have none of the `$` members the sanitizer drops', () => {
4
+ expectTypeOf().not.toHaveProperty('$cache');
5
+ expectTypeOf().not.toHaveProperty('$sse');
6
+ expectTypeOf().not.toHaveProperty('$smtp');
7
+ expectTypeOf().not.toHaveProperty('$tables');
8
+ });
9
+ it('keep the members the client reads', () => {
10
+ expectTypeOf().toHaveProperty('collections');
11
+ expectTypeOf().toHaveProperty('panel');
12
+ });
13
+ });
@@ -4,20 +4,16 @@ import type { Dic } from '../../util/types.js';
4
4
  * Everything that shapes the **whole** config, in the order it runs.
5
5
  *
6
6
  * The twin of a prototype's `augments` list, at the other scope: an augment shapes one prototype
7
- * config, these five shape the config itself. It was `configureWithFeatures`, folding a
8
- * deduplicated feature list and calling `feature.configure` on whatever declared one — so reading
9
- * this order meant opening ten files and working out which of them had the prop.
10
- *
11
- * The order is the one the prototypes' feature lists produced, and two steps depend on it:
7
+ * config, these six shape the config itself. Two steps depend on the order:
12
8
  *
13
9
  * - **staff before panel.** The panel's icon map covers the collections that exist when it runs,
14
10
  * and `staff` has to be one of them.
15
11
  * - **panel before upload and versions.** Those two *derive* collections — `<slug>Directories`,
16
12
  * `$<slug>__versions` — and a derived collection has no place in the panel's navigation.
17
13
  *
18
- * Four of the six come through `$rime/modules`: they are server-only, and resolve to `undefined`
19
- * on a client build, where nothing derives a collection. That is what the `step ? … : current`
20
- * guard is for — the same one the fold made with `feature.configure ? … : current`.
14
+ * Four of the six come through `$rime/modules`. `configureVersions` and `configureCors` are
15
+ * server-only and resolve to `undefined` on a client build; the `step ? … : current` guard skips
16
+ * them.
21
17
  *
22
18
  * The type is declared rather than inferred, and that is load-bearing. `bootRime<C>` reads
23
19
  * `config.panel.language` while `C` is still a type parameter; an intersection built from a key
@@ -8,20 +8,16 @@ import { configurePanel } from '../panel/configure.js';
8
8
  * Everything that shapes the **whole** config, in the order it runs.
9
9
  *
10
10
  * The twin of a prototype's `augments` list, at the other scope: an augment shapes one prototype
11
- * config, these five shape the config itself. It was `configureWithFeatures`, folding a
12
- * deduplicated feature list and calling `feature.configure` on whatever declared one — so reading
13
- * this order meant opening ten files and working out which of them had the prop.
14
- *
15
- * The order is the one the prototypes' feature lists produced, and two steps depend on it:
11
+ * config, these six shape the config itself. Two steps depend on the order:
16
12
  *
17
13
  * - **staff before panel.** The panel's icon map covers the collections that exist when it runs,
18
14
  * and `staff` has to be one of them.
19
15
  * - **panel before upload and versions.** Those two *derive* collections — `<slug>Directories`,
20
16
  * `$<slug>__versions` — and a derived collection has no place in the panel's navigation.
21
17
  *
22
- * Four of the six come through `$rime/modules`: they are server-only, and resolve to `undefined`
23
- * on a client build, where nothing derives a collection. That is what the `step ? … : current`
24
- * guard is for — the same one the fold made with `feature.configure ? … : current`.
18
+ * Four of the six come through `$rime/modules`. `configureVersions` and `configureCors` are
19
+ * server-only and resolve to `undefined` on a client build; the `step ? … : current` guard skips
20
+ * them.
25
21
  *
26
22
  * The type is declared rather than inferred, and that is load-bearing. `bootRime<C>` reads
27
23
  * `config.panel.language` while `C` is still a type parameter; an intersection built from a key
@@ -1,4 +1,4 @@
1
- import type { AreaSlug, CollectionSlug, Config, PrototypeSlug } from '../../types.js';
1
+ import type { AreaSlug, CollectionSlug, Config } from '../../types.js';
2
2
  import type { BuildConfig } from './build.server.js';
3
3
  /**
4
4
  * What `event.locals.rime.config` is.
@@ -75,8 +75,4 @@ export declare function createConfigContext<const C extends Config>(config: Buil
75
75
  * Checks if a slug represents an area
76
76
  */
77
77
  isArea: (slug?: string) => slug is AreaSlug;
78
- /**
79
- * Determines the prototype (collection or area) of a document by its slug
80
- */
81
- getDocumentPrototype(slug: PrototypeSlug): "area" | "collection";
82
78
  };
@@ -19,13 +19,13 @@ export function createConfigContext(config) {
19
19
  const getLocalesCodes = () => config.localization ? config.localization.locales.map((l) => l.code) : [];
20
20
  const isValidLocale = (locale) => getLocalesCodes().includes(locale);
21
21
  const getArea = (slug) => {
22
- const areaConfig = (config.areas || []).find((g) => g.slug === slug);
22
+ const areaConfig = config.areas.find((area) => area.slug === slug);
23
23
  if (!areaConfig)
24
24
  throw new RimeError(RimeError.BAD_REQUEST, `${slug} is not an area`);
25
25
  return areaConfig;
26
26
  };
27
27
  const getCollection = (slug) => {
28
- const collectionConfig = (config.collections || []).find((c) => c.slug === slug);
28
+ const collectionConfig = config.collections.find((collection) => collection.slug === slug);
29
29
  if (!collectionConfig)
30
30
  throw new RimeError(RimeError.BAD_REQUEST, `${slug} is not a collection`);
31
31
  return collectionConfig;
@@ -43,8 +43,8 @@ export function createConfigContext(config) {
43
43
  }
44
44
  }
45
45
  };
46
- const isCollection = (slug) => !!mapCollectionsSlug.includes(slug);
47
- const isArea = (slug) => !!mapAreasSlug.includes(slug);
46
+ const isCollection = (slug) => mapCollectionsSlug.includes(slug);
47
+ const isArea = (slug) => mapAreasSlug.includes(slug);
48
48
  return {
49
49
  /**
50
50
  * Gets raw config object
@@ -103,16 +103,6 @@ export function createConfigContext(config) {
103
103
  /**
104
104
  * Checks if a slug represents an area
105
105
  */
106
- isArea,
107
- /**
108
- * Determines the prototype (collection or area) of a document by its slug
109
- */
110
- getDocumentPrototype(slug) {
111
- if (isCollection(slug))
112
- return 'collection';
113
- if (isArea(slug))
114
- return 'area';
115
- throw new RimeError(RimeError.BAD_REQUEST, slug + ' is neither a collection nor an area');
116
- }
106
+ isArea
117
107
  };
118
108
  }
@@ -0,0 +1 @@
1
+ export {};