@webless/agent 0.14.2 → 0.14.3
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-KUNT2X4I.js → chunk-RUZGX75D.js} +5 -3
- package/dist/{chunk-KUNT2X4I.js.map → chunk-RUZGX75D.js.map} +1 -1
- package/dist/embed.cjs +14 -3
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +36 -0
- package/dist/embed.css.map +1 -1
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.js +10 -2
- package/dist/embed.js.map +1 -1
- package/dist/{panel-controller-CDWodIJl.d.cts → panel-controller-csugUSgZ.d.cts} +5 -1
- package/dist/{panel-controller-CDWodIJl.d.ts → panel-controller-csugUSgZ.d.ts} +5 -1
- package/dist/react.cjs +4 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +36 -0
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +4 -3
- package/dist/react.d.ts +4 -3
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/dist/embed.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(embed_exports, {
|
|
|
25
25
|
createWeblessAgentPublicApi: () => createWeblessAgentPublicApi,
|
|
26
26
|
getMountedAgent: () => getMountedAgent,
|
|
27
27
|
mountAgent: () => mountAgent,
|
|
28
|
+
normalizeAgentPanelPresentation: () => normalizeAgentPanelPresentation,
|
|
28
29
|
normalizeAgentPlacement: () => normalizeAgentPlacement,
|
|
29
30
|
normalizeAgentTagManifest: () => normalizeAgentTagManifest,
|
|
30
31
|
resetAgentPanel: () => resetAgentPanel,
|
|
@@ -8551,6 +8552,7 @@ function AgentWidget({
|
|
|
8551
8552
|
runtimeOrigin,
|
|
8552
8553
|
handoffEnabled = false,
|
|
8553
8554
|
placement: placementInput,
|
|
8555
|
+
panelPresentation = "drawer",
|
|
8554
8556
|
defaultCollapsed = true,
|
|
8555
8557
|
pageShift = true,
|
|
8556
8558
|
registerPanelController = false,
|
|
@@ -8561,11 +8563,12 @@ function AgentWidget({
|
|
|
8561
8563
|
}) {
|
|
8562
8564
|
const isMobile = useIsMobile();
|
|
8563
8565
|
const placement = normalizeAgentPlacement(placementInput);
|
|
8566
|
+
const overlayPopup = panelPresentation === "popup" && !isMobile;
|
|
8564
8567
|
const railSlotRef = (0, import_react19.useRef)(null);
|
|
8565
8568
|
const [railCollapsed, setRailCollapsed] = (0, import_react19.useState)(defaultCollapsed);
|
|
8566
8569
|
const [railExpanded, setRailExpanded] = (0, import_react19.useState)(false);
|
|
8567
8570
|
const pageShiftActive = shouldApplyPageShift({
|
|
8568
|
-
pageShift,
|
|
8571
|
+
pageShift: pageShift && !overlayPopup,
|
|
8569
8572
|
isMobile,
|
|
8570
8573
|
railCollapsed,
|
|
8571
8574
|
railExpanded
|
|
@@ -8691,7 +8694,7 @@ function AgentWidget({
|
|
|
8691
8694
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8692
8695
|
"div",
|
|
8693
8696
|
{
|
|
8694
|
-
className: `webless-agent-root__shell${railCollapsed ? " webless-agent-root__shell--collapsed" : ""}${railExpanded ? " webless-agent-root__shell--expanded" : ""}`,
|
|
8697
|
+
className: `webless-agent-root__shell${railCollapsed ? " webless-agent-root__shell--collapsed" : ""}${railExpanded ? " webless-agent-root__shell--expanded" : ""}${overlayPopup ? " webless-agent-root__shell--popup" : ""}`,
|
|
8695
8698
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8696
8699
|
"div",
|
|
8697
8700
|
{
|
|
@@ -8794,6 +8797,7 @@ function AgentWidget2({
|
|
|
8794
8797
|
handoffEnabled: manifest.handoffEnabled,
|
|
8795
8798
|
previewBuildId: manifest.version === "unpublished" ? readUnpublishedPreviewBuildId() : void 0,
|
|
8796
8799
|
placement: manifest.placement,
|
|
8800
|
+
panelPresentation: manifest.panelPresentation,
|
|
8797
8801
|
pageShift: manifest.pageShift,
|
|
8798
8802
|
colorScheme: manifest.colorScheme,
|
|
8799
8803
|
branding: manifest.branding,
|
|
@@ -8805,6 +8809,9 @@ function AgentWidget2({
|
|
|
8805
8809
|
}
|
|
8806
8810
|
|
|
8807
8811
|
// src/embed/manifest.ts
|
|
8812
|
+
function normalizeAgentPanelPresentation(value) {
|
|
8813
|
+
return value === "popup" ? "popup" : "drawer";
|
|
8814
|
+
}
|
|
8808
8815
|
function normalizeAgentTagManifest(manifest) {
|
|
8809
8816
|
const indexId = manifest.indexId.trim();
|
|
8810
8817
|
if (!indexId) {
|
|
@@ -8840,7 +8847,10 @@ function normalizeAgentTagManifest(manifest) {
|
|
|
8840
8847
|
strategy: manifest.mount?.strategy ?? "body"
|
|
8841
8848
|
},
|
|
8842
8849
|
placement: normalizeAgentPlacement(manifest.placement),
|
|
8843
|
-
|
|
8850
|
+
panelPresentation: normalizeAgentPanelPresentation(
|
|
8851
|
+
manifest.panelPresentation
|
|
8852
|
+
),
|
|
8853
|
+
pageShift: normalizeAgentPanelPresentation(manifest.panelPresentation) === "popup" ? false : manifest.pageShift ?? true,
|
|
8844
8854
|
colorScheme,
|
|
8845
8855
|
...branding ? { branding } : {},
|
|
8846
8856
|
...analytics ? { analytics } : {}
|
|
@@ -9034,6 +9044,7 @@ function createWeblessAgentPublicApi(manifest) {
|
|
|
9034
9044
|
createWeblessAgentPublicApi,
|
|
9035
9045
|
getMountedAgent,
|
|
9036
9046
|
mountAgent,
|
|
9047
|
+
normalizeAgentPanelPresentation,
|
|
9037
9048
|
normalizeAgentPlacement,
|
|
9038
9049
|
normalizeAgentTagManifest,
|
|
9039
9050
|
resetAgentPanel,
|