rimecms 0.27.6 → 0.28.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 (204) hide show
  1. package/dist/adapter-sqlite/{area.js → area.server.js} +2 -2
  2. package/dist/adapter-sqlite/{blocks.d.ts → blocks.server.d.ts} +1 -1
  3. package/dist/adapter-sqlite/{blocks.js → blocks.server.js} +1 -1
  4. package/dist/adapter-sqlite/{collection.js → collection.server.js} +17 -8
  5. package/dist/adapter-sqlite/generate-schema/write.server.js +2 -2
  6. package/dist/adapter-sqlite/index.server.d.ts +8 -8
  7. package/dist/adapter-sqlite/index.server.js +7 -7
  8. package/dist/adapter-sqlite/{orderBy.js → orderBy.server.js} +1 -1
  9. package/dist/adapter-sqlite/{relations.d.ts → relations.server.d.ts} +1 -1
  10. package/dist/adapter-sqlite/{relations.js → relations.server.js} +1 -1
  11. package/dist/adapter-sqlite/{transform.js → transform.server.js} +2 -3
  12. package/dist/adapter-sqlite/{tree.d.ts → tree.server.d.ts} +1 -1
  13. package/dist/adapter-sqlite/{tree.js → tree.server.js} +1 -1
  14. package/dist/adapter-sqlite/url.server.d.ts +1 -1
  15. package/dist/core/areas/local-api.server.d.ts +1 -1
  16. package/dist/core/areas/local-api.server.js +1 -0
  17. package/dist/core/collections/api/delete.server.js +1 -1
  18. package/dist/core/collections/api/get.server.js +1 -1
  19. package/dist/core/collections/api/getById.server.js +3 -1
  20. package/dist/core/collections/config/augment-panel.d.ts +13 -0
  21. package/dist/core/collections/config/augment-panel.js +19 -0
  22. package/dist/core/collections/config/augment-upload.server.d.ts +1 -0
  23. package/dist/core/collections/config/augment-upload.server.js +1 -0
  24. package/dist/core/collections/config/builder.js +3 -1
  25. package/dist/core/collections/config/builder.server.js +3 -1
  26. package/dist/core/collections/local-api.server.js +3 -1
  27. package/dist/core/collections/operations/findById.js +3 -1
  28. package/dist/core/collections/upload/hooks/convert-base64.server.js +1 -1
  29. package/dist/core/config/auth/better-auth.server.d.ts +3 -3
  30. package/dist/core/config/auth/better-auth.server.js +1 -1
  31. package/dist/core/config/client/augment-panel.d.ts +4 -4
  32. package/dist/core/config/client/build-config.d.ts +5 -5
  33. package/dist/core/config/server/augment-directories.server.js +3 -3
  34. package/dist/core/config/server/augment-staff.server.d.ts +1 -1
  35. package/dist/core/config/server/augment-staff.server.js +1 -1
  36. package/dist/core/config/server/build-config.server.d.ts +12 -12
  37. package/dist/core/config/server/build-config.server.js +1 -1
  38. package/dist/core/config/server/{validate.js → validate.server.js} +1 -1
  39. package/dist/core/config/server/{write.js → write.server.js} +1 -1
  40. package/dist/core/config/shared/augment-icons.d.ts +1 -2
  41. package/dist/core/config/shared/get-staff-collection.d.ts +1 -1
  42. package/dist/core/config/shared/upload-directories.js +1 -1
  43. package/dist/core/config/types.d.ts +20 -8
  44. package/dist/core/dev/cli/generate/{index.js → index.server.js} +2 -2
  45. package/dist/core/dev/cli/index.js +3 -3
  46. package/dist/core/dev/cli/init/{index.js → index.server.js} +68 -25
  47. package/dist/core/dev/cli/init/{packageManagerUtil.js → package-manager-util.server.js} +5 -5
  48. package/dist/core/dev/generate/routes/{area.d.ts → area.server.d.ts} +1 -1
  49. package/dist/core/dev/generate/routes/{area.js → area.server.js} +1 -1
  50. package/dist/core/dev/generate/routes/{collection.d.ts → collection.server.d.ts} +1 -1
  51. package/dist/core/dev/generate/routes/{collection.js → collection.server.js} +1 -1
  52. package/dist/core/dev/generate/routes/{common.d.ts → common.server.d.ts} +1 -1
  53. package/dist/core/dev/generate/routes/{common.js → common.server.js} +3 -3
  54. package/dist/core/dev/generate/routes/{index.js → index.server.js} +5 -5
  55. package/dist/core/dev/generate/routes/{util.js → util.server.js} +1 -1
  56. package/dist/core/dev/generate/types/{index.js → index.server.js} +1 -1
  57. package/dist/core/dev/vite/{index.js → index.server.js} +1 -1
  58. package/dist/core/fields/util.d.ts +13 -0
  59. package/dist/core/fields/util.js +77 -4
  60. package/dist/core/i18n/en/common.d.ts +1 -0
  61. package/dist/core/i18n/en/common.js +1 -0
  62. package/dist/core/i18n/fr/common.d.ts +1 -0
  63. package/dist/core/i18n/fr/common.js +1 -0
  64. package/dist/core/operations/hooks/before-read/populate-url.server.js +10 -2
  65. package/dist/core/operations/hooks/before-upsert/handle-new-version.server.js +2 -2
  66. package/dist/core/operations/relations/diff.server.d.ts +1 -1
  67. package/dist/core/operations/relations/extract.server.d.ts +1 -1
  68. package/dist/core/rime.server.d.ts +22 -8
  69. package/dist/core/rime.server.js +5 -5
  70. package/dist/fields/blocks/component/Block.svelte +13 -19
  71. package/dist/fields/blocks/component/Blocks.svelte +6 -13
  72. package/dist/fields/group/component/Group.svelte +6 -13
  73. package/dist/fields/number/component/number.css +2 -0
  74. package/dist/fields/relation/component/default/Default.svelte +1 -7
  75. package/dist/fields/relation/component/upload/upload.css +1 -10
  76. package/dist/fields/relation/index.d.ts +21 -6
  77. package/dist/fields/relation/index.js +41 -11
  78. package/dist/fields/rich-text/component/RichText.svelte +4 -4
  79. package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte +6 -6
  80. package/dist/fields/rich-text/component/bubble-menu/bubble-menu.svelte.d.ts +2 -0
  81. package/dist/fields/rich-text/component/drag-handle/drag-handle.css +1 -0
  82. package/dist/fields/rich-text/component/styles/rich-text.css +0 -7
  83. package/dist/fields/rich-text/core/features/resource/resource.svelte +2 -9
  84. package/dist/fields/rich-text/core/features/upload/upload.svelte +5 -12
  85. package/dist/fields/rich-text/core/render-rich-text.svelte +5 -3
  86. package/dist/fields/rich-text/index.d.ts +1 -1
  87. package/dist/fields/select/component/Select.svelte +5 -11
  88. package/dist/fields/tabs/index.d.ts +1 -0
  89. package/dist/fields/tabs/index.js +3 -0
  90. package/dist/fields/textarea/component/TextArea.svelte +5 -13
  91. package/dist/fields/tree/component/TreeBlock.svelte +12 -18
  92. package/dist/fields/types.d.ts +3 -2
  93. package/dist/live.d.ts +2 -1
  94. package/dist/live.js +2 -1
  95. package/dist/panel/components/fields/Error.svelte +1 -7
  96. package/dist/panel/components/sections/collection/Empty.svelte +1 -0
  97. package/dist/panel/components/sections/collection/folder/Folder.svelte +7 -16
  98. package/dist/panel/components/sections/collection/folder/FolderWithActions.svelte +1 -1
  99. package/dist/panel/components/sections/collection/grid/CollectionGrid.svelte +22 -12
  100. package/dist/panel/components/sections/collection/grid/create-directory-dialog/CreateDirectoryDialog.svelte +4 -5
  101. package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte +41 -33
  102. package/dist/panel/components/sections/collection/grid/grid-item/GridItem.svelte.d.ts +4 -0
  103. package/dist/panel/components/sections/collection/header/ButtonCreate.svelte +14 -16
  104. package/dist/panel/components/sections/collection/header/ButtonCreate.svelte.d.ts +2 -0
  105. package/dist/panel/components/sections/collection/header/DisplayMode.svelte +10 -10
  106. package/dist/panel/components/sections/collection/header/SearchInput.svelte +2 -8
  107. package/dist/panel/components/sections/collection/list/CollectionList.svelte +32 -3
  108. package/dist/panel/components/sections/collection/list/header/Header.svelte +3 -9
  109. package/dist/panel/components/sections/collection/list/row/Row.svelte +34 -24
  110. package/dist/panel/components/sections/collection/list/row/Row.svelte.d.ts +9 -0
  111. package/dist/panel/components/sections/collection/upload-thumb-cell/UploadThumbCell.svelte +11 -1
  112. package/dist/panel/components/sections/document/ButtonStatus.svelte +3 -11
  113. package/dist/panel/components/sections/document/Document.svelte +22 -41
  114. package/dist/panel/components/sections/document/Document.svelte.d.ts +0 -1
  115. package/dist/panel/components/sections/document/upload-header/UploadHeader.svelte +11 -21
  116. package/dist/panel/components/sections/live/LiveEdit.svelte +114 -0
  117. package/dist/panel/components/sections/live/LiveEdit.svelte.d.ts +32 -0
  118. package/dist/panel/components/sections/live/LiveEditPanel.svelte +53 -0
  119. package/dist/panel/components/sections/live/LiveEditPanel.svelte.d.ts +11 -0
  120. package/dist/panel/components/sections/live/LiveFloatingUI.svelte +106 -0
  121. package/dist/panel/components/sections/live/LiveFloatingUI.svelte.d.ts +12 -0
  122. package/dist/panel/components/sections/live/Provider.svelte +4 -4
  123. package/dist/panel/components/sections/live/Provider.svelte.d.ts +5 -3
  124. package/dist/panel/components/sections/live/live-edit-panel.css +12 -0
  125. package/dist/panel/components/ui/breadcrumb/BreadCrumb.svelte +2 -9
  126. package/dist/panel/components/ui/button/button.svelte +35 -54
  127. package/dist/panel/components/ui/calendar/calendar.css +11 -0
  128. package/dist/panel/components/ui/card-document/card-document.svelte +21 -14
  129. package/dist/panel/components/ui/card-resource/card-resource.svelte +8 -14
  130. package/dist/panel/components/ui/checkbox/checkbox.svelte +1 -1
  131. package/dist/panel/components/ui/command/command-group.css +1 -0
  132. package/dist/panel/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -7
  133. package/dist/panel/components/ui/input/input.svelte +13 -23
  134. package/dist/panel/components/ui/label/label.css +0 -1
  135. package/dist/panel/components/ui/nav/NavItemButton.svelte +2 -8
  136. package/dist/panel/components/ui/page-header/PageHeader.svelte +6 -13
  137. package/dist/panel/components/ui/radio-group/radio-group.css +2 -0
  138. package/dist/panel/components/ui/scroll-area/scroll-area.css +0 -4
  139. package/dist/panel/components/ui/sheet/sheet.css +0 -16
  140. package/dist/panel/components/ui/tabs/tabs.css +7 -0
  141. package/dist/panel/context/collection.svelte.d.ts +0 -4
  142. package/dist/panel/context/collection.svelte.js +0 -3
  143. package/dist/panel/context/documentForm.svelte.js +1 -0
  144. package/dist/panel/context/live.svelte.d.ts +8 -20
  145. package/dist/panel/context/live.svelte.js +65 -35
  146. package/dist/panel/context/livePanel.svelte.d.ts +11 -0
  147. package/dist/panel/context/livePanel.svelte.js +8 -0
  148. package/dist/panel/pages/auth/forgot-password/ForgotPassword.svelte +1 -7
  149. package/dist/panel/pages/collection/Collection.svelte +3 -1
  150. package/dist/panel/pages/dashboard/Dashboard.svelte +52 -28
  151. package/dist/panel/pages/dashboard/DashboardCollection.svelte +91 -0
  152. package/dist/panel/pages/dashboard/DashboardCollection.svelte.d.ts +9 -0
  153. package/dist/panel/pages/dashboard/load.server.js +30 -14
  154. package/dist/panel/pages/dashboard/types.d.ts +1 -0
  155. package/dist/panel/pages/live/Live.svelte +244 -67
  156. package/dist/panel/pages/live/Live.svelte.d.ts +9 -1
  157. package/dist/panel/pages/live/load.server.js +14 -1
  158. package/dist/panel/style/index.css +562 -8
  159. package/dist/panel/style/mixins/index.css +1 -3
  160. package/dist/panel/util/upload.d.ts +1 -1
  161. package/dist/util/object.js +3 -0
  162. package/package.json +12 -10
  163. package/dist/panel/components/sections/document/FloatingUI.svelte +0 -81
  164. package/dist/panel/components/sections/document/FloatingUI.svelte.d.ts +0 -8
  165. package/dist/panel/components/sections/live/SidePanel.svelte +0 -61
  166. package/dist/panel/components/sections/live/SidePanel.svelte.d.ts +0 -14
  167. package/dist/panel/components/sections/live/side-panel.css +0 -15
  168. /package/dist/adapter-sqlite/{area.d.ts → area.server.d.ts} +0 -0
  169. /package/dist/adapter-sqlite/{collection.d.ts → collection.server.d.ts} +0 -0
  170. /package/dist/adapter-sqlite/{orderBy.d.ts → orderBy.server.d.ts} +0 -0
  171. /package/dist/adapter-sqlite/{transform.d.ts → transform.server.d.ts} +0 -0
  172. /package/dist/adapter-sqlite/{types.d.ts → types.server.d.ts} +0 -0
  173. /package/dist/adapter-sqlite/{types.js → types.server.js} +0 -0
  174. /package/dist/adapter-sqlite/{util.d.ts → util.server.d.ts} +0 -0
  175. /package/dist/adapter-sqlite/{util.js → util.server.js} +0 -0
  176. /package/dist/adapter-sqlite/{where.d.ts → where.server.d.ts} +0 -0
  177. /package/dist/adapter-sqlite/{where.js → where.server.js} +0 -0
  178. /package/dist/adapter-sqlite/{with.d.ts → with.server.d.ts} +0 -0
  179. /package/dist/adapter-sqlite/{with.js → with.server.js} +0 -0
  180. /package/dist/core/collections/upload/util/{converter.d.ts → converter.server.d.ts} +0 -0
  181. /package/dist/core/collections/upload/util/{converter.js → converter.server.js} +0 -0
  182. /package/dist/core/config/auth/{better-auth-hooks.d.ts → better-auth-hooks.server.d.ts} +0 -0
  183. /package/dist/core/config/auth/{better-auth-hooks.js → better-auth-hooks.server.js} +0 -0
  184. /package/dist/core/config/server/{augment-cors.d.ts → augment-cors.server.d.ts} +0 -0
  185. /package/dist/core/config/server/{augment-cors.js → augment-cors.server.js} +0 -0
  186. /package/dist/core/config/server/{validate.d.ts → validate.server.d.ts} +0 -0
  187. /package/dist/core/config/server/{write.d.ts → write.server.d.ts} +0 -0
  188. /package/dist/core/dev/cache/{index.d.ts → index.server.d.ts} +0 -0
  189. /package/dist/core/dev/cache/{index.js → index.server.js} +0 -0
  190. /package/dist/core/dev/cli/clear/{index.d.ts → index.server.d.ts} +0 -0
  191. /package/dist/core/dev/cli/clear/{index.js → index.server.js} +0 -0
  192. /package/dist/core/dev/cli/generate/{index.d.ts → index.server.d.ts} +0 -0
  193. /package/dist/core/dev/cli/init/{getPackageName.d.ts → get-package-info.server.d.ts} +0 -0
  194. /package/dist/core/dev/cli/init/{getPackageName.js → get-package-info.server.js} +0 -0
  195. /package/dist/core/dev/cli/init/{index.d.ts → index.server.d.ts} +0 -0
  196. /package/dist/core/dev/cli/init/{packageManagerUtil.d.ts → package-manager-util.server.d.ts} +0 -0
  197. /package/dist/core/dev/generate/routes/{custom-css.d.ts → custom-css.server.d.ts} +0 -0
  198. /package/dist/core/dev/generate/routes/{custom-css.js → custom-css.server.js} +0 -0
  199. /package/dist/core/dev/generate/routes/{index.d.ts → index.server.d.ts} +0 -0
  200. /package/dist/core/dev/generate/routes/{util.d.ts → util.server.d.ts} +0 -0
  201. /package/dist/core/dev/generate/sanitize/{index.d.ts → index.server.d.ts} +0 -0
  202. /package/dist/core/dev/generate/sanitize/{index.js → index.server.js} +0 -0
  203. /package/dist/core/dev/generate/types/{index.d.ts → index.server.d.ts} +0 -0
  204. /package/dist/core/dev/vite/{index.d.ts → index.server.d.ts} +0 -0
@@ -1137,7 +1137,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
1137
1137
  $Infer: {
1138
1138
  body: {
1139
1139
  userId: string;
1140
- role: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[];
1140
+ role: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[];
1141
1141
  };
1142
1142
  };
1143
1143
  };
@@ -1217,7 +1217,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
1217
1217
  email: string;
1218
1218
  password?: string | undefined;
1219
1219
  name: string;
1220
- role?: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[] | undefined;
1220
+ role?: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[] | undefined;
1221
1221
  data?: Record<string, any> | undefined;
1222
1222
  };
1223
1223
  };
@@ -1761,7 +1761,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
1761
1761
  permission?: never | undefined;
1762
1762
  }) & {
1763
1763
  userId?: string | undefined;
1764
- role?: "user" | "staff" | "admin" | undefined;
1764
+ role?: "user" | "admin" | "staff" | undefined;
1765
1765
  };
1766
1766
  };
1767
1767
  };
@@ -3119,7 +3119,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
3119
3119
  $Infer: {
3120
3120
  body: {
3121
3121
  userId: string;
3122
- role: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[];
3122
+ role: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[];
3123
3123
  };
3124
3124
  };
3125
3125
  };
@@ -3199,7 +3199,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
3199
3199
  email: string;
3200
3200
  password?: string | undefined;
3201
3201
  name: string;
3202
- role?: "user" | "staff" | "admin" | ("user" | "staff" | "admin")[] | undefined;
3202
+ role?: "user" | "admin" | "staff" | ("user" | "admin" | "staff")[] | undefined;
3203
3203
  data?: Record<string, any> | undefined;
3204
3204
  };
3205
3205
  };
@@ -3743,7 +3743,7 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
3743
3743
  permission?: never | undefined;
3744
3744
  }) & {
3745
3745
  userId?: string | undefined;
3746
- role?: "user" | "staff" | "admin" | undefined;
3746
+ role?: "user" | "admin" | "staff" | undefined;
3747
3747
  };
3748
3748
  };
3749
3749
  };
@@ -3956,12 +3956,12 @@ export declare const buildConfig: <const C extends Config>(config: C) => Promise
3956
3956
  };
3957
3957
  }>;
3958
3958
  declare function augmentConfig<T extends Config>(config: T): T & {
3959
- readonly collections: readonly [import("../types.js").BuiltCollection, ...import("../types.js").BuiltCollection[]];
3959
+ readonly collections: readonly [...import("../types.js").BuiltCollection[], import("../types.js").BuiltCollection];
3960
3960
  } & {
3961
3961
  readonly collections: import("../types.js").BuiltCollection[];
3962
3962
  readonly areas: import("../types.js").BuiltArea[];
3963
3963
  } & {
3964
- readonly icons: import("../../../util/types.js").Dic<import("svelte").Component<import("@lucide/svelte").IconProps, {}, string>>;
3964
+ readonly icons: import("../../../util/types.js").Dic<import("svelte").Component<import("@lucide/svelte").LucideProps, {}, string>>;
3965
3965
  } & {
3966
3966
  readonly panel: {
3967
3967
  readonly routes: Record<string, import("../types.js").CustomPanelRoute>;
@@ -3972,16 +3972,16 @@ declare function augmentConfig<T extends Config>(config: T): T & {
3972
3972
  icon: import("svelte").Component<import("@lucide/svelte").IconProps>;
3973
3973
  }[], {
3974
3974
  readonly label: "content";
3975
- readonly icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
3975
+ readonly icon: import("svelte").Component<import("@lucide/svelte").LucideProps, {}, "">;
3976
3976
  }, {
3977
3977
  readonly label: "system";
3978
- readonly icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
3978
+ readonly icon: import("svelte").Component<import("@lucide/svelte").LucideProps, {}, "">;
3979
3979
  }, {
3980
3980
  readonly label: "collections";
3981
- readonly icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
3981
+ readonly icon: import("svelte").Component<import("@lucide/svelte").LucideProps, {}, "">;
3982
3982
  }, {
3983
3983
  readonly label: "areas";
3984
- readonly icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
3984
+ readonly icon: import("svelte").Component<import("@lucide/svelte").LucideProps, {}, "">;
3985
3985
  }];
3986
3986
  };
3987
3987
  readonly components: {
@@ -4,7 +4,7 @@ import { augmentPlugins } from '../client/augment-plugins.js';
4
4
  import { augmentIcons } from '../shared/augment-icons.js';
5
5
  import { augmentPrototypes } from '../shared/augment-prototypes.js';
6
6
  import { makeVersionsCollectionsAliases } from '../shared/versions-alias.server.js';
7
- import { augmentCORS } from './augment-cors.js';
7
+ import { augmentCORS } from './augment-cors.server.js';
8
8
  import { augmentDirectoriesServer } from './augment-directories.server.js';
9
9
  import { augmentPanelAccess } from './augment-panel-access.server.js';
10
10
  import { augmentPluginsServer } from './augment-plugins.server.js';
@@ -1,5 +1,5 @@
1
1
  import { isAuthConfig } from '../../collections/auth/util.js';
2
- import cache from '../../dev/cache/index.js';
2
+ import cache from '../../dev/cache/index.server.js';
3
3
  import { isFormField } from '../../fields/util.js';
4
4
  import { isBlocksFieldRaw } from '../../../fields/blocks/index.js';
5
5
  import { isGroupFieldRaw } from '../../../fields/group/index.js';
@@ -1,5 +1,5 @@
1
1
  import { flatten } from 'flat';
2
- import cache from '../../dev/cache/index.js';
2
+ import cache from '../../dev/cache/index.server.js';
3
3
  const serializeValue = (value) => {
4
4
  if (value === null)
5
5
  return 'null';
@@ -1,10 +1,9 @@
1
1
  import type { BuiltArea, BuiltCollection } from '../types.js';
2
2
  import type { Dic } from '../../../util/types.js';
3
- import type { IconProps } from '@lucide/svelte';
4
3
  import type { Component } from 'svelte';
5
4
  export declare const augmentIcons: <const T extends {
6
5
  collections?: BuiltCollection[];
7
6
  areas?: BuiltArea[];
8
7
  }>(config: T) => T & {
9
- readonly icons: Dic<Component<IconProps, {}, string>>;
8
+ readonly icons: Dic<Component<import("@lucide/svelte").LucideProps, {}, string>>;
10
9
  };
@@ -15,7 +15,7 @@ export declare const staffCollection: {
15
15
  type: string;
16
16
  roles: string[];
17
17
  };
18
- icon: import("svelte").Component<import("@lucide/svelte").IconProps, {}, "">;
18
+ icon: import("svelte").Component<import("@lucide/svelte").LucideProps, {}, "">;
19
19
  fields: FieldBuilder<Field>[];
20
20
  access: Access;
21
21
  };
@@ -47,7 +47,7 @@ export function makeUploadDirectoriesCollectionClient(collection) {
47
47
  plural: `${collection.slug} directories`
48
48
  },
49
49
  icon: collection.icon,
50
- asTitle: 'path',
50
+ asTitle: 'name',
51
51
  asThumbnail: collection.asThumbnail,
52
52
  panel: false
53
53
  };
@@ -168,12 +168,6 @@ export type VersionsConfig = {
168
168
  maxVersions?: number;
169
169
  };
170
170
  export type UrlDefinition<T extends BaseDoc = BaseDoc> = (document: T) => string;
171
- export type PrototypePanelConfig = {
172
- /** Description for the collection/area, basically displayed on the dashboard */
173
- description?: string;
174
- /** Sidebar navigation group */
175
- group?: string;
176
- };
177
171
  type PrototypeConfig<S extends string = string> = {
178
172
  slug: S;
179
173
  /** Document fields definition */
@@ -185,8 +179,6 @@ type PrototypeConfig<S extends string = string> = {
185
179
  access?: Access;
186
180
  /** If the document can be edited live, if enabled the url prop must be set also. */
187
181
  live?: boolean;
188
- /** Panel configuration, set false to hide the area/collection from the panel */
189
- panel?: false | PrototypePanelConfig;
190
182
  };
191
183
  export type UploadConfig = {
192
184
  /**
@@ -233,6 +225,17 @@ export type CollectionAuthConfig = ({
233
225
  }) & {
234
226
  roles?: (string | Option)[];
235
227
  };
228
+ export type CollectionPanelConfig = false | {
229
+ /** Description for the collection/area, basically displayed on the dashboard */
230
+ description?: string;
231
+ /** Sidebar navigation group */
232
+ group?: string;
233
+ /** Dashboard settings */
234
+ dashboard?: {
235
+ layout?: 'rows' | 'grid';
236
+ maxEntries?: number;
237
+ } | false;
238
+ };
236
239
  export type Collection<S> = {
237
240
  slug: S;
238
241
  /** The collection label */
@@ -247,6 +250,8 @@ export type Collection<S> = {
247
250
  nested?: boolean;
248
251
  /** Whether the collection support file upload */
249
252
  upload?: boolean | UploadConfig;
253
+ /** Panel configuration, set false to hide the collection from the panel */
254
+ panel?: CollectionPanelConfig;
250
255
  } & PrototypeConfig;
251
256
  export type Area<S> = PrototypeConfig & {
252
257
  slug: S;
@@ -255,6 +260,13 @@ export type Area<S> = PrototypeConfig & {
255
260
  $hooks?: AreaHooks<S extends keyof RegisterArea ? S : any>;
256
261
  /** The area label */
257
262
  label?: string;
263
+ /** Panel configuration, set false to hide the area from the panel */
264
+ panel?: false | {
265
+ /** Description for the collection/area, basically displayed on the dashboard */
266
+ description?: string;
267
+ /** Sidebar navigation group */
268
+ group?: string;
269
+ };
258
270
  };
259
271
  type NavigationConfig = {
260
272
  groups: Array<{
@@ -1,5 +1,5 @@
1
- import cache from '../../cache/index.js';
2
- import { sanitize } from '../../generate/sanitize/index.js';
1
+ import cache from '../../cache/index.server.js';
2
+ import { sanitize } from '../../generate/sanitize/index.server.js';
3
3
  import { ensureGeneratedConfig, ensureUserConfigExist } from '../../../ensure.server.js';
4
4
  import { logger } from '../../../logger/index.server.js';
5
5
  import { trycatch } from '../../../../util/function.js';
@@ -8,7 +8,7 @@ program
8
8
  .option('-f, --force', 'Force init with default package name', false)
9
9
  .option('-s, --skip-install', 'Do not install dependencies', false)
10
10
  .action(async (args) => {
11
- const init = await import('./init/index.js').then((m) => m.init);
11
+ const init = await import('./init/index.server.js').then((m) => m.init);
12
12
  init(args);
13
13
  });
14
14
  program
@@ -22,14 +22,14 @@ program
22
22
  .command('clear')
23
23
  .option('-f, --force', 'Force clear without prompt', false)
24
24
  .action(async (args) => {
25
- const clear = await import('./clear/index.js').then((m) => m.clear);
25
+ const clear = await import('./clear/index.server.js').then((m) => m.clear);
26
26
  clear(args);
27
27
  });
28
28
  program
29
29
  .command('generate')
30
30
  .option('-f, --force', 'Force generation, ignore cache, overwrite routes', false)
31
31
  .action(async (args) => {
32
- const generate = await import('./generate/index.js').then((m) => m.generate);
32
+ const generate = await import('./generate/index.server.js').then((m) => m.generate);
33
33
  generate({
34
34
  force: args.force
35
35
  });
@@ -1,15 +1,19 @@
1
1
  import { logger } from '../../../logger/index.server.js';
2
2
  import { randomId } from '../../../../util/random.js';
3
3
  import { isValidSlug, slugify } from '../../../../util/string.js';
4
+ import { generate as generateCode } from '@babel/generator';
5
+ import * as t from '@babel/types';
6
+ import { babelParse } from 'ast-kit';
4
7
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
5
8
  import { cp, mkdir } from 'fs/promises';
9
+ import fs from 'node:fs';
6
10
  import path from 'path';
7
11
  import { fileURLToPath } from 'url';
8
12
  import { INPUT_DIR } from '../../constants.js';
9
- import { generate } from '../generate/index.js';
13
+ import { generate } from '../generate/index.server.js';
10
14
  import { prompt } from '../util.server.js';
11
- import { getPackageInfoByKey } from './getPackageName.js';
12
- import { installDependencies } from './packageManagerUtil.js';
15
+ import { getPackageInfoByKey } from './get-package-info.server.js';
16
+ import { installDependencies } from './package-manager-util.server.js';
13
17
  import * as templates from './templates.js';
14
18
  const PACKAGE = 'rimecms';
15
19
  const root = process.cwd();
@@ -104,33 +108,72 @@ export const init = async ({ force, name: incomingName, skipInstall }) => {
104
108
  }
105
109
  function configureVite() {
106
110
  const configPath = path.resolve(root, 'vite.config.ts');
107
- if (!existsSync(configPath)) {
111
+ if (!fs.existsSync(configPath)) {
108
112
  throw new Error("Can't find vite configuration file");
109
113
  }
110
- const content = readFileSync(configPath, 'utf-8');
111
- if (!content.includes('rime()')) {
112
- // Add import
113
- const newContent = content.replace(/(import .* from .*;\n?)/, `$1import { rime } from '${PACKAGE}/vite';\n`);
114
- // Add plugin to the list - ensure it's after sveltekit()
115
- const updatedContent = newContent.replace(/plugins:\s*\[([\s\S]*?)\]/, (match, plugins) => {
116
- // Check if sveltekit() is in the plugins list
117
- if (plugins.includes('sveltekit()')) {
118
- // Add rime() after sveltekit()
119
- return plugins.includes('sveltekit()')
120
- ? match.replace('sveltekit()', 'sveltekit(), rime()')
121
- : `plugins: [${plugins}, rime()]`;
122
- }
123
- else {
124
- // If sveltekit() isn't found, add rime() at the end
125
- return `plugins: [${plugins}, rime()]`;
126
- }
127
- });
128
- writeFileSync(configPath, updatedContent);
129
- logger.info('[✓] Vite plugin added');
114
+ let content = fs.readFileSync(configPath, 'utf-8');
115
+ content = content.replace("from '@sveltejs/adapter-auto'", "from '@sveltejs/adapter-node'");
116
+ const program = babelParse(content, configPath); // t.Program
117
+ const programBody = program.body;
118
+ const configObject = findSvelteConfigObject(programBody);
119
+ if (!configObject) {
120
+ throw new Error("Couldn't find the Vite config object (defineConfig({...}) or export default {...})");
121
+ }
122
+ const pluginsProp = configObject.properties.find((p) => t.isObjectProperty(p) && t.isIdentifier(p.key) && p.key.name === 'plugins');
123
+ if (!pluginsProp || !t.isArrayExpression(pluginsProp.value)) {
124
+ throw new Error("Couldn't find a `plugins: [...]` array in the Vite config object");
125
+ }
126
+ const pluginsArray = pluginsProp.value;
127
+ const alreadyPresent = pluginsArray.elements.some((el) => t.isCallExpression(el) && t.isIdentifier(el.callee) && el.callee.name === 'rime');
128
+ if (alreadyPresent) {
129
+ logger.info('[✓] Vite plugin already present (skip)');
130
+ return;
131
+ }
132
+ const hasImport = programBody.some((node) => t.isImportDeclaration(node) &&
133
+ node.source.value === `${PACKAGE}/vite` &&
134
+ node.specifiers.some((s) => t.isImportSpecifier(s) && t.isIdentifier(s.imported) && s.imported.name === 'rime'));
135
+ if (!hasImport) {
136
+ const importDecl = t.importDeclaration([t.importSpecifier(t.identifier('rime'), t.identifier('rime'))], t.stringLiteral(`${PACKAGE}/vite`));
137
+ programBody.unshift(importDecl);
138
+ }
139
+ const rimeCall = t.callExpression(t.identifier('rime'), []);
140
+ const sveltekitIndex = pluginsArray.elements.findIndex((el) => t.isCallExpression(el) && t.isIdentifier(el.callee) && el.callee.name === 'sveltekit');
141
+ if (sveltekitIndex !== -1) {
142
+ pluginsArray.elements.splice(sveltekitIndex + 1, 0, rimeCall);
130
143
  }
131
144
  else {
132
- logger.info('[✓] Vite plugin already present (skip)');
145
+ pluginsArray.elements.push(rimeCall);
146
+ }
147
+ const file = t.file(program);
148
+ const { code } = generateCode(file, {}, content);
149
+ fs.writeFileSync(configPath, code);
150
+ logger.info('[✓] Vite plugin added');
151
+ }
152
+ function findSvelteConfigObject(body) {
153
+ for (const node of body) {
154
+ if (t.isExpressionStatement(node) &&
155
+ t.isCallExpression(node.expression) &&
156
+ t.isIdentifier(node.expression.callee) &&
157
+ node.expression.callee.name === 'defineConfig') {
158
+ const arg = node.expression.arguments[0];
159
+ if (t.isObjectExpression(arg))
160
+ return arg;
161
+ }
162
+ if (t.isExportDefaultDeclaration(node)) {
163
+ const decl = node.declaration;
164
+ if (t.isCallExpression(decl) &&
165
+ t.isIdentifier(decl.callee) &&
166
+ decl.callee.name === 'defineConfig') {
167
+ const arg = decl.arguments[0];
168
+ if (t.isObjectExpression(arg))
169
+ return arg;
170
+ }
171
+ if (t.isObjectExpression(decl)) {
172
+ return decl;
173
+ }
174
+ }
133
175
  }
176
+ return null;
134
177
  }
135
178
  function setHooks() {
136
179
  const hooksPath = path.join(root, 'src', 'hooks.server.ts');
@@ -11,23 +11,23 @@ const packageManagersMap = {
11
11
  };
12
12
  const packageManagerConfigs = {
13
13
  yarn: {
14
- command: 'yarn add -D drizzle-kit'
14
+ command: 'echo "yarn is not supported, please use pnpm or npm" && exit 1'
15
15
  },
16
16
  pnpm: {
17
- command: 'pnpm add -D drizzle-kit && pnpm add drizzle-orm @lucide/svelte sharp',
17
+ command: 'pnpm add -D drizzle-kit && pnpm add -D @sveltejs/adapter-node && pnpm add drizzle-orm @lucide/svelte sharp',
18
18
  preInstall: updatePackageJsonForPnpm,
19
19
  postInstall: () => {
20
20
  execSync('pnpm rebuild');
21
21
  }
22
22
  },
23
23
  bun: {
24
- command: 'bun add -D drizzle-kit'
24
+ command: 'bun add -D drizzle-kit && bun add -D @sveltejs/adapter-node && bun add drizzle-orm @lucide/svelte sharp'
25
25
  },
26
26
  npm: {
27
- command: 'npm install -D drizzle-kit'
27
+ command: 'npm install -D drizzle-kit && npm install -D @sveltejs/adapter-node && npm install drizzle-orm @lucide/svelte sharp'
28
28
  },
29
29
  deno: {
30
- command: 'deno install -D npm:drizzle-kit && deno install --allow-scripts=npm:sharp'
30
+ command: 'echo "deno is not supported, please use pnpm or npm" && exit 1'
31
31
  }
32
32
  };
33
33
  export function getPackageManager() {
@@ -1,4 +1,4 @@
1
- import { type Routes } from './util.js';
1
+ import { type Routes } from './util.server.js';
2
2
  /**
3
3
  * Area routes dictionary defining route patterns and their corresponding templates
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { PACKAGE_NAME } from '../../../constant.server.js';
2
- import { TScastVersionSlug } from './util.js';
2
+ import { TScastVersionSlug } from './util.server.js';
3
3
  /**
4
4
  * Area templates defined outside of the routes object
5
5
  * (rime)/panel/{area.kebab}/+page.svelte
@@ -1,4 +1,4 @@
1
- import { type Routes } from './util.js';
1
+ import { type Routes } from './util.server.js';
2
2
  /****************************************************/
3
3
  /**
4
4
  * Collection panel routes
@@ -1,5 +1,5 @@
1
1
  import { PACKAGE_NAME } from '../../../constant.server.js';
2
- import { TScastVersionSlug } from './util.js';
2
+ import { TScastVersionSlug } from './util.server.js';
3
3
  /**
4
4
  * Layout server template for collection
5
5
  * (rime)/panel/{collection.kebab}/+page.server.ts
@@ -1,4 +1,4 @@
1
- import type { Routes } from './util.js';
1
+ import type { Routes } from './util.server.js';
2
2
  /**
3
3
  * Custom route template generator
4
4
  * Used for generating custom routes
@@ -198,7 +198,7 @@ const livePage = () => `
198
198
  <script lang="ts">
199
199
  import { Live } from '${PACKAGE_NAME}/panel/client';
200
200
 
201
- import config from '../../../lib/${OUTPUT_DIR}/rime.config.js';
201
+ import config from '../../../../lib/${OUTPUT_DIR}/rime.config.js';
202
202
 
203
203
  const { data } = $props();
204
204
  </script>
@@ -273,8 +273,8 @@ export const commonRoutes = {
273
273
  page: panelPage,
274
274
  pageServer: panelPageServer
275
275
  },
276
- '(rime)/live': {
277
- page: livePage,
276
+ '(rime)/panel/live-edit': {
277
+ 'page@(rime)': livePage,
278
278
  pageServer: livePageServer
279
279
  }
280
280
  };
@@ -2,11 +2,11 @@ import { logger } from '../../../logger/index.server.js';
2
2
  import { withDirectoriesSuffix, withVersionsSuffix } from '../../../naming.js';
3
3
  import fs from 'fs';
4
4
  import path from 'path';
5
- import { areaAPIRoutes, areaRoutes, areaVersionsPanelRoutes } from './area.js';
6
- import { collectionAPIRoutes, collectionPanelRoutes, collectionVersionsPanelRoutes } from './collection.js';
7
- import { commonRoutes, customRoute } from './common.js';
8
- import { injectCustomCSS, removeCustomCSS } from './custom-css.js';
9
- import { ensureDir, shouldRegenerateRoutes, writeRouteFile } from './util.js';
5
+ import { areaAPIRoutes, areaRoutes, areaVersionsPanelRoutes } from './area.server.js';
6
+ import { collectionAPIRoutes, collectionPanelRoutes, collectionVersionsPanelRoutes } from './collection.server.js';
7
+ import { commonRoutes, customRoute } from './common.server.js';
8
+ import { injectCustomCSS, removeCustomCSS } from './custom-css.server.js';
9
+ import { ensureDir, shouldRegenerateRoutes, writeRouteFile } from './util.server.js';
10
10
  const projectRoot = process.cwd();
11
11
  /**
12
12
  * Main function to generate browser routes based on configuration
@@ -1,4 +1,4 @@
1
- import cache from '../../cache/index.js';
1
+ import cache from '../../cache/index.server.js';
2
2
  import { hasDirectoriesSuffix, hasVersionsSuffix } from '../../../naming.js';
3
3
  import { slugify } from '../../../../util/string.js';
4
4
  import fs from 'fs';
@@ -1,6 +1,6 @@
1
1
  import { isUploadConfig } from '../../../collections/upload/util/config.js';
2
2
  import { PACKAGE_NAME } from '../../../constant.server.js';
3
- import cache from '../../cache/index.js';
3
+ import cache from '../../cache/index.server.js';
4
4
  import { FormFieldBuilder } from '../../../fields/builders/form-field-builder.js';
5
5
  import { logger } from '../../../logger/index.server.js';
6
6
  import { withVersionsSuffix } from '../../../naming.js';
@@ -4,7 +4,7 @@ import path from 'node:path';
4
4
  import { ensureHasInit } from '../../ensure.server.js';
5
5
  import { logger } from '../../logger/index.server.js';
6
6
  import { INPUT_DIR, OUTPUT_DIR } from '../constants.js';
7
- import { sanitize } from '../generate/sanitize/index.js';
7
+ import { sanitize } from '../generate/sanitize/index.server.js';
8
8
  dotenv.config({ override: true });
9
9
  const dev = process.env.NODE_ENV === 'development';
10
10
  export function rime() {
@@ -1,5 +1,6 @@
1
1
  import type { Field, FormField, SeparatorField } from '../../fields/types.js';
2
2
  import type { Dic } from '../../util/types.js';
3
+ import type { FieldBuilder } from './builders';
3
4
  /**
4
5
  * Checks if a field is a presentative field (currently only separator fields).
5
6
  * Presentative fields are used for UI organization and don't store data.
@@ -65,3 +66,15 @@ export declare function pathToRegex(path: string): RegExp;
65
66
  *
66
67
  */
67
68
  export declare const getFieldConfigByPath: (path: string, fields: Field[]) => FormField | undefined;
69
+ /**
70
+ * Traverses a FieldBuilder[] tree and returns the subset of builders to pass to
71
+ * RenderFields, along with the path prefix those builders should be rendered at.
72
+ *
73
+ * Containers (tabs, groups) are treated as transparent navigation layers.
74
+ * Blocks are treated as endpoints — the blocks builder itself is returned
75
+ * regardless of any index:blockType suffix in the path.
76
+ */
77
+ export declare function getFieldBuildersAtPath(fieldPath: string, builders: FieldBuilder[], parentPath?: string): {
78
+ fields: FieldBuilder[];
79
+ path: string;
80
+ };
@@ -1,7 +1,8 @@
1
- import { isBlocksFieldRaw } from '../../fields/blocks/index.js';
2
- import { isGroupFieldRaw } from '../../fields/group/index.js';
3
- import { isTabsFieldRaw } from '../../fields/tabs/index.js';
4
- import { isTreeFieldRaw } from '../../fields/tree/index.js';
1
+ import { BlocksBuilder, isBlocksFieldRaw } from '../../fields/blocks/index.js';
2
+ import { GroupFieldBuilder, isGroupFieldRaw } from '../../fields/group/index.js';
3
+ import { isTabsFieldRaw, TabsBuilder } from '../../fields/tabs/index.js';
4
+ import { isTreeFieldRaw, TreeBuilder } from '../../fields/tree/index.js';
5
+ import { normalizeFieldPath } from '../../util/doc.js';
5
6
  /**
6
7
  * Checks if a field is a presentative field (currently only separator fields).
7
8
  * Presentative fields are used for UI organization and don't store data.
@@ -168,3 +169,75 @@ export const getFieldConfigByPath = (path, fields) => {
168
169
  };
169
170
  return findInFields(fields, parts);
170
171
  };
172
+ /**
173
+ * Traverses a FieldBuilder[] tree and returns the subset of builders to pass to
174
+ * RenderFields, along with the path prefix those builders should be rendered at.
175
+ *
176
+ * Containers (tabs, groups) are treated as transparent navigation layers.
177
+ * Blocks are treated as endpoints — the blocks builder itself is returned
178
+ * regardless of any index:blockType suffix in the path.
179
+ */
180
+ export function getFieldBuildersAtPath(fieldPath, builders, parentPath = '') {
181
+ if (!fieldPath)
182
+ return { fields: builders, path: parentPath };
183
+ const dotIndex = fieldPath.indexOf('.');
184
+ const head = dotIndex === -1 ? fieldPath : fieldPath.slice(0, dotIndex);
185
+ const tail = dotIndex === -1 ? '' : fieldPath.slice(dotIndex + 1);
186
+ const isEndpoint = fieldPath.split('.').length === 1;
187
+ const nextParentPath = normalizeFieldPath(`${parentPath}${parentPath ? '.' : ''}${head}`);
188
+ for (const builder of builders) {
189
+ // ── Tabs container: navigate into the matching tab
190
+ if (builder instanceof TabsBuilder) {
191
+ const tab = builder.field.tabs.find((t) => t.name === head);
192
+ if (!tab)
193
+ continue;
194
+ if (isEndpoint) {
195
+ // Path targets the tab → return all its inner fields
196
+ return { fields: tab.raw.fields, path: nextParentPath };
197
+ }
198
+ return getFieldBuildersAtPath(tail, tab.raw.fields, nextParentPath);
199
+ }
200
+ if (!isFormField(builder.raw))
201
+ continue;
202
+ // ── Group field: navigate into children
203
+ if (builder instanceof GroupFieldBuilder && builder.raw.name === head) {
204
+ const children = builder.field.fields;
205
+ if (isEndpoint)
206
+ return { fields: children, path: nextParentPath };
207
+ return getFieldBuildersAtPath(tail, children, nextParentPath);
208
+ }
209
+ // —— Blocks
210
+ if (builder instanceof BlocksBuilder && builder.raw.name === head) {
211
+ const blockType = tail.split('.')[0]?.split(':')[1];
212
+ const isInnerBlockLookup = tail.split('.').length > 1;
213
+ const nextParentPathWithBlockIndex = `${nextParentPath}.${tail.split('.')[0]}`;
214
+ if (blockType) {
215
+ const block = builder.raw.blocks.find((b) => b.name === blockType);
216
+ if (!isInnerBlockLookup && block?.raw.fields) {
217
+ return {
218
+ fields: block?.raw.fields,
219
+ path: normalizeFieldPath(nextParentPathWithBlockIndex)
220
+ };
221
+ }
222
+ if (block) {
223
+ return getFieldBuildersAtPath(tail.split('.').slice(1).join('.'), block?.raw.fields, normalizeFieldPath(nextParentPathWithBlockIndex));
224
+ }
225
+ }
226
+ return { fields: [builder], path: parentPath };
227
+ }
228
+ // Tree
229
+ if (builder instanceof TreeBuilder && builder.raw.name === head) {
230
+ const children = builder.raw.fields;
231
+ const nextParentPathWithIndex = `${nextParentPath}.${tail.split('.')[0]}`;
232
+ if (isEndpoint)
233
+ return { fields: children, path: nextParentPath };
234
+ return getFieldBuildersAtPath(tail.split('.').slice(1).join('.'), children, nextParentPathWithIndex);
235
+ }
236
+ // Direct unique field match
237
+ if (isEndpoint && isFormField(builder.raw) && builder.raw.name === fieldPath) {
238
+ return { fields: [builder], path: parentPath };
239
+ }
240
+ }
241
+ console.warn(`[LiveEditPanel] fieldPath "${fieldPath}" not found in config fields`);
242
+ return { fields: builders, path: parentPath };
243
+ }
@@ -58,6 +58,7 @@ declare namespace _default {
58
58
  export let unsaved_dialog_text: string;
59
59
  export let version_created: string;
60
60
  export let versions_history: string;
61
+ export let view_all: string;
61
62
  export let view_page: string;
62
63
  export let view_site: string;
63
64
  export let welcome: string;
@@ -58,6 +58,7 @@ export default {
58
58
  unsaved_dialog_text: 'There are unsaved modifications in the document.',
59
59
  version_created: 'New version created',
60
60
  versions_history: 'Versions history',
61
+ view_all: 'View all',
61
62
  view_page: 'View page',
62
63
  view_site: 'View website',
63
64
  welcome: 'Welcome'