@contember/create 2.1.0-alpha.1 → 2.1.0-alpha.10

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 (282) hide show
  1. package/dist/development/src/commands/WorkspaceCreateCommand.cjs +37 -23
  2. package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  3. package/dist/development/src/commands/WorkspaceCreateCommand.js +37 -23
  4. package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
  5. package/dist/development/src/lib/FileSystem.cjs +1 -0
  6. package/dist/development/src/lib/FileSystem.cjs.map +1 -1
  7. package/dist/development/src/lib/FileSystem.js +1 -0
  8. package/dist/development/src/lib/FileSystem.js.map +1 -1
  9. package/dist/development/src/lib/TemplateInstaller.cjs +24 -5
  10. package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
  11. package/dist/development/src/lib/TemplateInstaller.js +24 -5
  12. package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
  13. package/dist/development/src/lib/packageManagerDetector.cjs +22 -0
  14. package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -0
  15. package/dist/development/src/lib/packageManagerDetector.js +22 -0
  16. package/dist/development/src/lib/packageManagerDetector.js.map +1 -0
  17. package/dist/production/src/commands/WorkspaceCreateCommand.cjs +37 -23
  18. package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
  19. package/dist/production/src/commands/WorkspaceCreateCommand.js +37 -23
  20. package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
  21. package/dist/production/src/lib/FileSystem.cjs +1 -0
  22. package/dist/production/src/lib/FileSystem.cjs.map +1 -1
  23. package/dist/production/src/lib/FileSystem.js +1 -0
  24. package/dist/production/src/lib/FileSystem.js.map +1 -1
  25. package/dist/production/src/lib/TemplateInstaller.cjs +24 -5
  26. package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
  27. package/dist/production/src/lib/TemplateInstaller.js +24 -5
  28. package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
  29. package/dist/production/src/lib/packageManagerDetector.cjs +22 -0
  30. package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -0
  31. package/dist/production/src/lib/packageManagerDetector.js +22 -0
  32. package/dist/production/src/lib/packageManagerDetector.js.map +1 -0
  33. package/dist/types/commands/WorkspaceCreateCommand.d.ts +4 -2
  34. package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
  35. package/dist/types/lib/FileSystem.d.ts +1 -0
  36. package/dist/types/lib/FileSystem.d.ts.map +1 -1
  37. package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
  38. package/dist/types/lib/packageManagerDetector.d.ts +3 -0
  39. package/dist/types/lib/packageManagerDetector.d.ts.map +1 -0
  40. package/dist/types/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +7 -3
  42. package/resources/templates/default/.gitignore.dist +154 -0
  43. package/resources/templates/default/README.md +98 -0
  44. package/resources/templates/{template-workspace → default}/admin/.env.development +1 -0
  45. package/resources/templates/{template-workspace → default}/admin/app/components/layout.tsx +7 -3
  46. package/resources/templates/default/admin/app/components/navigation.tsx +85 -0
  47. package/resources/templates/{template-workspace → default}/admin/app/index.tsx +4 -4
  48. package/resources/templates/default/admin/app/pages/tenant.tsx +160 -0
  49. package/resources/templates/default/admin/entrypoint/components/layout.tsx +14 -0
  50. package/resources/templates/default/admin/entrypoint/components/logged-in.tsx +47 -0
  51. package/resources/templates/default/admin/entrypoint/components/login.tsx +103 -0
  52. package/resources/templates/default/admin/entrypoint/config.ts +35 -0
  53. package/resources/templates/default/admin/entrypoint/contexts/login.tsx +18 -0
  54. package/resources/templates/default/admin/entrypoint/index.tsx +12 -0
  55. package/resources/templates/default/admin/entrypoint/login-entrypoint.tsx +24 -0
  56. package/resources/templates/default/admin/entrypoint/pages/index.tsx +48 -0
  57. package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +56 -0
  58. package/resources/templates/default/admin/entrypoint/pages/magicLintSent.tsx +63 -0
  59. package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +44 -0
  60. package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +35 -0
  61. package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +34 -0
  62. package/resources/templates/default/admin/index.css +94 -0
  63. package/resources/templates/{template-workspace → default}/admin/index.html +1 -1
  64. package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/block-repeater.tsx +4 -4
  65. package/resources/templates/{template-workspace → default}/admin/lib/board/board.tsx +3 -3
  66. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx +1 -1
  67. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +8 -8
  68. package/resources/templates/default/admin/lib/datagrid/elements.tsx +59 -0
  69. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/empty.tsx +1 -1
  70. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx +4 -4
  71. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx +1 -1
  72. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx +1 -1
  73. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/table.tsx +1 -1
  74. package/resources/templates/{template-workspace → default}/admin/lib/datagrid/ui.tsx +4 -4
  75. package/resources/templates/{template-workspace → default}/admin/lib/dimensions/dimensions.tsx +2 -2
  76. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-block-toolbar.tsx +1 -1
  77. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-canvas.tsx +2 -2
  78. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-inline-toolbar.tsx +1 -1
  79. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/BlockElement.tsx +2 -2
  80. package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +1 -1
  81. package/resources/templates/{template-workspace → default}/admin/lib/editor/editor-block.tsx +1 -1
  82. package/resources/templates/{template-workspace → default}/admin/lib/editor/sortable-block.tsx +1 -1
  83. package/resources/templates/{template-workspace → default}/admin/lib/form/container.tsx +2 -1
  84. package/resources/templates/{template-workspace → default}/admin/lib/form/inputs.tsx +2 -2
  85. package/resources/templates/{template-workspace → default}/admin/lib/layout/layout-boxed.tsx +4 -4
  86. package/resources/templates/{template-workspace → default}/admin/lib/repeater/repeater.tsx +3 -3
  87. package/resources/templates/{template-workspace → default}/admin/lib/select/ui.tsx +5 -5
  88. package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/common.tsx +1 -1
  89. package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/memberships-control.tsx +1 -1
  90. package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/otp-setup.tsx +1 -1
  91. package/resources/templates/{template-workspace → default}/admin/lib/toast/toast.tsx +4 -5
  92. package/resources/templates/{template-workspace → default}/admin/lib/ui/button.tsx +6 -6
  93. package/resources/templates/{template-workspace → default}/admin/lib/ui/card.tsx +1 -1
  94. package/resources/templates/{template-workspace → default}/admin/lib/ui/dialog.tsx +2 -2
  95. package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +6 -6
  96. package/resources/templates/{template-workspace → default}/admin/lib/ui/input.tsx +11 -11
  97. package/resources/templates/{template-workspace → default}/admin/lib/ui/overlay.tsx +1 -1
  98. package/resources/templates/{template-workspace → default}/admin/lib/ui/popover.tsx +1 -1
  99. package/resources/templates/{template-workspace → default}/admin/lib/ui/property-list.tsx +3 -3
  100. package/resources/templates/{template-workspace → default}/admin/lib/ui/select.tsx +4 -3
  101. package/resources/templates/{template-workspace → default}/admin/lib/ui/sheet.tsx +4 -4
  102. package/resources/templates/{template-workspace → default}/admin/lib/ui/sidebar.tsx +15 -16
  103. package/resources/templates/{template-workspace → default}/admin/lib/ui/sortable.tsx +1 -1
  104. package/resources/templates/{template-workspace → default}/admin/lib/ui/switch.tsx +1 -1
  105. package/resources/templates/{template-workspace → default}/admin/lib/ui/table.tsx +3 -3
  106. package/resources/templates/{template-workspace → default}/admin/lib/ui/textarea.tsx +3 -3
  107. package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle.tsx +2 -3
  108. package/resources/templates/{template-workspace → default}/admin/lib/ui/tooltip.tsx +2 -2
  109. package/resources/templates/{template-workspace → default}/admin/lib/upload/ui.tsx +4 -4
  110. package/resources/templates/{template-workspace → default}/admin/lib/upload/upload-progress.tsx +1 -1
  111. package/resources/templates/{template-workspace → default}/admin/lib/upload/view.tsx +3 -3
  112. package/resources/templates/{template-workspace → default}/admin/lib/utils/uic.tsx +30 -23
  113. package/resources/templates/{template-workspace → default}/admin/package.json +6 -3
  114. package/resources/templates/default/admin/postcss.config.js +5 -0
  115. package/resources/templates/default/admin/sentry.ts +26 -0
  116. package/resources/templates/{template-workspace → default}/admin/tsconfig.json +1 -9
  117. package/resources/templates/default/admin/vite-env.d.ts +12 -0
  118. package/resources/templates/default/admin/vite.config.ts +11 -0
  119. package/resources/templates/default/api/README.md +87 -0
  120. package/resources/templates/{template-workspace → default}/biome.json +1 -1
  121. package/resources/templates/default/client/README.md +285 -0
  122. package/resources/templates/{template-workspace → default}/contember.template.yaml +5 -0
  123. package/resources/templates/{template-workspace → default}/package.json +2 -2
  124. package/resources/templates/default/scripts/generate-client.sh +7 -0
  125. package/resources/templates/default/scripts/update-ui-lib.sh +344 -0
  126. package/src/commands/WorkspaceCreateCommand.ts +41 -24
  127. package/src/lib/FileSystem.ts +1 -0
  128. package/src/lib/TemplateInstaller.ts +30 -7
  129. package/src/lib/packageManagerDetector.ts +24 -0
  130. package/resources/templates/template-workspace/.gitignore.dist +0 -3
  131. package/resources/templates/template-workspace/admin/app/components/navigation.tsx +0 -1
  132. package/resources/templates/template-workspace/admin/index.css +0 -53
  133. package/resources/templates/template-workspace/admin/index.tsx +0 -268
  134. package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +0 -48
  135. package/resources/templates/template-workspace/admin/postcss.config.js +0 -6
  136. package/resources/templates/template-workspace/admin/tailwind.config.js +0 -73
  137. package/resources/templates/template-workspace/admin/vite-env.d.ts +0 -7
  138. package/resources/templates/template-workspace/scripts/generate-client.sh +0 -8
  139. /package/resources/templates/{template-workspace → default}/.github/scripts/setup-actions-variables.sh +0 -0
  140. /package/resources/templates/{template-workspace → default}/.github/workflows/deploy.yaml +0 -0
  141. /package/resources/templates/{template-workspace → default}/admin/app/components/logo.tsx +0 -0
  142. /package/resources/templates/{template-workspace → default}/admin/app/config.ts +0 -0
  143. /package/resources/templates/{template-workspace → default}/admin/app/index.html +0 -0
  144. /package/resources/templates/{template-workspace → default}/admin/app/pages/index.tsx +0 -0
  145. /package/resources/templates/{template-workspace → default}/admin/lib/binding/binding.tsx +0 -0
  146. /package/resources/templates/{template-workspace → default}/admin/lib/binding/delete.tsx +0 -0
  147. /package/resources/templates/{template-workspace → default}/admin/lib/binding/hooks.tsx +0 -0
  148. /package/resources/templates/{template-workspace → default}/admin/lib/binding/identity.tsx +0 -0
  149. /package/resources/templates/{template-workspace → default}/admin/lib/binding/index.ts +0 -0
  150. /package/resources/templates/{template-workspace → default}/admin/lib/binding/navigation-guard-dialog.tsx +0 -0
  151. /package/resources/templates/{template-workspace → default}/admin/lib/binding/persist.tsx +0 -0
  152. /package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/index.ts +0 -0
  153. /package/resources/templates/{template-workspace → default}/admin/lib/board/index.ts +0 -0
  154. /package/resources/templates/{template-workspace → default}/admin/lib/buttons/back-button.tsx +0 -0
  155. /package/resources/templates/{template-workspace → default}/admin/lib/buttons/index.ts +0 -0
  156. /package/resources/templates/{template-workspace → default}/admin/lib/buttons/link-back-button.tsx +0 -0
  157. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/cells.tsx +0 -0
  158. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-leaf.tsx +0 -0
  159. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/export.tsx +0 -0
  160. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/boolean.tsx +0 -0
  161. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx +0 -0
  162. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/defined.tsx +0 -0
  163. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx +0 -0
  164. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/index.ts +0 -0
  165. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/mobile.tsx +0 -0
  166. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx +0 -0
  167. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/text.tsx +0 -0
  168. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/grid.tsx +0 -0
  169. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/index.ts +0 -0
  170. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/labels.tsx +0 -0
  171. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/layout-switcher.tsx +0 -0
  172. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/loader.tsx +0 -0
  173. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/tiles.tsx +0 -0
  174. /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/toolbar.tsx +0 -0
  175. /package/resources/templates/{template-workspace → default}/admin/lib/dev/index.ts +0 -0
  176. /package/resources/templates/{template-workspace → default}/admin/lib/dev/login-panel.tsx +0 -0
  177. /package/resources/templates/{template-workspace → default}/admin/lib/dev/todo.tsx +0 -0
  178. /package/resources/templates/{template-workspace → default}/admin/lib/dict.ts +0 -0
  179. /package/resources/templates/{template-workspace → default}/admin/lib/dimensions/index.ts +0 -0
  180. /package/resources/templates/{template-workspace → default}/admin/lib/editor/block-editor.tsx +0 -0
  181. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/baseEditorPlugins.tsx +0 -0
  182. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/buttons.tsx +0 -0
  183. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-editable-canvas.tsx +0 -0
  184. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/AnchorRenderer.tsx +0 -0
  185. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HeadingRenderer.tsx +0 -0
  186. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +0 -0
  187. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ListItemRenderer.tsx +0 -0
  188. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/OrderedListRenderer.tsx +0 -0
  189. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ParagraphRenderer.tsx +0 -0
  190. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ScrollTargetRenderer.tsx +0 -0
  191. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableElementRenderer.tsx +0 -0
  192. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +0 -0
  193. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +0 -0
  194. /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/index.ts +0 -0
  195. /package/resources/templates/{template-workspace → default}/admin/lib/editor/index.ts +0 -0
  196. /package/resources/templates/{template-workspace → default}/admin/lib/editor/plugins.tsx +0 -0
  197. /package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text-view.tsx +0 -0
  198. /package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text.tsx +0 -0
  199. /package/resources/templates/{template-workspace → default}/admin/lib/errors/error-boundary.tsx +0 -0
  200. /package/resources/templates/{template-workspace → default}/admin/lib/errors/index.ts +0 -0
  201. /package/resources/templates/{template-workspace → default}/admin/lib/errors/use-error-formatter.ts +0 -0
  202. /package/resources/templates/{template-workspace → default}/admin/lib/field/formatted-field.tsx +0 -0
  203. /package/resources/templates/{template-workspace → default}/admin/lib/field/index.ts +0 -0
  204. /package/resources/templates/{template-workspace → default}/admin/lib/form/index.ts +0 -0
  205. /package/resources/templates/{template-workspace → default}/admin/lib/form/labels.tsx +0 -0
  206. /package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +0 -0
  207. /package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +0 -0
  208. /package/resources/templates/{template-workspace → default}/admin/lib/form/upload-repeaters.tsx +0 -0
  209. /package/resources/templates/{template-workspace → default}/admin/lib/form/upload.tsx +0 -0
  210. /package/resources/templates/{template-workspace → default}/admin/lib/formatting/formatting.ts +0 -0
  211. /package/resources/templates/{template-workspace → default}/admin/lib/formatting/index.ts +0 -0
  212. /package/resources/templates/{template-workspace → default}/admin/lib/images/formatImageResizeUrl.ts +0 -0
  213. /package/resources/templates/{template-workspace → default}/admin/lib/images/index.ts +0 -0
  214. /package/resources/templates/{template-workspace → default}/admin/lib/labels/enum-labels.ts +0 -0
  215. /package/resources/templates/{template-workspace → default}/admin/lib/labels/field-labels.ts +0 -0
  216. /package/resources/templates/{template-workspace → default}/admin/lib/labels/index.ts +0 -0
  217. /package/resources/templates/{template-workspace → default}/admin/lib/layout/index.ts +0 -0
  218. /package/resources/templates/{template-workspace → default}/admin/lib/layout/layout.tsx +0 -0
  219. /package/resources/templates/{template-workspace → default}/admin/lib/layout/slots.tsx +0 -0
  220. /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/index.ts +0 -0
  221. /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +0 -0
  222. /package/resources/templates/{template-workspace → default}/admin/lib/repeater/index.ts +0 -0
  223. /package/resources/templates/{template-workspace → default}/admin/lib/select/create-new.tsx +0 -0
  224. /package/resources/templates/{template-workspace → default}/admin/lib/select/filter.tsx +0 -0
  225. /package/resources/templates/{template-workspace → default}/admin/lib/select/highlight.tsx +0 -0
  226. /package/resources/templates/{template-workspace → default}/admin/lib/select/index.ts +0 -0
  227. /package/resources/templates/{template-workspace → default}/admin/lib/select/list.tsx +0 -0
  228. /package/resources/templates/{template-workspace → default}/admin/lib/select/multi-select.tsx +0 -0
  229. /package/resources/templates/{template-workspace → default}/admin/lib/select/select.tsx +0 -0
  230. /package/resources/templates/{template-workspace → default}/admin/lib/select/sortable-select.tsx +0 -0
  231. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/change-my-password.tsx +0 -0
  232. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/create-api-key.tsx +0 -0
  233. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/index.ts +0 -0
  234. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/invite.tsx +0 -0
  235. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/login.tsx +0 -0
  236. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset-request.tsx +0 -0
  237. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset.tsx +0 -0
  238. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin-init.tsx +0 -0
  239. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin.tsx +0 -0
  240. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/update-project-member.tsx +0 -0
  241. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInvite.ts +0 -0
  242. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInviteUser.tsx +0 -0
  243. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/index.ts +0 -0
  244. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/api-key-list.tsx +0 -0
  245. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/index.ts +0 -0
  246. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-delete-dialog.tsx +0 -0
  247. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-list.tsx +0 -0
  248. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/person-list.tsx +0 -0
  249. /package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/index.ts +0 -0
  250. /package/resources/templates/{template-workspace → default}/admin/lib/toast/index.ts +0 -0
  251. /package/resources/templates/{template-workspace → default}/admin/lib/toast/toaster.tsx +0 -0
  252. /package/resources/templates/{template-workspace → default}/admin/lib/ui/alert-dialog.tsx +0 -0
  253. /package/resources/templates/{template-workspace → default}/admin/lib/ui/avatar.tsx +0 -0
  254. /package/resources/templates/{template-workspace → default}/admin/lib/ui/collapsible.tsx +0 -0
  255. /package/resources/templates/{template-workspace → default}/admin/lib/ui/divider.tsx +0 -0
  256. /package/resources/templates/{template-workspace → default}/admin/lib/ui/label.tsx +0 -0
  257. /package/resources/templates/{template-workspace → default}/admin/lib/ui/loader.tsx +0 -0
  258. /package/resources/templates/{template-workspace → default}/admin/lib/ui/menu.tsx +0 -0
  259. /package/resources/templates/{template-workspace → default}/admin/lib/ui/progress.tsx +0 -0
  260. /package/resources/templates/{template-workspace → default}/admin/lib/ui/scroll-area.tsx +0 -0
  261. /package/resources/templates/{template-workspace → default}/admin/lib/ui/separator.tsx +0 -0
  262. /package/resources/templates/{template-workspace → default}/admin/lib/ui/skeleton.tsx +0 -0
  263. /package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle-group.tsx +0 -0
  264. /package/resources/templates/{template-workspace → default}/admin/lib/upload/dropzone.tsx +0 -0
  265. /package/resources/templates/{template-workspace → default}/admin/lib/upload/index.ts +0 -0
  266. /package/resources/templates/{template-workspace → default}/admin/lib/upload/repeater.tsx +0 -0
  267. /package/resources/templates/{template-workspace → default}/admin/lib/utils/cn.ts +0 -0
  268. /package/resources/templates/{template-workspace → default}/admin/lib/utils/createComponentOpenHooks.tsx +0 -0
  269. /package/resources/templates/{template-workspace → default}/admin/lib/utils/index.ts +0 -0
  270. /package/resources/templates/{template-workspace → default}/admin/lib/utils/use-mobile.ts +0 -0
  271. /package/resources/templates/{template-workspace → default}/admin/public/favicon.png +0 -0
  272. /package/resources/templates/{template-workspace → default}/api/index.ts +0 -0
  273. /package/resources/templates/{template-workspace → default}/api/migrations/.gitkeep +0 -0
  274. /package/resources/templates/{template-workspace → default}/api/model/index.ts +0 -0
  275. /package/resources/templates/{template-workspace → default}/api/package.json +0 -0
  276. /package/resources/templates/{template-workspace → default}/api/tsconfig.json +0 -0
  277. /package/resources/templates/{template-workspace → default}/client/package.json +0 -0
  278. /package/resources/templates/{template-workspace → default}/client/src/index.ts +0 -0
  279. /package/resources/templates/{template-workspace → default}/client/tsconfig.json +0 -0
  280. /package/resources/templates/{template-workspace → default}/docker-compose.yaml +0 -0
  281. /package/resources/templates/{template-workspace → default}/tsconfig.json +0 -0
  282. /package/resources/templates/{template-workspace → default}/tsconfig.settings.json +0 -0
@@ -3,12 +3,14 @@ import { join } from 'node:path'
3
3
  import chalk from 'chalk'
4
4
  import { TemplateInstaller } from '../lib/TemplateInstaller'
5
5
  import { getPackageVersion } from '../lib/version'
6
+ import { detectPackageManager } from '../lib/packageManagerDetector'
6
7
 
7
8
  type Args = {
8
- workspaceName: string
9
+ projectName: string
9
10
  }
10
11
 
11
12
  type Options = {
13
+ template: string
12
14
  }
13
15
 
14
16
  export class WorkspaceCreateCommand extends Command<Args, Options> {
@@ -19,42 +21,57 @@ export class WorkspaceCreateCommand extends Command<Args, Options> {
19
21
  }
20
22
 
21
23
  protected configure(configuration: CommandConfiguration<Args, Options>): void {
22
- configuration.description('Creates a new Contember workspace')
23
- configuration.argument('workspaceName')
24
+ configuration.description('Creates a new Contember project')
25
+ configuration.argument('projectName')
26
+ configuration.option('template').shortcut('t').valueRequired().description('Template name or remote source')
24
27
  }
25
28
 
26
29
  protected async execute(input: Input<Args, Options>): Promise<void> {
27
- const workspaceName = input.getArgument('workspaceName')
28
- const workspaceDirectory = join(process.cwd(), workspaceName)
29
- await this.templateInstaller.installTemplate('@contember/template-workspace', workspaceDirectory, {
30
+ const projectName = input.getArgument('projectName')
31
+ const projectDirectory = join(process.cwd(), projectName)
32
+ const packageManager = detectPackageManager()
33
+ const template = input.getOption('template') ?? 'default'
34
+
35
+ await this.templateInstaller.installTemplate(template, projectDirectory, {
30
36
  version: await getPackageVersion(),
31
- projectName: workspaceName,
37
+ projectName: projectName,
38
+ packageManager: packageManager,
32
39
  })
40
+
33
41
  // eslint-disable-next-line no-console
34
- console.log(createDocs(workspaceDirectory, workspaceName))
42
+ console.log(createDocs(projectDirectory, projectName, packageManager))
35
43
  }
36
44
  }
37
45
 
38
- const createDocs = (workspaceDirectory: string, workspaceName: string) => `
39
- Contember workspace was successfully created inside the directory ${workspaceDirectory}
46
+ const createDocs = (projectDirectory: string, projectName: string, packageManager: string) => `
47
+ Contember project successfully created in ${projectDirectory}
48
+
49
+ Next steps:
50
+
51
+ 1. Navigate to the project directory:
52
+ $ ${chalk.green(`cd ${projectName}`)}
53
+
54
+ 2. Install dependencies:
55
+ $ ${chalk.green(`${packageManager} install`)}
40
56
 
41
- You can now enter this directory:
42
- $ ${chalk.greenBright(`cd ${workspaceName}`)}
57
+ 3. Start the Contember stack:
58
+ $ ${chalk.green(`${packageManager} start`)}
43
59
 
44
- Install NPM dependencies:
45
- $ ${chalk.greenBright(`yarn install`)}
60
+ Available services:
46
61
 
47
- And start the Contember stack:
48
- $ ${chalk.greenBright('yarn start')}
62
+ ${chalk.bold('UI & Admin')}
63
+ - Contember Admin ${chalk.blue('http://localhost:1480')}
49
64
 
50
- The following services will be accessible:
65
+ ${chalk.bold('API & Backend')}
66
+ - Contember Engine API ${chalk.blue('http://localhost:1481')}
67
+ Auth token: 0000000000000000000000000000000000000000
51
68
 
52
- - Contember Admin at http://localhost:1480
53
- - Contember Engine endpoints at http://localhost:1481 (you can authorize with token 0000000000000000000000000000000000000000)
54
- - Adminer database management tool at http://localhost:1485
55
- - Minio local S3 provider at http://localhost:1483 (you can sign in with contember / contember credentials)
56
- - MailHog testing SMTP at http://localhost:1484
57
- - PostgreSQL database at localhost:1482 (you can sign in with contember / contember credentials)
69
+ ${chalk.bold('Development Tools')}
70
+ - PostgreSQL database ${chalk.blue('http://localhost:1482')} ${chalk.grey('credentials: contember / contember')}
71
+ - Minio S3 storage ${chalk.blue('http://localhost:1483')}
72
+ - Mailpit SMTP testing ${chalk.blue('http://localhost:1484')}
73
+ - Adminer DB manager ${chalk.blue('http://localhost:1485')}
74
+ - Minio Dashboard ${chalk.blue('http://localhost:1486')} ${chalk.grey('credentials: contember / contember')}
58
75
 
59
- If you have any issues or questions, just ask here: https://github.com/contember/engine/discussions
76
+ ${chalk.bold('Need help?')} Ask the community: https://github.com/orgs/contember/discussions
60
77
  `
@@ -10,6 +10,7 @@ export class FileSystem {
10
10
  readDir = fs.readdir
11
11
  copy = copy
12
12
  unlink = fs.unlink
13
+ remove = fs.rm
13
14
  pathExists = async (path: string) => {
14
15
  try {
15
16
  await access(path)
@@ -1,18 +1,20 @@
1
1
  import { join } from 'node:path'
2
2
  import { FileSystem } from './FileSystem'
3
3
  import jsyaml from 'js-yaml'
4
+ import degit from 'degit'
4
5
 
5
6
 
6
7
  export class TemplateInstaller {
7
8
 
8
- private localTemplates: Record<string, string> = {
9
- ['@contember/template-workspace']: join(this.resourceDir, 'templates/template-workspace'),
10
- }
9
+ private localTemplates: Record<string, string>
11
10
 
12
11
  constructor(
13
12
  private readonly resourceDir: string,
14
13
  private readonly fs: FileSystem,
15
14
  ) {
15
+ this.localTemplates = {
16
+ ['default']: join(this.resourceDir, 'templates/default'),
17
+ }
16
18
  }
17
19
 
18
20
  installTemplate = async (
@@ -20,15 +22,35 @@ export class TemplateInstaller {
20
22
  targetDir: string,
21
23
  variables: Record<string, string> = {},
22
24
  ) => {
23
- let removeTemplate = () => {
24
- }
25
+ let removeTemplate = () => { }
26
+
25
27
  if (this.localTemplates[template]) {
26
28
  template = this.localTemplates[template]
29
+ } else {
30
+ const tmpDir = await this.fs.createTempDir()
31
+
32
+ try {
33
+ const emitter = degit(template, { cache: false, force: true, verbose: true })
34
+ await emitter.clone(tmpDir)
35
+
36
+ removeTemplate = () => {
37
+ try {
38
+ this.fs.remove(tmpDir, { recursive: true, force: true })
39
+ } catch (error) {
40
+ console.error(`Failed to clean up template: ${error}`)
41
+ }
42
+ }
43
+
44
+ template = tmpDir
45
+ } catch (error) {
46
+ throw new Error(`Failed to clone template from repository: ${error}`)
47
+ }
27
48
  }
28
49
 
29
50
  const templateConfigFile = join(template, 'contember.template.yaml')
30
51
  if (!(await this.fs.pathExists(templateConfigFile))) {
31
- throw `${template} is not a Contember template`
52
+ removeTemplate()
53
+ throw new Error(`${template} is not a Contember template`)
32
54
  }
33
55
  const config = (await this.readYaml(templateConfigFile)) as {
34
56
  type?: string
@@ -46,7 +68,8 @@ export class TemplateInstaller {
46
68
  await this.fs.copy(template, targetDir, {
47
69
  filter: src => !src.startsWith(nodeModulesDir) && !skippedFiles.has(src),
48
70
  })
49
- await removeTemplate()
71
+
72
+ removeTemplate()
50
73
 
51
74
  if (config.patchPackageJson) {
52
75
  await this.replaceFileContent(join(targetDir, 'package.json'), content => {
@@ -0,0 +1,24 @@
1
+ import { existsSync } from 'node:fs'
2
+ import { join } from 'node:path'
3
+
4
+ export type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'
5
+
6
+ export const detectPackageManager = (): PackageManager => {
7
+ const userAgent = process.env.npm_config_user_agent
8
+
9
+ if (userAgent) {
10
+ if (userAgent.startsWith('yarn/')) return 'yarn'
11
+ if (userAgent.startsWith('pnpm/')) return 'pnpm'
12
+ if (userAgent.startsWith('npm/')) return 'npm'
13
+ if (userAgent.startsWith('bun/')) return 'bun'
14
+ }
15
+
16
+ const cwd = process.cwd()
17
+ if (existsSync(join(cwd, 'yarn.lock'))) return 'yarn'
18
+ if (existsSync(join(cwd, 'pnpm-lock.yaml'))) return 'pnpm'
19
+ if (existsSync(join(cwd, 'package-lock.json'))) return 'npm'
20
+ if (existsSync(join(cwd, 'bun.lockb'))) return 'bun'
21
+ if (existsSync(join(cwd, 'bun.lock'))) return 'bun'
22
+
23
+ return 'npm'
24
+ }
@@ -1,3 +0,0 @@
1
- /admin/dist
2
- /node_modules
3
- /docker-compose.override.yaml
@@ -1 +0,0 @@
1
- export const Navigation = () => (<div>Navigation</div>)
@@ -1,53 +0,0 @@
1
- @import "@contember/react-devbar/index.css";
2
-
3
-
4
- @tailwind base;
5
- @tailwind components;
6
- @tailwind utilities;
7
-
8
- @layer base {
9
- :root {
10
- --background: 0 0% 100%;
11
- --foreground: 240 10% 3.9%;
12
- --card: 0 0% 100%;
13
- --card-foreground: 240 10% 3.9%;
14
- --popover: 0 0% 100%;
15
- --popover-foreground: 240 10% 3.9%;
16
- --primary: 240 5.9% 10%;
17
- --primary-foreground: 0 0% 98%;
18
- --secondary: 240 4.8% 95.9%;
19
- --secondary-foreground: 240 5.9% 10%;
20
- --muted: 240 4.8% 95.9%;
21
- --muted-foreground: 240 3.8% 46.1%;
22
- --accent: 240 4.8% 95.9%;
23
- --accent-foreground: 240 5.9% 10%;
24
- --destructive: 0 72.22% 50.59%;
25
- --destructive-foreground: 0 0% 98%;
26
- --border: 240 5.9% 90%;
27
- --input: 240 5.9% 90%;
28
- --ring: 240 5% 64.9%;
29
- --radius: 0.5rem;
30
- }
31
-
32
- .dark {
33
- --background: 240 10% 3.9%;
34
- --foreground: 0 0% 98%;
35
- --card: 240 10% 3.9%;
36
- --card-foreground: 0 0% 98%;
37
- --popover: 240 10% 3.9%;
38
- --popover-foreground: 0 0% 98%;
39
- --primary: 0 0% 98%;
40
- --primary-foreground: 240 5.9% 10%;
41
- --secondary: 240 3.7% 15.9%;
42
- --secondary-foreground: 0 0% 98%;
43
- --muted: 240 3.7% 15.9%;
44
- --muted-foreground: 240 5% 64.9%;
45
- --accent: 240 3.7% 15.9%;
46
- --accent-foreground: 0 0% 98%;
47
- --destructive: 0 62.8% 30.6%;
48
- --destructive-foreground: 0 85.7% 97.3%;
49
- --border: 240 3.7% 15.9%;
50
- --input: 240 3.7% 15.9%;
51
- --ring: 240 4.9% 83.9%;
52
- }
53
- }
@@ -1,268 +0,0 @@
1
- import './index.css'
2
- import { dict } from '@app/lib/dict'
3
- import { LoginFormFields, PasswordResetRequestFormFields } from '@app/lib/tenant'
4
- import { PasswordResetFormFields } from '@app/lib/tenant'
5
- import { ToastContent, Toaster, useShowToast } from '@app/lib/toast'
6
- import { AnchorButton, Button } from '@app/lib/ui/button'
7
- import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@app/lib/ui/card'
8
- import { Loader } from '@app/lib/ui/loader'
9
- import { Overlay } from '@app/lib/ui/overlay'
10
- import { Pages, useIdentity } from '@contember/interface'
11
- import { ContemberClient } from '@contember/react-client'
12
- import { createErrorHandler } from '@contember/react-devbar'
13
- import {
14
- IDP,
15
- IDPInitTrigger,
16
- IDPState,
17
- IdentityProvider,
18
- IdentityState,
19
- LoginForm,
20
- LogoutTrigger,
21
- PasswordResetForm,
22
- PasswordResetRequestForm,
23
- } from '@contember/react-identity'
24
- import { Link, RoutingProvider, useCurrentRequest, useRedirect } from '@contember/react-routing'
25
- import { MailIcon } from 'lucide-react'
26
- import { useEffect } from 'react'
27
- import { createRoot } from 'react-dom/client'
28
-
29
- const errorHandler = createErrorHandler((dom, react, onRecoverableError) => createRoot(dom, { onRecoverableError }).render(react))
30
-
31
- const rootEl = document.body.appendChild(document.createElement('div'))
32
-
33
- // Un-comment this to setup idp sign in
34
- // const Idps = {
35
- // google: 'Login with Google',
36
- // }
37
-
38
- const hasTokenFromEnv = import.meta.env.VITE_CONTEMBER_ADMIN_SESSION_TOKEN !== '__SESSION_TOKEN__'
39
- const appUrl = '/app'
40
-
41
- const Login = () => {
42
- const showToast = useShowToast()
43
- return (
44
- <>
45
- <IDP
46
- onInitError={error =>
47
- showToast(
48
- <ToastContent>
49
- {dict.tenant.login.idpInitError} {error}
50
- </ToastContent>,
51
- { type: 'error' },
52
- )
53
- }
54
- onResponseError={error =>
55
- showToast(
56
- <ToastContent>
57
- {dict.tenant.login.idpResponseError} {error}
58
- </ToastContent>,
59
- { type: 'error' },
60
- )
61
- }
62
- >
63
- <Card className="w-96 relative">
64
- <CardHeader>
65
- <CardTitle className="text-2xl">{dict.tenant.login.title}</CardTitle>
66
- <CardDescription>{dict.tenant.login.description}</CardDescription>
67
- </CardHeader>
68
- <CardContent>
69
- {hasTokenFromEnv && (
70
- <AnchorButton href={appUrl} size="lg" className="w-full" variant="destructive">
71
- Continue as default user
72
- </AnchorButton>
73
- )}
74
- <LoginForm>
75
- <form className="grid gap-4">
76
- <LoginFormFields />
77
- </form>
78
- </LoginForm>
79
-
80
- {/* Un-comment this to setup idp sign in */}
81
- {/*{Object.entries(Idps).map(([idp, label]) => (*/}
82
- {/* <IDPInitTrigger key={idp} identityProvider={idp}>*/}
83
- {/* <Button variant="outline" className="w-full">*/}
84
- {/* {label}*/}
85
- {/* </Button>*/}
86
- {/* </IDPInitTrigger>*/}
87
- {/*))}*/}
88
- </CardContent>
89
- <IDPState state={['processing_init', 'processing_response', 'success']}>
90
- <Loader />
91
- </IDPState>
92
- </Card>
93
- </IDP>
94
- </>
95
- )
96
- }
97
-
98
- const LoggedIn = () => {
99
- const identity = useIdentity()
100
- useEffect(() => {
101
- setTimeout(() => {
102
- window.location.href = appUrl
103
- }, 500)
104
- }, [])
105
-
106
- return (
107
- <Card className="w-96 relative">
108
- <CardHeader>
109
- <CardTitle className="text-2xl">Logged in </CardTitle>
110
- <CardDescription>as {identity?.person?.email ?? 'unknown'}</CardDescription>
111
- </CardHeader>
112
- <Loader position="static" />
113
- </Card>
114
- )
115
- }
116
-
117
- const IndexPage = () => {
118
- return (
119
- <IdentityProvider>
120
- <IdentityState state={['none', 'cleared']}>
121
- <Login />
122
- </IdentityState>
123
- <IdentityState state="success">
124
- <LoggedIn />
125
- </IdentityState>
126
- <IdentityState state="loading">
127
- <Loader />
128
- </IdentityState>
129
- <IdentityState state="failed">
130
- <Overlay>
131
- <div className="bg-gray-100 flex flex-col gap-4 items-center justify-center p-16 rounded-lg shadow-lg border">
132
- <p className="text-lg">Failed to load identity.</p>
133
- <LogoutTrigger>
134
- <Button className="w-full" variant="outline">
135
- Logout
136
- </Button>
137
- </LogoutTrigger>
138
- </div>
139
- </Overlay>
140
- </IdentityState>
141
- </IdentityProvider>
142
- )
143
- }
144
-
145
- const PasswordResetRequestPage = () => {
146
- const redirect = useRedirect()
147
- return (
148
- <Card className="w-96">
149
- <CardHeader>
150
- <CardTitle className="text-2xl">{dict.tenant.passwordResetRequest.title}</CardTitle>
151
- <CardDescription>{dict.tenant.passwordResetRequest.description}</CardDescription>
152
- </CardHeader>
153
- <CardContent>
154
- <PasswordResetRequestForm onSuccess={() => redirect('resetRequestSuccess')}>
155
- <form>
156
- <PasswordResetRequestFormFields />
157
- </form>
158
- </PasswordResetRequestForm>
159
- </CardContent>
160
- <CardFooter>
161
- <Link to="index">
162
- <AnchorButton variant="link" className="ml-auto">
163
- {dict.tenant.login.backToLogin}
164
- </AnchorButton>
165
- </Link>
166
- </CardFooter>
167
- </Card>
168
- )
169
- }
170
-
171
- const PasswordResetPage = () => {
172
- const request = useCurrentRequest()
173
- const redirect = useRedirect()
174
- const showToast = useShowToast()
175
- const token = request?.parameters.token as string | undefined
176
- return (
177
- <Card className="w-96">
178
- <CardHeader>
179
- <CardTitle className="text-2xl">{dict.tenant.passwordReset.title}</CardTitle>
180
- <CardDescription>{dict.tenant.passwordReset.description}</CardDescription>
181
- </CardHeader>
182
- <CardContent>
183
- <PasswordResetForm
184
- onSuccess={() => {
185
- showToast(<ToastContent>Password has been reset</ToastContent>, { type: 'success' })
186
- redirect('index')
187
- }}
188
- token={token}
189
- >
190
- <form>
191
- <PasswordResetFormFields hasToken={!!token} />
192
- </form>
193
- </PasswordResetForm>
194
- </CardContent>
195
- <CardFooter>
196
- <Link to="index">
197
- <AnchorButton variant="link" className="ml-auto">
198
- {dict.tenant.login.backToLogin}
199
- </AnchorButton>
200
- </Link>
201
- </CardFooter>
202
- </Card>
203
- )
204
- }
205
-
206
- const PasswordResetRequestSuccessPage = () => (
207
- <Card className="w-96">
208
- <CardHeader>
209
- <CardTitle className="text-2xl">{dict.tenant.passwordResetRequest.title}</CardTitle>
210
- <CardDescription>{dict.tenant.passwordResetRequest.description}</CardDescription>
211
- </CardHeader>
212
- <CardContent>
213
- <div className="flex flex-col items-center justify-center gap-4">
214
- <MailIcon className="text-gray-300 w-16 h-16" />
215
- <div className="text-center">An email with password reset instructions has been sent to your email address.</div>
216
- <div className="text-center text-gray-500">
217
- <Link to="passwordReset">
218
- <a className="underline">{dict.tenant.passwordResetRequest.entryCode}</a>
219
- </Link>
220
- </div>
221
- </div>
222
- </CardContent>
223
- <CardFooter>
224
- <Link to="index">
225
- <AnchorButton variant="link" className="ml-auto">
226
- {dict.tenant.login.backToLogin}
227
- </AnchorButton>
228
- </Link>
229
- </CardFooter>
230
- </Card>
231
- )
232
-
233
- const Layout = ({ children }: { children?: React.ReactNode }) => (
234
- <div className="grid md:grid-cols-2 min-h-screen ">
235
- <div className="bg-gray-100 p-4 flex items-center justify-center">{children}</div>
236
- <div className="bg-gray-700 text-white p-4 flex items-center justify-center">
237
- <div className="w-full max-w-md">
238
- <div className="text-center text-2xl">Welcome to your app</div>
239
- {/*<p className="mt-8 text-center text-gray-300">*/}
240
- {/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec auctor, sem eget ultricies ultricies, sapien urna tristique eros, ac*/}
241
- {/* tincidunt felis lacus nec nunc.*/}
242
- {/*</p>*/}
243
- </div>
244
- </div>
245
- </div>
246
- )
247
-
248
- errorHandler(onRecoverableError =>
249
- createRoot(rootEl, { onRecoverableError }).render(
250
- <>
251
- <ContemberClient apiBaseUrl={import.meta.env.VITE_CONTEMBER_ADMIN_API_BASE_URL} loginToken={import.meta.env.VITE_CONTEMBER_ADMIN_LOGIN_TOKEN}>
252
- <RoutingProvider pageInQuery>
253
- <Toaster>
254
- <Pages
255
- layout={Layout}
256
- children={{
257
- index: IndexPage,
258
- resetRequest: PasswordResetRequestPage,
259
- resetRequestSuccess: PasswordResetRequestSuccessPage,
260
- passwordReset: PasswordResetPage,
261
- }}
262
- />
263
- </Toaster>
264
- </RoutingProvider>
265
- </ContemberClient>
266
- </>,
267
- ),
268
- )
@@ -1,48 +0,0 @@
1
- import { EyeIcon, EyeOffIcon } from 'lucide-react'
2
- import { dict } from '../dict'
3
- import * as React from 'react'
4
- import { ReactNode } from 'react'
5
- import { DataViewVisibilityTrigger, useDataViewElements } from '@contember/react-dataview'
6
- import { ScrollArea } from '../ui/scroll-area'
7
-
8
- /**
9
- * Props for {@link DataGridToolbarVisibleElements}.
10
- */
11
- export interface DataGridToolbarVisibleElementsProps {
12
- elements?: {
13
- name: string
14
- label: ReactNode
15
- }[]
16
- }
17
-
18
- /**
19
- * Control for toggling visibility of columns in data grid.
20
- */
21
- export const DataGridToolbarVisibleElements = ({ elements }: DataGridToolbarVisibleElementsProps) => {
22
- const globalElements = useDataViewElements()
23
-
24
- const resolvedElements = elements ?? globalElements
25
- if (resolvedElements.length === 0) {
26
- return null
27
- }
28
- return (
29
- <div>
30
- <p className="text-gray-400 text-xs font-semibold mb-1">{dict.datagrid.visibleFields}</p>
31
- <div className="flex flex-col bg-gray-50 p-2 border rounded shadow-inner">
32
- <ScrollArea className={'max-h-48'}>
33
- <div className="flex flex-col">
34
- {resolvedElements.map(element => (
35
- element.name && <DataViewVisibilityTrigger key={element.name} name={element.name} value={it => !(it ?? true)}>
36
- <button className={'gap-2 group text-gray-400 data-[current]:text-black text-left inline-flex items-center p-0.5 text-sm rounded hover:bg-white'}>
37
- <EyeIcon className={'w-3 h-3 hidden group-data-[current]:block'} />
38
- <EyeOffIcon className={'w-3 h-3 block group-data-[current]:hidden'} />
39
- <span>{element.label}</span>
40
- </button>
41
- </DataViewVisibilityTrigger>
42
- ))}
43
- </div>
44
- </ScrollArea>
45
- </div>
46
- </div>
47
- )
48
- }
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
@@ -1,73 +0,0 @@
1
-
2
- /** @type {import('tailwindcss').Config} */
3
- module.exports = {
4
- content: ['./{app,lib}/**/*.{html,js,tsx,ts}', '*.{html,js,ts,tsx}'],
5
- darkMode: ['class'],
6
- theme: {
7
- container: {
8
- center: true,
9
- padding: '2rem',
10
- screens: {
11
- '2xl': '1400px',
12
- },
13
- },
14
- extend: {
15
- colors: {
16
- border: 'hsl(var(--border))',
17
- input: 'hsl(var(--input))',
18
- ring: 'hsl(var(--ring))',
19
- background: 'hsl(var(--background))',
20
- foreground: 'hsl(var(--foreground))',
21
- primary: {
22
- DEFAULT: 'hsl(var(--primary))',
23
- foreground: 'hsl(var(--primary-foreground))',
24
- },
25
- secondary: {
26
- DEFAULT: 'hsl(var(--secondary))',
27
- foreground: 'hsl(var(--secondary-foreground))',
28
- },
29
- destructive: {
30
- DEFAULT: 'hsl(var(--destructive) / <alpha-value>)',
31
- foreground: 'hsl(var(--destructive-foreground) / <alpha-value>)',
32
- },
33
- muted: {
34
- DEFAULT: 'hsl(var(--muted))',
35
- foreground: 'hsl(var(--muted-foreground))',
36
- },
37
- accent: {
38
- DEFAULT: 'hsl(var(--accent))',
39
- foreground: 'hsl(var(--accent-foreground))',
40
- },
41
- popover: {
42
- DEFAULT: 'hsl(var(--popover))',
43
- foreground: 'hsl(var(--popover-foreground))',
44
- },
45
- card: {
46
- DEFAULT: 'hsl(var(--card))',
47
- foreground: 'hsl(var(--card-foreground))',
48
- },
49
- },
50
- borderRadius: {
51
- xl: `calc(var(--radius) + 4px)`,
52
- lg: `var(--radius)`,
53
- md: `calc(var(--radius) - 2px)`,
54
- sm: 'calc(var(--radius) - 4px)',
55
- },
56
- keyframes: {
57
- 'accordion-down': {
58
- from: { height: '0' },
59
- to: { height: 'var(--radix-accordion-content-height)' },
60
- },
61
- 'accordion-up': {
62
- from: { height: 'var(--radix-accordion-content-height)' },
63
- to: { height: '0' },
64
- },
65
- },
66
- animation: {
67
- 'accordion-down': 'accordion-down 0.2s ease-out',
68
- 'accordion-up': 'accordion-up 0.2s ease-out',
69
- },
70
- },
71
- },
72
- plugins: [require('tailwindcss-animate')],
73
- }
@@ -1,7 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- interface ImportMetaEnv {
4
- VITE_CONTEMBER_ADMIN_API_BASE_URL: string
5
- VITE_CONTEMBER_ADMIN_SESSION_TOKEN: string
6
- VITE_CONTEMBER_ADMIN_PROJECT_NAME: string
7
- }
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- docker-compose run --rm --entrypoint="" contember-cli sh -c "
4
- node /opt/contember/run.js project:print-schema --format=schema > /tmp/contember-schema.json
5
- yarn run --silent contember-client-generator /tmp/contember-schema.json ./client/src
6
- rm /tmp/contember-schema.json
7
- "
8
-