@helpway/react 0.11.0 → 0.12.0
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/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -265,6 +265,7 @@ function createWidgetStore() {
|
|
|
265
265
|
announcementPreviews: [],
|
|
266
266
|
unseenAnnouncementCount: 0,
|
|
267
267
|
newConversationPrefill: null,
|
|
268
|
+
pendingContentDetail: null,
|
|
268
269
|
contentCache: /* @__PURE__ */ new Map(),
|
|
269
270
|
// ── Lifecycle ────────────────────────────────────
|
|
270
271
|
setReady(visitor, website, agentConfig) {
|
|
@@ -434,6 +435,9 @@ function createWidgetStore() {
|
|
|
434
435
|
announcementPreviews: open ? [] : s.announcementPreviews
|
|
435
436
|
}));
|
|
436
437
|
},
|
|
438
|
+
setPendingContentDetail(value) {
|
|
439
|
+
set({ pendingContentDetail: value });
|
|
440
|
+
},
|
|
437
441
|
setDismissed(dismissed) {
|
|
438
442
|
set({ isDismissed: dismissed });
|
|
439
443
|
},
|
|
@@ -3855,12 +3859,12 @@ function AnnouncementPreviewItem({
|
|
|
3855
3859
|
}
|
|
3856
3860
|
)
|
|
3857
3861
|
] }),
|
|
3858
|
-
preview.badge && /* @__PURE__ */ jsx12("div", { className: "hw-announcement-badge", children: preview.badge }),
|
|
3859
3862
|
/* @__PURE__ */ jsx12("div", { className: "hw-preview-body hw-preview-body--title", children: preview.title }),
|
|
3860
3863
|
preview.body && (() => {
|
|
3861
3864
|
const clean = stripMarkdown(preview.body);
|
|
3862
3865
|
return /* @__PURE__ */ jsx12("div", { className: "hw-preview-body hw-preview-body--desc", children: clean.length > 120 ? `${clean.slice(0, 120)}\u2026` : clean });
|
|
3863
3866
|
})(),
|
|
3867
|
+
preview.badge && /* @__PURE__ */ jsx12("div", { className: "hw-announcement-badge", children: preview.badge }),
|
|
3864
3868
|
footer != null && footer !== false && /* @__PURE__ */ jsx12("div", { className: "hw-preview-footer", children: footer })
|
|
3865
3869
|
]
|
|
3866
3870
|
}
|
|
@@ -4472,6 +4476,16 @@ function DefaultWidget({ hideLauncher = false } = {}) {
|
|
|
4472
4476
|
},
|
|
4473
4477
|
[activeTab, subView, activeId, setActiveConversation]
|
|
4474
4478
|
);
|
|
4479
|
+
const pendingContentDetail = useWidgetStore((s) => s.pendingContentDetail);
|
|
4480
|
+
useEffect13(() => {
|
|
4481
|
+
if (!pendingContentDetail) return;
|
|
4482
|
+
const { slug, tabId } = pendingContentDetail;
|
|
4483
|
+
markEntrySeen(slug);
|
|
4484
|
+
switchTab(`content:${tabId}`);
|
|
4485
|
+
setContentDetailSlug(slug);
|
|
4486
|
+
setSubView("content-detail");
|
|
4487
|
+
store.getState().setPendingContentDetail(null);
|
|
4488
|
+
}, [pendingContentDetail, markEntrySeen, switchTab, store]);
|
|
4475
4489
|
const setStoreOpen = useWidgetStore((s) => s.setOpen);
|
|
4476
4490
|
const handleBubbleClick = useCallback12(() => {
|
|
4477
4491
|
if (storeIsOpen) {
|