@contember/create 2.1.0-alpha.3 → 2.1.0-alpha.35
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.
- package/dist/development/run.cjs +6 -4
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +6 -4
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +37 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +37 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -0
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -0
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +28 -12
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +28 -12
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs +22 -0
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -0
- package/dist/development/src/lib/packageManagerDetector.js +22 -0
- package/dist/development/src/lib/packageManagerDetector.js.map +1 -0
- package/dist/development/src/lib/version.cjs.map +1 -1
- package/dist/development/src/lib/version.js.map +1 -1
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/development/src/paths.js.map +1 -1
- package/dist/production/run.cjs +6 -4
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +6 -4
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +37 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +37 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -0
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -0
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +28 -12
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +28 -12
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs +22 -0
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -0
- package/dist/production/src/lib/packageManagerDetector.js +22 -0
- package/dist/production/src/lib/packageManagerDetector.js.map +1 -0
- package/dist/production/src/lib/version.cjs.map +1 -1
- package/dist/production/src/lib/version.js.map +1 -1
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/production/src/paths.js.map +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +4 -2
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +1 -0
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/lib/packageManagerDetector.d.ts +3 -0
- package/dist/types/lib/packageManagerDetector.d.ts.map +1 -0
- package/package.json +15 -6
- package/resources/templates/{template-workspace → default}/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/.gitignore.dist +154 -0
- package/resources/templates/default/README.md +98 -0
- package/resources/templates/{template-workspace → default}/admin/.env.development +1 -0
- package/resources/templates/default/admin/.env.production +6 -0
- package/resources/templates/{template-workspace → default}/admin/app/components/layout.tsx +7 -3
- package/resources/templates/default/admin/app/components/navigation.tsx +85 -0
- package/resources/templates/{template-workspace → default}/admin/app/index.tsx +4 -4
- package/resources/templates/default/admin/app/pages/tenant.tsx +160 -0
- package/resources/templates/default/admin/entrypoint/components/layout.tsx +14 -0
- package/resources/templates/default/admin/entrypoint/components/logged-in.tsx +47 -0
- package/resources/templates/default/admin/entrypoint/components/login.tsx +103 -0
- package/resources/templates/default/admin/entrypoint/config.ts +35 -0
- package/resources/templates/default/admin/entrypoint/contexts/login.tsx +18 -0
- package/resources/templates/default/admin/entrypoint/index.tsx +12 -0
- package/resources/templates/default/admin/entrypoint/login-entrypoint.tsx +24 -0
- package/resources/templates/default/admin/entrypoint/pages/index.tsx +48 -0
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +56 -0
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +63 -0
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +44 -0
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +35 -0
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +34 -0
- package/resources/templates/default/admin/index.css +94 -0
- package/resources/templates/{template-workspace → default}/admin/index.html +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/binding/binding.tsx +0 -2
- package/resources/templates/{template-workspace → default}/admin/lib/binding/hooks.tsx +14 -8
- package/resources/templates/default/admin/lib/binding/identity.tsx +51 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
- package/resources/templates/{template-workspace → default}/admin/lib/binding/persist.tsx +7 -5
- package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/block-repeater.tsx +14 -16
- package/resources/templates/{template-workspace → default}/admin/lib/board/board.tsx +61 -47
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/back-button.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/cells.tsx +49 -35
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx +47 -38
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +128 -105
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +63 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/boolean.tsx +1 -4
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx +14 -14
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx +35 -21
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/defined.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx +24 -30
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/mobile.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx +0 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx +36 -30
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/labels.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/loader.tsx +2 -7
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx +33 -38
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/table.tsx +8 -6
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/tiles.tsx +10 -5
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/toolbar.tsx +10 -7
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/ui.tsx +12 -15
- package/resources/templates/{template-workspace → default}/admin/lib/dev/login-panel.tsx +23 -16
- package/resources/templates/{template-workspace → default}/admin/lib/dict.ts +17 -5
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +159 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/block-editor.tsx +22 -10
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +205 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-canvas.tsx +6 -4
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-inline-toolbar.tsx +5 -2
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
- package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +60 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
- package/resources/templates/{template-workspace → default}/admin/lib/editor/editor-block.tsx +17 -10
- package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text-view.tsx +11 -6
- package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text.tsx +6 -7
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +57 -0
- package/resources/templates/default/admin/lib/form/container.tsx +72 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/inputs.tsx +14 -12
- package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +93 -51
- package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +1 -1
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +221 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/upload.tsx +61 -62
- package/resources/templates/{template-workspace → default}/admin/lib/labels/enum-labels.ts +6 -3
- package/resources/templates/{template-workspace → default}/admin/lib/labels/field-labels.ts +4 -2
- package/resources/templates/{template-workspace → default}/admin/lib/layout/layout-boxed.tsx +39 -29
- package/resources/templates/{template-workspace → default}/admin/lib/layout/slots.tsx +1 -4
- package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
- package/resources/templates/{template-workspace → default}/admin/lib/repeater/repeater.tsx +24 -15
- package/resources/templates/{template-workspace → default}/admin/lib/select/create-new.tsx +0 -3
- package/resources/templates/{template-workspace → default}/admin/lib/select/filter.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/select/list.tsx +33 -28
- package/resources/templates/default/admin/lib/select/multi-select.tsx +92 -0
- package/resources/templates/default/admin/lib/select/select.tsx +109 -0
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +138 -0
- package/resources/templates/{template-workspace → default}/admin/lib/select/ui.tsx +13 -11
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/change-my-password.tsx +21 -8
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/common.tsx +21 -12
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/create-api-key.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/invite.tsx +12 -7
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/login.tsx +26 -7
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/memberships-control.tsx +32 -20
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset.tsx +21 -8
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/update-project-member.tsx +3 -4
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/api-key-list.tsx +5 -3
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-list.tsx +17 -11
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/person-list.tsx +6 -4
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/otp-setup.tsx +86 -59
- package/resources/templates/default/admin/lib/toast/toast.tsx +113 -0
- package/resources/templates/{template-workspace → default}/admin/lib/toast/toaster.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/alert-dialog.tsx +4 -3
- package/resources/templates/default/admin/lib/ui/button.tsx +30 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/ui/dimension.tsx +9 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +18 -15
- package/resources/templates/default/admin/lib/ui/input.tsx +68 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/loader.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/menu.tsx +3 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/overlay.tsx +11 -9
- package/resources/templates/{template-workspace → default}/admin/lib/ui/popover.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/ui/property-list.tsx +5 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/scroll-area.tsx +11 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/select.tsx +4 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sheet.tsx +9 -8
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sidebar.tsx +53 -42
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/switch.tsx +11 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/table.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/textarea.tsx +10 -7
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle-group.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle.tsx +3 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/tooltip.tsx +4 -3
- package/resources/templates/{template-workspace → default}/admin/lib/upload/dropzone.tsx +14 -10
- package/resources/templates/{template-workspace → default}/admin/lib/upload/repeater.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/upload/ui.tsx +4 -8
- package/resources/templates/{template-workspace → default}/admin/lib/upload/upload-progress.tsx +28 -12
- package/resources/templates/{template-workspace → default}/admin/lib/upload/view.tsx +130 -68
- package/resources/templates/{template-workspace → default}/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
- package/resources/templates/{template-workspace → default}/admin/lib/utils/uic.tsx +24 -14
- package/resources/templates/{template-workspace → default}/admin/lib/utils/use-mobile.ts +1 -3
- package/resources/templates/{template-workspace → default}/admin/package.json +6 -4
- package/resources/templates/default/admin/sentry.ts +26 -0
- package/resources/templates/{template-workspace → default}/admin/tsconfig.json +1 -9
- package/resources/templates/default/admin/vite-env.d.ts +12 -0
- package/resources/templates/default/admin/vite.config.ts +11 -0
- package/resources/templates/default/api/README.md +87 -0
- package/resources/templates/{template-workspace → default}/biome.json +1 -1
- package/resources/templates/default/client/README.md +285 -0
- package/resources/templates/{template-workspace → default}/contember.template.yaml +5 -0
- package/resources/templates/{template-workspace → default}/package.json +1 -1
- package/resources/templates/default/scripts/generate-client.sh +7 -0
- package/resources/templates/default/scripts/update-ui-lib.sh +344 -0
- package/src/commands/WorkspaceCreateCommand.ts +41 -25
- package/src/lib/FileSystem.ts +1 -0
- package/src/lib/TemplateInstaller.ts +32 -12
- package/src/lib/packageManagerDetector.ts +24 -0
- package/src/run.ts +8 -7
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/resources/templates/template-workspace/.gitignore.dist +0 -3
- package/resources/templates/template-workspace/admin/app/components/navigation.tsx +0 -1
- package/resources/templates/template-workspace/admin/index.css +0 -53
- package/resources/templates/template-workspace/admin/index.tsx +0 -268
- package/resources/templates/template-workspace/admin/lib/binding/identity.tsx +0 -50
- package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +0 -48
- package/resources/templates/template-workspace/admin/lib/dimensions/dimensions.tsx +0 -135
- package/resources/templates/template-workspace/admin/lib/editor/common/buttons.tsx +0 -83
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/BlockElement.tsx +0 -48
- package/resources/templates/template-workspace/admin/lib/editor/sortable-block.tsx +0 -51
- package/resources/templates/template-workspace/admin/lib/form/container.tsx +0 -59
- package/resources/templates/template-workspace/admin/lib/form/upload-repeaters.tsx +0 -188
- package/resources/templates/template-workspace/admin/lib/select/multi-select.tsx +0 -96
- package/resources/templates/template-workspace/admin/lib/select/select.tsx +0 -104
- package/resources/templates/template-workspace/admin/lib/select/sortable-select.tsx +0 -136
- package/resources/templates/template-workspace/admin/lib/toast/toast.tsx +0 -112
- package/resources/templates/template-workspace/admin/lib/ui/button.tsx +0 -29
- package/resources/templates/template-workspace/admin/lib/ui/input.tsx +0 -69
- package/resources/templates/template-workspace/admin/lib/ui/switch.tsx +0 -9
- package/resources/templates/template-workspace/admin/postcss.config.js +0 -6
- package/resources/templates/template-workspace/admin/tailwind.config.js +0 -73
- package/resources/templates/template-workspace/admin/vite-env.d.ts +0 -7
- package/resources/templates/template-workspace/scripts/generate-client.sh +0 -8
- package/resources/templates/{template-workspace → default}/.github/scripts/setup-actions-variables.sh +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/components/logo.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/config.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/index.html +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/pages/index.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/delete.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/board/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/link-back-button.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-leaf.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/export.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/text.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/grid.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/index.ts +21 -21
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/layout-switcher.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/todo.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dimensions/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ListItemRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/OrderedListRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ParagraphRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ScrollTargetRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/plugins.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/error-boundary.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/use-error-formatter.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/field/formatted-field.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/field/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/labels.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/formatting/formatting.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/formatting/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/images/formatImageResizeUrl.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/images/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/labels/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/layout/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/layout/layout.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/repeater/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/highlight.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInvite.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/toast/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/avatar.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/collapsible.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/divider.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/label.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/progress.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/separator.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/skeleton.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/upload/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/cn.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/public/favicon.png +0 -0
- /package/resources/templates/{template-workspace → default}/api/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/api/migrations/.gitkeep +0 -0
- /package/resources/templates/{template-workspace → default}/api/model/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/api/package.json +0 -0
- /package/resources/templates/{template-workspace → default}/api/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/client/package.json +0 -0
- /package/resources/templates/{template-workspace → default}/client/src/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/client/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/docker-compose.yaml +0 -0
- /package/resources/templates/{template-workspace → default}/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/tsconfig.settings.json +0 -0
|
@@ -23,14 +23,13 @@ export type BaseFileViewProps = {
|
|
|
23
23
|
DestroyAction?: ComponentType<{ children: ReactElement }>
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
export type UploadedImageViewProps =
|
|
28
27
|
& FileUrlDataExtractorProps
|
|
29
28
|
& GenericFileMetadataExtractorProps
|
|
30
29
|
& ImageFileDataExtractorProps
|
|
31
30
|
& BaseFileViewProps
|
|
32
31
|
|
|
33
|
-
export const UploadedImageView = Component<UploadedImageViewProps>(({ DestroyAction, edit, actions, baseField,
|
|
32
|
+
export const UploadedImageView = Component<UploadedImageViewProps>(({ DestroyAction, edit, actions, baseField, ...props }) => (
|
|
34
33
|
<div className="flex items-center justify-center h-40 rounded-md group relative">
|
|
35
34
|
<UploaderBase baseField={baseField}>
|
|
36
35
|
<ImagePreview urlField={props.urlField} />
|
|
@@ -40,9 +39,12 @@ export const UploadedImageView = Component<UploadedImageViewProps>(({ DestroyAct
|
|
|
40
39
|
))
|
|
41
40
|
|
|
42
41
|
const ImagePreview = Component((props: FileUrlDataExtractorProps) => (
|
|
43
|
-
<FieldView<string>
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
<FieldView<string>
|
|
43
|
+
field={props.urlField}
|
|
44
|
+
render={({ value: url }) => (
|
|
45
|
+
!url ? null : <img src={formatImageResizeUrl(url, { width: 400 })} className="max-w-full max-h-full" />
|
|
46
|
+
)}
|
|
47
|
+
/>
|
|
46
48
|
))
|
|
47
49
|
|
|
48
50
|
const ImageMetadata = Component(({ heightField, widthField, ...props }: UploadedImageViewProps) => (
|
|
@@ -51,8 +53,6 @@ const ImageMetadata = Component(({ heightField, widthField, ...props }: Uploaded
|
|
|
51
53
|
</Metadata>
|
|
52
54
|
))
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
56
|
export type UploadedAudioViewProps =
|
|
57
57
|
& FileUrlDataExtractorProps
|
|
58
58
|
& GenericFileMetadataExtractorProps
|
|
@@ -64,15 +64,17 @@ export const UploadedAudioView = Component<UploadedAudioViewProps>(({ DestroyAct
|
|
|
64
64
|
<UploaderBase baseField={baseField}>
|
|
65
65
|
<AudioPreview urlField={props.urlField} />
|
|
66
66
|
</UploaderBase>
|
|
67
|
-
<FileActions baseField={baseField} DestroyAction={DestroyAction} metadata={<AudioMetadata {...props} />} edit={edit}
|
|
68
|
-
actions={actions} />
|
|
67
|
+
<FileActions baseField={baseField} DestroyAction={DestroyAction} metadata={<AudioMetadata {...props} />} edit={edit} actions={actions} />
|
|
69
68
|
</div>
|
|
70
69
|
))
|
|
71
70
|
|
|
72
71
|
const AudioPreview = Component(({ urlField }: FileUrlDataExtractorProps) => (
|
|
73
|
-
<FieldView<string>
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
<FieldView<string>
|
|
73
|
+
field={urlField}
|
|
74
|
+
render={({ value: url }) => (
|
|
75
|
+
!url ? null : <audio src={url} controls className="max-w-full max-h-full" controlsList="nodownload noremoteplayback noplaybackrate" />
|
|
76
|
+
)}
|
|
77
|
+
/>
|
|
76
78
|
))
|
|
77
79
|
|
|
78
80
|
const AudioMetadata = Component(({ durationField, ...props }: UploadedAudioViewProps) => (
|
|
@@ -81,8 +83,6 @@ const AudioMetadata = Component(({ durationField, ...props }: UploadedAudioViewP
|
|
|
81
83
|
</Metadata>
|
|
82
84
|
))
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
86
|
export type UploadedVideoViewProps =
|
|
87
87
|
& FileUrlDataExtractorProps
|
|
88
88
|
& GenericFileMetadataExtractorProps
|
|
@@ -99,9 +99,12 @@ export const UploadedVideoView = Component<UploadedVideoViewProps>(({ DestroyAct
|
|
|
99
99
|
))
|
|
100
100
|
|
|
101
101
|
const VideoPreview = Component(({ urlField }: FileUrlDataExtractorProps) => (
|
|
102
|
-
<FieldView<string>
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
<FieldView<string>
|
|
103
|
+
field={urlField}
|
|
104
|
+
render={({ value: url }) => (
|
|
105
|
+
!url ? null : <video src={url} controls className="max-w-full max-h-full" controlsList="nodownload noremoteplayback noplaybackrate" />
|
|
106
|
+
)}
|
|
107
|
+
/>
|
|
105
108
|
))
|
|
106
109
|
|
|
107
110
|
const VideoMetadata = Component(({ durationField, widthField, heightField, ...props }: UploadedVideoViewProps) => (
|
|
@@ -111,8 +114,6 @@ const VideoMetadata = Component(({ durationField, widthField, heightField, ...pr
|
|
|
111
114
|
</Metadata>
|
|
112
115
|
))
|
|
113
116
|
|
|
114
|
-
|
|
115
|
-
|
|
116
117
|
export type UploadedAnyViewProps =
|
|
117
118
|
& FileUrlDataExtractorProps
|
|
118
119
|
& GenericFileMetadataExtractorProps
|
|
@@ -127,16 +128,43 @@ export const UploadedAnyView = Component<UploadedAnyViewProps>(({ DestroyAction,
|
|
|
127
128
|
</div>
|
|
128
129
|
))
|
|
129
130
|
|
|
130
|
-
const AnyFilePreview = Component(({ urlField, fileNameField }: FileUrlDataExtractorProps & GenericFileMetadataExtractorProps) =>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
const AnyFilePreview = Component(({ urlField, fileNameField }: FileUrlDataExtractorProps & GenericFileMetadataExtractorProps) => (
|
|
132
|
+
<>
|
|
133
|
+
<FieldView<string>
|
|
134
|
+
field={urlField}
|
|
135
|
+
render={({ value: url }) => (
|
|
136
|
+
url
|
|
137
|
+
? (
|
|
138
|
+
<a
|
|
139
|
+
href={url ?? '#'}
|
|
140
|
+
target="_blank"
|
|
141
|
+
rel="noreferrer"
|
|
142
|
+
className="text-blue-600 hover:text-blue-700 underline overflow-hidden whitespace-nowrap text-ellipsis flex flex-col group/anchor flex-1 items-center justify-center"
|
|
143
|
+
>
|
|
144
|
+
<FileIcon className="h-16 w-16 text-gray-400 group-hover/anchor:text-gray-500 transition-all" />
|
|
145
|
+
{fileNameField
|
|
146
|
+
? (
|
|
147
|
+
<span>
|
|
148
|
+
<Field field={fileNameField} />
|
|
149
|
+
</span>
|
|
150
|
+
)
|
|
151
|
+
: null}
|
|
152
|
+
</a>
|
|
153
|
+
)
|
|
154
|
+
: null
|
|
155
|
+
)}
|
|
156
|
+
/>
|
|
157
|
+
<StaticRender>
|
|
158
|
+
{fileNameField
|
|
159
|
+
? (
|
|
160
|
+
<span>
|
|
161
|
+
<Field field={fileNameField} />
|
|
162
|
+
</span>
|
|
163
|
+
)
|
|
164
|
+
: null}
|
|
165
|
+
</StaticRender>
|
|
166
|
+
</>
|
|
167
|
+
))
|
|
140
168
|
|
|
141
169
|
type MetadataProps =
|
|
142
170
|
& FileUrlDataExtractorProps
|
|
@@ -152,12 +180,15 @@ const Metadata = Component(({ children, urlField, fileSizeField, fileNameField,
|
|
|
152
180
|
<MetaField field={fileNameField} label="File name:" />
|
|
153
181
|
{children}
|
|
154
182
|
<MetaField field={lastModifiedField} label="Date:" format={formatDate} />
|
|
155
|
-
<MetaField
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
183
|
+
<MetaField
|
|
184
|
+
field={urlField}
|
|
185
|
+
label="URL:"
|
|
186
|
+
format={url => (
|
|
187
|
+
<a href={url} target="_blank" rel="noreferrer" className="text-blue-600 underline overflow-hidden whitespace-nowrap text-ellipsis">
|
|
188
|
+
{url.replace(/^(.{15}).*(.{15})$/, '$1…$2')}
|
|
189
|
+
</a>
|
|
190
|
+
)}
|
|
191
|
+
/>
|
|
161
192
|
</div>
|
|
162
193
|
))
|
|
163
194
|
|
|
@@ -168,10 +199,17 @@ const DimensionsMeta = Component(({ widthField, heightField }: {
|
|
|
168
199
|
if (!widthField || !heightField) {
|
|
169
200
|
return null
|
|
170
201
|
}
|
|
171
|
-
return
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
202
|
+
return (
|
|
203
|
+
<FieldView<number, number>
|
|
204
|
+
fields={[widthField, heightField]}
|
|
205
|
+
render={(width, height) => (
|
|
206
|
+
<>
|
|
207
|
+
<span className="font-semibold text-right">Dimensions:</span>
|
|
208
|
+
<span>{width.value} x {height.value} px</span>
|
|
209
|
+
</>
|
|
210
|
+
)}
|
|
211
|
+
/>
|
|
212
|
+
)
|
|
175
213
|
})
|
|
176
214
|
|
|
177
215
|
interface MetaFieldProps {
|
|
@@ -180,47 +218,71 @@ interface MetaFieldProps {
|
|
|
180
218
|
format?: (value: any) => ReactNode
|
|
181
219
|
}
|
|
182
220
|
const MetaField = Component<MetaFieldProps>(({ field, label, format = it => it }) => (
|
|
183
|
-
!field ? null :
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
221
|
+
!field ? null : (
|
|
222
|
+
<FieldView<any>
|
|
223
|
+
field={field}
|
|
224
|
+
render={value => (
|
|
225
|
+
<>
|
|
226
|
+
<span className="font-semibold text-right">{label}</span>
|
|
227
|
+
<span>{format(value.value)}</span>
|
|
228
|
+
</>
|
|
229
|
+
)}
|
|
230
|
+
/>
|
|
231
|
+
)
|
|
187
232
|
))
|
|
188
233
|
|
|
189
|
-
|
|
190
234
|
const FileActions = Component(({ DestroyAction, metadata, actions, edit, baseField, noDestroy }: {
|
|
191
235
|
metadata?: ReactNode
|
|
192
236
|
} & BaseFileViewProps) => {
|
|
193
237
|
return (
|
|
194
|
-
<div className="absolute -top-2 -right-1 p-0.5 bg-gray-200 border border-gray-300 rounded shadow flex gap-2 opacity-0 transition-opacity group-hover:opacity-100">
|
|
238
|
+
<div className="absolute -top-2 -right-1 p-0.5 bg-gray-200 border border-gray-300 rounded-sm shadow-sm flex gap-2 opacity-0 transition-opacity group-hover:opacity-100">
|
|
195
239
|
{actions}
|
|
196
|
-
{edit &&
|
|
197
|
-
<
|
|
198
|
-
<Button variant={'ghost'} size={'sm'} className={'p-0.5 h-5 w-5'} onClick={e => e.stopPropagation()}>
|
|
199
|
-
<EditIcon className="h-4 w-4" />
|
|
200
|
-
</Button>
|
|
201
|
-
</PopoverTrigger>
|
|
202
|
-
<PopoverContent>
|
|
203
|
-
{edit}
|
|
204
|
-
</PopoverContent>
|
|
205
|
-
</Popover>}
|
|
206
|
-
<UploaderBase baseField={baseField}>
|
|
207
|
-
{metadata && <Popover>
|
|
240
|
+
{edit && (
|
|
241
|
+
<Popover>
|
|
208
242
|
<PopoverTrigger asChild>
|
|
209
|
-
<Button
|
|
210
|
-
|
|
243
|
+
<Button
|
|
244
|
+
variant={'ghost'}
|
|
245
|
+
size={'sm'}
|
|
246
|
+
className={'p-0.5 h-5 w-5'}
|
|
247
|
+
onClick={e => e.stopPropagation()}
|
|
248
|
+
>
|
|
249
|
+
<EditIcon className="h-4 w-4" />
|
|
211
250
|
</Button>
|
|
212
251
|
</PopoverTrigger>
|
|
213
252
|
<PopoverContent>
|
|
214
|
-
|
|
215
|
-
{metadata}
|
|
216
|
-
</div>
|
|
253
|
+
{edit}
|
|
217
254
|
</PopoverContent>
|
|
218
|
-
</Popover>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
255
|
+
</Popover>
|
|
256
|
+
)}
|
|
257
|
+
<UploaderBase baseField={baseField}>
|
|
258
|
+
{metadata && (
|
|
259
|
+
<Popover>
|
|
260
|
+
<PopoverTrigger asChild>
|
|
261
|
+
<Button
|
|
262
|
+
variant={'ghost'}
|
|
263
|
+
size={'sm'}
|
|
264
|
+
className={'p-0.5 h-5 w-5'}
|
|
265
|
+
onClick={e => e.stopPropagation()}
|
|
266
|
+
>
|
|
267
|
+
<InfoIcon className="h-4 w-4" />
|
|
268
|
+
</Button>
|
|
269
|
+
</PopoverTrigger>
|
|
270
|
+
<PopoverContent>
|
|
271
|
+
<div className="text-sm">
|
|
272
|
+
{metadata}
|
|
273
|
+
</div>
|
|
274
|
+
</PopoverContent>
|
|
275
|
+
</Popover>
|
|
276
|
+
)}
|
|
277
|
+
{!noDestroy && DestroyAction
|
|
278
|
+
? (
|
|
279
|
+
<DestroyAction>
|
|
280
|
+
<Button variant={'ghost'} size={'sm'} className={'p-0.5 h-5 w-5 text-red-500'}>
|
|
281
|
+
<TrashIcon className="h-4 w-4" />
|
|
282
|
+
</Button>
|
|
283
|
+
</DestroyAction>
|
|
284
|
+
)
|
|
285
|
+
: null}
|
|
224
286
|
</UploaderBase>
|
|
225
287
|
</div>
|
|
226
288
|
)
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { ComponentType, memo, SetStateAction, useCallback, useState } from 'react'
|
|
2
2
|
import { createRequiredContext } from '@contember/react-utils'
|
|
3
3
|
|
|
4
|
-
export const createComponentOpenHooks = <
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export const createComponentOpenHooks = <
|
|
5
|
+
P extends {
|
|
6
|
+
open?: boolean
|
|
7
|
+
defaultOpen?: boolean
|
|
8
|
+
onOpenChange?(open: boolean): void
|
|
9
|
+
},
|
|
10
|
+
>(Component: ComponentType<P>): {
|
|
9
11
|
Component: ComponentType<P>
|
|
10
12
|
useOpen: () => [boolean, (value: SetStateAction<boolean>) => void]
|
|
11
13
|
} => {
|
|
12
|
-
const [ctx, useOpen] = createRequiredContext<[boolean, (value: SetStateAction<boolean>) => void]>(
|
|
14
|
+
const [ctx, useOpen] = createRequiredContext<[boolean, (value: SetStateAction<boolean>) => void]>(
|
|
15
|
+
`${Component.displayName ?? 'UnnamedComponent'}OpenContext`,
|
|
16
|
+
)
|
|
13
17
|
const WrappedComponent = memo<P>(({ open: openIn, defaultOpen, onOpenChange, ...props }) => {
|
|
14
18
|
const [open, setOpenInternal] = useState(openIn ?? defaultOpen ?? false)
|
|
15
19
|
if (openIn !== undefined && open !== openIn) {
|
|
@@ -10,12 +10,14 @@ type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
|
10
10
|
type ConfigSchema = Record<string, Record<string, ClassValue>>
|
|
11
11
|
|
|
12
12
|
export type ConfigVariants<T extends ConfigSchema | undefined> = T extends ConfigSchema ? {
|
|
13
|
-
|
|
14
|
-
}
|
|
13
|
+
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined
|
|
14
|
+
}
|
|
15
|
+
: {}
|
|
15
16
|
|
|
16
17
|
type ConfigVariantsMulti<T extends ConfigSchema | undefined> = T extends ConfigSchema ? {
|
|
17
|
-
|
|
18
|
-
}
|
|
18
|
+
[Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined
|
|
19
|
+
}
|
|
20
|
+
: {}
|
|
19
21
|
|
|
20
22
|
type DataAttr<T extends ConfigSchema | undefined> = T extends ConfigSchema ? `data-${keyof T & string}` : never
|
|
21
23
|
type DataAttrValue = boolean | string | number | undefined | null
|
|
@@ -24,9 +26,12 @@ type Config<T extends ConfigSchema | undefined, El extends React.ElementType> =
|
|
|
24
26
|
baseClass?: ClassValue
|
|
25
27
|
variants?: T
|
|
26
28
|
passVariantProps?: string[]
|
|
27
|
-
defaultProps?: Partial<
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
defaultProps?: Partial<
|
|
30
|
+
& React.ComponentProps<El>
|
|
31
|
+
& {
|
|
32
|
+
[K in `data-${string}`]?: DataAttrValue
|
|
33
|
+
}
|
|
34
|
+
>
|
|
30
35
|
defaultVariants?: ConfigVariants<T>
|
|
31
36
|
compoundVariants?: ((ConfigVariants<T> | ConfigVariantsMulti<T>) & { className?: string })[]
|
|
32
37
|
variantsAsDataAttrs?: (keyof ConfigVariants<T>)[]
|
|
@@ -42,7 +47,10 @@ export const uiconfig = <T extends ConfigSchema | undefined>(config: Config<T, C
|
|
|
42
47
|
|
|
43
48
|
export type NoInfer<T> = T & { [K in keyof T]: T[K] }
|
|
44
49
|
|
|
45
|
-
export const uic = <El extends React.ElementType, Variants extends ConfigSchema | undefined = undefined>(
|
|
50
|
+
export const uic = <El extends React.ElementType, Variants extends ConfigSchema | undefined = undefined>(
|
|
51
|
+
Component: El,
|
|
52
|
+
config: Config<Variants, NoInfer<El>>,
|
|
53
|
+
) => {
|
|
46
54
|
const cls = cva<any>(config?.baseClass as any, {
|
|
47
55
|
variants: config?.variants,
|
|
48
56
|
defaultVariants: config?.defaultVariants,
|
|
@@ -50,11 +58,14 @@ export const uic = <El extends React.ElementType, Variants extends ConfigSchema
|
|
|
50
58
|
})
|
|
51
59
|
const passVariantProps = config?.passVariantProps ? new Set(config.passVariantProps) : undefined
|
|
52
60
|
|
|
53
|
-
const component = forwardRef<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
const component = forwardRef<
|
|
62
|
+
React.ComponentRef<El>,
|
|
63
|
+
React.ComponentProps<El> & {
|
|
64
|
+
asChild?: boolean
|
|
65
|
+
children?: ReactNode
|
|
66
|
+
className?: string
|
|
67
|
+
} & ConfigVariants<Variants>
|
|
68
|
+
>((props, ref) => {
|
|
58
69
|
const { className: classNameProp, children: childrenBase, ...rest } = props
|
|
59
70
|
|
|
60
71
|
const variants: Record<string, string> = {}
|
|
@@ -99,7 +110,6 @@ export const uic = <El extends React.ElementType, Variants extends ConfigSchema
|
|
|
99
110
|
]
|
|
100
111
|
}
|
|
101
112
|
|
|
102
|
-
|
|
103
113
|
const innerEl = (
|
|
104
114
|
<FinalComponent
|
|
105
115
|
ref={ref}
|
|
@@ -3,9 +3,7 @@ import { useEffect, useState } from 'react'
|
|
|
3
3
|
const MOBILE_BREAKPOINT = 768
|
|
4
4
|
|
|
5
5
|
export const useIsMobile = () => {
|
|
6
|
-
const [isMobile, setIsMobile] = useState(() =>
|
|
7
|
-
typeof window !== 'undefined' ? window.innerWidth < MOBILE_BREAKPOINT : false,
|
|
8
|
-
)
|
|
6
|
+
const [isMobile, setIsMobile] = useState(() => typeof window !== 'undefined' ? window.innerWidth < MOBILE_BREAKPOINT : false)
|
|
9
7
|
|
|
10
8
|
useEffect(() => {
|
|
11
9
|
if (typeof window === 'undefined') return
|
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@contember/vite-plugin": "{version}",
|
|
12
|
+
"@tailwindcss/vite": "^4",
|
|
12
13
|
"@types/react": "^18",
|
|
13
14
|
"@types/react-dom": "^18",
|
|
14
15
|
"@vitejs/plugin-react": "^4.2.1",
|
|
15
|
-
"
|
|
16
|
-
"postcss": "^8",
|
|
17
|
-
"tailwindcss": "^3",
|
|
16
|
+
"tailwindcss": "^4",
|
|
18
17
|
"tailwindcss-animate": "^1.0.7",
|
|
19
|
-
"vite": "^
|
|
18
|
+
"vite": "^7"
|
|
20
19
|
},
|
|
21
20
|
"dependencies": {
|
|
22
21
|
"@contember/client-content": "{version}",
|
|
@@ -37,6 +36,7 @@
|
|
|
37
36
|
"@contember/react-uploader": "{version}",
|
|
38
37
|
"@contember/react-uploader-dropzone": "{version}",
|
|
39
38
|
"@radix-ui/react-alert-dialog": "^1.1.2",
|
|
39
|
+
"@radix-ui/react-avatar": "^1.1.3",
|
|
40
40
|
"@radix-ui/react-dialog": "^1.1.2",
|
|
41
41
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
42
42
|
"@radix-ui/react-label": "^2.1.0",
|
|
@@ -45,12 +45,14 @@
|
|
|
45
45
|
"@radix-ui/react-progress": "^1.1.0",
|
|
46
46
|
"@radix-ui/react-scroll-area": "^1.2.0",
|
|
47
47
|
"@radix-ui/react-select": "^2.1.2",
|
|
48
|
+
"@radix-ui/react-separator": "^1.1.2",
|
|
48
49
|
"@radix-ui/react-slot": "^1.1.0",
|
|
49
50
|
"@radix-ui/react-switch": "^1.1.1",
|
|
50
51
|
"@radix-ui/react-toast": "^1.2.2",
|
|
51
52
|
"@radix-ui/react-toggle": "^1.1.0",
|
|
52
53
|
"@radix-ui/react-toggle-group": "^1.1.0",
|
|
53
54
|
"@radix-ui/react-tooltip": "^1.1.3",
|
|
55
|
+
"@sentry/react": "^8.47.0",
|
|
54
56
|
"class-variance-authority": "^0.7.0",
|
|
55
57
|
"clsx": "^2.1.1",
|
|
56
58
|
"lucide-react": "^0.451.0",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/react'
|
|
2
|
+
|
|
3
|
+
const sentryDsn = import.meta.env.VITE_SENTRY_DSN
|
|
4
|
+
const enableSentry = sentryDsn && import.meta.env.MODE === 'production'
|
|
5
|
+
const projectName = import.meta.env.VITE_CONTEMBER_ADMIN_PROJECT_NAME
|
|
6
|
+
|
|
7
|
+
Sentry.init({
|
|
8
|
+
enabled: enableSentry,
|
|
9
|
+
dsn: sentryDsn,
|
|
10
|
+
integrations: [
|
|
11
|
+
Sentry.browserApiErrorsIntegration(),
|
|
12
|
+
Sentry.browserSessionIntegration(),
|
|
13
|
+
Sentry.browserTracingIntegration(),
|
|
14
|
+
Sentry.captureConsoleIntegration({ levels: ['error'] }),
|
|
15
|
+
Sentry.replayIntegration(),
|
|
16
|
+
],
|
|
17
|
+
initialScope: {
|
|
18
|
+
tags: {
|
|
19
|
+
environment: import.meta.env.MODE,
|
|
20
|
+
projectName: projectName,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
tracesSampleRate: 1,
|
|
24
|
+
replaysSessionSampleRate: 0,
|
|
25
|
+
replaysOnErrorSampleRate: 1,
|
|
26
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
interface ImportMetaEnv {
|
|
4
|
+
readonly VITE_CONTEMBER_ADMIN_API_BASE_URL: string
|
|
5
|
+
readonly VITE_CONTEMBER_ADMIN_SESSION_TOKEN: string
|
|
6
|
+
readonly VITE_CONTEMBER_ADMIN_LOGIN_TOKEN: string
|
|
7
|
+
readonly VITE_CONTEMBER_ADMIN_PROJECT_NAME: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ImportMeta {
|
|
11
|
+
readonly env: ImportMetaEnv
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import contember from '@contember/vite-plugin'
|
|
2
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
3
|
+
import react from '@vitejs/plugin-react'
|
|
4
|
+
import { defineConfig } from 'vite'
|
|
5
|
+
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
6
|
+
|
|
7
|
+
export default defineConfig(() => {
|
|
8
|
+
return {
|
|
9
|
+
plugins: [tsconfigPaths(), tailwindcss(), react(), contember()],
|
|
10
|
+
}
|
|
11
|
+
})
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Contember API
|
|
2
|
+
|
|
3
|
+
Typesafe GraphQL API for managing content and data.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This API project defines the data model and permissions for the Contember API. It is built with the Contember platform, a headless CMS that provides a powerful GraphQL API for managing content and data.
|
|
8
|
+
|
|
9
|
+
## Project Structure
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
├── migrations/ # Database migrations
|
|
13
|
+
└── model/ # Data model definitions
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- **`migrations/`**: Stores database migration scripts to manage schema changes and data migrations.
|
|
17
|
+
- **`model/`**: Contains the definitions for entities, fields, relations, and permissions.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Key Concepts
|
|
22
|
+
|
|
23
|
+
### Migrations
|
|
24
|
+
Database schema changes are managed through **migrations**. These include both schema alterations and data transformations. Use the Contember CLI to create, amend, or execute migrations.
|
|
25
|
+
|
|
26
|
+
### Data Model
|
|
27
|
+
Defines your application's **entities**, **fields**, **relations**, and **permissions**, serving as the blueprint for your GraphQL API.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Using the Contember CLI
|
|
32
|
+
|
|
33
|
+
The **Contember CLI** is a command-line tool for managing migrations, the data model, and permissions. For detailed guidance, see the [Contember CLI Documentation](https://docs.contember.com/reference/cli/).
|
|
34
|
+
|
|
35
|
+
To view all available commands, run:
|
|
36
|
+
```bash
|
|
37
|
+
yarn run contember
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Common Commands
|
|
43
|
+
|
|
44
|
+
Run these commands from the root of the project directory.
|
|
45
|
+
|
|
46
|
+
#### Amend the Latest Migration
|
|
47
|
+
Modify the most recent migration file to refine your changes:
|
|
48
|
+
```bash
|
|
49
|
+
yarn run contember migrations:amend
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Generate a Schema Migration Diff
|
|
53
|
+
Create a migration diff for a specific project:
|
|
54
|
+
```bash
|
|
55
|
+
yarn run contember migrations:diff <migration-name>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### Execute Migrations
|
|
59
|
+
Apply migrations to a Contember instance:
|
|
60
|
+
```bash
|
|
61
|
+
yarn run contember migrations:execute
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Shortcut Commands
|
|
65
|
+
All commands support minimal unique prefixes. For example:
|
|
66
|
+
- `yarn run contember m:a` → Shortcut for `migrations:amend`
|
|
67
|
+
- `yarn run contember m:d` → Shortcut for `migrations:diff`
|
|
68
|
+
|
|
69
|
+
[Contember CLI Reference](https://docs.contember.com/reference/cli/)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
# How to work with Actions locally
|
|
74
|
+
|
|
75
|
+
To test or debug Actions with a local Cloudflare worker running on http://localhost:8787, you need to access the worker from within the Docker container. Docker uses a special DNS name, `host.docker.internal`, which resolves to the host machine's internal IP address.
|
|
76
|
+
|
|
77
|
+
For example, to set up a Contember Action that communicates with the worker, use the following configuration:
|
|
78
|
+
```
|
|
79
|
+
@c.Watch({
|
|
80
|
+
name: 'action_name',
|
|
81
|
+
watch: `fields_to_watch`,
|
|
82
|
+
webhook: 'http://host.docker.internal:8787',
|
|
83
|
+
selection: 'optional_selection_for_payload',
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
[Contember Actions Documentation](https://docs.contember.com/reference/engine/actions/definition)
|