@dao42/d42paas-front 0.7.34 → 0.7.38

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.
@@ -14944,6 +14944,12 @@ const dockerState = create$5(subscribeWithSelector$1((set2) => ({
14944
14944
  dockerStatus: arg
14945
14945
  })
14946
14946
  })));
14947
+ const ErrorMsgState = create$5(subscribeWithSelector$1((set2) => ({
14948
+ message: {},
14949
+ setMessage: (arg) => set2({
14950
+ message: arg
14951
+ })
14952
+ })));
14947
14953
  const oTStore = create$5(subscribeWithSelector$1((set2) => ({
14948
14954
  asyncType: void 0,
14949
14955
  appStatus: "code",
@@ -28639,6 +28645,25 @@ const PlaygroundInit = (arg) => {
28639
28645
  io.on("dockerStatus", (data) => {
28640
28646
  setDockerStatus(data || "STOP");
28641
28647
  });
28648
+ io.on("folderEvent", async (d2) => {
28649
+ var _a2, _b2;
28650
+ const _d2 = JSON.parse(d2);
28651
+ setCRDTInfo2(_d2);
28652
+ setAsyncType("file");
28653
+ setReplaySource(__spreadProps(__spreadValues({}, _d2), {
28654
+ event: "file"
28655
+ }));
28656
+ const localReplayFile = await (await daopaasDB()).get("replayFiles", _d2.file.path);
28657
+ if (!localReplayFile) {
28658
+ setLocalReplayFile((_a2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _a2.path, {
28659
+ value: _d2.file.value,
28660
+ revision: 0,
28661
+ path: _d2.file.path
28662
+ });
28663
+ }
28664
+ if (((_b2 = shadowUserStore.getState().shadowUser) == null ? void 0 : _b2.uuid) || IsMe(_d2 == null ? void 0 : _d2.userInfo) && _d2.file)
28665
+ ;
28666
+ });
28642
28667
  io.on("fileContent", async (d2) => {
28643
28668
  var _a2, _b2;
28644
28669
  const _d2 = JSON.parse(d2);
@@ -28704,6 +28729,9 @@ const PlaygroundInit = (arg) => {
28704
28729
  event: "media"
28705
28730
  }));
28706
28731
  });
28732
+ io.on("errorHandler", (d2) => {
28733
+ ErrorMsgState.getState().setMessage(d2);
28734
+ });
28707
28735
  io.on("disconnect", (reason) => {
28708
28736
  if (reason === "io server disconnect") {
28709
28737
  return;
@@ -41903,6 +41931,196 @@ register$2(LevaInputs.BOOLEAN, boolean$6);
41903
41931
  register$2(LevaInputs.INTERVAL, interval);
41904
41932
  register$2(LevaInputs.VECTOR3D, vector3d);
41905
41933
  register$2(LevaInputs.VECTOR2D, vector2d);
41934
+ const clearCache = () => {
41935
+ var _a2, _b2;
41936
+ localStorage.clear();
41937
+ indexedDB.deleteDatabase("daopaas").onsuccess = () => {
41938
+ };
41939
+ (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("clearCache");
41940
+ };
41941
+ const adminClearCache = () => {
41942
+ var _a2, _b2;
41943
+ localStorage.clear();
41944
+ indexedDB.deleteDatabase("daopaas").onsuccess = () => {
41945
+ };
41946
+ (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("adminClearCache");
41947
+ };
41948
+ const guiStore = create$5((set2) => ({
41949
+ showGUI: false,
41950
+ setShowGUI: (arg) => set2(() => ({
41951
+ showGUI: arg
41952
+ }))
41953
+ }));
41954
+ var CRDTKeyToVal;
41955
+ (function(CRDTKeyToVal2) {
41956
+ CRDTKeyToVal2["editor"] = "\u7F16\u8F91\u5668";
41957
+ CRDTKeyToVal2["file"] = "\u6587\u4EF6";
41958
+ CRDTKeyToVal2["terminal"] = "\u7EC8\u7AEF";
41959
+ CRDTKeyToVal2["console"] = "\u8FD0\u884C\u6846";
41960
+ CRDTKeyToVal2["media"] = "\u5F71\u97F3";
41961
+ })(CRDTKeyToVal || (CRDTKeyToVal = {}));
41962
+ var DefaultContext = {
41963
+ color: void 0,
41964
+ size: void 0,
41965
+ className: void 0,
41966
+ style: void 0,
41967
+ attr: void 0
41968
+ };
41969
+ var IconContext = React.createContext && React.createContext(DefaultContext);
41970
+ var __assign$b = globalThis && globalThis.__assign || function() {
41971
+ __assign$b = Object.assign || function(t2) {
41972
+ for (var s2, i = 1, n2 = arguments.length; i < n2; i++) {
41973
+ s2 = arguments[i];
41974
+ for (var p2 in s2)
41975
+ if (Object.prototype.hasOwnProperty.call(s2, p2))
41976
+ t2[p2] = s2[p2];
41977
+ }
41978
+ return t2;
41979
+ };
41980
+ return __assign$b.apply(this, arguments);
41981
+ };
41982
+ var __rest = globalThis && globalThis.__rest || function(s2, e2) {
41983
+ var t2 = {};
41984
+ for (var p2 in s2)
41985
+ if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0)
41986
+ t2[p2] = s2[p2];
41987
+ if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
41988
+ for (var i = 0, p2 = Object.getOwnPropertySymbols(s2); i < p2.length; i++) {
41989
+ if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i]))
41990
+ t2[p2[i]] = s2[p2[i]];
41991
+ }
41992
+ return t2;
41993
+ };
41994
+ function Tree2Element(tree2) {
41995
+ return tree2 && tree2.map(function(node2, i) {
41996
+ return React.createElement(node2.tag, __assign$b({
41997
+ key: i
41998
+ }, node2.attr), Tree2Element(node2.child));
41999
+ });
42000
+ }
42001
+ function GenIcon(data) {
42002
+ return function(props2) {
42003
+ return React.createElement(IconBase, __assign$b({
42004
+ attr: __assign$b({}, data.attr)
42005
+ }, props2), Tree2Element(data.child));
42006
+ };
42007
+ }
42008
+ function IconBase(props2) {
42009
+ var elem = function(conf2) {
42010
+ var attr = props2.attr, size2 = props2.size, title = props2.title, svgProps = __rest(props2, ["attr", "size", "title"]);
42011
+ var computedSize = size2 || conf2.size || "1em";
42012
+ var className;
42013
+ if (conf2.className)
42014
+ className = conf2.className;
42015
+ if (props2.className)
42016
+ className = (className ? className + " " : "") + props2.className;
42017
+ return React.createElement("svg", __assign$b({
42018
+ stroke: "currentColor",
42019
+ fill: "currentColor",
42020
+ strokeWidth: "0"
42021
+ }, conf2.attr, attr, svgProps, {
42022
+ className,
42023
+ style: __assign$b(__assign$b({
42024
+ color: props2.color || conf2.color
42025
+ }, conf2.style), props2.style),
42026
+ height: computedSize,
42027
+ width: computedSize,
42028
+ xmlns: "http://www.w3.org/2000/svg"
42029
+ }), title && React.createElement("title", null, title), props2.children);
42030
+ };
42031
+ return IconContext !== void 0 ? React.createElement(IconContext.Consumer, null, function(conf2) {
42032
+ return elem(conf2);
42033
+ }) : elem(DefaultContext);
42034
+ }
42035
+ function MdOutlinePersonOutline(props2) {
42036
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M12 5.9a2.1 2.1 0 110 4.2 2.1 2.1 0 010-4.2m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z" } }] })(props2);
42037
+ }
42038
+ const DrawerComponent = ({
42039
+ drawerOpen,
42040
+ setDrawerOpen,
42041
+ replayList,
42042
+ option
42043
+ }) => {
42044
+ const [filterVal, setFilterVal] = react.exports.useState("");
42045
+ react.exports.useEffect(() => {
42046
+ }, [replayList]);
42047
+ return /* @__PURE__ */ jsxs(Drawer$1, {
42048
+ size: "lg",
42049
+ placement: "right",
42050
+ open: drawerOpen,
42051
+ onClose: () => setDrawerOpen(false),
42052
+ children: [/* @__PURE__ */ jsxs(Drawer$1.Header, {
42053
+ children: [/* @__PURE__ */ jsx(Drawer$1.Title, {
42054
+ children: !option ? "\u56DE\u653E\u5217\u8868" : option.title ? option.title : ""
42055
+ }), /* @__PURE__ */ jsx(Drawer$1.Actions, {
42056
+ children: /* @__PURE__ */ jsxs(InputGroup$1, {
42057
+ children: [/* @__PURE__ */ jsx(InputGroup$1.Addon, {
42058
+ children: /* @__PURE__ */ jsx(MdOutlinePersonOutline, {
42059
+ size: "1.5em"
42060
+ })
42061
+ }), /* @__PURE__ */ jsx(Input$1, {
42062
+ onChange: (evt) => {
42063
+ setFilterVal(evt);
42064
+ }
42065
+ })]
42066
+ })
42067
+ })]
42068
+ }), /* @__PURE__ */ jsx(Drawer$1.Body, {
42069
+ children: replayList ? /* @__PURE__ */ jsx("div", {
42070
+ children: /* @__PURE__ */ jsx("ul", {
42071
+ role: "list",
42072
+ className: "marker:text-sky-400 list-disc pl-5 space-y-3 text-gray-400",
42073
+ children: filterVal ? replayList.filter((item) => userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid).username.indexOf(filterVal) >= 0).map((item, index2) => {
42074
+ var _a2, _b2;
42075
+ return /* @__PURE__ */ jsxs("li", {
42076
+ className: "hover:ring-sky-500 cursor-pointer",
42077
+ onClick: () => {
42078
+ setDrawerOpen(false);
42079
+ replay({
42080
+ timestamp: item.timestamp
42081
+ });
42082
+ },
42083
+ children: [CRDTKeyToVal[item.event], /* @__PURE__ */ jsx("span", {
42084
+ className: "mx-4",
42085
+ style: {
42086
+ color: (_a2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _a2.color
42087
+ },
42088
+ children: (_b2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _b2.username
42089
+ }), /* @__PURE__ */ jsxs("span", {
42090
+ children: ["\u3010", dayjs(Number(item.timestamp)).format("YYYY-DD-MM hh:mm:ss"), "\u3011"]
42091
+ })]
42092
+ }, index2);
42093
+ }) : replayList.map((item, index2) => {
42094
+ var _a2, _b2;
42095
+ return /* @__PURE__ */ jsxs("li", {
42096
+ className: "hover:ring-sky-500 cursor-pointer",
42097
+ onClick: () => {
42098
+ setDrawerOpen(false);
42099
+ replay({
42100
+ userId: item.userInfo.uuid,
42101
+ timestamp: item.timestamp
42102
+ });
42103
+ },
42104
+ children: [CRDTKeyToVal[item.event], /* @__PURE__ */ jsx("span", {
42105
+ className: "mx-4",
42106
+ style: {
42107
+ color: (_a2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _a2.color
42108
+ },
42109
+ children: (_b2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _b2.username
42110
+ }), /* @__PURE__ */ jsxs("span", {
42111
+ children: ["\u3010", dayjs(Number(item.timestamp)).format("YYYY-DD-MM hh:mm:ss"), "\u3011"]
42112
+ })]
42113
+ }, index2);
42114
+ })
42115
+ })
42116
+ }) : /* @__PURE__ */ jsx(Placeholder$2.Paragraph, {
42117
+ style: {
42118
+ marginTop: 30
42119
+ }
42120
+ })
42121
+ })]
42122
+ });
42123
+ };
41906
42124
  /**
41907
42125
  * @license
41908
42126
  * Copyright 2019 Google LLC
@@ -44160,196 +44378,6 @@ __decorate$1z([
44160
44378
  NinjaKeys = __decorate$1z([
44161
44379
  n$2("ninja-keys")
44162
44380
  ], NinjaKeys);
44163
- const clearCache = () => {
44164
- var _a2, _b2;
44165
- localStorage.clear();
44166
- indexedDB.deleteDatabase("daopaas").onsuccess = () => {
44167
- };
44168
- (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("clearCache");
44169
- };
44170
- const adminClearCache = () => {
44171
- var _a2, _b2;
44172
- localStorage.clear();
44173
- indexedDB.deleteDatabase("daopaas").onsuccess = () => {
44174
- };
44175
- (_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("adminClearCache");
44176
- };
44177
- const guiStore = create$5((set2) => ({
44178
- showGUI: false,
44179
- setShowGUI: (arg) => set2(() => ({
44180
- showGUI: arg
44181
- }))
44182
- }));
44183
- var CRDTKeyToVal;
44184
- (function(CRDTKeyToVal2) {
44185
- CRDTKeyToVal2["editor"] = "\u7F16\u8F91\u5668";
44186
- CRDTKeyToVal2["file"] = "\u6587\u4EF6";
44187
- CRDTKeyToVal2["terminal"] = "\u7EC8\u7AEF";
44188
- CRDTKeyToVal2["console"] = "\u8FD0\u884C\u6846";
44189
- CRDTKeyToVal2["media"] = "\u5F71\u97F3";
44190
- })(CRDTKeyToVal || (CRDTKeyToVal = {}));
44191
- var DefaultContext = {
44192
- color: void 0,
44193
- size: void 0,
44194
- className: void 0,
44195
- style: void 0,
44196
- attr: void 0
44197
- };
44198
- var IconContext = React.createContext && React.createContext(DefaultContext);
44199
- var __assign$b = globalThis && globalThis.__assign || function() {
44200
- __assign$b = Object.assign || function(t2) {
44201
- for (var s2, i = 1, n2 = arguments.length; i < n2; i++) {
44202
- s2 = arguments[i];
44203
- for (var p2 in s2)
44204
- if (Object.prototype.hasOwnProperty.call(s2, p2))
44205
- t2[p2] = s2[p2];
44206
- }
44207
- return t2;
44208
- };
44209
- return __assign$b.apply(this, arguments);
44210
- };
44211
- var __rest = globalThis && globalThis.__rest || function(s2, e2) {
44212
- var t2 = {};
44213
- for (var p2 in s2)
44214
- if (Object.prototype.hasOwnProperty.call(s2, p2) && e2.indexOf(p2) < 0)
44215
- t2[p2] = s2[p2];
44216
- if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
44217
- for (var i = 0, p2 = Object.getOwnPropertySymbols(s2); i < p2.length; i++) {
44218
- if (e2.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i]))
44219
- t2[p2[i]] = s2[p2[i]];
44220
- }
44221
- return t2;
44222
- };
44223
- function Tree2Element(tree2) {
44224
- return tree2 && tree2.map(function(node2, i) {
44225
- return React.createElement(node2.tag, __assign$b({
44226
- key: i
44227
- }, node2.attr), Tree2Element(node2.child));
44228
- });
44229
- }
44230
- function GenIcon(data) {
44231
- return function(props2) {
44232
- return React.createElement(IconBase, __assign$b({
44233
- attr: __assign$b({}, data.attr)
44234
- }, props2), Tree2Element(data.child));
44235
- };
44236
- }
44237
- function IconBase(props2) {
44238
- var elem = function(conf2) {
44239
- var attr = props2.attr, size2 = props2.size, title = props2.title, svgProps = __rest(props2, ["attr", "size", "title"]);
44240
- var computedSize = size2 || conf2.size || "1em";
44241
- var className;
44242
- if (conf2.className)
44243
- className = conf2.className;
44244
- if (props2.className)
44245
- className = (className ? className + " " : "") + props2.className;
44246
- return React.createElement("svg", __assign$b({
44247
- stroke: "currentColor",
44248
- fill: "currentColor",
44249
- strokeWidth: "0"
44250
- }, conf2.attr, attr, svgProps, {
44251
- className,
44252
- style: __assign$b(__assign$b({
44253
- color: props2.color || conf2.color
44254
- }, conf2.style), props2.style),
44255
- height: computedSize,
44256
- width: computedSize,
44257
- xmlns: "http://www.w3.org/2000/svg"
44258
- }), title && React.createElement("title", null, title), props2.children);
44259
- };
44260
- return IconContext !== void 0 ? React.createElement(IconContext.Consumer, null, function(conf2) {
44261
- return elem(conf2);
44262
- }) : elem(DefaultContext);
44263
- }
44264
- function MdOutlinePersonOutline(props2) {
44265
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M12 5.9a2.1 2.1 0 110 4.2 2.1 2.1 0 010-4.2m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z" } }] })(props2);
44266
- }
44267
- const DrawerComponent = ({
44268
- drawerOpen,
44269
- setDrawerOpen,
44270
- replayList,
44271
- option
44272
- }) => {
44273
- const [filterVal, setFilterVal] = react.exports.useState("");
44274
- react.exports.useEffect(() => {
44275
- }, [replayList]);
44276
- return /* @__PURE__ */ jsxs(Drawer$1, {
44277
- size: "lg",
44278
- placement: "right",
44279
- open: drawerOpen,
44280
- onClose: () => setDrawerOpen(false),
44281
- children: [/* @__PURE__ */ jsxs(Drawer$1.Header, {
44282
- children: [/* @__PURE__ */ jsx(Drawer$1.Title, {
44283
- children: !option ? "\u56DE\u653E\u5217\u8868" : option.title ? option.title : ""
44284
- }), /* @__PURE__ */ jsx(Drawer$1.Actions, {
44285
- children: /* @__PURE__ */ jsxs(InputGroup$1, {
44286
- children: [/* @__PURE__ */ jsx(InputGroup$1.Addon, {
44287
- children: /* @__PURE__ */ jsx(MdOutlinePersonOutline, {
44288
- size: "1.5em"
44289
- })
44290
- }), /* @__PURE__ */ jsx(Input$1, {
44291
- onChange: (evt) => {
44292
- setFilterVal(evt);
44293
- }
44294
- })]
44295
- })
44296
- })]
44297
- }), /* @__PURE__ */ jsx(Drawer$1.Body, {
44298
- children: replayList ? /* @__PURE__ */ jsx("div", {
44299
- children: /* @__PURE__ */ jsx("ul", {
44300
- role: "list",
44301
- className: "marker:text-sky-400 list-disc pl-5 space-y-3 text-gray-400",
44302
- children: filterVal ? replayList.filter((item) => userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid).username.indexOf(filterVal) >= 0).map((item, index2) => {
44303
- var _a2, _b2;
44304
- return /* @__PURE__ */ jsxs("li", {
44305
- className: "hover:ring-sky-500 cursor-pointer",
44306
- onClick: () => {
44307
- setDrawerOpen(false);
44308
- replay({
44309
- timestamp: item.timestamp
44310
- });
44311
- },
44312
- children: [CRDTKeyToVal[item.event], /* @__PURE__ */ jsx("span", {
44313
- className: "mx-4",
44314
- style: {
44315
- color: (_a2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _a2.color
44316
- },
44317
- children: (_b2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _b2.username
44318
- }), /* @__PURE__ */ jsxs("span", {
44319
- children: ["\u3010", dayjs(Number(item.timestamp)).format("YYYY-DD-MM hh:mm:ss"), "\u3011"]
44320
- })]
44321
- }, index2);
44322
- }) : replayList.map((item, index2) => {
44323
- var _a2, _b2;
44324
- return /* @__PURE__ */ jsxs("li", {
44325
- className: "hover:ring-sky-500 cursor-pointer",
44326
- onClick: () => {
44327
- setDrawerOpen(false);
44328
- replay({
44329
- userId: item.userInfo.uuid,
44330
- timestamp: item.timestamp
44331
- });
44332
- },
44333
- children: [CRDTKeyToVal[item.event], /* @__PURE__ */ jsx("span", {
44334
- className: "mx-4",
44335
- style: {
44336
- color: (_a2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _a2.color
44337
- },
44338
- children: (_b2 = userListStore.getState().userList.find((user) => user.uuid === item.userInfo.uuid)) == null ? void 0 : _b2.username
44339
- }), /* @__PURE__ */ jsxs("span", {
44340
- children: ["\u3010", dayjs(Number(item.timestamp)).format("YYYY-DD-MM hh:mm:ss"), "\u3011"]
44341
- })]
44342
- }, index2);
44343
- })
44344
- })
44345
- }) : /* @__PURE__ */ jsx(Placeholder$2.Paragraph, {
44346
- style: {
44347
- marginTop: 30
44348
- }
44349
- })
44350
- })]
44351
- });
44352
- };
44353
44381
  const CmdKey = () => {
44354
44382
  const ninjaKeys = react.exports.useRef(null);
44355
44383
  const actions = [
@@ -44602,6 +44630,7 @@ class DaoPaaS {
44602
44630
  __publicField(this, "playgroundId");
44603
44631
  __publicField(this, "serviceWorkerOrigin");
44604
44632
  __publicField(this, "onMessage");
44633
+ __publicField(this, "onError");
44605
44634
  this.mode = mode;
44606
44635
  this.ticket = ticket;
44607
44636
  this.playgroundId = playgroundId;
@@ -44612,6 +44641,7 @@ class DaoPaaS {
44612
44641
  this.paasDomain = paasDomain;
44613
44642
  this.components = components;
44614
44643
  this.onMessage = onMessage;
44644
+ this.onError = onError;
44615
44645
  this.serviceWorkerOrigin = serviceWorkerOrigin;
44616
44646
  sessionStorage.setItem("playgroundId", playgroundId);
44617
44647
  this.init();
@@ -44712,11 +44742,29 @@ class DaoPaaS {
44712
44742
  dockerState.subscribe((state2) => state2, (pre, next2) => {
44713
44743
  this.trigger(lodash$2.exports.pick(pre, ["dockerStatus"]), lodash$2.exports.pick(next2, ["dockerStatus"]));
44714
44744
  });
44745
+ oTStore.subscribe((state2) => state2, (pre, next2) => {
44746
+ this.trigger(lodash$2.exports.pick(pre, ["playgroundStatus"]), lodash$2.exports.pick(next2, ["playgroundStatus"]));
44747
+ });
44748
+ ErrorMsgState.subscribe((state2) => state2, (next2, pre) => {
44749
+ this.trigger("error", lodash$2.exports.pick(next2, "message"));
44750
+ });
44715
44751
  userListStore.subscribe((next2, pre) => {
44716
44752
  this.trigger(lodash$2.exports.pick(pre, ["userList"]), lodash$2.exports.pick(next2, ["userList"]));
44717
44753
  });
44754
+ shadowUserStore.subscribe((next2, pre) => {
44755
+ this.trigger({
44756
+ followingUser: pre.shadowUser
44757
+ }, {
44758
+ followingUser: pre.shadowUser
44759
+ });
44760
+ });
44718
44761
  }
44719
44762
  trigger(_d2, data) {
44763
+ if (_d2 === "error") {
44764
+ this.on(data, _d2);
44765
+ return;
44766
+ }
44767
+ console.log(data);
44720
44768
  this.on(data);
44721
44769
  }
44722
44770
  clearIDB(callback) {
@@ -44785,8 +44833,12 @@ class DaoPaaS {
44785
44833
  isRecording: !!setBoolean
44786
44834
  });
44787
44835
  }
44788
- on(data) {
44789
- this.onMessage && this.onMessage(data);
44836
+ on(data, type) {
44837
+ if (type === "error") {
44838
+ this.onError && this.onError(data);
44839
+ } else {
44840
+ this.onMessage && this.onMessage(data);
44841
+ }
44790
44842
  }
44791
44843
  mapRender(components) {
44792
44844
  components == null ? void 0 : components.forEach(({
@@ -44854,6 +44906,7 @@ class DaoPaaS {
44854
44906
  props: props2
44855
44907
  }) {
44856
44908
  this.editorDOM = container ? isHTMLElement$1(container) : this.editorDOM;
44909
+ console.log(props2, 374);
44857
44910
  reactDom.exports.render(/* @__PURE__ */ jsx(react.exports.Suspense, {
44858
44911
  fallback: /* @__PURE__ */ jsx(Loading, {}),
44859
44912
  children: /* @__PURE__ */ jsx(LazyEditorComponent$1, __spreadProps(__spreadValues({}, props2), {
@@ -48387,6 +48440,20 @@ AwaitingWithBuffer.prototype.resend = function(client2) {
48387
48440
  client2.sendOperation(client2.revision, this.outstanding);
48388
48441
  };
48389
48442
  const FROZEN_CONTROL_COMPONENTS = ["editor", "file", "terminal"];
48443
+ newStyled.div`
48444
+ position: absolute;
48445
+ right: 0;
48446
+ top: -1.5rem;
48447
+ padding: 0 2rem;
48448
+ background: ${(props2) => props2.shadowUser.color}5c;
48449
+ border: 1px solid ${(props2) => props2.shadowUser.color};
48450
+ border-radius: 5px 5px 0 0;
48451
+
48452
+ span {
48453
+ font-size: 12px;
48454
+ color: #fff;
48455
+ }
48456
+ `;
48390
48457
  const FollowLayoutWrapper = newStyled.div`
48391
48458
  width: 100%;
48392
48459
  height: 100%;
@@ -48414,7 +48481,7 @@ const FollowLayout = ({
48414
48481
  const isPass = asyncType === name && (shadowUser == null ? void 0 : shadowUser.uuid) && !IsMe(shadowUser);
48415
48482
  return /* @__PURE__ */ jsxs(FollowLayoutWrapper, {
48416
48483
  user: shadowUser,
48417
- className: `${className} follow-layout`,
48484
+ className: `follow-layout`,
48418
48485
  isPass,
48419
48486
  onClick: () => {
48420
48487
  if (!(shadowUser == null ? void 0 : shadowUser.uuid))
@@ -173945,9 +174012,125 @@ class EditorData {
173945
174012
  }
173946
174013
  }
173947
174014
  __publicField(EditorData, "EditorData");
174015
+ const FolderSVG = (props2) => /* @__PURE__ */ jsx("svg", {
174016
+ className: props2.className,
174017
+ xmlns: "http://www.w3.org/2000/svg",
174018
+ width: "12",
174019
+ height: "10",
174020
+ viewBox: "0 0 12 10",
174021
+ fill: "none",
174022
+ children: /* @__PURE__ */ jsx("path", {
174023
+ fillRule: "evenodd",
174024
+ clipRule: "evenodd",
174025
+ d: "M0.398438 0.800006C0.398438 0.41341 0.711841 0.100006 1.09844 0.100006H5.29844C5.68503 0.100006 5.99844 0.41341 5.99844 0.800006C5.99844 1.1866 6.31183 1.50001 6.69844 1.50001H10.8984C11.285 1.50001 11.5984 1.81341 11.5984 2.20001V9.20001C11.5984 9.58662 11.285 9.90001 10.8984 9.90001H1.09844C0.711841 9.90001 0.398438 9.58662 0.398438 9.20001V2.90001V2.20001V0.800006ZM10.0234 3.27501H6.17344V4.32501H10.0234V3.27501Z",
174026
+ fill: "#999999"
174027
+ })
174028
+ });
174029
+ const FileSVG = react.exports.forwardRef((_props, ref) => /* @__PURE__ */ jsx("svg", {
174030
+ className: `flex-shrink-0 ${(_props == null ? void 0 : _props.className) ? _props == null ? void 0 : _props.className : ""}`,
174031
+ ref,
174032
+ xmlns: "http://www.w3.org/2000/svg",
174033
+ width: "10",
174034
+ height: "11",
174035
+ viewBox: "0 0 10 11",
174036
+ fill: "none",
174037
+ children: /* @__PURE__ */ jsx("path", {
174038
+ fillRule: "evenodd",
174039
+ clipRule: "evenodd",
174040
+ d: "M0.801562 0.100006C0.414966 0.100006 0.101562 0.41341 0.101562 0.800006V9.90001C0.101562 10.2866 0.414966 10.6 0.801562 10.6H9.20156C9.58817 10.6 9.90156 10.2866 9.90156 9.90001V3.88995C9.90156 3.70431 9.82778 3.52625 9.69653 3.39498L8.15156 1.85001L6.60659 0.305029C6.47534 0.173758 6.29726 0.100006 6.11162 0.100006H0.801562ZM6.22656 3.77501V1.67501H5.17656V4.30001C5.17656 4.58995 5.41162 4.82501 5.70156 4.82501H8.32656V3.77501H6.22656Z",
174041
+ fill: "#666666"
174042
+ })
174043
+ }));
174044
+ FileSVG.displayName = "FileSVG";
173948
174045
  const TreeRootLayout = newStyled.div`
173949
174046
  height: 100%;
173950
174047
  overflow: auto;
174048
+
174049
+ .folder-svg {
174050
+ margin: 0 0.5rem 0 0.2rem;
174051
+ }
174052
+
174053
+ .file-svg {
174054
+ margin: 0 0.5rem 0 0.2rem;
174055
+ }
174056
+
174057
+ ul.rct-tree-items-container {
174058
+ position: relative;
174059
+ ul.rct-tree-items-container:after {
174060
+ content: '';
174061
+ position: absolute;
174062
+ top: 0;
174063
+ height: 100%;
174064
+ width: 1px;
174065
+ z-index: 8888;
174066
+ left: 8px;
174067
+ background: rgba(255, 255, 255, 0.1);
174068
+ }
174069
+ }
174070
+
174071
+ .rct-tree-root {
174072
+ background: ${(props2) => props2.bgColor};
174073
+ color: ${(props2) => props2.fontColor};
174074
+ overflow: auto;
174075
+ }
174076
+
174077
+ .rct-tree-root.root-drag-over {
174078
+ background-color: ${(props2) => props2.hoverBgColor};
174079
+ }
174080
+
174081
+ .rct-tree-item-li {
174082
+ .rct-tree-item-title-container {
174083
+ .rct-tree-item-arrow {
174084
+ flex-shrink: 0;
174085
+ }
174086
+ .rct-tree-item-avatar {
174087
+ width: 20px;
174088
+ height: 20px;
174089
+ margin-left: 10px;
174090
+ background-color: white;
174091
+ right: 5px;
174092
+ }
174093
+ .rct-tree-item-toolbar {
174094
+ display: none;
174095
+ }
174096
+ &:hover {
174097
+ .rct-tree-item-toolbar {
174098
+ display: flex;
174099
+ gap: 8px;
174100
+ }
174101
+ }
174102
+ }
174103
+ }
174104
+
174105
+ .rct-tree-root-focus {
174106
+ outline: none;
174107
+ .rct-tree-item-li-selected {
174108
+ .rct-tree-item-title-container-selected {
174109
+ color: ${(props2) => props2.hoverTextColor};
174110
+ background-color: ${(props2) => props2.hoverBgColor};
174111
+ border-radius: 4px;
174112
+ }
174113
+ }
174114
+ }
174115
+
174116
+ .rct-tree-root-focus {
174117
+ .rct-tree-item-title-container-focused {
174118
+ border-color: transparent;
174119
+ }
174120
+ }
174121
+
174122
+ :not(.rct-tree-root-focus) {
174123
+ .rct-tree-item-title-container-focused {
174124
+ border-color: transparent;
174125
+ }
174126
+ .rct-tree-item-li-selected {
174127
+ .rct-tree-item-title-container-selected {
174128
+ color: ${(props2) => props2.hoverTextColor};
174129
+ background-color: ${(props2) => props2.hoverBgColor};
174130
+ border-radius: 4px;
174131
+ }
174132
+ }
174133
+ }
173951
174134
  `;
173952
174135
  function addChildrenArray(children, parent2) {
173953
174136
  var _a2, _b2;
@@ -174016,7 +174199,13 @@ const getStringFromFile = async (file) => {
174016
174199
  };
174017
174200
  const FileTree = ({
174018
174201
  onCustomSelect,
174019
- className
174202
+ dropBgColor = "pink",
174203
+ dropTextColor = "black",
174204
+ hoverBgColor = "rgb(37 45 124 / 80%)",
174205
+ hoverTextColor = "#fff",
174206
+ bgColor = "#15171c",
174207
+ fontColor = "#fff",
174208
+ onClick
174020
174209
  }) => {
174021
174210
  const addedFolder = {
174022
174211
  target: "",
@@ -174074,6 +174263,10 @@ const FileTree = ({
174074
174263
  path: items[0]
174075
174264
  }
174076
174265
  };
174266
+ onClick && onClick({
174267
+ uri: `${fileTree.data.uri}${items[0]}`,
174268
+ path: items[0]
174269
+ });
174077
174270
  (_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("fileContent", JSON.stringify(crdt));
174078
174271
  }
174079
174272
  }
@@ -174356,8 +174549,14 @@ const FileTree = ({
174356
174549
  return /* @__PURE__ */ jsx(FollowLayout, {
174357
174550
  name: "file",
174358
174551
  children: /* @__PURE__ */ jsxs(TreeRootLayout, {
174359
- className: `tree-root-layout ${className ? className : ""}`,
174360
174552
  ref: treeRef,
174553
+ className: `tree-root-layout`,
174554
+ dropBgColor,
174555
+ dropTextColor,
174556
+ hoverBgColor,
174557
+ hoverTextColor,
174558
+ bgColor,
174559
+ fontColor,
174361
174560
  children: [/* @__PURE__ */ jsx("input", {
174362
174561
  id: "manual-upload-file",
174363
174562
  type: "file",
@@ -174404,13 +174603,11 @@ const FileTree = ({
174404
174603
  context,
174405
174604
  children
174406
174605
  }) => {
174606
+ var _a2;
174407
174607
  return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, context.itemContainerWithChildrenProps), {
174408
174608
  className: ["rct-tree-item-li", context.isSelected ? "rct-tree-item-li-selected" : "", context.isExpanded ? "rct-tree-item-li-expanded" : "", context.isFocused ? "rct-tree-item-li-focused" : "", children ? "rct-tree-item-li-hasChildren" : ""].join(" "),
174409
174609
  children: [/* @__PURE__ */ jsxs("div", {
174410
174610
  className: ["rct-tree-item-title-container", context.isSelected ? "rct-tree-item-title-container-selected" : "", context.isExpanded ? "rct-tree-item-title-container-expanded" : "", context.isFocused ? "rct-tree-item-title-container-focused" : "", children ? "rct-tree-item-title-container-hasChildren" : ""].join(" "),
174411
- style: {
174412
- paddingLeft: `${depth}0px`
174413
- },
174414
174611
  children: [remoteUserList[context.interactiveElementProps["data-rct-item-id"]] && remoteUserList[context.interactiveElementProps["data-rct-item-id"]].map((remoteUser) => /* @__PURE__ */ jsx("div", {
174415
174612
  className: "rct-tree-item-avatar rounded-full absolute border",
174416
174613
  style: {
@@ -174483,8 +174680,8 @@ const FileTree = ({
174483
174680
  children: /* @__PURE__ */ jsx("button", {
174484
174681
  className: "w-full justify-center my-2",
174485
174682
  onClick: () => {
174486
- var _a2;
174487
- setRenameValue((_a2 = title == null ? void 0 : title.props) == null ? void 0 : _a2.children);
174683
+ var _a3;
174684
+ setRenameValue((_a3 = title == null ? void 0 : title.props) == null ? void 0 : _a3.children);
174488
174685
  setRenameItem(context.interactiveElementProps["data-rct-item-id"]);
174489
174686
  },
174490
174687
  children: "\u91CD\u547D\u540D"
@@ -174521,9 +174718,13 @@ const FileTree = ({
174521
174718
  break;
174522
174719
  }
174523
174720
  }
174524
- }) : /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues(__spreadValues({}, context.itemContainerWithoutChildrenProps), context.interactiveElementProps), {
174721
+ }) : /* @__PURE__ */ jsxs("button", __spreadProps(__spreadValues(__spreadValues({}, context.itemContainerWithoutChildrenProps), context.interactiveElementProps), {
174525
174722
  className: ["rct-tree-item-button", context.isSelected ? "rct-tree-item-button-selected" : "", context.isExpanded ? "rct-tree-item-button-expanded" : "", context.isFocused ? "rct-tree-item-button-focused" : "", children ? "rct-tree-item-button-hasChildren" : ""].join(" "),
174526
- children: title
174723
+ children: [((_a2 = arrow == null ? void 0 : arrow.props) == null ? void 0 : _a2.className.includes("rct-tree-item-arrow-hasChildren")) ? /* @__PURE__ */ jsx(FolderSVG, {
174724
+ className: "folder-svg"
174725
+ }) : /* @__PURE__ */ jsx(FileSVG, {
174726
+ className: "file-svg"
174727
+ }), title]
174527
174728
  }))]
174528
174729
  }), children]
174529
174730
  }));
@@ -174732,41 +174933,14 @@ const EditorLayout = newStyled.div`
174732
174933
  color: #666;
174733
174934
  }
174734
174935
 
174735
- .stack-list {
174736
- width: 100%;
174737
- height: 35px;
174738
- transform: translate(0, -1px);
174739
- overflow-x: auto;
174740
- flex-wrap: nowrap;
174741
- li {
174742
- /* width: 100px; */
174743
- height: 100%;
174744
- padding: 5px 25px;
174745
- color: #fff;
174746
- font-size: 12px;
174747
- flex: 0 0 auto;
174748
- &:hover {
174749
- background: #005391;
174750
- }
174751
- }
174752
-
174753
- .active {
174754
- background: #004172;
174936
+ .margin-view-overlays {
174937
+ background-color: ${(props2) => props2.theme.marginViewOverlays};
174755
174938
 
174756
- box-shadow: 0px 1px 0px 0 #333;
174757
- border-right: 1px solid rgb(42 96 231);
174758
- /* border-left: 1px solid rgb(42 96 231); */
174759
- /* background: red; */
174760
- }
174939
+ .line-numbers {
174940
+ color: ${(props2) => props2.theme.lineNumbers};
174761
174941
 
174762
- .tree-closer {
174763
- right: 4px;
174764
- font-size: 14px;
174765
- opacity: 0;
174766
- line-height: 0;
174767
- transition: opacity 0.2s ease-in-out;
174768
- &.hover {
174769
- opacity: 1;
174942
+ &.active-line-number {
174943
+ color: ${(props2) => props2.theme.activeLineNumber};
174770
174944
  }
174771
174945
  }
174772
174946
  }
@@ -220182,6 +220356,214 @@ const Markdown = ({
220182
220356
  })
220183
220357
  }), document.body);
220184
220358
  };
220359
+ const Dracula = {
220360
+ base: "vs-dark",
220361
+ inherit: true,
220362
+ rules: [
220363
+ {
220364
+ background: "282a36",
220365
+ token: ""
220366
+ },
220367
+ {
220368
+ foreground: "6272a4",
220369
+ token: "comment"
220370
+ },
220371
+ {
220372
+ foreground: "f1fa8c",
220373
+ token: "string"
220374
+ },
220375
+ {
220376
+ foreground: "bd93f9",
220377
+ token: "constant.numeric"
220378
+ },
220379
+ {
220380
+ foreground: "bd93f9",
220381
+ token: "constant.language"
220382
+ },
220383
+ {
220384
+ foreground: "bd93f9",
220385
+ token: "constant.character"
220386
+ },
220387
+ {
220388
+ foreground: "bd93f9",
220389
+ token: "constant.other"
220390
+ },
220391
+ {
220392
+ foreground: "ffb86c",
220393
+ token: "variable.other.readwrite.instance"
220394
+ },
220395
+ {
220396
+ foreground: "ff79c6",
220397
+ token: "constant.character.escaped"
220398
+ },
220399
+ {
220400
+ foreground: "ff79c6",
220401
+ token: "constant.character.escape"
220402
+ },
220403
+ {
220404
+ foreground: "ff79c6",
220405
+ token: "string source"
220406
+ },
220407
+ {
220408
+ foreground: "ff79c6",
220409
+ token: "string source.ruby"
220410
+ },
220411
+ {
220412
+ foreground: "ff79c6",
220413
+ token: "keyword"
220414
+ },
220415
+ {
220416
+ foreground: "ff79c6",
220417
+ token: "storage"
220418
+ },
220419
+ {
220420
+ foreground: "8be9fd",
220421
+ fontStyle: "italic",
220422
+ token: "storage.type"
220423
+ },
220424
+ {
220425
+ foreground: "50fa7b",
220426
+ fontStyle: "underline",
220427
+ token: "entity.name.class"
220428
+ },
220429
+ {
220430
+ foreground: "50fa7b",
220431
+ fontStyle: "italic underline",
220432
+ token: "entity.other.inherited-class"
220433
+ },
220434
+ {
220435
+ foreground: "50fa7b",
220436
+ token: "entity.name.function"
220437
+ },
220438
+ {
220439
+ foreground: "ffb86c",
220440
+ fontStyle: "italic",
220441
+ token: "variable.parameter"
220442
+ },
220443
+ {
220444
+ foreground: "ff79c6",
220445
+ token: "entity.name.tag"
220446
+ },
220447
+ {
220448
+ foreground: "50fa7b",
220449
+ token: "entity.other.attribute-name"
220450
+ },
220451
+ {
220452
+ foreground: "8be9fd",
220453
+ token: "support.function"
220454
+ },
220455
+ {
220456
+ foreground: "6be5fd",
220457
+ token: "support.constant"
220458
+ },
220459
+ {
220460
+ foreground: "66d9ef",
220461
+ fontStyle: " italic",
220462
+ token: "support.type"
220463
+ },
220464
+ {
220465
+ foreground: "66d9ef",
220466
+ fontStyle: " italic",
220467
+ token: "support.class"
220468
+ },
220469
+ {
220470
+ foreground: "f8f8f0",
220471
+ background: "ff79c6",
220472
+ token: "invalid"
220473
+ },
220474
+ {
220475
+ foreground: "f8f8f0",
220476
+ background: "bd93f9",
220477
+ token: "invalid.deprecated"
220478
+ },
220479
+ {
220480
+ foreground: "cfcfc2",
220481
+ token: "meta.structure.dictionary.json string.quoted.double.json"
220482
+ },
220483
+ {
220484
+ foreground: "6272a4",
220485
+ token: "meta.diff"
220486
+ },
220487
+ {
220488
+ foreground: "6272a4",
220489
+ token: "meta.diff.header"
220490
+ },
220491
+ {
220492
+ foreground: "ff79c6",
220493
+ token: "markup.deleted"
220494
+ },
220495
+ {
220496
+ foreground: "50fa7b",
220497
+ token: "markup.inserted"
220498
+ },
220499
+ {
220500
+ foreground: "e6db74",
220501
+ token: "markup.changed"
220502
+ },
220503
+ {
220504
+ foreground: "bd93f9",
220505
+ token: "constant.numeric.line-number.find-in-files - match"
220506
+ },
220507
+ {
220508
+ foreground: "e6db74",
220509
+ token: "entity.name.filename"
220510
+ },
220511
+ {
220512
+ foreground: "f83333",
220513
+ token: "message.error"
220514
+ },
220515
+ {
220516
+ foreground: "eeeeee",
220517
+ token: "punctuation.definition.string.begin.json - meta.structure.dictionary.value.json"
220518
+ },
220519
+ {
220520
+ foreground: "eeeeee",
220521
+ token: "punctuation.definition.string.end.json - meta.structure.dictionary.value.json"
220522
+ },
220523
+ {
220524
+ foreground: "8be9fd",
220525
+ token: "meta.structure.dictionary.json string.quoted.double.json"
220526
+ },
220527
+ {
220528
+ foreground: "f1fa8c",
220529
+ token: "meta.structure.dictionary.value.json string.quoted.double.json"
220530
+ },
220531
+ {
220532
+ foreground: "50fa7b",
220533
+ token: "meta meta meta meta meta meta meta.structure.dictionary.value string"
220534
+ },
220535
+ {
220536
+ foreground: "ffb86c",
220537
+ token: "meta meta meta meta meta meta.structure.dictionary.value string"
220538
+ },
220539
+ {
220540
+ foreground: "ff79c6",
220541
+ token: "meta meta meta meta meta.structure.dictionary.value string"
220542
+ },
220543
+ {
220544
+ foreground: "bd93f9",
220545
+ token: "meta meta meta meta.structure.dictionary.value string"
220546
+ },
220547
+ {
220548
+ foreground: "50fa7b",
220549
+ token: "meta meta meta.structure.dictionary.value string"
220550
+ },
220551
+ {
220552
+ foreground: "ffb86c",
220553
+ token: "meta meta.structure.dictionary.value string"
220554
+ }
220555
+ ],
220556
+ colors: {
220557
+ "editor.foreground": "#f8f8f2",
220558
+ "editor.background": "#282a36",
220559
+ "editor.selectionBackground": "#44475a",
220560
+ "editor.lineHighlightBackground": "#44475a",
220561
+ "editorCursor.foreground": "#f8f8f0",
220562
+ "editorWhitespace.foreground": "#3B3A32",
220563
+ "editorIndentGuide.activeBackground": "#9D550FB0",
220564
+ "editor.selectionHighlightBorder": "#222218"
220565
+ }
220566
+ };
220185
220567
  const APP_DIR = "/home/runner/app";
220186
220568
  let editor;
220187
220569
  const docServer = new Map();
@@ -220200,7 +220582,7 @@ const Editor = ({
220200
220582
  editorStyle,
220201
220583
  serviceWorkerOrigin,
220202
220584
  useLsp,
220203
- className
220585
+ theme
220204
220586
  }) => {
220205
220587
  const divEl = react.exports.useRef(null);
220206
220588
  const [clientEditor, setClientEditor] = react.exports.useState(null);
@@ -220471,24 +220853,8 @@ const Editor = ({
220471
220853
  io == null ? void 0 : io.emit("fileTreeOp", JSON.stringify(payload));
220472
220854
  }
220473
220855
  });
220474
- editor$1.defineTheme("myCoolTheme", {
220475
- base: "vs-dark",
220476
- inherit: false,
220477
- rules: [{
220478
- token: "green",
220479
- background: "FF0000",
220480
- foreground: "00FF00",
220481
- fontStyle: "italic"
220482
- }, {
220483
- token: "red",
220484
- foreground: "FF0000",
220485
- fontStyle: "bold underline"
220486
- }],
220487
- colors: {
220488
- "editor.foreground": "#FFFFFF",
220489
- "editor.background": "#000000"
220490
- }
220491
- });
220856
+ editor$1.defineTheme("myCoolTheme", Dracula);
220857
+ editor$1.setTheme("myCoolTheme");
220492
220858
  setClientEditor(new MonacoAdapter(editor, serviceWorkerOrigin));
220493
220859
  setOtherClients(new ClientMeta(editor, userList.filter((x2) => !IsMe(x2))));
220494
220860
  serviceBinder();
@@ -220655,7 +221021,8 @@ const Editor = ({
220655
221021
  }
220656
221022
  }), /* @__PURE__ */ jsxs(EditorLayout, {
220657
221023
  style: containerStyle,
220658
- className: `editor-layout ${className ? className : ""} flex flex-col`,
221024
+ theme,
221025
+ className: `editor-layout flex flex-col`,
220659
221026
  children: [/* @__PURE__ */ jsx(FileTreeStack, {
220660
221027
  editor,
220661
221028
  menuStyle,
@@ -220670,11 +221037,56 @@ const Editor = ({
220670
221037
  })]
220671
221038
  });
220672
221039
  };
221040
+ const FileTreeStackLayout = newStyled.ul`
221041
+ .active {
221042
+ background-color: ${(props2) => props2.menuStyle.backgroundColor};
221043
+ box-shadow: 0px 1px 0px 0 #333;
221044
+ border-right: 1px solid ${(props2) => props2.menuStyle.backgroundColor};
221045
+ }
221046
+
221047
+ width: 100%;
221048
+ height: 35px;
221049
+ transform: translate(0, -1px);
221050
+ overflow-x: auto;
221051
+ flex-wrap: nowrap;
221052
+ li {
221053
+ /* width: 100px; */
221054
+ height: 100%;
221055
+ padding: 5px 25px;
221056
+ color: ${(props2) => props2.menuStyle.textColor};
221057
+ font-size: 12px;
221058
+ flex: 0 0 auto;
221059
+ &:hover {
221060
+ background: ${(props2) => props2.menuStyle.hoverBgColor};
221061
+ color: ${(props2) => props2.menuStyle.hoverTextColor};
221062
+ }
221063
+ }
221064
+
221065
+ .tree-closer {
221066
+ right: 4px;
221067
+ font-size: 14px;
221068
+ opacity: 0;
221069
+ line-height: 0;
221070
+ transition: opacity 0.2s ease-in-out;
221071
+ color: ${(props2) => props2.menuStyle.iconColor};
221072
+ &.hover {
221073
+ opacity: 1;
221074
+ color: ${(props2) => props2.menuStyle.hoverIconColor};
221075
+ }
221076
+ }
221077
+ `;
220673
221078
  const FileTreeStack = ({
220674
221079
  editor: editor2,
220675
- menuStyle,
220676
221080
  switchModel,
220677
- clearPlayground
221081
+ clearPlayground,
221082
+ menuStyle = {
221083
+ backgroundColor: "#005391",
221084
+ textColor: "#fff",
221085
+ hoverBgColor: "rgb(37 45 124 / 80%)",
221086
+ hoverTextColor: "#fff",
221087
+ iconColor: "#fff",
221088
+ hoverIconColor: "#fff"
221089
+ }
220678
221090
  }) => {
220679
221091
  const switchDoc2 = oTStore((state2) => state2.switchDoc);
220680
221092
  oTStore((state2) => state2.dockerInfo);
@@ -220698,11 +221110,11 @@ const FileTreeStack = ({
220698
221110
  switchModel(_fileTreeStackList.slice(-1)[0].model);
220699
221111
  }
220700
221112
  };
220701
- return fileTreeStack && fileTreeStack.length > 0 ? /* @__PURE__ */ jsx("ul", {
220702
- style: menuStyle,
221113
+ return fileTreeStack && fileTreeStack.length > 0 ? /* @__PURE__ */ jsx(FileTreeStackLayout, {
221114
+ menuStyle,
220703
221115
  id: "menu-list",
220704
221116
  ref,
220705
- className: "\r flex\r flex-row\r stack-list\r items-center\r flex-shrink-0\r scroll-smooth\r no-scrollbar\r overflow-x-scroll\r bg-codezone-black\r overflow-auto touch-pan-x",
221117
+ className: "flex flex-row stack-list items-center flex-shrink-0 scroll-smooth no-scrollbar overflow-x-scroll bg-codezone-black overflow-auto touch-pan-x",
220706
221118
  children: fileTreeStack == null ? void 0 : fileTreeStack.map((f2, index2) => /* @__PURE__ */ jsxs("li", {
220707
221119
  className: `
220708
221120
  flex
@@ -227987,12 +228399,25 @@ var index$3 = /* @__PURE__ */ Object.freeze({
227987
228399
  "default": Console
227988
228400
  });
227989
228401
  const PROTOCOL = "https://";
228402
+ const BrowserLayout = newStyled.div``;
227990
228403
  const NavBar = newStyled.div`
227991
228404
  background-color: white;
227992
228405
  height: 30px;
227993
228406
  display: flex;
227994
228407
  align-items: center;
227995
228408
 
228409
+ .reload {
228410
+ color: ${(props2) => props2.freshIconColor};
228411
+ }
228412
+
228413
+ .file-copy {
228414
+ color: ${(props2) => props2.openIconColor};
228415
+ }
228416
+
228417
+ input {
228418
+ color: ${(props2) => props2.inputColor};
228419
+ }
228420
+
227996
228421
  i {
227997
228422
  margin: 0 10px;
227998
228423
  width: 24px;
@@ -228038,9 +228463,15 @@ const StopMask = newStyled.div`
228038
228463
  `;
228039
228464
  const OutputBrowser = (_g2) => {
228040
228465
  var _h2 = _g2, {
228041
- showURL = false
228466
+ showURL = false,
228467
+ freshIconColor = "#00bcd4",
228468
+ inputColor = "#adacac",
228469
+ openIconColor = "#adacac"
228042
228470
  } = _h2, props2 = __objRest(_h2, [
228043
- "showURL"
228471
+ "showURL",
228472
+ "freshIconColor",
228473
+ "inputColor",
228474
+ "openIconColor"
228044
228475
  ]);
228045
228476
  var _a2;
228046
228477
  const pStatus = oTStore((state2) => state2.playgroundStatus);
@@ -228094,33 +228525,39 @@ const OutputBrowser = (_g2) => {
228094
228525
  }
228095
228526
  }
228096
228527
  }, [playgroundStatus, dockerStatus]);
228097
- return /* @__PURE__ */ jsxs(FollowLayout, {
228528
+ return /* @__PURE__ */ jsx(FollowLayout, {
228098
228529
  name: "browser",
228099
- children: [showURL ? /* @__PURE__ */ jsxs(NavBar, {
228100
- children: [/* @__PURE__ */ jsx("i", {
228101
- className: "d42 text-xl reload cursor-pointer",
228102
- onClick: onRefresh
228103
- }), /* @__PURE__ */ jsx("input", {
228104
- type: "text",
228105
- value: iframeSrc,
228106
- onChange: (e2) => setIframeSrc(e2.target.value),
228107
- onKeyDown: onEnterKey
228108
- }), /* @__PURE__ */ jsx("i", {
228109
- className: "d42 text-xl file-copy cursor-pointer",
228110
- onClick: onOpenInNewTab
228530
+ children: /* @__PURE__ */ jsxs(BrowserLayout, {
228531
+ className: "w-full h-full",
228532
+ children: [showURL ? /* @__PURE__ */ jsxs(NavBar, {
228533
+ freshIconColor,
228534
+ inputColor,
228535
+ openIconColor,
228536
+ children: [/* @__PURE__ */ jsx("i", {
228537
+ className: "d42 text-xl reload cursor-pointer",
228538
+ onClick: onRefresh
228539
+ }), /* @__PURE__ */ jsx("input", {
228540
+ type: "text",
228541
+ value: iframeSrc,
228542
+ onChange: (e2) => setIframeSrc(e2.target.value),
228543
+ onKeyDown: onEnterKey
228544
+ }), /* @__PURE__ */ jsx("i", {
228545
+ className: "d42 text-xl file-copy cursor-pointer",
228546
+ onClick: onOpenInNewTab
228547
+ })]
228548
+ }) : null, dockerStatus === "STOP" && /* @__PURE__ */ jsx(StopMask, {
228549
+ children: /* @__PURE__ */ jsx("span", {
228550
+ children: "\u70B9\u51FB\u201C\u8FD0\u884C\u201D\uFF0C\u542F\u52A8\u5E94\u7528"
228551
+ })
228552
+ }), /* @__PURE__ */ jsx("iframe", {
228553
+ ref: iframeRef,
228554
+ src: iframeSrc,
228555
+ style: {
228556
+ width: "100%",
228557
+ height: "calc(100% - 30px)"
228558
+ }
228111
228559
  })]
228112
- }) : null, dockerStatus === "STOP" && /* @__PURE__ */ jsx(StopMask, {
228113
- children: /* @__PURE__ */ jsx("span", {
228114
- children: "\u70B9\u51FB\u201C\u8FD0\u884C\u201D\uFF0C\u542F\u52A8\u5E94\u7528"
228115
- })
228116
- }), /* @__PURE__ */ jsx("iframe", {
228117
- ref: iframeRef,
228118
- src: iframeSrc,
228119
- style: {
228120
- width: "100%",
228121
- height: "calc(100% - 30px)"
228122
- }
228123
- })]
228560
+ })
228124
228561
  });
228125
228562
  };
228126
228563
  var index$2 = /* @__PURE__ */ Object.freeze({
@@ -228885,9 +229322,9 @@ const HeaderLayout = newStyled.header`
228885
229322
  `;
228886
229323
  const ContainerLayout = newStyled.div`
228887
229324
  height: calc(100% - 4.625rem);
228888
- section {
229325
+ /* section {
228889
229326
  height: calc(100% - 0.625rem);
228890
- }
229327
+ } */
228891
229328
  `;
228892
229329
  const RunnerLayout = newStyled.section`
228893
229330
  background: #202327;
@@ -228939,12 +229376,44 @@ const Index = (props2) => {
228939
229376
  react.exports.useEffect(() => {
228940
229377
  setUrl(playgroundInfo.url);
228941
229378
  }, [playgroundInfo]);
229379
+ dockerState.subscribe((state2) => state2, (pre, next2) => {
229380
+ });
229381
+ oTStore.subscribe((state2) => state2, (pre, next2) => {
229382
+ });
229383
+ ErrorMsgState.subscribe((state2) => state2, (next2, pre) => {
229384
+ Toast.message({
229385
+ type: "error",
229386
+ content: next2.message.content,
229387
+ placement: "topCenter"
229388
+ });
229389
+ });
229390
+ userListStore.subscribe((next2, pre) => {
229391
+ });
229392
+ shadowUserStore.subscribe((next2, pre) => {
229393
+ if (next2.shadowUser.userId) {
229394
+ Toast.message({
229395
+ type: "success",
229396
+ content: `\u6B63\u5728\u8DDF\u968F${next2.shadowUser.username}`,
229397
+ placement: "topCenter"
229398
+ });
229399
+ } else {
229400
+ Toast.message({
229401
+ type: "success",
229402
+ content: `\u5DF2\u9000\u51FA\u8DDF\u968F\u6A21\u5F0F`,
229403
+ placement: "topCenter"
229404
+ });
229405
+ }
229406
+ });
228942
229407
  react.exports.useEffect(() => {
228943
229408
  props2.playgroundId && (socket2 == null ? void 0 : socket2.emit("playgroundInfo", JSON.stringify({
228944
229409
  messageId: "1",
228945
229410
  playgroundId: props2.playgroundId
228946
229411
  })));
228947
229412
  }, [props2.playgroundId]);
229413
+ react.exports.useEffect(() => {
229414
+ var _a2;
229415
+ (_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("active");
229416
+ }, []);
228948
229417
  return /* @__PURE__ */ jsx(Fragment, {
228949
229418
  children: /* @__PURE__ */ jsxs(MainLayout, {
228950
229419
  className: "flex flex-col",
@@ -228960,7 +229429,6 @@ const Index = (props2) => {
228960
229429
  count: 10
228961
229430
  }),
228962
229431
  children: /* @__PURE__ */ jsx(LazyEditorComponent, {
228963
- className: "editor-custom-style",
228964
229432
  serviceWorkerOrigin: props2.serviceWorkerOrigin,
228965
229433
  useLsp: true
228966
229434
  })
@@ -228970,7 +229438,8 @@ const Index = (props2) => {
228970
229438
  children: [/* @__PURE__ */ jsx(PreviewWrapper, {
228971
229439
  className: "mb-2.5 relative",
228972
229440
  children: /* @__PURE__ */ jsx(OutputBrowser, {
228973
- url: url2
229441
+ url: url2,
229442
+ showURL: true
228974
229443
  })
228975
229444
  }), /* @__PURE__ */ jsx(Tabs, {
228976
229445
  className: "mb-1",
@@ -229060,7 +229529,7 @@ const HeaderComponent = () => {
229060
229529
  children: userListStore.getState().userList.map((item, index2) => {
229061
229530
  return /* @__PURE__ */ jsx("div", {
229062
229531
  onClick: () => {
229063
- shadowUserStore.getState().switchShadowUser(item);
229532
+ shadowUserStore.getState().switchShadowUser(item.userId);
229064
229533
  console.log(shadowUserStore.getState().shadowUser);
229065
229534
  },
229066
229535
  className: "-ml-2.5 z-0 avatar-hover",