@acmekit/dashboard 2.13.7 → 2.13.9

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/api-key-management-create-VWUERPPB.mjs +170 -0
  2. package/dist/api-key-management-detail-V4ENQHYY.mjs +306 -0
  3. package/dist/api-key-management-edit-R44OHS7B.mjs +106 -0
  4. package/dist/api-key-management-list-K2XPKF5E.mjs +400 -0
  5. package/dist/app.js +16765 -1370
  6. package/dist/app.mjs +786 -1030
  7. package/dist/chunk-22YYMH6M.mjs +382 -0
  8. package/dist/chunk-2U3RK3JG.mjs +474 -0
  9. package/dist/chunk-535OVBXR.mjs +226 -0
  10. package/dist/chunk-774WSTCC.mjs +19 -0
  11. package/dist/chunk-C76H5USB.mjs +16 -0
  12. package/dist/chunk-DFFLVEZ5.mjs +40 -0
  13. package/dist/chunk-DN3MIYQH.mjs +140 -0
  14. package/dist/chunk-DQCEH3X2.mjs +28 -0
  15. package/dist/chunk-DTY37DDZ.mjs +20 -0
  16. package/dist/chunk-EFRMWHRX.mjs +84 -0
  17. package/dist/chunk-FXYH54JP.mjs +16 -0
  18. package/dist/chunk-G22WWLPG.mjs +44 -0
  19. package/dist/chunk-G2VJOHHV.mjs +32 -0
  20. package/dist/chunk-GBFVWROS.mjs +58 -0
  21. package/dist/chunk-ITNQKZQQ.mjs +142 -0
  22. package/dist/chunk-IUCDCPJU.mjs +0 -0
  23. package/dist/chunk-LKWTBYYC.mjs +35 -0
  24. package/dist/{chunk-4VYJHIB3.mjs → chunk-ND3ODI36.mjs} +0 -72
  25. package/dist/chunk-OAHCJFG3.mjs +17 -0
  26. package/dist/chunk-RPAL6FHW.mjs +73 -0
  27. package/dist/{chunk-JSJZMTQG.mjs → chunk-RREPQMYC.mjs} +14 -41
  28. package/dist/chunk-S3REQHPQ.mjs +86 -0
  29. package/dist/chunk-S4DMV3ZT.mjs +35 -0
  30. package/dist/chunk-ST2YB7JN.mjs +74 -0
  31. package/dist/chunk-TCNCAWYD.mjs +9 -0
  32. package/dist/chunk-ULSPL3DR.mjs +126 -0
  33. package/dist/chunk-WILMJYUB.mjs +35 -0
  34. package/dist/chunk-XIM7X4FB.mjs +83 -0
  35. package/dist/chunk-YLPAZ2DP.mjs +1837 -0
  36. package/dist/chunk-YRWSG3YM.mjs +80 -0
  37. package/dist/{invite-S5USGDOZ.mjs → invite-XGPZZBUP.mjs} +15 -7
  38. package/dist/{login-AIMR26AL.mjs → login-GNP3QIPI.mjs} +25 -12
  39. package/dist/profile-detail-YX27F7N6.mjs +96 -0
  40. package/dist/profile-edit-2VRDU75O.mjs +173 -0
  41. package/dist/{reset-password-UQPRHMB3.mjs → reset-password-TWRNZO6Z.mjs} +7 -3
  42. package/dist/settings-3XWLL5LG.mjs +545 -0
  43. package/dist/translation-list-CCEQJNED.mjs +581 -0
  44. package/dist/translations-edit-E57GVUFV.mjs +5376 -0
  45. package/dist/user-detail-KUSRRVNX.mjs +169 -0
  46. package/dist/user-edit-HTN3ZGCL.mjs +114 -0
  47. package/dist/user-invite-E3FAAU3V.mjs +361 -0
  48. package/dist/user-list-KNJ5S3IM.mjs +1116 -0
  49. package/dist/user-metadata-5GQK75DT.mjs +425 -0
  50. package/dist/workflow-execution-detail-LZXCRVNC.mjs +819 -0
  51. package/dist/workflow-execution-list-HQ3V6TML.mjs +175 -0
  52. package/package.json +9 -9
  53. package/src/components/layout/settings-layout/settings-layout.tsx +8 -2
  54. package/src/dashboard-app/routes/get-route.map.tsx +1 -14
  55. package/src/hooks/api/api-keys.tsx +0 -49
  56. package/src/hooks/api/index.ts +0 -1
  57. package/src/providers/keybind-provider/hooks.tsx +0 -145
  58. package/src/routes/translations/translation-list/translation-list.tsx +10 -21
  59. package/src/routes/translations/translations-edit/translations-edit.tsx +14 -11
  60. package/src/vite-env.d.ts +3 -1
  61. package/dist/chunk-FBTP4AJM.mjs +0 -221
  62. package/dist/chunk-QYOO4QR6.mjs +0 -73
  63. package/src/components/data-table/helpers/sales-channels/index.ts +0 -4
  64. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-columns.tsx +0 -61
  65. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-empty-state.tsx +0 -22
  66. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-filters.tsx +0 -33
  67. package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-query.tsx +0 -30
  68. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +0 -206
  69. package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/index.ts +0 -1
  70. package/src/routes/store/common/hooks/use-currencies-table-columns.tsx +0 -29
  71. package/src/routes/store/common/hooks/use-currencies-table-query.tsx +0 -21
  72. package/src/routes/store/common/hooks/use-locales-table-columns.tsx +0 -29
  73. package/src/routes/store/common/hooks/use-locales-table-query.tsx +0 -21
  74. package/src/routes/store/store-detail/components/store-general-section/index.ts +0 -1
  75. package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +0 -48
  76. package/src/routes/store/store-detail/index.ts +0 -2
  77. package/src/routes/store/store-detail/loader.ts +0 -18
  78. package/src/routes/store/store-detail/store-detail.tsx +0 -42
  79. package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +0 -83
  80. package/src/routes/store/store-edit/index.ts +0 -1
  81. package/src/routes/store/store-edit/store-edit.tsx +0 -25
  82. package/src/routes/store/store-metadata/index.ts +0 -1
  83. package/src/routes/store/store-metadata/store-metadata.tsx +0 -24
@@ -1,69 +1,3 @@
1
- // src/hooks/api/auth.tsx
2
- import { useMutation } from "@tanstack/react-query";
3
-
4
- // src/lib/client/client.ts
5
- import AcmeKit from "@acmekit/js-sdk";
6
- var backendUrl = __BACKEND_URL__ ?? "/";
7
- var authType = __AUTH_TYPE__ ?? "session";
8
- var jwtTokenStorageKey = __JWT_TOKEN_STORAGE_KEY__ || void 0;
9
- var sdk = new AcmeKit({
10
- baseUrl: backendUrl,
11
- auth: {
12
- type: authType,
13
- jwtTokenStorageKey
14
- }
15
- });
16
- if (typeof window !== "undefined") {
17
- ;
18
- window.__sdk = sdk;
19
- }
20
-
21
- // src/hooks/api/auth.tsx
22
- var useSignInWithEmailPass = (options) => {
23
- return useMutation({
24
- mutationFn: (payload) => sdk.auth.login("user", "emailpass", payload),
25
- onSuccess: async (data, variables, context) => {
26
- options?.onSuccess?.(data, variables, context);
27
- },
28
- ...options
29
- });
30
- };
31
- var useSignUpWithEmailPass = (options) => {
32
- return useMutation({
33
- mutationFn: (payload) => sdk.auth.register("user", "emailpass", payload),
34
- onSuccess: async (data, variables, context) => {
35
- options?.onSuccess?.(data, variables, context);
36
- },
37
- ...options
38
- });
39
- };
40
- var useResetPasswordForEmailPass = (options) => {
41
- return useMutation({
42
- mutationFn: (payload) => sdk.auth.resetPassword("user", "emailpass", {
43
- identifier: payload.email
44
- }),
45
- onSuccess: async (data, variables, context) => {
46
- options?.onSuccess?.(data, variables, context);
47
- },
48
- ...options
49
- });
50
- };
51
- var useLogout = (options) => {
52
- return useMutation({
53
- mutationFn: () => sdk.auth.logout(),
54
- ...options
55
- });
56
- };
57
- var useUpdateProviderForEmailPass = (token, options) => {
58
- return useMutation({
59
- mutationFn: (payload) => sdk.auth.updateProvider("user", "emailpass", payload, token),
60
- onSuccess: async (data, variables, context) => {
61
- options?.onSuccess?.(data, variables, context);
62
- },
63
- ...options
64
- });
65
- };
66
-
67
1
  // src/components/common/form/form.tsx
68
2
  import { InformationCircleSolid } from "@acmekit/icons";
69
3
  import {
@@ -223,11 +157,5 @@ var Form = Object.assign(Provider, {
223
157
  });
224
158
 
225
159
  export {
226
- sdk,
227
- useSignInWithEmailPass,
228
- useSignUpWithEmailPass,
229
- useResetPasswordForEmailPass,
230
- useLogout,
231
- useUpdateProviderForEmailPass,
232
160
  Form
233
161
  };
@@ -0,0 +1,17 @@
1
+ // src/components/common/conditional-tooltip/conditional-tooltip.tsx
2
+ import { Tooltip } from "@acmekit/ui";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var ConditionalTooltip = ({
5
+ children,
6
+ showTooltip = false,
7
+ ...props
8
+ }) => {
9
+ if (showTooltip) {
10
+ return /* @__PURE__ */ jsx(Tooltip, { ...props, children });
11
+ }
12
+ return children;
13
+ };
14
+
15
+ export {
16
+ ConditionalTooltip
17
+ };
@@ -0,0 +1,73 @@
1
+ // src/routes/workflow-executions/constants.ts
2
+ var STEP_IN_PROGRESS_STATES = [
3
+ "compensating" /* COMPENSATING */,
4
+ "invoking" /* INVOKING */
5
+ ];
6
+ var STEP_SKIPPED_STATES = [
7
+ "skipped" /* SKIPPED */,
8
+ "skipped_failure" /* SKIPPED_FAILURE */
9
+ ];
10
+ var STEP_OK_STATES = [
11
+ "done" /* DONE */
12
+ ];
13
+ var STEP_ERROR_STATES = [
14
+ "failed" /* FAILED */,
15
+ "reverted" /* REVERTED */,
16
+ "timeout" /* TIMEOUT */,
17
+ "dormant" /* DORMANT */
18
+ ];
19
+ var STEP_INACTIVE_STATES = [
20
+ "not_started" /* NOT_STARTED */
21
+ ];
22
+ var TRANSACTION_OK_STATES = [
23
+ "done" /* DONE */
24
+ ];
25
+ var TRANSACTION_ERROR_STATES = [
26
+ "failed" /* FAILED */,
27
+ "reverted" /* REVERTED */
28
+ ];
29
+ var TRANSACTION_IN_PROGRESS_STATES = [
30
+ "invoking" /* INVOKING */,
31
+ "waiting_to_compensate" /* WAITING_TO_COMPENSATE */,
32
+ "compensating" /* COMPENSATING */
33
+ ];
34
+
35
+ // src/routes/workflow-executions/utils.ts
36
+ var getTransactionStateColor = (state) => {
37
+ let statusColor = "green";
38
+ if (TRANSACTION_ERROR_STATES.includes(state)) {
39
+ statusColor = "red";
40
+ }
41
+ if (TRANSACTION_IN_PROGRESS_STATES.includes(state)) {
42
+ statusColor = "orange";
43
+ }
44
+ return statusColor;
45
+ };
46
+ var getTransactionState = (t, state) => {
47
+ switch (state) {
48
+ case "done" /* DONE */:
49
+ return t("workflowExecutions.state.done");
50
+ case "failed" /* FAILED */:
51
+ return t("workflowExecutions.state.failed");
52
+ case "reverted" /* REVERTED */:
53
+ return t("workflowExecutions.state.reverted");
54
+ case "invoking" /* INVOKING */:
55
+ return t("workflowExecutions.state.invoking");
56
+ case "waiting_to_compensate" /* WAITING_TO_COMPENSATE */:
57
+ return t("workflowExecutions.transaction.state.waitingToCompensate");
58
+ case "compensating" /* COMPENSATING */:
59
+ return t("workflowExecutions.state.compensating");
60
+ case "not_started" /* NOT_STARTED */:
61
+ return t("workflowExecutions.state.notStarted");
62
+ }
63
+ };
64
+
65
+ export {
66
+ STEP_IN_PROGRESS_STATES,
67
+ STEP_SKIPPED_STATES,
68
+ STEP_OK_STATES,
69
+ STEP_ERROR_STATES,
70
+ STEP_INACTIVE_STATES,
71
+ getTransactionStateColor,
72
+ getTransactionState
73
+ };
@@ -1,37 +1,10 @@
1
- // src/components/common/logo-box/avatar-box.tsx
2
- import { motion } from "motion/react";
3
-
4
- // src/components/common/icon-avatar/icon-avatar.tsx
5
- import { clx } from "@acmekit/ui";
6
- import { jsx } from "react/jsx-runtime";
7
- var IconAvatar = ({
8
- size = "small",
9
- variant = "rounded",
10
- children,
11
- className
12
- }) => {
13
- return /* @__PURE__ */ jsx(
14
- "div",
15
- {
16
- className: clx(
17
- "shadow-borders-base flex size-7 items-center justify-center",
18
- variant === "squared" && "rounded-md",
19
- variant === "rounded" && "rounded-full",
20
- "[&>div]:bg-ui-bg-field [&>div]:text-ui-fg-subtle [&>div]:flex [&>div]:size-6 [&>div]:items-center [&>div]:justify-center",
21
- {
22
- "size-7 rounded-md [&>div]:size-6 [&>div]:rounded-[4px]": size === "small",
23
- "size-10 rounded-lg [&>div]:size-9 [&>div]:rounded-[6px]": size === "large",
24
- "size-12 rounded-xl [&>div]:size-11 [&>div]:rounded-[10px]": size === "xlarge"
25
- },
26
- className
27
- ),
28
- children: /* @__PURE__ */ jsx("div", { children })
29
- }
30
- );
31
- };
1
+ import {
2
+ IconAvatar
3
+ } from "./chunk-G2VJOHHV.mjs";
32
4
 
33
5
  // src/components/common/logo-box/avatar-box.tsx
34
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
6
+ import { motion } from "motion/react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
35
8
  function AvatarBox({ checked }) {
36
9
  return /* @__PURE__ */ jsxs(
37
10
  IconAvatar,
@@ -39,7 +12,7 @@ function AvatarBox({ checked }) {
39
12
  size: "xlarge",
40
13
  className: "bg-ui-button-neutral shadow-buttons-neutral after:button-neutral-gradient relative mb-4 flex h-[50px] w-[50px] items-center justify-center rounded-xl after:inset-0 after:content-['']",
41
14
  children: [
42
- checked && /* @__PURE__ */ jsx2(
15
+ checked && /* @__PURE__ */ jsx(
43
16
  motion.div,
44
17
  {
45
18
  className: "absolute -right-[5px] -top-1 flex size-5 items-center justify-center rounded-full border-[0.5px] border-[rgba(3,7,18,0.2)] bg-[#3B82F6] bg-gradient-to-b from-white/0 to-white/20 shadow-[0px_1px_2px_0px_rgba(3,7,18,0.12),0px_1px_2px_0px_rgba(255,255,255,0.10)_inset,0px_-1px_5px_0px_rgba(255,255,255,0.10)_inset,0px_0px_0px_0px_rgba(3,7,18,0.06)_inset]",
@@ -50,7 +23,7 @@ function AvatarBox({ checked }) {
50
23
  delay: 0.8,
51
24
  ease: [0, 0.71, 0.2, 1.01]
52
25
  },
53
- children: /* @__PURE__ */ jsx2(
26
+ children: /* @__PURE__ */ jsx(
54
27
  "svg",
55
28
  {
56
29
  xmlns: "http://www.w3.org/2000/svg",
@@ -58,7 +31,7 @@ function AvatarBox({ checked }) {
58
31
  height: "20",
59
32
  viewBox: "0 0 20 20",
60
33
  fill: "none",
61
- children: /* @__PURE__ */ jsx2(
34
+ children: /* @__PURE__ */ jsx(
62
35
  motion.path,
63
36
  {
64
37
  d: "M5.8335 10.4167L9.16683 13.75L14.1668 6.25",
@@ -88,8 +61,8 @@ function AvatarBox({ checked }) {
88
61
  fill: "none",
89
62
  xmlns: "http://www.w3.org/2000/svg",
90
63
  children: [
91
- /* @__PURE__ */ jsx2("rect", { width: "400", height: "400", fill: "#18181B" }),
92
- /* @__PURE__ */ jsx2(
64
+ /* @__PURE__ */ jsx("rect", { width: "400", height: "400", fill: "#18181B" }),
65
+ /* @__PURE__ */ jsx(
93
66
  "path",
94
67
  {
95
68
  d: "M238.088 51.1218L238.089 51.1223L310.605 92.8101C334.028 106.308 348.526 131.32 347.868 157.953L347.867 157.966V157.978V241.688C347.867 268.68 333.687 293.362 310.271 306.856L310.269 306.858L237.754 348.878C214.336 362.374 185.643 362.374 162.225 348.878L89.7127 306.859C66.6206 293.361 52.1113 268.674 52.1113 241.688V157.978C52.1113 131.326 66.6211 106.307 89.7088 92.8093C89.7101 92.8085 89.7114 92.8078 89.7127 92.807L162.556 51.1233L162.559 51.1218C185.977 37.6261 214.67 37.6261 238.088 51.1218ZM124.634 200C124.634 241.576 158.502 275.372 200.156 275.372C242.142 275.372 276.013 241.578 276.013 200C276.013 158.419 241.805 124.628 200.156 124.628C158.502 124.628 124.634 158.424 124.634 200Z",
@@ -109,8 +82,8 @@ function AvatarBox({ checked }) {
109
82
  y2: "360",
110
83
  gradientUnits: "userSpaceOnUse",
111
84
  children: [
112
- /* @__PURE__ */ jsx2("stop", { stopColor: "white" }),
113
- /* @__PURE__ */ jsx2("stop", { offset: "1", stopColor: "white", stopOpacity: "0.7" })
85
+ /* @__PURE__ */ jsx("stop", { stopColor: "white" }),
86
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.7" })
114
87
  ]
115
88
  }
116
89
  ),
@@ -124,8 +97,8 @@ function AvatarBox({ checked }) {
124
97
  y2: "360",
125
98
  gradientUnits: "userSpaceOnUse",
126
99
  children: [
127
- /* @__PURE__ */ jsx2("stop", { stopColor: "white", stopOpacity: "0" }),
128
- /* @__PURE__ */ jsx2("stop", { offset: "1", stopColor: "white", stopOpacity: "0.7" })
100
+ /* @__PURE__ */ jsx("stop", { stopColor: "white", stopOpacity: "0" }),
101
+ /* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.7" })
129
102
  ]
130
103
  }
131
104
  )
@@ -0,0 +1,86 @@
1
+ import {
2
+ ConditionalTooltip
3
+ } from "./chunk-OAHCJFG3.mjs";
4
+ import {
5
+ useDocumentDirection
6
+ } from "./chunk-S4DMV3ZT.mjs";
7
+
8
+ // src/components/common/action-menu/action-menu.tsx
9
+ import { DropdownMenu, IconButton, clx } from "@acmekit/ui";
10
+ import { EllipsisHorizontal } from "@acmekit/icons";
11
+ import { Link } from "react-router-dom";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+ var ActionMenu = ({
14
+ groups,
15
+ variant = "transparent",
16
+ children
17
+ }) => {
18
+ const direction = useDocumentDirection();
19
+ const inner = children ?? /* @__PURE__ */ jsx(IconButton, { size: "small", variant, children: /* @__PURE__ */ jsx(EllipsisHorizontal, {}) });
20
+ return /* @__PURE__ */ jsxs(DropdownMenu, { dir: direction, children: [
21
+ /* @__PURE__ */ jsx(DropdownMenu.Trigger, { asChild: true, children: inner }),
22
+ /* @__PURE__ */ jsx(DropdownMenu.Content, { children: groups.map((group, index) => {
23
+ if (!group.actions.length) {
24
+ return null;
25
+ }
26
+ const isLast = index === groups.length - 1;
27
+ return /* @__PURE__ */ jsxs(DropdownMenu.Group, { children: [
28
+ group.actions.map((action, index2) => {
29
+ const Wrapper = action.disabledTooltip ? ({ children: children2 }) => /* @__PURE__ */ jsx(
30
+ ConditionalTooltip,
31
+ {
32
+ showTooltip: action.disabled,
33
+ content: action.disabledTooltip,
34
+ side: "right",
35
+ children: /* @__PURE__ */ jsx("div", { children: children2 })
36
+ }
37
+ ) : "div";
38
+ if (action.onClick) {
39
+ return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsxs(
40
+ DropdownMenu.Item,
41
+ {
42
+ disabled: action.disabled,
43
+ onClick: (e) => {
44
+ e.stopPropagation();
45
+ action.onClick();
46
+ },
47
+ className: clx(
48
+ "[&_svg]:text-ui-fg-subtle flex items-center gap-x-2",
49
+ {
50
+ "[&_svg]:text-ui-fg-disabled": action.disabled
51
+ }
52
+ ),
53
+ children: [
54
+ action.icon,
55
+ /* @__PURE__ */ jsx("span", { children: action.label })
56
+ ]
57
+ }
58
+ ) }, index2);
59
+ }
60
+ return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(
61
+ DropdownMenu.Item,
62
+ {
63
+ className: clx(
64
+ "[&_svg]:text-ui-fg-subtle flex items-center gap-x-2",
65
+ {
66
+ "[&_svg]:text-ui-fg-disabled": action.disabled
67
+ }
68
+ ),
69
+ asChild: true,
70
+ disabled: action.disabled,
71
+ children: /* @__PURE__ */ jsxs(Link, { to: action.to, onClick: (e) => e.stopPropagation(), children: [
72
+ action.icon,
73
+ /* @__PURE__ */ jsx("span", { children: action.label })
74
+ ] })
75
+ }
76
+ ) }, index2);
77
+ }),
78
+ !isLast && /* @__PURE__ */ jsx(DropdownMenu.Separator, {})
79
+ ] }, index);
80
+ }) })
81
+ ] });
82
+ };
83
+
84
+ export {
85
+ ActionMenu
86
+ };
@@ -0,0 +1,35 @@
1
+ // src/hooks/use-document-direction.tsx
2
+ import { useEffect, useState } from "react";
3
+ var useDocumentDirection = () => {
4
+ const [direction, setDirection] = useState(() => {
5
+ if (typeof document !== "undefined") {
6
+ return document.documentElement.getAttribute("dir") || void 0;
7
+ }
8
+ return void 0;
9
+ });
10
+ useEffect(() => {
11
+ if (typeof document === "undefined") {
12
+ return;
13
+ }
14
+ const observer = new MutationObserver((mutations) => {
15
+ mutations.forEach((mutation) => {
16
+ if (mutation.type === "attributes" && mutation.attributeName === "dir" && mutation.target === document.documentElement) {
17
+ const newDirection = document.documentElement.getAttribute("dir");
18
+ setDirection(newDirection || void 0);
19
+ }
20
+ });
21
+ });
22
+ observer.observe(document.documentElement, {
23
+ attributes: true,
24
+ attributeFilter: ["dir"]
25
+ });
26
+ return () => {
27
+ observer.disconnect();
28
+ };
29
+ }, []);
30
+ return direction;
31
+ };
32
+
33
+ export {
34
+ useDocumentDirection
35
+ };
@@ -0,0 +1,74 @@
1
+ import {
2
+ queryKeysFactory
3
+ } from "./chunk-774WSTCC.mjs";
4
+ import {
5
+ sdk
6
+ } from "./chunk-DTY37DDZ.mjs";
7
+
8
+ // src/hooks/api/locales.tsx
9
+ import { useQuery } from "@tanstack/react-query";
10
+ var LOCALES_QUERY_KEY = "locales";
11
+ var localesQueryKeys = queryKeysFactory(LOCALES_QUERY_KEY);
12
+ var useLocales = (query, options) => {
13
+ const { data, ...rest } = useQuery({
14
+ queryFn: () => sdk.admin.locale.list(query),
15
+ queryKey: localesQueryKeys.list(query),
16
+ ...options
17
+ });
18
+ return { ...data, ...rest };
19
+ };
20
+
21
+ // src/hooks/api/cloud.tsx
22
+ import {
23
+ useMutation,
24
+ useQuery as useQuery2
25
+ } from "@tanstack/react-query";
26
+ var cloudQueryKeys = {
27
+ all: ["cloud"],
28
+ auth: () => [...cloudQueryKeys.all, "auth"]
29
+ };
30
+ var useCloudAuthEnabled = (options) => {
31
+ return useQuery2({
32
+ queryKey: cloudQueryKeys.auth(),
33
+ queryFn: async () => {
34
+ return await sdk.client.fetch("/cloud/auth");
35
+ },
36
+ ...options
37
+ });
38
+ };
39
+ var useCreateCloudAuthUser = (options) => {
40
+ return useMutation({
41
+ mutationFn: async () => {
42
+ await sdk.client.fetch("/cloud/auth/users", {
43
+ method: "POST"
44
+ });
45
+ },
46
+ ...options
47
+ });
48
+ };
49
+
50
+ // src/hooks/api/notification.tsx
51
+ import { useQuery as useQuery3 } from "@tanstack/react-query";
52
+ var NOTIFICATION_QUERY_KEY = "notification";
53
+ var notificationQueryKeys = queryKeysFactory(NOTIFICATION_QUERY_KEY);
54
+ var useNotifications = (query, options) => {
55
+ const { data, ...rest } = useQuery3({
56
+ queryFn: () => sdk.admin.notification.list(query),
57
+ queryKey: notificationQueryKeys.list(query),
58
+ ...options
59
+ });
60
+ return { ...data, ...rest };
61
+ };
62
+
63
+ // src/hooks/api/plugins.tsx
64
+ import { useQuery as useQuery4 } from "@tanstack/react-query";
65
+ var PLUGINS_QUERY_KEY = "plugins";
66
+ var pluginsQueryKeys = queryKeysFactory(PLUGINS_QUERY_KEY);
67
+
68
+ export {
69
+ useCloudAuthEnabled,
70
+ useCreateCloudAuthUser,
71
+ useLocales,
72
+ notificationQueryKeys,
73
+ useNotifications
74
+ };
@@ -0,0 +1,9 @@
1
+ // src/lib/is-fetch-error.ts
2
+ import { FetchError } from "@acmekit/js-sdk";
3
+ var isFetchError = (error) => {
4
+ return error instanceof FetchError;
5
+ };
6
+
7
+ export {
8
+ isFetchError
9
+ };
@@ -0,0 +1,126 @@
1
+ import {
2
+ queryClient
3
+ } from "./chunk-FXYH54JP.mjs";
4
+ import {
5
+ queryKeysFactory
6
+ } from "./chunk-774WSTCC.mjs";
7
+ import {
8
+ sdk
9
+ } from "./chunk-DTY37DDZ.mjs";
10
+
11
+ // src/hooks/api/translations.tsx
12
+ import {
13
+ useInfiniteQuery,
14
+ useMutation,
15
+ useQuery
16
+ } from "@tanstack/react-query";
17
+ var TRANSLATIONS_QUERY_KEY = "translations";
18
+ var translationsQueryKeys = queryKeysFactory(TRANSLATIONS_QUERY_KEY);
19
+ var TRANSLATION_SETTINGS_QUERY_KEY = "translation_settings";
20
+ var translationSettingsQueryKeys = queryKeysFactory(
21
+ TRANSLATION_SETTINGS_QUERY_KEY
22
+ );
23
+ var TRANSLATION_STATISTICS_QUERY_KEY = "translation_statistics";
24
+ var translationStatisticsQueryKeys = queryKeysFactory(
25
+ TRANSLATION_STATISTICS_QUERY_KEY
26
+ );
27
+ var TRANSLATION_ENTITIES_QUERY_KEY = "translation_entities";
28
+ var translationEntitiesQueryKeys = queryKeysFactory(
29
+ TRANSLATION_ENTITIES_QUERY_KEY
30
+ );
31
+ var DEFAULT_PAGE_SIZE = 20;
32
+ var useReferenceTranslations = (reference, referenceId, options) => {
33
+ const { data, ...rest } = useInfiniteQuery({
34
+ queryKey: translationEntitiesQueryKeys.list({
35
+ type: reference,
36
+ id: referenceId
37
+ }),
38
+ queryFn: async ({ pageParam = 0 }) => {
39
+ return sdk.admin.translation.entities({
40
+ type: reference,
41
+ id: referenceId,
42
+ limit: DEFAULT_PAGE_SIZE,
43
+ offset: pageParam
44
+ });
45
+ },
46
+ initialPageParam: 0,
47
+ getNextPageParam: (lastPage) => {
48
+ const nextOffset = lastPage.offset + lastPage.limit;
49
+ return nextOffset < lastPage.count ? nextOffset : void 0;
50
+ },
51
+ ...options
52
+ });
53
+ const entitiesWithTranslations = data?.pages.flatMap((page) => page.data) ?? [];
54
+ const translations = entitiesWithTranslations.flatMap(
55
+ (entity) => entity.translations ?? []
56
+ );
57
+ const references = entitiesWithTranslations.map(
58
+ ({ translations: _, ...entity }) => entity
59
+ );
60
+ const count = data?.pages[0]?.count ?? 0;
61
+ return {
62
+ references,
63
+ translations,
64
+ count,
65
+ ...rest
66
+ };
67
+ };
68
+ var useBatchTranslations = (reference, options) => {
69
+ const mutation = useMutation({
70
+ mutationFn: (payload) => sdk.admin.translation.batch(payload),
71
+ ...options
72
+ });
73
+ const invalidateQueries = async () => {
74
+ await Promise.all([
75
+ queryClient.invalidateQueries({
76
+ queryKey: translationEntitiesQueryKeys.list({ type: reference })
77
+ }),
78
+ queryClient.invalidateQueries({
79
+ queryKey: translationStatisticsQueryKeys.lists()
80
+ })
81
+ ]);
82
+ };
83
+ return {
84
+ ...mutation,
85
+ invalidateQueries
86
+ };
87
+ };
88
+ var useTranslationSettings = (query, options) => {
89
+ const { data, ...rest } = useQuery({
90
+ queryKey: translationSettingsQueryKeys.list(query),
91
+ queryFn: () => sdk.admin.translation.settings(query),
92
+ ...options
93
+ });
94
+ return { ...data, ...rest };
95
+ };
96
+ var useBatchTranslationSettings = (options) => {
97
+ return useMutation({
98
+ mutationFn: (payload) => sdk.admin.translation.batchSettings(payload),
99
+ onSuccess: (data, variables, context) => {
100
+ queryClient.invalidateQueries({
101
+ queryKey: translationSettingsQueryKeys.lists()
102
+ });
103
+ queryClient.invalidateQueries({
104
+ queryKey: translationStatisticsQueryKeys.lists()
105
+ });
106
+ options?.onSuccess?.(data, variables, context);
107
+ },
108
+ ...options
109
+ });
110
+ };
111
+ var useTranslationStatistics = (query, options) => {
112
+ const { data, ...rest } = useQuery({
113
+ queryKey: translationStatisticsQueryKeys.list(query),
114
+ queryFn: () => sdk.admin.translation.statistics(query),
115
+ ...options
116
+ });
117
+ return { ...data, ...rest };
118
+ };
119
+
120
+ export {
121
+ useReferenceTranslations,
122
+ useBatchTranslations,
123
+ useTranslationSettings,
124
+ useBatchTranslationSettings,
125
+ useTranslationStatistics
126
+ };
@@ -0,0 +1,35 @@
1
+ // src/components/table/table-cells/common/status-cell/status-cell.tsx
2
+ import { clx } from "@acmekit/ui";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ var StatusCell = ({ color, children }) => {
5
+ return /* @__PURE__ */ jsxs("div", { className: "txt-compact-small text-ui-fg-subtle flex h-full w-full items-center gap-x-2 overflow-hidden", children: [
6
+ /* @__PURE__ */ jsx(
7
+ "div",
8
+ {
9
+ role: "presentation",
10
+ className: "flex h-5 w-2 items-center justify-center",
11
+ children: /* @__PURE__ */ jsx(
12
+ "div",
13
+ {
14
+ className: clx(
15
+ "h-2 w-2 rounded-sm shadow-[0px_0px_0px_1px_rgba(0,0,0,0.12)_inset]",
16
+ {
17
+ "bg-ui-tag-neutral-icon": color === "grey",
18
+ "bg-ui-tag-green-icon": color === "green",
19
+ "bg-ui-tag-red-icon": color === "red",
20
+ "bg-ui-tag-blue-icon": color === "blue",
21
+ "bg-ui-tag-orange-icon": color === "orange",
22
+ "bg-ui-tag-purple-icon": color === "purple"
23
+ }
24
+ )
25
+ }
26
+ )
27
+ }
28
+ ),
29
+ /* @__PURE__ */ jsx("span", { className: "truncate", children })
30
+ ] });
31
+ };
32
+
33
+ export {
34
+ StatusCell
35
+ };