@blocklet/discuss-kit-ux 1.5.212 → 1.5.213

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 { lazy } from "react";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-b4081082.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-13980925.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -4288,9 +4288,7 @@ function DefaultEditorConfigProvider({
4288
4288
  if (typeof payload === "string") {
4289
4289
  const result2 = await request.post(
4290
4290
  joinUrl("/api/ai/completions"),
4291
- {
4292
- prompt: payload
4293
- },
4291
+ { prompt: payload },
4294
4292
  { baseURL, timeout: 3e4 }
4295
4293
  );
4296
4294
  return (_a3 = result2.data) == null ? void 0 : _a3.message;
@@ -4300,7 +4298,7 @@ function DefaultEditorConfigProvider({
4300
4298
  { ...payload, stream: false },
4301
4299
  { timeout: 3e4 }
4302
4300
  );
4303
- return result.data;
4301
+ return result.data.content || "";
4304
4302
  },
4305
4303
  imageGenerations: async (payload) => {
4306
4304
  const result = await request.post("/api/ai/image/generations", payload, { baseURL, timeout: 3e4 });
@@ -4328,15 +4326,15 @@ function DefaultEditorConfigProvider({
4328
4326
  const { offset = 0, limit = 20, tag } = params;
4329
4327
  try {
4330
4328
  const {
4331
- data: { templates }
4329
+ data: { assistants }
4332
4330
  } = await request.get(
4333
4331
  joinUrl(
4334
4332
  window.location.origin,
4335
4333
  aiAssistantMountPoint,
4336
- `/api/templates?offset=${offset}&limit=${limit}${tag ? `&tag=${tag}` : ""}`
4334
+ `/api/assistants?offset=${offset}&limit=${limit}${tag ? `&tag=${tag}` : ""}`
4337
4335
  )
4338
4336
  );
4339
- return templates;
4337
+ return assistants;
4340
4338
  } catch (e) {
4341
4339
  (_a3 = e.markAsHandled) == null ? void 0 : _a3.call(e);
4342
4340
  console.error(e);
@@ -4396,7 +4394,7 @@ function Pagination({ page, size = 20, total, onChange, routerMode = true, ...re
4396
4394
  }
4397
4395
  );
4398
4396
  }
4399
- const Editor = lazy(() => import("./editor-64b50636.mjs"));
4397
+ const Editor = lazy(() => import("./editor-20e8ce1d.mjs"));
4400
4398
  function LazyEditor(props) {
4401
4399
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
4402
4400
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { K, j, N, A, h, a6, B, z, y, E, Q, O, T, W, o, C, q, v, x, _, $, aa, a1, H, J, D, a9, a8, G, c, b, a7, M, P, ah, n, m, a5, R, S, a2, k, X, Z, ab, ae, ad, af, ai, F, aj, l, p, r, t, d, a3, L, e, U, w, a0, a4, u, ag, ak, Y, ac, f } from "./index-b4081082.mjs";
2
+ import { K, j, N, A, h, a6, B, z, y, E, Q, O, T, W, o, C, q, v, x, _, $, aa, a1, H, J, D, a9, a8, G, c, b, a7, M, P, ah, n, m, a5, R, S, a2, k, X, Z, ab, ae, ad, af, ai, F, aj, l, p, r, t, d, a3, L, e, U, w, a0, a4, u, ag, ak, Y, ac, f } from "./index-13980925.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -4230,9 +4230,7 @@ var __publicField = (obj, key, value) => {
4230
4230
  if (typeof payload === "string") {
4231
4231
  const result2 = await request.post(
4232
4232
  joinUrl("/api/ai/completions"),
4233
- {
4234
- prompt: payload
4235
- },
4233
+ { prompt: payload },
4236
4234
  { baseURL, timeout: 3e4 }
4237
4235
  );
4238
4236
  return (_a3 = result2.data) == null ? void 0 : _a3.message;
@@ -4242,7 +4240,7 @@ var __publicField = (obj, key, value) => {
4242
4240
  { ...payload, stream: false },
4243
4241
  { timeout: 3e4 }
4244
4242
  );
4245
- return result.data;
4243
+ return result.data.content || "";
4246
4244
  },
4247
4245
  imageGenerations: async (payload) => {
4248
4246
  const result = await request.post("/api/ai/image/generations", payload, { baseURL, timeout: 3e4 });
@@ -4270,15 +4268,15 @@ var __publicField = (obj, key, value) => {
4270
4268
  const { offset = 0, limit = 20, tag } = params;
4271
4269
  try {
4272
4270
  const {
4273
- data: { templates }
4271
+ data: { assistants }
4274
4272
  } = await request.get(
4275
4273
  joinUrl(
4276
4274
  window.location.origin,
4277
4275
  aiAssistantMountPoint,
4278
- `/api/templates?offset=${offset}&limit=${limit}${tag ? `&tag=${tag}` : ""}`
4276
+ `/api/assistants?offset=${offset}&limit=${limit}${tag ? `&tag=${tag}` : ""}`
4279
4277
  )
4280
4278
  );
4281
- return templates;
4279
+ return assistants;
4282
4280
  } catch (e) {
4283
4281
  (_a3 = e.markAsHandled) == null ? void 0 : _a3.call(e);
4284
4282
  console.error(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.5.212",
3
+ "version": "1.5.213",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.103",
32
- "@blocklet/editor": "1.5.212",
33
- "@blocklet/labels": "1.5.212",
34
- "@blocklet/uploader": "^0.0.52",
32
+ "@blocklet/editor": "1.5.213",
33
+ "@blocklet/labels": "1.5.213",
34
+ "@blocklet/uploader": "^0.0.53",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
37
37
  "@emotion/styled": "^11.10.5",
@@ -92,5 +92,5 @@
92
92
  "resolutions": {
93
93
  "react": "^18.2.0"
94
94
  },
95
- "gitHead": "0a5b2497a3c6470d12b5459fb05f9a507a2b7fa6"
95
+ "gitHead": "b0aa694b1676289ebbb9a756e1cbecdd2e647e4d"
96
96
  }