rhua-chatgpt-web 1.0.78 → 1.0.79

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.
Files changed (45) hide show
  1. package/dist/{api_chain-BMBlLJ9P.cjs → api_chain-D78548jP.cjs} +1 -1
  2. package/dist/{api_chain-DxmtjGZR.js → api_chain-DlfmxpRO.js} +2 -2
  3. package/dist/{combine_docs_chain-BvsfAIEV.js → combine_docs_chain-BOe7gr-O.js} +2 -2
  4. package/dist/{combine_docs_chain-CKhXoczO.cjs → combine_docs_chain-BufROOtk.cjs} +1 -1
  5. package/dist/{few_shot-C7wme246.js → few_shot-CqVSyRQV.js} +1 -1
  6. package/dist/{few_shot-kCizcCQG.cjs → few_shot-LP1lBxWX.cjs} +1 -1
  7. package/dist/{index-kOFqOpyj.js → index-7bCJ03YI.js} +1 -1
  8. package/dist/{index-D2PJ83Oy.js → index-B-geeHAO.js} +1 -1
  9. package/dist/index-B15rr_aH.js +4 -0
  10. package/dist/index-B58Bx9pt.js +4 -0
  11. package/dist/{index-DNJwzxBp.js → index-BGFFP-s-.js} +2 -2
  12. package/dist/index-BU90_UfO.js +4 -0
  13. package/dist/{index-CCzqZMyF.js → index-B_FeE6GZ.js} +1 -1
  14. package/dist/{index-DY191wuv.js → index-BzQZOw18.js} +1 -1
  15. package/dist/{index-DO3BVly9.cjs → index-C3pnN9Uq.cjs} +1 -1
  16. package/dist/{index-B27a-wH3.cjs → index-CkUpB83y.cjs} +1 -1
  17. package/dist/{index-DuZOJIDr.cjs → index-CycbKs17.cjs} +1 -1
  18. package/dist/{index-CvfMe_qg.cjs → index-DOYDAFdc.cjs} +1 -1
  19. package/dist/{index-R9lAZGhC.cjs → index-DYvgVl7b.cjs} +1 -1
  20. package/dist/{index-NDQ8iJp-.cjs → index-DanMI0EG.cjs} +1 -1
  21. package/dist/{index-oVt43enE.cjs → index-Dc9-cHyy.cjs} +1 -1
  22. package/dist/{index-BCgsObGB.cjs → index-DejGE7Xn.cjs} +1 -1
  23. package/dist/index-DfAAX9yY.js +4 -0
  24. package/dist/{index-C755WiyV.cjs → index-DkPCRrTF.cjs} +2 -2
  25. package/dist/{index-BT8AK5wD.cjs → index-DmtJXrjd.cjs} +1 -1
  26. package/dist/{index-Dc04u1WG.js → index-Dr_uoSon.js} +2 -2
  27. package/dist/{index-Bnvlz8he.js → index-DyVccl4J.js} +1 -1
  28. package/dist/{index-LGBzY7X4.js → index-Z1KCXkYN.js} +101 -120
  29. package/dist/{index-DqQywXU8.cjs → index-_0rQl6Wo.cjs} +1 -1
  30. package/dist/{index-BCgWuMfi.cjs → index-kRe-eEsQ.cjs} +1 -1
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/{index.es-CMGIRK4t.js → index.es-DxoVSrNP.js} +11 -11
  33. package/dist/{index.es-D4rfimNX.cjs → index.es-NPOTWQ4B.cjs} +2 -2
  34. package/dist/index.esm.js +1 -1
  35. package/dist/{llm_chain-BXBR6ZuC.cjs → llm_chain-BzxuYoNo.cjs} +1 -1
  36. package/dist/{llm_chain-DotVPF7M.js → llm_chain-CZ4n4MFx.js} +1 -1
  37. package/dist/{sequential_chain-CL6uDykC.cjs → sequential_chain-BfE9_gsP.cjs} +1 -1
  38. package/dist/{sequential_chain-Ctx-2nEf.js → sequential_chain-BwwmBxFe.js} +1 -1
  39. package/dist/{vector_db_qa-itqyuw36.cjs → vector_db_qa-B8Q5r8tV.cjs} +1 -1
  40. package/dist/{vector_db_qa-Cq_CyJ5A.js → vector_db_qa-DVsphet0.js} +3 -3
  41. package/package.json +1 -1
  42. package/dist/index-BVzzQN3V.js +0 -4
  43. package/dist/index-CkEDv7A4.js +0 -4
  44. package/dist/index-DJ5tu-ks.js +0 -4
  45. package/dist/index-FRCszYTB.js +0 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C755WiyV.cjs");exports.default=e.remarkGfm;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkPCRrTF.cjs");exports.default=e.remarkGfm;
@@ -1,5 +1,5 @@
1
- import { O as toText, Q as phrasing$2, T as structuredClone, w as whitespace, U as visit, W as EXIT, X as toString, S as SKIP, Y as position } from "./index-LGBzY7X4.js";
2
- import { m as minifyWhitespace, p as phrasing$1 } from "./index-CCzqZMyF.js";
1
+ import { O as toText, Q as phrasing$2, T as structuredClone, w as whitespace, U as visit, W as EXIT, X as toString, S as SKIP, Y as position } from "./index-Z1KCXkYN.js";
2
+ import { m as minifyWhitespace, p as phrasing$1 } from "./index-B_FeE6GZ.js";
3
3
  function rehypeMinifyWhitespace(options) {
4
4
  return function(tree) {
5
5
  minifyWhitespace(tree, options);
@@ -1,4 +1,4 @@
1
- import { A as svg, D as html, E as webNamespaces, F as s, G as h, I as find, J as ok, V as VFile, K as VFileMessage } from "./index-LGBzY7X4.js";
1
+ import { A as svg, D as html, E as webNamespaces, F as s, G as h, I as find, J as ok, V as VFile, K as VFileMessage } from "./index-Z1KCXkYN.js";
2
2
  function location(file) {
3
3
  const value = String(file);
4
4
  const indices = [];
@@ -48546,7 +48546,7 @@ const BlockEdit = ({
48546
48546
  const initVueEditor = async () => {
48547
48547
  if (editorRef.current) {
48548
48548
  try {
48549
- const BlockNoteEditorModule = await import("./index.es-CMGIRK4t.js");
48549
+ const BlockNoteEditorModule = await import("./index.es-DxoVSrNP.js");
48550
48550
  const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
48551
48551
  const theme = {
48552
48552
  colors: {
@@ -49376,11 +49376,75 @@ const Chat3 = forwardRef(
49376
49376
  }
49377
49377
  );
49378
49378
  Chat3.displayName = "Chat";
49379
+ const DB_NAME = "WritingDB";
49380
+ const DB_VERSION = 1;
49381
+ const STORE_NAME = "writings";
49382
+ function openDB() {
49383
+ return new Promise((resolve, reject) => {
49384
+ const request = indexedDB.open(DB_NAME, DB_VERSION);
49385
+ request.onerror = () => {
49386
+ reject(new Error("打开数据库失败"));
49387
+ };
49388
+ request.onsuccess = () => {
49389
+ resolve(request.result);
49390
+ };
49391
+ request.onupgradeneeded = (event) => {
49392
+ const db = event.target.result;
49393
+ if (!db.objectStoreNames.contains(STORE_NAME)) {
49394
+ const objectStore = db.createObjectStore(STORE_NAME, {
49395
+ keyPath: "id",
49396
+ autoIncrement: true
49397
+ });
49398
+ objectStore.createIndex("userId", "userId", { unique: false });
49399
+ objectStore.createIndex("createdAt", "createdAt", { unique: false });
49400
+ }
49401
+ };
49402
+ });
49403
+ }
49404
+ async function getWritingsByUserId(userId) {
49405
+ try {
49406
+ const db = await openDB();
49407
+ const transaction = db.transaction([STORE_NAME], "readonly");
49408
+ const store = transaction.objectStore(STORE_NAME);
49409
+ const index2 = store.index("userId");
49410
+ return new Promise((resolve, reject) => {
49411
+ const request = index2.getAll(userId);
49412
+ request.onsuccess = () => {
49413
+ const results = request.result.sort((a, b) => b.createdAt - a.createdAt);
49414
+ resolve(results);
49415
+ };
49416
+ request.onerror = () => {
49417
+ reject(new Error("获取数据失败"));
49418
+ };
49419
+ });
49420
+ } catch (error) {
49421
+ console.error("获取写作内容失败:", error);
49422
+ throw error;
49423
+ }
49424
+ }
49425
+ async function deleteWriting(id) {
49426
+ try {
49427
+ const db = await openDB();
49428
+ const transaction = db.transaction([STORE_NAME], "readwrite");
49429
+ const store = transaction.objectStore(STORE_NAME);
49430
+ return new Promise((resolve, reject) => {
49431
+ const request = store.delete(id);
49432
+ request.onsuccess = () => {
49433
+ resolve();
49434
+ };
49435
+ request.onerror = () => {
49436
+ reject(new Error("删除数据失败"));
49437
+ };
49438
+ });
49439
+ } catch (error) {
49440
+ console.error("删除写作内容失败:", error);
49441
+ throw error;
49442
+ }
49443
+ }
49379
49444
  const style = {
49380
49445
  backgroundColor: "transparent",
49381
49446
  color: "#333"
49382
49447
  };
49383
- const HISTORY_PAGE_SIZE = 20;
49384
49448
  const AiBlockEdit = ({
49385
49449
  getSetBlockContent,
49386
49450
  baseUrl,
@@ -49409,7 +49473,7 @@ const AiBlockEdit = ({
49409
49473
  const initVueEditor = async () => {
49410
49474
  if (editorRef.current) {
49411
49475
  try {
49412
- const BlockNoteEditorModule = await import("./index.es-CMGIRK4t.js");
49476
+ const BlockNoteEditorModule = await import("./index.es-DxoVSrNP.js");
49413
49477
  const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
49414
49478
  const theme = {
49415
49479
  colors: {
@@ -49766,70 +49830,22 @@ const AiBlockEdit = ({
49766
49830
  getSetBlockContent(setBlockContent);
49767
49831
  }
49768
49832
  }, [getSetBlockContent]);
49769
- const getHistory = async (lastId) => {
49770
- var _a2, _b;
49771
- if (historyLoading) return;
49772
- setHistoryLoading(true);
49773
- let apiUrl = (baseUrl == null ? void 0 : baseUrl.difyApi) || localStorage.getItem("difyApi") || "http://111.6.44.42:30000";
49774
- const intelligentQaApiKey = ((_a2 = baseUrl == null ? void 0 : baseUrl.aiWritingAgent) == null ? void 0 : _a2.tokens) || ((_b = JSON.parse(localStorage.getItem("aiWritingAgent") || "{}")) == null ? void 0 : _b.tokens) || "app-tQ4LITOR6HCUYd1RqZe5LRHS";
49775
- try {
49776
- const query = new URLSearchParams({
49777
- user: "admin1",
49778
- last_id: lastId || "",
49779
- limit: String(HISTORY_PAGE_SIZE)
49780
- });
49781
- const response = await fetch(
49782
- `${apiUrl}/v1/conversations?${query.toString()}`,
49783
- {
49784
- method: "GET",
49785
- headers: {
49786
- Authorization: `Bearer ${intelligentQaApiKey}`,
49787
- "Content-Type": "application/json"
49788
- }
49789
- }
49790
- );
49791
- const data = await response.json();
49792
- if (!response.ok) {
49793
- throw new Error((data == null ? void 0 : data.message) || "获取历史记录失败");
49794
- }
49795
- const list2 = Array.isArray(data == null ? void 0 : data.data) ? data.data : [];
49796
- setHistoryList((prev) => lastId ? [...prev, ...list2] : list2);
49797
- if (typeof (data == null ? void 0 : data.has_more) === "boolean") {
49798
- setHistoryHasMore(data.has_more);
49799
- } else {
49800
- setHistoryHasMore(list2.length === HISTORY_PAGE_SIZE);
49801
- }
49802
- } catch (error) {
49803
- console.error("获取历史记录失败:", error);
49804
- Toast.error("获取历史记录失败,请重试或查看控制台日志");
49805
- } finally {
49806
- setHistoryLoading(false);
49833
+ const getHistoryFromIndexedDB = async () => {
49834
+ const userId = (baseUrl == null ? void 0 : baseUrl.userId) || "";
49835
+ if (!userId) {
49836
+ Toast.error("获取用户ID失败");
49837
+ return;
49807
49838
  }
49839
+ const historyList2 = await getWritingsByUserId(userId);
49840
+ setHistoryList(historyList2);
49808
49841
  };
49809
- const deleteHistory = async (id) => {
49842
+ const deleteHistoryFromIndexedDB = async (id) => {
49810
49843
  Modal.confirm({
49811
49844
  title: "删除历史记录",
49812
49845
  content: "确定要删除该历史记录吗?",
49813
49846
  onOk: async () => {
49814
- var _a2, _b;
49815
49847
  try {
49816
- const apiUrl = (baseUrl == null ? void 0 : baseUrl.difyApi) || localStorage.getItem("difyApi") || "http://111.6.44.42:30000";
49817
- const intelligentQaApiKey = ((_a2 = baseUrl == null ? void 0 : baseUrl.aiWritingAgent) == null ? void 0 : _a2.tokens) || ((_b = JSON.parse(localStorage.getItem("aiWritingAgent") || "{}")) == null ? void 0 : _b.tokens) || "app-tQ4LITOR6HCUYd1RqZe5LRHS";
49818
- const response = await fetch(`${apiUrl}/v1/conversations/${id}`, {
49819
- method: "DELETE",
49820
- headers: {
49821
- Authorization: `Bearer ${intelligentQaApiKey}`,
49822
- "Content-Type": "application/json"
49823
- },
49824
- body: JSON.stringify({
49825
- user: "admin1"
49826
- })
49827
- });
49828
- const data = await response.json();
49829
- if (!response.ok) {
49830
- Toast.error((data == null ? void 0 : data.message) || "删除历史记录失败");
49831
- throw new Error((data == null ? void 0 : data.message) || "删除历史记录失败");
49832
- }
49848
+ await deleteWriting(id);
49833
49849
  Toast.success("删除历史记录成功");
49834
49850
  setHistoryList((prev) => prev.filter((item) => item.id !== id));
49835
49851
  } catch (error) {
@@ -49842,58 +49858,23 @@ const AiBlockEdit = ({
49842
49858
  }
49843
49859
  });
49844
49860
  };
49845
- const getHistoryDetail = async (id) => {
49846
- var _a2, _b, _c, _d;
49847
- setCurrentConversationId(id);
49848
- const apiUrl = (baseUrl == null ? void 0 : baseUrl.difyApi) || localStorage.getItem("difyApi") || "http://111.6.44.42:30000";
49849
- const intelligentQaApiKey = ((_a2 = baseUrl == null ? void 0 : baseUrl.aiWritingAgent) == null ? void 0 : _a2.tokens) || ((_b = JSON.parse(localStorage.getItem("aiWritingAgent") || "{}")) == null ? void 0 : _b.tokens) || "app-tQ4LITOR6HCUYd1RqZe5LRHS";
49850
- const response = await fetch(
49851
- `${apiUrl}/v1/messages?user=admin1&conversation_id=${id}`,
49852
- {
49853
- method: "GET",
49854
- headers: {
49855
- Authorization: `Bearer ${intelligentQaApiKey}`,
49856
- "Content-Type": "application/json"
49857
- }
49858
- }
49859
- );
49860
- const data = await response.json();
49861
- if (!response.ok || !(data == null ? void 0 : data.data)) {
49862
- Toast.error((data == null ? void 0 : data.message) || "获取历史记录详情失败");
49863
- throw new Error((data == null ? void 0 : data.message) || "获取历史记录详情失败");
49864
- }
49865
- if (((_c = data == null ? void 0 : data.data) == null ? void 0 : _c.length) > 0) {
49866
- let message = (_d = data == null ? void 0 : data.data[0]) == null ? void 0 : _d.answer;
49867
- if (message && message.indexOf("<think>") !== -1) {
49868
- message = message.split("<think>")[1];
49869
- }
49870
- console.log("message123", message);
49871
- if (message) {
49872
- setBlockContent(message);
49873
- } else {
49874
- Toast.info("获取历史记录详情为空");
49875
- }
49861
+ const getHistoryDetail = async (item) => {
49862
+ setCurrentConversationId(item.conversationId);
49863
+ let content2 = item.content;
49864
+ if (content2 && content2.indexOf("<think>") !== -1) {
49865
+ content2 = content2.split("<think>")[1];
49866
+ }
49867
+ if (content2) {
49868
+ setBlockContent(content2);
49869
+ } else {
49870
+ Toast.info("获取历史记录详情为空");
49876
49871
  }
49877
49872
  };
49878
49873
  const openDrawer = () => {
49879
49874
  setHistoryVisible(true);
49880
49875
  setHistoryList([]);
49881
49876
  setHistoryHasMore(true);
49882
- void getHistory();
49883
- };
49884
- const handleHistoryScroll = (event) => {
49885
- var _a2;
49886
- const target = event.currentTarget;
49887
- if (historyLoading || !historyHasMore || historyList.length === 0) {
49888
- return;
49889
- }
49890
- const distanceToBottom = target.scrollHeight - target.scrollTop - target.clientHeight;
49891
- if (distanceToBottom <= 40) {
49892
- const lastId = (_a2 = historyList[historyList.length - 1]) == null ? void 0 : _a2.id;
49893
- if (lastId) {
49894
- void getHistory(lastId);
49895
- }
49896
- }
49877
+ getHistoryFromIndexedDB();
49897
49878
  };
49898
49879
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
49899
49880
  "div",
@@ -49974,28 +49955,28 @@ const AiBlockEdit = ({
49974
49955
  title: "历史记录",
49975
49956
  visible: historyVisible,
49976
49957
  onCancel: () => setHistoryVisible(false),
49977
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "side-sheet-content", onScroll: handleHistoryScroll, children: [
49958
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "side-sheet-content", children: [
49978
49959
  historyList.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
49979
49960
  "div",
49980
49961
  {
49981
49962
  className: "side-sheet-content-list",
49982
49963
  style: {
49983
- backgroundColor: currentConversationId === item.id ? "#f0f0f0" : "#fff"
49964
+ backgroundColor: currentConversationId === item.conversationId ? "#f0f0f0" : "#fff"
49984
49965
  },
49985
49966
  children: [
49986
49967
  /* @__PURE__ */ jsxRuntimeExports.jsx(
49987
49968
  "div",
49988
49969
  {
49989
49970
  className: "side-sheet-content-list-item",
49990
- onClick: () => getHistoryDetail(item.id),
49991
- children: item.inputs.Title
49971
+ onClick: () => getHistoryDetail(item),
49972
+ children: item.title
49992
49973
  }
49993
49974
  ),
49994
49975
  /* @__PURE__ */ jsxRuntimeExports.jsx(
49995
49976
  IconClose,
49996
49977
  {
49997
49978
  className: "side-sheet-content-list-close",
49998
- onClick: () => deleteHistory(item.id)
49979
+ onClick: () => deleteHistoryFromIndexedDB(item.id)
49999
49980
  }
50000
49981
  )
50001
49982
  ]
@@ -50329,7 +50310,7 @@ class BasePromptTemplate extends Runnable {
50329
50310
  return PromptTemplate2.deserialize({ ...data, _type: "prompt" });
50330
50311
  }
50331
50312
  case "few_shot": {
50332
- const { FewShotPromptTemplate } = await import("./few_shot-C7wme246.js");
50313
+ const { FewShotPromptTemplate } = await import("./few_shot-CqVSyRQV.js");
50333
50314
  return FewShotPromptTemplate.deserialize(data);
50334
50315
  }
50335
50316
  default:
@@ -51901,35 +51882,35 @@ class BaseChain extends BaseLangChain {
51901
51882
  static async deserialize(data, values = {}) {
51902
51883
  switch (data._type) {
51903
51884
  case "llm_chain": {
51904
- const { LLMChain } = await import("./llm_chain-DotVPF7M.js");
51885
+ const { LLMChain } = await import("./llm_chain-CZ4n4MFx.js");
51905
51886
  return LLMChain.deserialize(data);
51906
51887
  }
51907
51888
  case "sequential_chain": {
51908
- const { SequentialChain } = await import("./sequential_chain-Ctx-2nEf.js");
51889
+ const { SequentialChain } = await import("./sequential_chain-BwwmBxFe.js");
51909
51890
  return SequentialChain.deserialize(data);
51910
51891
  }
51911
51892
  case "simple_sequential_chain": {
51912
- const { SimpleSequentialChain } = await import("./sequential_chain-Ctx-2nEf.js");
51893
+ const { SimpleSequentialChain } = await import("./sequential_chain-BwwmBxFe.js");
51913
51894
  return SimpleSequentialChain.deserialize(data);
51914
51895
  }
51915
51896
  case "stuff_documents_chain": {
51916
- const { StuffDocumentsChain } = await import("./combine_docs_chain-BvsfAIEV.js");
51897
+ const { StuffDocumentsChain } = await import("./combine_docs_chain-BOe7gr-O.js");
51917
51898
  return StuffDocumentsChain.deserialize(data);
51918
51899
  }
51919
51900
  case "map_reduce_documents_chain": {
51920
- const { MapReduceDocumentsChain } = await import("./combine_docs_chain-BvsfAIEV.js");
51901
+ const { MapReduceDocumentsChain } = await import("./combine_docs_chain-BOe7gr-O.js");
51921
51902
  return MapReduceDocumentsChain.deserialize(data);
51922
51903
  }
51923
51904
  case "refine_documents_chain": {
51924
- const { RefineDocumentsChain } = await import("./combine_docs_chain-BvsfAIEV.js");
51905
+ const { RefineDocumentsChain } = await import("./combine_docs_chain-BOe7gr-O.js");
51925
51906
  return RefineDocumentsChain.deserialize(data);
51926
51907
  }
51927
51908
  case "vector_db_qa": {
51928
- const { VectorDBQAChain } = await import("./vector_db_qa-Cq_CyJ5A.js");
51909
+ const { VectorDBQAChain } = await import("./vector_db_qa-DVsphet0.js");
51929
51910
  return VectorDBQAChain.deserialize(data, values);
51930
51911
  }
51931
51912
  case "api_chain": {
51932
- const { APIChain } = await import("./api_chain-DxmtjGZR.js");
51913
+ const { APIChain } = await import("./api_chain-DlfmxpRO.js");
51933
51914
  return APIChain.deserialize(data);
51934
51915
  }
51935
51916
  default:
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DO3BVly9.cjs"),t=require("./index-C755WiyV.cjs"),n=["pre","script","style","textarea"],i={};function a(e,t){return Boolean(t&&"element"===t.type&&e.blanks.length>0&&e.blanks.includes(t.tagName))}function l(t,n){return"root"===n.type||"element"===n.type&&(t.head||"script"===n.tagName||e.embedded(n)||!e.phrasing(n))}exports.default=function(r){return function(c){!function(r,c){const d=c||i,s={blanks:d.blanks||[],head:!1,indentInitial:!1!==d.indentInitial,indent:"number"==typeof d.indent?" ".repeat(d.indent):"string"==typeof d.indent?d.indent:" "};function o(e,n,i){const l=e[e.length-1],r=l&&t.whitespace(l)?e[e.length-2]:l,c=(a(s,r)&&a(s,i)?"\n\n":"\n")+s.indent.repeat(Math.max(n,0));l&&"text"===l.type?l.value=t.whitespace(l)?c:l.value+c:e.push({type:"text",value:c})}e.minifyWhitespace(r,{newlines:!0}),t.visitParents(r,function(e,i){if(!("children"in e))return;if("element"===e.type&&"head"===e.tagName&&(s.head=!0),s.head&&"element"===e.type&&"body"===e.tagName&&(s.head=!1),"element"===e.type&&n.includes(e.tagName))return t.SKIP;if(0===e.children.length||!l(s,e))return;let a=i.length;s.indentInitial||a--;let r=!1;for(const t of e.children)"comment"!==t.type&&"text"!==t.type||(t.value.includes("\n")&&(r=!0),t.value=t.value.replace(/ *\n/g,"$&"+s.indent.repeat(a)));const c=[];let d;for(const t of e.children)(l(s,t)||r&&!d)&&(o(c,a,t),r=!0),d=t,c.push(t);d&&(r||l(s,d))&&(t.whitespace(d)&&(c.pop(),d=c[c.length-1]),o(c,a-1)),e.children=c})}(c,r)}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C3pnN9Uq.cjs"),t=require("./index-DkPCRrTF.cjs"),n=["pre","script","style","textarea"],i={};function a(e,t){return Boolean(t&&"element"===t.type&&e.blanks.length>0&&e.blanks.includes(t.tagName))}function l(t,n){return"root"===n.type||"element"===n.type&&(t.head||"script"===n.tagName||e.embedded(n)||!e.phrasing(n))}exports.default=function(r){return function(c){!function(r,c){const d=c||i,s={blanks:d.blanks||[],head:!1,indentInitial:!1!==d.indentInitial,indent:"number"==typeof d.indent?" ".repeat(d.indent):"string"==typeof d.indent?d.indent:" "};function o(e,n,i){const l=e[e.length-1],r=l&&t.whitespace(l)?e[e.length-2]:l,c=(a(s,r)&&a(s,i)?"\n\n":"\n")+s.indent.repeat(Math.max(n,0));l&&"text"===l.type?l.value=t.whitespace(l)?c:l.value+c:e.push({type:"text",value:c})}e.minifyWhitespace(r,{newlines:!0}),t.visitParents(r,function(e,i){if(!("children"in e))return;if("element"===e.type&&"head"===e.tagName&&(s.head=!0),s.head&&"element"===e.type&&"body"===e.tagName&&(s.head=!1),"element"===e.type&&n.includes(e.tagName))return t.SKIP;if(0===e.children.length||!l(s,e))return;let a=i.length;s.indentInitial||a--;let r=!1;for(const t of e.children)"comment"!==t.type&&"text"!==t.type||(t.value.includes("\n")&&(r=!0),t.value=t.value.replace(/ *\n/g,"$&"+s.indent.repeat(a)));const c=[];let d;for(const t of e.children)(l(s,t)||r&&!d)&&(o(c,a,t),r=!0),d=t,c.push(t);d&&(r||l(s,d))&&(t.whitespace(d)&&(c.pop(),d=c[c.length-1]),o(c,a-1)),e.children=c})}(c,r)}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C755WiyV.cjs");exports.default=e.remarkRehype,exports.defaultFootnoteBackContent=e.defaultFootnoteBackContent,exports.defaultFootnoteBackLabel=e.defaultFootnoteBackLabel,exports.defaultHandlers=e.handlers;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkPCRrTF.cjs");exports.default=e.remarkRehype,exports.defaultFootnoteBackContent=e.defaultFootnoteBackContent,exports.defaultFootnoteBackLabel=e.defaultFootnoteBackLabel,exports.defaultHandlers=e.handlers;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C755WiyV.cjs");require("katex/dist/katex.min.css"),require("@semi-bot/semi-theme-xiangshuishidai/scss/index.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/global.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/animation.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/local.scss"),require("@semi-bot/semi-theme-xiangshuishidai/semi.css"),exports.AgentWebIndex=e.AgentWebIndex,exports.AiBlockEdit=e.AiBlockEdit,exports.CommonUtil=e.CommonUtil,exports.MessageUtil=e.MessageUtil,exports.PluginExecutor=e.PluginExecutor,exports.Storage=e.LocalForageService;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkPCRrTF.cjs");require("katex/dist/katex.min.css"),require("@semi-bot/semi-theme-xiangshuishidai/scss/index.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/global.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/animation.scss"),require("@semi-bot/semi-theme-xiangshuishidai/scss/local.scss"),require("@semi-bot/semi-theme-xiangshuishidai/semi.css"),exports.AgentWebIndex=e.AgentWebIndex,exports.AiBlockEdit=e.AiBlockEdit,exports.CommonUtil=e.CommonUtil,exports.MessageUtil=e.MessageUtil,exports.PluginExecutor=e.PluginExecutor,exports.Storage=e.LocalForageService;
@@ -3,7 +3,7 @@ import * as ReactDOM from "react-dom";
3
3
  import ReactDOM__default, { flushSync, createPortal } from "react-dom";
4
4
  import * as React from "react";
5
5
  import React__default, { useLayoutEffect, useEffect, useRef, useContext, createRef, memo, createContext, createElement, version, forwardRef, useMemo, useState, useCallback, useImperativeHandle, useSyncExternalStore, Fragment as Fragment$1, useId as useId$2, cloneElement, Children } from "react";
6
- import { Z as getDefaultExportFromCjs, _ as jsxRuntimeExports } from "./index-LGBzY7X4.js";
6
+ import { Z as getDefaultExportFromCjs, _ as jsxRuntimeExports } from "./index-Z1KCXkYN.js";
7
7
  function hasWindow() {
8
8
  return typeof window !== "undefined";
9
9
  }
@@ -39841,16 +39841,16 @@ async function et$2() {
39841
39841
  if (fe$1)
39842
39842
  return fe$1;
39843
39843
  const e = await Promise.all([
39844
- import("./index-Bnvlz8he.js"),
39845
- import("./index-DY191wuv.js"),
39846
- import("./index-BVzzQN3V.js"),
39847
- import("./index-DJ5tu-ks.js"),
39848
- import("./index-Dc04u1WG.js"),
39849
- import("./index-CkEDv7A4.js"),
39850
- import("./index-kOFqOpyj.js"),
39851
- import("./index-FRCszYTB.js"),
39852
- import("./index-D2PJ83Oy.js"),
39853
- import("./index-DNJwzxBp.js")
39844
+ import("./index-DyVccl4J.js"),
39845
+ import("./index-BzQZOw18.js"),
39846
+ import("./index-B15rr_aH.js"),
39847
+ import("./index-DfAAX9yY.js"),
39848
+ import("./index-Dr_uoSon.js"),
39849
+ import("./index-B58Bx9pt.js"),
39850
+ import("./index-7bCJ03YI.js"),
39851
+ import("./index-BU90_UfO.js"),
39852
+ import("./index-B-geeHAO.js"),
39853
+ import("./index-BGFFP-s-.js")
39854
39854
  ]);
39855
39855
  return fe$1 = {
39856
39856
  rehypeParse: e[0],