@acmekit/dashboard 2.13.7 → 2.13.8

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 (60) hide show
  1. package/dist/api-key-management-create-D57V3NN2.mjs +170 -0
  2. package/dist/api-key-management-detail-QURSBB6T.mjs +307 -0
  3. package/dist/api-key-management-edit-GG5V77GY.mjs +106 -0
  4. package/dist/api-key-management-list-PL64LD22.mjs +400 -0
  5. package/dist/app.js +16930 -1004
  6. package/dist/app.mjs +793 -884
  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-6SQCO25J.mjs +65 -0
  11. package/dist/chunk-774WSTCC.mjs +19 -0
  12. package/dist/chunk-7ZHDHEUH.mjs +1837 -0
  13. package/dist/chunk-C76H5USB.mjs +16 -0
  14. package/dist/chunk-DFFLVEZ5.mjs +40 -0
  15. package/dist/chunk-DN3MIYQH.mjs +140 -0
  16. package/dist/chunk-DQCEH3X2.mjs +28 -0
  17. package/dist/chunk-DTY37DDZ.mjs +20 -0
  18. package/dist/chunk-FXYH54JP.mjs +16 -0
  19. package/dist/chunk-G22WWLPG.mjs +44 -0
  20. package/dist/chunk-G2VJOHHV.mjs +32 -0
  21. package/dist/chunk-GBFVWROS.mjs +58 -0
  22. package/dist/chunk-ITNQKZQQ.mjs +142 -0
  23. package/dist/chunk-IUCDCPJU.mjs +0 -0
  24. package/dist/chunk-LKWTBYYC.mjs +35 -0
  25. package/dist/{chunk-4VYJHIB3.mjs → chunk-ND3ODI36.mjs} +0 -72
  26. package/dist/chunk-OAHCJFG3.mjs +17 -0
  27. package/dist/chunk-OHAFITSB.mjs +54 -0
  28. package/dist/chunk-RPAL6FHW.mjs +73 -0
  29. package/dist/{chunk-JSJZMTQG.mjs → chunk-RREPQMYC.mjs} +14 -41
  30. package/dist/chunk-S3REQHPQ.mjs +86 -0
  31. package/dist/chunk-S4DMV3ZT.mjs +35 -0
  32. package/dist/chunk-TCNCAWYD.mjs +9 -0
  33. package/dist/chunk-ULSPL3DR.mjs +126 -0
  34. package/dist/chunk-VBT5YZ4K.mjs +129 -0
  35. package/dist/chunk-WILMJYUB.mjs +35 -0
  36. package/dist/chunk-XIM7X4FB.mjs +83 -0
  37. package/dist/chunk-YB52HEIR.mjs +387 -0
  38. package/dist/chunk-YRWSG3YM.mjs +80 -0
  39. package/dist/{invite-S5USGDOZ.mjs → invite-BAFXQBLJ.mjs} +15 -7
  40. package/dist/{login-AIMR26AL.mjs → login-YURMNRCS.mjs} +23 -9
  41. package/dist/profile-detail-SJWODS2K.mjs +96 -0
  42. package/dist/profile-edit-HSGF4UXZ.mjs +173 -0
  43. package/dist/{reset-password-UQPRHMB3.mjs → reset-password-RQ5M7HQC.mjs} +8 -4
  44. package/dist/settings-3XWLL5LG.mjs +545 -0
  45. package/dist/store-detail-SQKV5KBD.mjs +109 -0
  46. package/dist/store-edit-WGGIJMYJ.mjs +97 -0
  47. package/dist/store-metadata-CSBUGX6Z.mjs +49 -0
  48. package/dist/translation-list-H5X4DVCC.mjs +587 -0
  49. package/dist/translations-edit-NPAUN2GZ.mjs +5376 -0
  50. package/dist/user-detail-7SUQ35G7.mjs +169 -0
  51. package/dist/user-edit-KUZV37AH.mjs +114 -0
  52. package/dist/user-invite-OREFWWYL.mjs +361 -0
  53. package/dist/user-list-OWUR75OP.mjs +1116 -0
  54. package/dist/user-metadata-QHUX5SHZ.mjs +51 -0
  55. package/dist/workflow-execution-detail-MWNM25TF.mjs +820 -0
  56. package/dist/workflow-execution-list-IGYF44UH.mjs +175 -0
  57. package/package.json +9 -9
  58. package/src/components/layout/settings-layout/settings-layout.tsx +8 -2
  59. package/dist/chunk-FBTP4AJM.mjs +0 -221
  60. package/dist/chunk-QYOO4QR6.mjs +0 -73
@@ -0,0 +1,54 @@
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/store.tsx
12
+ import {
13
+ useMutation,
14
+ useQuery
15
+ } from "@tanstack/react-query";
16
+ import { FetchError } from "@acmekit/js-sdk";
17
+ var STORE_QUERY_KEY = "store";
18
+ var storeQueryKeys = queryKeysFactory(STORE_QUERY_KEY);
19
+ async function retrieveActiveStore(query) {
20
+ const response = await sdk.admin.store.list(query);
21
+ const activeStore = response.stores?.[0];
22
+ if (!activeStore) {
23
+ throw new FetchError("No active store found", "Not Found", 404);
24
+ }
25
+ return { store: activeStore };
26
+ }
27
+ var useStore = (query, options) => {
28
+ const { data, ...rest } = useQuery({
29
+ queryFn: () => retrieveActiveStore(query),
30
+ queryKey: storeQueryKeys.details(),
31
+ ...options
32
+ });
33
+ return {
34
+ ...data,
35
+ ...rest
36
+ };
37
+ };
38
+ var useUpdateStore = (id, options) => {
39
+ return useMutation({
40
+ mutationFn: (payload) => sdk.admin.store.update(id, payload),
41
+ onSuccess: (data, variables, context) => {
42
+ queryClient.invalidateQueries({ queryKey: storeQueryKeys.details() });
43
+ options?.onSuccess?.(data, variables, context);
44
+ },
45
+ ...options
46
+ });
47
+ };
48
+
49
+ export {
50
+ storeQueryKeys,
51
+ retrieveActiveStore,
52
+ useStore,
53
+ useUpdateStore
54
+ };
@@ -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,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,129 @@
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/api-keys.tsx
12
+ import {
13
+ useMutation as useMutation4,
14
+ useQuery as useQuery4
15
+ } from "@tanstack/react-query";
16
+
17
+ // src/hooks/api/sales-channels.tsx
18
+ import {
19
+ useMutation as useMutation3,
20
+ useQuery as useQuery3
21
+ } from "@tanstack/react-query";
22
+
23
+ // src/hooks/api/products.tsx
24
+ import {
25
+ useMutation as useMutation2,
26
+ useQuery as useQuery2
27
+ } from "@tanstack/react-query";
28
+
29
+ // src/hooks/api/inventory.tsx
30
+ import {
31
+ useMutation,
32
+ useQuery
33
+ } from "@tanstack/react-query";
34
+ var INVENTORY_ITEMS_QUERY_KEY = "inventory_items";
35
+ var inventoryItemsQueryKeys = queryKeysFactory(
36
+ INVENTORY_ITEMS_QUERY_KEY
37
+ );
38
+ var INVENTORY_ITEM_LEVELS_QUERY_KEY = "inventory_item_levels";
39
+ var inventoryItemLevelsQueryKeys = queryKeysFactory(
40
+ INVENTORY_ITEM_LEVELS_QUERY_KEY
41
+ );
42
+
43
+ // src/hooks/use-infinite-list.tsx
44
+ import {
45
+ useInfiniteQuery
46
+ } from "@tanstack/react-query";
47
+
48
+ // src/hooks/api/products.tsx
49
+ var PRODUCTS_QUERY_KEY = "products";
50
+ var productsQueryKeys = queryKeysFactory(PRODUCTS_QUERY_KEY);
51
+ var VARIANTS_QUERY_KEY = "product_variants";
52
+ var variantsQueryKeys = queryKeysFactory(VARIANTS_QUERY_KEY);
53
+ var OPTIONS_QUERY_KEY = "product_options";
54
+ var optionsQueryKeys = queryKeysFactory(OPTIONS_QUERY_KEY);
55
+
56
+ // src/hooks/api/sales-channels.tsx
57
+ var SALES_CHANNELS_QUERY_KEY = "sales-channels";
58
+ var salesChannelsQueryKeys = queryKeysFactory(SALES_CHANNELS_QUERY_KEY);
59
+
60
+ // src/hooks/api/api-keys.tsx
61
+ var API_KEYS_QUERY_KEY = "api_keys";
62
+ var apiKeysQueryKeys = queryKeysFactory(API_KEYS_QUERY_KEY);
63
+ var useApiKey = (id, options) => {
64
+ const { data, ...rest } = useQuery4({
65
+ queryFn: () => sdk.admin.apiKey.retrieve(id),
66
+ queryKey: apiKeysQueryKeys.detail(id),
67
+ ...options
68
+ });
69
+ return { ...data, ...rest };
70
+ };
71
+ var useApiKeys = (query, options) => {
72
+ const { data, ...rest } = useQuery4({
73
+ queryFn: () => sdk.admin.apiKey.list(query),
74
+ queryKey: apiKeysQueryKeys.list(query),
75
+ ...options
76
+ });
77
+ return { ...data, ...rest };
78
+ };
79
+ var useCreateApiKey = (options) => {
80
+ return useMutation4({
81
+ mutationFn: (payload) => sdk.admin.apiKey.create(payload),
82
+ onSuccess: (data, variables, context) => {
83
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.lists() });
84
+ options?.onSuccess?.(data, variables, context);
85
+ },
86
+ ...options
87
+ });
88
+ };
89
+ var useUpdateApiKey = (id, options) => {
90
+ return useMutation4({
91
+ mutationFn: (payload) => sdk.admin.apiKey.update(id, payload),
92
+ onSuccess: (data, variables, context) => {
93
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.lists() });
94
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.detail(id) });
95
+ options?.onSuccess?.(data, variables, context);
96
+ },
97
+ ...options
98
+ });
99
+ };
100
+ var useRevokeApiKey = (id, options) => {
101
+ return useMutation4({
102
+ mutationFn: () => sdk.admin.apiKey.revoke(id),
103
+ onSuccess: (data, variables, context) => {
104
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.lists() });
105
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.detail(id) });
106
+ options?.onSuccess?.(data, variables, context);
107
+ }
108
+ });
109
+ };
110
+ var useDeleteApiKey = (id, options) => {
111
+ return useMutation4({
112
+ mutationFn: () => sdk.admin.apiKey.delete(id),
113
+ onSuccess: (data, variables, context) => {
114
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.lists() });
115
+ queryClient.invalidateQueries({ queryKey: apiKeysQueryKeys.detail(id) });
116
+ options?.onSuccess?.(data, variables, context);
117
+ }
118
+ });
119
+ };
120
+
121
+ export {
122
+ apiKeysQueryKeys,
123
+ useApiKey,
124
+ useApiKeys,
125
+ useCreateApiKey,
126
+ useUpdateApiKey,
127
+ useRevokeApiKey,
128
+ useDeleteApiKey
129
+ };
@@ -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
+ };