@webless/agent 0.14.1 → 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/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,
@@ -4828,16 +4829,11 @@ function ExploreMore({
4828
4829
  if (!sources.length && !questions.length) return null;
4829
4830
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "explore-more", children: [
4830
4831
  sources.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "explore-more__section", children: [
4831
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "explore-more__label", children: [
4832
- "Based on ",
4833
- sources.length,
4834
- " ",
4835
- sources.length === 1 ? "page" : "pages"
4836
- ] }),
4832
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "explore-more__label", children: "Related Resources" }),
4837
4833
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SearchReferences, { results, mode: "sources" })
4838
4834
  ] }) : null,
4839
4835
  questions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "explore-more__section", children: [
4840
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "explore-more__label", children: "Learn more" }),
4836
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "explore-more__label", children: "Ask Next" }),
4841
4837
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "explore-more__questions", children: questions.map((question) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
4842
4838
  "button",
4843
4839
  {
@@ -5196,7 +5192,7 @@ function Composer({
5196
5192
  disabled,
5197
5193
  title: "Share your details and we'll reach out shortly",
5198
5194
  onClick: () => setDraft((current) => ({ ...current, expanded: true })),
5199
- children: "Review follow-up"
5195
+ children: "Request a Follow-Up"
5200
5196
  }
5201
5197
  ) : null
5202
5198
  ] }) : null,
@@ -5720,7 +5716,7 @@ var BRAND_LOGO_LAYOUT = {
5720
5716
  header: { maxHeight: 20, maxWidth: 96, square: 24 },
5721
5717
  message: { maxHeight: 18, maxWidth: 80, square: 22 },
5722
5718
  /** Bottom/mobile launcher pill orb — keep in sync with AssistEdgeTab chip CSS. */
5723
- launcher: { maxHeight: 24, maxWidth: 104, square: 38 }
5719
+ launcher: { maxHeight: 20, maxWidth: 80, square: 22 }
5724
5720
  };
5725
5721
  function isWideBrandLogo(naturalWidth, naturalHeight) {
5726
5722
  return naturalWidth > naturalHeight * 1.4;
@@ -8556,6 +8552,7 @@ function AgentWidget({
8556
8552
  runtimeOrigin,
8557
8553
  handoffEnabled = false,
8558
8554
  placement: placementInput,
8555
+ panelPresentation = "drawer",
8559
8556
  defaultCollapsed = true,
8560
8557
  pageShift = true,
8561
8558
  registerPanelController = false,
@@ -8566,11 +8563,12 @@ function AgentWidget({
8566
8563
  }) {
8567
8564
  const isMobile = useIsMobile();
8568
8565
  const placement = normalizeAgentPlacement(placementInput);
8566
+ const overlayPopup = panelPresentation === "popup" && !isMobile;
8569
8567
  const railSlotRef = (0, import_react19.useRef)(null);
8570
8568
  const [railCollapsed, setRailCollapsed] = (0, import_react19.useState)(defaultCollapsed);
8571
8569
  const [railExpanded, setRailExpanded] = (0, import_react19.useState)(false);
8572
8570
  const pageShiftActive = shouldApplyPageShift({
8573
- pageShift,
8571
+ pageShift: pageShift && !overlayPopup,
8574
8572
  isMobile,
8575
8573
  railCollapsed,
8576
8574
  railExpanded
@@ -8696,7 +8694,7 @@ function AgentWidget({
8696
8694
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
8697
8695
  "div",
8698
8696
  {
8699
- 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" : ""}`,
8700
8698
  children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
8701
8699
  "div",
8702
8700
  {
@@ -8799,6 +8797,7 @@ function AgentWidget2({
8799
8797
  handoffEnabled: manifest.handoffEnabled,
8800
8798
  previewBuildId: manifest.version === "unpublished" ? readUnpublishedPreviewBuildId() : void 0,
8801
8799
  placement: manifest.placement,
8800
+ panelPresentation: manifest.panelPresentation,
8802
8801
  pageShift: manifest.pageShift,
8803
8802
  colorScheme: manifest.colorScheme,
8804
8803
  branding: manifest.branding,
@@ -8810,6 +8809,9 @@ function AgentWidget2({
8810
8809
  }
8811
8810
 
8812
8811
  // src/embed/manifest.ts
8812
+ function normalizeAgentPanelPresentation(value) {
8813
+ return value === "popup" ? "popup" : "drawer";
8814
+ }
8813
8815
  function normalizeAgentTagManifest(manifest) {
8814
8816
  const indexId = manifest.indexId.trim();
8815
8817
  if (!indexId) {
@@ -8845,7 +8847,10 @@ function normalizeAgentTagManifest(manifest) {
8845
8847
  strategy: manifest.mount?.strategy ?? "body"
8846
8848
  },
8847
8849
  placement: normalizeAgentPlacement(manifest.placement),
8848
- pageShift: manifest.pageShift ?? true,
8850
+ panelPresentation: normalizeAgentPanelPresentation(
8851
+ manifest.panelPresentation
8852
+ ),
8853
+ pageShift: normalizeAgentPanelPresentation(manifest.panelPresentation) === "popup" ? false : manifest.pageShift ?? true,
8849
8854
  colorScheme,
8850
8855
  ...branding ? { branding } : {},
8851
8856
  ...analytics ? { analytics } : {}
@@ -9039,6 +9044,7 @@ function createWeblessAgentPublicApi(manifest) {
9039
9044
  createWeblessAgentPublicApi,
9040
9045
  getMountedAgent,
9041
9046
  mountAgent,
9047
+ normalizeAgentPanelPresentation,
9042
9048
  normalizeAgentPlacement,
9043
9049
  normalizeAgentTagManifest,
9044
9050
  resetAgentPanel,