@dao42/d42paas-front 0.5.38 → 0.5.45

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.
@@ -40733,14 +40733,23 @@ const CmdKey = () => {
40733
40733
  }
40734
40734
  },
40735
40735
  {
40736
- id: "doc",
40737
- title: "\u6587\u6863",
40736
+ id: "storybook",
40737
+ title: "storybook",
40738
40738
  hotkey: "d",
40739
40739
  mdIcon: "description",
40740
40740
  handler: () => {
40741
40741
  window.open("https://develop.1024paas.com/storybook");
40742
40742
  }
40743
40743
  },
40744
+ {
40745
+ id: "tsdoc",
40746
+ title: "TS\u6587\u6863",
40747
+ hotkey: "t",
40748
+ mdIcon: "highlight",
40749
+ handler: () => {
40750
+ window.open("https://develop.1024paas.com/tsdoc");
40751
+ }
40752
+ },
40744
40753
  {
40745
40754
  id: "clearCache",
40746
40755
  title: "\u6E05\u9664\u7F13\u5B58",
@@ -40864,13 +40873,14 @@ const LazyPageComponent = lazy$2(async () => await Promise.resolve().then(functi
40864
40873
  }));
40865
40874
  class DaoPaaS {
40866
40875
  constructor({
40876
+ mode,
40867
40877
  ticket,
40868
40878
  playgroundId,
40869
40879
  userId,
40870
40880
  tenantId,
40871
40881
  username,
40872
- env: env2 = "develop",
40873
- components
40882
+ components,
40883
+ env: env2 = "develop"
40874
40884
  }) {
40875
40885
  __publicField(this, "shellDOM");
40876
40886
  __publicField(this, "editorDOM");
@@ -40885,6 +40895,8 @@ class DaoPaaS {
40885
40895
  __publicField(this, "io");
40886
40896
  __publicField(this, "env");
40887
40897
  __publicField(this, "components");
40898
+ __publicField(this, "mode");
40899
+ this.mode = mode;
40888
40900
  this.ticket = ticket;
40889
40901
  this.playgroundId = playgroundId;
40890
40902
  this.userId = userId;
@@ -40905,6 +40917,8 @@ class DaoPaaS {
40905
40917
  return ignoreReplayerStore.getState().ignoreReplayers;
40906
40918
  }
40907
40919
  async init() {
40920
+ if (this.mode === "tsdoc")
40921
+ return;
40908
40922
  const {
40909
40923
  setSocket,
40910
40924
  socket: socket2
@@ -40913,7 +40927,6 @@ class DaoPaaS {
40913
40927
  initClassDIV.className = "init-class";
40914
40928
  document.body.appendChild(initClassDIV);
40915
40929
  reactDom.exports.unstable_batchedUpdates(async () => {
40916
- var _a2;
40917
40930
  const {
40918
40931
  setUserInfo,
40919
40932
  userInfo
@@ -40952,14 +40965,9 @@ class DaoPaaS {
40952
40965
  PlaygroundInit(__spreadProps(__spreadValues(__spreadValues({}, this.userInfo), args), {
40953
40966
  io: this.io
40954
40967
  }));
40955
- (_a2 = this.components) == null ? void 0 : _a2.forEach((comp, index2) => {
40956
- this.editorDOM = comp.container ? isHTMLElement$1(comp.container) : this.editorDOM;
40957
- const ArgRenderToComponent = `Lazy${comp.component}Component`;
40958
- reactDom.exports.render(/* @__PURE__ */ jsx(react.exports.Suspense, {
40959
- fallback: /* @__PURE__ */ jsx(Loading, {}),
40960
- children: /* @__PURE__ */ jsx(ArgRenderToComponent, __spreadValues({}, comp.props))
40961
- }), this.editorDOM);
40962
- });
40968
+ if (this.components) {
40969
+ this.mapRender(this.components);
40970
+ }
40963
40971
  });
40964
40972
  window.onerror = (message) => {
40965
40973
  if (/dError/.test(message)) {
@@ -41027,6 +41035,46 @@ class DaoPaaS {
41027
41035
  console.log("\u4F20\u53C2\u9519\u8BEF");
41028
41036
  }
41029
41037
  }
41038
+ mapRender(components) {
41039
+ components == null ? void 0 : components.forEach(({
41040
+ container,
41041
+ props: props2,
41042
+ item
41043
+ }, _index) => {
41044
+ switch (item) {
41045
+ case "Tree":
41046
+ this.Tree({
41047
+ container,
41048
+ props: props2
41049
+ });
41050
+ break;
41051
+ case "Editor":
41052
+ this.Editor({
41053
+ container,
41054
+ props: props2
41055
+ });
41056
+ break;
41057
+ case "Console":
41058
+ this.Console({
41059
+ container,
41060
+ props: props2
41061
+ });
41062
+ break;
41063
+ case "Browser":
41064
+ this.Browser({
41065
+ container,
41066
+ props: props2
41067
+ });
41068
+ break;
41069
+ case "Shell":
41070
+ this.Shell({
41071
+ container,
41072
+ props: props2
41073
+ });
41074
+ break;
41075
+ }
41076
+ });
41077
+ }
41030
41078
  Page({
41031
41079
  container,
41032
41080
  props: props2
@@ -41090,10 +41138,7 @@ class DaoPaaS {
41090
41138
  }
41091
41139
  }
41092
41140
  function isHTMLElement$1(arg) {
41093
- if (!/HTMLDivElement|HTMLElement/.test(Object.prototype.toString.call(arg))) {
41094
- arg = document.querySelector(arg);
41095
- }
41096
- return arg;
41141
+ return !/HTMLDivElement|HTMLElement/.test(Object.prototype.toString.call(arg)) ? document.querySelector(arg) : arg;
41097
41142
  }
41098
41143
  var __assign$a = globalThis && globalThis.__assign || function() {
41099
41144
  __assign$a = Object.assign || function(t2) {
@@ -186213,14 +186258,11 @@ const ContentLayout = newStyled.div`
186213
186258
  `;
186214
186259
  const Editor = ({
186215
186260
  doc,
186216
- docType,
186217
186261
  containerStyle,
186218
186262
  menuStyle,
186219
186263
  editorStyle
186220
186264
  }) => {
186221
186265
  const divEl = react.exports.useRef(null);
186222
- react.exports.useState(doc ? doc : "");
186223
- react.exports.useState(null);
186224
186266
  const file = oTStore((state) => state.doc);
186225
186267
  const setFromServer = oTStore((state) => state.setFromServer);
186226
186268
  const [client2, setClient] = react.exports.useState(new IoClient(0));
@@ -186703,9 +186745,11 @@ const Editor = ({
186703
186745
  }
186704
186746
  }, [file == null ? void 0 : file.path]);
186705
186747
  react.exports.useEffect(() => {
186706
- }, [docType]);
186707
- react.exports.useEffect(() => {
186708
- }, [doc, docType]);
186748
+ if (!!editor && (doc == null ? void 0 : doc.type)) {
186749
+ editor$1.setModelLanguage(editor.getModel(), doc == null ? void 0 : doc.type);
186750
+ editor.setValue(doc.value ? doc.value : "");
186751
+ }
186752
+ }, [doc]);
186709
186753
  react.exports.useEffect(() => {
186710
186754
  const {
186711
186755
  usersDelta,