@m5kdev/web-ui 0.9.0 → 0.9.1
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/packages/backend/dist/src/modules/base/base.procedure.d.mts +11 -1
- package/dist/packages/backend/dist/src/modules/base/base.procedure.d.ts +11 -1
- package/dist/packages/backend/dist/src/modules/base/base.service.d.mts +1 -1
- package/dist/packages/backend/dist/src/modules/base/base.service.d.ts +1 -1
- package/dist/packages/backend/dist/src/modules/billing/billing.repository.d.mts +10 -10
- package/dist/packages/backend/dist/src/modules/billing/billing.repository.d.ts +10 -10
- package/dist/packages/backend/dist/src/modules/billing/billing.service.d.mts +6 -6
- package/dist/packages/backend/dist/src/modules/billing/billing.service.d.ts +6 -6
- package/dist/src/components/AvatarUpload.js +1 -1
- package/dist/src/components/AvatarUpload.mjs +2 -2
- package/dist/src/components/AvatarUpload.mjs.map +1 -1
- package/dist/src/components/Calendar.d.mts +1 -1
- package/dist/src/components/CardsSelect.js +1 -1
- package/dist/src/components/CardsSelect.mjs +1 -1
- package/dist/src/components/CollapsibleSidebarMenuItem.d.mts +1 -1
- package/dist/src/components/ColorPicker.d.mts +1 -1
- package/dist/src/components/ColorPicker.js +1 -1
- package/dist/src/components/ColorPicker.mjs +1 -1
- package/dist/src/components/CopyButton.d.mts +1 -1
- package/dist/src/components/CopyButton.js +1 -1
- package/dist/src/components/CopyButton.mjs +2 -2
- package/dist/src/components/CopyButton.mjs.map +1 -1
- package/dist/src/components/CropDialog.js +1 -1
- package/dist/src/components/CropDialog.mjs +1 -1
- package/dist/src/components/DialogProvider.d.mts +1 -1
- package/dist/src/components/DialogProvider.js +1 -1
- package/dist/src/components/DialogProvider.mjs +2 -2
- package/dist/src/components/DialogProvider.mjs.map +1 -1
- package/dist/src/components/FileDropzone.js +1 -1
- package/dist/src/components/FileDropzone.mjs +3 -3
- package/dist/src/components/FileDropzone.mjs.map +1 -1
- package/dist/src/components/MultiSelectDropdown.js +1 -1
- package/dist/src/components/MultiSelectDropdown.mjs +7 -7
- package/dist/src/components/MultiSelectDropdown.mjs.map +1 -1
- package/dist/src/components/Orb.js +1 -1
- package/dist/src/components/Orb.mjs +1 -1
- package/dist/src/components/PageAlert.d.mts +1 -1
- package/dist/src/components/PageAlert.d.ts +1 -1
- package/dist/src/components/PageAlert.js +1 -1
- package/dist/src/components/PageAlert.mjs +1 -1
- package/dist/src/components/SelectChips.d.mts +1 -1
- package/dist/src/components/SelectChips.js +1 -1
- package/dist/src/components/SelectChips.mjs +1 -1
- package/dist/src/components/SidebarItem.d.mts +1 -1
- package/dist/src/components/TablerIconPicker.d.mts +1 -1
- package/dist/src/components/TablerIconPicker.js +1 -1
- package/dist/src/components/TablerIconPicker.mjs +1 -1
- package/dist/src/components/app-header.js +1 -1
- package/dist/src/components/app-header.mjs +2 -2
- package/dist/src/components/app-header.mjs.map +1 -1
- package/dist/src/components/blur-card.d.mts +1 -1
- package/dist/src/components/blur-card.js +1 -1
- package/dist/src/components/blur-card.mjs +1 -1
- package/dist/src/components/features-section-demo-1.js +1 -1
- package/dist/src/components/features-section-demo-1.mjs +1 -1
- package/dist/src/components/features-section-demo-3.js +1 -1
- package/dist/src/components/features-section-demo-3.mjs +1 -1
- package/dist/src/components/shared/ButtonCopy.js +1 -1
- package/dist/src/components/shared/ButtonCopy.mjs +2 -2
- package/dist/src/components/shared/ButtonCopy.mjs.map +1 -1
- package/dist/src/components/team-switcher.d.mts +1 -1
- package/dist/src/components/team-switcher.js +1 -1
- package/dist/src/components/team-switcher.mjs +1 -1
- package/dist/src/components/theme-provider.js +1 -1
- package/dist/src/components/theme-provider.mjs +1 -1
- package/dist/src/components/typewriter.js +1 -1
- package/dist/src/components/typewriter.mjs +1 -1
- package/dist/src/components/ui/alert-dialog.d.mts +1 -1
- package/dist/src/components/ui/alert.d.mts +1 -1
- package/dist/src/components/ui/avatar.js +1 -1
- package/dist/src/components/ui/avatar.mjs +1 -1
- package/dist/src/components/ui/badge.d.mts +1 -1
- package/dist/src/components/ui/bento-grid2.d.mts +1 -1
- package/dist/src/components/ui/breadcrumb.d.mts +1 -1
- package/dist/src/components/ui/breadcrumb.js +1 -1
- package/dist/src/components/ui/breadcrumb.mjs +1 -1
- package/dist/src/components/ui/button.js +1 -1
- package/dist/src/components/ui/button.mjs +1 -1
- package/dist/src/components/ui/card.js +1 -1
- package/dist/src/components/ui/card.mjs +1 -1
- package/dist/src/components/ui/checkbox.js +1 -1
- package/dist/src/components/ui/checkbox.mjs +1 -1
- package/dist/src/components/ui/dialog.d.mts +1 -1
- package/dist/src/components/ui/dropdown-menu.d.mts +1 -1
- package/dist/src/components/ui/dropdown-menu.js +1 -1
- package/dist/src/components/ui/dropdown-menu.mjs +1 -1
- package/dist/src/components/ui/floating-navbar.d.mts +1 -1
- package/dist/src/components/ui/floating-navbar.js +1 -1
- package/dist/src/components/ui/floating-navbar.mjs +1 -1
- package/dist/src/components/ui/form.d.mts +1 -1
- package/dist/src/components/ui/form.js +1 -1
- package/dist/src/components/ui/form.mjs +1 -1
- package/dist/src/components/ui/image.js +1 -1
- package/dist/src/components/ui/image.mjs +1 -1
- package/dist/src/components/ui/input.js +1 -1
- package/dist/src/components/ui/input.mjs +1 -1
- package/dist/src/components/ui/label.js +1 -1
- package/dist/src/components/ui/label.mjs +1 -1
- package/dist/src/components/ui/pagination.d.mts +1 -1
- package/dist/src/components/ui/progress.js +1 -1
- package/dist/src/components/ui/progress.mjs +1 -1
- package/dist/src/components/ui/resizable-navbar.d.mts +1 -1
- package/dist/src/components/ui/resizable-navbar.js +1 -1
- package/dist/src/components/ui/resizable-navbar.mjs +1 -1
- package/dist/src/components/ui/segment-control.js +1 -1
- package/dist/src/components/ui/segment-control.mjs +3 -3
- package/dist/src/components/ui/segment-control.mjs.map +1 -1
- package/dist/src/components/ui/select.js +1 -1
- package/dist/src/components/ui/select.mjs +1 -1
- package/dist/src/components/ui/separator.js +1 -1
- package/dist/src/components/ui/separator.mjs +1 -1
- package/dist/src/components/ui/sheet.d.mts +1 -1
- package/dist/src/components/ui/sheet.js +1 -1
- package/dist/src/components/ui/sheet.mjs +1 -1
- package/dist/src/components/ui/sidebar.js +1 -1
- package/dist/src/components/ui/sidebar.mjs +1 -1
- package/dist/src/components/ui/slider.js +1 -1
- package/dist/src/components/ui/slider.mjs +1 -1
- package/dist/src/components/ui/spinner.d.mts +1 -1
- package/dist/src/components/ui/switch.js +1 -1
- package/dist/src/components/ui/switch.mjs +1 -1
- package/dist/src/components/ui/table.d.mts +1 -1
- package/dist/src/components/ui/tabs.d.mts +1 -1
- package/dist/src/components/ui/textarea.d.mts +1 -1
- package/dist/src/components/ui/timeline.d.mts +1 -1
- package/dist/src/components/ui/timeline.js +1 -1
- package/dist/src/components/ui/timeline.mjs +1 -1
- package/dist/src/components/ui/toast.js +1 -1
- package/dist/src/components/ui/toast.mjs +1 -1
- package/dist/src/components/ui/tooltip.d.mts +1 -1
- package/dist/src/components/ui/typewriter-effect.js +1 -1
- package/dist/src/components/ui/typewriter-effect.mjs +1 -1
- package/dist/src/icons/GoogleIcon.d.mts +1 -1
- package/dist/src/icons/LinkedInIcon.d.mts +1 -1
- package/dist/src/icons/MicrosoftIcon.d.mts +1 -1
- package/dist/src/modules/app/components/AppLoader.d.mts +1 -1
- package/dist/src/modules/app/components/AppLoader.js +1 -1
- package/dist/src/modules/app/components/AppLoader.mjs +1 -1
- package/dist/src/modules/app/components/AppShell.d.mts +1 -1
- package/dist/src/modules/app/components/AppSidebar.d.mts +1 -1
- package/dist/src/modules/app/components/AppSidebarHeader.js +1 -1
- package/dist/src/modules/app/components/AppSidebarHeader.mjs +1 -1
- package/dist/src/modules/app/components/AppSidebarInvites.js +1 -1
- package/dist/src/modules/app/components/AppSidebarInvites.mjs +1 -1
- package/dist/src/modules/auth/components/AdminUserManagement.js +2 -2
- package/dist/src/modules/auth/components/AdminUserManagement.mjs +6 -6
- package/dist/src/modules/auth/components/AdminUserManagement.mjs.map +1 -1
- package/dist/src/modules/auth/components/AdminWaitlist.js +1 -1
- package/dist/src/modules/auth/components/AdminWaitlist.mjs +3 -3
- package/dist/src/modules/auth/components/AdminWaitlist.mjs.map +1 -1
- package/dist/src/modules/auth/components/AuthLayout.d.mts +1 -1
- package/dist/src/modules/auth/components/AuthProviders.js +1 -1
- package/dist/src/modules/auth/components/AuthProviders.mjs +1 -1
- package/dist/src/modules/auth/components/AuthRouter.d.mts +1 -1
- package/dist/src/modules/auth/components/ClaimAccountRoute.js +1 -1
- package/dist/src/modules/auth/components/ClaimAccountRoute.mjs +1 -1
- package/dist/src/modules/auth/components/ErrorAuthRoute.js +1 -1
- package/dist/src/modules/auth/components/ErrorAuthRoute.mjs +1 -1
- package/dist/src/modules/auth/components/ForgotPasswordForm.js +1 -1
- package/dist/src/modules/auth/components/ForgotPasswordForm.mjs +1 -1
- package/dist/src/modules/auth/components/ForgotPasswordRoute.js +1 -1
- package/dist/src/modules/auth/components/ForgotPasswordRoute.mjs +1 -1
- package/dist/src/modules/auth/components/InviteFriends.js +1 -1
- package/dist/src/modules/auth/components/InviteFriends.mjs +1 -1
- package/dist/src/modules/auth/components/LastUsedBadge.d.mts +1 -1
- package/dist/src/modules/auth/components/LastUsedBadge.js +1 -1
- package/dist/src/modules/auth/components/LastUsedBadge.mjs +1 -1
- package/dist/src/modules/auth/components/LoginForm.js +1 -1
- package/dist/src/modules/auth/components/LoginForm.mjs +1 -1
- package/dist/src/modules/auth/components/LoginRoute.js +1 -1
- package/dist/src/modules/auth/components/LoginRoute.mjs +1 -1
- package/dist/src/modules/auth/components/LogoutRoute.js +1 -1
- package/dist/src/modules/auth/components/LogoutRoute.mjs +1 -1
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js +1 -1
- package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.mjs +1 -1
- package/dist/src/modules/auth/components/OrganizationMembersRoute.js +2 -2
- package/dist/src/modules/auth/components/OrganizationMembersRoute.mjs +2 -2
- package/dist/src/modules/auth/components/OrganizationPreferences.js +1 -1
- package/dist/src/modules/auth/components/OrganizationPreferences.mjs +1 -1
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.js +2 -2
- package/dist/src/modules/auth/components/OrganizationSettingsRoute.mjs +2 -2
- package/dist/src/modules/auth/components/OrganizationSwitcher.js +2 -2
- package/dist/src/modules/auth/components/OrganizationSwitcher.mjs +2 -2
- package/dist/src/modules/auth/components/PreferencesEditor.js +1 -1
- package/dist/src/modules/auth/components/PreferencesEditor.mjs +1 -1
- package/dist/src/modules/auth/components/ProfileRoute.js +1 -1
- package/dist/src/modules/auth/components/ProfileRoute.mjs +1 -1
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.js +1 -1
- package/dist/src/modules/auth/components/RangeNuqsDatePicker.mjs +1 -1
- package/dist/src/modules/auth/components/ResetPasswordForm.js +1 -1
- package/dist/src/modules/auth/components/ResetPasswordForm.mjs +1 -1
- package/dist/src/modules/auth/components/ResetPasswordRoute.js +1 -1
- package/dist/src/modules/auth/components/ResetPasswordRoute.mjs +1 -1
- package/dist/src/modules/auth/components/SignupFormRoute.js +1 -1
- package/dist/src/modules/auth/components/SignupFormRoute.mjs +1 -1
- package/dist/src/modules/auth/components/SignupRoute.js +1 -1
- package/dist/src/modules/auth/components/SignupRoute.mjs +1 -1
- package/dist/src/modules/auth/components/WaitlistCard.js +1 -1
- package/dist/src/modules/auth/components/WaitlistCard.mjs +1 -1
- package/dist/src/modules/auth/components/WaitlistCodeValidation.js +1 -1
- package/dist/src/modules/auth/components/WaitlistCodeValidation.mjs +1 -1
- package/dist/src/modules/billing/components/BillingBetaPage.d.mts +1 -1
- package/dist/src/modules/billing/components/BillingInvoicePage.js +2 -2
- package/dist/src/modules/billing/components/BillingInvoicePage.mjs +2 -2
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.js +1 -1
- package/dist/src/modules/billing/components/BillingSinglePlanSelect.mjs +1 -1
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.js +1 -1
- package/dist/src/modules/table/components/ColumnOrderAndVisibility.mjs +1 -1
- package/dist/src/modules/table/components/NuqsTable.js +1 -1
- package/dist/src/modules/table/components/NuqsTable.mjs +3 -3
- package/dist/src/modules/table/components/NuqsTable.mjs.map +1 -1
- package/dist/src/modules/table/components/TableFiltering.js +1 -1
- package/dist/src/modules/table/components/TableFiltering.mjs +1 -1
- package/dist/src/modules/table/components/TableGroupBy.js +1 -1
- package/dist/src/modules/table/components/TableGroupBy.mjs +1 -1
- package/dist/src/modules/table/components/TablePagination.js +1 -1
- package/dist/src/modules/table/components/TablePagination.mjs +1 -1
- package/package.json +5 -5
|
@@ -14,6 +14,8 @@ type ServiceProcedureContext = {
|
|
|
14
14
|
} & Record<string, unknown>;
|
|
15
15
|
type ServiceProcedureState = Record<string, unknown>;
|
|
16
16
|
type ServiceProcedureStoredValue<T> = [T] extends [undefined] ? undefined : Awaited<T>;
|
|
17
|
+
/** Value stored in procedure state after `loadResource` (loader may return null/undefined; state is narrowed). */
|
|
18
|
+
type ServiceProcedureLoadedResource<TOutput> = NonNullable<ServiceProcedureStoredValue<TOutput>>;
|
|
17
19
|
type ServiceProcedureResultLike<T> = T | ServerResult<T> | Promise<T | ServerResult<T>>;
|
|
18
20
|
type ServiceProcedureContextFilterScope = ActorScope;
|
|
19
21
|
type ServiceProcedureContextFilteredInput<TInput> = Extract<NonNullable<TInput>, QueryInput>;
|
|
@@ -35,6 +37,14 @@ type ServiceProcedureInputMapper<TInput, TCtx extends ServiceProcedureContext, R
|
|
|
35
37
|
type ServiceProcedureHandler<TInput, TCtx extends ServiceProcedureContext, Repositories extends RepositoryMap, Services extends ServiceMap, State extends ServiceProcedureState, TOutput> = (args: ServiceProcedureArgs<TInput, TCtx, Repositories, Services, State>) => ServiceProcedureResultLike<TOutput>;
|
|
36
38
|
interface ServiceProcedureBuilder<TInput, TCtx extends ServiceProcedureContext, Repositories extends RepositoryMap, Services extends ServiceMap, State extends ServiceProcedureState = Record<string, never>> {
|
|
37
39
|
use<StepName extends string, TOutput = void>(stepName: StepName, step: ServiceProcedureStep<TInput, TCtx, Repositories, Services, State, TOutput>): ServiceProcedureBuilder<TInput, TCtx, Repositories, Services, State & Record<StepName, ServiceProcedureStoredValue<TOutput>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Loads a value from a `ServerResult` (or plain value) and stores it under `stepName`.
|
|
42
|
+
* Propagates `Err`; if the resolved value is falsy, returns `NOT_FOUND`.
|
|
43
|
+
* For valid numeric `0` or empty string, use `.use()` instead of this helper.
|
|
44
|
+
*/
|
|
45
|
+
loadResource<StepName extends string, TOutput>(stepName: StepName, step: ServiceProcedureStep<TInput, TCtx, Repositories, Services, State, TOutput>, options?: {
|
|
46
|
+
notFoundMessage?: string;
|
|
47
|
+
}): ServiceProcedureBuilder<TInput, TCtx, Repositories, Services, State & Record<StepName, ServiceProcedureLoadedResource<TOutput>>>;
|
|
38
48
|
mapInput<StepName extends string, TNextInput>(stepName: StepName, step: ServiceProcedureInputMapper<TInput, TCtx, Repositories, Services, State, TNextInput>): ServiceProcedureBuilder<ServiceProcedureStoredValue<TNextInput>, TCtx, Repositories, Services, State & Record<StepName, ServiceProcedureStoredValue<TNextInput>>>;
|
|
39
49
|
addContextFilter<TInclude extends readonly ServiceProcedureContextFilterScope[] | undefined = undefined>(include?: TInclude): ServiceProcedureBuilder<ServiceProcedureContextFilteredInput<TInput>, TCtx & ServiceProcedureAuthContext<ServiceProcedureRequiredScopeFromFilter<TInclude>>, Repositories, Services, State & {
|
|
40
50
|
contextFilter: ServiceProcedureContextFilteredInput<TInput>;
|
|
@@ -43,5 +53,5 @@ interface ServiceProcedureBuilder<TInput, TCtx extends ServiceProcedureContext,
|
|
|
43
53
|
handle<TOutput>(handler: ServiceProcedureHandler<TInput, TCtx, Repositories, Services, State, TOutput>): ServiceProcedure<TInput, TCtx, TOutput>;
|
|
44
54
|
}
|
|
45
55
|
//#endregion
|
|
46
|
-
export { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper };
|
|
56
|
+
export { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper, ServiceProcedureLoadedResource };
|
|
47
57
|
//# sourceMappingURL=base.procedure.d.mts.map
|
|
@@ -14,6 +14,8 @@ type ServiceProcedureContext = {
|
|
|
14
14
|
} & Record<string, unknown>;
|
|
15
15
|
type ServiceProcedureState = Record<string, unknown>;
|
|
16
16
|
type ServiceProcedureStoredValue<T> = [T] extends [undefined] ? undefined : Awaited<T>;
|
|
17
|
+
/** Value stored in procedure state after `loadResource` (loader may return null/undefined; state is narrowed). */
|
|
18
|
+
type ServiceProcedureLoadedResource<TOutput> = NonNullable<ServiceProcedureStoredValue<TOutput>>;
|
|
17
19
|
type ServiceProcedureResultLike<T> = T | ServerResult<T> | Promise<T | ServerResult<T>>;
|
|
18
20
|
type ServiceProcedureContextFilterScope = ActorScope;
|
|
19
21
|
type ServiceProcedureContextFilteredInput<TInput> = Extract<NonNullable<TInput>, QueryInput>;
|
|
@@ -35,6 +37,14 @@ type ServiceProcedureInputMapper<TInput, TCtx extends ServiceProcedureContext, R
|
|
|
35
37
|
type ServiceProcedureHandler<TInput, TCtx extends ServiceProcedureContext, Repositories extends RepositoryMap, Services extends ServiceMap, State extends ServiceProcedureState, TOutput> = (args: ServiceProcedureArgs<TInput, TCtx, Repositories, Services, State>) => ServiceProcedureResultLike<TOutput>;
|
|
36
38
|
interface ServiceProcedureBuilder<TInput, TCtx extends ServiceProcedureContext, Repositories extends RepositoryMap, Services extends ServiceMap, State extends ServiceProcedureState = Record<string, never>> {
|
|
37
39
|
use<StepName extends string, TOutput = void>(stepName: StepName, step: ServiceProcedureStep<TInput, TCtx, Repositories, Services, State, TOutput>): ServiceProcedureBuilder<TInput, TCtx, Repositories, Services, State & Record<StepName, ServiceProcedureStoredValue<TOutput>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Loads a value from a `ServerResult` (or plain value) and stores it under `stepName`.
|
|
42
|
+
* Propagates `Err`; if the resolved value is falsy, returns `NOT_FOUND`.
|
|
43
|
+
* For valid numeric `0` or empty string, use `.use()` instead of this helper.
|
|
44
|
+
*/
|
|
45
|
+
loadResource<StepName extends string, TOutput>(stepName: StepName, step: ServiceProcedureStep<TInput, TCtx, Repositories, Services, State, TOutput>, options?: {
|
|
46
|
+
notFoundMessage?: string;
|
|
47
|
+
}): ServiceProcedureBuilder<TInput, TCtx, Repositories, Services, State & Record<StepName, ServiceProcedureLoadedResource<TOutput>>>;
|
|
38
48
|
mapInput<StepName extends string, TNextInput>(stepName: StepName, step: ServiceProcedureInputMapper<TInput, TCtx, Repositories, Services, State, TNextInput>): ServiceProcedureBuilder<ServiceProcedureStoredValue<TNextInput>, TCtx, Repositories, Services, State & Record<StepName, ServiceProcedureStoredValue<TNextInput>>>;
|
|
39
49
|
addContextFilter<TInclude extends readonly ServiceProcedureContextFilterScope[] | undefined = undefined>(include?: TInclude): ServiceProcedureBuilder<ServiceProcedureContextFilteredInput<TInput>, TCtx & ServiceProcedureAuthContext<ServiceProcedureRequiredScopeFromFilter<TInclude>>, Repositories, Services, State & {
|
|
40
50
|
contextFilter: ServiceProcedureContextFilteredInput<TInput>;
|
|
@@ -43,5 +53,5 @@ interface ServiceProcedureBuilder<TInput, TCtx extends ServiceProcedureContext,
|
|
|
43
53
|
handle<TOutput>(handler: ServiceProcedureHandler<TInput, TCtx, Repositories, Services, State, TOutput>): ServiceProcedure<TInput, TCtx, TOutput>;
|
|
44
54
|
}
|
|
45
55
|
//#endregion
|
|
46
|
-
export { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper };
|
|
56
|
+
export { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper, ServiceProcedureLoadedResource };
|
|
47
57
|
//# sourceMappingURL=base.procedure.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Base } from "./base.abstract.mjs";
|
|
2
2
|
import { AuthenticatedActor } from "./base.actor.mjs";
|
|
3
|
-
import { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper } from "./base.procedure.mjs";
|
|
3
|
+
import { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper, ServiceProcedureLoadedResource } from "./base.procedure.mjs";
|
|
4
4
|
import { QueryFilter, QueryInput } from "@m5kdev/commons/modules/schemas/query.schema";
|
|
5
5
|
|
|
6
6
|
//#region ../backend/dist/src/modules/base/base.service.d.mts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Base } from "./base.abstract.js";
|
|
2
2
|
import { AuthenticatedActor } from "./base.actor.js";
|
|
3
|
-
import { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper } from "./base.procedure.js";
|
|
3
|
+
import { ServiceProcedure, ServiceProcedureArgs, ServiceProcedureBuilder, ServiceProcedureContext, ServiceProcedureContextFilterScope, ServiceProcedureContextFilteredInput, ServiceProcedureInputMapper, ServiceProcedureLoadedResource } from "./base.procedure.js";
|
|
4
4
|
import { QueryFilter, QueryInput } from "@m5kdev/commons/modules/schemas/query.schema";
|
|
5
5
|
|
|
6
6
|
//#region ../backend/dist/src/modules/base/base.service.d.mts
|
|
@@ -2714,7 +2714,7 @@ declare const schema: {
|
|
|
2714
2714
|
type Schema = typeof schema;
|
|
2715
2715
|
type Orm = LibSQLDatabase<Schema>;
|
|
2716
2716
|
declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["subscriptions"]> {
|
|
2717
|
-
stripe: Stripe
|
|
2717
|
+
stripe: Stripe;
|
|
2718
2718
|
plans: StripePlan[];
|
|
2719
2719
|
trial?: StripePlan;
|
|
2720
2720
|
constructor(options: {
|
|
@@ -2722,7 +2722,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2722
2722
|
schema: Schema;
|
|
2723
2723
|
table: Schema["subscriptions"];
|
|
2724
2724
|
libs: {
|
|
2725
|
-
stripe: Stripe
|
|
2725
|
+
stripe: Stripe;
|
|
2726
2726
|
};
|
|
2727
2727
|
config: {
|
|
2728
2728
|
trial?: StripePlan;
|
|
@@ -2731,7 +2731,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2731
2731
|
});
|
|
2732
2732
|
hasTrial(): boolean;
|
|
2733
2733
|
getPlanByPriceId(priceId: string): StripePlan | undefined;
|
|
2734
|
-
getCustomerByEmail(email: string): ServerResultAsync<Stripe
|
|
2734
|
+
getCustomerByEmail(email: string): ServerResultAsync<Stripe.Customer | null>;
|
|
2735
2735
|
getUserByCustomerId(customerId: string): ServerResultAsync<InferSelectModel<Schema["users"]> | null>;
|
|
2736
2736
|
createCustomer({
|
|
2737
2737
|
email,
|
|
@@ -2741,8 +2741,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2741
2741
|
email: string;
|
|
2742
2742
|
name?: string;
|
|
2743
2743
|
userId: string;
|
|
2744
|
-
}): ServerResultAsync<Stripe
|
|
2745
|
-
createTrialSubscription(customerId: string): ServerResultAsync<Stripe
|
|
2744
|
+
}): ServerResultAsync<Stripe.Customer>;
|
|
2745
|
+
createTrialSubscription(customerId: string): ServerResultAsync<Stripe.Subscription>;
|
|
2746
2746
|
createSubscription({
|
|
2747
2747
|
customerId,
|
|
2748
2748
|
priceId,
|
|
@@ -2753,7 +2753,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2753
2753
|
priceId: string;
|
|
2754
2754
|
quantity?: number;
|
|
2755
2755
|
trialDays?: number;
|
|
2756
|
-
}): ServerResultAsync<Stripe
|
|
2756
|
+
}): ServerResultAsync<Stripe.Subscription>;
|
|
2757
2757
|
updateUserCustomerId({
|
|
2758
2758
|
userId,
|
|
2759
2759
|
customerId
|
|
@@ -2763,7 +2763,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2763
2763
|
}): ServerResultAsync<InferSelectModel<Schema["users"]>>;
|
|
2764
2764
|
getLatestSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2765
2765
|
getActiveSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2766
|
-
listInvoices(customerId: string): ServerResultAsync<Stripe
|
|
2766
|
+
listInvoices(customerId: string): ServerResultAsync<Stripe.Invoice[]>;
|
|
2767
2767
|
createCheckoutSession({
|
|
2768
2768
|
customerId,
|
|
2769
2769
|
priceId,
|
|
@@ -2772,8 +2772,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2772
2772
|
customerId: string;
|
|
2773
2773
|
priceId: string;
|
|
2774
2774
|
userId: string;
|
|
2775
|
-
}): ServerResultAsync<Stripe
|
|
2776
|
-
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe
|
|
2775
|
+
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
2776
|
+
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
2777
2777
|
syncStripeData({
|
|
2778
2778
|
customerId,
|
|
2779
2779
|
userId
|
|
@@ -2781,7 +2781,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2781
2781
|
customerId: string;
|
|
2782
2782
|
userId: string;
|
|
2783
2783
|
}): ServerResultAsync<boolean>;
|
|
2784
|
-
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe
|
|
2784
|
+
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe.Event>;
|
|
2785
2785
|
} //#endregion
|
|
2786
2786
|
//#endregion
|
|
2787
2787
|
export { BillingRepository };
|
|
@@ -2714,7 +2714,7 @@ declare const schema: {
|
|
|
2714
2714
|
type Schema = typeof schema;
|
|
2715
2715
|
type Orm = LibSQLDatabase<Schema>;
|
|
2716
2716
|
declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<string, never>, Schema["subscriptions"]> {
|
|
2717
|
-
stripe: Stripe
|
|
2717
|
+
stripe: Stripe;
|
|
2718
2718
|
plans: StripePlan[];
|
|
2719
2719
|
trial?: StripePlan;
|
|
2720
2720
|
constructor(options: {
|
|
@@ -2722,7 +2722,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2722
2722
|
schema: Schema;
|
|
2723
2723
|
table: Schema["subscriptions"];
|
|
2724
2724
|
libs: {
|
|
2725
|
-
stripe: Stripe
|
|
2725
|
+
stripe: Stripe;
|
|
2726
2726
|
};
|
|
2727
2727
|
config: {
|
|
2728
2728
|
trial?: StripePlan;
|
|
@@ -2731,7 +2731,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2731
2731
|
});
|
|
2732
2732
|
hasTrial(): boolean;
|
|
2733
2733
|
getPlanByPriceId(priceId: string): StripePlan | undefined;
|
|
2734
|
-
getCustomerByEmail(email: string): ServerResultAsync<Stripe
|
|
2734
|
+
getCustomerByEmail(email: string): ServerResultAsync<Stripe.Customer | null>;
|
|
2735
2735
|
getUserByCustomerId(customerId: string): ServerResultAsync<InferSelectModel<Schema["users"]> | null>;
|
|
2736
2736
|
createCustomer({
|
|
2737
2737
|
email,
|
|
@@ -2741,8 +2741,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2741
2741
|
email: string;
|
|
2742
2742
|
name?: string;
|
|
2743
2743
|
userId: string;
|
|
2744
|
-
}): ServerResultAsync<Stripe
|
|
2745
|
-
createTrialSubscription(customerId: string): ServerResultAsync<Stripe
|
|
2744
|
+
}): ServerResultAsync<Stripe.Customer>;
|
|
2745
|
+
createTrialSubscription(customerId: string): ServerResultAsync<Stripe.Subscription>;
|
|
2746
2746
|
createSubscription({
|
|
2747
2747
|
customerId,
|
|
2748
2748
|
priceId,
|
|
@@ -2753,7 +2753,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2753
2753
|
priceId: string;
|
|
2754
2754
|
quantity?: number;
|
|
2755
2755
|
trialDays?: number;
|
|
2756
|
-
}): ServerResultAsync<Stripe
|
|
2756
|
+
}): ServerResultAsync<Stripe.Subscription>;
|
|
2757
2757
|
updateUserCustomerId({
|
|
2758
2758
|
userId,
|
|
2759
2759
|
customerId
|
|
@@ -2763,7 +2763,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2763
2763
|
}): ServerResultAsync<InferSelectModel<Schema["users"]>>;
|
|
2764
2764
|
getLatestSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2765
2765
|
getActiveSubscription(referenceId: string): ServerResultAsync<BillingSchema | null>;
|
|
2766
|
-
listInvoices(customerId: string): ServerResultAsync<Stripe
|
|
2766
|
+
listInvoices(customerId: string): ServerResultAsync<Stripe.Invoice[]>;
|
|
2767
2767
|
createCheckoutSession({
|
|
2768
2768
|
customerId,
|
|
2769
2769
|
priceId,
|
|
@@ -2772,8 +2772,8 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2772
2772
|
customerId: string;
|
|
2773
2773
|
priceId: string;
|
|
2774
2774
|
userId: string;
|
|
2775
|
-
}): ServerResultAsync<Stripe
|
|
2776
|
-
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe
|
|
2775
|
+
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
2776
|
+
createBillingPortalSession(customerId: string): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
2777
2777
|
syncStripeData({
|
|
2778
2778
|
customerId,
|
|
2779
2779
|
userId
|
|
@@ -2781,7 +2781,7 @@ declare class BillingRepository extends BaseTableRepository<Orm, Schema, Record<
|
|
|
2781
2781
|
customerId: string;
|
|
2782
2782
|
userId: string;
|
|
2783
2783
|
}): ServerResultAsync<boolean>;
|
|
2784
|
-
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe
|
|
2784
|
+
constructEvent(body: Buffer | string, signature: string, secret: string): ServerResult<Stripe.Event>;
|
|
2785
2785
|
} //#endregion
|
|
2786
2786
|
//#endregion
|
|
2787
2787
|
export { BillingRepository };
|
|
@@ -18,7 +18,7 @@ declare class BillingService extends BaseService<{
|
|
|
18
18
|
email: string;
|
|
19
19
|
name?: string;
|
|
20
20
|
};
|
|
21
|
-
}): ServerResultAsync<Stripe.Customer>;
|
|
21
|
+
}): ServerResultAsync<Stripe$1.Customer>;
|
|
22
22
|
createUserHook({
|
|
23
23
|
user
|
|
24
24
|
}: {
|
|
@@ -29,7 +29,7 @@ declare class BillingService extends BaseService<{
|
|
|
29
29
|
};
|
|
30
30
|
}): ServerResultAsync<boolean>;
|
|
31
31
|
getActiveSubscription(ctx: Context): ServerResultAsync<BillingSchema | null>;
|
|
32
|
-
listInvoices(ctx: Context): ServerResultAsync<Stripe.Invoice[]>;
|
|
32
|
+
listInvoices(ctx: Context): ServerResultAsync<Stripe$1.Invoice[]>;
|
|
33
33
|
createCheckoutSession({
|
|
34
34
|
priceId
|
|
35
35
|
}: {
|
|
@@ -38,15 +38,15 @@ declare class BillingService extends BaseService<{
|
|
|
38
38
|
user
|
|
39
39
|
}: {
|
|
40
40
|
user: User;
|
|
41
|
-
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
41
|
+
}): ServerResultAsync<Stripe$1.Checkout.Session>;
|
|
42
42
|
createBillingPortalSession({
|
|
43
43
|
user
|
|
44
44
|
}: {
|
|
45
45
|
user: User;
|
|
46
|
-
}): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
47
|
-
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe.Event>;
|
|
46
|
+
}): ServerResultAsync<Stripe$1.BillingPortal.Session>;
|
|
47
|
+
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe$1.Event>;
|
|
48
48
|
syncStripeData(customerId: string, eventType?: string): ServerResultAsync<boolean>;
|
|
49
|
-
processEvent(event: Stripe.Event): ServerResultAsync<boolean>;
|
|
49
|
+
processEvent(event: Stripe$1.Event): ServerResultAsync<boolean>;
|
|
50
50
|
} //#endregion
|
|
51
51
|
//#endregion
|
|
52
52
|
export { BillingService };
|
|
@@ -18,7 +18,7 @@ declare class BillingService extends BaseService<{
|
|
|
18
18
|
email: string;
|
|
19
19
|
name?: string;
|
|
20
20
|
};
|
|
21
|
-
}): ServerResultAsync<Stripe.Customer>;
|
|
21
|
+
}): ServerResultAsync<Stripe$1.Customer>;
|
|
22
22
|
createUserHook({
|
|
23
23
|
user
|
|
24
24
|
}: {
|
|
@@ -29,7 +29,7 @@ declare class BillingService extends BaseService<{
|
|
|
29
29
|
};
|
|
30
30
|
}): ServerResultAsync<boolean>;
|
|
31
31
|
getActiveSubscription(ctx: Context): ServerResultAsync<BillingSchema | null>;
|
|
32
|
-
listInvoices(ctx: Context): ServerResultAsync<Stripe.Invoice[]>;
|
|
32
|
+
listInvoices(ctx: Context): ServerResultAsync<Stripe$1.Invoice[]>;
|
|
33
33
|
createCheckoutSession({
|
|
34
34
|
priceId
|
|
35
35
|
}: {
|
|
@@ -38,15 +38,15 @@ declare class BillingService extends BaseService<{
|
|
|
38
38
|
user
|
|
39
39
|
}: {
|
|
40
40
|
user: User;
|
|
41
|
-
}): ServerResultAsync<Stripe.Checkout.Session>;
|
|
41
|
+
}): ServerResultAsync<Stripe$1.Checkout.Session>;
|
|
42
42
|
createBillingPortalSession({
|
|
43
43
|
user
|
|
44
44
|
}: {
|
|
45
45
|
user: User;
|
|
46
|
-
}): ServerResultAsync<Stripe.BillingPortal.Session>;
|
|
47
|
-
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe.Event>;
|
|
46
|
+
}): ServerResultAsync<Stripe$1.BillingPortal.Session>;
|
|
47
|
+
constructEvent(body: Buffer | string, signature: string): ServerResult<Stripe$1.Event>;
|
|
48
48
|
syncStripeData(customerId: string, eventType?: string): ServerResultAsync<boolean>;
|
|
49
|
-
processEvent(event: Stripe.Event): ServerResultAsync<boolean>;
|
|
49
|
+
processEvent(event: Stripe$1.Event): ServerResultAsync<boolean>;
|
|
50
50
|
} //#endregion
|
|
51
51
|
//#endregion
|
|
52
52
|
export { BillingService };
|
|
@@ -4,8 +4,8 @@ const require_src_lib_utils = require("../lib/utils.js");
|
|
|
4
4
|
const require_src_components_CropDialog = require("./CropDialog.js");
|
|
5
5
|
const require_src_components_ui_avatar = require("./ui/avatar.js");
|
|
6
6
|
const require_src_components_ui_progress = require("./ui/progress.js");
|
|
7
|
-
let react = require("react");
|
|
8
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let react = require("react");
|
|
9
9
|
let _m5kdev_frontend_modules_file_hooks_useUpload = require("@m5kdev/frontend/modules/file/hooks/useUpload");
|
|
10
10
|
let lucide_react = require("lucide-react");
|
|
11
11
|
let react_i18next = require("react-i18next");
|
|
@@ -2,8 +2,8 @@ import { cn } from "../lib/utils.mjs";
|
|
|
2
2
|
import { CropDialog } from "./CropDialog.mjs";
|
|
3
3
|
import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar.mjs";
|
|
4
4
|
import { Progress } from "./ui/progress.mjs";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { useRef, useState } from "react";
|
|
6
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useFileUpload } from "@m5kdev/frontend/modules/file/hooks/useUpload";
|
|
8
8
|
import { Edit2, User } from "lucide-react";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
@@ -58,7 +58,7 @@ function AvatarUpload({ currentAvatarUrl, onUploadComplete, className }) {
|
|
|
58
58
|
reset();
|
|
59
59
|
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
60
60
|
};
|
|
61
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
61
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
62
62
|
role: "dialog",
|
|
63
63
|
className: cn("relative inline-block", className),
|
|
64
64
|
onMouseEnter: () => setIsHovered(true),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarUpload.mjs","names":[],"sources":["../../../src/components/AvatarUpload.tsx"],"sourcesContent":["import { useFileUpload } from \"@m5kdev/frontend/modules/file/hooks/useUpload\";\r\nimport { Edit2, User } from \"lucide-react\";\r\nimport { type ChangeEvent, useRef, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { CropDialog } from \"./CropDialog\";\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./ui/avatar\";\r\nimport { Progress } from \"./ui/progress\";\r\nimport { cn } from \"../lib/utils\";\r\n\r\ninterface AvatarUploadProps {\r\n currentAvatarUrl?: string | null;\r\n onUploadComplete?: (avatarUrl: string) => void;\r\n className?: string;\r\n}\r\n\r\nexport function AvatarUpload({ currentAvatarUrl, onUploadComplete, className }: AvatarUploadProps) {\r\n const { t } = useTranslation();\r\n const [isHovered, setIsHovered] = useState(false);\r\n const [selectedFile, setSelectedFile] = useState<File | null>(null);\r\n const [previewUrl, setPreviewUrl] = useState<string | null>(currentAvatarUrl || null);\r\n const [showCropDialog, setShowCropDialog] = useState(false);\r\n\r\n const fileInputRef = useRef<HTMLInputElement>(null);\r\n const { upload, status, progress, errorMessage, reset } = useFileUpload();\r\n\r\n const handleFileSelect = (event: ChangeEvent<HTMLInputElement>) => {\r\n const file = event.target.files?.[0];\r\n if (file) {\r\n // Validate file type\r\n if (![\"image/jpeg\", \"image/png\", \"image/webp\", \"image/jpg\"].includes(file.type)) {\r\n alert(t(\"web-ui:upload.errors.invalidType\"));\r\n return;\r\n }\r\n // Validate file size (5MB)\r\n if (file.size > 5 * 1024 * 1024) {\r\n alert(t(\"web-ui:upload.errors.tooLarge\"));\r\n return;\r\n }\r\n setSelectedFile(file);\r\n const objectUrl = URL.createObjectURL(file);\r\n setPreviewUrl(objectUrl);\r\n setShowCropDialog(true);\r\n }\r\n };\r\n\r\n const handleCropComplete = async (croppedBlob: Blob) => {\r\n const croppedFile = new File([croppedBlob], selectedFile?.name || \"cropped-image.jpg\", {\r\n type: \"image/jpeg\",\r\n });\r\n\r\n setSelectedFile(croppedFile);\r\n const croppedObjectUrl = URL.createObjectURL(croppedFile);\r\n setPreviewUrl(croppedObjectUrl);\r\n setShowCropDialog(false);\r\n\r\n try {\r\n const res = await upload<{\r\n url: string;\r\n minetype: string;\r\n size: number;\r\n }>(\"image\", croppedFile);\r\n console.log({ res });\r\n onUploadComplete?.(res.url);\r\n } catch (error) {\r\n console.error(\"Error uploading image:\", error);\r\n }\r\n };\r\n\r\n const removeFile = () => {\r\n if (previewUrl && previewUrl !== currentAvatarUrl) {\r\n URL.revokeObjectURL(previewUrl);\r\n }\r\n setSelectedFile(null);\r\n setPreviewUrl(currentAvatarUrl || null);\r\n setShowCropDialog(false);\r\n reset();\r\n if (fileInputRef.current) {\r\n fileInputRef.current.value = \"\";\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n role=\"dialog\"\r\n className={cn(\"relative inline-block\", className)}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n >\r\n <Avatar className=\"h-24 w-24 cursor-pointer\" onClick={() => fileInputRef.current?.click()}>\r\n {previewUrl ? (\r\n <AvatarImage src={previewUrl} alt={t(\"web-ui:avatar.preview.alt\")} />\r\n ) : (\r\n <AvatarFallback>\r\n <User className=\"h-12 w-12\" />\r\n </AvatarFallback>\r\n )}\r\n {isHovered && (\r\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/50 rounded-full\">\r\n <Edit2 className=\"h-6 w-6 text-white\" />\r\n </div>\r\n )}\r\n </Avatar>\r\n\r\n <input\r\n ref={fileInputRef}\r\n type=\"file\"\r\n className=\"hidden\"\r\n accept=\"image/jpeg,image/png,image/webp\"\r\n onChange={handleFileSelect}\r\n />\r\n\r\n {status === \"uploading\" && (\r\n <div className=\"mt-2 w-full\">\r\n <Progress value={progress} className=\"h-2\" />\r\n </div>\r\n )}\r\n {status === \"error\" && <p className=\"mt-2 text-sm text-red-500\">{errorMessage}</p>}\r\n </div>\r\n\r\n {previewUrl && (\r\n <CropDialog\r\n open={showCropDialog}\r\n onOpenChange={setShowCropDialog}\r\n imageUrl={previewUrl}\r\n onCropComplete={handleCropComplete}\r\n onCancel={removeFile}\r\n isLoading={status === \"uploading\"}\r\n />\r\n )}\r\n </>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,aAAa,EAAE,kBAAkB,kBAAkB,aAAgC;CACjG,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,cAAc,mBAAmB,SAAsB,KAAK;CACnE,MAAM,CAAC,YAAY,iBAAiB,SAAwB,oBAAoB,KAAK;CACrF,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,MAAM;CAE3D,MAAM,eAAe,OAAyB,KAAK;CACnD,MAAM,EAAE,QAAQ,QAAQ,UAAU,cAAc,UAAU,eAAe;CAEzE,MAAM,oBAAoB,UAAyC;EACjE,MAAM,OAAO,MAAM,OAAO,QAAQ;AAClC,MAAI,MAAM;AAER,OAAI,CAAC;IAAC;IAAc;IAAa;IAAc;IAAY,CAAC,SAAS,KAAK,KAAK,EAAE;AAC/E,UAAM,EAAE,mCAAmC,CAAC;AAC5C;;AAGF,OAAI,KAAK,OAAO,IAAI,OAAO,MAAM;AAC/B,UAAM,EAAE,gCAAgC,CAAC;AACzC;;AAEF,mBAAgB,KAAK;AAErB,iBADkB,IAAI,gBAAgB,KAAK,CACnB;AACxB,qBAAkB,KAAK;;;CAI3B,MAAM,qBAAqB,OAAO,gBAAsB;EACtD,MAAM,cAAc,IAAI,KAAK,CAAC,YAAY,EAAE,cAAc,QAAQ,qBAAqB,EACrF,MAAM,cACP,CAAC;AAEF,kBAAgB,YAAY;AAE5B,gBADyB,IAAI,gBAAgB,YAAY,CAC1B;AAC/B,oBAAkB,MAAM;AAExB,MAAI;GACF,MAAM,MAAM,MAAM,OAIf,SAAS,YAAY;AACxB,WAAQ,IAAI,EAAE,KAAK,CAAC;AACpB,sBAAmB,IAAI,IAAI;WACpB,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;;;CAIlD,MAAM,mBAAmB;AACvB,MAAI,cAAc,eAAe,iBAC/B,KAAI,gBAAgB,WAAW;AAEjC,kBAAgB,KAAK;AACrB,gBAAc,oBAAoB,KAAK;AACvC,oBAAkB,MAAM;AACxB,SAAO;AACP,MAAI,aAAa,QACf,cAAa,QAAQ,QAAQ;;AAIjC,QACE,qBAAA,
|
|
1
|
+
{"version":3,"file":"AvatarUpload.mjs","names":[],"sources":["../../../src/components/AvatarUpload.tsx"],"sourcesContent":["import { useFileUpload } from \"@m5kdev/frontend/modules/file/hooks/useUpload\";\r\nimport { Edit2, User } from \"lucide-react\";\r\nimport { type ChangeEvent, useRef, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { CropDialog } from \"./CropDialog\";\r\nimport { Avatar, AvatarFallback, AvatarImage } from \"./ui/avatar\";\r\nimport { Progress } from \"./ui/progress\";\r\nimport { cn } from \"../lib/utils\";\r\n\r\ninterface AvatarUploadProps {\r\n currentAvatarUrl?: string | null;\r\n onUploadComplete?: (avatarUrl: string) => void;\r\n className?: string;\r\n}\r\n\r\nexport function AvatarUpload({ currentAvatarUrl, onUploadComplete, className }: AvatarUploadProps) {\r\n const { t } = useTranslation();\r\n const [isHovered, setIsHovered] = useState(false);\r\n const [selectedFile, setSelectedFile] = useState<File | null>(null);\r\n const [previewUrl, setPreviewUrl] = useState<string | null>(currentAvatarUrl || null);\r\n const [showCropDialog, setShowCropDialog] = useState(false);\r\n\r\n const fileInputRef = useRef<HTMLInputElement>(null);\r\n const { upload, status, progress, errorMessage, reset } = useFileUpload();\r\n\r\n const handleFileSelect = (event: ChangeEvent<HTMLInputElement>) => {\r\n const file = event.target.files?.[0];\r\n if (file) {\r\n // Validate file type\r\n if (![\"image/jpeg\", \"image/png\", \"image/webp\", \"image/jpg\"].includes(file.type)) {\r\n alert(t(\"web-ui:upload.errors.invalidType\"));\r\n return;\r\n }\r\n // Validate file size (5MB)\r\n if (file.size > 5 * 1024 * 1024) {\r\n alert(t(\"web-ui:upload.errors.tooLarge\"));\r\n return;\r\n }\r\n setSelectedFile(file);\r\n const objectUrl = URL.createObjectURL(file);\r\n setPreviewUrl(objectUrl);\r\n setShowCropDialog(true);\r\n }\r\n };\r\n\r\n const handleCropComplete = async (croppedBlob: Blob) => {\r\n const croppedFile = new File([croppedBlob], selectedFile?.name || \"cropped-image.jpg\", {\r\n type: \"image/jpeg\",\r\n });\r\n\r\n setSelectedFile(croppedFile);\r\n const croppedObjectUrl = URL.createObjectURL(croppedFile);\r\n setPreviewUrl(croppedObjectUrl);\r\n setShowCropDialog(false);\r\n\r\n try {\r\n const res = await upload<{\r\n url: string;\r\n minetype: string;\r\n size: number;\r\n }>(\"image\", croppedFile);\r\n console.log({ res });\r\n onUploadComplete?.(res.url);\r\n } catch (error) {\r\n console.error(\"Error uploading image:\", error);\r\n }\r\n };\r\n\r\n const removeFile = () => {\r\n if (previewUrl && previewUrl !== currentAvatarUrl) {\r\n URL.revokeObjectURL(previewUrl);\r\n }\r\n setSelectedFile(null);\r\n setPreviewUrl(currentAvatarUrl || null);\r\n setShowCropDialog(false);\r\n reset();\r\n if (fileInputRef.current) {\r\n fileInputRef.current.value = \"\";\r\n }\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n role=\"dialog\"\r\n className={cn(\"relative inline-block\", className)}\r\n onMouseEnter={() => setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n >\r\n <Avatar className=\"h-24 w-24 cursor-pointer\" onClick={() => fileInputRef.current?.click()}>\r\n {previewUrl ? (\r\n <AvatarImage src={previewUrl} alt={t(\"web-ui:avatar.preview.alt\")} />\r\n ) : (\r\n <AvatarFallback>\r\n <User className=\"h-12 w-12\" />\r\n </AvatarFallback>\r\n )}\r\n {isHovered && (\r\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/50 rounded-full\">\r\n <Edit2 className=\"h-6 w-6 text-white\" />\r\n </div>\r\n )}\r\n </Avatar>\r\n\r\n <input\r\n ref={fileInputRef}\r\n type=\"file\"\r\n className=\"hidden\"\r\n accept=\"image/jpeg,image/png,image/webp\"\r\n onChange={handleFileSelect}\r\n />\r\n\r\n {status === \"uploading\" && (\r\n <div className=\"mt-2 w-full\">\r\n <Progress value={progress} className=\"h-2\" />\r\n </div>\r\n )}\r\n {status === \"error\" && <p className=\"mt-2 text-sm text-red-500\">{errorMessage}</p>}\r\n </div>\r\n\r\n {previewUrl && (\r\n <CropDialog\r\n open={showCropDialog}\r\n onOpenChange={setShowCropDialog}\r\n imageUrl={previewUrl}\r\n onCropComplete={handleCropComplete}\r\n onCancel={removeFile}\r\n isLoading={status === \"uploading\"}\r\n />\r\n )}\r\n </>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,aAAa,EAAE,kBAAkB,kBAAkB,aAAgC;CACjG,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CACjD,MAAM,CAAC,cAAc,mBAAmB,SAAsB,KAAK;CACnE,MAAM,CAAC,YAAY,iBAAiB,SAAwB,oBAAoB,KAAK;CACrF,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,MAAM;CAE3D,MAAM,eAAe,OAAyB,KAAK;CACnD,MAAM,EAAE,QAAQ,QAAQ,UAAU,cAAc,UAAU,eAAe;CAEzE,MAAM,oBAAoB,UAAyC;EACjE,MAAM,OAAO,MAAM,OAAO,QAAQ;AAClC,MAAI,MAAM;AAER,OAAI,CAAC;IAAC;IAAc;IAAa;IAAc;IAAY,CAAC,SAAS,KAAK,KAAK,EAAE;AAC/E,UAAM,EAAE,mCAAmC,CAAC;AAC5C;;AAGF,OAAI,KAAK,OAAO,IAAI,OAAO,MAAM;AAC/B,UAAM,EAAE,gCAAgC,CAAC;AACzC;;AAEF,mBAAgB,KAAK;AAErB,iBADkB,IAAI,gBAAgB,KAAK,CACnB;AACxB,qBAAkB,KAAK;;;CAI3B,MAAM,qBAAqB,OAAO,gBAAsB;EACtD,MAAM,cAAc,IAAI,KAAK,CAAC,YAAY,EAAE,cAAc,QAAQ,qBAAqB,EACrF,MAAM,cACP,CAAC;AAEF,kBAAgB,YAAY;AAE5B,gBADyB,IAAI,gBAAgB,YAAY,CAC1B;AAC/B,oBAAkB,MAAM;AAExB,MAAI;GACF,MAAM,MAAM,MAAM,OAIf,SAAS,YAAY;AACxB,WAAQ,IAAI,EAAE,KAAK,CAAC;AACpB,sBAAmB,IAAI,IAAI;WACpB,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;;;CAIlD,MAAM,mBAAmB;AACvB,MAAI,cAAc,eAAe,iBAC/B,KAAI,gBAAgB,WAAW;AAEjC,kBAAgB,KAAK;AACrB,gBAAc,oBAAoB,KAAK;AACvC,oBAAkB,MAAM;AACxB,SAAO;AACP,MAAI,aAAa,QACf,cAAa,QAAQ,QAAQ;;AAIjC,QACE,qBAAA,UAAA,EAAA,UAAA,CACE,qBAAC,OAAD;EACE,MAAK;EACL,WAAW,GAAG,yBAAyB,UAAU;EACjD,oBAAoB,aAAa,KAAK;EACtC,oBAAoB,aAAa,MAAM;YAJzC;GAME,qBAAC,QAAD;IAAQ,WAAU;IAA2B,eAAe,aAAa,SAAS,OAAO;cAAzF,CACG,aACC,oBAAC,aAAD;KAAa,KAAK;KAAY,KAAK,EAAE,4BAA4B;KAAI,CAAA,GAErE,oBAAC,gBAAD,EAAA,UACE,oBAAC,MAAD,EAAM,WAAU,aAAc,CAAA,EACf,CAAA,EAElB,aACC,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,OAAD,EAAO,WAAU,sBAAuB,CAAA;KACpC,CAAA,CAED;;GAET,oBAAC,SAAD;IACE,KAAK;IACL,MAAK;IACL,WAAU;IACV,QAAO;IACP,UAAU;IACV,CAAA;GAED,WAAW,eACV,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,UAAD;KAAU,OAAO;KAAU,WAAU;KAAQ,CAAA;IACzC,CAAA;GAEP,WAAW,WAAW,oBAAC,KAAD;IAAG,WAAU;cAA6B;IAAiB,CAAA;GAC9E;KAEL,cACC,oBAAC,YAAD;EACE,MAAM;EACN,cAAc;EACd,UAAU;EACV,gBAAgB;EAChB,UAAU;EACV,WAAW,WAAW;EACtB,CAAA,CAEH,EAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { CalendarProps } from "react-big-calendar";
|
|
4
4
|
//#region src/components/Calendar.d.ts
|
|
5
5
|
type CalendarComponents = NonNullable<CalendarProps["components"]>;
|
|
@@ -2,9 +2,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
3
3
|
const require_src_lib_utils = require("../lib/utils.js");
|
|
4
4
|
const require_src_components_ui_card = require("./ui/card.js");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
6
|
let react = require("react");
|
|
6
7
|
react = require_runtime.__toESM(react);
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let lucide_react = require("lucide-react");
|
|
9
9
|
//#region src/components/CardsSelect.tsx
|
|
10
10
|
const CardsSelect = react.forwardRef(({ items, selectedIds, onSelectionChange, maxSelections, className, cardClassName, showCheckbox = true, disabled = false, reversed = false, ...props }, ref) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.mjs";
|
|
2
2
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card.mjs";
|
|
3
|
-
import * as React$1 from "react";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
5
|
import { Check, Edit } from "lucide-react";
|
|
6
6
|
//#region src/components/CardsSelect.tsx
|
|
7
7
|
const CardsSelect = React$1.forwardRef(({ items, selectedIds, onSelectionChange, maxSelections, className, cardClassName, showCheckbox = true, disabled = false, reversed = false, ...props }, ref) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _heroui_react = require("@heroui/react");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let lucide_react = require("lucide-react");
|
|
7
7
|
let _uiw_color_convert = require("@uiw/color-convert");
|
|
8
8
|
let _uiw_react_color_colorful = require("@uiw/react-color-colorful");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useState } from "react";
|
|
2
3
|
import { Button, Input, Popover, PopoverContent, PopoverTrigger } from "@heroui/react";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { PipetteIcon } from "lucide-react";
|
|
5
5
|
import { hexToHsva } from "@uiw/color-convert";
|
|
6
6
|
import Colorful from "@uiw/react-color-colorful";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../_virtual/_rolldown/runtime.js");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _heroui_react = require("@heroui/react");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let lucide_react = require("lucide-react");
|
|
7
7
|
let react_i18next = require("react-i18next");
|
|
8
8
|
let sonner = require("sonner");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useState } from "react";
|
|
2
3
|
import { Button } from "@heroui/react";
|
|
3
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { CheckCircle, Copy } from "lucide-react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
6
6
|
import { toast } from "sonner";
|
|
@@ -24,7 +24,7 @@ function CopyButton({ text, notificationTimeout = 1e3, isIconOnly, onCopy, ...pr
|
|
|
24
24
|
isIconOnly,
|
|
25
25
|
onPress: () => handleCopy(text),
|
|
26
26
|
...props,
|
|
27
|
-
children: isCopied ? /* @__PURE__ */ jsxs(Fragment
|
|
27
|
+
children: isCopied ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CheckCircle, { className: "h-4 w-4" }), !isIconOnly && t("web-ui:common.copied")] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Copy, { className: "h-4 w-4" }), !isIconOnly && t("web-ui:common.copy")] })
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyButton.mjs","names":[],"sources":["../../../src/components/CopyButton.tsx"],"sourcesContent":["import { Button, type ButtonProps } from \"@heroui/react\";\r\nimport { CheckCircle, Copy } from \"lucide-react\";\r\nimport { useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { toast } from \"sonner\";\r\n\r\nexport function CopyButton({\r\n text,\r\n notificationTimeout = 1000,\r\n isIconOnly,\r\n onCopy,\r\n ...props\r\n}: ButtonProps & { text: string; notificationTimeout?: number; onCopy?: () => void }) {\r\n const { t } = useTranslation();\r\n const [isCopied, setIsCopied] = useState(false);\r\n\r\n const handleCopy = async (text: string) => {\r\n try {\r\n await window.navigator.clipboard.writeText(text);\r\n setIsCopied(true);\r\n onCopy?.();\r\n toast.success(t(\"web-ui:common.copySuccess\"));\r\n setTimeout(() => setIsCopied(false), notificationTimeout);\r\n } catch (error) {\r\n toast.error(t(\"web-ui:common.copyError\"));\r\n console.error(error);\r\n }\r\n };\r\n\r\n return (\r\n <Button isIconOnly={isIconOnly} onPress={() => handleCopy(text)} {...props}>\r\n {isCopied ? (\r\n <>\r\n <CheckCircle className=\"h-4 w-4\" />\r\n {!isIconOnly && t(\"web-ui:common.copied\")}\r\n </>\r\n ) : (\r\n <>\r\n <Copy className=\"h-4 w-4\" />\r\n {!isIconOnly && t(\"web-ui:common.copy\")}\r\n </>\r\n )}\r\n </Button>\r\n );\r\n}\r\n"],"mappings":";;;;;;;AAMA,SAAgB,WAAW,EACzB,MACA,sBAAsB,KACtB,YACA,QACA,GAAG,SACiF;CACpF,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM;CAE/C,MAAM,aAAa,OAAO,SAAiB;AACzC,MAAI;AACF,SAAM,OAAO,UAAU,UAAU,UAAU,KAAK;AAChD,eAAY,KAAK;AACjB,aAAU;AACV,SAAM,QAAQ,EAAE,4BAA4B,CAAC;AAC7C,oBAAiB,YAAY,MAAM,EAAE,oBAAoB;WAClD,OAAO;AACd,SAAM,MAAM,EAAE,0BAA0B,CAAC;AACzC,WAAQ,MAAM,MAAM;;;AAIxB,QACE,oBAAC,QAAD;EAAoB;EAAY,eAAe,WAAW,KAAK;EAAE,GAAI;YAClE,WACC,qBAAA,
|
|
1
|
+
{"version":3,"file":"CopyButton.mjs","names":[],"sources":["../../../src/components/CopyButton.tsx"],"sourcesContent":["import { Button, type ButtonProps } from \"@heroui/react\";\r\nimport { CheckCircle, Copy } from \"lucide-react\";\r\nimport { useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { toast } from \"sonner\";\r\n\r\nexport function CopyButton({\r\n text,\r\n notificationTimeout = 1000,\r\n isIconOnly,\r\n onCopy,\r\n ...props\r\n}: ButtonProps & { text: string; notificationTimeout?: number; onCopy?: () => void }) {\r\n const { t } = useTranslation();\r\n const [isCopied, setIsCopied] = useState(false);\r\n\r\n const handleCopy = async (text: string) => {\r\n try {\r\n await window.navigator.clipboard.writeText(text);\r\n setIsCopied(true);\r\n onCopy?.();\r\n toast.success(t(\"web-ui:common.copySuccess\"));\r\n setTimeout(() => setIsCopied(false), notificationTimeout);\r\n } catch (error) {\r\n toast.error(t(\"web-ui:common.copyError\"));\r\n console.error(error);\r\n }\r\n };\r\n\r\n return (\r\n <Button isIconOnly={isIconOnly} onPress={() => handleCopy(text)} {...props}>\r\n {isCopied ? (\r\n <>\r\n <CheckCircle className=\"h-4 w-4\" />\r\n {!isIconOnly && t(\"web-ui:common.copied\")}\r\n </>\r\n ) : (\r\n <>\r\n <Copy className=\"h-4 w-4\" />\r\n {!isIconOnly && t(\"web-ui:common.copy\")}\r\n </>\r\n )}\r\n </Button>\r\n );\r\n}\r\n"],"mappings":";;;;;;;AAMA,SAAgB,WAAW,EACzB,MACA,sBAAsB,KACtB,YACA,QACA,GAAG,SACiF;CACpF,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM;CAE/C,MAAM,aAAa,OAAO,SAAiB;AACzC,MAAI;AACF,SAAM,OAAO,UAAU,UAAU,UAAU,KAAK;AAChD,eAAY,KAAK;AACjB,aAAU;AACV,SAAM,QAAQ,EAAE,4BAA4B,CAAC;AAC7C,oBAAiB,YAAY,MAAM,EAAE,oBAAoB;WAClD,OAAO;AACd,SAAM,MAAM,EAAE,0BAA0B,CAAC;AACzC,WAAQ,MAAM,MAAM;;;AAIxB,QACE,oBAAC,QAAD;EAAoB;EAAY,eAAe,WAAW,KAAK;EAAE,GAAI;YAClE,WACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,aAAD,EAAa,WAAU,WAAY,CAAA,EAClC,CAAC,cAAc,EAAE,uBAAuB,CACxC,EAAA,CAAA,GAEH,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD,EAAM,WAAU,WAAY,CAAA,EAC3B,CAAC,cAAc,EAAE,qBAAqB,CACtC,EAAA,CAAA;EAEE,CAAA"}
|
|
@@ -3,8 +3,8 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
|
3
3
|
const require_src_components_ui_button = require("./ui/button.js");
|
|
4
4
|
const require_src_components_ui_dialog = require("./ui/dialog.js");
|
|
5
5
|
const require_src_components_ui_slider = require("./ui/slider.js");
|
|
6
|
-
let react = require("react");
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let react = require("react");
|
|
8
8
|
let lucide_react = require("lucide-react");
|
|
9
9
|
let react_i18next = require("react-i18next");
|
|
10
10
|
let react_easy_crop = require("react-easy-crop");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Button } from "./ui/button.mjs";
|
|
2
2
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "./ui/dialog.mjs";
|
|
3
3
|
import { Slider } from "./ui/slider.mjs";
|
|
4
|
-
import { useState } from "react";
|
|
5
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
6
|
import { ZoomIn, ZoomOut } from "lucide-react";
|
|
7
7
|
import { useTranslation } from "react-i18next";
|
|
8
8
|
import Cropper from "react-easy-crop";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../../_virtual/_rolldown/runtime.js");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _heroui_react = require("@heroui/react");
|
|
5
6
|
let _heroui_theme = require("@heroui/theme");
|
|
6
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
//#region src/components/DialogProvider.tsx
|
|
8
8
|
const DialogContext = (0, react.createContext)(() => {
|
|
9
9
|
console.warn("DialogProvider is not initialized");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { createContext, useContext, useRef, useState } from "react";
|
|
2
3
|
import { Button, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader } from "@heroui/react";
|
|
3
4
|
import { semanticColors } from "@heroui/theme";
|
|
4
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/DialogProvider.tsx
|
|
6
6
|
const DialogContext = createContext(() => {
|
|
7
7
|
console.warn("DialogProvider is not initialized");
|
|
@@ -43,7 +43,7 @@ function DialogProvider({ children }) {
|
|
|
43
43
|
};
|
|
44
44
|
return /* @__PURE__ */ jsx(DialogContext.Provider, {
|
|
45
45
|
value: handleSetDialog,
|
|
46
|
-
children: /* @__PURE__ */ jsxs(Fragment
|
|
46
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [children, dialog && /* @__PURE__ */ jsx(Modal, {
|
|
47
47
|
isOpen,
|
|
48
48
|
onOpenChange: handleUnsetDialog,
|
|
49
49
|
style: { borderColor: semanticColors.light[dialog.color || "danger"][600] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogProvider.mjs","names":[],"sources":["../../../src/components/DialogProvider.tsx"],"sourcesContent":["import {\r\n Button,\r\n type ButtonProps,\r\n Modal,\r\n ModalBody,\r\n ModalContent,\r\n ModalFooter,\r\n ModalHeader,\r\n} from \"@heroui/react\";\r\nimport { semanticColors } from \"@heroui/theme\";\r\nimport { createContext, useContext, useRef, useState } from \"react\";\r\n\r\nexport type DialogProps = {\r\n title: React.ReactNode;\r\n description: React.ReactNode;\r\n color?: ButtonProps[\"color\"];\r\n cancelable?: boolean;\r\n onCancel?: () => void;\r\n onConfirm?: () => void;\r\n cancelLabel?: string;\r\n confirmLabel?: string;\r\n};\r\n\r\nconst DialogContext = createContext<(dialog: DialogProps) => void>(() => {\r\n console.warn(\"DialogProvider is not initialized\");\r\n});\r\n\r\nexport function useDialog() {\r\n const context = useContext(DialogContext);\r\n if (!context) {\r\n throw new Error(\"useDialog must be used within a DialogProvider\");\r\n }\r\n return context;\r\n}\r\n\r\nexport function DialogProvider({ children }: { children: React.ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [dialog, setDialog] = useState<DialogProps | null>(null);\r\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n const handleSetDialog = (dialog: DialogProps) => {\r\n if (timeoutRef.current) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n setDialog(dialog);\r\n setIsOpen(true);\r\n };\r\n\r\n const handleUnsetDialog = () => {\r\n setIsOpen(false);\r\n if (timeoutRef.current) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n timeoutRef.current = setTimeout(() => {\r\n setDialog(null);\r\n }, 500);\r\n };\r\n\r\n const handleCancel = () => {\r\n dialog?.onCancel?.();\r\n handleUnsetDialog();\r\n };\r\n\r\n const handleConfirm = () => {\r\n dialog?.onConfirm?.();\r\n handleUnsetDialog();\r\n };\r\n\r\n return (\r\n <DialogContext.Provider value={handleSetDialog}>\r\n <>\r\n {children}\r\n {dialog && (\r\n <Modal\r\n isOpen={isOpen}\r\n onOpenChange={handleUnsetDialog}\r\n style={{\r\n borderColor: semanticColors.light[dialog.color || \"danger\"][600],\r\n }}\r\n classNames={{\r\n base: \"border-1\",\r\n }}\r\n >\r\n <ModalContent>\r\n <ModalHeader>{dialog.title}</ModalHeader>\r\n <ModalBody>{dialog.description}</ModalBody>\r\n <ModalFooter>\r\n <div className=\"flex flex-row gap-2\">\r\n {(dialog.cancelable || dialog.onCancel) && (\r\n <Button onPress={handleCancel}>{dialog.cancelLabel ?? \"Cancel\"}</Button>\r\n )}\r\n <Button color={dialog.color} onPress={handleConfirm}>\r\n {dialog.confirmLabel ?? \"Confirm\"}\r\n </Button>\r\n </div>\r\n </ModalFooter>\r\n </ModalContent>\r\n </Modal>\r\n )}\r\n </>\r\n </DialogContext.Provider>\r\n );\r\n}\r\n"],"mappings":";;;;;AAuBA,MAAM,gBAAgB,oBAAmD;AACvE,SAAQ,KAAK,oCAAoC;EACjD;AAEF,SAAgB,YAAY;CAC1B,MAAM,UAAU,WAAW,cAAc;AACzC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,iDAAiD;AAEnE,QAAO;;AAGT,SAAgB,eAAe,EAAE,YAA2C;CAC1E,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,CAAC,QAAQ,aAAa,SAA6B,KAAK;CAC9D,MAAM,aAAa,OAA6C,KAAK;CAErE,MAAM,mBAAmB,WAAwB;AAC/C,MAAI,WAAW,SAAS;AACtB,gBAAa,WAAW,QAAQ;AAChC,cAAW,UAAU;;AAEvB,YAAU,OAAO;AACjB,YAAU,KAAK;;CAGjB,MAAM,0BAA0B;AAC9B,YAAU,MAAM;AAChB,MAAI,WAAW,SAAS;AACtB,gBAAa,WAAW,QAAQ;AAChC,cAAW,UAAU;;AAEvB,aAAW,UAAU,iBAAiB;AACpC,aAAU,KAAK;KACd,IAAI;;CAGT,MAAM,qBAAqB;AACzB,UAAQ,YAAY;AACpB,qBAAmB;;CAGrB,MAAM,sBAAsB;AAC1B,UAAQ,aAAa;AACrB,qBAAmB;;AAGrB,QACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;YAC7B,qBAAA,
|
|
1
|
+
{"version":3,"file":"DialogProvider.mjs","names":[],"sources":["../../../src/components/DialogProvider.tsx"],"sourcesContent":["import {\r\n Button,\r\n type ButtonProps,\r\n Modal,\r\n ModalBody,\r\n ModalContent,\r\n ModalFooter,\r\n ModalHeader,\r\n} from \"@heroui/react\";\r\nimport { semanticColors } from \"@heroui/theme\";\r\nimport { createContext, useContext, useRef, useState } from \"react\";\r\n\r\nexport type DialogProps = {\r\n title: React.ReactNode;\r\n description: React.ReactNode;\r\n color?: ButtonProps[\"color\"];\r\n cancelable?: boolean;\r\n onCancel?: () => void;\r\n onConfirm?: () => void;\r\n cancelLabel?: string;\r\n confirmLabel?: string;\r\n};\r\n\r\nconst DialogContext = createContext<(dialog: DialogProps) => void>(() => {\r\n console.warn(\"DialogProvider is not initialized\");\r\n});\r\n\r\nexport function useDialog() {\r\n const context = useContext(DialogContext);\r\n if (!context) {\r\n throw new Error(\"useDialog must be used within a DialogProvider\");\r\n }\r\n return context;\r\n}\r\n\r\nexport function DialogProvider({ children }: { children: React.ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [dialog, setDialog] = useState<DialogProps | null>(null);\r\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n const handleSetDialog = (dialog: DialogProps) => {\r\n if (timeoutRef.current) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n setDialog(dialog);\r\n setIsOpen(true);\r\n };\r\n\r\n const handleUnsetDialog = () => {\r\n setIsOpen(false);\r\n if (timeoutRef.current) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n timeoutRef.current = setTimeout(() => {\r\n setDialog(null);\r\n }, 500);\r\n };\r\n\r\n const handleCancel = () => {\r\n dialog?.onCancel?.();\r\n handleUnsetDialog();\r\n };\r\n\r\n const handleConfirm = () => {\r\n dialog?.onConfirm?.();\r\n handleUnsetDialog();\r\n };\r\n\r\n return (\r\n <DialogContext.Provider value={handleSetDialog}>\r\n <>\r\n {children}\r\n {dialog && (\r\n <Modal\r\n isOpen={isOpen}\r\n onOpenChange={handleUnsetDialog}\r\n style={{\r\n borderColor: semanticColors.light[dialog.color || \"danger\"][600],\r\n }}\r\n classNames={{\r\n base: \"border-1\",\r\n }}\r\n >\r\n <ModalContent>\r\n <ModalHeader>{dialog.title}</ModalHeader>\r\n <ModalBody>{dialog.description}</ModalBody>\r\n <ModalFooter>\r\n <div className=\"flex flex-row gap-2\">\r\n {(dialog.cancelable || dialog.onCancel) && (\r\n <Button onPress={handleCancel}>{dialog.cancelLabel ?? \"Cancel\"}</Button>\r\n )}\r\n <Button color={dialog.color} onPress={handleConfirm}>\r\n {dialog.confirmLabel ?? \"Confirm\"}\r\n </Button>\r\n </div>\r\n </ModalFooter>\r\n </ModalContent>\r\n </Modal>\r\n )}\r\n </>\r\n </DialogContext.Provider>\r\n );\r\n}\r\n"],"mappings":";;;;;AAuBA,MAAM,gBAAgB,oBAAmD;AACvE,SAAQ,KAAK,oCAAoC;EACjD;AAEF,SAAgB,YAAY;CAC1B,MAAM,UAAU,WAAW,cAAc;AACzC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,iDAAiD;AAEnE,QAAO;;AAGT,SAAgB,eAAe,EAAE,YAA2C;CAC1E,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAC3C,MAAM,CAAC,QAAQ,aAAa,SAA6B,KAAK;CAC9D,MAAM,aAAa,OAA6C,KAAK;CAErE,MAAM,mBAAmB,WAAwB;AAC/C,MAAI,WAAW,SAAS;AACtB,gBAAa,WAAW,QAAQ;AAChC,cAAW,UAAU;;AAEvB,YAAU,OAAO;AACjB,YAAU,KAAK;;CAGjB,MAAM,0BAA0B;AAC9B,YAAU,MAAM;AAChB,MAAI,WAAW,SAAS;AACtB,gBAAa,WAAW,QAAQ;AAChC,cAAW,UAAU;;AAEvB,aAAW,UAAU,iBAAiB;AACpC,aAAU,KAAK;KACd,IAAI;;CAGT,MAAM,qBAAqB;AACzB,UAAQ,YAAY;AACpB,qBAAmB;;CAGrB,MAAM,sBAAsB;AAC1B,UAAQ,aAAa;AACrB,qBAAmB;;AAGrB,QACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;YAC7B,qBAAA,UAAA,EAAA,UAAA,CACG,UACA,UACC,oBAAC,OAAD;GACU;GACR,cAAc;GACd,OAAO,EACL,aAAa,eAAe,MAAM,OAAO,SAAS,UAAU,MAC7D;GACD,YAAY,EACV,MAAM,YACP;aAED,qBAAC,cAAD,EAAA,UAAA;IACE,oBAAC,aAAD,EAAA,UAAc,OAAO,OAAoB,CAAA;IACzC,oBAAC,WAAD,EAAA,UAAY,OAAO,aAAwB,CAAA;IAC3C,oBAAC,aAAD,EAAA,UACE,qBAAC,OAAD;KAAK,WAAU;eAAf,EACI,OAAO,cAAc,OAAO,aAC5B,oBAAC,QAAD;MAAQ,SAAS;gBAAe,OAAO,eAAe;MAAkB,CAAA,EAE1E,oBAAC,QAAD;MAAQ,OAAO,OAAO;MAAO,SAAS;gBACnC,OAAO,gBAAgB;MACjB,CAAA,CACL;QACM,CAAA;IACD,EAAA,CAAA;GACT,CAAA,CAET,EAAA,CAAA;EACoB,CAAA"}
|
|
@@ -3,8 +3,8 @@ require("../../_virtual/_rolldown/runtime.js");
|
|
|
3
3
|
const require_src_lib_utils = require("../lib/utils.js");
|
|
4
4
|
const require_src_components_ui_button = require("./ui/button.js");
|
|
5
5
|
const require_src_components_ui_progress = require("./ui/progress.js");
|
|
6
|
-
let react = require("react");
|
|
7
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let react = require("react");
|
|
8
8
|
let lucide_react = require("lucide-react");
|
|
9
9
|
let react_dropzone = require("react-dropzone");
|
|
10
10
|
//#region src/components/FileDropzone.tsx
|