@dao42/d42paas-front 0.5.39 → 0.5.47
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.
- package/dist/DaoPaaS.es.js +92 -43
- package/dist/DaoPaaS.umd.js +497 -497
- package/dist/editor.d.ts +48 -15
- package/dist/style.css +1 -1
- package/dist/tsdoc.html +60 -0
- package/package.json +1 -1
package/dist/DaoPaaS.es.js
CHANGED
|
@@ -14918,13 +14918,6 @@ const oTStore = create$3((set2) => ({
|
|
|
14918
14918
|
client: null,
|
|
14919
14919
|
senders: [],
|
|
14920
14920
|
doc: {},
|
|
14921
|
-
fileTree: {
|
|
14922
|
-
data: {
|
|
14923
|
-
type: "DIRECTORY",
|
|
14924
|
-
name: "/",
|
|
14925
|
-
children: []
|
|
14926
|
-
}
|
|
14927
|
-
},
|
|
14928
14921
|
isRecording: false,
|
|
14929
14922
|
CRDTInfo: {
|
|
14930
14923
|
operation: [],
|
|
@@ -14975,9 +14968,6 @@ const oTStore = create$3((set2) => ({
|
|
|
14975
14968
|
switchDoc: (arg) => set2(() => ({
|
|
14976
14969
|
doc: arg
|
|
14977
14970
|
})),
|
|
14978
|
-
switchDocTree: (arg) => set2(() => ({
|
|
14979
|
-
fileTree: arg
|
|
14980
|
-
})),
|
|
14981
14971
|
setSenders: (arg) => set2(() => ({
|
|
14982
14972
|
senders: arg
|
|
14983
14973
|
})),
|
|
@@ -15031,6 +15021,15 @@ const oTStore = create$3((set2) => ({
|
|
|
15031
15021
|
asyncType: arg
|
|
15032
15022
|
}))
|
|
15033
15023
|
}));
|
|
15024
|
+
const fileTreeStore = create$3(persist((set2) => ({
|
|
15025
|
+
fileTree: {},
|
|
15026
|
+
switchFileTree: (arg) => set2(() => ({
|
|
15027
|
+
fileTree: arg
|
|
15028
|
+
}))
|
|
15029
|
+
}), {
|
|
15030
|
+
name: "fileTree",
|
|
15031
|
+
getStorage: () => localStorage
|
|
15032
|
+
}));
|
|
15034
15033
|
const userStore = create$3(persist((set2) => ({
|
|
15035
15034
|
userInfo: {},
|
|
15036
15035
|
setUserInfo: (arg) => set2(() => ({
|
|
@@ -27258,6 +27257,9 @@ const PlaygroundInit = (arg) => {
|
|
|
27258
27257
|
reactDom.exports.unstable_batchedUpdates(() => {
|
|
27259
27258
|
const setUserInfo = userStore.getState().setUserInfo;
|
|
27260
27259
|
const setUserList = userListStore.getState().setUserList;
|
|
27260
|
+
const {
|
|
27261
|
+
switchFileTree
|
|
27262
|
+
} = fileTreeStore.getState();
|
|
27261
27263
|
const {
|
|
27262
27264
|
switchDoc,
|
|
27263
27265
|
setSenders,
|
|
@@ -27265,7 +27267,6 @@ const PlaygroundInit = (arg) => {
|
|
|
27265
27267
|
setAsyncType,
|
|
27266
27268
|
setServerAck,
|
|
27267
27269
|
setCustomAck,
|
|
27268
|
-
switchDocTree,
|
|
27269
27270
|
setPlaygroundInfo,
|
|
27270
27271
|
setDockerInfo,
|
|
27271
27272
|
setQueryObject,
|
|
@@ -27312,9 +27313,6 @@ const PlaygroundInit = (arg) => {
|
|
|
27312
27313
|
avatar: avatarGenerator(lodash$2.exports.random(0, 6), userData.uuid)
|
|
27313
27314
|
}), "coUsers");
|
|
27314
27315
|
setUserInfo(originUser);
|
|
27315
|
-
if (oTStore.getState().playgroundStatus === "INACTIVE") {
|
|
27316
|
-
io == null ? void 0 : io.emit("active");
|
|
27317
|
-
}
|
|
27318
27316
|
}
|
|
27319
27317
|
const userInfoList = [originUser, ...userData.coUsers.filter((f2) => f2.uuid !== originUser.uuid).map((user) => {
|
|
27320
27318
|
return __spreadProps(__spreadValues({}, user), {
|
|
@@ -27332,7 +27330,7 @@ const PlaygroundInit = (arg) => {
|
|
|
27332
27330
|
} = JSON.parse(data);
|
|
27333
27331
|
setPlaygroundInfo(playgroundInfo);
|
|
27334
27332
|
setDockerInfo(__spreadValues(__spreadValues({}, oTStore.getState().dockerInfo), dockerInfo));
|
|
27335
|
-
dockerInfo.fileTree &&
|
|
27333
|
+
dockerInfo.fileTree && switchFileTree({
|
|
27336
27334
|
data: dockerInfo.fileTree
|
|
27337
27335
|
});
|
|
27338
27336
|
setCRDTInfo(crdt);
|
|
@@ -27407,7 +27405,7 @@ const PlaygroundInit = (arg) => {
|
|
|
27407
27405
|
});
|
|
27408
27406
|
io.on("fileNode", (data) => {
|
|
27409
27407
|
const res = JSON.parse(data);
|
|
27410
|
-
|
|
27408
|
+
switchFileTree({
|
|
27411
27409
|
data: res
|
|
27412
27410
|
});
|
|
27413
27411
|
});
|
|
@@ -29466,15 +29464,17 @@ const REPLAY_INTERVAL = 250;
|
|
|
29466
29464
|
let timer;
|
|
29467
29465
|
let timeOutT;
|
|
29468
29466
|
const replayHandler = async () => {
|
|
29467
|
+
const {
|
|
29468
|
+
switchFileTree
|
|
29469
|
+
} = fileTreeStore.getState();
|
|
29469
29470
|
const {
|
|
29470
29471
|
setAppStatus,
|
|
29471
29472
|
switchDoc,
|
|
29472
|
-
switchDocTree,
|
|
29473
29473
|
setCRDTInfo,
|
|
29474
29474
|
dockerInfo,
|
|
29475
29475
|
doc
|
|
29476
29476
|
} = oTStore.getState();
|
|
29477
|
-
|
|
29477
|
+
switchFileTree == null ? void 0 : switchFileTree({
|
|
29478
29478
|
data: dockerInfo.fileTree
|
|
29479
29479
|
});
|
|
29480
29480
|
const crdts = await getLocalCRDTs();
|
|
@@ -40733,14 +40733,23 @@ const CmdKey = () => {
|
|
|
40733
40733
|
}
|
|
40734
40734
|
},
|
|
40735
40735
|
{
|
|
40736
|
-
id: "
|
|
40737
|
-
title: "
|
|
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
|
-
|
|
40873
|
-
|
|
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;
|
|
@@ -40904,7 +40916,12 @@ class DaoPaaS {
|
|
|
40904
40916
|
get ignoreReplayers() {
|
|
40905
40917
|
return ignoreReplayerStore.getState().ignoreReplayers;
|
|
40906
40918
|
}
|
|
40919
|
+
get userList() {
|
|
40920
|
+
return userListStore.getState().userList;
|
|
40921
|
+
}
|
|
40907
40922
|
async init() {
|
|
40923
|
+
if (this.mode === "tsdoc")
|
|
40924
|
+
return;
|
|
40908
40925
|
const {
|
|
40909
40926
|
setSocket,
|
|
40910
40927
|
socket: socket2
|
|
@@ -40913,7 +40930,6 @@ class DaoPaaS {
|
|
|
40913
40930
|
initClassDIV.className = "init-class";
|
|
40914
40931
|
document.body.appendChild(initClassDIV);
|
|
40915
40932
|
reactDom.exports.unstable_batchedUpdates(async () => {
|
|
40916
|
-
var _a2;
|
|
40917
40933
|
const {
|
|
40918
40934
|
setUserInfo,
|
|
40919
40935
|
userInfo
|
|
@@ -40952,14 +40968,9 @@ class DaoPaaS {
|
|
|
40952
40968
|
PlaygroundInit(__spreadProps(__spreadValues(__spreadValues({}, this.userInfo), args), {
|
|
40953
40969
|
io: this.io
|
|
40954
40970
|
}));
|
|
40955
|
-
(
|
|
40956
|
-
this.
|
|
40957
|
-
|
|
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
|
-
});
|
|
40971
|
+
if (this.components) {
|
|
40972
|
+
this.mapRender(this.components);
|
|
40973
|
+
}
|
|
40963
40974
|
});
|
|
40964
40975
|
window.onerror = (message) => {
|
|
40965
40976
|
if (/dError/.test(message)) {
|
|
@@ -41027,6 +41038,46 @@ class DaoPaaS {
|
|
|
41027
41038
|
console.log("\u4F20\u53C2\u9519\u8BEF");
|
|
41028
41039
|
}
|
|
41029
41040
|
}
|
|
41041
|
+
mapRender(components) {
|
|
41042
|
+
components == null ? void 0 : components.forEach(({
|
|
41043
|
+
container,
|
|
41044
|
+
props: props2,
|
|
41045
|
+
item
|
|
41046
|
+
}, _index) => {
|
|
41047
|
+
switch (item) {
|
|
41048
|
+
case "Tree":
|
|
41049
|
+
this.Tree({
|
|
41050
|
+
container,
|
|
41051
|
+
props: props2
|
|
41052
|
+
});
|
|
41053
|
+
break;
|
|
41054
|
+
case "Editor":
|
|
41055
|
+
this.Editor({
|
|
41056
|
+
container,
|
|
41057
|
+
props: props2
|
|
41058
|
+
});
|
|
41059
|
+
break;
|
|
41060
|
+
case "Console":
|
|
41061
|
+
this.Console({
|
|
41062
|
+
container,
|
|
41063
|
+
props: props2
|
|
41064
|
+
});
|
|
41065
|
+
break;
|
|
41066
|
+
case "Browser":
|
|
41067
|
+
this.Browser({
|
|
41068
|
+
container,
|
|
41069
|
+
props: props2
|
|
41070
|
+
});
|
|
41071
|
+
break;
|
|
41072
|
+
case "Shell":
|
|
41073
|
+
this.Shell({
|
|
41074
|
+
container,
|
|
41075
|
+
props: props2
|
|
41076
|
+
});
|
|
41077
|
+
break;
|
|
41078
|
+
}
|
|
41079
|
+
});
|
|
41080
|
+
}
|
|
41030
41081
|
Page({
|
|
41031
41082
|
container,
|
|
41032
41083
|
props: props2
|
|
@@ -41090,10 +41141,7 @@ class DaoPaaS {
|
|
|
41090
41141
|
}
|
|
41091
41142
|
}
|
|
41092
41143
|
function isHTMLElement$1(arg) {
|
|
41093
|
-
|
|
41094
|
-
arg = document.querySelector(arg);
|
|
41095
|
-
}
|
|
41096
|
-
return arg;
|
|
41144
|
+
return !/HTMLDivElement|HTMLElement/.test(Object.prototype.toString.call(arg)) ? document.querySelector(arg) : arg;
|
|
41097
41145
|
}
|
|
41098
41146
|
var __assign$a = globalThis && globalThis.__assign || function() {
|
|
41099
41147
|
__assign$a = Object.assign || function(t2) {
|
|
@@ -43288,14 +43336,16 @@ const FileTree = ({
|
|
|
43288
43336
|
} = oTStore((state) => state);
|
|
43289
43337
|
const {
|
|
43290
43338
|
fileTree
|
|
43291
|
-
} =
|
|
43339
|
+
} = fileTreeStore((state) => state);
|
|
43292
43340
|
const [treeData, setTreeData] = react.exports.useState({});
|
|
43293
43341
|
react.exports.useEffect(() => {
|
|
43294
43342
|
if (oTStore.getState().appStatus === "replay") {
|
|
43295
43343
|
setSelectedItems([]);
|
|
43296
43344
|
setExpandedItems([]);
|
|
43297
43345
|
}
|
|
43298
|
-
|
|
43346
|
+
if (!fileTree.data)
|
|
43347
|
+
return;
|
|
43348
|
+
const newData = formatFileToTree(fileTree == null ? void 0 : fileTree.data);
|
|
43299
43349
|
setSelectedItems(selectedItems.filter((item) => newData[item]));
|
|
43300
43350
|
setExpandedItems(expandedItems.filter((item) => newData[item]));
|
|
43301
43351
|
setTreeData(newData);
|
|
@@ -186213,14 +186263,11 @@ const ContentLayout = newStyled.div`
|
|
|
186213
186263
|
`;
|
|
186214
186264
|
const Editor = ({
|
|
186215
186265
|
doc,
|
|
186216
|
-
docType,
|
|
186217
186266
|
containerStyle,
|
|
186218
186267
|
menuStyle,
|
|
186219
186268
|
editorStyle
|
|
186220
186269
|
}) => {
|
|
186221
186270
|
const divEl = react.exports.useRef(null);
|
|
186222
|
-
react.exports.useState(doc ? doc : "");
|
|
186223
|
-
react.exports.useState(null);
|
|
186224
186271
|
const file = oTStore((state) => state.doc);
|
|
186225
186272
|
const setFromServer = oTStore((state) => state.setFromServer);
|
|
186226
186273
|
const [client2, setClient] = react.exports.useState(new IoClient(0));
|
|
@@ -186703,9 +186750,11 @@ const Editor = ({
|
|
|
186703
186750
|
}
|
|
186704
186751
|
}, [file == null ? void 0 : file.path]);
|
|
186705
186752
|
react.exports.useEffect(() => {
|
|
186706
|
-
|
|
186707
|
-
|
|
186708
|
-
|
|
186753
|
+
if (!!editor && (doc == null ? void 0 : doc.type)) {
|
|
186754
|
+
editor$1.setModelLanguage(editor.getModel(), doc == null ? void 0 : doc.type);
|
|
186755
|
+
editor.setValue(doc.value ? doc.value : "");
|
|
186756
|
+
}
|
|
186757
|
+
}, [doc]);
|
|
186709
186758
|
react.exports.useEffect(() => {
|
|
186710
186759
|
const {
|
|
186711
186760
|
usersDelta,
|