@coffer-org/plugin-webchat 2.2.3 → 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 {
|
|
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(
|
|
29215
|
-
|
|
29216
|
-
onClick:
|
|
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", {
|
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-
|
|
14
|
+
load: () => import("./ChatWidget-DueGsCOz.js")
|
|
15
15
|
}] });
|
|
16
16
|
//#endregion
|
|
17
17
|
export { ui_default as default };
|