@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.
Files changed (83) hide show
  1. package/dist/components/account/sections/MyProfileSection.mjs +1 -2
  2. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
  3. package/dist/components/embeds/CrispEmbed.mjs +24 -60
  4. package/dist/components/embeds/CrispEmbed.mjs.map +1 -1
  5. package/dist/components/embeds/FrillEmbed.mjs +3 -10
  6. package/dist/components/embeds/FrillEmbed.mjs.map +1 -1
  7. package/dist/components/layouts/ProfilePopover.mjs +1 -2
  8. package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
  9. package/dist/components/modals/cards/AddCardModal.mjs +6 -10
  10. package/dist/components/modals/cards/AddCardModal.mjs.map +1 -1
  11. package/dist/components/modals/cards/CardFormFields.mjs +15 -47
  12. package/dist/components/modals/cards/CardFormFields.mjs.map +1 -1
  13. package/dist/components/navigation/subcomponents/BottomLinks.mjs +2 -2
  14. package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
  15. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +1 -1
  16. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -1
  17. package/dist/components/pages/notifications/Notifications.mjs +17 -27
  18. package/dist/components/pages/notifications/Notifications.mjs.map +1 -1
  19. package/dist/components/ui/form/Select.mjs +1 -1
  20. package/dist/components/ui/form/Select.mjs.map +1 -1
  21. package/dist/components/ui/overlay/Dialog.mjs +1 -2
  22. package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
  23. package/dist/components/ui/overlay/Popover.mjs +1 -1
  24. package/dist/components/ui/overlay/Popover.mjs.map +1 -1
  25. package/dist/components/ui/overlay/Sheet.mjs +6 -6
  26. package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
  27. package/dist/components/ui/overlay/Tooltip.mjs +1 -1
  28. package/dist/components/ui/overlay/Tooltip.mjs.map +1 -1
  29. package/dist/index.mjs +2 -50
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/infra/utils/date.mjs +0 -11
  32. package/dist/infra/utils/date.mjs.map +1 -1
  33. package/dist/modules/auth/services/auth.service.mjs +1 -2
  34. package/dist/modules/auth/services/auth.service.mjs.map +1 -1
  35. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs +2 -21
  36. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +1 -1
  37. package/dist/modules/plans/services/plans.service.mjs +10 -71
  38. package/dist/modules/plans/services/plans.service.mjs.map +1 -1
  39. package/dist/modules/plans/types/plan.type.mjs +0 -1
  40. package/dist/modules/plans/types/plan.type.mjs.map +1 -1
  41. package/dist/modules/subscriptions/types/subscription.type.mjs +1 -31
  42. package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
  43. package/dist/server.mjs +0 -6
  44. package/dist/server.mjs.map +1 -1
  45. package/package.json +1 -1
  46. package/src/components/navigation/ProjectSelectorPopover.tsx +1 -1
  47. package/src/components/ui/overlay/Sheet.tsx +9 -11
  48. package/dist/components/embeds/EmbedWidgets.mjs +0 -45
  49. package/dist/components/embeds/EmbedWidgets.mjs.map +0 -1
  50. package/dist/components/widgets/ImageUpload/ImageCropModal.mjs +0 -212
  51. package/dist/components/widgets/ImageUpload/ImageCropModal.mjs.map +0 -1
  52. package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs +0 -51
  53. package/dist/components/widgets/ImageUpload/ImageTooSmallModal.mjs.map +0 -1
  54. package/dist/components/widgets/ImageUpload/ImageUpload.mjs +0 -122
  55. package/dist/components/widgets/ImageUpload/ImageUpload.mjs.map +0 -1
  56. package/dist/components/widgets/ImageUpload/index.mjs +0 -9
  57. package/dist/components/widgets/ImageUpload/index.mjs.map +0 -1
  58. package/dist/modules/images/actions/process-image.action.mjs +0 -31
  59. package/dist/modules/images/actions/process-image.action.mjs.map +0 -1
  60. package/dist/modules/images/constants/image.constants.mjs +0 -14
  61. package/dist/modules/images/constants/image.constants.mjs.map +0 -1
  62. package/dist/modules/images/hooks/use-image-upload.hook.mjs +0 -132
  63. package/dist/modules/images/hooks/use-image-upload.hook.mjs.map +0 -1
  64. package/dist/modules/images/services/image-processing.service.mjs +0 -65
  65. package/dist/modules/images/services/image-processing.service.mjs.map +0 -1
  66. package/dist/modules/images/types/image.type.mjs +0 -1
  67. package/dist/modules/images/types/image.type.mjs.map +0 -1
  68. package/dist/modules/images/utils/base64.mjs +0 -24
  69. package/dist/modules/images/utils/base64.mjs.map +0 -1
  70. package/dist/modules/images/utils/compress-image.mjs +0 -17
  71. package/dist/modules/images/utils/compress-image.mjs.map +0 -1
  72. package/dist/modules/images/utils/crop-image.mjs +0 -31
  73. package/dist/modules/images/utils/crop-image.mjs.map +0 -1
  74. package/dist/modules/images/utils/validate-image.mjs +0 -58
  75. package/dist/modules/images/utils/validate-image.mjs.map +0 -1
  76. package/dist/modules/plans/actions/list-plans.action.mjs +0 -17
  77. package/dist/modules/plans/actions/list-plans.action.mjs.map +0 -1
  78. package/dist/modules/plans/hooks/list-plans.hook.mjs +0 -22
  79. package/dist/modules/plans/hooks/list-plans.hook.mjs.map +0 -1
  80. package/dist/modules/plans/utils/map-api-plan-to-ui.mjs +0 -58
  81. package/dist/modules/plans/utils/map-api-plan-to-ui.mjs.map +0 -1
  82. package/dist/utils/format/currency.mjs +0 -13
  83. package/dist/utils/format/currency.mjs.map +0 -1
@@ -1,58 +0,0 @@
1
- import { ADDON_IDS } from "../../subscriptions/constants/addons.constants";
2
- import { formatCurrencyNumber } from "../../../utils/format/currency";
3
- const BASE_FEATURES = [
4
- { icon: "check", text: "Visitas ilimitadas" },
5
- { icon: "check", text: "Leads ilimitadas" },
6
- { icon: "check", text: "Compartilhar p\xE1ginas", tooltip: "sharePages" },
7
- { icon: "check", text: "Hospedagem inclusa" },
8
- { icon: "check", text: "SSL (HTTPS) + CDN" },
9
- { icon: "check", text: "Templates Free" }
10
- ];
11
- function buildMainFeaturesFromItems(items) {
12
- const pagesItem = items.find((i) => i.id_addon === ADDON_IDS.PAGES);
13
- const domainsItem = items.find((i) => i.id_addon === ADDON_IDS.DOMAINS);
14
- const pagesQty = pagesItem?.quantity ?? 0;
15
- const domainsQty = domainsItem?.quantity ?? 1;
16
- return {
17
- pages: pagesQty === 0 ? "P\xE1ginas ilimitadas" : pagesQty === 1 ? "1 p\xE1gina" : `${pagesQty} p\xE1ginas`,
18
- domains: domainsQty >= 999 ? "Dom\xEDnios ilimitados" : domainsQty === 1 ? "1 dom\xEDnio externo" : `${domainsQty} dom\xEDnios externos`,
19
- users: "Usu\xE1rios ilimitados"
20
- };
21
- }
22
- function computePricingByPeriod(apiPlan) {
23
- const monthly = apiPlan.value;
24
- const round2 = (n) => Math.round(n * 100) / 100;
25
- return {
26
- monthly,
27
- semiannual: round2(monthly * (1 - apiPlan.discount_semester / 100)),
28
- annual: round2(monthly * (1 - apiPlan.discount_annual / 100))
29
- };
30
- }
31
- function mapApiPlanToUiPlan(apiPlan, options) {
32
- const { planId, isPopular, buttonVariant } = options;
33
- const pricingByPeriod = computePricingByPeriod(apiPlan);
34
- const monthlyFinal = pricingByPeriod.monthly;
35
- const lowerName = apiPlan.name.toLowerCase();
36
- const hasProjectAndOnboarding = lowerName.includes("ag\xEAncia") || lowerName.includes("agencia");
37
- const features = [
38
- ...BASE_FEATURES,
39
- hasProjectAndOnboarding ? { icon: "check", text: "Reuni\xE3o de Onboarding" } : { icon: "x", text: "Reuni\xE3o de Onboarding", disabled: true },
40
- hasProjectAndOnboarding ? { icon: "check", text: "Gest\xE3o de projetos", tooltip: "projectManagement" } : { icon: "x", text: "Gest\xE3o de projetos", disabled: true, tooltip: "projectManagement" }
41
- ];
42
- return {
43
- idPlan: planId,
44
- name: apiPlan.name,
45
- isPopular,
46
- buttonVariant,
47
- mainFeatures: buildMainFeaturesFromItems(apiPlan.items),
48
- features,
49
- originalPrice: formatCurrencyNumber(monthlyFinal),
50
- price: formatCurrencyNumber(monthlyFinal),
51
- pricingByPeriod,
52
- items: apiPlan.items
53
- };
54
- }
55
- export {
56
- mapApiPlanToUiPlan
57
- };
58
- //# sourceMappingURL=map-api-plan-to-ui.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/modules/plans/utils/map-api-plan-to-ui.ts"],"sourcesContent":["import type { Plan, PlanFeature, PlanMainFeatures, PlanPricingByPeriod, UiPlan } from '../types/plan.type';\nimport { ADDON_IDS } from '../../subscriptions/constants/addons.constants';\nimport { formatCurrencyNumber } from '../../../utils/format/currency';\n\nexport type PlanBillingPeriod = 'monthly' | 'semiannual' | 'annual';\n\nconst BASE_FEATURES: PlanFeature[] = [\n { icon: 'check', text: 'Visitas ilimitadas' },\n { icon: 'check', text: 'Leads ilimitadas' },\n { icon: 'check', text: 'Compartilhar páginas', tooltip: 'sharePages' },\n { icon: 'check', text: 'Hospedagem inclusa' },\n { icon: 'check', text: 'SSL (HTTPS) + CDN' },\n { icon: 'check', text: 'Templates Free' },\n];\n\nfunction buildMainFeaturesFromItems(items: Plan['items']): PlanMainFeatures {\n const pagesItem = items.find((i) => i.id_addon === ADDON_IDS.PAGES);\n const domainsItem = items.find((i) => i.id_addon === ADDON_IDS.DOMAINS);\n\n const pagesQty = pagesItem?.quantity ?? 0;\n const domainsQty = domainsItem?.quantity ?? 1;\n\n return {\n pages:\n pagesQty === 0\n ? 'Páginas ilimitadas'\n : pagesQty === 1\n ? '1 página'\n : `${pagesQty} páginas`,\n domains:\n domainsQty >= 999\n ? 'Domínios ilimitados'\n : domainsQty === 1\n ? '1 domínio externo'\n : `${domainsQty} domínios externos`,\n users: 'Usuários ilimitados',\n };\n}\n\nfunction computePricingByPeriod(apiPlan: Plan): PlanPricingByPeriod {\n const monthly = apiPlan.value;\n const round2 = (n: number) => Math.round(n * 100) / 100;\n return {\n monthly,\n semiannual: round2(monthly * (1 - apiPlan.discount_semester / 100)),\n annual: round2(monthly * (1 - apiPlan.discount_annual / 100)),\n };\n}\n\nexport function mapApiPlanToUiPlan(\n apiPlan: Plan,\n options: {\n planId: number;\n isPopular?: boolean;\n buttonVariant?: 'brand' | 'default';\n }\n): UiPlan {\n const { planId, isPopular, buttonVariant } = options;\n\n const pricingByPeriod = computePricingByPeriod(apiPlan);\n const monthlyFinal = pricingByPeriod.monthly;\n\n const lowerName = apiPlan.name.toLowerCase();\n const hasProjectAndOnboarding =\n lowerName.includes('agência') || lowerName.includes('agencia');\n\n const features: PlanFeature[] = [\n ...BASE_FEATURES,\n hasProjectAndOnboarding\n ? { icon: 'check', text: 'Reunião de Onboarding' }\n : { icon: 'x', text: 'Reunião de Onboarding', disabled: true },\n hasProjectAndOnboarding\n ? { icon: 'check', text: 'Gestão de projetos', tooltip: 'projectManagement' }\n : { icon: 'x', text: 'Gestão de projetos', disabled: true, tooltip: 'projectManagement' },\n ];\n\n return {\n idPlan: planId,\n name: apiPlan.name,\n isPopular,\n buttonVariant,\n mainFeatures: buildMainFeaturesFromItems(apiPlan.items),\n features,\n originalPrice: formatCurrencyNumber(monthlyFinal),\n price: formatCurrencyNumber(monthlyFinal),\n pricingByPeriod,\n items: apiPlan.items,\n };\n}\n"],"mappings":"AACA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;AAIrC,MAAM,gBAA+B;AAAA,EACnC,EAAE,MAAM,SAAS,MAAM,qBAAqB;AAAA,EAC5C,EAAE,MAAM,SAAS,MAAM,mBAAmB;AAAA,EAC1C,EAAE,MAAM,SAAS,MAAM,2BAAwB,SAAS,aAAa;AAAA,EACrE,EAAE,MAAM,SAAS,MAAM,qBAAqB;AAAA,EAC5C,EAAE,MAAM,SAAS,MAAM,oBAAoB;AAAA,EAC3C,EAAE,MAAM,SAAS,MAAM,iBAAiB;AAC1C;AAEA,SAAS,2BAA2B,OAAwC;AAC1E,QAAM,YAAY,MAAM,KAAK,CAAC,MAAM,EAAE,aAAa,UAAU,KAAK;AAClE,QAAM,cAAc,MAAM,KAAK,CAAC,MAAM,EAAE,aAAa,UAAU,OAAO;AAEtE,QAAM,WAAW,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AAA,EACjB;AACF;","names":[]}
@@ -1,13 +0,0 @@
1
- const formatCurrencyNumber = (value, decimals = 2) => {
2
- const safeValue = value ?? 0;
3
- return safeValue.toLocaleString("pt-BR", {
4
- style: "currency",
5
- currency: "BRL",
6
- minimumFractionDigits: decimals,
7
- maximumFractionDigits: decimals
8
- });
9
- };
10
- export {
11
- formatCurrencyNumber
12
- };
13
- //# sourceMappingURL=currency.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/format/currency.ts"],"sourcesContent":["/**\n * Formata um número (opcional) para moeda BRL\n * @param value - Número a ser formatado (pode ser undefined ou null)\n * @param decimals - Casas decimais (padrão: 2)\n * @returns String formatada como \"R$ X.XXX,XX\"\n */\nexport const formatCurrencyNumber = (value?: number | null, decimals = 2): string => {\n const safeValue = value ?? 0;\n return safeValue.toLocaleString('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n });\n};\n"],"mappings":"AAMO,MAAM,uBAAuB,CAAC,OAAuB,WAAW,MAAc;AACnF,QAAM,YAAY,SAAS;AAC3B,SAAO,UAAU,eAAe,SAAS;AAAA,IACvC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,uBAAuB;AAAA,IACvB,uBAAuB;AAAA,EACzB,CAAC;AACH;","names":[]}