@appcorp/fusion-storybook 0.3.44 → 0.3.46

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 (106) hide show
  1. package/base-modules/admission/context/use-admission-module.js +4 -1
  2. package/base-modules/admission/form.js +3 -1
  3. package/base-modules/admission/more-actions.js +2 -2
  4. package/base-modules/admission/view.js +1 -1
  5. package/base-modules/attendance/context.js +2 -1
  6. package/base-modules/attendance/form.js +3 -3
  7. package/base-modules/attendance/more-actions.js +1 -1
  8. package/base-modules/attendance/page.js +1 -1
  9. package/base-modules/attendance/view.js +2 -2
  10. package/base-modules/campus/context.js +2 -1
  11. package/base-modules/campus/more-actions.js +2 -1
  12. package/base-modules/class/cache.d.ts +3 -3
  13. package/base-modules/class/cache.js +1 -1
  14. package/base-modules/class/context.js +2 -1
  15. package/base-modules/class/more-actions.js +1 -1
  16. package/base-modules/course/context.js +2 -1
  17. package/base-modules/course/form.js +1 -1
  18. package/base-modules/course/more-actions.js +2 -1
  19. package/base-modules/course/view.js +1 -3
  20. package/base-modules/discount-code/cache.d.ts +3 -3
  21. package/base-modules/discount-code/cache.js +1 -1
  22. package/base-modules/discount-code/context.js +2 -1
  23. package/base-modules/enrollment/context.js +2 -1
  24. package/base-modules/enrollment/form.js +4 -3
  25. package/base-modules/enrollment/more-actions.js +1 -1
  26. package/base-modules/enrollment/page.js +2 -1
  27. package/base-modules/enrollment/view.js +3 -3
  28. package/base-modules/expense/context.js +2 -1
  29. package/base-modules/expense/more-actions.js +1 -1
  30. package/base-modules/expense/page.js +1 -1
  31. package/base-modules/expense/view.js +2 -4
  32. package/base-modules/family/context.js +2 -1
  33. package/base-modules/family/more-actions.js +1 -1
  34. package/base-modules/family-member/context.js +2 -1
  35. package/base-modules/family-member/more-actions.js +2 -2
  36. package/base-modules/family-member/view.js +1 -1
  37. package/base-modules/fee-structure/cache.d.ts +3 -3
  38. package/base-modules/fee-structure/cache.js +1 -1
  39. package/base-modules/fee-structure/context.js +2 -1
  40. package/base-modules/fee-structure/form.js +1 -1
  41. package/base-modules/fee-structure/more-actions.js +1 -1
  42. package/base-modules/push-campaign/cache.d.ts +9 -0
  43. package/base-modules/push-campaign/cache.js +16 -0
  44. package/base-modules/push-campaign/constants.d.ts +24 -0
  45. package/base-modules/push-campaign/constants.js +11 -0
  46. package/base-modules/push-campaign/context/module-base.d.ts +181 -0
  47. package/base-modules/push-campaign/context/module-base.js +45 -0
  48. package/base-modules/push-campaign/context/use-push-campaign-module.d.ts +66 -0
  49. package/base-modules/push-campaign/context/use-push-campaign-module.js +451 -0
  50. package/base-modules/push-campaign/context.d.ts +2 -0
  51. package/base-modules/push-campaign/context.js +3 -0
  52. package/base-modules/push-campaign/filter.d.ts +1 -0
  53. package/base-modules/push-campaign/filter.js +43 -0
  54. package/base-modules/push-campaign/form.d.ts +1 -0
  55. package/base-modules/push-campaign/form.js +21 -0
  56. package/base-modules/push-campaign/page.d.ts +28 -0
  57. package/base-modules/push-campaign/page.js +152 -0
  58. package/base-modules/push-campaign/validate.d.ts +11 -0
  59. package/base-modules/push-campaign/validate.js +11 -0
  60. package/base-modules/push-campaign/view.d.ts +1 -0
  61. package/base-modules/push-campaign/view.js +26 -0
  62. package/base-modules/rbac/context.js +2 -1
  63. package/base-modules/school/cache.js +1 -1
  64. package/base-modules/school/context.js +1 -1
  65. package/base-modules/section/cache.d.ts +3 -3
  66. package/base-modules/section/cache.js +1 -1
  67. package/base-modules/section/context.js +2 -1
  68. package/base-modules/section/more-actions.js +1 -1
  69. package/base-modules/student-fee/context/use-student-fee-module.js +4 -1
  70. package/base-modules/student-fee/form.js +2 -1
  71. package/base-modules/student-fee/more-actions.js +1 -1
  72. package/base-modules/student-fee/page.js +1 -1
  73. package/base-modules/student-fee/single-entry.js +1 -1
  74. package/base-modules/student-fee/view.js +4 -4
  75. package/base-modules/student-profile/cache.d.ts +3 -3
  76. package/base-modules/student-profile/cache.js +1 -1
  77. package/base-modules/student-profile/context/use-student-profile-module.js +4 -1
  78. package/base-modules/student-profile/form.js +1 -1
  79. package/base-modules/student-profile/more-actions.js +1 -1
  80. package/base-modules/student-profile/page.js +1 -1
  81. package/base-modules/student-profile/view.js +1 -1
  82. package/base-modules/subject/cache.d.ts +3 -3
  83. package/base-modules/subject/cache.js +1 -1
  84. package/base-modules/subject/context.js +2 -1
  85. package/base-modules/subject/more-actions.js +1 -1
  86. package/base-modules/teacher/cache.d.ts +3 -3
  87. package/base-modules/teacher/cache.js +1 -1
  88. package/base-modules/teacher/context.js +2 -1
  89. package/base-modules/teacher/more-actions.js +1 -1
  90. package/base-modules/teacher/view.js +1 -1
  91. package/base-modules/user/cache.d.ts +3 -3
  92. package/base-modules/user/cache.js +1 -1
  93. package/base-modules/user/context/use-user-module.js +4 -1
  94. package/base-modules/user/more-actions.js +2 -1
  95. package/base-modules/workspace/cache.js +2 -1
  96. package/base-modules/workspace/context.js +1 -1
  97. package/base-modules/workspace/view.js +1 -1
  98. package/base-modules/workspace-user/context.js +5 -2
  99. package/base-modules/workspace-user/more-actions.js +2 -2
  100. package/constants.d.ts +6 -0
  101. package/constants.js +6 -0
  102. package/package.json +2 -2
  103. package/tsconfig.build.tsbuildinfo +1 -1
  104. package/types/communication.d.ts +28 -0
  105. package/types/enums.d.ts +1 -0
  106. package/types/enums.js +1 -0
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useTranslations } from "next-intl";
4
- import { downloadFromUrl, API_METHODS } from "@react-pakistan/util-functions";
4
+ import { downloadFromUrl } from "@react-pakistan/util-functions/general/download-from-url";
5
+ import { API_METHODS } from "@react-pakistan/util-functions/constants/api-methods";
5
6
  import { getCachedWorkspaceSync } from "../workspace/cache";
6
7
  import converter from "json-2-csv";
7
8
  import { Timeline } from "../../components/timeline";
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Cache utilities for workspace data using generic cache system.
5
5
  */
6
- import { getCachedSingleItem, getCachedSingleItemSync, invalidateCache, ONE_YEAR_IN_MS, } from "@react-pakistan/util-functions";
6
+ import { getCachedSingleItem, getCachedSingleItemSync, invalidateCache, } from "@react-pakistan/util-functions/general/generic-cache";
7
+ import { ONE_YEAR_IN_MS } from "@react-pakistan/util-functions/constants/cache-time";
7
8
  import { WORKSPACE_API_ROUTES } from "../../constants";
8
9
  import { LS_KEYS } from "../../constants";
9
10
  // ============================================================================
@@ -21,7 +21,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
21
21
  import { createContext, useCallback, useContext, useEffect, useMemo, useState, } from "react";
22
22
  import { useTheme } from "next-themes";
23
23
  import { useTranslations } from "next-intl";
24
- import { validateForm } from "@react-pakistan/util-functions";
24
+ import { validateForm } from "@react-pakistan/util-functions/general/validate-form";
25
25
  import { useModuleEntityV2, } from "@react-pakistan/util-functions/hooks/use-module-entity-v2";
26
26
  import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
27
27
  import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
@@ -12,7 +12,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@app
12
12
  import { Badge } from "@appcorp/shadcn/components/ui/badge";
13
13
  import { Separator } from "@appcorp/shadcn/components/ui/separator";
14
14
  import { Building2, Globe, FileText, Image as LucideImage, CheckCircle2, XCircle, Calendar, CreditCard, Users, BookOpen, GraduationCap, Home, HardDrive, Clock, Shield, } from "lucide-react";
15
- import { DATE_FORMATS, formatDate } from "@react-pakistan/util-functions";
15
+ import { DATE_FORMATS, formatDate, } from "@react-pakistan/util-functions/general/format-date";
16
16
  import { formatValue } from "@react-pakistan/util-functions/general/format-value";
17
17
  export const WorkspaceView = () => {
18
18
  const { state } = useWorkspaceModule();
@@ -20,7 +20,8 @@
20
20
  "use client";
21
21
  import { useCallback, useEffect, useMemo, useRef } from "react";
22
22
  import { useTheme } from "next-themes";
23
- import { isCreatedOrUpdated, validateForm, } from "@react-pakistan/util-functions";
23
+ import { isCreatedOrUpdated } from "@react-pakistan/util-functions/general/is-created-or-updated";
24
+ import { validateForm } from "@react-pakistan/util-functions/general/validate-form";
24
25
  import { useModuleEntityV2, } from "@react-pakistan/util-functions/hooks/use-module-entity-v2";
25
26
  import { useDebounce } from "@react-pakistan/util-functions/hooks/use-debounce";
26
27
  import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
@@ -183,7 +184,9 @@ export const useWorkspaceUserModule = () => {
183
184
  var _a;
184
185
  const isCreated = isCreatedOrUpdated(data);
185
186
  if (error) {
186
- showToast(isCreated ? t("messagesWorkspaceUserCreateFailed") : t("messagesWorkspaceUserUpdateFailed"), TOAST_VARIANT.ERROR);
187
+ showToast(isCreated
188
+ ? t("messagesWorkspaceUserCreateFailed")
189
+ : t("messagesWorkspaceUserUpdateFailed"), TOAST_VARIANT.ERROR);
187
190
  return;
188
191
  }
189
192
  if (data) {
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { API_METHODS } from "@react-pakistan/util-functions";
3
+ import { API_METHODS } from "@react-pakistan/util-functions/constants/api-methods";
4
4
  import { getCachedWorkspaceSync } from "../workspace/cache";
5
5
  import converter from "json-2-csv";
6
6
  import { Timeline } from "../../components/timeline";
7
- import { downloadFromUrl } from "@react-pakistan/util-functions";
7
+ import { downloadFromUrl } from "@react-pakistan/util-functions/general/download-from-url";
8
8
  import { useTranslations } from "next-intl";
9
9
  export const WorkspaceUserMoreActions = () => {
10
10
  const t = useTranslations("workspaceUser");
package/constants.d.ts CHANGED
@@ -60,6 +60,11 @@ export declare const FEE_STRUCTURE_API_ROUTES: {
60
60
  export declare const PLAN_API_ROUTES: {
61
61
  readonly UNIT: "/api/v1/plan";
62
62
  };
63
+ export declare const PUSH_CAMPAIGN_API_ROUTES: {
64
+ readonly UNIT: "/api/v1/push-campaign";
65
+ readonly START: "/api/v1/push-campaign/start";
66
+ readonly AI_CHECK: "/api/v1/push-campaign/ai-check";
67
+ };
63
68
  export declare const RBAC_API_ROUTES: Record<string, string>;
64
69
  export declare const SCHOOL_API_ROUTES: Record<string, string>;
65
70
  export declare const SECTION_API_ROUTES: {
@@ -136,6 +141,7 @@ export declare const DASHBOARD_ROUTES: {
136
141
  USER_MANAGEMENT: string;
137
142
  USER: string;
138
143
  WHATSAPP_BROADCAST: string;
144
+ PUSH_CAMPAIGN: string;
139
145
  WORKSPACE_USER: string;
140
146
  WORKSPACE: string;
141
147
  };
package/constants.js CHANGED
@@ -65,6 +65,11 @@ export const FEE_STRUCTURE_API_ROUTES = {
65
65
  export const PLAN_API_ROUTES = {
66
66
  UNIT: "/api/v1/plan",
67
67
  };
68
+ export const PUSH_CAMPAIGN_API_ROUTES = {
69
+ UNIT: "/api/v1/push-campaign",
70
+ START: "/api/v1/push-campaign/start",
71
+ AI_CHECK: "/api/v1/push-campaign/ai-check",
72
+ };
68
73
  export const RBAC_API_ROUTES = {
69
74
  UNIT: "/api/v1/role",
70
75
  PERMISSIONS_LIST: "/api/v1/permission",
@@ -157,6 +162,7 @@ export const DASHBOARD_ROUTES = {
157
162
  USER_MANAGEMENT: "/user-management",
158
163
  USER: "/user-management/user",
159
164
  WHATSAPP_BROADCAST: "/communication/whatsapp-broadcast",
165
+ PUSH_CAMPAIGN: "/communication/push-campaign",
160
166
  WORKSPACE_USER: "/user-management/workspace-user",
161
167
  WORKSPACE: "/account/workspace",
162
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.3.44",
3
+ "version": "0.3.46",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",
@@ -59,7 +59,7 @@
59
59
  "@radix-ui/react-slider": "^1.3.6",
60
60
  "@radix-ui/react-slot": "^1.2.4",
61
61
  "@radix-ui/react-toast": "^1.2.15",
62
- "@react-pakistan/util-functions": "^1.25.89",
62
+ "@react-pakistan/util-functions": "^2.0.2",
63
63
  "@storybook/addon-a11y": "^10.3.4",
64
64
  "@storybook/addon-docs": "^10.3.4",
65
65
  "@storybook/addon-onboarding": "^10.3.4",