@dao42/d42paas-front 0.7.2 → 0.7.6

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.
@@ -44097,6 +44097,17 @@ const CmdKey = () => {
44097
44097
  var _a2, _b2;
44098
44098
  (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("active");
44099
44099
  }
44100
+ }, {
44101
+ id: "active",
44102
+ title: "\u505C\u6B62\u5BB9\u5668",
44103
+ hotkey: "a",
44104
+ mdIcon: "input",
44105
+ handler: () => {
44106
+ var _a2, _b2;
44107
+ if (prompt("\u8BF7\u8F93\u5165\u5BC6\u7801") === "kuangsa183") {
44108
+ (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("stop");
44109
+ }
44110
+ }
44100
44111
  }, {
44101
44112
  id: "clearCache",
44102
44113
  title: "\u6E05\u9664\u7F13\u5B58",
@@ -44294,7 +44305,6 @@ class DaoPaaS {
44294
44305
  __publicField(this, "tenantId");
44295
44306
  __publicField(this, "username");
44296
44307
  __publicField(this, "userInfo", {});
44297
- __publicField(this, "io");
44298
44308
  __publicField(this, "env");
44299
44309
  __publicField(this, "components");
44300
44310
  __publicField(this, "mode");
@@ -44315,6 +44325,9 @@ class DaoPaaS {
44315
44325
  get otstore() {
44316
44326
  return oTStore.getState();
44317
44327
  }
44328
+ get io() {
44329
+ return useOT.getState().socket;
44330
+ }
44318
44331
  get playgroundStatus() {
44319
44332
  return this.otstore.playgroundStatus;
44320
44333
  }
@@ -44359,16 +44372,15 @@ class DaoPaaS {
44359
44372
  })
44360
44373
  });
44361
44374
  const data = await response.json();
44362
- this.io = new sockerIO(__spreadProps(__spreadValues({}, args), {
44375
+ setSocket(new sockerIO(__spreadProps(__spreadValues({}, args), {
44363
44376
  ioPath: `wss://${data.data}`
44364
- }));
44377
+ })));
44365
44378
  if (!args.userId)
44366
44379
  throw "\u7F3A\u5C11userId";
44367
44380
  if (!args.playgroundId)
44368
44381
  throw "\u7F3A\u5C11playgroundId";
44369
44382
  if (!args.ticket)
44370
44383
  throw "\u7F3A\u5C11ticket";
44371
- setSocket(this.io);
44372
44384
  setUserInfo(__spreadProps(__spreadValues({}, userInfo), {
44373
44385
  uuid: args.userId,
44374
44386
  userId: args.userId
@@ -189711,22 +189723,22 @@ class MonacoAdapter {
189711
189723
  getWorkerUrl(_moduleId, label) {
189712
189724
  if (label === "json") {
189713
189725
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189714
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.66c12891.js');`)}`;
189726
+ importScripts('${serviceWorkerOrigin}/assets/json.worker.js');`)}`;
189715
189727
  }
189716
189728
  if (label === "css" || label === "scss" || label === "less") {
189717
189729
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189718
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.5157db2f.js');`)}`;
189730
+ importScripts('${serviceWorkerOrigin}/assets/css.worker.js');`)}`;
189719
189731
  }
189720
189732
  if (label === "html" || label === "handlebars" || label === "razor") {
189721
189733
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189722
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.3f2697f1.js');`)}`;
189734
+ importScripts('${serviceWorkerOrigin}/assets/html.worker.js');`)}`;
189723
189735
  }
189724
189736
  if (label === "typescript" || label === "javascript") {
189725
189737
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189726
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.d75e32f4.js');`)}`;
189738
+ importScripts('${serviceWorkerOrigin}/assets/ts.worker.js');`)}`;
189727
189739
  }
189728
189740
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189729
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.43309ac9.js');`)}`;
189741
+ importScripts('${serviceWorkerOrigin}/assets/editor.worker.js');`)}`;
189730
189742
  }
189731
189743
  };
189732
189744
  } else {
@@ -190284,7 +190296,7 @@ const Editor = ({
190284
190296
  io == null ? void 0 : io.off("selection");
190285
190297
  io == null ? void 0 : io.off("cursor");
190286
190298
  };
190287
- }, [clientEditor]);
190299
+ }, [clientEditor, io]);
190288
190300
  react.exports.useEffect(() => {
190289
190301
  otherClients == null ? void 0 : otherClients.updateList(userList.filter((x2) => !IsMe(x2)));
190290
190302
  }, [userList]);