@parallelworks/tandem-web 0.175.1 → 0.175.2

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.
@@ -132,6 +132,7 @@ var e = {
132
132
  usernameDescription: "Used in links and the API. Old links stop working when you change it.",
133
133
  tokens: "CLI and API tokens",
134
134
  tokensDescription: "Tokens act as you, within the access you give them. Create one here for a script or integration, or sign in with <code>tandem login</code>. Unused tokens expire after 90 days.",
135
+ command: "command",
135
136
  revoke: "Revoke",
136
137
  revokeTokenTitle: "Revoke token?",
137
138
  revokeTokenDescription: "Anything using {name} will be signed out.",
@@ -132,6 +132,7 @@ var e = {
132
132
  usernameDescription: "Se usa en los enlaces y en la API. Los enlaces antiguos dejan de funcionar cuando lo cambias.",
133
133
  tokens: "Tokens de CLI y API",
134
134
  tokensDescription: "Los tokens actúan como tú, dentro del acceso que les des. Crea uno aquí para un script o una integración, o inicia sesión con <code>tandem login</code>. Los tokens sin usar caducan a los 90 días.",
135
+ command: "comando",
135
136
  revoke: "Revocar",
136
137
  revokeTokenTitle: "¿Revocar el token?",
137
138
  revokeTokenDescription: "Se cerrará la sesión de todo lo que use {name}.",
@@ -132,6 +132,7 @@ var e = {
132
132
  usernameDescription: "リンクや API で使われます。変更すると、古いリンクは使えなくなります。",
133
133
  tokens: "CLI・API トークン",
134
134
  tokensDescription: "トークンは、付与したアクセス権の範囲内であなたとして動作します。スクリプトや連携用にここで作成するか、<code>tandem login</code> でサインインしてください。使われていないトークンは 90 日後に失効します。",
135
+ command: "コマンド",
135
136
  revoke: "取り消す",
136
137
  revokeTokenTitle: "トークンを取り消しますか?",
137
138
  revokeTokenDescription: "{name} を使っているものはすべてサインアウトされます。",
@@ -132,6 +132,7 @@ var e = {
132
132
  usernameDescription: "링크와 API에 사용됩니다. 변경하면 이전 링크는 더 이상 작동하지 않습니다.",
133
133
  tokens: "CLI 및 API 토큰",
134
134
  tokensDescription: "토큰은 부여한 액세스 범위 안에서 회원님으로 동작합니다. 스크립트나 통합에 사용할 토큰을 여기에서 만들거나 <code>tandem login</code>으로 로그인하세요. 사용하지 않는 토큰은 90일 후 만료됩니다.",
135
+ command: "명령어",
135
136
  revoke: "해지",
136
137
  revokeTokenTitle: "토큰을 해지하시겠습니까?",
137
138
  revokeTokenDescription: "{name}을(를) 사용하는 모든 항목이 로그아웃됩니다.",
@@ -132,6 +132,7 @@ var e = {
132
132
  usernameDescription: "用于链接和 API。更改后,旧链接将失效。",
133
133
  tokens: "CLI 和 API 令牌",
134
134
  tokensDescription: "令牌以您的身份操作,权限不超出您授予的范围。可在此为脚本或集成创建令牌,也可以使用 <code>tandem login</code> 登录。未使用的令牌将在 90 天后过期。",
135
+ command: "命令",
135
136
  revoke: "撤销",
136
137
  revokeTokenTitle: "撤销令牌?",
137
138
  revokeTokenDescription: "所有使用 {name} 的程序都将退出登录。",
@@ -0,0 +1,13 @@
1
+ import { CopyCodeBlock as e } from "@parallelworks/ui";
2
+ import { useTranslations as t } from "use-intl";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ // src/components/InlineCommand.tsx
5
+ function r({ children: r }) {
6
+ let i = t("account");
7
+ return /* @__PURE__ */ n(e, {
8
+ inline: !0,
9
+ text: [r].flat().join(""),
10
+ label: i("command")
11
+ });
12
+ }
13
+ export { r as InlineCommand };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.175.1",
3
+ "version": "0.175.2",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -1,17 +1,18 @@
1
1
  import { api as e, unwrap as t } from "../../../api/client.js";
2
2
  import { runnersQuery as n } from "../../../api/queries.js";
3
3
  import { ComputeTargets as r } from "../../../components/ComputeTargets.js";
4
- import { WorkerIcon as i } from "../../../components/icons.js";
5
- import { SettingsPage as a } from "../../../components/settings.js";
6
- import { useConfirm as o } from "../../../lib/confirm.js";
7
- import { copyItem as s } from "../../../lib/menus.js";
8
- import { useTime as c } from "../../../lib/time.js";
9
- import { Route as l } from "./runners.js";
10
- import { Callout as u, StatusDot as d, Table as f, menuDivider as p, useOpenMenu as m } from "@parallelworks/ui";
11
- import { useMemo as h } from "react";
12
- import { useFormatter as g, useTranslations as _ } from "use-intl";
13
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
- import { useMutation as b, useQueryClient as x, useSuspenseQuery as S } from "@tanstack/react-query";
4
+ import { InlineCommand as i } from "../../../components/InlineCommand.js";
5
+ import { WorkerIcon as a } from "../../../components/icons.js";
6
+ import { SettingsPage as o } from "../../../components/settings.js";
7
+ import { useConfirm as s } from "../../../lib/confirm.js";
8
+ import { copyItem as c } from "../../../lib/menus.js";
9
+ import { useTime as l } from "../../../lib/time.js";
10
+ import { Route as u } from "./runners.js";
11
+ import { Callout as d, StatusDot as f, Table as p, menuDivider as m, useOpenMenu as h } from "@parallelworks/ui";
12
+ import { useMemo as g } from "react";
13
+ import { useFormatter as _, useTranslations as v } from "use-intl";
14
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
15
+ import { useMutation as x, useQueryClient as ee, useSuspenseQuery as S } from "@tanstack/react-query";
15
16
  import { ListCellText as C, ListColumns as w, ListPage as T, ListRow as E, ListToolbar as D, NameCell as O, listTableProps as k, useListNavigate as A, useListSearch as j, useListView as M } from "@parallelworks/ui/list";
16
17
  // src/routes/$workspace/settings/runners.tsx?tsr-split=component
17
18
  var N = {
@@ -21,22 +22,22 @@ var N = {
21
22
  bypass: "runnerModeBypass"
22
23
  };
23
24
  function P() {
24
- let { workspace: e } = l.useParams();
25
- return /* @__PURE__ */ v(F, { workspace: e });
25
+ let { workspace: e } = u.useParams();
26
+ return /* @__PURE__ */ y(F, { workspace: e });
26
27
  }
27
- function F({ workspace: l }) {
28
- let { data: P } = S(n(l)), F = _("account"), I = g(), L = _("common"), R = c(), z = x(), B = j(), V = A(), H = m(), U = b({
28
+ function F({ workspace: u }) {
29
+ let { data: P } = S(n(u)), F = v("account"), I = _(), L = v("common"), R = l(), z = ee(), B = j(), V = A(), H = h(), U = x({
29
30
  mutationFn: async (n) => t(await e.DELETE("/api/v1/workspaces/{workspace}/runners/{runnerId}", { params: { path: {
30
- workspace: l,
31
+ workspace: u,
31
32
  runnerId: n
32
33
  } } })),
33
- onSettled: () => z.invalidateQueries({ queryKey: n(l).queryKey })
34
- }), { confirm: W, dialog: G } = o(), K = (e) => W({
34
+ onSettled: () => z.invalidateQueries({ queryKey: n(u).queryKey })
35
+ }), { confirm: W, dialog: G } = s(), K = (e) => W({
35
36
  title: F("revokeRunnerTitle"),
36
37
  description: F("revokeRunnerDescription", { name: e.name }),
37
38
  confirmLabel: F("revoke"),
38
39
  onConfirm: () => U.mutateAsync(e.id)
39
- }), q = h(() => [{
40
+ }), q = g(() => [{
40
41
  key: "name",
41
42
  label: L("name"),
42
43
  headerClassName: "py-2",
@@ -46,7 +47,7 @@ function F({ workspace: l }) {
46
47
  label: F("runnerColSeen"),
47
48
  headerClassName: "py-2 w-40",
48
49
  align: "end"
49
- }], [F, L]), J = h(() => [{
50
+ }], [F, L]), J = g(() => [{
50
51
  value: "name",
51
52
  label: L("name"),
52
53
  compare: (e, t) => e.name.localeCompare(t.name)
@@ -55,7 +56,7 @@ function F({ workspace: l }) {
55
56
  label: F("runnerColSeen"),
56
57
  compare: (e, t) => (t.lastSeenAt ?? "").localeCompare(e.lastSeenAt ?? "")
57
58
  }], [F, L]), Y = M({
58
- storageKey: `tandem-runners-${l}`,
59
+ storageKey: `tandem-runners-${u}`,
59
60
  defaultShowColumnHeaders: !1,
60
61
  columns: q,
61
62
  orderBys: J,
@@ -67,21 +68,18 @@ function F({ workspace: l }) {
67
68
  ...e.harnesses,
68
69
  ...e.labels
69
70
  ].some((e) => e.toLowerCase().includes(X))), Q = P.filter((e) => e.sharingRefused), $ = P.filter((e) => e.sharingUnchecked);
70
- return /* @__PURE__ */ y(a, {
71
+ return /* @__PURE__ */ b(o, {
71
72
  wide: !0,
72
73
  title: F("runners"),
73
- description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */ v("code", {
74
- className: "rounded bg-muted px-1 py-0.5 text-xs",
75
- children: e
76
- }) }),
77
- toolbar: P.length > 0 && /* @__PURE__ */ v(D, {
74
+ description: F.rich("runnersDescription", { code: (e) => /* @__PURE__ */ y(i, { children: e }) }),
75
+ toolbar: P.length > 0 && /* @__PURE__ */ y(D, {
78
76
  view: Y,
79
77
  search: B,
80
78
  searchLabel: F("runnerSearch"),
81
79
  searchPlaceholder: F("runnerSearch")
82
80
  }),
83
81
  children: [
84
- Q.length > 0 && /* @__PURE__ */ v(u, {
82
+ Q.length > 0 && /* @__PURE__ */ y(d, {
85
83
  tone: "warning",
86
84
  className: "mb-6",
87
85
  children: F("runnerSharingRefused", {
@@ -89,7 +87,7 @@ function F({ workspace: l }) {
89
87
  names: I.list(Q.map((e) => e.name), { type: "conjunction" })
90
88
  })
91
89
  }),
92
- $.length > 0 && /* @__PURE__ */ v(u, {
90
+ $.length > 0 && /* @__PURE__ */ y(d, {
93
91
  tone: "muted",
94
92
  className: "mb-6",
95
93
  children: F("runnerSharingUnchecked", {
@@ -97,9 +95,9 @@ function F({ workspace: l }) {
97
95
  names: I.list($.map((e) => e.name), { type: "conjunction" })
98
96
  })
99
97
  }),
100
- /* @__PURE__ */ v("div", {
98
+ /* @__PURE__ */ y("div", {
101
99
  className: "border-t border-border",
102
- children: /* @__PURE__ */ v(T, {
100
+ children: /* @__PURE__ */ y(T, {
103
101
  view: Y,
104
102
  total: P.length,
105
103
  matches: Z.length,
@@ -109,28 +107,28 @@ function F({ workspace: l }) {
109
107
  nounPlural: F("runnerNounPlural")
110
108
  },
111
109
  empty: {
112
- icon: /* @__PURE__ */ v(i, {}),
110
+ icon: /* @__PURE__ */ y(a, {}),
113
111
  title: F("noRunners")
114
112
  },
115
113
  noMatches: F("runnerNoMatches"),
116
- children: /* @__PURE__ */ y(f, {
114
+ children: /* @__PURE__ */ b(p, {
117
115
  ...k,
118
- children: [/* @__PURE__ */ v(w, { view: Y }), Y.applyOrder(Z).map((e) => /* @__PURE__ */ y(E, {
116
+ children: [/* @__PURE__ */ y(w, { view: Y }), Y.applyOrder(Z).map((e) => /* @__PURE__ */ b(E, {
119
117
  href: null,
120
118
  goTo: V,
121
119
  openMenu: H,
122
120
  items: [
123
- s(F("copyRunnerId"), e.id),
124
- s(L("copyName"), e.name),
125
- p,
121
+ c(F("copyRunnerId"), e.id),
122
+ c(L("copyName"), e.name),
123
+ m,
126
124
  {
127
125
  label: F("revoke"),
128
126
  destructive: !0,
129
127
  onClick: () => K(e)
130
128
  }
131
129
  ],
132
- children: [/* @__PURE__ */ v(O, {
133
- icon: /* @__PURE__ */ v(i, {}),
130
+ children: [/* @__PURE__ */ y(O, {
131
+ icon: /* @__PURE__ */ y(a, {}),
134
132
  iconTile: !0,
135
133
  name: e.name,
136
134
  subtitle: I.list([
@@ -142,12 +140,12 @@ function F({ workspace: l }) {
142
140
  ...e.labels
143
141
  ], { type: "unit" }),
144
142
  href: null
145
- }), Y.isVisible("seen") && /* @__PURE__ */ y(f.Item, {
143
+ }), Y.isVisible("seen") && /* @__PURE__ */ b(p.Item, {
146
144
  className: "py-2.5",
147
- children: [/* @__PURE__ */ v(C, { children: e.lastSeenAt ? F("runnerSeen", { seen: R.relative(e.lastSeenAt) }) : F("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ y("span", {
145
+ children: [/* @__PURE__ */ y(C, { children: e.lastSeenAt ? F("runnerSeen", { seen: R.relative(e.lastSeenAt) }) : F("runnerNeverConnected") }), e.isolation && /* @__PURE__ */ b("span", {
148
146
  className: "flex items-center justify-end gap-1.5 text-xs text-muted-foreground",
149
147
  title: e.isolation.failures.join("\n") || void 0,
150
- children: [/* @__PURE__ */ v(d, {
148
+ children: [/* @__PURE__ */ y(f, {
151
149
  variant: e.isolation.passed ? "success" : "error",
152
150
  size: 8
153
151
  }), e.isolation.passed ? F("runnerIsolated") : F("runnerNotIsolated", { count: e.isolation.failures.length })]
@@ -157,7 +155,7 @@ function F({ workspace: l }) {
157
155
  })
158
156
  })
159
157
  }),
160
- /* @__PURE__ */ v(r, { workspace: l }),
158
+ /* @__PURE__ */ y(r, { workspace: u }),
161
159
  G
162
160
  ]
163
161
  });
@@ -1,160 +1,158 @@
1
1
  import { api as e, unwrap as t } from "../../../api/client.js";
2
2
  import { tokensQuery as n } from "../../../api/queries.js";
3
- import { KeyIcon as r } from "../../../components/icons.js";
4
- import { OneTimeSecret as i } from "../../../components/OneTimeSecret.js";
5
- import { SettingsPage as a, useFormError as o } from "../../../components/settings.js";
6
- import { useConfirm as s } from "../../../lib/confirm.js";
7
- import { copyItem as c } from "../../../lib/menus.js";
8
- import { useTime as l } from "../../../lib/time.js";
9
- import { Route as u } from "./tokens.js";
10
- import { Button as d, ErrorText as f, Input as p, Modal as m, ModalTitle as h, PageHeaderAddButton as g, Select as _, Table as v, menuDivider as y, useOpenMenu as b } from "@parallelworks/ui";
11
- import { useMemo as x, useState as S } from "react";
12
- import { useTranslations as C } from "use-intl";
13
- import { jsx as w, jsxs as T } from "react/jsx-runtime";
14
- import { useMutation as E, useQueryClient as D, useSuspenseQuery as O } from "@tanstack/react-query";
15
- import { ListCellText as k, ListColumns as A, ListPage as j, ListRow as M, ListToolbar as N, NameCell as P, listTableProps as F, useListNavigate as I, useListSearch as L, useListView as R } from "@parallelworks/ui/list";
3
+ import { InlineCommand as r } from "../../../components/InlineCommand.js";
4
+ import { KeyIcon as i } from "../../../components/icons.js";
5
+ import { OneTimeSecret as a } from "../../../components/OneTimeSecret.js";
6
+ import { SettingsPage as o, useFormError as s } from "../../../components/settings.js";
7
+ import { useConfirm as c } from "../../../lib/confirm.js";
8
+ import { copyItem as l } from "../../../lib/menus.js";
9
+ import { useTime as u } from "../../../lib/time.js";
10
+ import { Route as d } from "./tokens.js";
11
+ import { Button as f, ErrorText as p, Input as m, Modal as h, ModalTitle as g, PageHeaderAddButton as _, Select as v, Table as y, menuDivider as b, useOpenMenu as x } from "@parallelworks/ui";
12
+ import { useMemo as S, useState as C } from "react";
13
+ import { useTranslations as w } from "use-intl";
14
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
15
+ import { useMutation as D, useQueryClient as O, useSuspenseQuery as k } from "@tanstack/react-query";
16
+ import { ListCellText as A, ListColumns as j, ListPage as M, ListRow as N, ListToolbar as P, NameCell as F, listTableProps as I, useListNavigate as L, useListSearch as R, useListView as z } from "@parallelworks/ui/list";
16
17
  // src/routes/$workspace/settings/tokens.tsx?tsr-split=component
17
- function z() {
18
- let { workspace: o } = u.useParams(), { data: d } = O(n), f = C("account"), p = C("common"), m = l(), h = D(), _ = L(), z = I(), V = b(), [H, U] = S(!1), [W, G] = S(null), K = E({
18
+ function B() {
19
+ let { workspace: s } = d.useParams(), { data: f } = k(n), p = w("account"), m = w("common"), h = u(), g = O(), v = R(), B = L(), H = x(), [U, W] = C(!1), [G, K] = C(null), q = D({
19
20
  mutationFn: async (n) => t(await e.DELETE("/api/v1/me/tokens/{tokenId}", { params: { path: { tokenId: n } } })),
20
- onSettled: () => h.invalidateQueries({ queryKey: n.queryKey })
21
- }), { confirm: q, dialog: J } = s(), Y = (e) => q({
22
- title: f("revokeTokenTitle"),
23
- description: f("revokeTokenDescription", { name: e.name }),
24
- confirmLabel: f("revoke"),
25
- onConfirm: () => K.mutateAsync(e.id)
26
- }), X = x(() => [
21
+ onSettled: () => g.invalidateQueries({ queryKey: n.queryKey })
22
+ }), { confirm: J, dialog: Y } = c(), X = (e) => J({
23
+ title: p("revokeTokenTitle"),
24
+ description: p("revokeTokenDescription", { name: e.name }),
25
+ confirmLabel: p("revoke"),
26
+ onConfirm: () => q.mutateAsync(e.id)
27
+ }), ee = S(() => [
27
28
  {
28
29
  key: "name",
29
- label: p("name"),
30
+ label: m("name"),
30
31
  headerClassName: "py-2",
31
32
  alwaysVisible: !0
32
33
  },
33
34
  {
34
35
  key: "access",
35
- label: f("tokenAccess"),
36
+ label: p("tokenAccess"),
36
37
  headerClassName: "py-2 w-56"
37
38
  },
38
39
  {
39
40
  key: "used",
40
- label: f("tokenColUsed"),
41
+ label: p("tokenColUsed"),
41
42
  headerClassName: "py-2 w-40",
42
43
  align: "end"
43
44
  }
44
- ], [f, p]), ee = x(() => [{
45
+ ], [p, m]), te = S(() => [{
45
46
  value: "name",
46
- label: p("name"),
47
+ label: m("name"),
47
48
  compare: (e, t) => e.name.localeCompare(t.name)
48
49
  }, {
49
50
  value: "used",
50
- label: f("tokenColUsed"),
51
+ label: p("tokenColUsed"),
51
52
  compare: (e, t) => (t.lastUsedAt ?? "").localeCompare(e.lastUsedAt ?? "")
52
- }], [f, p]), Z = R({
53
+ }], [p, m]), Z = z({
53
54
  storageKey: "tandem-tokens",
54
55
  defaultShowColumnHeaders: !1,
55
- columns: X,
56
- orderBys: ee,
56
+ columns: ee,
57
+ orderBys: te,
57
58
  defaultOrderBy: "name",
58
59
  facets: []
59
- }), Q = _.filter.trim().toLowerCase(), $ = d.filter((e) => !Q || e.name.toLowerCase().includes(Q));
60
- return /* @__PURE__ */ T(a, {
60
+ }), Q = v.filter.trim().toLowerCase(), $ = f.filter((e) => !Q || e.name.toLowerCase().includes(Q));
61
+ return /* @__PURE__ */ E(o, {
61
62
  wide: !0,
62
- title: f("tokens"),
63
- description: f.rich("tokensDescription", { code: (e) => /* @__PURE__ */ w("code", {
64
- className: "rounded bg-muted px-1 py-0.5 text-xs",
65
- children: e
66
- }) }),
67
- actions: /* @__PURE__ */ w(g, {
68
- label: f("newToken"),
63
+ title: p("tokens"),
64
+ description: p.rich("tokensDescription", { code: (e) => /* @__PURE__ */ T(r, { children: e }) }),
65
+ actions: /* @__PURE__ */ T(_, {
66
+ label: p("newToken"),
69
67
  word: "create",
70
- onClick: () => U(!0)
68
+ onClick: () => W(!0)
71
69
  }),
72
- toolbar: d.length > 0 && /* @__PURE__ */ w(N, {
70
+ toolbar: f.length > 0 && /* @__PURE__ */ T(P, {
73
71
  view: Z,
74
- search: _,
75
- searchLabel: f("tokenSearch"),
76
- searchPlaceholder: f("tokenSearch")
72
+ search: v,
73
+ searchLabel: p("tokenSearch"),
74
+ searchPlaceholder: p("tokenSearch")
77
75
  }),
78
76
  children: [
79
- W && /* @__PURE__ */ w("div", {
77
+ G && /* @__PURE__ */ T("div", {
80
78
  className: "px-4 pb-4",
81
- children: /* @__PURE__ */ w(i, {
82
- title: f("tokenCreated", { name: W.name }),
83
- secret: W.secret,
84
- onDismiss: () => G(null)
79
+ children: /* @__PURE__ */ T(a, {
80
+ title: p("tokenCreated", { name: G.name }),
81
+ secret: G.secret,
82
+ onDismiss: () => K(null)
85
83
  })
86
84
  }),
87
- /* @__PURE__ */ w("div", {
85
+ /* @__PURE__ */ T("div", {
88
86
  className: "border-t border-border",
89
- children: /* @__PURE__ */ w(j, {
87
+ children: /* @__PURE__ */ T(M, {
90
88
  view: Z,
91
- total: d.length,
89
+ total: f.length,
92
90
  matches: $.length,
93
91
  count: {
94
- filterActive: _.filter.trim() !== "",
95
- noun: f("tokenNoun"),
96
- nounPlural: f("tokenNounPlural")
92
+ filterActive: v.filter.trim() !== "",
93
+ noun: p("tokenNoun"),
94
+ nounPlural: p("tokenNounPlural")
97
95
  },
98
96
  empty: {
99
- icon: /* @__PURE__ */ w(r, {}),
100
- title: f("noTokens")
97
+ icon: /* @__PURE__ */ T(i, {}),
98
+ title: p("noTokens")
101
99
  },
102
- noMatches: f("tokenNoMatches"),
103
- children: /* @__PURE__ */ T(v, {
104
- ...F,
105
- children: [/* @__PURE__ */ w(A, { view: Z }), Z.applyOrder($).map((e) => /* @__PURE__ */ T(M, {
100
+ noMatches: p("tokenNoMatches"),
101
+ children: /* @__PURE__ */ E(y, {
102
+ ...I,
103
+ children: [/* @__PURE__ */ T(j, { view: Z }), Z.applyOrder($).map((e) => /* @__PURE__ */ E(N, {
106
104
  href: null,
107
- goTo: z,
108
- openMenu: V,
105
+ goTo: B,
106
+ openMenu: H,
109
107
  items: [
110
- c(p("copyName"), e.name),
111
- y,
108
+ l(m("copyName"), e.name),
109
+ b,
112
110
  {
113
- label: f("revoke"),
111
+ label: p("revoke"),
114
112
  destructive: !0,
115
- onClick: () => Y(e)
113
+ onClick: () => X(e)
116
114
  }
117
115
  ],
118
116
  children: [
119
- /* @__PURE__ */ w(P, {
120
- icon: /* @__PURE__ */ w(r, {}),
117
+ /* @__PURE__ */ T(F, {
118
+ icon: /* @__PURE__ */ T(i, {}),
121
119
  iconTile: !0,
122
120
  name: e.name,
123
- subtitle: f("tokenCreatedAgo", { created: m.relative(e.createdAt) }),
121
+ subtitle: p("tokenCreatedAgo", { created: h.relative(e.createdAt) }),
124
122
  href: null
125
123
  }),
126
- Z.isVisible("access") && /* @__PURE__ */ w(v.Item, {
124
+ Z.isVisible("access") && /* @__PURE__ */ T(y.Item, {
127
125
  className: "py-2.5",
128
- children: /* @__PURE__ */ T(k, { children: [
129
- e.readOnly ? f("readOnly") : f("readWrite"),
126
+ children: /* @__PURE__ */ E(A, { children: [
127
+ e.readOnly ? p("readOnly") : p("readWrite"),
130
128
  " · ",
131
- e.workspace || f("allWorkspaces")
129
+ e.workspace || p("allWorkspaces")
132
130
  ] })
133
131
  }),
134
- Z.isVisible("used") && /* @__PURE__ */ w(v.Item, {
132
+ Z.isVisible("used") && /* @__PURE__ */ T(y.Item, {
135
133
  className: "py-2.5",
136
- children: /* @__PURE__ */ w(k, { children: e.lastUsedAt ? m.relative(e.lastUsedAt) : f("tokenNotUsed") })
134
+ children: /* @__PURE__ */ T(A, { children: e.lastUsedAt ? h.relative(e.lastUsedAt) : p("tokenNotUsed") })
137
135
  })
138
136
  ]
139
137
  }, e.id))]
140
138
  })
141
139
  })
142
140
  }),
143
- J,
144
- H && /* @__PURE__ */ w(B, {
145
- workspace: o,
141
+ Y,
142
+ U && /* @__PURE__ */ T(V, {
143
+ workspace: s,
146
144
  onCreated: (e) => {
147
- U(!1), G(e);
145
+ W(!1), K(e);
148
146
  },
149
- onClose: () => U(!1)
147
+ onClose: () => W(!1)
150
148
  })
151
149
  ]
152
150
  });
153
151
  }
154
- function B({ workspace: r, onCreated: i, onClose: a }) {
155
- let s = C("account"), c = C("common"), l = D(), u = o(), [g, v] = S(""), [y, b] = S("read"), [x, O] = S("one"), [k, A] = S("90"), j = E({
152
+ function V({ workspace: r, onCreated: i, onClose: a }) {
153
+ let o = w("account"), c = w("common"), l = O(), u = s(), [d, _] = C(""), [y, b] = C("read"), [x, S] = C("one"), [k, A] = C("90"), j = D({
156
154
  mutationFn: async () => t(await e.POST("/api/v1/me/tokens", { body: {
157
- name: g,
155
+ name: d,
158
156
  readOnly: y === "read",
159
157
  ...x === "one" && { workspace: r },
160
158
  ...k !== "0" && { expiresInDays: Number(k) }
@@ -167,104 +165,104 @@ function B({ workspace: r, onCreated: i, onClose: a }) {
167
165
  onSettled: () => l.invalidateQueries({ queryKey: n.queryKey }),
168
166
  onError: u.set
169
167
  });
170
- return /* @__PURE__ */ w(m, {
168
+ return /* @__PURE__ */ T(h, {
171
169
  open: !0,
172
170
  onClose: a,
173
171
  className: "w-full max-w-md p-5",
174
- children: /* @__PURE__ */ T("form", {
172
+ children: /* @__PURE__ */ E("form", {
175
173
  onSubmit: (e) => {
176
174
  e.preventDefault(), j.mutate();
177
175
  },
178
176
  children: [
179
- /* @__PURE__ */ w(h, {
177
+ /* @__PURE__ */ T(g, {
180
178
  className: "text-sm font-semibold",
181
- children: s("newToken")
179
+ children: o("newToken")
182
180
  }),
183
- /* @__PURE__ */ w(p, {
181
+ /* @__PURE__ */ T(m, {
184
182
  required: !0,
185
183
  autoFocus: !0,
186
- value: g,
187
- onChange: (e) => v(e.target.value),
188
- placeholder: s("tokenNamePlaceholder"),
189
- "aria-label": s("tokenName"),
184
+ value: d,
185
+ onChange: (e) => _(e.target.value),
186
+ placeholder: o("tokenNamePlaceholder"),
187
+ "aria-label": o("tokenName"),
190
188
  className: "mt-4 w-full"
191
189
  }),
192
- /* @__PURE__ */ T("div", {
190
+ /* @__PURE__ */ E("div", {
193
191
  className: "mt-3 flex flex-wrap gap-2",
194
192
  children: [
195
- /* @__PURE__ */ w(_, {
193
+ /* @__PURE__ */ T(v, {
196
194
  value: y,
197
195
  onValueChange: b,
198
- "aria-label": s("tokenAccess"),
196
+ "aria-label": o("tokenAccess"),
199
197
  items: [{
200
198
  value: "read",
201
- label: s("readOnly")
199
+ label: o("readOnly")
202
200
  }, {
203
201
  value: "write",
204
- label: s("readWrite")
202
+ label: o("readWrite")
205
203
  }],
206
204
  width: "content"
207
205
  }),
208
- /* @__PURE__ */ w(_, {
206
+ /* @__PURE__ */ T(v, {
209
207
  value: x,
210
- onValueChange: O,
211
- "aria-label": s("tokenWorkspace"),
208
+ onValueChange: S,
209
+ "aria-label": o("tokenWorkspace"),
212
210
  items: [{
213
211
  value: "one",
214
- label: s("thisWorkspace", { workspace: r })
212
+ label: o("thisWorkspace", { workspace: r })
215
213
  }, {
216
214
  value: "all",
217
- label: s("allWorkspaces")
215
+ label: o("allWorkspaces")
218
216
  }],
219
217
  width: "content"
220
218
  }),
221
- /* @__PURE__ */ w(_, {
219
+ /* @__PURE__ */ T(v, {
222
220
  value: k,
223
221
  onValueChange: A,
224
- "aria-label": s("tokenExpiry"),
222
+ "aria-label": o("tokenExpiry"),
225
223
  items: [
226
224
  {
227
225
  value: "30",
228
- label: s("expiresIn", { days: 30 })
226
+ label: o("expiresIn", { days: 30 })
229
227
  },
230
228
  {
231
229
  value: "90",
232
- label: s("expiresIn", { days: 90 })
230
+ label: o("expiresIn", { days: 90 })
233
231
  },
234
232
  {
235
233
  value: "365",
236
- label: s("expiresIn", { days: 365 })
234
+ label: o("expiresIn", { days: 365 })
237
235
  },
238
236
  {
239
237
  value: "0",
240
- label: s("noExpiry")
238
+ label: o("noExpiry")
241
239
  }
242
240
  ],
243
241
  width: "content"
244
242
  })
245
243
  ]
246
244
  }),
247
- /* @__PURE__ */ w(f, {
245
+ /* @__PURE__ */ T(p, {
248
246
  size: "md",
249
247
  className: "mt-3",
250
248
  children: u.error
251
249
  }),
252
- /* @__PURE__ */ T("div", {
250
+ /* @__PURE__ */ E("div", {
253
251
  className: "mt-5 flex justify-end gap-2",
254
- children: [/* @__PURE__ */ w(d, {
252
+ children: [/* @__PURE__ */ T(f, {
255
253
  type: "button",
256
254
  onClick: a,
257
255
  children: c("cancel")
258
- }), /* @__PURE__ */ w(d, {
256
+ }), /* @__PURE__ */ T(f, {
259
257
  type: "submit",
260
258
  variant: "primary",
261
- disabled: !g.trim(),
259
+ disabled: !d.trim(),
262
260
  loading: j.isPending,
263
- children: s("createToken")
261
+ children: o("createToken")
264
262
  })]
265
263
  })
266
264
  ]
267
265
  })
268
266
  });
269
267
  }
270
- export { z as component };
268
+ export { B as component };