@drawnagency/primitives 0.1.89 → 0.1.91
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/{chunk-75P6HWPN.js → chunk-5BM2Y3NJ.js} +5 -3
- package/dist/{chunk-VK5KNH73.js → chunk-AGWE2LJG.js} +2 -2
- package/dist/{chunk-2QXJ2KGB.js → chunk-KBQNJZUX.js} +1 -1
- package/dist/{chunk-WCBYXNAG.js → chunk-KMQZYORS.js} +1 -0
- package/dist/{chunk-Y24T75HT.js → chunk-MK7YB2A4.js} +1 -1
- package/dist/{chunk-QFV5TSPO.js → chunk-SIYQ37QY.js} +12 -4
- package/dist/{chunk-J75XGXYD.js → chunk-XKRQMTE4.js} +9 -0
- package/dist/{chunk-L2MAJKKC.js → chunk-XUIJHYKI.js} +2 -2
- package/dist/{chunk-MVX4ULYE.js → chunk-ZLG7S54V.js} +241 -82
- package/dist/components/chat/ChatPanel.d.ts +14 -6
- package/dist/components/chat/ChatPanel.d.ts.map +1 -1
- package/dist/components/chat/ChatWidget.d.ts.map +1 -1
- package/dist/components/editor/AudienceIndicator.d.ts +6 -0
- package/dist/components/editor/AudienceIndicator.d.ts.map +1 -1
- package/dist/components/editor/ChildBlockWrapper.d.ts.map +1 -1
- package/dist/components/editor/ColSpanControl.d.ts.map +1 -1
- package/dist/components/editor/DragHandle.d.ts +3 -1
- package/dist/components/editor/DragHandle.d.ts.map +1 -1
- package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
- package/dist/components/editor/StatusIndicator.d.ts +7 -0
- package/dist/components/editor/StatusIndicator.d.ts.map +1 -1
- package/dist/components/editor/index.js +98 -76
- package/dist/components/primitives/index.js +3 -3
- package/dist/components/sections/Container/Container.d.ts +3 -2
- package/dist/components/sections/Container/Container.d.ts.map +1 -1
- package/dist/components/sections/Container/ContainerSettingsForm.d.ts +4 -2
- package/dist/components/sections/Container/ContainerSettingsForm.d.ts.map +1 -1
- package/dist/components/sections/Container/index.d.ts +8 -2
- package/dist/components/sections/Container/index.d.ts.map +1 -1
- package/dist/components/sections/SectionLayout.d.ts +3 -1
- package/dist/components/sections/SectionLayout.d.ts.map +1 -1
- package/dist/components/sections/ViewRenderer.d.ts +3 -1
- package/dist/components/sections/ViewRenderer.d.ts.map +1 -1
- package/dist/components/sections/all-sections.d.ts +8 -2
- package/dist/components/sections/all-sections.d.ts.map +1 -1
- package/dist/components/sections/brand-guide.js +3 -3
- package/dist/components/sections/core-sections.d.ts +8 -2
- package/dist/components/sections/core-sections.d.ts.map +1 -1
- package/dist/components/sections/register-schemas.js +6 -6
- package/dist/components/sections/register.js +6 -6
- package/dist/components/shared/Fab.d.ts +37 -0
- package/dist/components/shared/Fab.d.ts.map +1 -0
- package/dist/components/shared/Tooltip.d.ts +8 -1
- package/dist/components/shared/Tooltip.d.ts.map +1 -1
- package/dist/components/shell/AudiencePreviewMenu.d.ts +7 -0
- package/dist/components/shell/AudiencePreviewMenu.d.ts.map +1 -0
- package/dist/components/shell/AuthoringDefaultsMenu.d.ts +10 -0
- package/dist/components/shell/AuthoringDefaultsMenu.d.ts.map +1 -0
- package/dist/components/shell/BugReportFAB.d.ts.map +1 -1
- package/dist/components/shell/EditorContext.d.ts +3 -0
- package/dist/components/shell/EditorContext.d.ts.map +1 -1
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/components/shell/SiteSettingsChatbot.d.ts.map +1 -1
- package/dist/hooks/useBuildStatus.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/lib/authoring-defaults.d.ts +17 -0
- package/dist/lib/authoring-defaults.d.ts.map +1 -0
- package/dist/lib/container-grid.d.ts +6 -0
- package/dist/lib/container-grid.d.ts.map +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/lib/migrate-sections-transform.js +1 -1
- package/dist/media/index.js +1 -1
- package/dist/schemas/index.js +4 -2
- package/dist/schemas/site-config.d.ts +6 -0
- package/dist/schemas/site-config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/ChatPanel.tsx +51 -19
- package/src/components/chat/ChatWidget.tsx +113 -51
- package/src/components/editor/AudienceIndicator.tsx +50 -37
- package/src/components/editor/ChildBlockWrapper.tsx +8 -7
- package/src/components/editor/ColSpanControl.tsx +14 -11
- package/src/components/editor/DragHandle.tsx +5 -2
- package/src/components/editor/PagesModal.tsx +10 -10
- package/src/components/editor/SectionWrapper.tsx +32 -21
- package/src/components/editor/StatusIndicator.tsx +37 -24
- package/src/components/sections/Container/Container.tsx +185 -43
- package/src/components/sections/Container/ContainerSettingsForm.tsx +64 -24
- package/src/components/sections/Container/index.tsx +45 -20
- package/src/components/sections/SectionLayout.tsx +13 -3
- package/src/components/sections/ViewRenderer.tsx +11 -2
- package/src/components/shared/Fab.tsx +57 -0
- package/src/components/shared/Tooltip.tsx +18 -2
- package/src/components/shell/AudiencePreviewMenu.tsx +73 -0
- package/src/components/shell/AuthoringDefaultsMenu.tsx +54 -0
- package/src/components/shell/BugReportFAB.tsx +3 -7
- package/src/components/shell/EditorContext.tsx +5 -1
- package/src/components/shell/EditorShell.tsx +80 -25
- package/src/components/shell/SiteSettingsChatbot.tsx +2 -1
- package/src/hooks/useBuildStatus.ts +35 -4
- package/src/lib/authoring-defaults.ts +42 -0
- package/src/lib/container-grid.ts +14 -0
- package/src/lib/migrate-sections-transform.ts +5 -3
- package/src/schemas/site-config.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-ZLG7S54V.js";
|
|
4
|
+
import "../../chunk-XUIJHYKI.js";
|
|
5
|
+
import "../../chunk-SIYQ37QY.js";
|
|
6
6
|
import "../../chunk-5THS4K5D.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-KBQNJZUX.js";
|
|
8
|
+
import "../../chunk-XKRQMTE4.js";
|
|
9
9
|
import "../../chunk-ZSPCE6MZ.js";
|
|
10
10
|
import "../../chunk-NV4R6VHN.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
@@ -16,7 +16,7 @@ import "../../chunk-53DKVAB6.js";
|
|
|
16
16
|
import "../../chunk-7EOSDFS3.js";
|
|
17
17
|
import "../../chunk-YBVK254P.js";
|
|
18
18
|
import "../../chunk-TZQPOR5A.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-KMQZYORS.js";
|
|
20
20
|
import {
|
|
21
21
|
registerSection
|
|
22
22
|
} from "../../chunk-VKAGMEKE.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode, Ref } from "react";
|
|
2
|
+
/** Floating action button — the round primary buttons floating over the page.
|
|
3
|
+
*
|
|
4
|
+
* The `column` is both the placement and the behavior hook: base.css hides
|
|
5
|
+
* every member of both columns (shrink + fade) while the chat is open, keyed
|
|
6
|
+
* on the column class, so a new FAB participates in the chat open/close
|
|
7
|
+
* choreography just by rendering through this component. Positions are
|
|
8
|
+
* static on purpose — FABs are only visible while the chat is closed
|
|
9
|
+
* (--chat-space: 0), so they never need to track the docked sidebar.
|
|
10
|
+
*
|
|
11
|
+
* - "viewer": viewport corner stack (z-40, h-12). Rendered on SSR viewer
|
|
12
|
+
* pages too — keep this component hook-free so it stays server-renderable
|
|
13
|
+
* without hydration.
|
|
14
|
+
* - "editor": the /edit FAB column (z-50, h-10), content-edge aligned at lg+
|
|
15
|
+
* via fab-container-right.
|
|
16
|
+
*
|
|
17
|
+
* Renders an <a> when `href` is set, else a <button type="button">. The
|
|
18
|
+
* caller supplies the vertical slot (bottom-*) via className and the icon as
|
|
19
|
+
* children.
|
|
20
|
+
*/
|
|
21
|
+
interface FabCommon {
|
|
22
|
+
/** Accessible name — FABs are icon-only. */
|
|
23
|
+
label: string;
|
|
24
|
+
column: "viewer" | "editor";
|
|
25
|
+
/** Vertical slot (bottom-*) plus any per-FAB extras. */
|
|
26
|
+
className?: string;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export type FabProps = ({
|
|
30
|
+
href: string;
|
|
31
|
+
} & FabCommon & Omit<ComponentPropsWithoutRef<"a">, "children" | "className" | "aria-label">) | ({
|
|
32
|
+
href?: undefined;
|
|
33
|
+
ref?: Ref<HTMLButtonElement>;
|
|
34
|
+
} & FabCommon & Omit<ComponentPropsWithoutRef<"button">, "children" | "className" | "aria-label" | "type">);
|
|
35
|
+
export default function Fab({ label, column, className, children, ...rest }: FabProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=Fab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Fab.d.ts","sourceRoot":"","sources":["../../../src/components/shared/Fab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,UAAU,SAAS;IACjB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,QAAQ,GAChB,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC,CAAC,GAC7G,CAAC;IAAE,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAAE,GAAG,SAAS,GAC7D,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC;AAElG,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,2CAoBpF"}
|
|
@@ -3,8 +3,15 @@ interface TooltipProps {
|
|
|
3
3
|
content: ReactNode;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
className?: string;
|
|
6
|
+
/** Where the bubble sits relative to the trigger:
|
|
7
|
+
* - "bottom" (default): below, centered.
|
|
8
|
+
* - "right": to the right (used by the container child rail, a narrow left gutter).
|
|
9
|
+
* - "bottom-clamp": below, centered on wide viewports but right-aligned under `xl`
|
|
10
|
+
* (where the top toolbar hits the viewport width) so a far-right button's bubble
|
|
11
|
+
* can't overflow off the right edge of the screen. */
|
|
12
|
+
side?: "bottom" | "right" | "bottom-clamp";
|
|
6
13
|
}
|
|
7
|
-
export declare function Tooltip({ content, children, className }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function Tooltip({ content, children, className, side }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
8
15
|
export declare function Kbd({ children }: {
|
|
9
16
|
children: ReactNode;
|
|
10
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/shared/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,YAAY;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/shared/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,YAAY;IACpB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;6DAKyD;IACzD,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAC;CAC5C;AAQD,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAe,EAAE,EAAE,YAAY,2CAiBtF;AAED,wBAAgB,GAAG,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAExD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Audience } from "../../auth/types";
|
|
2
|
+
interface AudiencePreviewMenuProps {
|
|
3
|
+
audiences: Audience[];
|
|
4
|
+
}
|
|
5
|
+
export declare function AudiencePreviewMenu({ audiences }: AudiencePreviewMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AudiencePreviewMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudiencePreviewMenu.d.ts","sourceRoot":"","sources":["../../../src/components/shell/AudiencePreviewMenu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,wBAAwB;IAChC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE,wBAAwB,2CA4D1E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuthoringDefaults } from "../../lib/authoring-defaults";
|
|
2
|
+
import type { Audience } from "../../auth/types";
|
|
3
|
+
interface AuthoringDefaultsMenuProps {
|
|
4
|
+
defaults: AuthoringDefaults;
|
|
5
|
+
audiences: Audience[];
|
|
6
|
+
onChange: (next: AuthoringDefaults) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function AuthoringDefaultsMenu({ defaults, audiences, onChange }: AuthoringDefaultsMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=AuthoringDefaultsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthoringDefaultsMenu.d.ts","sourceRoot":"","sources":["../../../src/components/shell/AuthoringDefaultsMenu.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,0BAA0B;IAClC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,0BAA0B,2CAsClG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BugReportFAB.d.ts","sourceRoot":"","sources":["../../../src/components/shell/BugReportFAB.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BugReportFAB.d.ts","sourceRoot":"","sources":["../../../src/components/shell/BugReportFAB.tsx"],"names":[],"mappings":"AA8BA,wBAAgB,YAAY,mDAqT3B"}
|
|
@@ -14,11 +14,14 @@ interface EditorContextValue {
|
|
|
14
14
|
viewBranch: "saved" | "live";
|
|
15
15
|
historyState: HistoryState;
|
|
16
16
|
historyPageId: string | null;
|
|
17
|
+
/** Audience-preview mode: dim sections this audience can't access. null = off. */
|
|
18
|
+
previewAudience: string | null;
|
|
17
19
|
toggleEditMode: () => void;
|
|
18
20
|
toggleShowAllChrome: () => void;
|
|
19
21
|
setViewBranch: (branch: "saved" | "live") => void;
|
|
20
22
|
setHistoryState: (state: HistoryState) => void;
|
|
21
23
|
setHistoryPageId: (pageId: string | null) => void;
|
|
24
|
+
setPreviewAudience: (audience: string | null) => void;
|
|
22
25
|
}
|
|
23
26
|
interface EditorProviderProps {
|
|
24
27
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorContext.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB,GAAG,IAAI,CAAC;AAET,UAAU,kBAAkB;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorContext.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB,GAAG,IAAI,CAAC;AAET,UAAU,kBAAkB;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kFAAkF;IAClF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAClD,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAClD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACvD;AAID,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CA6B/D;AAED,wBAAgB,gBAAgB,IAAI,kBAAkB,CAMrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAcjD,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAuDtF,OAAO,KAAK,EAAE,eAAe,EAA2D,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAcjD,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAuDtF,OAAO,KAAK,EAAE,eAAe,EAA2D,MAAM,oBAAoB,CAAC;AAwCnH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAoBxD,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAIhB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;QACvB,YAAY,EAAE,OAAO,CAAC;QACtB,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;KAAE,GAAG,IAAI,CAAC;IAIhE,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAKjC,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,OAAO,EACP,YAAY,EACZ,MAAM,EACN,SAAS,EAAE,gBAAgB,EAC3B,YAAY,EACZ,WAAW,EACX,sBAA8B,EAC9B,eAAe,GAChB,EAAE,KAAK,2CA4mDP;AAuED;6EAC6E;AAC7E,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,WAAW,CAAC,YAAY,CAAC,EACvC,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,eAAe,EAAE,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteSettingsChatbot.d.ts","sourceRoot":"","sources":["../../../src/components/shell/SiteSettingsChatbot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SiteSettingsChatbot.d.ts","sourceRoot":"","sources":["../../../src/components/shell/SiteSettingsChatbot.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAcjD,UAAU,KAAK;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACjD,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAsBD,wBAAgB,mBAAmB,CAAC,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,KAAK,2CA4LxG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBuildStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useBuildStatus.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AASrE,UAAU,iBAAiB;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"useBuildStatus.d.ts","sourceRoot":"","sources":["../../src/hooks/useBuildStatus.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AASrE,UAAU,iBAAiB;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAkBD,wBAAgB,cAAc,IAAI,iBAAiB,CAkKlD"}
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
AudienceNameSchema,
|
|
52
52
|
MediaGridOptionsSchema,
|
|
53
53
|
slugifyAudienceName
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-MK7YB2A4.js";
|
|
55
55
|
import {
|
|
56
56
|
AudienceSchema,
|
|
57
57
|
RoleSchema,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
resolveChatbotName,
|
|
78
78
|
resolveThinkingPhrases,
|
|
79
79
|
safeRedirect
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-AGWE2LJG.js";
|
|
81
81
|
import {
|
|
82
82
|
curatedIcons,
|
|
83
83
|
getIcon
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
audiencePasses
|
|
107
107
|
} from "./chunk-YBVK254P.js";
|
|
108
|
-
import "./chunk-
|
|
108
|
+
import "./chunk-5BM2Y3NJ.js";
|
|
109
109
|
import {
|
|
110
110
|
getSectionContentSchema,
|
|
111
111
|
getSectionSchema
|
|
@@ -127,10 +127,11 @@ import {
|
|
|
127
127
|
SectionMetaSchema,
|
|
128
128
|
SingleMediaReferenceSchema,
|
|
129
129
|
SiteConfigSchema,
|
|
130
|
+
StatusSchema,
|
|
130
131
|
TextLineSchema,
|
|
131
132
|
VariantSchema,
|
|
132
133
|
normalizeSiteIndex
|
|
133
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-KMQZYORS.js";
|
|
134
135
|
import {
|
|
135
136
|
clearRegistry,
|
|
136
137
|
createRegistry,
|
|
@@ -202,6 +203,7 @@ export {
|
|
|
202
203
|
SingleMediaReferenceSchema,
|
|
203
204
|
SiteConfigSchema,
|
|
204
205
|
SiteUserSchema,
|
|
206
|
+
StatusSchema,
|
|
205
207
|
StorageConflictError,
|
|
206
208
|
TakeoverMessageSchema,
|
|
207
209
|
TextLineSchema,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Audience } from "../auth/types";
|
|
3
|
+
export declare const AuthoringDefaultsSchema: z.ZodObject<{
|
|
4
|
+
status: z.ZodPipe<z.ZodEnum<{
|
|
5
|
+
draft: "draft";
|
|
6
|
+
live: "live";
|
|
7
|
+
archived: "archived";
|
|
8
|
+
published: "published";
|
|
9
|
+
}>, z.ZodTransform<"draft" | "live" | "archived", "draft" | "live" | "archived" | "published">>;
|
|
10
|
+
access: z.ZodArray<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type AuthoringDefaults = z.infer<typeof AuthoringDefaultsSchema>;
|
|
13
|
+
export declare const FALLBACK_AUTHORING_DEFAULTS: AuthoringDefaults;
|
|
14
|
+
export declare function loadAuthoringDefaults(): AuthoringDefaults;
|
|
15
|
+
export declare function saveAuthoringDefaults(defaults: AuthoringDefaults): void;
|
|
16
|
+
export declare function filterAccessToKnown(access: string[], audiences: Audience[]): string[];
|
|
17
|
+
//# sourceMappingURL=authoring-defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authoring-defaults.d.ts","sourceRoot":"","sources":["../../src/lib/authoring-defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,uBAAuB;;;;;;;;iBAGlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,2BAA2B,EAAE,iBAAmD,CAAC;AAM9F,wBAAgB,qBAAqB,IAAI,iBAAiB,CASzD;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAOvE;AAID,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CAErF"}
|
|
@@ -19,6 +19,12 @@ export declare const colSpanClass: Record<number, Record<number, string>>;
|
|
|
19
19
|
/** Gap token -> Tailwind gap class. Retained as a utility; the container now uses a
|
|
20
20
|
* fixed gap (the Gap setting was removed), but the map stays for general use. */
|
|
21
21
|
export declare const gapClass: Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* Column count -> `columns-N` classes for masonry (CSS multi-column), mirroring
|
|
24
|
+
* `containerGridClass`'s collapse curve (`grid-cols-`→`columns-`). Full static
|
|
25
|
+
* strings so Tailwind's source scan generates them.
|
|
26
|
+
*/
|
|
27
|
+
export declare const masonryColumnsClass: Record<number, string>;
|
|
22
28
|
/**
|
|
23
29
|
* Per-column-count container-query classes that HIDE a spacer cell once the container
|
|
24
30
|
* collapses to a single column (mobile). Mirrors `containerGridClass`'s collapse curve:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-grid.d.ts","sourceRoot":"","sources":["../../src/lib/container-grid.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOrD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/D,CAAC;AAEF;kFACkF;AAClF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK3C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOpD,CAAC"}
|
|
1
|
+
{"version":3,"file":"container-grid.d.ts","sourceRoot":"","sources":["../../src/lib/container-grid.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOrD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO/D,CAAC;AAEF;kFACkF;AAClF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOtD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOpD,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
resolveChatbotName,
|
|
12
12
|
resolveThinkingPhrases,
|
|
13
13
|
safeRedirect
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-AGWE2LJG.js";
|
|
15
15
|
import {
|
|
16
16
|
curatedIcons,
|
|
17
17
|
getIcon
|
|
@@ -35,9 +35,9 @@ import "../chunk-S2L3BPLS.js";
|
|
|
35
35
|
import {
|
|
36
36
|
audiencePasses
|
|
37
37
|
} from "../chunk-YBVK254P.js";
|
|
38
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-5BM2Y3NJ.js";
|
|
39
39
|
import "../chunk-TZQPOR5A.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-KMQZYORS.js";
|
|
41
41
|
import {
|
|
42
42
|
clearRegistry,
|
|
43
43
|
createRegistry,
|
package/dist/media/index.js
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AudienceNameSchema,
|
|
4
4
|
MediaGridOptionsSchema,
|
|
5
5
|
slugifyAudienceName
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-MK7YB2A4.js";
|
|
7
7
|
import {
|
|
8
8
|
AudienceSchema,
|
|
9
9
|
RoleSchema,
|
|
@@ -37,10 +37,11 @@ import {
|
|
|
37
37
|
SectionMetaSchema,
|
|
38
38
|
SingleMediaReferenceSchema,
|
|
39
39
|
SiteConfigSchema,
|
|
40
|
+
StatusSchema,
|
|
40
41
|
TextLineSchema,
|
|
41
42
|
VariantSchema,
|
|
42
43
|
normalizeSiteIndex
|
|
43
|
-
} from "../chunk-
|
|
44
|
+
} from "../chunk-KMQZYORS.js";
|
|
44
45
|
import "../chunk-VKAGMEKE.js";
|
|
45
46
|
import "../chunk-FM4M4Q2W.js";
|
|
46
47
|
import "../chunk-NSCT3AMV.js";
|
|
@@ -72,6 +73,7 @@ export {
|
|
|
72
73
|
SingleMediaReferenceSchema,
|
|
73
74
|
SiteConfigSchema,
|
|
74
75
|
SiteUserSchema,
|
|
76
|
+
StatusSchema,
|
|
75
77
|
TextLineSchema,
|
|
76
78
|
VariantSchema,
|
|
77
79
|
getSectionContentSchema,
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const StatusSchema: z.ZodPipe<z.ZodEnum<{
|
|
3
|
+
draft: "draft";
|
|
4
|
+
live: "live";
|
|
5
|
+
archived: "archived";
|
|
6
|
+
published: "published";
|
|
7
|
+
}>, z.ZodTransform<"draft" | "live" | "archived", "draft" | "live" | "archived" | "published">>;
|
|
2
8
|
export declare const SectionMetaSchema: z.ZodObject<{
|
|
3
9
|
type: z.ZodString;
|
|
4
10
|
status: z.ZodPipe<z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-config.d.ts","sourceRoot":"","sources":["../../src/schemas/site-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"site-config.d.ts","sourceRoot":"","sources":["../../src/schemas/site-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,YAAY;;;;;+FAExB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;iBAI5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAQ5D,eAAO,MAAM,cAAc,8EAA+E,CAAC;AAW3G,eAAO,MAAM,gBAAgB;;;EAA+B,CAAC;AAE7D,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AA0C9C,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6CtB,CAAC;AAEL,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAyE,CAAC;AAElG,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE7D,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAE1D;AAMD,eAAO,MAAM,iBAAiB;;;;;iBAM5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAiC5B,CAAC;AACL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyD3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -12,9 +12,9 @@ import { RemoveIcon } from "../shared/icons";
|
|
|
12
12
|
export interface ChatMessage { role: "user" | "assistant"; content: string }
|
|
13
13
|
|
|
14
14
|
/** How the conversation is framed on screen:
|
|
15
|
-
* - "floating": the compact anchored panel (
|
|
16
|
-
* - "docked": full-height right sidebar (viewer, >=768px)
|
|
17
|
-
* - "sheet": bottom sheet (viewer, phones) */
|
|
15
|
+
* - "floating": the compact anchored panel (settings test chat only)
|
|
16
|
+
* - "docked": full-height right sidebar (viewer + /edit, >=768px)
|
|
17
|
+
* - "sheet": bottom sheet (viewer + /edit, phones) */
|
|
18
18
|
export type ChatPanelMode = "floating" | "docked" | "sheet";
|
|
19
19
|
|
|
20
20
|
const SESSION_KEY = "bp-chat-session";
|
|
@@ -35,9 +35,10 @@ function sessionId(): string {
|
|
|
35
35
|
return id;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
/** Conversation persistence (
|
|
39
|
-
* same tab, so the transcript must survive page navigation
|
|
40
|
-
*
|
|
38
|
+
/** Conversation persistence (docked/sheet modes): viewer internal links open
|
|
39
|
+
* in the same tab, so the transcript must survive page navigation — and it
|
|
40
|
+
* carries across same-tab hops between /edit and the live site. sessionStorage
|
|
41
|
+
* — per-tab, cleared when the visit ends. */
|
|
41
42
|
function loadStoredMessages(): ChatMessage[] {
|
|
42
43
|
try {
|
|
43
44
|
const parsed: unknown = JSON.parse(window.sessionStorage.getItem(MESSAGES_KEY) ?? "[]");
|
|
@@ -132,8 +133,15 @@ export async function streamChat(
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
export default function ChatPanel({ open, onClose, siteName, botName, thinkingPhrases, tasks, isEditor, draftChatbot, simulateAudience, variant = "viewer", mode = "floating", focusComposer, audience }: {
|
|
136
|
+
export default function ChatPanel({ open, closing, animateEnter, onClose, siteName, botName, thinkingPhrases, tasks, isEditor, draftChatbot, simulateAudience, variant = "viewer", mode = "floating", focusComposer, audience }: {
|
|
136
137
|
open: boolean;
|
|
138
|
+
/** Viewer modes: keeps the panel mounted through its exit slide (ChatWidget
|
|
139
|
+
* flips this off once the transition has run). */
|
|
140
|
+
closing?: boolean;
|
|
141
|
+
/** Animate the entrance (explicit user open). False for the docked restore
|
|
142
|
+
* on page load, where the column is already reserved pre-paint and a slide
|
|
143
|
+
* would replay on every navigation. */
|
|
144
|
+
animateEnter?: boolean;
|
|
137
145
|
onClose: () => void;
|
|
138
146
|
siteName: string;
|
|
139
147
|
/** Resolved assistant display name (per-audience, server-side). */
|
|
@@ -146,8 +154,9 @@ export default function ChatPanel({ open, onClose, siteName, botName, thinkingPh
|
|
|
146
154
|
draftChatbot?: unknown;
|
|
147
155
|
/** Configurator test panel only: preview this audience's prompt overlay. */
|
|
148
156
|
simulateAudience?: string;
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
157
|
+
/** Surface the chat serves: "editor" (/edit docked chat) keeps internal
|
|
158
|
+
* cross-page links in a new tab (unsaved editor state) and sizes the
|
|
159
|
+
* docked panel against the editor toolbar instead of the viewer nav. */
|
|
151
160
|
variant?: "viewer" | "editor";
|
|
152
161
|
mode?: ChatPanelMode;
|
|
153
162
|
/** Focus the composer when opened (explicit user open on desktop). Never
|
|
@@ -331,14 +340,15 @@ export default function ChatPanel({ open, onClose, siteName, botName, thinkingPh
|
|
|
331
340
|
return;
|
|
332
341
|
}
|
|
333
342
|
if (url.origin === window.location.origin) {
|
|
334
|
-
if (persistent) {
|
|
343
|
+
if (persistent && variant !== "editor") {
|
|
335
344
|
// Internal cross-page citation, viewer chat: navigate in place — the
|
|
336
345
|
// sessionStorage transcript (and docked-open state) survive the load.
|
|
337
346
|
window.location.assign(url.href);
|
|
338
347
|
return;
|
|
339
348
|
}
|
|
340
|
-
// Editor surfaces (
|
|
341
|
-
// unsaved editor state — keep internal links
|
|
349
|
+
// Editor surfaces (/edit docked chat, settings test panel): same-tab
|
|
350
|
+
// navigation would destroy unsaved editor state — keep internal links
|
|
351
|
+
// in a new tab there.
|
|
342
352
|
window.open(url.href, "_blank", "noopener");
|
|
343
353
|
return;
|
|
344
354
|
}
|
|
@@ -442,14 +452,21 @@ export default function ChatPanel({ open, onClose, siteName, botName, thinkingPh
|
|
|
442
452
|
setHistory(loadHistory(historyAudience));
|
|
443
453
|
}
|
|
444
454
|
|
|
445
|
-
if (!open) return null;
|
|
455
|
+
if (!open && !closing) return null;
|
|
446
456
|
|
|
447
457
|
const lastIndex = messages.length - 1;
|
|
448
458
|
|
|
449
459
|
return (
|
|
450
460
|
<>
|
|
451
461
|
{mode === "sheet" && (
|
|
452
|
-
<div
|
|
462
|
+
<div
|
|
463
|
+
className={cn(
|
|
464
|
+
"fixed inset-0 z-50 bg-black/50 motion-safe:transition-opacity motion-safe:duration-300",
|
|
465
|
+
open ? "opacity-100 starting:opacity-0" : "pointer-events-none opacity-0",
|
|
466
|
+
)}
|
|
467
|
+
onClick={onClose}
|
|
468
|
+
aria-hidden="true"
|
|
469
|
+
/>
|
|
453
470
|
)}
|
|
454
471
|
<div
|
|
455
472
|
ref={panelRef}
|
|
@@ -460,12 +477,27 @@ export default function ChatPanel({ open, onClose, siteName, botName, thinkingPh
|
|
|
460
477
|
onKeyDown={(e) => { if (e.key === "Escape") onClose(); }}
|
|
461
478
|
className={cn(
|
|
462
479
|
"flex flex-col bg-base focus:outline-none",
|
|
463
|
-
mode === "floating" &&
|
|
464
|
-
|
|
465
|
-
|
|
480
|
+
mode === "floating" && "fixed z-40 h-[28rem] w-80 rounded-outer border border-base-200 shadow-xl bottom-20 right-4",
|
|
481
|
+
// Enter/exit slides pair with base.css's 300ms band shift (same
|
|
482
|
+
// duration + default curve); under reduced motion there's no
|
|
483
|
+
// transition and @starting-style has no effect — instant show/hide.
|
|
484
|
+
// Top offset clears the fixed top bar spanning the panel's column:
|
|
485
|
+
// the viewer nav header exists below xl (chat-enabled pages dock
|
|
486
|
+
// the nav at xl); /edit keeps its full-width h-16 toolbar at every
|
|
487
|
+
// width, so the panel always tucks below it — the toolbar never
|
|
488
|
+
// moves during the open/close slide.
|
|
489
|
+
mode === "docked" && cn(
|
|
490
|
+
"fixed right-0 bottom-0 z-40 w-[var(--chat-w)] border-l border-base-200",
|
|
491
|
+
variant === "editor" ? "top-16" : "top-16 xl:top-0",
|
|
492
|
+
"motion-safe:transition-transform motion-safe:duration-300",
|
|
493
|
+
open ? "translate-x-0" : "translate-x-full",
|
|
494
|
+
open && animateEnter && "starting:translate-x-full",
|
|
495
|
+
),
|
|
496
|
+
mode === "sheet" && cn(
|
|
497
|
+
"fixed inset-x-0 bottom-0 z-50 h-[85dvh] rounded-t-outer border-t border-base-200 shadow-xl",
|
|
498
|
+
"motion-safe:transition-transform motion-safe:duration-300",
|
|
499
|
+
open ? "translate-y-0 starting:translate-y-full" : "translate-y-full",
|
|
466
500
|
),
|
|
467
|
-
mode === "docked" && "fixed right-0 bottom-0 top-16 xl:top-0 z-40 w-[var(--chat-w)] border-l border-base-200",
|
|
468
|
-
mode === "sheet" && "fixed inset-x-0 bottom-0 z-50 h-[85dvh] rounded-t-outer border-t border-base-200 shadow-xl",
|
|
469
501
|
)}
|
|
470
502
|
style={mode === "sheet" ? { bottom: "var(--kb-offset, 0px)", maxHeight: "calc(var(--vvh, 100dvh) - 2.5rem)" } : undefined}
|
|
471
503
|
>
|