@blocklet/discuss-kit-ux 2.4.32 → 2.4.34
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 { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
|
|
|
4
4
|
import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
|
|
5
5
|
import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
|
|
6
6
|
import { lazyRetry } from "@arcblock/ux/lib/Util";
|
|
7
|
-
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, g as getExcerptSync, s as stringify } from "./index-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, g as getExcerptSync, s as stringify } from "./index-BlqRGWgQ.mjs";
|
|
8
8
|
const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -5221,7 +5221,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
|
|
|
5221
5221
|
}
|
|
5222
5222
|
const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 14L21 3m0 0l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1z" }) });
|
|
5223
5223
|
const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 15.5a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0-7 0M3 19V8.5a3.5 3.5 0 0 1 7 0V19m-7-6h7m11-1v7" }) });
|
|
5224
|
-
const Editor = lazyRetry(() => import("./editor-
|
|
5224
|
+
const Editor = lazyRetry(() => import("./editor-B3z0rXVh.mjs"));
|
|
5225
5225
|
function LazyEditor(props) {
|
|
5226
5226
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
5227
5227
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
@@ -6381,15 +6381,14 @@ function DefaultEditorConfigProvider({
|
|
|
6381
6381
|
},
|
|
6382
6382
|
getCurrentUserDid: () => session?.user?.did
|
|
6383
6383
|
};
|
|
6384
|
-
const { mountPoint: aiAssistantMountPoint } = getBlockletMountPointInfo("ai-assistant") || {};
|
|
6385
6384
|
const AI = {
|
|
6386
6385
|
checkAvailable: async () => {
|
|
6387
|
-
if (downMd
|
|
6386
|
+
if (downMd) {
|
|
6388
6387
|
return false;
|
|
6389
6388
|
}
|
|
6390
6389
|
try {
|
|
6391
|
-
const { data } = await request.get("/api/
|
|
6392
|
-
return !!data?.
|
|
6390
|
+
const { data } = await request.get("/api/aigne/check", { baseURL });
|
|
6391
|
+
return !!data?.connected;
|
|
6393
6392
|
} catch (e) {
|
|
6394
6393
|
e.markAsHandled?.();
|
|
6395
6394
|
console.error(e);
|
|
@@ -6398,23 +6397,14 @@ function DefaultEditorConfigProvider({
|
|
|
6398
6397
|
},
|
|
6399
6398
|
completions: async (payload) => {
|
|
6400
6399
|
if (typeof payload === "string") {
|
|
6401
|
-
const
|
|
6402
|
-
joinURL("/api/
|
|
6403
|
-
{
|
|
6400
|
+
const result = await request.post(
|
|
6401
|
+
joinURL("/api/aigne/chat"),
|
|
6402
|
+
{ message: payload },
|
|
6404
6403
|
{ baseURL, timeout: 3e4 }
|
|
6405
6404
|
);
|
|
6406
|
-
return
|
|
6405
|
+
return result.data?.result?.text || "";
|
|
6407
6406
|
}
|
|
6408
|
-
|
|
6409
|
-
joinURL(window.location.origin, aiAssistantMountPoint || "", "/api/ai/completions"),
|
|
6410
|
-
{ ...payload, stream: false },
|
|
6411
|
-
{ timeout: 3e4 }
|
|
6412
|
-
);
|
|
6413
|
-
return result.data.content || "";
|
|
6414
|
-
},
|
|
6415
|
-
imageGenerations: async (payload) => {
|
|
6416
|
-
const result = await request.post("/api/ai/image/generations", payload, { baseURL, timeout: 3e4 });
|
|
6417
|
-
return result.data;
|
|
6407
|
+
return "";
|
|
6418
6408
|
}
|
|
6419
6409
|
};
|
|
6420
6410
|
const templatePlugin = {
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { W, o, Y, aQ, A, n, af, B, G, N, L, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, aR, aS, v, O, aE, aF, R, S, ab, as, aD, q, aP, a4, a6, ak, an, am, aM, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aN, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, aT, c, a2, E, a9, ad, aV, e, u, ap, d, av, aU, aO, a5, al, f } from "./index-
|
|
2
|
+
import { W, o, Y, aQ, A, n, af, B, G, N, L, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, aR, aS, v, O, aE, aF, R, S, ab, as, aD, q, aP, a4, a6, ak, an, am, aM, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aN, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, aT, c, a2, E, a9, ad, aV, e, u, ap, d, av, aU, aO, a5, al, f } from "./index-BlqRGWgQ.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -6301,15 +6301,14 @@
|
|
|
6301
6301
|
},
|
|
6302
6302
|
getCurrentUserDid: () => session?.user?.did
|
|
6303
6303
|
};
|
|
6304
|
-
const { mountPoint: aiAssistantMountPoint } = getBlockletMountPointInfo("ai-assistant") || {};
|
|
6305
6304
|
const AI = {
|
|
6306
6305
|
checkAvailable: async () => {
|
|
6307
|
-
if (downMd
|
|
6306
|
+
if (downMd) {
|
|
6308
6307
|
return false;
|
|
6309
6308
|
}
|
|
6310
6309
|
try {
|
|
6311
|
-
const { data } = await request.get("/api/
|
|
6312
|
-
return !!data?.
|
|
6310
|
+
const { data } = await request.get("/api/aigne/check", { baseURL });
|
|
6311
|
+
return !!data?.connected;
|
|
6313
6312
|
} catch (e) {
|
|
6314
6313
|
e.markAsHandled?.();
|
|
6315
6314
|
console.error(e);
|
|
@@ -6318,23 +6317,14 @@
|
|
|
6318
6317
|
},
|
|
6319
6318
|
completions: async (payload) => {
|
|
6320
6319
|
if (typeof payload === "string") {
|
|
6321
|
-
const
|
|
6322
|
-
ufo.joinURL("/api/
|
|
6323
|
-
{
|
|
6320
|
+
const result = await request.post(
|
|
6321
|
+
ufo.joinURL("/api/aigne/chat"),
|
|
6322
|
+
{ message: payload },
|
|
6324
6323
|
{ baseURL, timeout: 3e4 }
|
|
6325
6324
|
);
|
|
6326
|
-
return
|
|
6325
|
+
return result.data?.result?.text || "";
|
|
6327
6326
|
}
|
|
6328
|
-
|
|
6329
|
-
ufo.joinURL(window.location.origin, aiAssistantMountPoint || "", "/api/ai/completions"),
|
|
6330
|
-
{ ...payload, stream: false },
|
|
6331
|
-
{ timeout: 3e4 }
|
|
6332
|
-
);
|
|
6333
|
-
return result.data.content || "";
|
|
6334
|
-
},
|
|
6335
|
-
imageGenerations: async (payload) => {
|
|
6336
|
-
const result = await request.post("/api/ai/image/generations", payload, { baseURL, timeout: 3e4 });
|
|
6337
|
-
return result.data;
|
|
6327
|
+
return "";
|
|
6338
6328
|
}
|
|
6339
6329
|
};
|
|
6340
6330
|
const templatePlugin = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.34",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/bridge": "^3.0.
|
|
22
|
-
"@arcblock/react-hooks": "^3.0.
|
|
23
|
-
"@arcblock/ws": "^1.21.
|
|
21
|
+
"@arcblock/bridge": "^3.0.41",
|
|
22
|
+
"@arcblock/react-hooks": "^3.0.41",
|
|
23
|
+
"@arcblock/ws": "^1.21.1",
|
|
24
24
|
"@blocklet/js-sdk": "^1.16.46",
|
|
25
25
|
"@blocklet/uploader": "^0.2.5",
|
|
26
26
|
"@emotion/css": "^11.13.5",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"unstated-next": "^1.1.0",
|
|
48
48
|
"url-join": "^4.0.1",
|
|
49
49
|
"zustand": "^4.5.5",
|
|
50
|
-
"@blocklet/editor": "2.4.
|
|
51
|
-
"@blocklet/labels": "2.4.
|
|
50
|
+
"@blocklet/editor": "2.4.34",
|
|
51
|
+
"@blocklet/labels": "2.4.34"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@arcblock/did-connect": "^3.0.1",
|