@greatapps/common 1.1.131 → 1.1.133
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/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -1
- package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -1
- package/dist/components/layouts/AppNavBar.mjs.map +1 -1
- package/dist/components/layouts/NavBar.mjs.map +1 -1
- package/dist/components/navigation/NavItemsContext.mjs.map +1 -1
- package/dist/components/navigation/shells/TabsMobileShell.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.map +1 -1
- package/dist/components/ui/buttons/Button.mjs.map +1 -1
- package/dist/components/ui/buttons/CancelButton.mjs.map +1 -1
- package/dist/components/ui/buttons/CopyButton.mjs.map +1 -1
- package/dist/components/ui/data-display/Accordion.mjs.map +1 -1
- package/dist/components/ui/data-display/Badge.mjs.map +1 -1
- package/dist/components/ui/data-display/Card.mjs.map +1 -1
- package/dist/components/ui/data-display/Pagination.mjs.map +1 -1
- package/dist/components/ui/data-display/ScrollArea.mjs.map +1 -1
- package/dist/components/ui/data-display/Separator.mjs.map +1 -1
- package/dist/components/ui/data-display/Table.mjs.map +1 -1
- package/dist/components/ui/data-display/Tabs.mjs.map +1 -1
- package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -1
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +1 -1
- package/dist/components/ui/feedback/Progress.mjs.map +1 -1
- package/dist/components/ui/feedback/Toast.mjs.map +1 -1
- package/dist/components/ui/form/Calendar.mjs.map +1 -1
- package/dist/components/ui/form/Checkbox.mjs.map +1 -1
- package/dist/components/ui/form/DatePicker.mjs.map +1 -1
- package/dist/components/ui/form/DateRangePicker.mjs.map +1 -1
- package/dist/components/ui/form/Input.mjs.map +1 -1
- package/dist/components/ui/form/InputOtp.mjs.map +1 -1
- package/dist/components/ui/form/RadioGroup.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/form/Switch.mjs.map +1 -1
- package/dist/components/ui/form/Textarea.mjs.map +1 -1
- package/dist/components/ui/overlay/Command.mjs.map +1 -1
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Popover.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/Tooltip.mjs.map +1 -1
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +1 -1
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +1 -1
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +1 -1
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +1 -1
- package/dist/modules/auth/hooks/login.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/logout.hook.mjs.map +1 -1
- package/dist/modules/auth/hooks/register.hook.mjs.map +1 -1
- package/dist/modules/auth/services/auth.service.mjs +1 -1
- package/dist/modules/auth/services/auth.service.mjs.map +1 -1
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +1 -1
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -1
- package/dist/modules/projects/actions/list-available-users.action.mjs.map +1 -1
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +1 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +1 -1
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +1 -1
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +1 -1
- package/dist/modules/users/action/list-messages.action.mjs.map +1 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -1
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs +15 -0
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs.map +1 -0
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +1 -1
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs +76 -0
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs.map +1 -0
- package/dist/modules/whitelabel/styles-schema.mjs +1 -0
- package/dist/modules/whitelabel/styles-schema.mjs.map +1 -0
- package/dist/providers/whitelabel.provider.mjs +14 -17
- package/dist/providers/whitelabel.provider.mjs.map +1 -1
- package/dist/server.mjs +5 -1
- package/dist/server.mjs.map +1 -1
- package/dist/utils/safeServerAction.mjs.map +1 -1
- package/dist/utils/withAction.mjs.map +1 -1
- package/package.json +84 -84
- package/src/components/account/ConfirmDeleteAccountModal.tsx +55 -55
- package/src/components/account/DeleteAccountModal.tsx +130 -130
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +49 -49
- package/src/components/account/hooks/useTwoFactorAuthForm.tsx +101 -101
- package/src/components/layouts/AppMobileNavBar.tsx +125 -125
- package/src/components/layouts/AppNavBar.tsx +57 -57
- package/src/components/layouts/NavBar.tsx +139 -139
- package/src/components/navigation/NavItemsContext.ts +20 -20
- package/src/components/navigation/shells/TabsMobileShell.tsx +72 -72
- package/src/components/navigation/subcomponents/ProjectSelector.tsx +1 -1
- package/src/components/pages/notifications/Notifications.tsx +160 -160
- package/src/components/ui/buttons/Button.tsx +57 -57
- package/src/components/ui/buttons/CancelButton.tsx +14 -14
- package/src/components/ui/buttons/CopyButton.tsx +54 -54
- package/src/components/ui/data-display/Accordion.tsx +81 -81
- package/src/components/ui/data-display/Badge.tsx +47 -47
- package/src/components/ui/data-display/Card.tsx +93 -93
- package/src/components/ui/data-display/Pagination.tsx +126 -126
- package/src/components/ui/data-display/ScrollArea.tsx +59 -59
- package/src/components/ui/data-display/Separator.tsx +29 -29
- package/src/components/ui/data-display/Table.tsx +117 -117
- package/src/components/ui/data-display/Tabs.tsx +67 -67
- package/src/components/ui/feedback/CircularProgress.tsx +75 -75
- package/src/components/ui/feedback/DefaultCircularProgress.tsx +53 -53
- package/src/components/ui/feedback/LoadingOverlay.tsx +31 -31
- package/src/components/ui/feedback/Progress.tsx +40 -40
- package/src/components/ui/feedback/Toast.tsx +101 -101
- package/src/components/ui/form/Calendar.tsx +228 -228
- package/src/components/ui/form/Checkbox.tsx +31 -31
- package/src/components/ui/form/DatePicker.tsx +97 -97
- package/src/components/ui/form/DateRangePicker.tsx +108 -108
- package/src/components/ui/form/Input.tsx +20 -20
- package/src/components/ui/form/InputOtp.tsx +80 -80
- package/src/components/ui/form/RadioGroup.tsx +45 -45
- package/src/components/ui/form/Select.tsx +200 -200
- package/src/components/ui/form/Switch.tsx +32 -32
- package/src/components/ui/form/Textarea.tsx +19 -19
- package/src/components/ui/overlay/Command.tsx +185 -185
- package/src/components/ui/overlay/Dialog.tsx +151 -151
- package/src/components/ui/overlay/Popover.tsx +49 -49
- package/src/components/ui/overlay/Sheet.tsx +159 -159
- package/src/components/ui/overlay/Tooltip.tsx +62 -62
- package/src/hooks/copy-to-clipboard.hook.tsx +67 -67
- package/src/index.ts +348 -346
- package/src/modules/accounts/actions/account-management.action.ts +90 -90
- package/src/modules/accounts/actions/find-current-account.action.ts +9 -9
- package/src/modules/accounts/actions/list-currencies.action.ts +8 -8
- package/src/modules/accounts/actions/list-timezones.action.ts +8 -8
- package/src/modules/accounts/hooks/current-account.hook.tsx +22 -22
- package/src/modules/accounts/hooks/useAccountManagement.ts +85 -85
- package/src/modules/accounts/hooks/useCurrencies.ts +15 -15
- package/src/modules/accounts/hooks/useTimezones.ts +15 -15
- package/src/modules/auth/hooks/login.hook.tsx +17 -17
- package/src/modules/auth/hooks/logout.hook.tsx +11 -11
- package/src/modules/auth/hooks/register.hook.tsx +11 -11
- package/src/modules/auth/schema.ts +1 -0
- package/src/modules/auth/services/auth.service.ts +1 -1
- package/src/modules/ia-credits/actions/list-ia-credits.action.ts +8 -8
- package/src/modules/projects/actions/add-project-user.action.ts +9 -9
- package/src/modules/projects/actions/list-available-users.action.ts +9 -9
- package/src/modules/projects/actions/list-project-users.action.ts +9 -9
- package/src/modules/projects/actions/remove-project-user.action.ts +9 -9
- package/src/modules/projects/hooks/list-available-users.hook.ts +33 -33
- package/src/modules/projects/hooks/list-project-users.hook.ts +33 -33
- package/src/modules/subscriptions/actions/list-subscriptions.action.ts +9 -9
- package/src/modules/subscriptions/hooks/find-active-subscription.hook.ts +19 -19
- package/src/modules/subscriptions/hooks/list-subscriptions.hook.ts +17 -17
- package/src/modules/users/action/find-user-by-id.action.ts +8 -8
- package/src/modules/users/action/list-messages.action.ts +12 -12
- package/src/modules/users/action/mark-all-messages-as-read.action.ts +8 -8
- package/src/modules/users/action/mark-message-as-read.action.ts +8 -8
- package/src/modules/users/hooks/messages.hook.ts +60 -60
- package/src/modules/whitelabel/actions/find-whitelabel-styles.action.ts +14 -0
- package/src/modules/whitelabel/actions/find-whitelabel.action.ts +23 -23
- package/src/modules/whitelabel/services/whitelabel-styles.service.ts +91 -0
- package/src/modules/whitelabel/styles-schema.ts +37 -0
- package/src/providers/whitelabel.provider.tsx +46 -44
- package/src/server.ts +2 -0
- package/src/utils/safeServerAction.ts +21 -21
- package/src/utils/withAction.ts +13 -13
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import greatCache from "@greatapps/cache";
|
|
2
|
+
import { ApiError } from "../../../infra/api/types";
|
|
3
|
+
function parseStyleField(value) {
|
|
4
|
+
if (typeof value === "string") {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(value);
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
if (value && typeof value === "object") return value;
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function mapWithStyleResponse(row) {
|
|
15
|
+
return {
|
|
16
|
+
id: row["style_id"],
|
|
17
|
+
id_wl: row["style_id_wl"],
|
|
18
|
+
general: parseStyleField(row["style_general"]),
|
|
19
|
+
signin_page: parseStyleField(row["style_signin_page"]),
|
|
20
|
+
signup_page: parseStyleField(row["style_signup_page"]),
|
|
21
|
+
dashboard: parseStyleField(row["style_dashboard"])
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
class WhitelabelStylesService {
|
|
25
|
+
getApiUrl() {
|
|
26
|
+
const apiUrl = process.env.GAPPS_R3_API_URL;
|
|
27
|
+
if (!apiUrl) throw new ApiError("GAPPS_R3_API_URL not configured", "CONFIG_ERROR", 500);
|
|
28
|
+
return apiUrl;
|
|
29
|
+
}
|
|
30
|
+
getToken() {
|
|
31
|
+
const token = process.env.WHITELABEL_TOKEN_MASTER;
|
|
32
|
+
if (!token) throw new ApiError("WHITELABEL_TOKEN_MASTER not configured", "CONFIG_ERROR", 500);
|
|
33
|
+
return token;
|
|
34
|
+
}
|
|
35
|
+
async getByWlId(id_wl) {
|
|
36
|
+
const apiUrl = this.getApiUrl();
|
|
37
|
+
const token = this.getToken();
|
|
38
|
+
const url = `${apiUrl}/v1/pt-br/1/whitelabels/${id_wl}/with-style`;
|
|
39
|
+
console.log("[WhitelabelStylesService] Fetching with-style for id_wl", { id_wl, url });
|
|
40
|
+
const cache = new greatCache({
|
|
41
|
+
service: "whitelabel-styles-service",
|
|
42
|
+
version: "1.0",
|
|
43
|
+
domain: "whitelabel-cache.greatapps.com.br",
|
|
44
|
+
ambient: process.env.NODE_ENV || "development"
|
|
45
|
+
});
|
|
46
|
+
const cacheKey = `whitelabel-styles-${id_wl}`;
|
|
47
|
+
const cachedData = await cache.select(cacheKey);
|
|
48
|
+
if (cachedData.status == 1 && "data" in cachedData && cachedData.data) {
|
|
49
|
+
console.log("[WhitelabelStylesService] Cache hit for id_wl", { id_wl });
|
|
50
|
+
return JSON.parse(cachedData.data);
|
|
51
|
+
}
|
|
52
|
+
const response = await fetch(url, {
|
|
53
|
+
method: "GET",
|
|
54
|
+
headers: { authorization: token }
|
|
55
|
+
});
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
console.error("[WhitelabelStylesService] Failed to fetch with-style", { status: response.status });
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const result = await response.json();
|
|
61
|
+
if (result.status !== 1 || !result.data?.length) {
|
|
62
|
+
console.warn("[WhitelabelStylesService] No data in with-style for id_wl", { id_wl });
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const parsed = mapWithStyleResponse(result.data[0]);
|
|
66
|
+
if (parsed.id) {
|
|
67
|
+
await cache.insert(cacheKey, JSON.stringify(parsed), 300);
|
|
68
|
+
}
|
|
69
|
+
return parsed;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const whitelabelStylesService = new WhitelabelStylesService();
|
|
73
|
+
export {
|
|
74
|
+
whitelabelStylesService
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=whitelabel-styles.service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/whitelabel/services/whitelabel-styles.service.ts"],"sourcesContent":["import greatCache from '@greatapps/cache';\nimport { ApiError } from '../../../infra/api/types';\nimport { WhitelabelStylesData } from '../styles-schema';\n\ninterface WithStyleApiResponse {\n status: number;\n data: Record<string, unknown>[];\n}\n\nfunction parseStyleField<T>(value: unknown): T | null {\n if (typeof value === 'string') {\n try { return JSON.parse(value) as T; } catch { return null; }\n }\n if (value && typeof value === 'object') return value as T;\n return null;\n}\n\nfunction mapWithStyleResponse(row: Record<string, unknown>): WhitelabelStylesData {\n return {\n id: row['style_id'] as number,\n id_wl: row['style_id_wl'] as number,\n general: parseStyleField(row['style_general']),\n signin_page: parseStyleField(row['style_signin_page']),\n signup_page: parseStyleField(row['style_signup_page']),\n dashboard: parseStyleField(row['style_dashboard']),\n };\n}\n\nclass WhitelabelStylesService {\n private getApiUrl(): string {\n const apiUrl = process.env.GAPPS_R3_API_URL;\n if (!apiUrl) throw new ApiError('GAPPS_R3_API_URL not configured', 'CONFIG_ERROR', 500);\n return apiUrl;\n }\n\n private getToken(): string {\n const token = process.env.WHITELABEL_TOKEN_MASTER;\n if (!token) throw new ApiError('WHITELABEL_TOKEN_MASTER not configured', 'CONFIG_ERROR', 500);\n return token;\n }\n\n async getByWlId(id_wl: number): Promise<WhitelabelStylesData | null> {\n const apiUrl = this.getApiUrl();\n const token = this.getToken();\n const url = `${apiUrl}/v1/pt-br/1/whitelabels/${id_wl}/with-style`;\n\n console.log('[WhitelabelStylesService] Fetching with-style for id_wl', { id_wl, url });\n\n const cache = new greatCache({\n service: 'whitelabel-styles-service',\n version: '1.0',\n domain: 'whitelabel-cache.greatapps.com.br',\n ambient: process.env.NODE_ENV || 'development',\n });\n\n const cacheKey = `whitelabel-styles-${id_wl}`;\n const cachedData = await cache.select(cacheKey);\n\n if (cachedData.status == 1 && 'data' in cachedData && cachedData.data) {\n console.log('[WhitelabelStylesService] Cache hit for id_wl', { id_wl });\n return JSON.parse(cachedData.data) as WhitelabelStylesData;\n }\n\n const response = await fetch(url, {\n method: 'GET',\n headers: { authorization: token },\n });\n\n if (!response.ok) {\n console.error('[WhitelabelStylesService] Failed to fetch with-style', { status: response.status });\n return null;\n }\n\n const result: WithStyleApiResponse = await response.json();\n\n if (result.status !== 1 || !result.data?.length) {\n console.warn('[WhitelabelStylesService] No data in with-style for id_wl', { id_wl });\n return null;\n }\n\n const parsed = mapWithStyleResponse(result.data[0]);\n\n if (parsed.id) {\n await cache.insert(cacheKey, JSON.stringify(parsed), 300);\n }\n\n return parsed;\n }\n}\n\nexport const whitelabelStylesService = new WhitelabelStylesService();\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAQzB,SAAS,gBAAmB,OAA0B;AACpD,MAAI,OAAO,UAAU,UAAU;AAC7B,QAAI;AAAE,aAAO,KAAK,MAAM,KAAK;AAAA,IAAQ,QAAQ;AAAE,aAAO;AAAA,IAAM;AAAA,EAC9D;AACA,MAAI,SAAS,OAAO,UAAU,SAAU,QAAO;AAC/C,SAAO;AACT;AAEA,SAAS,qBAAqB,KAAoD;AAChF,SAAO;AAAA,IACL,IAAI,IAAI,UAAU;AAAA,IAClB,OAAO,IAAI,aAAa;AAAA,IACxB,SAAS,gBAAgB,IAAI,eAAe,CAAC;AAAA,IAC7C,aAAa,gBAAgB,IAAI,mBAAmB,CAAC;AAAA,IACrD,aAAa,gBAAgB,IAAI,mBAAmB,CAAC;AAAA,IACrD,WAAW,gBAAgB,IAAI,iBAAiB,CAAC;AAAA,EACnD;AACF;AAEA,MAAM,wBAAwB;AAAA,EACpB,YAAoB;AAC1B,UAAM,SAAS,QAAQ,IAAI;AAC3B,QAAI,CAAC,OAAQ,OAAM,IAAI,SAAS,mCAAmC,gBAAgB,GAAG;AACtF,WAAO;AAAA,EACT;AAAA,EAEQ,WAAmB;AACzB,UAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAI,CAAC,MAAO,OAAM,IAAI,SAAS,0CAA0C,gBAAgB,GAAG;AAC5F,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,UAAU,OAAqD;AACnE,UAAM,SAAS,KAAK,UAAU;AAC9B,UAAM,QAAQ,KAAK,SAAS;AAC5B,UAAM,MAAM,GAAG,MAAM,2BAA2B,KAAK;AAErD,YAAQ,IAAI,2DAA2D,EAAE,OAAO,IAAI,CAAC;AAErF,UAAM,QAAQ,IAAI,WAAW;AAAA,MAC3B,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS,QAAQ,IAAI,YAAY;AAAA,IACnC,CAAC;AAED,UAAM,WAAW,qBAAqB,KAAK;AAC3C,UAAM,aAAa,MAAM,MAAM,OAAO,QAAQ;AAE9C,QAAI,WAAW,UAAU,KAAK,UAAU,cAAc,WAAW,MAAM;AACrE,cAAQ,IAAI,iDAAiD,EAAE,MAAM,CAAC;AACtE,aAAO,KAAK,MAAM,WAAW,IAAI;AAAA,IACnC;AAEA,UAAM,WAAW,MAAM,MAAM,KAAK;AAAA,MAChC,QAAQ;AAAA,MACR,SAAS,EAAE,eAAe,MAAM;AAAA,IAClC,CAAC;AAED,QAAI,CAAC,SAAS,IAAI;AAChB,cAAQ,MAAM,wDAAwD,EAAE,QAAQ,SAAS,OAAO,CAAC;AACjG,aAAO;AAAA,IACT;AAEA,UAAM,SAA+B,MAAM,SAAS,KAAK;AAEzD,QAAI,OAAO,WAAW,KAAK,CAAC,OAAO,MAAM,QAAQ;AAC/C,cAAQ,KAAK,6DAA6D,EAAE,MAAM,CAAC;AACnF,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,qBAAqB,OAAO,KAAK,CAAC,CAAC;AAElD,QAAI,OAAO,IAAI;AACb,YAAM,MAAM,OAAO,UAAU,KAAK,UAAU,MAAM,GAAG,GAAG;AAAA,IAC1D;AAEA,WAAO;AAAA,EACT;AACF;AAEO,MAAM,0BAA0B,IAAI,wBAAwB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=styles-schema.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext } from "react";
|
|
4
|
-
const WhitelabelContext = createContext(
|
|
5
|
-
void 0
|
|
6
|
-
);
|
|
4
|
+
const WhitelabelContext = createContext(void 0);
|
|
7
5
|
function WhitelabelProvider({
|
|
8
6
|
children,
|
|
9
|
-
whitelabel
|
|
7
|
+
whitelabel,
|
|
8
|
+
whitelabelStyles = null
|
|
10
9
|
}) {
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
-
WhitelabelContext.Provider,
|
|
13
|
-
{
|
|
14
|
-
value: {
|
|
15
|
-
whitelabel
|
|
16
|
-
},
|
|
17
|
-
children
|
|
18
|
-
}
|
|
19
|
-
);
|
|
10
|
+
return /* @__PURE__ */ jsx(WhitelabelContext.Provider, { value: { whitelabel, whitelabelStyles }, children });
|
|
20
11
|
}
|
|
21
12
|
function useWhitelabel() {
|
|
22
13
|
const context = useContext(WhitelabelContext);
|
|
23
14
|
if (context === void 0) {
|
|
24
|
-
throw new Error(
|
|
25
|
-
"useWhitelabel deve ser usado dentro de um WhitelabelProvider"
|
|
26
|
-
);
|
|
15
|
+
throw new Error("useWhitelabel deve ser usado dentro de um WhitelabelProvider");
|
|
27
16
|
}
|
|
28
17
|
return context;
|
|
29
18
|
}
|
|
19
|
+
function useWhitelabelStyles() {
|
|
20
|
+
const context = useContext(WhitelabelContext);
|
|
21
|
+
if (context === void 0) {
|
|
22
|
+
throw new Error("useWhitelabelStyles deve ser usado dentro de um WhitelabelProvider");
|
|
23
|
+
}
|
|
24
|
+
return context.whitelabelStyles;
|
|
25
|
+
}
|
|
30
26
|
export {
|
|
31
27
|
WhitelabelProvider,
|
|
32
|
-
useWhitelabel
|
|
28
|
+
useWhitelabel,
|
|
29
|
+
useWhitelabelStyles
|
|
33
30
|
};
|
|
34
31
|
//# sourceMappingURL=whitelabel.provider.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/providers/whitelabel.provider.tsx"],"sourcesContent":["\"use client\";\
|
|
1
|
+
{"version":3,"sources":["../../src/providers/whitelabel.provider.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, ReactNode, useContext } from \"react\";\nimport { WhitelabelData } from \"../modules/whitelabel/schema\";\nimport { WhitelabelStylesData } from \"../modules/whitelabel/styles-schema\";\n\ninterface WhitelabelContextProps {\n whitelabel: WhitelabelData | null;\n whitelabelStyles: WhitelabelStylesData | null;\n}\n\nconst WhitelabelContext = createContext<WhitelabelContextProps | undefined>(undefined);\n\ninterface WhitelabelProviderProps {\n children: ReactNode;\n whitelabel: WhitelabelData | null;\n whitelabelStyles?: WhitelabelStylesData | null;\n}\n\nexport function WhitelabelProvider({\n children,\n whitelabel,\n whitelabelStyles = null,\n}: WhitelabelProviderProps) {\n return (\n <WhitelabelContext.Provider value={{ whitelabel, whitelabelStyles }}>\n {children}\n </WhitelabelContext.Provider>\n );\n}\n\nexport function useWhitelabel(): WhitelabelContextProps {\n const context = useContext(WhitelabelContext);\n if (context === undefined) {\n throw new Error(\"useWhitelabel deve ser usado dentro de um WhitelabelProvider\");\n }\n return context;\n}\n\nexport function useWhitelabelStyles(): WhitelabelStylesData | null {\n const context = useContext(WhitelabelContext);\n if (context === undefined) {\n throw new Error(\"useWhitelabelStyles deve ser usado dentro de um WhitelabelProvider\");\n }\n return context.whitelabelStyles;\n}\n"],"mappings":";AAyBI;AAvBJ,SAAS,eAA0B,kBAAkB;AASrD,MAAM,oBAAoB,cAAkD,MAAS;AAQ9E,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA,mBAAmB;AACrB,GAA4B;AAC1B,SACE,oBAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,YAAY,iBAAiB,GAC/D,UACH;AAEJ;AAEO,SAAS,gBAAwC;AACtD,QAAM,UAAU,WAAW,iBAAiB;AAC5C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,8DAA8D;AAAA,EAChF;AACA,SAAO;AACT;AAEO,SAAS,sBAAmD;AACjE,QAAM,UAAU,WAAW,iBAAiB;AAC5C,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI,MAAM,oEAAoE;AAAA,EACtF;AACA,SAAO,QAAQ;AACjB;","names":[]}
|
package/dist/server.mjs
CHANGED
|
@@ -2,6 +2,8 @@ import "server-only";
|
|
|
2
2
|
import { ApiClient, api, apiClient } from "./infra/api/client";
|
|
3
3
|
import { authService } from "./modules/auth/services/auth.service";
|
|
4
4
|
import { whitelabelService } from "./modules/whitelabel/services/whitelabel.service";
|
|
5
|
+
import { whitelabelStylesService } from "./modules/whitelabel/services/whitelabel-styles.service";
|
|
6
|
+
import { findWhitelabelStyles } from "./modules/whitelabel/actions/find-whitelabel-styles.action";
|
|
5
7
|
import { subscriptionsService } from "./modules/subscriptions/services/subscriptions.service";
|
|
6
8
|
import { iaCreditsService } from "./modules/ia-credits/services/ia-credits.service";
|
|
7
9
|
import { findWhitelabel } from "./modules/whitelabel/actions/find-whitelabel.action";
|
|
@@ -55,6 +57,7 @@ export {
|
|
|
55
57
|
findCurrentAccount,
|
|
56
58
|
findUserById,
|
|
57
59
|
findWhitelabel,
|
|
60
|
+
findWhitelabelStyles,
|
|
58
61
|
generateTwoFactorAction,
|
|
59
62
|
getClientInfoFromRequest,
|
|
60
63
|
getUserContext,
|
|
@@ -75,6 +78,7 @@ export {
|
|
|
75
78
|
updateAccountUserByIdAction,
|
|
76
79
|
updateUserAction,
|
|
77
80
|
validateSessionAction,
|
|
78
|
-
whitelabelService
|
|
81
|
+
whitelabelService,
|
|
82
|
+
whitelabelStylesService
|
|
79
83
|
};
|
|
80
84
|
//# sourceMappingURL=server.mjs.map
|
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 { subscriptionsService } from './modules/subscriptions/services/subscriptions.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 { 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 { safeServerAction } from './utils/safeServerAction';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,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,wBAAwB;","names":[]}
|
|
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 { whitelabelStylesService } from './modules/whitelabel/services/whitelabel-styles.service';\r\nexport { findWhitelabelStyles } from './modules/whitelabel/actions/find-whitelabel-styles.action';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.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 { 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 { safeServerAction } from './utils/safeServerAction';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,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,wBAAwB;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/safeServerAction.ts"],"sourcesContent":["import { isRedirectError } from 'next/dist/client/components/redirect-error';\
|
|
1
|
+
{"version":3,"sources":["../../src/utils/safeServerAction.ts"],"sourcesContent":["import { isRedirectError } from 'next/dist/client/components/redirect-error';\nimport { ApiError } from '../infra/api/types';\nimport type { ActionResult } from '../infra/api/types';\n\nexport async function safeServerAction<T>(\n fn: () => Promise<T>\n): Promise<ActionResult<T>> {\n try {\n const data = await fn();\n return { success: true, data };\n } catch (error) {\n if (isRedirectError(error)) throw error;\n const message =\n error instanceof ApiError\n ? error.message\n : error instanceof Error\n ? error.message\n : 'Erro desconhecido';\n return { success: false, error: message };\n }\n}\n"],"mappings":"AAAA,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AAGzB,eAAsB,iBACpB,IAC0B;AAC1B,MAAI;AACF,UAAM,OAAO,MAAM,GAAG;AACtB,WAAO,EAAE,SAAS,MAAM,KAAK;AAAA,EAC/B,SAAS,OAAO;AACd,QAAI,gBAAgB,KAAK,EAAG,OAAM;AAClC,UAAM,UACJ,iBAAiB,WACb,MAAM,UACN,iBAAiB,QACf,MAAM,UACN;AACR,WAAO,EAAE,SAAS,OAAO,OAAO,QAAQ;AAAA,EAC1C;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/withAction.ts"],"sourcesContent":["import type { ActionResult } from '../infra/api/types';\
|
|
1
|
+
{"version":3,"sources":["../../src/utils/withAction.ts"],"sourcesContent":["import type { ActionResult } from '../infra/api/types';\n\nexport function withAction<TArgs extends any[], TData>(\n action: (...args: TArgs) => Promise<ActionResult<TData>>\n): (...args: TArgs) => Promise<TData> {\n return async (...args) => {\n const result = await action(...args);\n if (!result.success) {\n throw new Error(result.error ?? 'Erro desconhecido');\n }\n return result.data as TData;\n };\n}\n"],"mappings":"AAEO,SAAS,WACd,QACoC;AACpC,SAAO,UAAU,SAAS;AACxB,UAAM,SAAS,MAAM,OAAO,GAAG,IAAI;AACnC,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,IAAI,MAAM,OAAO,SAAS,mBAAmB;AAAA,IACrD;AACA,WAAO,OAAO;AAAA,EAChB;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@greatapps/common",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "Shared library for GreatApps frontend applications",
|
|
5
|
-
"main": "./dist/index.mjs",
|
|
6
|
-
"types": "./src/index.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"import": "./dist/index.mjs",
|
|
10
|
-
"types": "./src/index.ts"
|
|
11
|
-
},
|
|
12
|
-
"./server": {
|
|
13
|
-
"import": "./dist/server.mjs",
|
|
14
|
-
"types": "./src/server.ts"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"src"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsup",
|
|
23
|
-
"dev": "tsup --watch",
|
|
24
|
-
"typecheck": "tsc --noEmit"
|
|
25
|
-
},
|
|
26
|
-
"keywords": [],
|
|
27
|
-
"author": "",
|
|
28
|
-
"license": "ISC",
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@greatapps/cache": "^2.0.1",
|
|
31
|
-
"@radix-ui/react-accordion": "^1.2.12",
|
|
32
|
-
"@radix-ui/react-checkbox": "^1.3.3",
|
|
33
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
34
|
-
"@radix-ui/react-progress": "^1.1.8",
|
|
35
|
-
"@radix-ui/react-radio-group": "^1.3.8",
|
|
36
|
-
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
37
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
38
|
-
"@radix-ui/react-separator": "^1.1.8",
|
|
39
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
40
|
-
"@radix-ui/react-tabs": "^1.1.13",
|
|
41
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
42
|
-
"@tanstack/query-broadcast-client-experimental": "^5.95.2",
|
|
43
|
-
"@tanstack/react-query-persist-client": "^5.95.2",
|
|
44
|
-
"axios": "^1.13.6",
|
|
45
|
-
"class-variance-authority": "^0.7.1",
|
|
46
|
-
"clsx": "^2.1.1",
|
|
47
|
-
"cmdk": "^1.1.1",
|
|
48
|
-
"date-fns": "^4.1.0",
|
|
49
|
-
"idb-keyval": "^6.2.2",
|
|
50
|
-
"input-otp": "^1.4.2",
|
|
51
|
-
"lucide-react": "^0.575.0",
|
|
52
|
-
"react-day-picker": "^9.14.0",
|
|
53
|
-
"server-only": "^0.0.1",
|
|
54
|
-
"sonner": ">=2.0.0",
|
|
55
|
-
"tailwind-merge": "^3.5.0",
|
|
56
|
-
"zod": "^4.3.6"
|
|
57
|
-
},
|
|
58
|
-
"devDependencies": {
|
|
59
|
-
"@hookform/resolvers": "^5.2.2",
|
|
60
|
-
"@tanstack/react-query": "^5.95.2",
|
|
61
|
-
"@tanstack/react-query-devtools": "^5.95.2",
|
|
62
|
-
"@types/node": "^25.5.0",
|
|
63
|
-
"@types/react": "^19.2.14",
|
|
64
|
-
"@types/react-dom": "^19.2.3",
|
|
65
|
-
"glob": "^13.0.6",
|
|
66
|
-
"next": "16.2.1",
|
|
67
|
-
"react": "19.1.4",
|
|
68
|
-
"react-dom": "19.1.4",
|
|
69
|
-
"react-hook-form": "^7.72.0",
|
|
70
|
-
"tsup": "^8.5.1",
|
|
71
|
-
"typescript": "^5.9.3",
|
|
72
|
-
"zustand": "^5.0.12"
|
|
73
|
-
},
|
|
74
|
-
"peerDependencies": {
|
|
75
|
-
"@hookform/resolvers": ">=3.0.0",
|
|
76
|
-
"@tanstack/react-query": ">=5.0.0",
|
|
77
|
-
"next": ">=16.0.0",
|
|
78
|
-
"react": ">=19.0.0",
|
|
79
|
-
"react-dom": ">=19.0.0",
|
|
80
|
-
"react-hook-form": ">=7.0.0",
|
|
81
|
-
"sonner": ">=2.0.0",
|
|
82
|
-
"zustand": ">=4.0.0"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@greatapps/common",
|
|
3
|
+
"version": "1.1.133",
|
|
4
|
+
"description": "Shared library for GreatApps frontend applications",
|
|
5
|
+
"main": "./dist/index.mjs",
|
|
6
|
+
"types": "./src/index.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.mjs",
|
|
10
|
+
"types": "./src/index.ts"
|
|
11
|
+
},
|
|
12
|
+
"./server": {
|
|
13
|
+
"import": "./dist/server.mjs",
|
|
14
|
+
"types": "./src/server.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup",
|
|
23
|
+
"dev": "tsup --watch",
|
|
24
|
+
"typecheck": "tsc --noEmit"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [],
|
|
27
|
+
"author": "",
|
|
28
|
+
"license": "ISC",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@greatapps/cache": "^2.0.1",
|
|
31
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
32
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
33
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
34
|
+
"@radix-ui/react-progress": "^1.1.8",
|
|
35
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
36
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
37
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
38
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
39
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
40
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
41
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
42
|
+
"@tanstack/query-broadcast-client-experimental": "^5.95.2",
|
|
43
|
+
"@tanstack/react-query-persist-client": "^5.95.2",
|
|
44
|
+
"axios": "^1.13.6",
|
|
45
|
+
"class-variance-authority": "^0.7.1",
|
|
46
|
+
"clsx": "^2.1.1",
|
|
47
|
+
"cmdk": "^1.1.1",
|
|
48
|
+
"date-fns": "^4.1.0",
|
|
49
|
+
"idb-keyval": "^6.2.2",
|
|
50
|
+
"input-otp": "^1.4.2",
|
|
51
|
+
"lucide-react": "^0.575.0",
|
|
52
|
+
"react-day-picker": "^9.14.0",
|
|
53
|
+
"server-only": "^0.0.1",
|
|
54
|
+
"sonner": ">=2.0.0",
|
|
55
|
+
"tailwind-merge": "^3.5.0",
|
|
56
|
+
"zod": "^4.3.6"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@hookform/resolvers": "^5.2.2",
|
|
60
|
+
"@tanstack/react-query": "^5.95.2",
|
|
61
|
+
"@tanstack/react-query-devtools": "^5.95.2",
|
|
62
|
+
"@types/node": "^25.5.0",
|
|
63
|
+
"@types/react": "^19.2.14",
|
|
64
|
+
"@types/react-dom": "^19.2.3",
|
|
65
|
+
"glob": "^13.0.6",
|
|
66
|
+
"next": "16.2.1",
|
|
67
|
+
"react": "19.1.4",
|
|
68
|
+
"react-dom": "19.1.4",
|
|
69
|
+
"react-hook-form": "^7.72.0",
|
|
70
|
+
"tsup": "^8.5.1",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"zustand": "^5.0.12"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@hookform/resolvers": ">=3.0.0",
|
|
76
|
+
"@tanstack/react-query": ">=5.0.0",
|
|
77
|
+
"next": ">=16.0.0",
|
|
78
|
+
"react": ">=19.0.0",
|
|
79
|
+
"react-dom": ">=19.0.0",
|
|
80
|
+
"react-hook-form": ">=7.0.0",
|
|
81
|
+
"sonner": ">=2.0.0",
|
|
82
|
+
"zustand": ">=4.0.0"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { TriangleAlert } from 'lucide-react';
|
|
4
|
-
import { toast } from 'sonner';
|
|
5
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
|
|
6
|
-
import { Button } from '../ui/buttons/Button';
|
|
7
|
-
import { Toast } from '../ui/feedback/Toast';
|
|
8
|
-
import { useAccountModals } from '../../store/useAccountModals';
|
|
9
|
-
|
|
10
|
-
export default function ConfirmDeleteAccountModal() {
|
|
11
|
-
const { activeModal, pagesCount, close } = useAccountModals();
|
|
12
|
-
const open = activeModal === 'confirmDelete';
|
|
13
|
-
|
|
14
|
-
const handleConfirm = () => {
|
|
15
|
-
toast.custom((t) => (
|
|
16
|
-
<Toast variant="success" message="Conta excluída com sucesso" toastId={t} />
|
|
17
|
-
));
|
|
18
|
-
close();
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Dialog open={open} onOpenChange={close}>
|
|
23
|
-
<DialogContent className="flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!">
|
|
24
|
-
<div className="flex flex-col gap-5 p-4 lg:p-5">
|
|
25
|
-
<DialogHeader className="p-0">
|
|
26
|
-
<DialogTitle className="paragraph-medium-semibold text-gray-950">
|
|
27
|
-
Uma pena te ver ir!
|
|
28
|
-
</DialogTitle>
|
|
29
|
-
</DialogHeader>
|
|
30
|
-
|
|
31
|
-
<div className="bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4">
|
|
32
|
-
<TriangleAlert size={20} className="text-red-500 shrink-0" strokeWidth={2} />
|
|
33
|
-
<p className="paragraph-small-regular text-gray-600">
|
|
34
|
-
Todas suas{' '}
|
|
35
|
-
<span className="font-semibold text-gray-950">{pagesCount} páginas</span>{' '}
|
|
36
|
-
serão deletadas permanentemente. Essa ação é{' '}
|
|
37
|
-
<span className="font-semibold text-gray-950">irreversível!</span>
|
|
38
|
-
</p>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
<div className="h-px bg-gray-200" />
|
|
43
|
-
|
|
44
|
-
<div className="flex items-center gap-2 p-4 lg:p-5">
|
|
45
|
-
<Button className="h-10 flex-1" onClick={close}>
|
|
46
|
-
Manter minha conta
|
|
47
|
-
</Button>
|
|
48
|
-
<Button variant="secondary" className="h-10! flex-1" onClick={handleConfirm}>
|
|
49
|
-
Excluir mesmo assim
|
|
50
|
-
</Button>
|
|
51
|
-
</div>
|
|
52
|
-
</DialogContent>
|
|
53
|
-
</Dialog>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { TriangleAlert } from 'lucide-react';
|
|
4
|
+
import { toast } from 'sonner';
|
|
5
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';
|
|
6
|
+
import { Button } from '../ui/buttons/Button';
|
|
7
|
+
import { Toast } from '../ui/feedback/Toast';
|
|
8
|
+
import { useAccountModals } from '../../store/useAccountModals';
|
|
9
|
+
|
|
10
|
+
export default function ConfirmDeleteAccountModal() {
|
|
11
|
+
const { activeModal, pagesCount, close } = useAccountModals();
|
|
12
|
+
const open = activeModal === 'confirmDelete';
|
|
13
|
+
|
|
14
|
+
const handleConfirm = () => {
|
|
15
|
+
toast.custom((t) => (
|
|
16
|
+
<Toast variant="success" message="Conta excluída com sucesso" toastId={t} />
|
|
17
|
+
));
|
|
18
|
+
close();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Dialog open={open} onOpenChange={close}>
|
|
23
|
+
<DialogContent className="flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!">
|
|
24
|
+
<div className="flex flex-col gap-5 p-4 lg:p-5">
|
|
25
|
+
<DialogHeader className="p-0">
|
|
26
|
+
<DialogTitle className="paragraph-medium-semibold text-gray-950">
|
|
27
|
+
Uma pena te ver ir!
|
|
28
|
+
</DialogTitle>
|
|
29
|
+
</DialogHeader>
|
|
30
|
+
|
|
31
|
+
<div className="bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4">
|
|
32
|
+
<TriangleAlert size={20} className="text-red-500 shrink-0" strokeWidth={2} />
|
|
33
|
+
<p className="paragraph-small-regular text-gray-600">
|
|
34
|
+
Todas suas{' '}
|
|
35
|
+
<span className="font-semibold text-gray-950">{pagesCount} páginas</span>{' '}
|
|
36
|
+
serão deletadas permanentemente. Essa ação é{' '}
|
|
37
|
+
<span className="font-semibold text-gray-950">irreversível!</span>
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div className="h-px bg-gray-200" />
|
|
43
|
+
|
|
44
|
+
<div className="flex items-center gap-2 p-4 lg:p-5">
|
|
45
|
+
<Button className="h-10 flex-1" onClick={close}>
|
|
46
|
+
Manter minha conta
|
|
47
|
+
</Button>
|
|
48
|
+
<Button variant="secondary" className="h-10! flex-1" onClick={handleConfirm}>
|
|
49
|
+
Excluir mesmo assim
|
|
50
|
+
</Button>
|
|
51
|
+
</div>
|
|
52
|
+
</DialogContent>
|
|
53
|
+
</Dialog>
|
|
54
|
+
);
|
|
55
|
+
}
|