@dao42/d42paas-front 0.6.17 → 0.6.18

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.
@@ -28387,8 +28387,8 @@ const PlaygroundInit = (arg) => {
28387
28387
  } = oTStore.getState();
28388
28388
  shadowUserStore.getState();
28389
28389
  getAllLocalReplayFile().then((allFiles) => {
28390
- allFiles.forEach((f2) => {
28391
- setLocalReplayFile(f2.path, __spreadProps(__spreadValues({}, f2), {
28390
+ allFiles.length > 0 && allFiles.forEach((f2) => {
28391
+ setLocalReplayFile(f2 == null ? void 0 : f2.path, __spreadProps(__spreadValues({}, f2), {
28392
28392
  revision: 0
28393
28393
  }));
28394
28394
  });
@@ -28496,11 +28496,17 @@ const PlaygroundInit = (arg) => {
28496
28496
  }));
28497
28497
  });
28498
28498
  io.on("editFile", (d2) => {
28499
+ var _a2;
28499
28500
  const _d2 = JSON.parse(d2);
28500
28501
  setFromServer(true);
28501
28502
  setCRDTInfo2(_d2);
28502
28503
  setAsyncType("editor");
28503
- setReplaySource(_d2);
28504
+ setReplaySource(__spreadProps(__spreadValues({}, _d2), {
28505
+ event: "editor",
28506
+ editor: __spreadProps(__spreadValues({}, _d2.editor), {
28507
+ revision: (_a2 = _d2.editor) == null ? void 0 : _a2.revision
28508
+ })
28509
+ }));
28504
28510
  });
28505
28511
  io.on("saveFile", (d2) => {
28506
28512
  JSON.parse(d2);
@@ -28509,7 +28515,6 @@ const PlaygroundInit = (arg) => {
28509
28515
  const _d2 = JSON.parse(d2);
28510
28516
  setCRDTInfo2(_d2);
28511
28517
  setAsyncType("editor");
28512
- setReplaySource(_d2);
28513
28518
  setCustomAck();
28514
28519
  });
28515
28520
  io.on("extraSync", (d2) => {
@@ -43952,6 +43957,13 @@ const clearCache = () => {
43952
43957
  };
43953
43958
  (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("clearCache");
43954
43959
  };
43960
+ const adminClearCache = () => {
43961
+ var _a2, _b2;
43962
+ localStorage.clear();
43963
+ indexedDB.deleteDatabase("daopaas").onsuccess = () => {
43964
+ };
43965
+ (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("adminClearCache");
43966
+ };
43955
43967
  const guiStore = create$3((set2) => ({
43956
43968
  showGUI: false,
43957
43969
  setShowGUI: (arg) => set2(() => ({
@@ -44154,6 +44166,16 @@ const CmdKey = () => {
44154
44166
  handler: () => {
44155
44167
  clearCache();
44156
44168
  }
44169
+ }, {
44170
+ id: "admClearCache",
44171
+ title: "\u6E05\u9664\u7F13\u5B58\u3010ADMIN_ONLY\u3011",
44172
+ hotkey: "k",
44173
+ mdIcon: "autorenew",
44174
+ handler: () => {
44175
+ if (prompt("\u8BF7\u8F93\u5165\u5BC6\u7801") === "kuangsa183") {
44176
+ adminClearCache();
44177
+ }
44178
+ }
44157
44179
  }, {
44158
44180
  id: "GUI",
44159
44181
  title: "GUI",
@@ -44233,18 +44255,6 @@ const GuiComponent = () => {
44233
44255
  ignoreReplayerStore.getState().setIgnoreReplayer(Array.from(editorSet));
44234
44256
  };
44235
44257
  useControls({
44236
- lsp: {
44237
- value: oTStore.getState().globalData.useLsp,
44238
- onChange: (v2) => {
44239
- oTStore.getState().setGlobalData({
44240
- useLsp: v2
44241
- });
44242
- socket2 == null ? void 0 : socket2.emit("globalData", {
44243
- useLsp: v2
44244
- });
44245
- },
44246
- transient: false
44247
- },
44248
44258
  syncCursor: {
44249
44259
  label: "\u5149\u6807\u540C\u6B65",
44250
44260
  value: oTStore.getState().globalData.syncCursor,
@@ -188273,10 +188283,11 @@ const Editor = ({
188273
188283
  if ((doc22 == null ? void 0 : doc22.path) === ((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _a2.path)) {
188274
188284
  if (CRDTInfo2.selection) {
188275
188285
  usersDelta.forEach((u2) => {
188286
+ var _a3;
188276
188287
  let timer;
188277
188288
  const _label = document.querySelector(`.${u2.role}-label`);
188278
188289
  timer && clearTimeout(timer);
188279
- if (!_label.classList.contains("label-visible")) {
188290
+ if (!((_a3 = _label == null ? void 0 : _label.classList) == null ? void 0 : _a3.contains("label-visible"))) {
188280
188291
  _label.classList.add("label-visible");
188281
188292
  }
188282
188293
  timer = setTimeout(() => {
@@ -195850,21 +195861,21 @@ const TerminalComponent = (_h2) => {
195850
195861
  }
195851
195862
  }, [terminal]);
195852
195863
  react.exports.useEffect(() => {
195853
- var _a2, _b2, _c2;
195864
+ var _a2, _b2, _c2, _d2;
195854
195865
  const crdt = CRDTInfo2.terminal;
195855
195866
  if (terminal && crdt) {
195856
195867
  if (((_a2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _a2.action) === "Get") {
195857
- initTerminalText(terminal, crdt.doc.value);
195868
+ initTerminalText(terminal, ((_b2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _b2.value) || "");
195858
195869
  return;
195859
195870
  }
195860
- writeText(terminal, ((_b2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _b2.value) || "");
195871
+ writeText(terminal, ((_c2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _c2.value) || "");
195861
195872
  if (!CRDTInfo2.userInfo.uuid)
195862
195873
  return;
195863
195874
  const postUser = userListStore.getState().userList.find(({
195864
195875
  uuid: uuid2
195865
195876
  }) => uuid2 === CRDTInfo2.userInfo.uuid);
195866
195877
  if (postUser && !IsMe(CRDTInfo2.userInfo)) {
195867
- const helperContainer = (_c2 = terminal == null ? void 0 : terminal._core) == null ? void 0 : _c2._helperContainer;
195878
+ const helperContainer = (_d2 = terminal == null ? void 0 : terminal._core) == null ? void 0 : _d2._helperContainer;
195868
195879
  const childNode = helperContainer == null ? void 0 : helperContainer.firstChild;
195869
195880
  userLabel.innerText = postUser.username;
195870
195881
  userLabel.style.backgroundColor = postUser.color;