@burdenoff/fe-libs 2026.1113.11 → 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 +1 -0
- 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/AssistantSpeechProvider.js +24 -25
- 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 +160 -159
- 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
package/README.md
CHANGED
|
@@ -25,8 +25,42 @@ import { mockProducts } from '@burdenoff/fe-libs/shared/utils/mockData';
|
|
|
25
25
|
import { cn } from '@burdenoff/fe-libs/shared';
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
### Tree shaking and import-only integrations
|
|
29
|
+
|
|
30
|
+
The package declares a conservative `sideEffects` allowlist so importing a hook
|
|
31
|
+
or shell helper through a public barrel does not also retain unrelated feature
|
|
32
|
+
renderers. Public exports and implementation identities are unchanged.
|
|
33
|
+
|
|
34
|
+
Import-only initialization barrels, CSS, bundled vendor initialization, shims, native boot modules, event sinks,
|
|
35
|
+
providers, utilities, the assistant history storage listener and the breadcrumb
|
|
36
|
+
registry remain side-effectful. Do not replace this with blanket
|
|
37
|
+
`sideEffects: false`: import-only integrations must keep working.
|
|
38
|
+
|
|
39
|
+
When adding module-level executable code, review its variable/class initializers
|
|
40
|
+
as well as its statements. Add an allowlist entry when initialization changes
|
|
41
|
+
state outside that module. The package-side-effects tests guard the known boot
|
|
42
|
+
paths and require explicit classification of new top-level executable statements;
|
|
43
|
+
they do not replace that initializer review. Validate the packed package and loaded
|
|
44
|
+
consumer routes, including lazy feature opening, before release.
|
|
45
|
+
|
|
28
46
|
## Development
|
|
29
47
|
|
|
48
|
+
### Installed public-shim consumer verification
|
|
49
|
+
|
|
50
|
+
After building and packing, create a private consumer with the actual local
|
|
51
|
+
archive as its `@burdenoff/fe-libs` dependency and exact React/ReactDOM `19.3.1`
|
|
52
|
+
peers. Use a normal script-disabled install to generate its lock, then a frozen
|
|
53
|
+
coherence install. Do not source-link the library or borrow another node_modules.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
node scripts/verification/installed-shim-consumer.mjs /path/to/private-consumer /path/to/candidate.tgz sha512-actual-archive-integrity
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The verifier checks the archive SRI, every installed shipped file, the real lock,
|
|
60
|
+
bare public shim imports, assert initialization/behavior, React peer/hook identity
|
|
61
|
+
and the server snapshot. It does not invent full-browser-root support on Node,
|
|
62
|
+
qualify the FluidGrids SDK, install dependencies, or publish anything.
|
|
63
|
+
|
|
30
64
|
```bash
|
|
31
65
|
# Install dependencies
|
|
32
66
|
bun install
|
|
@@ -139,14 +173,14 @@ Workflow builders, graphs and mappers use the canvas tokens in `tokens.css`.
|
|
|
139
173
|
Each one aliases an existing `chart-*` / `status-*` / surface token, so it
|
|
140
174
|
follows light/dark mode, the brand and the expressive themes:
|
|
141
175
|
|
|
142
|
-
| Group
|
|
143
|
-
|
|
144
|
-
| Canvas
|
|
145
|
-
| Node surface
|
|
146
|
-
| Node category | `--color-node-{trigger,action,logic,loop,data,integration,ai,human,utility,end,default}` plus `-subtle`
|
|
147
|
-
| Node state
|
|
148
|
-
| Edge
|
|
149
|
-
| Data type
|
|
176
|
+
| Group | Tokens |
|
|
177
|
+
| ------------- | -------------------------------------------------------------------------------------------------------- |
|
|
178
|
+
| Canvas | `--color-canvas-{bg,grid,selection,minimap-bg,minimap-node,minimap-mask,control-bg}` |
|
|
179
|
+
| Node surface | `--color-node-{bg,bg-hover,border,border-hover,border-selected,text,text-muted,handle,handle-connected}` |
|
|
180
|
+
| Node category | `--color-node-{trigger,action,logic,loop,data,integration,ai,human,utility,end,default}` plus `-subtle` |
|
|
181
|
+
| Node state | `--color-node-state-{idle,queued,running,success,warning,error,skipped}` |
|
|
182
|
+
| Edge | `--color-edge-{default,hover,selected,active,success,error,compatible,incompatible,label-bg,label-text}` |
|
|
183
|
+
| Data type | `--color-datatype-{string,number,boolean,object,array,date,binary,any}` |
|
|
150
184
|
|
|
151
185
|
`app-shell.css` maps them to Tailwind utilities (`bg-node-trigger`,
|
|
152
186
|
`stroke-edge-default`, `ring-node-state-running`, …). A shell with its own
|
|
@@ -255,3 +289,16 @@ does not bind a request's credentials. The default `refreshable` mode retains
|
|
|
255
289
|
profile-based session recovery. Existing explicit-token consumers need an
|
|
256
290
|
individual authority/refresh review before adopting pinned behavior; this additive
|
|
257
291
|
API does not retroactively repair those callers.
|
|
292
|
+
# Third-party PDF.js redistribution material
|
|
293
|
+
|
|
294
|
+
The build preserves PDF.js upstream copyright/license headers and adds an accurate
|
|
295
|
+
Vite/Rolldown transformation notice to both copied PDF.js modules. The packed
|
|
296
|
+
package includes the exact installed upstream Apache-2.0 license, attribution,
|
|
297
|
+
source-version/hash ledger and any supplied upstream NOTICE files under
|
|
298
|
+
`dist/third-party/pdfjs-dist/`. Build and extracted-archive verification fail if
|
|
299
|
+
this material or either PDF.js module is missing or altered.
|
|
300
|
+
|
|
301
|
+
Applications redistributing the PDF.js code must also retain its notices and copy
|
|
302
|
+
this accompanying legal material into their deployed distribution. Do not strip
|
|
303
|
+
the notices or omit the license to reduce bundle size. This does not replace the
|
|
304
|
+
separate notice/source-availability obligations of optional native plugins.
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @licstart The following is the entire license notice for the
|
|
3
|
+
* JavaScript code in this page
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Mozilla Foundation
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
* @licend The above is the entire license notice for the
|
|
19
|
+
* JavaScript code in this page
|
|
20
|
+
*/
|
|
21
|
+
/*! Modified by Burdenoff: transformed from the upstream PDF.js distribution to preserved-module ESM by Vite/Rolldown; upstream notices and accompanying license are retained. */
|
|
1
22
|
// node_modules/pdfjs-dist/build/pdf.mjs
|
|
2
23
|
var e = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), t = [
|
|
3
24
|
Infinity,
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @licstart The following is the entire license notice for the
|
|
3
|
+
* JavaScript code in this page
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Mozilla Foundation
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
* @licend The above is the entire license notice for the
|
|
19
|
+
* JavaScript code in this page
|
|
20
|
+
*/
|
|
21
|
+
/*! Modified by Burdenoff: transformed from the upstream PDF.js distribution to preserved-module ESM by Vite/Rolldown; upstream notices and accompanying license are retained. */
|
|
1
22
|
// node_modules/pdfjs-dist/build/pdf.worker.min.mjs
|
|
2
23
|
var e = !(typeof process != "object" || process + "" != "[object process]" || process.versions.nw || process.versions.electron && process.type && process.type !== "browser"), t = [
|
|
3
24
|
1 / 0,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "../sharing.js";
|
|
2
|
-
import { graphqlFetch as
|
|
3
|
-
import { useShellNavigate as
|
|
4
|
-
import { useAuth as
|
|
5
|
-
import { AcceptSharePage as r } from "../sharing/AcceptSharePage.js";
|
|
1
|
+
import { AcceptSharePage as e } from "../sharing/AcceptSharePage.js";
|
|
2
|
+
import { graphqlFetch as t } from "../shared/graphql/fetch.js";
|
|
3
|
+
import { useShellNavigate as n } from "../shared/utils/appHelpers.js";
|
|
4
|
+
import { useAuth as r } from "../shared/providers/shell/AuthProvider.js";
|
|
6
5
|
import "../shared-utils.js";
|
|
7
6
|
import { useCallback as i, useRef as a } from "react";
|
|
8
7
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -13,11 +12,11 @@ function d(e, t, n) {
|
|
|
13
12
|
return !e || !n ? t : n(e) ?? t;
|
|
14
13
|
}
|
|
15
14
|
function f({ homePath: f, resolveDestination: p }) {
|
|
16
|
-
let { token: m } = s(), h =
|
|
17
|
-
let n = (await
|
|
15
|
+
let { token: m } = s(), h = r(), g = n(), _ = h.user?.email ?? null, v = a(void 0), y = i(async (e) => {
|
|
16
|
+
let n = (await t({
|
|
18
17
|
gateway: "workspace",
|
|
19
18
|
query: c,
|
|
20
|
-
variables: { token:
|
|
19
|
+
variables: { token: e },
|
|
21
20
|
operationName: "ShareGrantByToken",
|
|
22
21
|
workspaceId: !0,
|
|
23
22
|
workspaceToken: !0
|
|
@@ -29,28 +28,28 @@ function f({ homePath: f, resolveDestination: p }) {
|
|
|
29
28
|
sharerName: n.sharerName ?? void 0,
|
|
30
29
|
status: n.status
|
|
31
30
|
}) : null;
|
|
32
|
-
}, []), b = i(async (
|
|
33
|
-
let n = await
|
|
31
|
+
}, []), b = i(async (e) => {
|
|
32
|
+
let n = await t({
|
|
34
33
|
gateway: "workspace",
|
|
35
34
|
query: l,
|
|
36
|
-
variables: { token:
|
|
35
|
+
variables: { token: e },
|
|
37
36
|
operationName: "AcceptShare",
|
|
38
37
|
workspaceId: !0,
|
|
39
38
|
workspaceToken: !0
|
|
40
39
|
});
|
|
41
40
|
if (n.errors?.length) throw Error(n.errors[0].message);
|
|
42
|
-
}, []), x = i(async (
|
|
43
|
-
let n = await
|
|
41
|
+
}, []), x = i(async (e) => {
|
|
42
|
+
let n = await t({
|
|
44
43
|
gateway: "workspace",
|
|
45
44
|
query: u,
|
|
46
|
-
variables: { token:
|
|
45
|
+
variables: { token: e },
|
|
47
46
|
operationName: "DeclineShare",
|
|
48
47
|
workspaceId: !0,
|
|
49
48
|
workspaceToken: !0
|
|
50
49
|
});
|
|
51
50
|
if (n.errors?.length) throw Error(n.errors[0].message);
|
|
52
51
|
}, []);
|
|
53
|
-
return m ? /* @__PURE__ */ o(
|
|
52
|
+
return m ? /* @__PURE__ */ o(e, {
|
|
54
53
|
token: m,
|
|
55
54
|
loadPreview: y,
|
|
56
55
|
accept: b,
|
|
@@ -59,7 +58,7 @@ function f({ homePath: f, resolveDestination: p }) {
|
|
|
59
58
|
g(d(v.current, f, p));
|
|
60
59
|
},
|
|
61
60
|
currentUserEmail: _
|
|
62
|
-
}) : /* @__PURE__ */ o(
|
|
61
|
+
}) : /* @__PURE__ */ o(e, {
|
|
63
62
|
token: "",
|
|
64
63
|
loadPreview: async () => null,
|
|
65
64
|
accept: async () => {},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import "../shared-config.js";
|
|
1
|
+
import { useAuth as e } from "../shared/providers/shell/AuthProvider.js";
|
|
2
|
+
import { useAuthToken as t } from "../shared/providers/shell/AuthTokenProvider.js";
|
|
3
|
+
import { resolveGatewayUrls as n } from "../shared/config/gatewayUrls.js";
|
|
5
4
|
import { useCallback as r, useEffect as i, useMemo as a, useReducer as o, useState as s } from "react";
|
|
6
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
6
|
// src/platform-pages/AffiliatesPage.tsx
|
|
@@ -83,7 +82,7 @@ async function h(e) {
|
|
|
83
82
|
return n.data;
|
|
84
83
|
}
|
|
85
84
|
function g({ productSlug: g }) {
|
|
86
|
-
let { user: x } =
|
|
85
|
+
let { user: x } = e(), { accessToken: S } = t(), C = S ?? "", w = `${a(() => n(), []).globalBaseUrl}/global/graphql`, [T, E] = o(f, d), [D, O] = o(m, p), [k, A] = s(""), [j, M] = s(() => u(g)), { codes: N, loading: P, error: F } = T, { selectedCodeId: I, analytics: L, notes: R } = D, z = x?.id ?? "", B = r(async () => {
|
|
87
86
|
if (z) {
|
|
88
87
|
E({ type: "load:start" });
|
|
89
88
|
try {
|
|
@@ -4,7 +4,6 @@ import { AssistantRuntimeManager as s } from "./runtime.js";
|
|
|
4
4
|
import { AssistantPromptDelivery as c, trackAssistantSandboxTurn as l } from "./promptDelivery.js";
|
|
5
5
|
import { buildProgress as u, isReapedSandboxConnectionError as d, isRecoverable as f, mergeMessagesById as p, sanitize as m } from "./progress.js";
|
|
6
6
|
import { createSandboxBusyGate as h, gateDoneOnSandboxBusy as g } from "./sandboxBusy.js";
|
|
7
|
-
import "./gatewayClient.js";
|
|
8
7
|
import { AssistantQuotaRefusal as _, describeQuotaError as v, isQuotaExhaustedError as y } from "./quota.js";
|
|
9
8
|
import { TURN_OUTCOME_COPY as b } from "./turnOutcomeCopy.js";
|
|
10
9
|
import { assistantLlmTerminalCodeOf as x } from "./sandboxProxyError.js";
|
|
@@ -296,6 +296,7 @@ export * from './uiActions/backStack';
|
|
|
296
296
|
export * from './uiActions/draftPathname';
|
|
297
297
|
export * from './uiActions/navigateAction';
|
|
298
298
|
export * from './uiActions/assistantHref';
|
|
299
|
+
export * from './uiActions/assistantLinkNavigation';
|
|
299
300
|
export * from './uiActions/inAppLinks';
|
|
300
301
|
export * from './uiActions/entityRoutes';
|
|
301
302
|
export * from './uiActions/resolveTarget';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { FC,
|
|
2
|
-
import { assistantRoutePath,
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { assistantRoutePath, browserShouldHandle, classifyAssistantHref, AssistantLinkKind } from '../uiActions/assistantLinkNavigation';
|
|
3
|
+
import { assistantUrlTransform } from '../uiActions/assistantHref';
|
|
3
4
|
import { NavigationInitiator, UnsavedChange } from '../../navigation/unsavedChanges';
|
|
4
5
|
interface Props {
|
|
5
6
|
content: string;
|
|
6
7
|
}
|
|
7
|
-
export { assistantRoutePath, assistantUrlTransform, classifyAssistantHref };
|
|
8
|
+
export { assistantRoutePath, assistantUrlTransform, browserShouldHandle, classifyAssistantHref };
|
|
8
9
|
export type { AssistantLinkKind };
|
|
9
10
|
/**
|
|
10
11
|
* ★ BOFF-8060 (N1a, C7): what a navigator reports about the hand-over, so the
|
|
@@ -60,26 +61,6 @@ export interface AssistantNavigateContext {
|
|
|
60
61
|
* `initiator`; `createAssistantNavigate` reads it.
|
|
61
62
|
*/
|
|
62
63
|
export type AssistantNavigate = (path: string, initiator?: AssistantNavigateInitiator, context?: AssistantNavigateContext) => AssistantNavigateResult | void | Promise<AssistantNavigateResult | void>;
|
|
63
|
-
/**
|
|
64
|
-
* ★★ The cases where the BROWSER must win, not the router. Losing these is how
|
|
65
|
-
* "open in new tab", "copy link" and middle-click quietly stop working — the
|
|
66
|
-
* reason the anchor also keeps a real `href` rather than becoming a button.
|
|
67
|
-
*
|
|
68
|
-
* ★★ THE ANCHOR SHOWS THE RESOLVED PATH, NOT THE RAW HREF, and that is a
|
|
69
|
-
* correctness fix rather than cosmetics. A document-relative href resolves
|
|
70
|
-
* against the CURRENT PAGE in the browser but against the ORIGIN in
|
|
71
|
-
* `assistantRoutePath`, so the two click modes disagreed:
|
|
72
|
-
*
|
|
73
|
-
* on /healthybowl/crops/42, `[x](fields)`
|
|
74
|
-
* plain click -> navigate("/fields") (resolved at the root)
|
|
75
|
-
* ctrl-click -> browser opens /healthybowl/crops/fields
|
|
76
|
-
*
|
|
77
|
-
* Same link, two destinations depending on how it was clicked — and "copy link
|
|
78
|
-
* address" gave a third answer. Emitting `routePath` as the href makes every
|
|
79
|
-
* mode agree, because there is then only one resolved value. A fragment and an
|
|
80
|
-
* external URL are left exactly as written: neither is a route.
|
|
81
|
-
*/
|
|
82
|
-
export declare function browserShouldHandle(event: MouseEvent<HTMLAnchorElement>): boolean;
|
|
83
64
|
/**
|
|
84
65
|
* ★ Context, not a prop: the renderer is reached by TWO paths — the chat
|
|
85
66
|
* transcript and the voice transcript drawer — and threading a prop through
|
|
@@ -6,44 +6,41 @@ import { defaultSchema as i } from "../../../node_modules/hast-util-sanitize/lib
|
|
|
6
6
|
import { useAssistantTr as a } from "../i18n.js";
|
|
7
7
|
import { copyToClipboard as o } from "../clipboard.js";
|
|
8
8
|
import { AssistantMarkdownImage as s } from "./AssistantMarkdownImage.js";
|
|
9
|
-
import { assistantRoutePath as c,
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { assistantRoutePath as c, browserShouldHandle as l, classifyAssistantHref as u } from "../uiActions/assistantLinkNavigation.js";
|
|
10
|
+
import { assistantUrlTransform as d } from "../uiActions/assistantHref.js";
|
|
11
|
+
import { createContext as f, useContext as p, useState as m } from "react";
|
|
12
|
+
import { Check as h, Copy as g } from "lucide-react";
|
|
13
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
14
|
// src/shared/assistant/ui/AssistantMarkdownRenderer.tsx
|
|
14
|
-
var
|
|
15
|
+
var b = {
|
|
15
16
|
...i,
|
|
16
17
|
protocols: {
|
|
17
18
|
...i.protocols,
|
|
18
19
|
src: [...i.protocols?.src ?? [], "data"]
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
-
function b(e) {
|
|
22
|
-
return e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
|
|
23
|
-
}
|
|
24
|
-
var x = d(null), S = ({ value: e, children: t }) => /* @__PURE__ */ _(x.Provider, {
|
|
21
|
+
}, x = f(null), S = ({ value: e, children: t }) => /* @__PURE__ */ v(x.Provider, {
|
|
25
22
|
value: e ?? null,
|
|
26
23
|
children: t
|
|
27
24
|
});
|
|
28
25
|
function C() {
|
|
29
|
-
return
|
|
26
|
+
return p(x);
|
|
30
27
|
}
|
|
31
28
|
var w = "text-action-primary-bg underline-offset-2 hover:underline", T = ({ href: e, children: t }) => {
|
|
32
29
|
let n = C(), r = u(e), i = r === "internal" ? c(e) : null;
|
|
33
|
-
return r === "blocked" ? /* @__PURE__ */ _
|
|
30
|
+
return r === "blocked" ? /* @__PURE__ */ v(_, { children: t }) : n && i ? /* @__PURE__ */ v("a", {
|
|
34
31
|
href: i,
|
|
35
32
|
className: w,
|
|
36
33
|
"data-testid": "assistant-markdown-link",
|
|
37
34
|
onClick: (e) => {
|
|
38
|
-
|
|
35
|
+
l(e) || (e.preventDefault(), Promise.resolve(n(i, "person", { surface: "reply-link" })).catch(() => void 0));
|
|
39
36
|
},
|
|
40
37
|
children: t
|
|
41
|
-
}) : r === "internal" || r === "fragment" ? /* @__PURE__ */
|
|
38
|
+
}) : r === "internal" || r === "fragment" ? /* @__PURE__ */ v("a", {
|
|
42
39
|
href: i ?? e,
|
|
43
40
|
className: w,
|
|
44
41
|
"data-testid": "assistant-markdown-link",
|
|
45
42
|
children: t
|
|
46
|
-
}) : /* @__PURE__ */
|
|
43
|
+
}) : /* @__PURE__ */ v("a", {
|
|
47
44
|
href: e,
|
|
48
45
|
target: "_blank",
|
|
49
46
|
rel: "noopener noreferrer",
|
|
@@ -51,17 +48,17 @@ var w = "text-action-primary-bg underline-offset-2 hover:underline", T = ({ href
|
|
|
51
48
|
"data-testid": "assistant-markdown-link",
|
|
52
49
|
children: t
|
|
53
50
|
});
|
|
54
|
-
}, E = [n], D = [[r,
|
|
51
|
+
}, E = [n], D = [[r, b]];
|
|
55
52
|
function O({ language: t, code: n }) {
|
|
56
|
-
let r = e(), i = a(), [s, c] =
|
|
57
|
-
return /* @__PURE__ */
|
|
53
|
+
let r = e(), i = a(), [s, c] = m(!1);
|
|
54
|
+
return /* @__PURE__ */ y("div", {
|
|
58
55
|
className: "group relative my-2 overflow-hidden rounded-md border border-border-default bg-bg-sunken",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ y("div", {
|
|
60
57
|
className: "flex items-center justify-between border-b border-border-default bg-bg-elevated px-3 py-1.5",
|
|
61
|
-
children: [/* @__PURE__ */
|
|
58
|
+
children: [/* @__PURE__ */ v("span", {
|
|
62
59
|
className: "font-mono text-[10px] uppercase tracking-wider text-text-muted",
|
|
63
60
|
children: t || r.code
|
|
64
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ v("button", {
|
|
65
62
|
type: "button",
|
|
66
63
|
onClick: () => {
|
|
67
64
|
o(n).then((e) => {
|
|
@@ -71,11 +68,11 @@ function O({ language: t, code: n }) {
|
|
|
71
68
|
className: "flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
72
69
|
"aria-label": i("markdown.copyCode", "Copy code"),
|
|
73
70
|
"data-testid": "assistant-markdown-copy-code",
|
|
74
|
-
children: s ? /* @__PURE__ */
|
|
71
|
+
children: s ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(h, { className: "size-3 text-status-success-text" }), /* @__PURE__ */ v("span", { children: i("markdown.copied", "Copied") })] }) : /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, { className: "size-3" }), /* @__PURE__ */ v("span", { children: i("markdown.copy", "Copy") })] })
|
|
75
72
|
})]
|
|
76
|
-
}), /* @__PURE__ */
|
|
73
|
+
}), /* @__PURE__ */ v("pre", {
|
|
77
74
|
className: "overflow-x-auto p-3 text-xs leading-relaxed",
|
|
78
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ v("code", {
|
|
79
76
|
className: "font-mono text-text-primary",
|
|
80
77
|
children: n
|
|
81
78
|
})
|
|
@@ -102,128 +99,128 @@ function j({ level: e, children: t }) {
|
|
|
102
99
|
5: "text-[0.95em]",
|
|
103
100
|
6: "text-[0.9em]"
|
|
104
101
|
}[e];
|
|
105
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ v(n, {
|
|
106
103
|
className: `mb-1 mt-3 font-semibold text-text-primary ${r}`,
|
|
107
104
|
children: t
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
107
|
var M = {
|
|
111
|
-
a: ({ href: e, children: t }) => /* @__PURE__ */
|
|
108
|
+
a: ({ href: e, children: t }) => /* @__PURE__ */ v(T, {
|
|
112
109
|
href: e,
|
|
113
110
|
children: t
|
|
114
111
|
}),
|
|
115
|
-
blockquote: ({ children: e }) => /* @__PURE__ */
|
|
112
|
+
blockquote: ({ children: e }) => /* @__PURE__ */ v("blockquote", {
|
|
116
113
|
className: "my-2 border-s-2 border-action-primary-bg ps-3 italic text-text-secondary",
|
|
117
114
|
children: e
|
|
118
115
|
}),
|
|
119
|
-
code: ({ children: e }) => /* @__PURE__ */
|
|
116
|
+
code: ({ children: e }) => /* @__PURE__ */ v("code", {
|
|
120
117
|
className: "rounded bg-bg-sunken px-1 py-0.5 font-mono text-[0.85em] text-text-primary",
|
|
121
118
|
children: e
|
|
122
119
|
}),
|
|
123
|
-
del: ({ children: e }) => /* @__PURE__ */
|
|
120
|
+
del: ({ children: e }) => /* @__PURE__ */ v("del", {
|
|
124
121
|
className: "text-text-muted line-through",
|
|
125
122
|
children: e
|
|
126
123
|
}),
|
|
127
|
-
em: ({ children: e }) => /* @__PURE__ */
|
|
124
|
+
em: ({ children: e }) => /* @__PURE__ */ v("em", {
|
|
128
125
|
className: "italic",
|
|
129
126
|
children: e
|
|
130
127
|
}),
|
|
131
|
-
h1: ({ children: e }) => /* @__PURE__ */
|
|
128
|
+
h1: ({ children: e }) => /* @__PURE__ */ v(j, {
|
|
132
129
|
level: 2,
|
|
133
130
|
children: e
|
|
134
131
|
}),
|
|
135
|
-
h2: ({ children: e }) => /* @__PURE__ */
|
|
132
|
+
h2: ({ children: e }) => /* @__PURE__ */ v(j, {
|
|
136
133
|
level: 3,
|
|
137
134
|
children: e
|
|
138
135
|
}),
|
|
139
|
-
h3: ({ children: e }) => /* @__PURE__ */
|
|
136
|
+
h3: ({ children: e }) => /* @__PURE__ */ v(j, {
|
|
140
137
|
level: 4,
|
|
141
138
|
children: e
|
|
142
139
|
}),
|
|
143
|
-
h4: ({ children: e }) => /* @__PURE__ */
|
|
140
|
+
h4: ({ children: e }) => /* @__PURE__ */ v(j, {
|
|
144
141
|
level: 5,
|
|
145
142
|
children: e
|
|
146
143
|
}),
|
|
147
|
-
h5: ({ children: e }) => /* @__PURE__ */
|
|
144
|
+
h5: ({ children: e }) => /* @__PURE__ */ v(j, {
|
|
148
145
|
level: 6,
|
|
149
146
|
children: e
|
|
150
147
|
}),
|
|
151
|
-
h6: ({ children: e }) => /* @__PURE__ */
|
|
148
|
+
h6: ({ children: e }) => /* @__PURE__ */ v(j, {
|
|
152
149
|
level: 6,
|
|
153
150
|
children: e
|
|
154
151
|
}),
|
|
155
|
-
hr: () => /* @__PURE__ */
|
|
156
|
-
img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */
|
|
152
|
+
hr: () => /* @__PURE__ */ v("hr", { className: "my-3 border-border-default" }),
|
|
153
|
+
img: ({ src: e, alt: t, title: n }) => /* @__PURE__ */ v(s, {
|
|
157
154
|
src: typeof e == "string" ? e : void 0,
|
|
158
155
|
alt: t,
|
|
159
156
|
title: n
|
|
160
157
|
}),
|
|
161
|
-
input: ({ checked: e, type: t }) => t === "checkbox" ? /* @__PURE__ */
|
|
158
|
+
input: ({ checked: e, type: t }) => t === "checkbox" ? /* @__PURE__ */ v("input", {
|
|
162
159
|
type: "checkbox",
|
|
163
160
|
checked: !!e,
|
|
164
161
|
disabled: !0,
|
|
165
162
|
className: "me-1.5 size-3 flex-shrink-0 align-[-0.1em] accent-[var(--color-action-primary-bg)]"
|
|
166
163
|
}) : null,
|
|
167
|
-
li: ({ className: e, children: t }) => /* @__PURE__ */
|
|
164
|
+
li: ({ className: e, children: t }) => /* @__PURE__ */ v("li", {
|
|
168
165
|
className: A(e, "task-list-item") ? "list-none text-text-primary" : "text-text-primary",
|
|
169
166
|
children: t
|
|
170
167
|
}),
|
|
171
|
-
ol: ({ children: e }) => /* @__PURE__ */
|
|
168
|
+
ol: ({ children: e }) => /* @__PURE__ */ v("ol", {
|
|
172
169
|
className: "my-1.5 ms-5 list-decimal space-y-0.5",
|
|
173
170
|
children: e
|
|
174
171
|
}),
|
|
175
|
-
p: ({ children: e }) => /* @__PURE__ */
|
|
172
|
+
p: ({ children: e }) => /* @__PURE__ */ v("p", {
|
|
176
173
|
className: "my-1.5 leading-relaxed text-text-primary",
|
|
177
174
|
children: e
|
|
178
175
|
}),
|
|
179
176
|
pre: ({ children: e, node: t }) => {
|
|
180
177
|
let n = k(t);
|
|
181
|
-
return n ? /* @__PURE__ */
|
|
178
|
+
return n ? /* @__PURE__ */ v(O, {
|
|
182
179
|
language: n.language,
|
|
183
180
|
code: n.code
|
|
184
|
-
}) : /* @__PURE__ */
|
|
181
|
+
}) : /* @__PURE__ */ v("pre", {
|
|
185
182
|
className: "my-2 overflow-x-auto rounded-md border border-border-default bg-bg-sunken p-3 text-xs leading-relaxed",
|
|
186
183
|
children: e
|
|
187
184
|
});
|
|
188
185
|
},
|
|
189
|
-
strong: ({ children: e }) => /* @__PURE__ */
|
|
186
|
+
strong: ({ children: e }) => /* @__PURE__ */ v("strong", {
|
|
190
187
|
className: "font-semibold text-text-primary",
|
|
191
188
|
children: e
|
|
192
189
|
}),
|
|
193
|
-
table: ({ children: e }) => /* @__PURE__ */
|
|
190
|
+
table: ({ children: e }) => /* @__PURE__ */ v("div", {
|
|
194
191
|
className: "my-2 overflow-x-auto",
|
|
195
192
|
"data-testid": "assistant-markdown-table",
|
|
196
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ v("table", {
|
|
197
194
|
className: "w-full border-collapse text-[0.9em]",
|
|
198
195
|
children: e
|
|
199
196
|
})
|
|
200
197
|
}),
|
|
201
|
-
td: ({ children: e }) => /* @__PURE__ */
|
|
198
|
+
td: ({ children: e }) => /* @__PURE__ */ v("td", {
|
|
202
199
|
className: "px-2 py-1.5 align-top text-text-primary",
|
|
203
200
|
children: e
|
|
204
201
|
}),
|
|
205
|
-
th: ({ children: e }) => /* @__PURE__ */
|
|
202
|
+
th: ({ children: e }) => /* @__PURE__ */ v("th", {
|
|
206
203
|
scope: "col",
|
|
207
204
|
className: "px-2 py-1.5 text-start font-semibold text-text-primary",
|
|
208
205
|
children: e
|
|
209
206
|
}),
|
|
210
|
-
tr: ({ children: e }) => /* @__PURE__ */
|
|
207
|
+
tr: ({ children: e }) => /* @__PURE__ */ v("tr", {
|
|
211
208
|
className: "border-b border-border-subtle",
|
|
212
209
|
children: e
|
|
213
210
|
}),
|
|
214
|
-
ul: ({ className: e, children: t }) => /* @__PURE__ */
|
|
211
|
+
ul: ({ className: e, children: t }) => /* @__PURE__ */ v("ul", {
|
|
215
212
|
className: A(e, "contains-task-list") ? "my-1.5 ms-0.5 list-none space-y-0.5" : "my-1.5 ms-5 list-disc space-y-0.5",
|
|
216
213
|
children: t
|
|
217
214
|
})
|
|
218
|
-
}, N = ({ content: e }) => /* @__PURE__ */
|
|
215
|
+
}, N = ({ content: e }) => /* @__PURE__ */ v("div", {
|
|
219
216
|
className: "break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
220
217
|
"data-testid": "assistant-markdown",
|
|
221
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ v(t, {
|
|
222
219
|
remarkPlugins: E,
|
|
223
220
|
rehypePlugins: D,
|
|
224
|
-
urlTransform:
|
|
221
|
+
urlTransform: d,
|
|
225
222
|
components: M,
|
|
226
223
|
children: e
|
|
227
224
|
})
|
|
228
225
|
});
|
|
229
|
-
export { N as AssistantMarkdownRenderer, S as AssistantNavigateProvider, c as assistantRoutePath,
|
|
226
|
+
export { N as AssistantMarkdownRenderer, S as AssistantNavigateProvider, c as assistantRoutePath, d as assistantUrlTransform, l as browserShouldHandle, u as classifyAssistantHref, C as useAssistantNavigate };
|