@burdenoff/fe-libs 2026.1113.10 → 2026.1114.1
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/README.md +55 -8
- package/dist/node_modules/pdfjs-dist/build/pdf.js +21 -0
- package/dist/node_modules/pdfjs-dist/build/pdf.worker.min.js +21 -0
- package/dist/platform-pages/AcceptShareRoute.js +15 -16
- package/dist/platform-pages/AffiliatesPage.js +4 -5
- package/dist/shared/assistant/createSandboxAssistantTransport.js +0 -1
- package/dist/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +267 -241
- package/dist/shared/assistant/ui/AssistantChatArea.js +1243 -1241
- package/dist/shared/assistant/ui/AssistantConversationList.js +253 -252
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +4 -23
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.js +52 -55
- package/dist/shared/assistant/ui/AssistantMessageItem.js +37 -38
- package/dist/shared/assistant/ui/AssistantMessageList.js +48 -47
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +24 -25
- package/dist/shared/assistant/ui/assistantPageLayout.d.ts +13 -0
- package/dist/shared/assistant/ui/assistantPageLayout.js +8 -0
- package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.d.ts +6 -0
- package/dist/shared/assistant/ui/avatar/AssistantCompactAvatar.js +77 -71
- package/dist/shared/assistant/ui/compact/AssistantMenuView.js +130 -129
- package/dist/shared/assistant/ui/compact/AssistantPageBar.d.ts +13 -0
- package/dist/shared/assistant/ui/compact/AssistantPageBar.js +46 -0
- package/dist/shared/assistant/ui/compact/AssistantViewSwitch.d.ts +5 -0
- package/dist/shared/assistant/ui/compact/AssistantViewSwitch.js +11 -11
- package/dist/shared/assistant/ui/composer/AssistantCompactFooter.js +15 -11
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +258 -257
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +3 -3
- package/dist/shared/assistant/ui/composer/connectSource.js +1 -2
- package/dist/shared/assistant/uiActions/assistantHref.d.ts +2 -30
- package/dist/shared/assistant/uiActions/assistantHref.js +7 -43
- package/dist/shared/assistant/uiActions/assistantLinkNavigation.d.ts +12 -0
- package/dist/shared/assistant/uiActions/assistantLinkNavigation.js +42 -0
- package/dist/shared/assistant/uiActions/inAppLinks.js +9 -8
- package/dist/shared/components/ContextConversationWidget.js +6 -7
- package/dist/shared/components/assistantWidget/MessageContent.js +3 -4
- package/dist/shared/components/contextConversationWidget/Composer.js +9 -10
- package/dist/shared/components/contextConversationWidget/MessageItem.js +0 -1
- package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +0 -1
- package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +0 -1
- package/dist/shared/components/contextConversationWidget/ReplyBanner.js +0 -1
- package/dist/shared/components/contextConversationWidget/WidgetHeader.js +8 -9
- package/dist/shared/hooks/usePushDeviceRegistration.js +9 -10
- package/dist/shared/hooks/useRecordProductVisit.js +8 -9
- package/dist/shared/tours/ToursContext.js +6 -7
- package/dist/shared-assistant.js +224 -221
- package/dist/shared-hooks.js +10 -12
- package/dist/shared-plugins.js +0 -1
- package/dist/shared-providers-shell.js +7 -8
- package/dist/shared.js +83 -87
- package/dist/third-party/pdfjs-dist/ATTRIBUTION.txt +54 -0
- package/dist/third-party/pdfjs-dist/LICENSE +177 -0
- package/dist/third-party/pdfjs-dist/manifest.json +19 -0
- package/dist/utils/index.js +1 -1
- package/package.json +29 -2
- package/dist/shared/actors/index.js +0 -3
- package/dist/shared/assistant/speech/index.js +0 -6
- package/dist/shared/plugins/iframe-mount/index.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { assistantRoutePath as e, classifyAssistantHref as t } from "../../uiActions/assistantLinkNavigation.js";
|
|
2
|
+
import { useAssistantTr as n } from "../../i18n.js";
|
|
3
3
|
import { useAssistantNavigate as r } from "../AssistantMarkdownRenderer.js";
|
|
4
4
|
import { connectSourceHrefRenders as i, useAssistantConnectSource as a } from "./connectSource.js";
|
|
5
5
|
import { useCallback as o } from "react";
|
|
@@ -15,7 +15,7 @@ var d = "flex w-full items-center gap-2.5 border-t border-border-subtle px-3 py-
|
|
|
15
15
|
menuitem: "assistant-connect-source",
|
|
16
16
|
action: "assistant-connect-source-action"
|
|
17
17
|
}, m = ({ onActivate: m, presentation: h = "menuitem" }) => {
|
|
18
|
-
let g =
|
|
18
|
+
let g = n(), { href: _, open: v } = a(), y = r(), b = t(_), x = b === "internal" ? e(_) : null, S = o((e) => {
|
|
19
19
|
e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || (m?.(), y && x && (e.preventDefault(), Promise.resolve(y(x, "person", { surface: "connect-source" })).catch(() => void 0)));
|
|
20
20
|
}, [
|
|
21
21
|
y,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { assistantRoutePath as e, classifyAssistantHref as t } from "../../uiActions/
|
|
2
|
-
import "../AssistantMarkdownRenderer.js";
|
|
1
|
+
import { assistantRoutePath as e, classifyAssistantHref as t } from "../../uiActions/assistantLinkNavigation.js";
|
|
3
2
|
import { createContext as n, useContext as r, useMemo as i } from "react";
|
|
4
3
|
import { jsx as a } from "react/jsx-runtime";
|
|
5
4
|
// src/shared/assistant/ui/composer/connectSource.tsx
|
|
@@ -1,35 +1,7 @@
|
|
|
1
1
|
import { Options } from 'react-markdown';
|
|
2
|
+
export { assistantRoutePath, classifyAssistantHref } from './assistantLinkNavigation';
|
|
3
|
+
export type { AssistantLinkKind } from './assistantLinkNavigation';
|
|
2
4
|
/** @internal Exported for unit tests; not part of the module's public surface. */
|
|
3
5
|
export declare function transformAssistantUrl(url: string, key: string, tagName: string): string;
|
|
4
6
|
/** @internal The react-markdown option form of `transformAssistantUrl`. */
|
|
5
7
|
export declare const assistantUrlTransform: Options['urlTransform'];
|
|
6
|
-
/**
|
|
7
|
-
* How a link in an assistant reply should be treated.
|
|
8
|
-
*
|
|
9
|
-
* ★★ `href.startsWith("/")` IS NOT AN INTERNAL TEST. A protocol-relative URL —
|
|
10
|
-
* `//evil.example/path` — has no colon, so react-markdown's `defaultUrlTransform`
|
|
11
|
-
* returns it verbatim and the sanitizer passes it through; the browser then
|
|
12
|
-
* resolves it against the page's SCHEME and lands on another origin. Treating
|
|
13
|
-
* that as internal would hand an attacker-authored destination to the router.
|
|
14
|
-
* So the decision is made by RESOLVING the href and comparing origins.
|
|
15
|
-
*
|
|
16
|
-
* ★ This runs AFTER the sanitizer, so anything with an unsafe scheme has already
|
|
17
|
-
* been reduced to an empty string upstream — `blocked` here is the empty case,
|
|
18
|
-
* not a second scheme allow-list. The scheme policy stays in one place.
|
|
19
|
-
*/
|
|
20
|
-
export type AssistantLinkKind = 'internal' | 'external' | 'fragment' | 'blocked';
|
|
21
|
-
export declare function classifyAssistantHref(href: string | null | undefined, baseOrigin?: string): AssistantLinkKind;
|
|
22
|
-
/**
|
|
23
|
-
* The router-ready path for an href already classified as `internal`, or null if
|
|
24
|
-
* it cannot be resolved.
|
|
25
|
-
*
|
|
26
|
-
* ★★ WHY THIS IS NOT THE HREF. An internal link may be written absolutely —
|
|
27
|
-
* `https://app.example.com/fields?q=1#top` is same-origin, so it classifies as
|
|
28
|
-
* internal — and every SPA router reads a `to`/`navigate()` string as a PATH.
|
|
29
|
-
* Handing it the absolute form routes to a literal `/https://app.example.com/...`
|
|
30
|
-
* segment. Resolving here means each product wires one line and cannot get this
|
|
31
|
-
* wrong; the alternative is the same five lines re-derived in every product,
|
|
32
|
-
* with only the ones whose assistant happened to emit an absolute URL finding
|
|
33
|
-
* out they got it wrong.
|
|
34
|
-
*/
|
|
35
|
-
export declare function assistantRoutePath(href: string | null | undefined, baseOrigin?: string): string | null;
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { assistantRoutePath as e, classifyAssistantHref as t } from "./assistantLinkNavigation.js";
|
|
2
|
+
import { defaultUrlTransform as n } from "../../../node_modules/react-markdown/lib/index.js";
|
|
3
3
|
// src/shared/assistant/uiActions/assistantHref.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
return
|
|
4
|
+
var r = /^data:image\/(?:png|jpe?g|gif|webp|avif|bmp);base64,[A-Za-z0-9+/=\s]+$/;
|
|
5
|
+
function i(e, t, i) {
|
|
6
|
+
return t === "src" && i === "img" && r.test(e) ? e : n(e);
|
|
7
7
|
}
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
return typeof window > "u" ? null : window.location.origin;
|
|
12
|
-
} catch {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function o(e, t) {
|
|
17
|
-
try {
|
|
18
|
-
let n = new URL(t);
|
|
19
|
-
if (n.protocol === "https:" || n.protocol === "http:" || !n.host) return !1;
|
|
20
|
-
let r = new URL(e, t);
|
|
21
|
-
return r.protocol === n.protocol && r.host === n.host;
|
|
22
|
-
} catch {
|
|
23
|
-
return !1;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function s(e, n) {
|
|
27
|
-
let r = (e ?? "").trim();
|
|
28
|
-
if (!r) return "blocked";
|
|
29
|
-
if (r.startsWith("#")) return "fragment";
|
|
30
|
-
let i = n ?? a();
|
|
31
|
-
return i && (t(r, i) || o(r, i)) ? "internal" : "external";
|
|
32
|
-
}
|
|
33
|
-
function c(e, t) {
|
|
34
|
-
let n = (e ?? "").trim();
|
|
35
|
-
if (!n) return null;
|
|
36
|
-
let r = t ?? a();
|
|
37
|
-
if (!r) return null;
|
|
38
|
-
try {
|
|
39
|
-
let e = new URL(n, r), t = `${e.pathname}${e.search}${e.hash}`;
|
|
40
|
-
return t.startsWith("//") || t.startsWith("/\\") ? null : t;
|
|
41
|
-
} catch {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
export { c as assistantRoutePath, i as assistantUrlTransform, s as classifyAssistantHref, r as transformAssistantUrl };
|
|
8
|
+
var a = (e, t, n) => i(e, t, n.tagName);
|
|
9
|
+
export { e as assistantRoutePath, a as assistantUrlTransform, t as classifyAssistantHref, i as transformAssistantUrl };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
export type AssistantLinkKind = 'internal' | 'external' | 'fragment' | 'blocked';
|
|
3
|
+
/**
|
|
4
|
+
* Runs after the renderer's sanitizer. This is origin classification, not a
|
|
5
|
+
* scheme allowlist: the lightweight widget retains its separate https-only
|
|
6
|
+
* external-link gate. Never replace resolved-origin comparison with a prefix.
|
|
7
|
+
*/
|
|
8
|
+
export declare function classifyAssistantHref(href: string | null | undefined, baseOrigin?: string): AssistantLinkKind;
|
|
9
|
+
/** Resolve internal links to a router-ready path, with the same escape guard. */
|
|
10
|
+
export declare function assistantRoutePath(href: string | null | undefined, baseOrigin?: string): string | null;
|
|
11
|
+
/** Modified/default-prevented/non-primary clicks remain owned by the browser. */
|
|
12
|
+
export declare function browserShouldHandle(event: Pick<MouseEvent<HTMLAnchorElement>, 'defaultPrevented' | 'button' | 'metaKey' | 'ctrlKey' | 'shiftKey' | 'altKey'>): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isSafeRedirectTarget as e } from "../../graphql/security.js";
|
|
2
|
+
// src/shared/assistant/uiActions/assistantLinkNavigation.ts
|
|
3
|
+
function t() {
|
|
4
|
+
try {
|
|
5
|
+
return typeof window > "u" ? null : window.location.origin;
|
|
6
|
+
} catch {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function n(e, t) {
|
|
11
|
+
try {
|
|
12
|
+
let n = new URL(t);
|
|
13
|
+
if (n.protocol === "https:" || n.protocol === "http:" || !n.host) return !1;
|
|
14
|
+
let r = new URL(e, t);
|
|
15
|
+
return r.protocol === n.protocol && r.host === n.host;
|
|
16
|
+
} catch {
|
|
17
|
+
return !1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function r(r, i) {
|
|
21
|
+
let a = (r ?? "").trim();
|
|
22
|
+
if (!a) return "blocked";
|
|
23
|
+
if (a.startsWith("#")) return "fragment";
|
|
24
|
+
let o = i ?? t();
|
|
25
|
+
return o && (e(a, o) || n(a, o)) ? "internal" : "external";
|
|
26
|
+
}
|
|
27
|
+
function i(e, n) {
|
|
28
|
+
let r = (e ?? "").trim();
|
|
29
|
+
if (!r) return null;
|
|
30
|
+
let i = n ?? t();
|
|
31
|
+
if (!i) return null;
|
|
32
|
+
try {
|
|
33
|
+
let e = new URL(r, i), t = `${e.pathname}${e.search}${e.hash}`;
|
|
34
|
+
return t.startsWith("//") || t.startsWith("/\\") ? null : t;
|
|
35
|
+
} catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function a(e) {
|
|
40
|
+
return e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
|
|
41
|
+
}
|
|
42
|
+
export { i as assistantRoutePath, a as browserShouldHandle, r as classifyAssistantHref };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { assistantRoutePath as e, classifyAssistantHref as t } from "./assistantLinkNavigation.js";
|
|
2
|
+
import n from "../../../node_modules/remark-gfm/lib/index.js";
|
|
3
|
+
import r from "../../../node_modules/remark-parse/lib/index.js";
|
|
4
|
+
import { unified as i } from "../../../node_modules/unified/lib/index.js";
|
|
5
|
+
import { transformAssistantUrl as a } from "./assistantHref.js";
|
|
5
6
|
// src/shared/assistant/uiActions/inAppLinks.ts
|
|
6
|
-
var o = 80, s =
|
|
7
|
+
var o = 80, s = i().use(r).use(n), c = (e) => e.trim().replace(/\s+/g, " ").toLowerCase(), l = /* @__PURE__ */ new Set([
|
|
7
8
|
"code",
|
|
8
9
|
"inlineCode",
|
|
9
10
|
"html",
|
|
@@ -21,9 +22,9 @@ function d(e, t) {
|
|
|
21
22
|
}
|
|
22
23
|
for (let n of e.children ?? []) d(n, t);
|
|
23
24
|
}
|
|
24
|
-
function f(
|
|
25
|
-
let
|
|
26
|
-
return
|
|
25
|
+
function f(n) {
|
|
26
|
+
let r = a(n, "href", "a");
|
|
27
|
+
return t(r) === "internal" ? e(r) : null;
|
|
27
28
|
}
|
|
28
29
|
function p(e) {
|
|
29
30
|
if (!e.trim()) return [];
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useI18n as e } from "../providers/shell/I18nProvider.js";
|
|
2
2
|
import { useGatewayClient as t } from "../graphql/GatewayContext.js";
|
|
3
|
-
import "../../ui.js";
|
|
4
|
-
import { useAuth as
|
|
5
|
-
import { useActiveContext as
|
|
6
|
-
import { Card as ee, CardContent as te } from "../../ui/card.js";
|
|
3
|
+
import { Card as n, CardContent as r } from "../../ui/card.js";
|
|
4
|
+
import { useAuth as ee } from "../providers/shell/AuthProvider.js";
|
|
5
|
+
import { useActiveContext as te } from "../providers/shell/ActiveContextProvider.js";
|
|
7
6
|
import "../../shared-graphql.js";
|
|
8
7
|
import { usePageConversationContext as ne } from "../providers/shell/PageConversationContextProvider.js";
|
|
9
8
|
import "../../shared-providers-shell.js";
|
|
@@ -26,7 +25,7 @@ import { useNavigate as ge } from "react-router";
|
|
|
26
25
|
import { useQuery as h } from "@apollo/client/react";
|
|
27
26
|
// src/shared/components/ContextConversationWidget.tsx
|
|
28
27
|
function g({ className: g, widgetKey: _ }) {
|
|
29
|
-
let { t: v } = e(), { workspaceId: y } =
|
|
28
|
+
let { t: v } = e(), { workspaceId: y } = te(), b = ee(), x = ne(), S = t("workspace"), C = ge(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, _e] = f(() => typeof window < "u" && window.innerWidth < 768), [j, M] = f(null), [N, P] = f(null), [F, I] = f(""), [L, R] = f(null), [z, B] = f([]), V = he(null), H = d(() => (e, t) => {
|
|
30
29
|
let n = v(e);
|
|
31
30
|
return n === e ? t : n;
|
|
32
31
|
}, [v]), U = b.user?.id ?? null, W = _ ?? x.widgetKey ?? "default", G = d(() => {
|
|
@@ -139,7 +138,7 @@ function g({ className: g, widgetKey: _ }) {
|
|
|
139
138
|
}, Se = async () => {
|
|
140
139
|
N && F.trim() && (await X.saveEdit(N, F.trim()), P(null), I(""));
|
|
141
140
|
};
|
|
142
|
-
return /* @__PURE__ */ m(
|
|
141
|
+
return /* @__PURE__ */ m(n, {
|
|
143
142
|
className: g,
|
|
144
143
|
children: [/* @__PURE__ */ p(me, {
|
|
145
144
|
conversationTitle: K.data?.conversation?.title,
|
|
@@ -159,7 +158,7 @@ function g({ className: g, widgetKey: _ }) {
|
|
|
159
158
|
},
|
|
160
159
|
onOpenInbox: () => w && C(`/conversations/${w}`),
|
|
161
160
|
tr: H
|
|
162
|
-
}), !A && /* @__PURE__ */ m(
|
|
161
|
+
}), !A && /* @__PURE__ */ m(r, {
|
|
163
162
|
className: "space-y-4",
|
|
164
163
|
children: [
|
|
165
164
|
L && /* @__PURE__ */ p("div", {
|
|
@@ -2,8 +2,7 @@ import { useAssistantGenerativeUi as e } from "../../assistant/openui/generative
|
|
|
2
2
|
import t from "../../assistant/openui/OpenUiBoundary.js";
|
|
3
3
|
import { splitOpenUiSegments as n } from "../../assistant/openui/segments.js";
|
|
4
4
|
import { lazyWithRetry as r } from "../../utils/lazyWithRetry.js";
|
|
5
|
-
import { assistantRoutePath as i,
|
|
6
|
-
import { browserShouldHandle as o } from "../../assistant/ui/AssistantMarkdownRenderer.js";
|
|
5
|
+
import { assistantRoutePath as i, browserShouldHandle as a, classifyAssistantHref as o } from "../../assistant/uiActions/assistantLinkNavigation.js";
|
|
7
6
|
import { Fragment as s, Suspense as c, useMemo as l } from "react";
|
|
8
7
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
8
|
// src/shared/components/assistantWidget/MessageContent.tsx
|
|
@@ -12,12 +11,12 @@ function _(e) {
|
|
|
12
11
|
return e.startsWith("https://");
|
|
13
12
|
}
|
|
14
13
|
function v(e, t, n, r, c) {
|
|
15
|
-
let l = r ?
|
|
14
|
+
let l = r ? o(r) : "blocked", u = l === "internal" && r ? i(r) : null, f = l === "external" && r !== void 0 && _(r);
|
|
16
15
|
return n && r && (u || f) ? /* @__PURE__ */ d("a", {
|
|
17
16
|
href: u ?? r,
|
|
18
17
|
"data-testid": "assistant-message-link",
|
|
19
18
|
...u ? { onClick: c ? (e) => {
|
|
20
|
-
|
|
19
|
+
a(e) || (e.preventDefault(), c(u));
|
|
21
20
|
} : void 0 } : {
|
|
22
21
|
target: "_blank",
|
|
23
22
|
rel: "noopener noreferrer"
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Badge as e } from "../../../ui/badge.js";
|
|
2
|
+
import { Button as t } from "../../../ui/button.js";
|
|
3
3
|
import { Textarea as n } from "../../../ui/textarea.js";
|
|
4
|
-
import "../../../ui.js";
|
|
5
4
|
import { Loader2 as r, Paperclip as i, SendHorizontal as a, SmilePlus as o } from "lucide-react";
|
|
6
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
6
|
// src/shared/components/contextConversationWidget/Composer.tsx
|
|
@@ -19,13 +18,13 @@ function l({ composerValue: l, onComposerChange: u, fileInputRef: d, onFilesSele
|
|
|
19
18
|
}),
|
|
20
19
|
_.mentions && v.length > 0 ? /* @__PURE__ */ c("div", {
|
|
21
20
|
className: "flex flex-wrap gap-2 rounded-md border border-border bg-muted/20 p-2",
|
|
22
|
-
children: [/* @__PURE__ */ s(o, { className: "mt-0.5 size-4 text-muted-foreground" }), v.map((
|
|
21
|
+
children: [/* @__PURE__ */ s(o, { className: "mt-0.5 size-4 text-muted-foreground" }), v.map((e) => /* @__PURE__ */ c(t, {
|
|
23
22
|
type: "button",
|
|
24
23
|
variant: "outline",
|
|
25
24
|
size: "sm",
|
|
26
|
-
onClick: () => y(
|
|
27
|
-
children: ["@",
|
|
28
|
-
},
|
|
25
|
+
onClick: () => y(e),
|
|
26
|
+
children: ["@", e.label]
|
|
27
|
+
}, e.id))]
|
|
29
28
|
}) : null,
|
|
30
29
|
/* @__PURE__ */ c("div", {
|
|
31
30
|
className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between",
|
|
@@ -39,7 +38,7 @@ function l({ composerValue: l, onComposerChange: u, fileInputRef: d, onFilesSele
|
|
|
39
38
|
className: "hidden",
|
|
40
39
|
onChange: (e) => f(e.target.files)
|
|
41
40
|
}),
|
|
42
|
-
/* @__PURE__ */ c(
|
|
41
|
+
/* @__PURE__ */ c(t, {
|
|
43
42
|
type: "button",
|
|
44
43
|
variant: "outline",
|
|
45
44
|
size: "sm",
|
|
@@ -47,12 +46,12 @@ function l({ composerValue: l, onComposerChange: u, fileInputRef: d, onFilesSele
|
|
|
47
46
|
disabled: h,
|
|
48
47
|
children: [h ? /* @__PURE__ */ s(r, { className: "me-2 size-4 animate-spin" }) : /* @__PURE__ */ s(i, { className: "me-2 size-4" }), b("conversationWidget.attach", "Attach files")]
|
|
49
48
|
}),
|
|
50
|
-
_.mentions ? /* @__PURE__ */ s(
|
|
49
|
+
_.mentions ? /* @__PURE__ */ s(e, {
|
|
51
50
|
variant: "outline",
|
|
52
51
|
children: b("conversationWidget.mentionsHint", "Type @ to mention participants")
|
|
53
52
|
}) : null
|
|
54
53
|
]
|
|
55
|
-
}), /* @__PURE__ */ c(
|
|
54
|
+
}), /* @__PURE__ */ c(t, {
|
|
56
55
|
type: "button",
|
|
57
56
|
onClick: m,
|
|
58
57
|
disabled: g || h || !l.trim(),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Button as e } from "../../../ui/button.js";
|
|
2
2
|
import { Textarea as t } from "../../../ui/textarea.js";
|
|
3
|
-
import "../../../ui.js";
|
|
4
3
|
import { QUICK_REACTIONS as n } from "./types.js";
|
|
5
4
|
import { formatFileSize as r, formatTimestamp as i } from "./utils.js";
|
|
6
5
|
import { Pencil as a, Pin as o, PinOff as s, Reply as c, Trash2 as l } from "lucide-react";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Card as e, CardContent as t, CardHeader as n, CardTitle as r } from "../../../ui/card.js";
|
|
2
|
-
import "../../../ui.js";
|
|
3
2
|
import { MessageCircle as i } from "lucide-react";
|
|
4
3
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
4
|
// src/shared/components/contextConversationWidget/NoWorkspaceCard.tsx
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Badge as e } from "../../../ui/badge.js";
|
|
2
|
-
import "../../../ui.js";
|
|
3
2
|
import { Paperclip as t, X as n } from "lucide-react";
|
|
4
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
4
|
// src/shared/components/contextConversationWidget/PendingAttachmentsBar.tsx
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Badge as e } from "../../../ui/badge.js";
|
|
2
|
+
import { Button as t } from "../../../ui/button.js";
|
|
3
3
|
import { CardHeader as n, CardTitle as r } from "../../../ui/card.js";
|
|
4
|
-
import "../../../ui.js";
|
|
5
4
|
import { ChevronDown as i, ChevronUp as a, ExternalLink as o, MessageCircle as s } from "lucide-react";
|
|
6
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
6
|
// src/shared/components/contextConversationWidget/WidgetHeader.tsx
|
|
@@ -24,14 +23,14 @@ function u({ conversationTitle: u, pageContext: d, resolvedContext: f, unreadCou
|
|
|
24
23
|
}), /* @__PURE__ */ l("div", {
|
|
25
24
|
className: "flex flex-wrap items-center gap-2 md:justify-end",
|
|
26
25
|
children: [
|
|
27
|
-
/* @__PURE__ */ l(
|
|
26
|
+
/* @__PURE__ */ l(t, {
|
|
28
27
|
type: "button",
|
|
29
28
|
variant: "outline",
|
|
30
29
|
size: "sm",
|
|
31
30
|
onClick: _,
|
|
32
31
|
children: [/* @__PURE__ */ c(o, { className: "me-2 size-4" }), y("conversationWidget.openContext", "Open context")]
|
|
33
32
|
}),
|
|
34
|
-
/* @__PURE__ */ c(
|
|
33
|
+
/* @__PURE__ */ c(t, {
|
|
35
34
|
type: "button",
|
|
36
35
|
"data-tour": "page-discussion-open-full",
|
|
37
36
|
variant: "outline",
|
|
@@ -40,7 +39,7 @@ function u({ conversationTitle: u, pageContext: d, resolvedContext: f, unreadCou
|
|
|
40
39
|
disabled: !m,
|
|
41
40
|
children: y("conversationWidget.openInbox", "Open in conversations")
|
|
42
41
|
}),
|
|
43
|
-
/* @__PURE__ */ c(
|
|
42
|
+
/* @__PURE__ */ c(t, {
|
|
44
43
|
type: "button",
|
|
45
44
|
variant: "ghost",
|
|
46
45
|
size: "icon",
|
|
@@ -53,15 +52,15 @@ function u({ conversationTitle: u, pageContext: d, resolvedContext: f, unreadCou
|
|
|
53
52
|
}), /* @__PURE__ */ l("div", {
|
|
54
53
|
className: "flex flex-wrap items-center gap-2",
|
|
55
54
|
children: [
|
|
56
|
-
/* @__PURE__ */ c(
|
|
55
|
+
/* @__PURE__ */ c(e, {
|
|
57
56
|
variant: "secondary",
|
|
58
57
|
children: f.widgetKey
|
|
59
58
|
}),
|
|
60
|
-
f.activeTab ? /* @__PURE__ */ c(
|
|
59
|
+
f.activeTab ? /* @__PURE__ */ c(e, {
|
|
61
60
|
variant: "outline",
|
|
62
61
|
children: f.activeTab
|
|
63
62
|
}) : null,
|
|
64
|
-
p ? /* @__PURE__ */ l(
|
|
63
|
+
p ? /* @__PURE__ */ l(e, { children: [p, " unread"] }) : null
|
|
65
64
|
]
|
|
66
65
|
})]
|
|
67
66
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { installPushDeviceRegistration as
|
|
3
|
-
import { logManager as n } from "../logger/LogManager.js";
|
|
1
|
+
import { logManager as e } from "../logger/LogManager.js";
|
|
2
|
+
import { installPushDeviceRegistration as t, unregisterPushDevice as n } from "../native/push-registration.js";
|
|
4
3
|
import { useAppShell as r } from "../providers/shell/AppShellContext.js";
|
|
5
4
|
import { useAuth as i } from "../providers/shell/AuthProvider.js";
|
|
6
5
|
import { useEffect as a, useRef as o } from "react";
|
|
7
6
|
// src/shared/hooks/usePushDeviceRegistration.ts
|
|
8
|
-
var s =
|
|
7
|
+
var s = e.getLogger("usePushDeviceRegistration");
|
|
9
8
|
function c() {
|
|
10
9
|
let e = globalThis.__APP_VERSION__;
|
|
11
10
|
return typeof e == "string" && e.length > 0 ? e : void 0;
|
|
@@ -13,24 +12,24 @@ function c() {
|
|
|
13
12
|
function l() {
|
|
14
13
|
if (typeof navigator < "u") return navigator.language || void 0;
|
|
15
14
|
}
|
|
16
|
-
function u(
|
|
17
|
-
let { productSlug: u } = r(), { user: d, tokens: f } = i(), p =
|
|
15
|
+
function u(e = {}) {
|
|
16
|
+
let { productSlug: u } = r(), { user: d, tokens: f } = i(), p = e.productSlug ?? u, m = e.enabled !== !1, h = d?.id, g = f?.accessToken, _ = o(null);
|
|
18
17
|
a(() => {
|
|
19
18
|
if (m && p) {
|
|
20
19
|
if (!h || !g) {
|
|
21
20
|
let e = _.current;
|
|
22
21
|
if (!e) return;
|
|
23
|
-
_.current = null,
|
|
22
|
+
_.current = null, n({ authToken: e.accessToken }).catch((e) => {
|
|
24
23
|
s.warn("[usePushDeviceRegistration] unregister failed", { error: e instanceof Error ? e.message : String(e) });
|
|
25
24
|
});
|
|
26
25
|
} else return _.current = {
|
|
27
26
|
userId: h,
|
|
28
27
|
accessToken: g
|
|
29
|
-
},
|
|
28
|
+
}, t({
|
|
30
29
|
productSlug: p,
|
|
31
30
|
getAuthToken: () => _.current?.accessToken,
|
|
32
31
|
getUserId: () => _.current?.userId,
|
|
33
|
-
appVersion:
|
|
32
|
+
appVersion: e.appVersion ?? c(),
|
|
34
33
|
locale: l(),
|
|
35
34
|
onError: (e) => {
|
|
36
35
|
s.warn("[usePushDeviceRegistration] registration failed", {
|
|
@@ -45,7 +44,7 @@ function u(n = {}) {
|
|
|
45
44
|
p,
|
|
46
45
|
h,
|
|
47
46
|
g,
|
|
48
|
-
|
|
47
|
+
e.appVersion
|
|
49
48
|
]);
|
|
50
49
|
}
|
|
51
50
|
export { u as usePushDeviceRegistration };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { graphqlFetch as e } from "../graphql/fetch.js";
|
|
2
|
-
import "
|
|
3
|
-
import { useAppShell as
|
|
4
|
-
import { logManager as n } from "../logger/LogManager.js";
|
|
2
|
+
import { logManager as t } from "../logger/LogManager.js";
|
|
3
|
+
import { useAppShell as n } from "../providers/shell/AppShellContext.js";
|
|
5
4
|
import { useAuth as r } from "../providers/shell/AuthProvider.js";
|
|
6
5
|
import { useEffect as i, useRef as a } from "react";
|
|
7
6
|
// src/shared/hooks/useRecordProductVisit.ts
|
|
8
|
-
var o =
|
|
7
|
+
var o = t.getLogger("useRecordProductVisit"), s = "\n mutation RecordProductVisit($input: RecordProductVisitInput!) {\n recordProductVisit(input: $input) {\n isFirstVisit\n productSlug\n recordedAt\n welcomeEmailStatus\n welcomeEmailMessageId\n }\n }\n";
|
|
9
8
|
function c(e, t) {
|
|
10
9
|
return `boff:product-visit-recorded:${t}:${e}`;
|
|
11
10
|
}
|
|
@@ -22,19 +21,19 @@ function u(e, t) {
|
|
|
22
21
|
window.sessionStorage.setItem(c(e, t), "1");
|
|
23
22
|
} catch {}
|
|
24
23
|
}
|
|
25
|
-
function d(
|
|
26
|
-
let { productSlug: c } =
|
|
24
|
+
function d(t = {}) {
|
|
25
|
+
let { productSlug: c } = n(), { user: d, tokens: f } = r(), p = t.productSlug ?? c, m = t.enabled !== !1, h = a(!1);
|
|
27
26
|
i(() => {
|
|
28
27
|
if (!m || !p || !d?.id || !f?.accessToken || l(d.id, p) || h.current) return;
|
|
29
28
|
h.current = !0;
|
|
30
|
-
let
|
|
29
|
+
let n = t.appUrl ?? (typeof window < "u" ? window.location.origin : void 0), r = f.accessToken, i = d.id;
|
|
31
30
|
e({
|
|
32
31
|
gateway: "global",
|
|
33
32
|
query: s,
|
|
34
33
|
operationName: "RecordProductVisit",
|
|
35
34
|
variables: { input: {
|
|
36
35
|
productSlug: p,
|
|
37
|
-
appUrl:
|
|
36
|
+
appUrl: n
|
|
38
37
|
} },
|
|
39
38
|
authToken: r,
|
|
40
39
|
suppressGlobalErrorEvent: !0
|
|
@@ -64,7 +63,7 @@ function d(n = {}) {
|
|
|
64
63
|
p,
|
|
65
64
|
d?.id,
|
|
66
65
|
f?.accessToken,
|
|
67
|
-
|
|
66
|
+
t.appUrl
|
|
68
67
|
]);
|
|
69
68
|
}
|
|
70
69
|
export { d as useRecordProductVisit };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useGatewayClient as e } from "../graphql/GatewayContext.js";
|
|
2
2
|
import "../../shared-graphql.js";
|
|
3
|
-
import "
|
|
4
|
-
import { useActiveContext as
|
|
5
|
-
import { useSafePermissions as
|
|
6
|
-
import { isTourAllowedByPermissions as
|
|
7
|
-
import { useLogger as i } from "../logger/useLogger.js";
|
|
3
|
+
import { useLogger as t } from "../logger/useLogger.js";
|
|
4
|
+
import { useActiveContext as n } from "../providers/shell/ActiveContextProvider.js";
|
|
5
|
+
import { useSafePermissions as r } from "../providers/shell/PermissionProvider.js";
|
|
6
|
+
import { isTourAllowedByPermissions as i } from "./permissions.js";
|
|
8
7
|
import { useAuth as a } from "../providers/shell/AuthProvider.js";
|
|
9
8
|
import { useAppShell as o } from "../providers/shell/AppShellContext.js";
|
|
10
9
|
import { isTourVisibleForContext as s } from "./routeCatalog.js";
|
|
@@ -20,7 +19,7 @@ import { useLocation as oe } from "react-router";
|
|
|
20
19
|
// src/shared/tours/ToursContext.tsx
|
|
21
20
|
var y = f(null);
|
|
22
21
|
function b({ children: f, defaultPageId: p = "home", getPageIdFromPath: b, disabled: x = !1, requireWorkspace: S = !1 }) {
|
|
23
|
-
let C = oe(), w = e("global"), { workspaceId: se } =
|
|
22
|
+
let C = oe(), w = e("global"), { workspaceId: se } = n(), { user: T } = a(), E = r(), { productSlug: D } = o(), O = t("ToursContext"), k = se ?? void 0, A = x || S && !k, { moduleId: j, pageId: M } = g(() => te(C.pathname, D, p, b), [
|
|
24
23
|
p,
|
|
25
24
|
b,
|
|
26
25
|
C.pathname,
|
|
@@ -127,7 +126,7 @@ function b({ children: f, defaultPageId: p = "home", getPageIdFromPath: b, disab
|
|
|
127
126
|
}, [N]);
|
|
128
127
|
let Y = m(() => {
|
|
129
128
|
q(!0);
|
|
130
|
-
}, [q]), X = g(() => N.filter((e) =>
|
|
129
|
+
}, [q]), X = g(() => N.filter((e) => i(e, E)), [N, E]), Z = g(() => X.filter((e) => e.isActive && e.steps?.length > 0 && s(e, {
|
|
131
130
|
productId: D,
|
|
132
131
|
moduleId: j,
|
|
133
132
|
pageId: M
|