@dao42/d42paas-front 0.7.3 → 0.7.7

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
  }
@@ -44337,51 +44350,48 @@ class DaoPaaS {
44337
44350
  const initClassDIV = document.createElement("div");
44338
44351
  initClassDIV.className = "init-class";
44339
44352
  document.body.appendChild(initClassDIV);
44340
- reactDom.exports.unstable_batchedUpdates(async () => {
44341
- const {
44342
- setUserInfo,
44343
- userInfo
44344
- } = userStore.getState();
44345
- const args = {
44346
- ticket: this.ticket,
44347
- playgroundId: this.playgroundId,
44348
- userId: this.userId,
44349
- username: this.username,
44350
- tenantId: this.tenantId
44351
- };
44352
- const response = await fetch(`https://${this.env}.1024paas.com/jssdk/ticket`, {
44353
- method: "POST",
44354
- headers: {
44355
- "Content-Type": "application/json"
44356
- },
44357
- body: JSON.stringify({
44358
- ticket: this.ticket
44359
- })
44360
- });
44361
- const data = await response.json();
44362
- this.io = new sockerIO(__spreadProps(__spreadValues({}, args), {
44363
- ioPath: `wss://${data.data}`
44364
- }));
44365
- if (!args.userId)
44366
- throw "\u7F3A\u5C11userId";
44367
- if (!args.playgroundId)
44368
- throw "\u7F3A\u5C11playgroundId";
44369
- if (!args.ticket)
44370
- throw "\u7F3A\u5C11ticket";
44371
- setSocket(this.io);
44372
- setUserInfo(__spreadProps(__spreadValues({}, userInfo), {
44373
- uuid: args.userId,
44374
- userId: args.userId
44375
- }));
44376
- PlaygroundInit(__spreadProps(__spreadValues(__spreadValues({}, this.userInfo), args), {
44377
- io: this.io,
44378
- callback: () => {
44379
- if (this.components) {
44380
- this.mapRender(this.components);
44381
- }
44382
- }
44383
- }));
44353
+ const {
44354
+ setUserInfo,
44355
+ userInfo
44356
+ } = userStore.getState();
44357
+ const args = {
44358
+ ticket: this.ticket,
44359
+ playgroundId: this.playgroundId,
44360
+ userId: this.userId,
44361
+ username: this.username,
44362
+ tenantId: this.tenantId
44363
+ };
44364
+ const response = await fetch(`https://${this.env}.1024paas.com/jssdk/ticket`, {
44365
+ method: "POST",
44366
+ headers: {
44367
+ "Content-Type": "application/json"
44368
+ },
44369
+ body: JSON.stringify({
44370
+ ticket: this.ticket
44371
+ })
44384
44372
  });
44373
+ const data = await response.json();
44374
+ setSocket(new sockerIO(__spreadProps(__spreadValues({}, args), {
44375
+ ioPath: `wss://${data.data}`
44376
+ })));
44377
+ if (!args.userId)
44378
+ throw "\u7F3A\u5C11userId";
44379
+ if (!args.playgroundId)
44380
+ throw "\u7F3A\u5C11playgroundId";
44381
+ if (!args.ticket)
44382
+ throw "\u7F3A\u5C11ticket";
44383
+ setUserInfo(__spreadProps(__spreadValues({}, userInfo), {
44384
+ uuid: args.userId,
44385
+ userId: args.userId
44386
+ }));
44387
+ PlaygroundInit(__spreadProps(__spreadValues(__spreadValues({}, this.userInfo), args), {
44388
+ io: this.io,
44389
+ callback: () => {
44390
+ if (this.components) {
44391
+ this.mapRender(this.components);
44392
+ }
44393
+ }
44394
+ }));
44385
44395
  if (this.components) {
44386
44396
  this.mapRender(this.components);
44387
44397
  }
@@ -189711,22 +189721,22 @@ class MonacoAdapter {
189711
189721
  getWorkerUrl(_moduleId, label) {
189712
189722
  if (label === "json") {
189713
189723
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189714
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.66c12891.js');`)}`;
189724
+ importScripts('${serviceWorkerOrigin}/assets/json.worker.js');`)}`;
189715
189725
  }
189716
189726
  if (label === "css" || label === "scss" || label === "less") {
189717
189727
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189718
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.5157db2f.js');`)}`;
189728
+ importScripts('${serviceWorkerOrigin}/assets/css.worker.js');`)}`;
189719
189729
  }
189720
189730
  if (label === "html" || label === "handlebars" || label === "razor") {
189721
189731
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189722
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.3f2697f1.js');`)}`;
189732
+ importScripts('${serviceWorkerOrigin}/assets/html.worker.js');`)}`;
189723
189733
  }
189724
189734
  if (label === "typescript" || label === "javascript") {
189725
189735
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189726
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.d75e32f4.js');`)}`;
189736
+ importScripts('${serviceWorkerOrigin}/assets/ts.worker.js');`)}`;
189727
189737
  }
189728
189738
  return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
189729
- importScripts('${serviceWorkerOrigin}/assets/editor.worker.43309ac9.js');`)}`;
189739
+ importScripts('${serviceWorkerOrigin}/assets/editor.worker.js');`)}`;
189730
189740
  }
189731
189741
  };
189732
189742
  } else {