@coffer-org/plugin-webchat 2.2.2 → 2.2.4

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.
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  import { createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import * as ReactDOM from "react-dom";
7
- import { Link, useLocation } from "react-router-dom";
7
+ import { useLocation, useNavigate } from "react-router-dom";
8
8
  //#region \0rolldown/runtime.js
9
9
  var __create = Object.create;
10
10
  var __defProp = Object.defineProperty;
@@ -29209,11 +29209,17 @@ function ChatMarkdown({ text, className }) {
29209
29209
  }
29210
29210
  function ChatLink({ href, children }) {
29211
29211
  const onNavigate = useChatNav();
29212
+ const navigate = useNavigate();
29212
29213
  const routes = [...getSiteLinks(), ...getPluginRoutes().map((r) => ({ pattern: `/${r.path}` }))];
29213
29214
  const kind = classifyHref(href ?? "", window.location.origin, routes, getSiteShelves());
29214
- if (kind.kind === "internal") return /* @__PURE__ */ jsx(Link, {
29215
- to: kind.to,
29216
- onClick: onNavigate,
29215
+ if (kind.kind === "internal") return /* @__PURE__ */ jsx("a", {
29216
+ href: kind.to,
29217
+ onClick: (event) => {
29218
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
29219
+ event.preventDefault();
29220
+ onNavigate();
29221
+ navigate(kind.to);
29222
+ },
29217
29223
  children
29218
29224
  });
29219
29225
  if (kind.kind === "external") return /* @__PURE__ */ jsx("a", {
@@ -29645,7 +29651,7 @@ function ChatWidget() {
29645
29651
  });
29646
29652
  if (mode === "bubble") return /* @__PURE__ */ jsx("button", {
29647
29653
  "aria-label": t("webchat.open"),
29648
- onClick: () => setMode("panel"),
29654
+ onClick: () => setMode(wide ? "panel" : "modal"),
29649
29655
  className: "fixed bottom-20 right-4 z-40 grid h-14 w-14 place-items-center rounded-full bg-accent text-white shadow-lg nav:bottom-4",
29650
29656
  children: /* @__PURE__ */ jsx(MessageCircle, { size: 24 })
29651
29657
  });
package/dist/web.js CHANGED
@@ -11,7 +11,7 @@ import { definePluginUI } from "@coffer-org/web-sdk";
11
11
  var ui_default = definePluginUI({ slots: [{
12
12
  slot: "overlay",
13
13
  id: "webchat",
14
- load: () => import("./ChatWidget-C9vwULxt.js")
14
+ load: () => import("./ChatWidget-DueGsCOz.js")
15
15
  }] });
16
16
  //#endregion
17
17
  export { ui_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffer-org/plugin-webchat",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24"