@burdenoff/fe-libs 2026.527.3 → 2026.527.4
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.
- package/dist/chrome/ContextSwitcher.js +90 -339
- package/dist/chrome/GlobalSearch.js +72 -456
- package/dist/chrome/NotificationCenter.js +69 -703
- package/dist/chrome/SideNavigation.js +73 -241
- package/dist/chrome/contextSwitcher/EmptyState.js +32 -0
- package/dist/chrome/contextSwitcher/OrganizationList.js +34 -0
- package/dist/chrome/contextSwitcher/ProjectList.js +34 -0
- package/dist/chrome/contextSwitcher/SearchInput.js +50 -0
- package/dist/chrome/contextSwitcher/TabButton.js +9 -0
- package/dist/chrome/contextSwitcher/TriggerButton.js +38 -0
- package/dist/chrome/contextSwitcher/WorkspaceList.js +34 -0
- package/dist/chrome/contextSwitcher/icons.js +58 -0
- package/dist/chrome/contextSwitcher/useIsMobile.js +11 -0
- package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +253 -0
- package/dist/chrome/globalSearch/CategoryTabs.js +28 -0
- package/dist/chrome/globalSearch/ResultsList.js +58 -0
- package/dist/chrome/globalSearch/SearchInput.js +28 -0
- package/dist/chrome/globalSearch/SearchModeBar.js +36 -0
- package/dist/chrome/globalSearch/useAdvancedFilters.js +78 -0
- package/dist/chrome/globalSearch/utils.js +22 -0
- package/dist/chrome/notificationCenter/BellButton.js +27 -0
- package/dist/chrome/notificationCenter/NotificationCardItem.js +129 -0
- package/dist/chrome/notificationCenter/NotificationFilters.js +67 -0
- package/dist/chrome/notificationCenter/NotificationFooter.js +23 -0
- package/dist/chrome/notificationCenter/NotificationHeader.js +75 -0
- package/dist/chrome/notificationCenter/NotificationList.js +75 -0
- package/dist/chrome/notificationCenter/NotificationPanel.js +19 -0
- package/dist/chrome/notificationCenter/SkeletonCard.js +18 -0
- package/dist/chrome/notificationCenter/constants.js +93 -0
- package/dist/chrome/notificationCenter/gql.js +58 -0
- package/dist/chrome/notificationCenter/useNotificationCenter.js +149 -0
- package/dist/chrome/notificationCenter/usePanelChrome.js +36 -0
- package/dist/chrome/sideNavigation/CollapseToggle.js +29 -0
- package/dist/chrome/sideNavigation/MobileActionsBar.js +25 -0
- package/dist/chrome/sideNavigation/NavItemRenderer.js +79 -0
- package/dist/chrome/sideNavigation/SidebarHeader.js +29 -0
- package/dist/chrome/sideNavigation/helpers.js +19 -0
- package/dist/chrome/sideNavigation/useSideNavigationState.js +45 -0
- package/dist/shared/components/ContextConversationWidget.js +173 -767
- package/dist/shared/components/contextConversationWidget/Composer.js +66 -0
- package/dist/shared/components/contextConversationWidget/MessageItem.js +124 -0
- package/dist/shared/components/contextConversationWidget/MessageList.js +32 -0
- package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +19 -0
- package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +28 -0
- package/dist/shared/components/contextConversationWidget/ReplyBanner.js +32 -0
- package/dist/shared/components/contextConversationWidget/WidgetHeader.js +70 -0
- package/dist/shared/components/contextConversationWidget/queries.js +197 -0
- package/dist/shared/components/contextConversationWidget/types.js +10 -0
- package/dist/shared/components/contextConversationWidget/useAttachmentUpload.js +57 -0
- package/dist/shared/components/contextConversationWidget/useConversationSubscriptions.js +26 -0
- package/dist/shared/components/contextConversationWidget/useMessageActions.js +34 -0
- package/dist/shared/components/contextConversationWidget/useSendMessage.js +45 -0
- package/dist/shared/components/contextConversationWidget/useWidgetMessages.js +44 -0
- package/dist/shared/components/contextConversationWidget/utils.js +56 -0
- package/dist/shared/pages/SearchPage.js +293 -1076
- package/dist/shared/pages/searchPage/ActiveFilterChips.js +176 -0
- package/dist/shared/pages/searchPage/FiltersPanel.js +329 -0
- package/dist/shared/pages/searchPage/ResultsList.js +119 -0
- package/dist/shared/pages/searchPage/ResultsStatus.js +32 -0
- package/dist/shared/pages/searchPage/SearchInput.js +31 -0
- package/dist/shared/pages/searchPage/SearchPagination.js +37 -0
- package/dist/shared/pages/searchPage/SearchToolbar.js +58 -0
- package/dist/shared/pages/searchPage/constants.js +155 -0
- package/dist/shared/pages/searchPage/utils.js +24 -0
- package/dist/shared/providers/shell/AuthProvider.js +130 -384
- package/dist/shared/providers/shell/authProvider/bridgeStateSync.js +34 -0
- package/dist/shared/providers/shell/authProvider/jwt.js +13 -0
- package/dist/shared/providers/shell/authProvider/ssoRelay.js +38 -0
- package/dist/shared/providers/shell/authProvider/useAuthActions.js +170 -0
- package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +86 -0
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +32 -0
- package/dist/shared/providers/shell/authProvider/useStorageSync.js +35 -0
- package/dist/shared/providers/shell/authProvider/useTokenExpiryTimer.js +37 -0
- package/dist/shared/tours/TourTrigger.js +86 -262
- package/dist/shared/tours/ToursContext.js +108 -398
- package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +48 -0
- package/dist/shared/tours/tourTrigger/MobileTourSheet.js +68 -0
- package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +36 -0
- package/dist/shared/tours/tourTrigger/TourListItemMobile.js +47 -0
- package/dist/shared/tours/tourTrigger/TourStatusChip.js +30 -0
- package/dist/shared/tours/tourTrigger/TourTriggerButton.js +22 -0
- package/dist/shared/tours/toursContext/errors.js +18 -0
- package/dist/shared/tours/toursContext/gql.js +152 -0
- package/dist/shared/tours/toursContext/route.js +20 -0
- package/dist/shared/tours/toursContext/session.js +19 -0
- package/dist/shared/tours/toursContext/useIdleReady.js +18 -0
- package/dist/shared/tours/toursContext/useTourMutations.js +118 -0
- package/dist/tag/TagsWidget.js +81 -226
- package/dist/tag/tagsWidget/AddTagTrigger.js +14 -0
- package/dist/tag/tagsWidget/TagBadgeList.js +17 -0
- package/dist/tag/tagsWidget/TagSearchPopover.js +80 -0
- package/dist/tag/tagsWidget/operations.js +64 -0
- package/dist/tag/tagsWidget/useVocabResolver.js +30 -0
- package/package.json +1 -1
package/dist/tag/TagsWidget.js
CHANGED
|
@@ -1,279 +1,134 @@
|
|
|
1
1
|
import { useGatewayClient as e } from "../shared/graphql/GatewayContext.js";
|
|
2
2
|
import { cn as t } from "../shared-utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { Popover as n, PopoverContent as r, PopoverTrigger as i } from "../ui/popover.js";
|
|
4
|
+
import { CREATE_TAG as a, NOTIFY_TAG_ASSIGNED as ee, NOTIFY_TAG_REMOVED as o, SEARCH_TAGS as s } from "./tagsWidget/operations.js";
|
|
5
|
+
import { useVocabResolver as c } from "./tagsWidget/useVocabResolver.js";
|
|
6
|
+
import { TagBadgeList as l } from "./tagsWidget/TagBadgeList.js";
|
|
7
|
+
import { AddTagTrigger as te } from "./tagsWidget/AddTagTrigger.js";
|
|
8
|
+
import { TagSearchPopover as u } from "./tagsWidget/TagSearchPopover.js";
|
|
9
|
+
import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
11
|
import { useLazyQuery as _, useMutation as v } from "@apollo/client/react";
|
|
11
12
|
//#region src/tag/TagsWidget.tsx
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
key
|
|
17
|
-
label
|
|
18
|
-
value
|
|
19
|
-
vocabularyId
|
|
20
|
-
parentId
|
|
21
|
-
hierarchyPath
|
|
22
|
-
color
|
|
23
|
-
icon
|
|
24
|
-
description
|
|
25
|
-
vocabulary {
|
|
26
|
-
key
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`, ce = g`
|
|
31
|
-
query TagsWidget_GetVocabularyByKey($key: String!) {
|
|
32
|
-
getVocabularyByKey(key: $key) {
|
|
33
|
-
id
|
|
34
|
-
key
|
|
35
|
-
name
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
`, y = g`
|
|
39
|
-
mutation TagsWidget_CreateVocabulary($input: CreateVocabularyInput!) {
|
|
40
|
-
createVocabulary(input: $input) {
|
|
41
|
-
id
|
|
42
|
-
key
|
|
43
|
-
name
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`, le = g`
|
|
47
|
-
mutation TagsWidget_CreateTag($input: CreateTagInput!) {
|
|
48
|
-
createTag(input: $input) {
|
|
49
|
-
id
|
|
50
|
-
key
|
|
51
|
-
label
|
|
52
|
-
value
|
|
53
|
-
vocabularyId
|
|
54
|
-
parentId
|
|
55
|
-
hierarchyPath
|
|
56
|
-
color
|
|
57
|
-
icon
|
|
58
|
-
vocabulary {
|
|
59
|
-
key
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`, b = g`
|
|
64
|
-
mutation TagsWidget_NotifyTagAssigned($input: NotifyTagAssignedInput!) {
|
|
65
|
-
notifyTagAssigned(input: $input)
|
|
66
|
-
}
|
|
67
|
-
`, ue = g`
|
|
68
|
-
mutation TagsWidget_NotifyTagRemoved($key: String!, $entityType: String!, $entityId: ID!) {
|
|
69
|
-
notifyTagRemoved(key: $key, entityType: $entityType, entityId: $entityId)
|
|
70
|
-
}
|
|
71
|
-
`, x = "general";
|
|
72
|
-
function S({ entityType: g, entityId: S, workspaceId: de, tags: C, onAdd: w, onRemove: T, vocabularyId: fe, allowCreate: E = !0, syncGraphNotifications: D = !0, maxTags: O = 20, className: pe }) {
|
|
73
|
-
let [me, k] = c(!1), [A, j] = c(""), [M, N] = c(null), [P, F] = c(fe), I = oe(null), L = e("workspace"), R = !de || !S, he = new Set(C.map((e) => e.id)), z = C.length < O, [B, { data: ge, loading: V }] = _(se, { client: L }), H = (ge?.searchTags ?? []).filter((e) => !he.has(e.id)), [U] = _(ce, { client: L }), [W] = v(y, { client: L }), [G, { loading: K }] = v(le, { client: L }), [q, J] = c(!1), [Y] = v(b, { client: L }), [X] = v(ue, { client: L }), Z = s(async () => {
|
|
74
|
-
if (P) return P;
|
|
75
|
-
let e = (await U({ variables: { key: x } })).data?.getVocabularyByKey;
|
|
76
|
-
if (e) return F(e.id), e.id;
|
|
77
|
-
let t = (await W({ variables: { input: {
|
|
78
|
-
key: x,
|
|
79
|
-
name: "General",
|
|
80
|
-
description: "Default vocabulary for general-purpose tags",
|
|
81
|
-
scope: "WORKSPACE",
|
|
82
|
-
allowCustomTags: !0
|
|
83
|
-
} } })).data?.createVocabulary;
|
|
84
|
-
if (!t) throw Error("Failed to create default vocabulary");
|
|
85
|
-
return F(t.id), t.id;
|
|
86
|
-
}, [
|
|
87
|
-
P,
|
|
88
|
-
U,
|
|
89
|
-
W
|
|
90
|
-
]), _e = s((e) => {
|
|
91
|
-
j(e), M && N(null), I.current && clearTimeout(I.current), e.trim() && (I.current = setTimeout(() => {
|
|
92
|
-
B({ variables: {
|
|
13
|
+
function y({ entityType: y, entityId: b, workspaceId: x, tags: S, onAdd: C, onRemove: w, vocabularyId: T, allowCreate: E = !0, syncGraphNotifications: D = !0, maxTags: O = 20, className: k }) {
|
|
14
|
+
let [A, j] = m(!1), [M, N] = m(""), [P, F] = m(null), [I, L] = m(!1), R = p(null), z = e("workspace"), { resolvedVocabId: B, resolveVocabId: V } = c(z, T), H = !x || !b, U = new Set(S.map((e) => e.id)), W = S.length < O, [G, { data: K, loading: q }] = _(s, { client: z }), J = (K?.searchTags ?? []).filter((e) => !U.has(e.id)), [Y, { loading: X }] = v(a, { client: z }), [Z] = v(ee, { client: z }), [Q] = v(o, { client: z }), ne = d((e) => {
|
|
15
|
+
N(e), P && F(null), R.current && clearTimeout(R.current), e.trim() && (R.current = setTimeout(() => {
|
|
16
|
+
G({ variables: {
|
|
93
17
|
query: e,
|
|
94
|
-
vocabularyId:
|
|
18
|
+
vocabularyId: B,
|
|
95
19
|
limit: 10
|
|
96
20
|
} });
|
|
97
21
|
}, 250));
|
|
98
22
|
}, [
|
|
23
|
+
G,
|
|
99
24
|
B,
|
|
100
|
-
P
|
|
101
|
-
M
|
|
25
|
+
P
|
|
102
26
|
]);
|
|
103
|
-
|
|
104
|
-
|
|
27
|
+
f(() => () => {
|
|
28
|
+
R.current && clearTimeout(R.current);
|
|
105
29
|
}, []);
|
|
106
|
-
let
|
|
107
|
-
if (!(!
|
|
108
|
-
|
|
30
|
+
let $ = d(async (e) => {
|
|
31
|
+
if (!(!W || I)) {
|
|
32
|
+
L(!0);
|
|
109
33
|
try {
|
|
110
|
-
await
|
|
34
|
+
await C({
|
|
111
35
|
...e,
|
|
112
36
|
vocabularyKey: e.vocabularyKey ?? e.vocabulary?.key ?? null
|
|
113
|
-
}),
|
|
37
|
+
}), N(""), j(!1), D && Z({ variables: { input: {
|
|
114
38
|
key: e.key,
|
|
115
|
-
entityType:
|
|
116
|
-
entityId:
|
|
39
|
+
entityType: y,
|
|
40
|
+
entityId: b,
|
|
117
41
|
source: "MANUAL"
|
|
118
42
|
} } });
|
|
119
43
|
} finally {
|
|
120
|
-
|
|
44
|
+
L(!1);
|
|
121
45
|
}
|
|
122
46
|
}
|
|
123
47
|
}, [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
48
|
+
Z,
|
|
49
|
+
C,
|
|
50
|
+
y,
|
|
51
|
+
b,
|
|
52
|
+
W,
|
|
53
|
+
I,
|
|
130
54
|
D
|
|
131
|
-
]),
|
|
132
|
-
if (!(!E || !
|
|
133
|
-
|
|
55
|
+
]), re = d(async () => {
|
|
56
|
+
if (!(!E || !M.trim() || X)) {
|
|
57
|
+
F(null);
|
|
134
58
|
try {
|
|
135
|
-
let e =
|
|
59
|
+
let e = M.trim(), t = e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
136
60
|
if (!t) {
|
|
137
|
-
|
|
61
|
+
F("Must contain at least one letter or number");
|
|
138
62
|
return;
|
|
139
63
|
}
|
|
140
|
-
let n = (await
|
|
64
|
+
let n = (await Y({ variables: { input: {
|
|
141
65
|
key: t,
|
|
142
66
|
label: e,
|
|
143
|
-
vocabularyId: await
|
|
67
|
+
vocabularyId: await V()
|
|
144
68
|
} } })).data?.createTag;
|
|
145
69
|
if (!n) throw Error("No data returned");
|
|
146
|
-
await
|
|
70
|
+
await $(n);
|
|
147
71
|
} catch (e) {
|
|
148
|
-
|
|
72
|
+
F(e instanceof Error ? e.message : "Failed to create tag");
|
|
149
73
|
}
|
|
150
74
|
}
|
|
151
75
|
}, [
|
|
152
76
|
E,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
]),
|
|
159
|
-
let t =
|
|
160
|
-
await
|
|
77
|
+
M,
|
|
78
|
+
X,
|
|
79
|
+
V,
|
|
80
|
+
Y,
|
|
81
|
+
$
|
|
82
|
+
]), ie = d(async (e) => {
|
|
83
|
+
let t = S.find((t) => t.id === e);
|
|
84
|
+
await w(e), t && D && Q({ variables: {
|
|
161
85
|
key: t.key,
|
|
162
|
-
entityType:
|
|
163
|
-
entityId:
|
|
86
|
+
entityType: y,
|
|
87
|
+
entityId: b
|
|
164
88
|
} });
|
|
165
89
|
}, [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
C,
|
|
169
|
-
g,
|
|
90
|
+
Q,
|
|
91
|
+
w,
|
|
170
92
|
S,
|
|
93
|
+
y,
|
|
94
|
+
b,
|
|
171
95
|
D
|
|
172
96
|
]);
|
|
173
|
-
if (
|
|
174
|
-
let
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
-
className: t("flex flex-wrap items-center gap-1.5",
|
|
177
|
-
children: [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
onRemove: () => void ye(e.id),
|
|
185
|
-
size: "sm"
|
|
186
|
-
}, e.id)), z && /* @__PURE__ */ h(te, {
|
|
187
|
-
open: me,
|
|
188
|
-
onOpenChange: k,
|
|
189
|
-
children: [/* @__PURE__ */ m(re, {
|
|
97
|
+
if (H) return null;
|
|
98
|
+
let ae = !!(E && M.trim() && !q && J.length === 0);
|
|
99
|
+
return /* @__PURE__ */ g("div", {
|
|
100
|
+
className: t("flex flex-wrap items-center gap-1.5", k),
|
|
101
|
+
children: [/* @__PURE__ */ h(l, {
|
|
102
|
+
tags: S,
|
|
103
|
+
onRemove: (e) => void ie(e)
|
|
104
|
+
}), W && /* @__PURE__ */ g(n, {
|
|
105
|
+
open: A,
|
|
106
|
+
onOpenChange: j,
|
|
107
|
+
children: [/* @__PURE__ */ h(i, {
|
|
190
108
|
asChild: !0,
|
|
191
|
-
children: /* @__PURE__ */ h(
|
|
192
|
-
|
|
193
|
-
"aria-label": "Add tag",
|
|
194
|
-
className: t("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border border-dashed", "border-border text-muted-foreground text-xs", "hover:border-foreground hover:text-foreground transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
|
|
195
|
-
children: [/* @__PURE__ */ m(f, { className: "size-3" }), /* @__PURE__ */ m("span", { children: C.length === 0 ? "Add tags" : "Add" })]
|
|
196
|
-
})
|
|
197
|
-
}), /* @__PURE__ */ m(ne, {
|
|
109
|
+
children: /* @__PURE__ */ h(te, { hasTags: S.length > 0 })
|
|
110
|
+
}), /* @__PURE__ */ h(r, {
|
|
198
111
|
className: "w-64 p-0",
|
|
199
112
|
align: "start",
|
|
200
113
|
side: "bottom",
|
|
201
114
|
sideOffset: 4,
|
|
202
|
-
children: /* @__PURE__ */ h(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
V && /* @__PURE__ */ m(l, { className: "size-3.5 shrink-0 animate-spin text-muted-foreground" })
|
|
216
|
-
]
|
|
217
|
-
}),
|
|
218
|
-
/* @__PURE__ */ h(ee, {
|
|
219
|
-
className: "max-h-48 overflow-y-auto",
|
|
220
|
-
children: [
|
|
221
|
-
A.trim() === "" && /* @__PURE__ */ m(r, {
|
|
222
|
-
className: "py-4 text-center text-xs text-muted-foreground",
|
|
223
|
-
children: "Type to search or create a tag"
|
|
224
|
-
}),
|
|
225
|
-
H.length > 0 && /* @__PURE__ */ m(i, { children: H.map((e) => /* @__PURE__ */ h(o, {
|
|
226
|
-
value: e.id,
|
|
227
|
-
onSelect: () => void Q(e),
|
|
228
|
-
className: "flex items-center gap-2 px-3 py-2 cursor-pointer",
|
|
229
|
-
disabled: q,
|
|
230
|
-
children: [
|
|
231
|
-
e.icon && /* @__PURE__ */ m("span", {
|
|
232
|
-
className: "text-sm",
|
|
233
|
-
children: e.icon
|
|
234
|
-
}),
|
|
235
|
-
/* @__PURE__ */ m("span", {
|
|
236
|
-
className: "truncate text-sm",
|
|
237
|
-
style: e.color ? { color: e.color } : void 0,
|
|
238
|
-
children: e.label
|
|
239
|
-
}),
|
|
240
|
-
q && /* @__PURE__ */ m(l, { className: "ml-auto size-3 animate-spin" })
|
|
241
|
-
]
|
|
242
|
-
}, e.id)) }),
|
|
243
|
-
$ && /* @__PURE__ */ m(i, { children: /* @__PURE__ */ h(o, {
|
|
244
|
-
value: `__create__${A}`,
|
|
245
|
-
onSelect: () => void ve(),
|
|
246
|
-
className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-primary",
|
|
247
|
-
disabled: K,
|
|
248
|
-
children: [K ? /* @__PURE__ */ m(l, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ m(u, { className: "size-3.5" }), /* @__PURE__ */ m("span", {
|
|
249
|
-
className: "text-sm truncate",
|
|
250
|
-
children: K ? "Creating..." : `Create "${A}"`
|
|
251
|
-
})]
|
|
252
|
-
}) }),
|
|
253
|
-
A.trim() !== "" && !V && H.length === 0 && !$ && /* @__PURE__ */ m(r, {
|
|
254
|
-
className: "py-4 text-center text-xs text-muted-foreground",
|
|
255
|
-
children: "No tags found"
|
|
256
|
-
}),
|
|
257
|
-
M && /* @__PURE__ */ m("div", {
|
|
258
|
-
className: "px-3 py-2 text-xs text-destructive border-t border-border",
|
|
259
|
-
children: M
|
|
260
|
-
})
|
|
261
|
-
]
|
|
262
|
-
}),
|
|
263
|
-
!z && /* @__PURE__ */ h("div", {
|
|
264
|
-
className: "border-t border-border px-3 py-2 text-xs text-muted-foreground flex items-center gap-1",
|
|
265
|
-
children: [
|
|
266
|
-
/* @__PURE__ */ m(p, { className: "size-3" }),
|
|
267
|
-
"Maximum ",
|
|
268
|
-
O,
|
|
269
|
-
" tags reached"
|
|
270
|
-
]
|
|
271
|
-
})
|
|
272
|
-
]
|
|
115
|
+
children: /* @__PURE__ */ h(u, {
|
|
116
|
+
search: M,
|
|
117
|
+
onSearchChange: ne,
|
|
118
|
+
searching: q,
|
|
119
|
+
searchResults: J,
|
|
120
|
+
adding: I,
|
|
121
|
+
creating: X,
|
|
122
|
+
showCreateOption: ae,
|
|
123
|
+
createError: P,
|
|
124
|
+
canAddMore: W,
|
|
125
|
+
maxTags: O,
|
|
126
|
+
onAssign: (e) => void $(e),
|
|
127
|
+
onCreate: () => void re()
|
|
273
128
|
})
|
|
274
129
|
})]
|
|
275
130
|
})]
|
|
276
131
|
});
|
|
277
132
|
}
|
|
278
133
|
//#endregion
|
|
279
|
-
export {
|
|
134
|
+
export { y as TagsWidget };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn as e } from "../../shared-utils.js";
|
|
2
|
+
import { Tag as t } from "lucide-react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/tag/tagsWidget/AddTagTrigger.tsx
|
|
5
|
+
function i({ hasTags: i }) {
|
|
6
|
+
return /* @__PURE__ */ r("button", {
|
|
7
|
+
type: "button",
|
|
8
|
+
"aria-label": "Add tag",
|
|
9
|
+
className: e("inline-flex items-center gap-1 px-2 py-0.5 rounded-full border border-dashed", "border-border text-muted-foreground text-xs", "hover:border-foreground hover:text-foreground transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
|
|
10
|
+
children: [/* @__PURE__ */ n(t, { className: "size-3" }), /* @__PURE__ */ n("span", { children: i ? "Add" : "Add tags" })]
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { i as AddTagTrigger };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TagBadge as e } from "../TagBadge.js";
|
|
2
|
+
import { Fragment as t, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/tag/tagsWidget/TagBadgeList.tsx
|
|
4
|
+
function r({ tags: r, onRemove: i }) {
|
|
5
|
+
return /* @__PURE__ */ n(t, { children: r.map((t) => /* @__PURE__ */ n(e, {
|
|
6
|
+
id: t.id,
|
|
7
|
+
label: t.label,
|
|
8
|
+
color: t.color ?? void 0,
|
|
9
|
+
icon: t.icon ?? void 0,
|
|
10
|
+
description: t.description ?? void 0,
|
|
11
|
+
removable: !0,
|
|
12
|
+
onRemove: () => i(t.id),
|
|
13
|
+
size: "sm"
|
|
14
|
+
}, t.id)) });
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as TagBadgeList };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Command as e, CommandEmpty as t, CommandGroup as n, CommandInput as r, CommandItem as i, CommandList as a } from "../../ui/command.js";
|
|
2
|
+
import { Loader2 as o, Plus as s, Search as c, X as l } from "lucide-react";
|
|
3
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
|
+
//#region src/tag/tagsWidget/TagSearchPopover.tsx
|
|
5
|
+
function f({ search: f, onSearchChange: p, searching: m, searchResults: h, adding: g, creating: _, showCreateOption: v, createError: y, canAddMore: b, maxTags: x, onAssign: S, onCreate: C }) {
|
|
6
|
+
return /* @__PURE__ */ d(e, {
|
|
7
|
+
shouldFilter: !1,
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ d("div", {
|
|
10
|
+
className: "flex items-center border-b border-border px-3",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ u(c, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
13
|
+
/* @__PURE__ */ u(r, {
|
|
14
|
+
placeholder: "Search or create a tag...",
|
|
15
|
+
value: f,
|
|
16
|
+
onValueChange: p,
|
|
17
|
+
className: "h-9 flex-1 border-0 bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground"
|
|
18
|
+
}),
|
|
19
|
+
m && /* @__PURE__ */ u(o, { className: "size-3.5 shrink-0 animate-spin text-muted-foreground" })
|
|
20
|
+
]
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ d(a, {
|
|
23
|
+
className: "max-h-48 overflow-y-auto",
|
|
24
|
+
children: [
|
|
25
|
+
f.trim() === "" && /* @__PURE__ */ u(t, {
|
|
26
|
+
className: "py-4 text-center text-xs text-muted-foreground",
|
|
27
|
+
children: "Type to search or create a tag"
|
|
28
|
+
}),
|
|
29
|
+
h.length > 0 && /* @__PURE__ */ u(n, { children: h.map((e) => /* @__PURE__ */ d(i, {
|
|
30
|
+
value: e.id,
|
|
31
|
+
onSelect: () => S(e),
|
|
32
|
+
className: "flex items-center gap-2 px-3 py-2 cursor-pointer",
|
|
33
|
+
disabled: g,
|
|
34
|
+
children: [
|
|
35
|
+
e.icon && /* @__PURE__ */ u("span", {
|
|
36
|
+
className: "text-sm",
|
|
37
|
+
children: e.icon
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ u("span", {
|
|
40
|
+
className: "truncate text-sm",
|
|
41
|
+
style: e.color ? { color: e.color } : void 0,
|
|
42
|
+
children: e.label
|
|
43
|
+
}),
|
|
44
|
+
g && /* @__PURE__ */ u(o, { className: "ml-auto size-3 animate-spin" })
|
|
45
|
+
]
|
|
46
|
+
}, e.id)) }),
|
|
47
|
+
v && /* @__PURE__ */ u(n, { children: /* @__PURE__ */ d(i, {
|
|
48
|
+
value: `__create__${f}`,
|
|
49
|
+
onSelect: C,
|
|
50
|
+
className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-primary",
|
|
51
|
+
disabled: _,
|
|
52
|
+
children: [_ ? /* @__PURE__ */ u(o, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ u(s, { className: "size-3.5" }), /* @__PURE__ */ u("span", {
|
|
53
|
+
className: "text-sm truncate",
|
|
54
|
+
children: _ ? "Creating..." : `Create "${f}"`
|
|
55
|
+
})]
|
|
56
|
+
}) }),
|
|
57
|
+
f.trim() !== "" && !m && h.length === 0 && !v && /* @__PURE__ */ u(t, {
|
|
58
|
+
className: "py-4 text-center text-xs text-muted-foreground",
|
|
59
|
+
children: "No tags found"
|
|
60
|
+
}),
|
|
61
|
+
y && /* @__PURE__ */ u("div", {
|
|
62
|
+
className: "px-3 py-2 text-xs text-destructive border-t border-border",
|
|
63
|
+
children: y
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
}),
|
|
67
|
+
!b && /* @__PURE__ */ d("div", {
|
|
68
|
+
className: "border-t border-border px-3 py-2 text-xs text-muted-foreground flex items-center gap-1",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ u(l, { className: "size-3" }),
|
|
71
|
+
"Maximum ",
|
|
72
|
+
x,
|
|
73
|
+
" tags reached"
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { f as TagSearchPopover };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { gql as e } from "@apollo/client";
|
|
2
|
+
//#region src/tag/tagsWidget/operations.ts
|
|
3
|
+
var t = e`
|
|
4
|
+
query TagsWidget_SearchTags($query: String!, $vocabularyId: ID, $limit: Int) {
|
|
5
|
+
searchTags(query: $query, vocabularyId: $vocabularyId, limit: $limit) {
|
|
6
|
+
id
|
|
7
|
+
key
|
|
8
|
+
label
|
|
9
|
+
value
|
|
10
|
+
vocabularyId
|
|
11
|
+
parentId
|
|
12
|
+
hierarchyPath
|
|
13
|
+
color
|
|
14
|
+
icon
|
|
15
|
+
description
|
|
16
|
+
vocabulary {
|
|
17
|
+
key
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`, n = e`
|
|
22
|
+
query TagsWidget_GetVocabularyByKey($key: String!) {
|
|
23
|
+
getVocabularyByKey(key: $key) {
|
|
24
|
+
id
|
|
25
|
+
key
|
|
26
|
+
name
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`, r = e`
|
|
30
|
+
mutation TagsWidget_CreateVocabulary($input: CreateVocabularyInput!) {
|
|
31
|
+
createVocabulary(input: $input) {
|
|
32
|
+
id
|
|
33
|
+
key
|
|
34
|
+
name
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`, i = e`
|
|
38
|
+
mutation TagsWidget_CreateTag($input: CreateTagInput!) {
|
|
39
|
+
createTag(input: $input) {
|
|
40
|
+
id
|
|
41
|
+
key
|
|
42
|
+
label
|
|
43
|
+
value
|
|
44
|
+
vocabularyId
|
|
45
|
+
parentId
|
|
46
|
+
hierarchyPath
|
|
47
|
+
color
|
|
48
|
+
icon
|
|
49
|
+
vocabulary {
|
|
50
|
+
key
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`, a = e`
|
|
55
|
+
mutation TagsWidget_NotifyTagAssigned($input: NotifyTagAssignedInput!) {
|
|
56
|
+
notifyTagAssigned(input: $input)
|
|
57
|
+
}
|
|
58
|
+
`, o = e`
|
|
59
|
+
mutation TagsWidget_NotifyTagRemoved($key: String!, $entityType: String!, $entityId: ID!) {
|
|
60
|
+
notifyTagRemoved(key: $key, entityType: $entityType, entityId: $entityId)
|
|
61
|
+
}
|
|
62
|
+
`, s = "general";
|
|
63
|
+
//#endregion
|
|
64
|
+
export { i as CREATE_TAG, r as CREATE_VOCABULARY, s as DEFAULT_VOCAB_KEY, n as GET_VOCABULARY_BY_KEY, a as NOTIFY_TAG_ASSIGNED, o as NOTIFY_TAG_REMOVED, t as SEARCH_TAGS };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CREATE_VOCABULARY as e, DEFAULT_VOCAB_KEY as t, GET_VOCABULARY_BY_KEY as n } from "./operations.js";
|
|
2
|
+
import { useCallback as r, useState as i } from "react";
|
|
3
|
+
import { useLazyQuery as a, useMutation as o } from "@apollo/client/react";
|
|
4
|
+
//#region src/tag/tagsWidget/useVocabResolver.ts
|
|
5
|
+
function s(s, c) {
|
|
6
|
+
let [l, u] = i(c), [d] = a(n, { client: s }), [f] = o(e, { client: s });
|
|
7
|
+
return {
|
|
8
|
+
resolvedVocabId: l,
|
|
9
|
+
resolveVocabId: r(async () => {
|
|
10
|
+
if (l) return l;
|
|
11
|
+
let e = (await d({ variables: { key: t } })).data?.getVocabularyByKey;
|
|
12
|
+
if (e) return u(e.id), e.id;
|
|
13
|
+
let n = (await f({ variables: { input: {
|
|
14
|
+
key: t,
|
|
15
|
+
name: "General",
|
|
16
|
+
description: "Default vocabulary for general-purpose tags",
|
|
17
|
+
scope: "WORKSPACE",
|
|
18
|
+
allowCustomTags: !0
|
|
19
|
+
} } })).data?.createVocabulary;
|
|
20
|
+
if (!n) throw Error("Failed to create default vocabulary");
|
|
21
|
+
return u(n.id), n.id;
|
|
22
|
+
}, [
|
|
23
|
+
l,
|
|
24
|
+
d,
|
|
25
|
+
f
|
|
26
|
+
])
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { s as useVocabResolver };
|