@contember/create 2.1.0-rc.3 → 2.2.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.
- package/CLAUDE.md +22 -0
- package/dist/development/run.cjs +7 -7
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +8 -8
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +28 -14
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +28 -14
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -2
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -2
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +79 -67
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +72 -60
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs +6 -6
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/development/src/lib/version.cjs +2 -2
- 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 +3 -3
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/production/run.cjs +7 -7
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +8 -8
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +28 -14
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +28 -14
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -2
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -2
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +79 -67
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +72 -60
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs +6 -6
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/production/src/lib/version.cjs +2 -2
- 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 +3 -3
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +16 -4
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/index.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +3 -2
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts +10 -2
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/resources/templates/default/README.md +3 -1
- package/resources/templates/default/admin/app/components/navigation.tsx +95 -8
- package/resources/templates/default/admin/app/pages/tenant.tsx +328 -77
- package/resources/templates/default/admin/entrypoint/components/login.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +1 -1
- package/resources/templates/default/admin/lib/binding/binding.tsx +19 -4
- package/resources/templates/default/admin/lib/binding/delete.tsx +37 -3
- package/resources/templates/default/admin/lib/binding/hooks.tsx +65 -3
- package/resources/templates/default/admin/lib/binding/identity.tsx +17 -4
- package/resources/templates/default/admin/lib/binding/index.ts +5 -5
- package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +15 -3
- package/resources/templates/default/admin/lib/binding/persist.tsx +27 -5
- package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +15 -11
- package/resources/templates/default/admin/lib/block-repeater/index.ts +1 -1
- package/resources/templates/default/admin/lib/board/board.tsx +2 -2
- package/resources/templates/default/admin/lib/board/index.ts +1 -1
- package/resources/templates/default/admin/lib/buttons/back-button.tsx +22 -2
- package/resources/templates/default/admin/lib/buttons/index.ts +2 -2
- package/resources/templates/default/admin/lib/buttons/link-back-button.tsx +11 -2
- package/resources/templates/default/admin/lib/datagrid/cells.tsx +3 -3
- package/resources/templates/default/admin/lib/datagrid/column-header.tsx +4 -4
- package/resources/templates/default/admin/lib/datagrid/columns.tsx +28 -14
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/default/admin/lib/datagrid/export.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +13 -13
- package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +37 -16
- package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +13 -12
- package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +56 -22
- package/resources/templates/default/admin/lib/datagrid/filters/index.ts +7 -7
- package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +18 -0
- package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +10 -13
- package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +8 -8
- package/resources/templates/default/admin/lib/datagrid/filters/text.tsx +9 -9
- package/resources/templates/default/admin/lib/datagrid/grid.tsx +31 -23
- package/resources/templates/default/admin/lib/datagrid/index.ts +12 -12
- package/resources/templates/default/admin/lib/datagrid/labels.tsx +22 -4
- package/resources/templates/default/admin/lib/datagrid/layout-switcher.tsx +10 -4
- package/resources/templates/default/admin/lib/datagrid/loader.tsx +4 -4
- package/resources/templates/default/admin/lib/datagrid/pagination.tsx +16 -6
- package/resources/templates/default/admin/lib/datagrid/table.tsx +8 -6
- package/resources/templates/default/admin/lib/datagrid/tiles.tsx +6 -5
- package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +15 -19
- package/resources/templates/default/admin/lib/datagrid/ui.tsx +3 -3
- package/resources/templates/default/admin/lib/dev/index.ts +2 -2
- package/resources/templates/default/admin/lib/dev/login-panel.tsx +12 -3
- package/resources/templates/default/admin/lib/dev/todo.tsx +12 -0
- package/resources/templates/default/admin/lib/dict.ts +0 -261
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +85 -4
- package/resources/templates/default/admin/lib/dimensions/index.ts +1 -1
- package/resources/templates/default/admin/lib/editor/block-editor.tsx +72 -3
- package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +54 -11
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/ListItemRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/OrderedListRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/index.ts +6 -6
- package/resources/templates/default/admin/lib/editor/editor-block.tsx +54 -3
- package/resources/templates/default/admin/lib/editor/index.ts +6 -6
- package/resources/templates/default/admin/lib/editor/plugins.tsx +46 -2
- package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +44 -0
- package/resources/templates/default/admin/lib/editor/rich-text.tsx +31 -3
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +34 -2
- package/resources/templates/default/admin/lib/errors/index.ts +1 -1
- package/resources/templates/default/admin/lib/errors/use-error-formatter.ts +22 -1
- package/resources/templates/default/admin/lib/field/formatted-field.tsx +16 -1
- package/resources/templates/default/admin/lib/field/index.ts +2 -1
- package/resources/templates/default/admin/lib/field/list-field.tsx +56 -0
- package/resources/templates/default/admin/lib/form/container.tsx +33 -3
- package/resources/templates/default/admin/lib/form/index.ts +6 -5
- package/resources/templates/default/admin/lib/form/inputs.tsx +105 -6
- package/resources/templates/default/admin/lib/form/labels.tsx +1 -1
- package/resources/templates/default/admin/lib/form/select.tsx +162 -5
- package/resources/templates/default/admin/lib/form/ui.tsx +2 -2
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +159 -5
- package/resources/templates/default/admin/lib/form/upload.tsx +116 -3
- package/resources/templates/default/admin/lib/formatting/formatting.ts +106 -1
- package/resources/templates/default/admin/lib/formatting/index.ts +1 -1
- package/resources/templates/default/admin/lib/images/formatImageResizeUrl.ts +19 -0
- package/resources/templates/default/admin/lib/images/index.ts +1 -1
- package/resources/templates/default/admin/lib/index.ts +54 -0
- package/resources/templates/default/admin/lib/labels/index.ts +2 -2
- package/resources/templates/default/admin/lib/layout/index.ts +3 -3
- package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +5 -5
- package/resources/templates/default/admin/lib/layout/layout.tsx +3 -3
- package/resources/templates/default/admin/lib/outdated-application-dialog/index.ts +1 -1
- package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +2 -2
- package/resources/templates/default/admin/lib/repeater/index.ts +1 -1
- package/resources/templates/default/admin/lib/repeater/repeater.tsx +26 -9
- package/resources/templates/default/admin/lib/select/create-new.tsx +19 -3
- package/resources/templates/default/admin/lib/select/filter.tsx +8 -2
- package/resources/templates/default/admin/lib/select/highlight.tsx +16 -0
- package/resources/templates/default/admin/lib/select/index.ts +6 -6
- package/resources/templates/default/admin/lib/select/list.tsx +30 -6
- package/resources/templates/default/admin/lib/select/multi-select.tsx +41 -4
- package/resources/templates/default/admin/lib/select/select.tsx +44 -6
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +15 -6
- package/resources/templates/default/admin/lib/select/ui.tsx +100 -4
- package/resources/templates/default/admin/lib/tenant/config/auth-policy-list.tsx +86 -0
- package/resources/templates/default/admin/lib/tenant/config/common.tsx +71 -0
- package/resources/templates/default/admin/lib/tenant/config/identity-provider-list.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/config/index.ts +5 -0
- package/resources/templates/default/admin/lib/tenant/config/mail-template-list.tsx +108 -0
- package/resources/templates/default/admin/lib/tenant/config/tenant-config-view.tsx +182 -0
- package/resources/templates/default/admin/lib/tenant/dict.ts +770 -0
- package/resources/templates/default/admin/lib/tenant/errors.ts +10 -0
- package/resources/templates/default/admin/lib/tenant/forms/add-project-member.tsx +57 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/change-my-profile.tsx +40 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-profile.tsx +55 -0
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +12 -5
- package/resources/templates/default/admin/lib/tenant/forms/confirm-email-change.tsx +38 -0
- package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +5 -5
- package/resources/templates/default/admin/lib/tenant/forms/create-global-api-key.tsx +69 -0
- package/resources/templates/default/admin/lib/tenant/forms/global-roles-control.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/forms/index.ts +23 -8
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +46 -8
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +8 -14
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +7 -5
- package/resources/templates/default/admin/lib/tenant/forms/mfa-code-fields.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +8 -14
- package/resources/templates/default/admin/lib/tenant/forms/request-email-verification.tsx +35 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-person-password.tsx +58 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-project-secret.tsx +59 -0
- package/resources/templates/default/admin/lib/tenant/forms/sign-up.tsx +73 -0
- package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +14 -5
- package/resources/templates/default/admin/lib/tenant/forms/verify-email.tsx +38 -0
- package/resources/templates/default/admin/lib/tenant/hooks/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/hooks/useInvite.ts +41 -0
- package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +32 -3
- package/resources/templates/default/admin/lib/tenant/idp/identity-provider-connections.tsx +124 -0
- package/resources/templates/default/admin/lib/tenant/idp/index.ts +1 -0
- package/resources/templates/default/admin/lib/tenant/index.ts +10 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +161 -23
- package/resources/templates/default/admin/lib/tenant/listing/auth-log-list.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/global-api-key-list.tsx +149 -0
- package/resources/templates/default/admin/lib/tenant/listing/index.ts +11 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +28 -19
- package/resources/templates/default/admin/lib/tenant/listing/mfa.tsx +29 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-actions.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-detail.tsx +141 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +17 -6
- package/resources/templates/default/admin/lib/tenant/listing/persons-list.tsx +128 -0
- package/resources/templates/default/admin/lib/tenant/listing/project-secret-list.tsx +82 -0
- package/resources/templates/default/admin/lib/tenant/otp/backup-codes.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/otp/email-otp-setup.tsx +133 -0
- package/resources/templates/default/admin/lib/tenant/otp/index.ts +3 -1
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +6 -6
- package/resources/templates/default/admin/lib/tenant/security/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/security/passwordless-toggle.tsx +63 -0
- package/resources/templates/default/admin/lib/tenant/security/session-list.tsx +143 -0
- package/resources/templates/default/admin/lib/toast/index.ts +2 -2
- package/resources/templates/default/admin/lib/toast/toast.tsx +3 -3
- package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +114 -3
- package/resources/templates/default/admin/lib/ui/avatar.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/button.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/collapsible.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/dialog.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/dimension.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/divider.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/dropdown.tsx +3 -3
- package/resources/templates/default/admin/lib/ui/input.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/label.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/loader.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/menu.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/overlay.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/popover.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/progress.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/property-list.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/scroll-area.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/select.tsx +44 -2
- package/resources/templates/default/admin/lib/ui/separator.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/sheet.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +8 -8
- package/resources/templates/default/admin/lib/ui/skeleton.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/switch.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/table.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/textarea.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/toggle-group.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/toggle.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -2
- package/resources/templates/default/admin/lib/upload/dropzone.tsx +20 -3
- package/resources/templates/default/admin/lib/upload/index.ts +3 -3
- package/resources/templates/default/admin/lib/upload/repeater.tsx +5 -1
- package/resources/templates/default/admin/lib/upload/ui.tsx +2 -2
- package/resources/templates/default/admin/lib/upload/upload-progress.tsx +6 -6
- package/resources/templates/default/admin/lib/upload/view.tsx +4 -4
- package/resources/templates/default/admin/lib/utils/cn.ts +18 -0
- package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +33 -0
- package/resources/templates/default/admin/lib/utils/index.ts +2 -2
- package/resources/templates/default/admin/lib/utils/uic.tsx +59 -0
- package/resources/templates/default/admin/lib/utils/use-mobile.ts +19 -0
- package/resources/templates/default/admin/package.json +1 -0
- package/resources/templates/default/docker/object-storage/README.md +13 -0
- package/resources/templates/default/docker/object-storage/identities.json +13 -0
- package/resources/templates/default/docker-compose.yaml +29 -7
- package/resources/templates/default/scripts/assemble-ui-lib.mjs +132 -0
- package/resources/templates/default/scripts/update-ui-lib.sh +101 -185
- package/src/commands/WorkspaceCreateCommand.ts +45 -17
- package/src/commands/index.ts +1 -1
- package/src/lib/FileSystem.ts +2 -2
- package/src/lib/TemplateInstaller.ts +87 -69
- package/src/lib/version.ts +1 -1
- package/src/run.ts +11 -10
- package/tests/cases/unit/create-process.test.ts +66 -0
- package/tests/cases/unit/template-installer-cleanup.test.ts +150 -0
- package/tests/cases/unit/workspace-create.test.ts +81 -0
|
@@ -3,8 +3,8 @@ import { createContext } from '@contember/react-utils'
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority'
|
|
4
4
|
import { ChevronRight } from 'lucide-react'
|
|
5
5
|
import { Children, isValidElement, ReactNode, useMemo } from 'react'
|
|
6
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible'
|
|
7
|
-
import { SidebarMenu, SidebarMenuButton, sidebarMenuButtonVariants, SidebarMenuItem, SidebarMenuSub } from './sidebar'
|
|
6
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible.js'
|
|
7
|
+
import { SidebarMenu, SidebarMenuButton, sidebarMenuButtonVariants, SidebarMenuItem, SidebarMenuSub } from './sidebar.js'
|
|
8
8
|
|
|
9
9
|
export type MenuItemProps = {
|
|
10
10
|
icon?: ReactNode
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover'
|
|
3
|
-
import { cn, uic } from '../utils'
|
|
4
|
-
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks'
|
|
3
|
+
import { cn, uic } from '../utils/index.js'
|
|
4
|
+
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks.js'
|
|
5
5
|
|
|
6
6
|
const { Component: Popover, useOpen: usePopoverOpenState } = createComponentOpenHooks(PopoverPrimitive.Root)
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ProgressPrimitive from '@radix-ui/react-progress'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { uic } from '../utils'
|
|
3
|
+
import { uic } from '../utils/index.js'
|
|
4
4
|
|
|
5
5
|
const ProgressRoot = uic(ProgressPrimitive.Root, {
|
|
6
6
|
baseClass: 'relative h-1.5 w-full overflow-hidden rounded-full bg-primary/20',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react'
|
|
2
|
-
import { uic } from '../utils'
|
|
2
|
+
import { uic } from '../utils/index.js'
|
|
3
3
|
|
|
4
4
|
export const PropertyList = uic('div', {
|
|
5
5
|
baseClass: 'relative overflow-auto bg-gray-50/50 max-w-lg border border-gray-200 rounded-md grid grid-cols-[max-content_1fr]',
|
|
@@ -1,8 +1,50 @@
|
|
|
1
1
|
import * as SelectPrimitive from '@radix-ui/react-select'
|
|
2
2
|
import { Check, ChevronDown, ChevronUp } from 'lucide-react'
|
|
3
|
-
import { uic } from '../utils'
|
|
4
|
-
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks'
|
|
3
|
+
import { uic } from '../utils/index.js'
|
|
4
|
+
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks.js'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Select Component
|
|
8
|
+
*
|
|
9
|
+
* ### Example: Basic
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Select>
|
|
12
|
+
* <SelectTrigger>Choose</SelectTrigger>
|
|
13
|
+
* <SelectContent>
|
|
14
|
+
* <SelectItem value="apple">Apple</SelectItem>
|
|
15
|
+
* <SelectItem value="banana">Banana</SelectItem>
|
|
16
|
+
* </SelectContent>
|
|
17
|
+
* </Select>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ### Example: With Group
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Select>
|
|
23
|
+
* <SelectTrigger>Choose country</SelectTrigger>
|
|
24
|
+
* <SelectContent>
|
|
25
|
+
* <SelectGroup>
|
|
26
|
+
* <SelectItem value="apple">Apple</SelectItem>
|
|
27
|
+
* <SelectItem value="banana">Banana</SelectItem>
|
|
28
|
+
* </SelectGroup>
|
|
29
|
+
* <SelectGroup>
|
|
30
|
+
* <SelectItem value="cucumber">Cucumber</SelectItem>
|
|
31
|
+
* <SelectItem value="paprika">Paprika</SelectItem>
|
|
32
|
+
* </SelectGroup>
|
|
33
|
+
* </SelectContent>
|
|
34
|
+
* </Select>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ### Sub-components
|
|
38
|
+
* - {@link SelectTrigger}
|
|
39
|
+
* - {@link SelectContent}
|
|
40
|
+
* - {@link SelectItem}
|
|
41
|
+
* - {@link SelectGroup}
|
|
42
|
+
* - {@link SelectValue}
|
|
43
|
+
* - {@link SelectLabel}
|
|
44
|
+
*
|
|
45
|
+
* ## Hooks
|
|
46
|
+
* - {@link useSelectOpenState}
|
|
47
|
+
*/
|
|
6
48
|
export const { Component: Select, useOpen: useSelectOpenState } = createComponentOpenHooks(SelectPrimitive.Root)
|
|
7
49
|
|
|
8
50
|
export const SelectGroup = SelectPrimitive.Group
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import * as SheetPrimitive from '@radix-ui/react-dialog'
|
|
3
|
-
import { uic } from '../utils/uic'
|
|
3
|
+
import { uic } from '../utils/uic.js'
|
|
4
4
|
import { XIcon } from 'lucide-react'
|
|
5
|
-
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks'
|
|
5
|
+
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks.js'
|
|
6
6
|
|
|
7
7
|
export const { Component: Sheet, useOpen: useSheetOpenState } = createComponentOpenHooks(SheetPrimitive.Root)
|
|
8
8
|
|
|
@@ -4,14 +4,14 @@ import { Slot } from '@radix-ui/react-slot'
|
|
|
4
4
|
import { cva, VariantProps } from 'class-variance-authority'
|
|
5
5
|
import { PanelLeft } from 'lucide-react'
|
|
6
6
|
import { ComponentProps, CSSProperties, ElementRef, forwardRef, PropsWithChildren, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'
|
|
7
|
-
import { cn, uic } from '../utils'
|
|
8
|
-
import { useIsMobile } from '../utils/use-mobile'
|
|
9
|
-
import { Button } from './button'
|
|
10
|
-
import { Input } from './input'
|
|
11
|
-
import { Separator } from './separator'
|
|
12
|
-
import { Sheet, SheetContent } from './sheet'
|
|
13
|
-
import { Skeleton } from './skeleton'
|
|
14
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip'
|
|
7
|
+
import { cn, uic } from '../utils/index.js'
|
|
8
|
+
import { useIsMobile } from '../utils/use-mobile.js'
|
|
9
|
+
import { Button } from './button.js'
|
|
10
|
+
import { Input } from './input.js'
|
|
11
|
+
import { Separator } from './separator.js'
|
|
12
|
+
import { Sheet, SheetContent } from './sheet.js'
|
|
13
|
+
import { Skeleton } from './skeleton.js'
|
|
14
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip.js'
|
|
15
15
|
|
|
16
16
|
const SIDEBAR_COOKIE_NAME = 'sidebar:state'
|
|
17
17
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group'
|
|
2
2
|
import * as React from 'react'
|
|
3
|
-
import { cn, uic } from '../utils'
|
|
4
|
-
import { toggleConfig, ToggleProps } from './toggle'
|
|
3
|
+
import { cn, uic } from '../utils/index.js'
|
|
4
|
+
import { toggleConfig, ToggleProps } from './toggle.js'
|
|
5
5
|
|
|
6
6
|
const ToggleGroupContext = React.createContext<ToggleProps>({
|
|
7
7
|
size: 'default',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
|
|
2
|
-
import { uic } from '../utils'
|
|
3
|
-
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks'
|
|
2
|
+
import { uic } from '../utils/index.js'
|
|
3
|
+
import { createComponentOpenHooks } from '../utils/createComponentOpenHooks.js'
|
|
4
4
|
|
|
5
5
|
export const TooltipProvider = TooltipPrimitive.Provider
|
|
6
6
|
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { UploaderDropzoneArea, UploaderDropzoneRoot } from '@contember/react-uploader-dropzone'
|
|
3
3
|
import { useUploaderStateFiles } from '@contember/react-uploader'
|
|
4
|
-
import { UploaderDropzoneAreaUI, UploaderDropzoneWrapperUI, UploaderInactiveDropzoneUI } from './ui'
|
|
4
|
+
import { UploaderDropzoneAreaUI, UploaderDropzoneWrapperUI, UploaderInactiveDropzoneUI } from './ui.js'
|
|
5
5
|
import { ReactNode } from 'react'
|
|
6
6
|
import { UploadIcon } from 'lucide-react'
|
|
7
|
-
import { dict } from '
|
|
8
|
-
import { Button } from '
|
|
7
|
+
import { dict } from '~/lib'
|
|
8
|
+
import { Button } from '~/lib'
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* `UploaderDropzone` renders a file drop area UI for uploading files, with optional
|
|
12
|
+
* placeholder customization and conditional display of a loader while uploads are in progress.
|
|
13
|
+
*
|
|
14
|
+
* Requires usage within an uploader context providing file upload state.
|
|
15
|
+
*
|
|
16
|
+
* - Displays a loader when uploads are active and `inactiveOnUpload` is `true`
|
|
17
|
+
* - Supports custom placeholder content via `dropzonePlaceholder`
|
|
18
|
+
*
|
|
19
|
+
* ## Example: Basic usage with custom placeholder
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <UploaderDropzone
|
|
22
|
+
* inactiveOnUpload
|
|
23
|
+
* dropzonePlaceholder={<div>Drop files here or click to upload</div>}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
10
27
|
export const UploaderDropzone = ({ inactiveOnUpload, dropzonePlaceholder }: { inactiveOnUpload?: boolean; dropzonePlaceholder?: ReactNode }) => {
|
|
11
28
|
const filesInProgress = useUploaderStateFiles({ state: ['uploading', 'initial', 'finalizing'] })
|
|
12
29
|
const showLoader = inactiveOnUpload && filesInProgress.length > 0
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './dropzone'
|
|
2
|
-
export * from './ui'
|
|
3
|
-
export * from './view'
|
|
1
|
+
export * from './dropzone.js'
|
|
2
|
+
export * from './ui.js'
|
|
3
|
+
export * from './view.js'
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { DropIndicator } from '
|
|
1
|
+
import { DropIndicator } from '~/lib'
|
|
2
2
|
import * as React from 'react'
|
|
3
3
|
import { RepeaterSortableDropIndicator } from '@contember/react-repeater-dnd-kit'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* UploaderRepeaterDropIndicator is a component that renders a drop indicator for a repeater.
|
|
7
|
+
* It is used to indicate where an item can be dropped in a repeater.
|
|
8
|
+
*/
|
|
5
9
|
export const UploaderRepeaterDropIndicator = ({ position }: { position: 'before' | 'after' }) => (
|
|
6
10
|
<div className={'relative'}>
|
|
7
11
|
<RepeaterSortableDropIndicator position={position}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
|
-
import { Loader } from '
|
|
2
|
+
import { Loader } from '~/lib'
|
|
3
3
|
import { GripIcon } from 'lucide-react'
|
|
4
|
-
import { uic } from '
|
|
4
|
+
import { uic } from '~/lib'
|
|
5
5
|
|
|
6
6
|
export const UploaderDropzoneWrapperUI = uic('div', { baseClass: 'rounded-sm border border-gray-200 p-1 shadow-sm' })
|
|
7
7
|
export const UploaderDropzoneAreaUI = uic('div', {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CheckIcon, FileIcon, Loader2Icon, StopCircleIcon, XIcon } from 'lucide-react'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Progress } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Progress } from '~/lib'
|
|
4
4
|
import * as React from 'react'
|
|
5
5
|
import { ReactNode, useEffect } from 'react'
|
|
6
|
-
import { Toast } from '
|
|
7
|
-
import { dict } from '
|
|
6
|
+
import { Toast } from '~/lib'
|
|
7
|
+
import { dict } from '~/lib'
|
|
8
8
|
import {
|
|
9
9
|
UploaderEachFile,
|
|
10
10
|
UploaderError,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
UploaderFileStateSwitch,
|
|
15
15
|
UploaderFileStateUploading,
|
|
16
16
|
} from '@contember/react-uploader'
|
|
17
|
-
import { formatBytes } from '../formatting/formatting'
|
|
18
|
-
import { Loader } from '
|
|
17
|
+
import { formatBytes } from '../formatting/formatting.js'
|
|
18
|
+
import { Loader } from '~/lib'
|
|
19
19
|
|
|
20
20
|
const formatError = (error: unknown) => {
|
|
21
21
|
if (error instanceof UploaderError) {
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
UploaderBase,
|
|
10
10
|
VideoFileDataExtractorProps,
|
|
11
11
|
} from '@contember/react-uploader'
|
|
12
|
-
import { formatBytes, formatDate, formatDuration } from '../formatting'
|
|
13
|
-
import { Button } from '
|
|
12
|
+
import { formatBytes, formatDate, formatDuration } from '../formatting/index.js'
|
|
13
|
+
import { Button } from '~/lib'
|
|
14
14
|
import { EditIcon, FileIcon, InfoIcon, TrashIcon } from 'lucide-react'
|
|
15
|
-
import { Popover, PopoverContent, PopoverTrigger } from '
|
|
16
|
-
import { formatImageResizeUrl } from '../images'
|
|
15
|
+
import { Popover, PopoverContent, PopoverTrigger } from '~/lib'
|
|
16
|
+
import { formatImageResizeUrl } from '../images/index.js'
|
|
17
17
|
|
|
18
18
|
export type BaseFileViewProps = {
|
|
19
19
|
baseField?: SugaredRelativeSingleEntity['field']
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { ClassValue, clsx } from 'clsx'
|
|
2
2
|
import { twMerge } from 'tailwind-merge'
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* `cn` is a utility function that combines Tailwind CSS class names using `clsx`
|
|
6
|
+
* and merges conflicting classes with `twMerge`.
|
|
7
|
+
*
|
|
8
|
+
* Useful for composing conditional and dynamic className values in React components
|
|
9
|
+
* with Tailwind, ensuring the final output avoids duplicates or conflicts.
|
|
10
|
+
*
|
|
11
|
+
* ## Example: Conditional class merging
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const Button = ({ isPrimary }: { isPrimary?: boolean }) => {
|
|
14
|
+
* return (
|
|
15
|
+
* <button className={cn('px-4 py-2', isPrimary && 'bg-blue-500', 'text-white')}>
|
|
16
|
+
* Click me
|
|
17
|
+
* </button>
|
|
18
|
+
* )
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
4
22
|
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(...inputs))
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import { ComponentType, memo, SetStateAction, useCallback, useState } from 'react'
|
|
2
2
|
import { createRequiredContext } from '@contember/react-utils'
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* `createComponentOpenHooks` wraps a component that supports open state management
|
|
6
|
+
* (`open`, `defaultOpen`, `onOpenChange`) and injects context-based control and access hooks.
|
|
7
|
+
*
|
|
8
|
+
* It returns:
|
|
9
|
+
* - A `Component` wrapped with open state context
|
|
10
|
+
* - A `useOpen` hook to access and control the open state
|
|
11
|
+
*
|
|
12
|
+
* This is especially useful for modals, drawers, popovers, and similar toggleable UI components.
|
|
13
|
+
*
|
|
14
|
+
* ## Example: Creating a toggleable modal with context access
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const BaseModal: React.FC<{ open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void }> = ({ open, onOpenChange }) => (
|
|
17
|
+
* <div style={{ display: open ? 'block' : 'none' }}>
|
|
18
|
+
* <button onClick={() => onOpenChange?.(false)}>Close</button>
|
|
19
|
+
* <p>Modal Content</p>
|
|
20
|
+
* </div>
|
|
21
|
+
* )
|
|
22
|
+
*
|
|
23
|
+
* const { Component: ModalWithHooks, useOpen } = createComponentOpenHooks(BaseModal)
|
|
24
|
+
*
|
|
25
|
+
* const App = () => {
|
|
26
|
+
* const [open, setOpen] = useOpen()
|
|
27
|
+
*
|
|
28
|
+
* return (
|
|
29
|
+
* <>
|
|
30
|
+
* <button onClick={() => setOpen(true)}>Open Modal</button>
|
|
31
|
+
* <ModalWithHooks />
|
|
32
|
+
* </>
|
|
33
|
+
* )
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
4
37
|
export const createComponentOpenHooks = <
|
|
5
38
|
P extends {
|
|
6
39
|
open?: boolean
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './cn'
|
|
2
|
-
export * from './uic'
|
|
1
|
+
export * from './cn.js'
|
|
2
|
+
export * from './uic.js'
|
|
@@ -47,6 +47,65 @@ export const uiconfig = <T extends ConfigSchema | undefined>(config: Config<T, C
|
|
|
47
47
|
|
|
48
48
|
export type NoInfer<T> = T & { [K in keyof T]: T[K] }
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Props are inferred from the base element and the provided config.
|
|
52
|
+
*
|
|
53
|
+
* `uic` is a utility function that enhances a base React component with configurable
|
|
54
|
+
* styling and structural behaviors using a utility-based class variance system (e.g., `cva`).
|
|
55
|
+
*
|
|
56
|
+
* It wraps the base component and provides features including:
|
|
57
|
+
* - Variant-based styling using `cva` configuration
|
|
58
|
+
* - Optional mapping of variant values to `data-*` attributes
|
|
59
|
+
* - Conditional rendering via `asChild` to support component composition
|
|
60
|
+
* - Structural wrapping of children (`wrapInner`) and of the whole component (`wrapOuter`)
|
|
61
|
+
* - Automatic filtering of unused variant props unless passed in `passVariantProps`
|
|
62
|
+
*
|
|
63
|
+
* The `wrapInner` and `wrapOuter` props in the config allow injecting extra layout structure:
|
|
64
|
+
* - `wrapInner`: Wraps the component's children in a custom element (e.g., for padding or effects)
|
|
65
|
+
* - `wrapOuter`: Wraps the entire rendered component (e.g., for layout constraints or portals)
|
|
66
|
+
*
|
|
67
|
+
* Must be used with a `Config` object that defines styling, variant options, and optional wrappers.
|
|
68
|
+
*
|
|
69
|
+
* ## Example: Basic usage with variant styling
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const Button = uic('button', {
|
|
72
|
+
* baseClass: 'px-4 py-2 font-bold',
|
|
73
|
+
* variants: {
|
|
74
|
+
* intent: {
|
|
75
|
+
* primary: 'bg-blue-500 text-white',
|
|
76
|
+
* secondary: 'bg-gray-500 text-white',
|
|
77
|
+
* },
|
|
78
|
+
* },
|
|
79
|
+
* defaultVariants: { intent: 'primary' },
|
|
80
|
+
* displayName: 'Button',
|
|
81
|
+
* })
|
|
82
|
+
*
|
|
83
|
+
* <Button intent="secondary">Click me</Button>
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* ## Example: Using `wrapInner` and `wrapOuter`
|
|
87
|
+
* ```tsx
|
|
88
|
+
* const Card = uic('div', {
|
|
89
|
+
* baseClass: 'bg-white shadow-md rounded',
|
|
90
|
+
* wrapInner: 'section',
|
|
91
|
+
* wrapOuter: ({ children }) => <div className="p-4 border">{children}</div>,
|
|
92
|
+
* displayName: 'Card',
|
|
93
|
+
* })
|
|
94
|
+
*
|
|
95
|
+
* <Card>
|
|
96
|
+
* <p>Hello world</p>
|
|
97
|
+
* </Card>
|
|
98
|
+
*
|
|
99
|
+
* // Results in:
|
|
100
|
+
* // <div class="p-4 border">
|
|
101
|
+
* // <div class="bg-white shadow-md rounded">
|
|
102
|
+
* // <section>
|
|
103
|
+
* // <p>Hello world</p>
|
|
104
|
+
* // </section>
|
|
105
|
+
* // </div>
|
|
106
|
+
* // </div>
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
50
109
|
export const uic = <El extends React.ElementType, Variants extends ConfigSchema | undefined = undefined>(
|
|
51
110
|
Component: El,
|
|
52
111
|
config: Config<Variants, NoInfer<El>>,
|
|
@@ -2,6 +2,25 @@ import { useEffect, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
const MOBILE_BREAKPOINT = 768
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* `useIsMobile` is a responsive utility hook that returns a boolean indicating
|
|
7
|
+
* whether the current viewport width is below the mobile breakpoint (768px).
|
|
8
|
+
*
|
|
9
|
+
* Useful for conditional rendering or styling based on mobile layout needs.
|
|
10
|
+
*
|
|
11
|
+
* ## Example: Conditional rendering for mobile
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const MyComponent = () => {
|
|
14
|
+
* const isMobile = useIsMobile()
|
|
15
|
+
*
|
|
16
|
+
* return (
|
|
17
|
+
* <div>
|
|
18
|
+
* {isMobile ? <MobileMenu /> : <DesktopMenu />}
|
|
19
|
+
* </div>
|
|
20
|
+
* )
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
5
24
|
export const useIsMobile = () => {
|
|
6
25
|
const [isMobile, setIsMobile] = useState(() => typeof window !== 'undefined' ? window.innerWidth < MOBILE_BREAKPOINT : false)
|
|
7
26
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@contember/react-block-repeater": "{version}",
|
|
26
26
|
"@contember/react-board": "{version}",
|
|
27
27
|
"@contember/react-board-dnd-kit": "{version}",
|
|
28
|
+
"@contember/react-client": "{version}",
|
|
28
29
|
"@contember/react-dataview": "{version}",
|
|
29
30
|
"@contember/react-form": "{version}",
|
|
30
31
|
"@contember/react-repeater": "{version}",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Local object storage (SeaweedFS)
|
|
2
|
+
|
|
3
|
+
`identities.json` is the `-s3.config` file for the `object-storage` service in
|
|
4
|
+
`docker-compose.yaml`. JSON carries no comments, so the two identities are explained here.
|
|
5
|
+
|
|
6
|
+
- **`anonymous`** — the unauthenticated caller. `Read:contember` makes exactly one bucket publicly
|
|
7
|
+
readable, which is what the Contember engine's asset bucket needs: `generateUploadUrl` hands the
|
|
8
|
+
browser a `publicUrl` with no credentials on it. Any other bucket added to `S3_BUCKET` stays
|
|
9
|
+
private until it is listed here as well.
|
|
10
|
+
- **`contember`** — the credentials the engine signs upload and read URLs with
|
|
11
|
+
(`DEFAULT_S3_KEY` / `DEFAULT_S3_SECRET`). Local dev only; a deployed environment holds its own.
|
|
12
|
+
|
|
13
|
+
Buckets are not declared here; the service creates them from `S3_BUCKET` on start.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identities": [
|
|
3
|
+
{
|
|
4
|
+
"name": "anonymous",
|
|
5
|
+
"actions": ["Read:contember"]
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "contember",
|
|
9
|
+
"credentials": [{ "accessKey": "contember", "secretKey": "contember" }],
|
|
10
|
+
"actions": ["Admin", "Read", "Write", "List", "Tagging"]
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -18,11 +18,15 @@ services:
|
|
|
18
18
|
DEFAULT_DB_USER: 'contember'
|
|
19
19
|
DEFAULT_DB_PASSWORD: 'contember'
|
|
20
20
|
|
|
21
|
+
# The host port, not the service name: the engine only signs URLs here and hands them to the
|
|
22
|
+
# browser, which resolves them itself.
|
|
21
23
|
DEFAULT_S3_ENDPOINT: 'http://localhost:1483'
|
|
22
24
|
DEFAULT_S3_BUCKET: 'contember'
|
|
23
25
|
DEFAULT_S3_REGION: ''
|
|
24
26
|
DEFAULT_S3_KEY: 'contember'
|
|
25
27
|
DEFAULT_S3_SECRET: 'contember'
|
|
28
|
+
# A Contember provider name, not the image behind `object-storage`: it selects path-style
|
|
29
|
+
# addressing and no object ACL (public read comes from the store's own config instead).
|
|
26
30
|
DEFAULT_S3_PROVIDER: 'minio'
|
|
27
31
|
|
|
28
32
|
TENANT_MAILER_HOST: 'mailhog'
|
|
@@ -81,19 +85,37 @@ services:
|
|
|
81
85
|
timeout: 5s
|
|
82
86
|
retries: 10
|
|
83
87
|
|
|
84
|
-
|
|
85
|
-
image:
|
|
88
|
+
object-storage:
|
|
89
|
+
image: chrislusf/seaweedfs:4.42
|
|
90
|
+
|
|
91
|
+
# `mini` runs master + volume + filer + S3 in a single process. Both flags override a default
|
|
92
|
+
# that would bite you: `autoCreateBucket` is on by default and silently creates a bucket on the
|
|
93
|
+
# first write, so a typo would look like a working upload, and telemetry is on by default and
|
|
94
|
+
# reports to telemetry.seaweedfs.com every 24 h.
|
|
95
|
+
command: >
|
|
96
|
+
mini -dir=/data -s3.port=9000 -s3.config=/etc/seaweedfs/identities.json
|
|
97
|
+
-s3.autoCreateBucket=false -master.telemetry=false
|
|
86
98
|
|
|
87
99
|
environment:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
100
|
+
# Created on start, an existing one left alone. Public read and the signing credentials live
|
|
101
|
+
# in the identities file — see docker/object-storage/README.md.
|
|
102
|
+
S3_BUCKET: 'contember'
|
|
91
103
|
|
|
92
104
|
ports:
|
|
93
105
|
- '1483:9000'
|
|
94
106
|
|
|
95
107
|
volumes:
|
|
96
|
-
-
|
|
108
|
+
- object-storage-data:/data
|
|
109
|
+
- ./docker/object-storage/identities.json:/etc/seaweedfs/identities.json:ro
|
|
110
|
+
|
|
111
|
+
# The S3 port starts answering ~0.5 s before the bucket exists, so probing it (or `/healthz`)
|
|
112
|
+
# would report ready while an upload still fails with `NoSuchBucket`. The filer 404s on a bucket
|
|
113
|
+
# that isn't there yet, so ask it instead.
|
|
114
|
+
healthcheck:
|
|
115
|
+
test: [ 'CMD-SHELL', 'curl -fsS -o /dev/null "http://127.0.0.1:8888/buckets/contember/?limit=1"' ]
|
|
116
|
+
interval: 2s
|
|
117
|
+
timeout: 3s
|
|
118
|
+
retries: 30
|
|
97
119
|
|
|
98
120
|
mailhog:
|
|
99
121
|
image: mailhog/mailhog
|
|
@@ -121,4 +143,4 @@ services:
|
|
|
121
143
|
|
|
122
144
|
volumes:
|
|
123
145
|
pgsql-data: ~
|
|
124
|
-
|
|
146
|
+
object-storage-data: ~
|