@greatapps/common 1.1.472 → 1.1.474
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/components/account/sections/MyProfileSection.mjs +1 -2
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/embeds/CrispEmbed.mjs +24 -60
- package/dist/components/embeds/CrispEmbed.mjs.map +1 -1
- package/dist/components/embeds/FrillEmbed.mjs +3 -10
- package/dist/components/embeds/FrillEmbed.mjs.map +1 -1
- package/dist/components/layouts/ProfilePopover.mjs +1 -2
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/modals/cards/AddCardModal.mjs +6 -10
- package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
- package/dist/components/modals/cards/CardFormFields.mjs +15 -47
- package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs +2 -2
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +1 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
- package/dist/components/pages/notifications/Notifications.mjs +17 -27
- package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
- package/dist/components/ui/form/Select.mjs +1 -1
- package/dist/components/ui/form/Select.mjs.map +1 -1
- package/dist/components/ui/overlay/Dialog.mjs +1 -2
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Popover.mjs +1 -1
- package/dist/components/ui/overlay/Popover.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +6 -6
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/Tooltip.mjs +1 -1
- package/dist/components/ui/overlay/Tooltip.mjs.map +1 -1
- package/dist/index.mjs +2 -50
- package/dist/index.mjs.map +1 -1
- package/dist/infra/utils/date.mjs +0 -11
- package/dist/infra/utils/date.mjs.map +1 -1
- package/dist/modules/auth/services/auth.service.mjs +1 -2
- package/dist/modules/auth/services/auth.service.mjs.map +1 -1
- package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs +2 -21
- package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +1 -1
- package/dist/modules/plans/services/plans.service.mjs +10 -71
- package/dist/modules/plans/services/plans.service.mjs.map +1 -1
- package/dist/modules/plans/types/plan.type.mjs +0 -1
- package/dist/modules/plans/types/plan.type.mjs.map +1 -1
- package/dist/modules/subscriptions/types/subscription.type.mjs +1 -31
- package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
- package/dist/server.mjs +0 -6
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/navigation/ProjectSelectorPopover.tsx +1 -1
- package/src/components/ui/overlay/Sheet.tsx +9 -11
- package/dist/components/embeds/EmbedWidgets.mjs +0 -45
- package/dist/components/embeds/EmbedWidgets.mjs.map +0 -1
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +0 -212
- package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +0 -1
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +0 -51
- package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +0 -1
- package/dist/components/widgets/ImageUpload/ImageUpload.mjs +0 -122
- package/dist/components/widgets/ImageUpload/ImageUpload.mjs.map +0 -1
- package/dist/components/widgets/ImageUpload/index.mjs +0 -9
- package/dist/components/widgets/ImageUpload/index.mjs.map +0 -1
- package/dist/modules/images/actions/process-image.action.mjs +0 -31
- package/dist/modules/images/actions/process-image.action.mjs.map +0 -1
- package/dist/modules/images/constants/image.constants.mjs +0 -14
- package/dist/modules/images/constants/image.constants.mjs.map +0 -1
- package/dist/modules/images/hooks/use-image-upload.hook.mjs +0 -132
- package/dist/modules/images/hooks/use-image-upload.hook.mjs.map +0 -1
- package/dist/modules/images/services/image-processing.service.mjs +0 -65
- package/dist/modules/images/services/image-processing.service.mjs.map +0 -1
- package/dist/modules/images/types/image.type.mjs +0 -1
- package/dist/modules/images/types/image.type.mjs.map +0 -1
- package/dist/modules/images/utils/base64.mjs +0 -24
- package/dist/modules/images/utils/base64.mjs.map +0 -1
- package/dist/modules/images/utils/compress-image.mjs +0 -17
- package/dist/modules/images/utils/compress-image.mjs.map +0 -1
- package/dist/modules/images/utils/crop-image.mjs +0 -31
- package/dist/modules/images/utils/crop-image.mjs.map +0 -1
- package/dist/modules/images/utils/validate-image.mjs +0 -58
- package/dist/modules/images/utils/validate-image.mjs.map +0 -1
- package/dist/modules/plans/actions/list-plans.action.mjs +0 -17
- package/dist/modules/plans/actions/list-plans.action.mjs.map +0 -1
- package/dist/modules/plans/hooks/list-plans.hook.mjs +0 -22
- package/dist/modules/plans/hooks/list-plans.hook.mjs.map +0 -1
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +0 -58
- package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +0 -1
- package/dist/utils/format/currency.mjs +0 -13
- package/dist/utils/format/currency.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/plans/types/plan.type.ts"],"sourcesContent":["import z from 'zod';\
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/plans/types/plan.type.ts"],"sourcesContent":["import z from 'zod';\n\nexport const PlanItemSchema = z.object({\n id_addon: z.number(),\n quantity: z.number(),\n value: z.number(),\n});\n\nexport type PlanItem = z.infer<typeof PlanItemSchema>;\n\nexport const PlanSchema = z.object({\n id: z.number(),\n name: z.string(),\n value: z.number().default(0),\n type: z.string().optional(),\n discount_semester: z.number().default(0),\n discount_annual: z.number().default(0),\n items: z.array(PlanItemSchema).optional().default([]),\n});\n\nexport type Plan = z.infer<typeof PlanSchema>;\n"],"mappings":"AAAA,OAAO,OAAO;AAEP,MAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,UAAU,EAAE,OAAO;AAAA,EACnB,UAAU,EAAE,OAAO;AAAA,EACnB,OAAO,EAAE,OAAO;AAClB,CAAC;AAIM,MAAM,aAAa,EAAE,OAAO;AAAA,EACjC,IAAI,EAAE,OAAO;AAAA,EACb,MAAM,EAAE,OAAO;AAAA,EACf,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAC3B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,mBAAmB,EAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EACvC,iBAAiB,EAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EACrC,OAAO,EAAE,MAAM,cAAc,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC;","names":[]}
|
|
@@ -48,37 +48,7 @@ const SubscriptionSchema = z.object({
|
|
|
48
48
|
card_name: z.string().nullable().optional(),
|
|
49
49
|
card_brand: z.string().nullable().optional(),
|
|
50
50
|
card_number: z.string().nullable().optional(),
|
|
51
|
-
items: z.array(SubscriptionItemSchema)
|
|
52
|
-
pending_change: z.object({
|
|
53
|
-
schedule_id: z.string(),
|
|
54
|
-
schedule_status: z.string(),
|
|
55
|
-
kind: z.string(),
|
|
56
|
-
takes_effect_at: z.number(),
|
|
57
|
-
takes_effect_at_iso: z.string(),
|
|
58
|
-
new_plan: z.object({
|
|
59
|
-
id: z.number(),
|
|
60
|
-
name: z.string(),
|
|
61
|
-
periodicity: z.number(),
|
|
62
|
-
value: z.number(),
|
|
63
|
-
value_gross: z.number()
|
|
64
|
-
}),
|
|
65
|
-
new_items: z.array(z.object({
|
|
66
|
-
price_id: z.string(),
|
|
67
|
-
id_addon: z.number().nullable(),
|
|
68
|
-
addon_name: z.string(),
|
|
69
|
-
quantity: z.number(),
|
|
70
|
-
unit_value: z.number(),
|
|
71
|
-
value: z.number(),
|
|
72
|
-
is_plan_base: z.boolean(),
|
|
73
|
-
is_ai_credit: z.boolean()
|
|
74
|
-
})),
|
|
75
|
-
new_discounts: z.array(z.unknown()),
|
|
76
|
-
changes: z.array(z.object({
|
|
77
|
-
type: z.string(),
|
|
78
|
-
from: z.unknown(),
|
|
79
|
-
to: z.unknown()
|
|
80
|
-
}))
|
|
81
|
-
}).nullable().optional()
|
|
51
|
+
items: z.array(SubscriptionItemSchema)
|
|
82
52
|
});
|
|
83
53
|
export {
|
|
84
54
|
SubscriptionItemSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/subscriptions/types/subscription.type.ts"],"sourcesContent":["import z from 'zod';\r\n\r\nexport const SubscriptionItemSchema = z.object({\r\n id: z.union([z.number(), z.string()]),\r\n deleted: z.number(),\r\n datetime_alt: z.coerce.date().nullable().optional(),\r\n datetime_del: z.coerce.date().nullable().optional(),\r\n datetime_add: z.coerce.date(),\r\n id_wl: z.number(),\r\n id_subscription: z.union([z.number(), z.string()]),\r\n id_addon: z.number().nullable(),\r\n addon_name: z.string().optional(),\r\n value: z.number(),\r\n currency: z.string(),\r\n quantity: z.number(),\r\n payment_status: z.number(),\r\n id_charge: z.union([z.number(), z.string()]).nullable(),\r\n trial: z.boolean(),\r\n trial_ends_at: z.coerce.date().nullable().optional(),\r\n});\r\n\r\nexport type SubscriptionItem = z.infer<typeof SubscriptionItemSchema>;\r\n\r\nexport const SubscriptionSchema = z.object({\r\n id: z.union([z.number(), z.string()]),\r\n deleted: z.number(),\r\n datetime_alt: z.coerce.date().nullable().optional(),\r\n datetime_del: z.coerce.date().nullable().optional(),\r\n datetime_add: z.coerce.date(),\r\n id_wl: z.number(),\r\n id_account: z.union([z.number(), z.string()]),\r\n id_card: z.union([z.number(), z.string()]).nullable(),\r\n id_coupon: z.union([z.number(), z.string()]).nullable(),\r\n type: z.string(),\r\n payment_method: z.number().nullable(),\r\n periodicity: z.coerce.number().nullable(),\r\n value: z.number().nullable(),\r\n id_product: z.number(),\r\n id_plan: z.number(),\r\n plan_name: z.string().nullable().optional(),\r\n id_gateway: z.union([z.number(), z.string()]).nullable(),\r\n gateway_account: z.string().nullable(),\r\n date_hiring: z.coerce.date().nullable(),\r\n date_due: z.coerce.date(),\r\n date_cancellation: z.coerce.date().nullable(),\r\n date_verification: z.coerce.date().nullable(),\r\n cancellation_reason: z.string().nullable(),\r\n cancellation_description: z.string().nullable(),\r\n active: z.boolean(),\r\n charged: z.boolean(),\r\n datetime_last_update_periodicity: z.coerce.date().nullable().optional(),\r\n card_name: z.string().nullable().optional(),\r\n card_brand: z.string().nullable().optional(),\r\n card_number: z.string().nullable().optional(),\r\n items: z.array(SubscriptionItemSchema),\r\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/subscriptions/types/subscription.type.ts"],"sourcesContent":["import z from 'zod';\r\n\r\nexport const SubscriptionItemSchema = z.object({\r\n id: z.union([z.number(), z.string()]),\r\n deleted: z.number(),\r\n datetime_alt: z.coerce.date().nullable().optional(),\r\n datetime_del: z.coerce.date().nullable().optional(),\r\n datetime_add: z.coerce.date(),\r\n id_wl: z.number(),\r\n id_subscription: z.union([z.number(), z.string()]),\r\n id_addon: z.number().nullable(),\r\n addon_name: z.string().optional(),\r\n value: z.number(),\r\n currency: z.string(),\r\n quantity: z.number(),\r\n payment_status: z.number(),\r\n id_charge: z.union([z.number(), z.string()]).nullable(),\r\n trial: z.boolean(),\r\n trial_ends_at: z.coerce.date().nullable().optional(),\r\n});\r\n\r\nexport type SubscriptionItem = z.infer<typeof SubscriptionItemSchema>;\r\n\r\nexport const SubscriptionSchema = z.object({\r\n id: z.union([z.number(), z.string()]),\r\n deleted: z.number(),\r\n datetime_alt: z.coerce.date().nullable().optional(),\r\n datetime_del: z.coerce.date().nullable().optional(),\r\n datetime_add: z.coerce.date(),\r\n id_wl: z.number(),\r\n id_account: z.union([z.number(), z.string()]),\r\n id_card: z.union([z.number(), z.string()]).nullable(),\r\n id_coupon: z.union([z.number(), z.string()]).nullable(),\r\n type: z.string(),\r\n payment_method: z.number().nullable(),\r\n periodicity: z.coerce.number().nullable(),\r\n value: z.number().nullable(),\r\n id_product: z.number(),\r\n id_plan: z.number(),\r\n plan_name: z.string().nullable().optional(),\r\n id_gateway: z.union([z.number(), z.string()]).nullable(),\r\n gateway_account: z.string().nullable(),\r\n date_hiring: z.coerce.date().nullable(),\r\n date_due: z.coerce.date(),\r\n date_cancellation: z.coerce.date().nullable(),\r\n date_verification: z.coerce.date().nullable(),\r\n cancellation_reason: z.string().nullable(),\r\n cancellation_description: z.string().nullable(),\r\n active: z.boolean(),\r\n charged: z.boolean(),\r\n datetime_last_update_periodicity: z.coerce.date().nullable().optional(),\r\n card_name: z.string().nullable().optional(),\r\n card_brand: z.string().nullable().optional(),\r\n card_number: z.string().nullable().optional(),\r\n items: z.array(SubscriptionItemSchema),\r\n});\r\n\r\nexport type Subscription = z.infer<typeof SubscriptionSchema>;\r\n\r\nexport interface FindSubscriptionsParams {\r\n active?: boolean;\r\n trial?: boolean;\r\n date_start?: string;\r\n date_end?: string;\r\n date_hiring_start?: string;\r\n date_hiring_end?: string;\r\n limit?: number;\r\n}\r\n"],"mappings":"AAAA,OAAO,OAAO;AAEP,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAAA,EACpC,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,cAAc,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,cAAc,EAAE,OAAO,KAAK;AAAA,EAC5B,OAAO,EAAE,OAAO;AAAA,EAChB,iBAAiB,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAAA,EACjD,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,OAAO,EAAE,OAAO;AAAA,EAChB,UAAU,EAAE,OAAO;AAAA,EACnB,UAAU,EAAE,OAAO;AAAA,EACnB,gBAAgB,EAAE,OAA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AK,EAAE,SAAS;AAAA,EACtC,UAAU,EAAE,OAAO,KAAK;AAAA,EACxB,mBAAmB,EAAE,OAAO,KAAK,EAAE,SAAS;AAAA,EAC5C,mBAAmB,EAAE,OAAO,KAAK,EAAE,SAAS;AAAA,EAC5C,qBAAqB,EAAE,OAAO,EAAE,SAAS;AAAA,EACzC,0BAA0B,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9C,QAAQ,EAAE,QAAQ;AAAA,EAClB,SAAS,EAAE,QAAQ;AAAA,EACnB,kCAAkC,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACtE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC1C,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC3C,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC5C,OAAO,EAAE,MAAM,sBAAsB;AACvC,CAAC;","names":[]}
|
package/dist/server.mjs
CHANGED
|
@@ -17,7 +17,6 @@ import { findUserById } from "./modules/users/action/find-user-by-id.action";
|
|
|
17
17
|
import { findCurrentAccount } from "./modules/accounts/actions/find-current-account.action";
|
|
18
18
|
import { listSubscriptionsAction } from "./modules/subscriptions/actions/list-subscriptions.action";
|
|
19
19
|
import { findPlanByIdAction } from "./modules/plans/actions/find-plan-by-id.action";
|
|
20
|
-
import { listPlansAction } from "./modules/plans/actions/list-plans.action";
|
|
21
20
|
import { calculateSubscriptionAction } from "./modules/subscriptions/actions/calculate-subscription.action";
|
|
22
21
|
import { updateSubscriptionPlanAction } from "./modules/subscriptions/actions/update-subscription-plan.action";
|
|
23
22
|
import { listCardsAction } from "./modules/cards/actions/list-cards.action";
|
|
@@ -53,8 +52,6 @@ import { getClientInfoFromRequest } from "./infra/utils/client-info";
|
|
|
53
52
|
import { getUserContext } from "./modules/auth/utils/get-user-context";
|
|
54
53
|
import { buildWlOverride, buildWlOverrideFromJwt } from "./modules/auth/utils/build-wl-override";
|
|
55
54
|
import { safeServerAction } from "./utils/safeServerAction";
|
|
56
|
-
import { processImageAction } from "./modules/images/actions/process-image.action";
|
|
57
|
-
import { processImage } from "./modules/images/services/image-processing.service";
|
|
58
55
|
export {
|
|
59
56
|
ApiClient,
|
|
60
57
|
accountService,
|
|
@@ -92,12 +89,9 @@ export {
|
|
|
92
89
|
listAvailableUsersAction,
|
|
93
90
|
listCardsAction,
|
|
94
91
|
listIaCreditsAction,
|
|
95
|
-
listPlansAction,
|
|
96
92
|
listProjectUsersAction,
|
|
97
93
|
listSubscriptionsAction,
|
|
98
94
|
plansService,
|
|
99
|
-
processImage,
|
|
100
|
-
processImageAction,
|
|
101
95
|
projectUsersService,
|
|
102
96
|
removeProjectUserAction,
|
|
103
97
|
requestEmailChangeAction,
|
package/dist/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only';\r\n\r\n// API Client\r\nexport { ApiClient, api, apiClient } from './infra/api/client';\r\n\r\n// Services\r\nexport { authService } from './modules/auth/services/auth.service';\r\nexport { whitelabelService } from './modules/whitelabel/services/whitelabel.service';\r\nexport { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalidate-whitelabel.action';\r\nexport { assertManagementPermission } from './modules/auth/utils/assert-management-permission';\r\nexport { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';\r\nexport { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';\r\nexport { assertPaidSubscription } from './modules/auth/utils/assert-paid-subscription';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';\r\nexport { plansService } from './modules/plans/services/plans.service';\r\nexport { cardsService } from './modules/cards/services/cards.service';\r\nexport { iaCreditsService } from './modules/ia-credits/services/ia-credits.service';\r\n\r\n// Actions\r\nexport { findWhitelabel } from './modules/whitelabel/actions/find-whitelabel.action';\r\nexport { validateSessionAction } from './modules/auth/actions/validate-session.action';\r\nexport { findUserById } from './modules/users/action/find-user-by-id.action';\r\nexport { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';\r\nexport { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';\r\nexport { findPlanByIdAction } from './modules/plans/actions/find-plan-by-id.action';\r\nexport {
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only';\r\n\r\n// API Client\r\nexport { ApiClient, api, apiClient } from './infra/api/client';\r\n\r\n// Services\r\nexport { authService } from './modules/auth/services/auth.service';\r\nexport { whitelabelService } from './modules/whitelabel/services/whitelabel.service';\r\nexport { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalidate-whitelabel.action';\r\nexport { assertManagementPermission } from './modules/auth/utils/assert-management-permission';\r\nexport { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';\r\nexport { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';\r\nexport { assertPaidSubscription } from './modules/auth/utils/assert-paid-subscription';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';\r\nexport { plansService } from './modules/plans/services/plans.service';\r\nexport { cardsService } from './modules/cards/services/cards.service';\r\nexport { iaCreditsService } from './modules/ia-credits/services/ia-credits.service';\r\n\r\n// Actions\r\nexport { findWhitelabel } from './modules/whitelabel/actions/find-whitelabel.action';\r\nexport { validateSessionAction } from './modules/auth/actions/validate-session.action';\r\nexport { findUserById } from './modules/users/action/find-user-by-id.action';\r\nexport { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';\r\nexport { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';\r\nexport { findPlanByIdAction } from './modules/plans/actions/find-plan-by-id.action';\r\nexport { calculateSubscriptionAction } from './modules/subscriptions/actions/calculate-subscription.action';\r\nexport { updateSubscriptionPlanAction } from './modules/subscriptions/actions/update-subscription-plan.action';\r\nexport { listCardsAction } from './modules/cards/actions/list-cards.action';\r\nexport { createCardAction } from './modules/cards/actions/create-card.action';\r\nexport { resolvePlanExtrasPrices } from './modules/subscriptions/utils/resolve-plan-extras-prices';\r\nexport { hasSubscriptionExpired } from './modules/subscriptions/utils/has-subscription-expired';\r\nexport { listIaCreditsAction } from './modules/ia-credits/actions/list-ia-credits.action';\r\n\r\n// Project Users Services & Actions (server-only)\r\nexport { projectUsersService } from './modules/projects/services/project-users.service';\r\nexport { listProjectUsersAction } from './modules/projects/actions/list-project-users.action';\r\nexport { listAvailableUsersAction } from './modules/projects/actions/list-available-users.action';\r\nexport { addProjectUserAction } from './modules/projects/actions/add-project-user.action';\r\nexport { removeProjectUserAction } from './modules/projects/actions/remove-project-user.action';\r\n\r\n// Account Services & Actions (server-only)\r\nexport { accountService } from './modules/accounts/services/account.service';\r\nexport { twoFactorService } from './modules/accounts/services/two-factor.service';\r\nexport {\r\n listAccountUsersAction,\r\n updateUserAction,\r\n updateAccountAction,\r\n updateAccountUserByIdAction,\r\n deleteAccountUserAction,\r\n deleteAccountAction,\r\n createAccountUserAction,\r\n changePasswordAction,\r\n requestEmailChangeAction,\r\n confirmEmailChangeAction,\r\n requestPhoneChangeAction,\r\n confirmPhoneChangeAction,\r\n generateTwoFactorAction,\r\n confirmTwoFactorAction,\r\n disableTwoFactorAction,\r\n} from './modules/accounts/actions/account-management.action';\r\n\r\n// Server Utils\r\nexport { getClientInfoFromRequest } from './infra/utils/client-info';\r\nexport { getUserContext } from './modules/auth/utils/get-user-context';\r\nexport { buildWlOverride, buildWlOverrideFromJwt } from './modules/auth/utils/build-wl-override';\r\nexport { safeServerAction } from './utils/safeServerAction';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,kCAAkC;AAC3C,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAC5C,SAAS,oCAAoC;AAC7C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AAGpC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AAGxC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,8BAA8B;AACxD,SAAS,wBAAwB;","names":[]}
|
package/package.json
CHANGED
|
@@ -97,7 +97,7 @@ export function ProjectSelectorPopover({
|
|
|
97
97
|
<div className="flex items-center justify-between">
|
|
98
98
|
<span className="paragraph-small-semibold">Projetos</span>
|
|
99
99
|
</div>
|
|
100
|
-
<Command className="gap-2">
|
|
100
|
+
<Command className="gap-2" defaultValue=" ">
|
|
101
101
|
<CommandInput placeholder="Busque aqui" />
|
|
102
102
|
<CommandList
|
|
103
103
|
className="custom-scrollbar paragraph-small-medium text-gray-600 h-[227px]"
|
|
@@ -37,18 +37,16 @@ function SheetPortal({
|
|
|
37
37
|
function SheetOverlay({
|
|
38
38
|
className,
|
|
39
39
|
...props
|
|
40
|
-
}: React.ComponentProps<
|
|
40
|
+
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
41
41
|
return (
|
|
42
|
-
<SheetPrimitive.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/>
|
|
51
|
-
</SheetPrimitive.Close>
|
|
42
|
+
<SheetPrimitive.Overlay
|
|
43
|
+
data-slot="sheet-overlay"
|
|
44
|
+
className={cn(
|
|
45
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[1000] bg-black/50",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
52
50
|
);
|
|
53
51
|
}
|
|
54
52
|
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
import { usePathname } from "next/navigation";
|
|
5
|
-
import { FrillEmbed } from "./FrillEmbed";
|
|
6
|
-
import { CrispEmbed } from "./CrispEmbed";
|
|
7
|
-
const EXCLUDED_ROUTES = ["/login", "/forgot-password", "/register"];
|
|
8
|
-
function getCrisp() {
|
|
9
|
-
try {
|
|
10
|
-
const key = "$crisp";
|
|
11
|
-
if (!(key in window)) return null;
|
|
12
|
-
const value = window[key];
|
|
13
|
-
return Array.isArray(value) ? value : null;
|
|
14
|
-
} catch {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function useHideCrispOnExcludedRoutes(isExcluded) {
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
try {
|
|
21
|
-
const $crisp = getCrisp();
|
|
22
|
-
if (!$crisp) return;
|
|
23
|
-
if (isExcluded) {
|
|
24
|
-
$crisp.push(["do", "chat:hide"]);
|
|
25
|
-
} else {
|
|
26
|
-
$crisp.push(["do", "chat:show"]);
|
|
27
|
-
}
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
}, [isExcluded]);
|
|
31
|
-
}
|
|
32
|
-
function EmbedWidgets() {
|
|
33
|
-
const pathname = usePathname();
|
|
34
|
-
const isExcluded = EXCLUDED_ROUTES.some((route) => pathname.startsWith(route));
|
|
35
|
-
useHideCrispOnExcludedRoutes(isExcluded);
|
|
36
|
-
if (isExcluded) return null;
|
|
37
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
-
/* @__PURE__ */ jsx(FrillEmbed, {}),
|
|
39
|
-
/* @__PURE__ */ jsx(CrispEmbed, {})
|
|
40
|
-
] });
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
EmbedWidgets
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=EmbedWidgets.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/embeds/EmbedWidgets.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\nimport { usePathname } from 'next/navigation';\nimport { FrillEmbed } from './FrillEmbed';\nimport { CrispEmbed } from './CrispEmbed';\n\nconst EXCLUDED_ROUTES = ['/login', '/forgot-password', '/register'];\n\nfunction getCrisp(): unknown[] | null {\n try {\n const key = '$crisp';\n if (!(key in window)) return null;\n const value = window[key];\n return Array.isArray(value) ? value : null;\n } catch {\n return null;\n }\n}\n\nfunction useHideCrispOnExcludedRoutes(isExcluded: boolean) {\n useEffect(() => {\n try {\n const $crisp = getCrisp();\n if (!$crisp) return;\n\n if (isExcluded) {\n $crisp.push(['do', 'chat:hide']);\n } else {\n $crisp.push(['do', 'chat:show']);\n }\n } catch {}\n }, [isExcluded]);\n}\n\nexport function EmbedWidgets() {\n const pathname = usePathname();\n const isExcluded = EXCLUDED_ROUTES.some((route) => pathname.startsWith(route));\n\n useHideCrispOnExcludedRoutes(isExcluded);\n\n if (isExcluded) return null;\n\n return (\n <>\n <FrillEmbed />\n <CrispEmbed />\n </>\n );\n}\n"],"mappings":";AA4CI,mBACE,KADF;AA1CJ,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAE3B,MAAM,kBAAkB,CAAC,UAAU,oBAAoB,WAAW;AAElE,SAAS,WAA6B;AACpC,MAAI;AACF,UAAM,MAAM;AACZ,QAAI,EAAE,OAAO,QAAS,QAAO;AAC7B,UAAM,QAAQ,OAAO,GAAG;AACxB,WAAO,MAAM,QAAQ,KAAK,IAAI,QAAQ;AAAA,EACxC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,SAAS,6BAA6B,YAAqB;AACzD,YAAU,MAAM;AACd,QAAI;AACF,YAAM,SAAS,SAAS;AACxB,UAAI,CAAC,OAAQ;AAEb,UAAI,YAAY;AACd,eAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAAA,MACjC,OAAO;AACL,eAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAAA,MACjC;AAAA,IACF,QAAQ;AAAA,IAAC;AAAA,EACX,GAAG,CAAC,UAAU,CAAC;AACjB;AAEO,SAAS,eAAe;AAC7B,QAAM,WAAW,YAAY;AAC7B,QAAM,aAAa,gBAAgB,KAAK,CAAC,UAAU,SAAS,WAAW,KAAK,CAAC;AAE7E,+BAA6B,UAAU;AAEvC,MAAI,WAAY,QAAO;AAEvB,SACE,iCACE;AAAA,wBAAC,cAAW;AAAA,IACZ,oBAAC,cAAW;AAAA,KACd;AAEJ;","names":[]}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRef, useState } from "react";
|
|
4
|
-
import ReactCrop, {
|
|
5
|
-
centerCrop,
|
|
6
|
-
makeAspectCrop
|
|
7
|
-
} from "react-image-crop";
|
|
8
|
-
import "react-image-crop/dist/ReactCrop.css";
|
|
9
|
-
import {
|
|
10
|
-
Dialog,
|
|
11
|
-
DialogContent,
|
|
12
|
-
DialogFooter,
|
|
13
|
-
DialogHeader,
|
|
14
|
-
DialogTitle
|
|
15
|
-
} from "../../ui/overlay/Dialog";
|
|
16
|
-
import { Button } from "../../ui/buttons/Button";
|
|
17
|
-
const baseCropStyles = `
|
|
18
|
-
.custom-crop-area .ReactCrop__crop-selection {
|
|
19
|
-
border: 2px solid white !important;
|
|
20
|
-
box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5) !important;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* Grid de 9 quadrados - linhas pontilhadas finas */
|
|
24
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid {
|
|
25
|
-
position: absolute;
|
|
26
|
-
inset: 0;
|
|
27
|
-
pointer-events: none;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line {
|
|
31
|
-
position: absolute;
|
|
32
|
-
background: repeating-linear-gradient(
|
|
33
|
-
to right,
|
|
34
|
-
rgba(255, 255, 255, 0.5) 0,
|
|
35
|
-
rgba(255, 255, 255, 0.5) 4px,
|
|
36
|
-
transparent 4px,
|
|
37
|
-
transparent 8px
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line.horizontal {
|
|
42
|
-
left: 0;
|
|
43
|
-
right: 0;
|
|
44
|
-
height: 1px;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line.vertical {
|
|
48
|
-
top: 0;
|
|
49
|
-
bottom: 0;
|
|
50
|
-
width: 1px;
|
|
51
|
-
background: repeating-linear-gradient(
|
|
52
|
-
to bottom,
|
|
53
|
-
rgba(255, 255, 255, 0.5) 0,
|
|
54
|
-
rgba(255, 255, 255, 0.5) 4px,
|
|
55
|
-
transparent 4px,
|
|
56
|
-
transparent 8px
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line.h1 { top: 33.33%; }
|
|
61
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line.h2 { top: 66.66%; }
|
|
62
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line.v1 { left: 33.33%; }
|
|
63
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-grid-line.v2 { left: 66.66%; }
|
|
64
|
-
|
|
65
|
-
/* C\xEDrculo inscrito */
|
|
66
|
-
.custom-crop-area.with-circle .ReactCrop__crop-selection .crop-circle {
|
|
67
|
-
position: absolute;
|
|
68
|
-
inset: 0;
|
|
69
|
-
border: 1px dashed rgba(255, 255, 255, 0.6);
|
|
70
|
-
border-radius: 50%;
|
|
71
|
-
pointer-events: none;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Bolinhas centrais nas bordas */
|
|
75
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-handle {
|
|
76
|
-
position: absolute;
|
|
77
|
-
width: 10px;
|
|
78
|
-
height: 10px;
|
|
79
|
-
background: white;
|
|
80
|
-
border-radius: 50%;
|
|
81
|
-
pointer-events: none;
|
|
82
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-handle.top {
|
|
86
|
-
top: -5px;
|
|
87
|
-
left: 50%;
|
|
88
|
-
transform: translateX(-50%);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-handle.bottom {
|
|
92
|
-
bottom: -5px;
|
|
93
|
-
left: 50%;
|
|
94
|
-
transform: translateX(-50%);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-handle.left {
|
|
98
|
-
left: -5px;
|
|
99
|
-
top: 50%;
|
|
100
|
-
transform: translateY(-50%);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.custom-crop-area .ReactCrop__crop-selection .crop-handle.right {
|
|
104
|
-
right: -5px;
|
|
105
|
-
top: 50%;
|
|
106
|
-
transform: translateY(-50%);
|
|
107
|
-
}
|
|
108
|
-
`;
|
|
109
|
-
function ImageCropModal({
|
|
110
|
-
open,
|
|
111
|
-
onOpenChange,
|
|
112
|
-
imageSrc,
|
|
113
|
-
aspectRatio,
|
|
114
|
-
onConfirm,
|
|
115
|
-
onCancel,
|
|
116
|
-
onImageLoad: onImageLoadCallback,
|
|
117
|
-
showCircleGuide,
|
|
118
|
-
minWidth,
|
|
119
|
-
minHeight
|
|
120
|
-
}) {
|
|
121
|
-
const imgRef = useRef(null);
|
|
122
|
-
const [crop, setCrop] = useState();
|
|
123
|
-
const [imageSize, setImageSize] = useState({ width: 0, height: 0 });
|
|
124
|
-
const onImageLoad = (e) => {
|
|
125
|
-
const { naturalWidth, naturalHeight } = e.currentTarget;
|
|
126
|
-
setImageSize({ width: naturalWidth, height: naturalHeight });
|
|
127
|
-
onImageLoadCallback?.(naturalWidth, naturalHeight);
|
|
128
|
-
const initialCrop = centerCrop(
|
|
129
|
-
makeAspectCrop(
|
|
130
|
-
{ unit: "%", width: 90 },
|
|
131
|
-
aspectRatio,
|
|
132
|
-
naturalWidth,
|
|
133
|
-
naturalHeight
|
|
134
|
-
),
|
|
135
|
-
naturalWidth,
|
|
136
|
-
naturalHeight
|
|
137
|
-
);
|
|
138
|
-
setCrop(initialCrop);
|
|
139
|
-
};
|
|
140
|
-
const minCropWidth = minWidth && imageSize.width > 0 ? Math.min(minWidth / imageSize.width * 100, 100) : void 0;
|
|
141
|
-
const minCropHeight = minHeight && imageSize.height > 0 ? Math.min(minHeight / imageSize.height * 100, 100) : void 0;
|
|
142
|
-
const handleConfirm = () => {
|
|
143
|
-
if (imgRef.current && crop) {
|
|
144
|
-
onConfirm(imgRef.current, crop);
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
const handleCancel = () => {
|
|
148
|
-
onCancel?.();
|
|
149
|
-
onOpenChange(false);
|
|
150
|
-
};
|
|
151
|
-
const shouldShowCircle = showCircleGuide ?? aspectRatio === 1;
|
|
152
|
-
const renderSelectionAddon = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
153
|
-
/* @__PURE__ */ jsxs("div", { className: "crop-grid", children: [
|
|
154
|
-
/* @__PURE__ */ jsx("div", { className: "crop-grid-line horizontal h1" }),
|
|
155
|
-
/* @__PURE__ */ jsx("div", { className: "crop-grid-line horizontal h2" }),
|
|
156
|
-
/* @__PURE__ */ jsx("div", { className: "crop-grid-line vertical v1" }),
|
|
157
|
-
/* @__PURE__ */ jsx("div", { className: "crop-grid-line vertical v2" })
|
|
158
|
-
] }),
|
|
159
|
-
shouldShowCircle && /* @__PURE__ */ jsx("div", { className: "crop-circle" }),
|
|
160
|
-
/* @__PURE__ */ jsx("div", { className: "crop-handle top" }),
|
|
161
|
-
/* @__PURE__ */ jsx("div", { className: "crop-handle bottom" }),
|
|
162
|
-
/* @__PURE__ */ jsx("div", { className: "crop-handle left" }),
|
|
163
|
-
/* @__PURE__ */ jsx("div", { className: "crop-handle right" })
|
|
164
|
-
] });
|
|
165
|
-
return /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange, children: [
|
|
166
|
-
/* @__PURE__ */ jsx("style", { children: baseCropStyles }),
|
|
167
|
-
/* @__PURE__ */ jsxs(
|
|
168
|
-
DialogContent,
|
|
169
|
-
{
|
|
170
|
-
className: "w-full md:w-[650px]! lg:w-[650px]! max-w-[650px]! max-[650px]:w-[calc(100%-32px)] p-0 gap-0 z-[1003]!",
|
|
171
|
-
overlayClassName: "z-[1002]!",
|
|
172
|
-
children: [
|
|
173
|
-
/* @__PURE__ */ jsx(DialogHeader, { className: "p-5", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-center text-[16px]!", children: "Ajustar imagem" }) }),
|
|
174
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 px-5 pb-5", children: [
|
|
175
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-center overflow-hidden rounded-lg", children: /* @__PURE__ */ jsx(
|
|
176
|
-
ReactCrop,
|
|
177
|
-
{
|
|
178
|
-
crop,
|
|
179
|
-
onChange: (c) => setCrop(c),
|
|
180
|
-
aspect: aspectRatio,
|
|
181
|
-
className: `max-h-[50vh] custom-crop-area ${shouldShowCircle ? "with-circle" : ""}`,
|
|
182
|
-
keepSelection: true,
|
|
183
|
-
minWidth: minCropWidth,
|
|
184
|
-
minHeight: minCropHeight,
|
|
185
|
-
renderSelectionAddon,
|
|
186
|
-
children: /* @__PURE__ */ jsx(
|
|
187
|
-
"img",
|
|
188
|
-
{
|
|
189
|
-
ref: imgRef,
|
|
190
|
-
src: imageSrc,
|
|
191
|
-
alt: "Crop",
|
|
192
|
-
onLoad: onImageLoad,
|
|
193
|
-
className: "max-h-[50vh] object-contain"
|
|
194
|
-
}
|
|
195
|
-
)
|
|
196
|
-
}
|
|
197
|
-
) }),
|
|
198
|
-
/* @__PURE__ */ jsx("p", { className: "paragraph-small-regular text-zinc-500 text-center", children: "Arraste para ajustar a \xE1rea de corte" })
|
|
199
|
-
] }),
|
|
200
|
-
/* @__PURE__ */ jsxs(DialogFooter, { className: "flex-row! items-center justify-start! gap-3 p-5 border-t border-zinc-200", children: [
|
|
201
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleConfirm, children: "Confirmar" }),
|
|
202
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleCancel, children: "Cancelar" })
|
|
203
|
-
] })
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
] });
|
|
208
|
-
}
|
|
209
|
-
export {
|
|
210
|
-
ImageCropModal
|
|
211
|
-
};
|
|
212
|
-
//# sourceMappingURL=ImageCropModal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/widgets/ImageUpload/ImageCropModal.tsx"],"sourcesContent":["'use client'\n\nimport { useRef, useState } from 'react'\nimport ReactCrop, {\n type Crop,\n centerCrop,\n makeAspectCrop,\n} from 'react-image-crop'\nimport 'react-image-crop/dist/ReactCrop.css'\nimport {\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../../ui/overlay/Dialog'\nimport { Button } from '../../ui/buttons/Button'\n\n// CSS customizado para grid pontilhado fino e círculo\nconst baseCropStyles = `\n .custom-crop-area .ReactCrop__crop-selection {\n border: 2px solid white !important;\n box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5) !important;\n }\n\n /* Grid de 9 quadrados - linhas pontilhadas finas */\n .custom-crop-area .ReactCrop__crop-selection .crop-grid {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line {\n position: absolute;\n background: repeating-linear-gradient(\n to right,\n rgba(255, 255, 255, 0.5) 0,\n rgba(255, 255, 255, 0.5) 4px,\n transparent 4px,\n transparent 8px\n );\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line.horizontal {\n left: 0;\n right: 0;\n height: 1px;\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line.vertical {\n top: 0;\n bottom: 0;\n width: 1px;\n background: repeating-linear-gradient(\n to bottom,\n rgba(255, 255, 255, 0.5) 0,\n rgba(255, 255, 255, 0.5) 4px,\n transparent 4px,\n transparent 8px\n );\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line.h1 { top: 33.33%; }\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line.h2 { top: 66.66%; }\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line.v1 { left: 33.33%; }\n .custom-crop-area .ReactCrop__crop-selection .crop-grid-line.v2 { left: 66.66%; }\n\n /* Círculo inscrito */\n .custom-crop-area.with-circle .ReactCrop__crop-selection .crop-circle {\n position: absolute;\n inset: 0;\n border: 1px dashed rgba(255, 255, 255, 0.6);\n border-radius: 50%;\n pointer-events: none;\n }\n\n /* Bolinhas centrais nas bordas */\n .custom-crop-area .ReactCrop__crop-selection .crop-handle {\n position: absolute;\n width: 10px;\n height: 10px;\n background: white;\n border-radius: 50%;\n pointer-events: none;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-handle.top {\n top: -5px;\n left: 50%;\n transform: translateX(-50%);\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-handle.bottom {\n bottom: -5px;\n left: 50%;\n transform: translateX(-50%);\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-handle.left {\n left: -5px;\n top: 50%;\n transform: translateY(-50%);\n }\n\n .custom-crop-area .ReactCrop__crop-selection .crop-handle.right {\n right: -5px;\n top: 50%;\n transform: translateY(-50%);\n }\n`\n\ninterface ImageCropModalProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n imageSrc: string\n aspectRatio: number\n onConfirm: (image: HTMLImageElement, crop: Crop) => void\n onCancel?: () => void\n onImageLoad?: (naturalWidth: number, naturalHeight: number) => void\n showCircleGuide?: boolean\n minWidth?: number\n minHeight?: number\n}\n\nexport function ImageCropModal({\n open,\n onOpenChange,\n imageSrc,\n aspectRatio,\n onConfirm,\n onCancel,\n onImageLoad: onImageLoadCallback,\n showCircleGuide,\n minWidth,\n minHeight,\n}: ImageCropModalProps) {\n const imgRef = useRef<HTMLImageElement>(null)\n const [crop, setCrop] = useState<Crop>()\n const [imageSize, setImageSize] = useState({ width: 0, height: 0 })\n\n const onImageLoad = (e: React.SyntheticEvent<HTMLImageElement>) => {\n const { naturalWidth, naturalHeight } = e.currentTarget\n setImageSize({ width: naturalWidth, height: naturalHeight })\n\n // Notifica o hook para verificar dimensões mínimas\n onImageLoadCallback?.(naturalWidth, naturalHeight)\n\n const initialCrop = centerCrop(\n makeAspectCrop(\n { unit: '%', width: 90 },\n aspectRatio,\n naturalWidth,\n naturalHeight\n ),\n naturalWidth,\n naturalHeight\n )\n\n setCrop(initialCrop)\n }\n\n // Calcula tamanho mínimo em porcentagem baseado nas dimensões mínimas em pixels\n const minCropWidth = minWidth && imageSize.width > 0\n ? Math.min((minWidth / imageSize.width) * 100, 100)\n : undefined\n const minCropHeight = minHeight && imageSize.height > 0\n ? Math.min((minHeight / imageSize.height) * 100, 100)\n : undefined\n\n const handleConfirm = () => {\n if (imgRef.current && crop) {\n onConfirm(imgRef.current, crop)\n }\n }\n\n const handleCancel = () => {\n onCancel?.()\n onOpenChange(false)\n }\n\n // Determina se deve mostrar círculo (aspect ratio 1:1 por padrão)\n const shouldShowCircle = showCircleGuide ?? aspectRatio === 1\n\n // Renderiza grid, círculo e bolinhas dentro da área de crop\n const renderSelectionAddon = () => (\n <>\n {/* Grid de 9 quadrados com linhas pontilhadas */}\n <div className=\"crop-grid\">\n <div className=\"crop-grid-line horizontal h1\" />\n <div className=\"crop-grid-line horizontal h2\" />\n <div className=\"crop-grid-line vertical v1\" />\n <div className=\"crop-grid-line vertical v2\" />\n </div>\n {/* Círculo inscrito */}\n {shouldShowCircle && <div className=\"crop-circle\" />}\n {/* Bolinhas centrais nas bordas */}\n <div className=\"crop-handle top\" />\n <div className=\"crop-handle bottom\" />\n <div className=\"crop-handle left\" />\n <div className=\"crop-handle right\" />\n </>\n )\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <style>{baseCropStyles}</style>\n <DialogContent\n className=\"w-full md:w-[650px]! lg:w-[650px]! max-w-[650px]! max-[650px]:w-[calc(100%-32px)] p-0 gap-0 z-[1003]!\"\n overlayClassName=\"z-[1002]!\"\n >\n <DialogHeader className=\"p-5\">\n <DialogTitle className=\"text-center text-[16px]!\">\n Ajustar imagem\n </DialogTitle>\n </DialogHeader>\n\n <div className=\"flex flex-col gap-4 px-5 pb-5\">\n <div className=\"flex justify-center overflow-hidden rounded-lg\">\n <ReactCrop\n crop={crop}\n onChange={(c) => setCrop(c)}\n aspect={aspectRatio}\n className={`max-h-[50vh] custom-crop-area ${shouldShowCircle ? 'with-circle' : ''}`}\n keepSelection\n minWidth={minCropWidth}\n minHeight={minCropHeight}\n renderSelectionAddon={renderSelectionAddon}\n >\n <img\n ref={imgRef}\n src={imageSrc}\n alt=\"Crop\"\n onLoad={onImageLoad}\n className=\"max-h-[50vh] object-contain\"\n />\n </ReactCrop>\n </div>\n\n <p className=\"paragraph-small-regular text-zinc-500 text-center\">\n Arraste para ajustar a área de corte\n </p>\n </div>\n\n <DialogFooter className=\"flex-row! items-center justify-start! gap-3 p-5 border-t border-zinc-200\">\n <Button onClick={handleConfirm}>Confirmar</Button>\n <Button variant=\"secondary\" onClick={handleCancel}>\n Cancelar\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";AA0LI,mBAGI,KADF,YAFF;AAxLJ,SAAS,QAAQ,gBAAgB;AACjC,OAAO;AAAA,EAEL;AAAA,EACA;AAAA,OACK;AACP,OAAO;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAGvB,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0GhB,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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
6
|
-
DialogFooter,
|
|
7
|
-
DialogHeader,
|
|
8
|
-
DialogTitle
|
|
9
|
-
} from "../../ui/overlay/Dialog";
|
|
10
|
-
import { Button } from "../../ui/buttons/Button";
|
|
11
|
-
function ImageTooSmallModal({
|
|
12
|
-
open,
|
|
13
|
-
onOpenChange,
|
|
14
|
-
fileName,
|
|
15
|
-
minWidth,
|
|
16
|
-
minHeight,
|
|
17
|
-
onSelectAnother,
|
|
18
|
-
onCancel
|
|
19
|
-
}) {
|
|
20
|
-
const dimensionText = `${minWidth}x${minHeight}px`;
|
|
21
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
22
|
-
DialogContent,
|
|
23
|
-
{
|
|
24
|
-
className: "w-full md:w-[480px]! lg:w-[480px]! max-w-[480px]! max-[480px]:w-[calc(100%-32px)] p-0 gap-0 z-[1003]!",
|
|
25
|
-
overlayClassName: "z-[1002]!",
|
|
26
|
-
children: [
|
|
27
|
-
/* @__PURE__ */ jsx(DialogHeader, { className: "p-5", children: /* @__PURE__ */ jsxs(DialogTitle, { className: "text-center text-[16px]!", children: [
|
|
28
|
-
"Foto menor que ",
|
|
29
|
-
dimensionText
|
|
30
|
-
] }) }),
|
|
31
|
-
/* @__PURE__ */ jsx("div", { className: "px-5 pb-5", children: /* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-zinc-600 text-center", children: [
|
|
32
|
-
'O arquivo "',
|
|
33
|
-
fileName,
|
|
34
|
-
'" \xE9 menor que ',
|
|
35
|
-
dimensionText,
|
|
36
|
-
". Fa\xE7a envio de uma imagem com pelo menos ",
|
|
37
|
-
dimensionText,
|
|
38
|
-
" para continuar."
|
|
39
|
-
] }) }),
|
|
40
|
-
/* @__PURE__ */ jsxs(DialogFooter, { className: "flex-row! items-center justify-start! gap-3 p-5 border-t border-zinc-200", children: [
|
|
41
|
-
/* @__PURE__ */ jsx(Button, { onClick: onSelectAnother, children: "Enviar outra" }),
|
|
42
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onCancel, children: "Cancelar" })
|
|
43
|
-
] })
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
) });
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
ImageTooSmallModal
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=ImageTooSmallModal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/widgets/ImageUpload/ImageTooSmallModal.tsx"],"sourcesContent":["'use client'\n\nimport {\n Dialog,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../../ui/overlay/Dialog'\nimport { Button } from '../../ui/buttons/Button'\n\ninterface ImageTooSmallModalProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n fileName: string\n minWidth: number\n minHeight: number\n onSelectAnother: () => void\n onCancel: () => void\n}\n\nexport function ImageTooSmallModal({\n open,\n onOpenChange,\n fileName,\n minWidth,\n minHeight,\n onSelectAnother,\n onCancel,\n}: ImageTooSmallModalProps) {\n const dimensionText = `${minWidth}x${minHeight}px`\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n className=\"w-full md:w-[480px]! lg:w-[480px]! max-w-[480px]! max-[480px]:w-[calc(100%-32px)] p-0 gap-0 z-[1003]!\"\n overlayClassName=\"z-[1002]!\"\n >\n <DialogHeader className=\"p-5\">\n <DialogTitle className=\"text-center text-[16px]!\">\n Foto menor que {dimensionText}\n </DialogTitle>\n </DialogHeader>\n\n <div className=\"px-5 pb-5\">\n <p className=\"paragraph-small-regular text-zinc-600 text-center\">\n O arquivo \"{fileName}\" é menor que {dimensionText}. Faça envio de\n uma imagem com pelo menos {dimensionText} para continuar.\n </p>\n </div>\n\n <DialogFooter className=\"flex-row! items-center justify-start! gap-3 p-5 border-t border-zinc-200\">\n <Button onClick={onSelectAnother}>Enviar outra</Button>\n <Button variant=\"secondary\" onClick={onCancel}>\n Cancelar\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n )\n}\n"],"mappings":";AAsCQ,cACE,YADF;AApCR;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AAYhB,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,gBAAgB,GAAG,QAAQ,IAAI,SAAS;AAE9C,SACE,oBAAC,UAAO,MAAY,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,kBAAiB;AAAA,MAEjB;AAAA,4BAAC,gBAAa,WAAU,OACtB,+BAAC,eAAY,WAAU,4BAA2B;AAAA;AAAA,UAChC;AAAA,WAClB,GACF;AAAA,QAEA,oBAAC,SAAI,WAAU,aACb,+BAAC,OAAE,WAAU,qDAAoD;AAAA;AAAA,UACnD;AAAA,UAAS;AAAA,UAAe;AAAA,UAAc;AAAA,UACvB;AAAA,UAAc;AAAA,WAC3C,GACF;AAAA,QAEA,qBAAC,gBAAa,WAAU,4EACtB;AAAA,8BAAC,UAAO,SAAS,iBAAiB,0BAAY;AAAA,UAC9C,oBAAC,UAAO,SAAQ,aAAY,SAAS,UAAU,sBAE/C;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|