@elevasis/ui 2.30.0 → 2.32.0

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 (130) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +38 -0
  3. package/dist/app/index.d.ts +190 -9
  4. package/dist/app/index.js +7 -6
  5. package/dist/charts/index.js +4 -5
  6. package/dist/{chunk-HXZQWMKE.js → chunk-2RJMVWFJ.js} +1 -6
  7. package/dist/{chunk-4VQ2PXMI.js → chunk-3FV6HBXS.js} +4 -4
  8. package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
  9. package/dist/{chunk-JKTPRYGV.js → chunk-4MFNGNHF.js} +123 -192
  10. package/dist/{chunk-HYLERWRO.js → chunk-4QK76KIF.js} +7 -7
  11. package/dist/chunk-5FJJ72HU.js +13 -0
  12. package/dist/chunk-5J4PDX26.js +112 -0
  13. package/dist/{chunk-4SY6BTVZ.js → chunk-6DWD423K.js} +12 -9
  14. package/dist/{chunk-3GV5NHSS.js → chunk-7KZINJLP.js} +78 -232
  15. package/dist/{chunk-6WXDE5LZ.js → chunk-EPTHX4VZ.js} +1 -1
  16. package/dist/{chunk-6EFVZV6X.js → chunk-GCOQ3TBG.js} +243 -254
  17. package/dist/{chunk-LRZFLK2F.js → chunk-IQHU7O5Y.js} +4 -4
  18. package/dist/{chunk-X2SUMO3P.js → chunk-IZWTVFJ2.js} +16 -3
  19. package/dist/{chunk-IKQ42WHU.js → chunk-JFL3GRD4.js} +1 -1
  20. package/dist/{chunk-4FZYEEPK.js → chunk-LLRXA7D7.js} +5 -6
  21. package/dist/chunk-MOY4VOHF.js +347 -0
  22. package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
  23. package/dist/{chunk-7E3FUTND.js → chunk-ND5TDV2J.js} +1 -1
  24. package/dist/{chunk-WF227UBV.js → chunk-QQHOKTJA.js} +4 -4
  25. package/dist/{chunk-A7B7HLDF.js → chunk-QTI3KC7D.js} +5884 -515
  26. package/dist/chunk-QXCDKE2O.js +486 -0
  27. package/dist/chunk-R2XR4FCV.js +48 -0
  28. package/dist/chunk-R66W5UDG.js +26 -0
  29. package/dist/{chunk-T5Z7G2J2.js → chunk-RQA2EVN3.js} +6 -16
  30. package/dist/{chunk-SKXXT3E2.js → chunk-RQTWIXJ5.js} +4 -4
  31. package/dist/chunk-T35FWDAB.js +4342 -0
  32. package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
  33. package/dist/{chunk-CN2HC4D4.js → chunk-UFTM5SZZ.js} +2 -2
  34. package/dist/{chunk-JCGD4GM6.js → chunk-UROTM5OR.js} +14 -1
  35. package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
  36. package/dist/{chunk-KVJ3LFH2.js → chunk-VNFR57DF.js} +4 -24
  37. package/dist/{chunk-SBCIB5TZ.js → chunk-VRNMNB3O.js} +6 -7
  38. package/dist/chunk-WQPX44YM.js +1626 -0
  39. package/dist/{chunk-T2PAD63Y.js → chunk-XZGSCABI.js} +1 -1
  40. package/dist/chunk-YLQEVSOR.js +299 -0
  41. package/dist/{chunk-P5WYW2GI.js → chunk-ZQOKIGZP.js} +152 -306
  42. package/dist/components/index.css +38 -0
  43. package/dist/components/index.d.ts +334 -38
  44. package/dist/components/index.js +42 -42
  45. package/dist/components/navigation/index.css +38 -0
  46. package/dist/components/navigation/index.js +3 -2
  47. package/dist/execution/index.d.ts +9 -3
  48. package/dist/features/auth/index.css +38 -0
  49. package/dist/features/auth/index.d.ts +212 -14
  50. package/dist/features/auth/index.js +41 -9
  51. package/dist/features/clients/index.css +649 -0
  52. package/dist/features/clients/index.d.ts +86 -0
  53. package/dist/features/clients/index.js +720 -0
  54. package/dist/features/crm/index.css +38 -0
  55. package/dist/features/crm/index.d.ts +228 -20
  56. package/dist/features/crm/index.js +20 -17
  57. package/dist/features/dashboard/index.css +38 -0
  58. package/dist/features/dashboard/index.d.ts +78 -3
  59. package/dist/features/dashboard/index.js +16 -16
  60. package/dist/features/delivery/index.css +38 -0
  61. package/dist/features/delivery/index.d.ts +201 -18
  62. package/dist/features/delivery/index.js +20 -18
  63. package/dist/features/knowledge/index.css +38 -0
  64. package/dist/features/knowledge/index.d.ts +20 -18
  65. package/dist/features/knowledge/index.js +116 -578
  66. package/dist/features/lead-gen/index.css +38 -0
  67. package/dist/features/lead-gen/index.d.ts +59 -51
  68. package/dist/features/lead-gen/index.js +20 -18
  69. package/dist/features/monitoring/index.css +38 -0
  70. package/dist/features/monitoring/index.d.ts +20 -18
  71. package/dist/features/monitoring/index.js +19 -18
  72. package/dist/features/monitoring/requests/index.css +38 -0
  73. package/dist/features/monitoring/requests/index.d.ts +21 -19
  74. package/dist/features/monitoring/requests/index.js +17 -15
  75. package/dist/features/operations/index.css +38 -0
  76. package/dist/features/operations/index.d.ts +945 -45
  77. package/dist/features/operations/index.js +24 -26
  78. package/dist/features/seo/index.d.ts +20 -18
  79. package/dist/features/seo/index.js +1 -1
  80. package/dist/features/settings/index.css +38 -0
  81. package/dist/features/settings/index.d.ts +201 -18
  82. package/dist/features/settings/index.js +18 -16
  83. package/dist/hooks/delivery/index.css +38 -0
  84. package/dist/hooks/delivery/index.d.ts +200 -0
  85. package/dist/hooks/delivery/index.js +2 -2
  86. package/dist/hooks/index.css +38 -0
  87. package/dist/hooks/index.d.ts +825 -47
  88. package/dist/hooks/index.js +14 -13
  89. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +194 -3
  90. package/dist/hooks/published.css +38 -0
  91. package/dist/hooks/published.d.ts +825 -47
  92. package/dist/hooks/published.js +14 -13
  93. package/dist/index.css +38 -0
  94. package/dist/index.d.ts +1506 -1212
  95. package/dist/index.js +15 -14
  96. package/dist/initialization/index.d.ts +181 -0
  97. package/dist/knowledge/index.d.ts +813 -1068
  98. package/dist/knowledge/index.js +7370 -2869
  99. package/dist/{chunk-CLUP5H3C.js → knowledge-search-index-5KYPO746.js} +441 -963
  100. package/dist/layout/index.d.ts +6 -0
  101. package/dist/layout/index.js +4 -5
  102. package/dist/organization/index.css +38 -0
  103. package/dist/profile/index.d.ts +181 -0
  104. package/dist/provider/index.css +38 -0
  105. package/dist/provider/index.d.ts +909 -1156
  106. package/dist/provider/index.js +11 -10
  107. package/dist/provider/published.css +38 -0
  108. package/dist/provider/published.d.ts +906 -1153
  109. package/dist/provider/published.js +7 -6
  110. package/dist/supabase/index.d.ts +349 -0
  111. package/dist/test-utils/index.d.ts +16 -9
  112. package/dist/test-utils/index.js +39 -32
  113. package/dist/test-utils/setup.js +1 -1
  114. package/dist/theme/index.js +3 -3
  115. package/dist/theme/presets/index.js +1 -1
  116. package/dist/types/index.d.ts +378 -5
  117. package/dist/utils/index.d.ts +78 -3
  118. package/dist/utils/index.js +1 -1
  119. package/dist/vite/index.js +2 -2
  120. package/dist/vite-plugin-knowledge/index.js +1 -1
  121. package/package.json +47 -37
  122. package/src/provider/README.md +5 -5
  123. package/dist/chunk-2DIYILF7.js +0 -413
  124. package/dist/chunk-3MDNBHVB.js +0 -3868
  125. package/dist/chunk-6IXOKUBC.js +0 -347
  126. package/dist/chunk-AKOD52HS.js +0 -739
  127. package/dist/chunk-ECNNI3NT.js +0 -6
  128. package/dist/chunk-JDNEWB5F.js +0 -10
  129. package/dist/chunk-NITGGYH2.js +0 -476
  130. package/dist/chunk-OAVTMITG.js +0 -13
@@ -88,7 +88,7 @@ function ProtectedRoute2({
88
88
  function AdminGuard2({ children, redirectTo, fallback = /* @__PURE__ */ jsx(AppShellLoader, {}) }) {
89
89
  return /* @__PURE__ */ jsx(AdminGuard, { redirectTo, fallback, children });
90
90
  }
91
- var FEATURE_LABELS = {
91
+ var SYSTEM_LABELS = {
92
92
  crm: "CRM",
93
93
  "lead-gen": "Lead Gen",
94
94
  projects: "Projects",
@@ -98,19 +98,51 @@ var FEATURE_LABELS = {
98
98
  settings: "Settings",
99
99
  seo: "SEO"
100
100
  };
101
- function getFeatureLabel(featureKey) {
102
- return FEATURE_LABELS[featureKey] ?? featureKey;
101
+ function getSystemLabel(systemKey) {
102
+ return SYSTEM_LABELS[systemKey] ?? systemKey;
103
103
  }
104
- function FeatureGuard({ featureKey, children, deniedMessage, useFeatureAccess }) {
104
+ function getSurfaceLabel(surfaceKey) {
105
+ return SYSTEM_LABELS[surfaceKey] ?? surfaceKey;
106
+ }
107
+ function SystemGuard({ systemKey, children, deniedMessage, useFeatureAccess }) {
108
+ const { checkFeature, isReady } = useFeatureAccess();
109
+ const navigate = useNavigate();
110
+ const hasRedirected = useRef(false);
111
+ const resolvedSystemKey = systemKey;
112
+ const { allowed, restrictedBy } = checkFeature(resolvedSystemKey);
113
+ useEffect(() => {
114
+ if (isReady && !allowed && !hasRedirected.current) {
115
+ hasRedirected.current = true;
116
+ const systemLabel = getSystemLabel(resolvedSystemKey);
117
+ const message = deniedMessage ?? (restrictedBy === "membership" ? `You do not have access to ${systemLabel}.` : `${systemLabel} is not available for your organization.`);
118
+ notifications.show({
119
+ title: "Access Restricted",
120
+ message,
121
+ autoClose: 5e3,
122
+ color: "red",
123
+ position: "top-right"
124
+ });
125
+ navigate({ to: "/" });
126
+ }
127
+ }, [isReady, allowed, restrictedBy, resolvedSystemKey, deniedMessage, navigate]);
128
+ if (!isReady) {
129
+ return /* @__PURE__ */ jsx(AppShellLoader, {});
130
+ }
131
+ if (!allowed) {
132
+ return null;
133
+ }
134
+ return /* @__PURE__ */ jsx(Fragment, { children });
135
+ }
136
+ function SurfaceGuard({ surfaceKey, children, deniedMessage, useFeatureAccess }) {
105
137
  const { checkFeature, isReady } = useFeatureAccess();
106
138
  const navigate = useNavigate();
107
139
  const hasRedirected = useRef(false);
108
- const { allowed, restrictedBy } = checkFeature(featureKey);
140
+ const { allowed, restrictedBy } = checkFeature(surfaceKey);
109
141
  useEffect(() => {
110
142
  if (isReady && !allowed && !hasRedirected.current) {
111
143
  hasRedirected.current = true;
112
- const featureLabel = getFeatureLabel(featureKey);
113
- const message = deniedMessage ?? (restrictedBy === "membership" ? `You do not have access to ${featureLabel}.` : `${featureLabel} is not available for your organization.`);
144
+ const surfaceLabel = getSurfaceLabel(surfaceKey);
145
+ const message = deniedMessage ?? (restrictedBy === "membership" ? `You do not have access to ${surfaceLabel}.` : `${surfaceLabel} is not available for your organization.`);
114
146
  notifications.show({
115
147
  title: "Access Restricted",
116
148
  message,
@@ -120,7 +152,7 @@ function FeatureGuard({ featureKey, children, deniedMessage, useFeatureAccess })
120
152
  });
121
153
  navigate({ to: "/" });
122
154
  }
123
- }, [isReady, allowed, restrictedBy, featureKey, deniedMessage, navigate]);
155
+ }, [isReady, allowed, restrictedBy, surfaceKey, deniedMessage, navigate]);
124
156
  if (!isReady) {
125
157
  return /* @__PURE__ */ jsx(AppShellLoader, {});
126
158
  }
@@ -130,4 +162,4 @@ function FeatureGuard({ featureKey, children, deniedMessage, useFeatureAccess })
130
162
  return /* @__PURE__ */ jsx(Fragment, { children });
131
163
  }
132
164
 
133
- export { AdminGuard2 as AdminGuard, FeatureGuard, ProtectedRoute2 as ProtectedRoute };
165
+ export { AdminGuard2 as AdminGuard, ProtectedRoute2 as ProtectedRoute, SurfaceGuard, SystemGuard };