@dao42/d42paas-front 0.5.23 → 0.5.25
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 +325 -343
- package/dist/DaoPaaS.umd.js +409 -406
- package/dist/editor.d.ts +14 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/assets/css.worker.fcb4bd78.js +0 -62
- package/dist/assets/editor.worker.d0372abe.js +0 -4
- package/dist/assets/html.worker.446a9d97.js +0 -452
- package/dist/assets/json.worker.4dd01dd8.js +0 -35
- package/dist/assets/ts.worker.bb4527d0.js +0 -35320
package/dist/DaoPaaS.es.js
CHANGED
|
@@ -29401,7 +29401,7 @@ const Loading = () => {
|
|
|
29401
29401
|
})
|
|
29402
29402
|
});
|
|
29403
29403
|
};
|
|
29404
|
-
let index$
|
|
29404
|
+
let index$7 = 0;
|
|
29405
29405
|
const REPLAY_INTERVAL = 250;
|
|
29406
29406
|
let timer;
|
|
29407
29407
|
let timeOutT;
|
|
@@ -29418,7 +29418,7 @@ const replayHandler = async () => {
|
|
|
29418
29418
|
data: dockerInfo.fileTree
|
|
29419
29419
|
});
|
|
29420
29420
|
const crdts = await getLocalCRDTs();
|
|
29421
|
-
const filterData = crdts[index$
|
|
29421
|
+
const filterData = crdts[index$7];
|
|
29422
29422
|
const cdata = __spreadValues({}, filterData);
|
|
29423
29423
|
timeOutT = setTimeout(async () => {
|
|
29424
29424
|
if (!cdata.timestamp) {
|
|
@@ -29440,7 +29440,7 @@ const replayHandler = async () => {
|
|
|
29440
29440
|
}
|
|
29441
29441
|
setCRDTInfo(__spreadValues({}, cdata));
|
|
29442
29442
|
}, 0);
|
|
29443
|
-
index$
|
|
29443
|
+
index$7++;
|
|
29444
29444
|
return {};
|
|
29445
29445
|
};
|
|
29446
29446
|
const replay = async (status2) => {
|
|
@@ -29460,7 +29460,7 @@ const replay = async (status2) => {
|
|
|
29460
29460
|
content: "\u64AD\u653E\u5B8C\u6BD5",
|
|
29461
29461
|
placement: "topCenter"
|
|
29462
29462
|
});
|
|
29463
|
-
index$
|
|
29463
|
+
index$7 = 0;
|
|
29464
29464
|
break;
|
|
29465
29465
|
case "disabled":
|
|
29466
29466
|
clearInterval(timer);
|
|
@@ -29469,7 +29469,7 @@ const replay = async (status2) => {
|
|
|
29469
29469
|
path: ""
|
|
29470
29470
|
});
|
|
29471
29471
|
setAppStatus("code");
|
|
29472
|
-
index$
|
|
29472
|
+
index$7 = 0;
|
|
29473
29473
|
break;
|
|
29474
29474
|
case "pause":
|
|
29475
29475
|
clearInterval(timer);
|
|
@@ -29492,13 +29492,19 @@ const replay = async (status2) => {
|
|
|
29492
29492
|
break;
|
|
29493
29493
|
}
|
|
29494
29494
|
};
|
|
29495
|
-
var index$
|
|
29495
|
+
var index$6 = "";
|
|
29496
29496
|
const LazyTreeComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
29497
|
-
return index$
|
|
29497
|
+
return index$5;
|
|
29498
29498
|
})).FileTree);
|
|
29499
29499
|
const LazyEditorComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
29500
|
-
return index$
|
|
29500
|
+
return index$4;
|
|
29501
29501
|
})).Editor);
|
|
29502
|
+
const LazyConsoleComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
29503
|
+
return index$3;
|
|
29504
|
+
})).default);
|
|
29505
|
+
const LazyBrowserComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
29506
|
+
return index$2;
|
|
29507
|
+
})).default);
|
|
29502
29508
|
const LazyShellComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
29503
29509
|
return index$1;
|
|
29504
29510
|
})).default);
|
|
@@ -29674,6 +29680,26 @@ class DaoPaaS {
|
|
|
29674
29680
|
children: /* @__PURE__ */ jsx(LazyTreeComponent, __spreadValues({}, props))
|
|
29675
29681
|
}), this.editorDOM);
|
|
29676
29682
|
}
|
|
29683
|
+
Console({
|
|
29684
|
+
container,
|
|
29685
|
+
props
|
|
29686
|
+
}) {
|
|
29687
|
+
this.editorDOM = container ? isHTMLElement$1(container) : this.editorDOM;
|
|
29688
|
+
reactDom.exports.render(/* @__PURE__ */ jsx(react.exports.Suspense, {
|
|
29689
|
+
fallback: /* @__PURE__ */ jsx(Loading, {}),
|
|
29690
|
+
children: /* @__PURE__ */ jsx(LazyConsoleComponent, __spreadValues({}, props))
|
|
29691
|
+
}), this.editorDOM);
|
|
29692
|
+
}
|
|
29693
|
+
Browser({
|
|
29694
|
+
container,
|
|
29695
|
+
props
|
|
29696
|
+
}) {
|
|
29697
|
+
this.editorDOM = container ? isHTMLElement$1(container) : this.editorDOM;
|
|
29698
|
+
reactDom.exports.render(/* @__PURE__ */ jsx(react.exports.Suspense, {
|
|
29699
|
+
fallback: /* @__PURE__ */ jsx(Loading, {}),
|
|
29700
|
+
children: /* @__PURE__ */ jsx(LazyBrowserComponent, __spreadValues({}, props))
|
|
29701
|
+
}), this.editorDOM);
|
|
29702
|
+
}
|
|
29677
29703
|
}
|
|
29678
29704
|
function isHTMLElement$1(arg) {
|
|
29679
29705
|
if (!/HTMLDivElement|HTMLElement/.test(Object.prototype.toString.call(arg))) {
|
|
@@ -32064,7 +32090,7 @@ const FileTree = ({
|
|
|
32064
32090
|
})
|
|
32065
32091
|
});
|
|
32066
32092
|
};
|
|
32067
|
-
var index$
|
|
32093
|
+
var index$5 = /* @__PURE__ */ Object.freeze({
|
|
32068
32094
|
__proto__: null,
|
|
32069
32095
|
[Symbol.toStringTag]: "Module",
|
|
32070
32096
|
FileTree
|
|
@@ -157491,24 +157517,6 @@ class ToggleHighContrast extends EditorAction {
|
|
|
157491
157517
|
}
|
|
157492
157518
|
}
|
|
157493
157519
|
registerEditorAction(ToggleHighContrast);
|
|
157494
|
-
var monaco = /* @__PURE__ */ Object.freeze({
|
|
157495
|
-
__proto__: null,
|
|
157496
|
-
[Symbol.toStringTag]: "Module",
|
|
157497
|
-
CancellationTokenSource,
|
|
157498
|
-
Emitter,
|
|
157499
|
-
KeyCode,
|
|
157500
|
-
KeyMod,
|
|
157501
|
-
Position: Position$4,
|
|
157502
|
-
Range: Range$4,
|
|
157503
|
-
Selection: Selection$2,
|
|
157504
|
-
SelectionDirection,
|
|
157505
|
-
MarkerSeverity,
|
|
157506
|
-
MarkerTag,
|
|
157507
|
-
Uri,
|
|
157508
|
-
Token,
|
|
157509
|
-
editor: editor$1,
|
|
157510
|
-
languages
|
|
157511
|
-
});
|
|
157512
157520
|
var lib$2 = {};
|
|
157513
157521
|
var textOperation = { exports: {} };
|
|
157514
157522
|
(function(module2) {
|
|
@@ -162753,8 +162761,8 @@ var DEFAULT = {
|
|
|
162753
162761
|
startClosed: false,
|
|
162754
162762
|
debug: false
|
|
162755
162763
|
};
|
|
162756
|
-
|
|
162757
|
-
function
|
|
162764
|
+
(function() {
|
|
162765
|
+
function ReconnectingWebSocket(url2, protocols, options) {
|
|
162758
162766
|
var _this = this;
|
|
162759
162767
|
if (options === void 0) {
|
|
162760
162768
|
options = {};
|
|
@@ -162836,63 +162844,63 @@ var ReconnectingWebSocket = function() {
|
|
|
162836
162844
|
}
|
|
162837
162845
|
this._connect();
|
|
162838
162846
|
}
|
|
162839
|
-
Object.defineProperty(
|
|
162847
|
+
Object.defineProperty(ReconnectingWebSocket, "CONNECTING", {
|
|
162840
162848
|
get: function() {
|
|
162841
162849
|
return 0;
|
|
162842
162850
|
},
|
|
162843
162851
|
enumerable: true,
|
|
162844
162852
|
configurable: true
|
|
162845
162853
|
});
|
|
162846
|
-
Object.defineProperty(
|
|
162854
|
+
Object.defineProperty(ReconnectingWebSocket, "OPEN", {
|
|
162847
162855
|
get: function() {
|
|
162848
162856
|
return 1;
|
|
162849
162857
|
},
|
|
162850
162858
|
enumerable: true,
|
|
162851
162859
|
configurable: true
|
|
162852
162860
|
});
|
|
162853
|
-
Object.defineProperty(
|
|
162861
|
+
Object.defineProperty(ReconnectingWebSocket, "CLOSING", {
|
|
162854
162862
|
get: function() {
|
|
162855
162863
|
return 2;
|
|
162856
162864
|
},
|
|
162857
162865
|
enumerable: true,
|
|
162858
162866
|
configurable: true
|
|
162859
162867
|
});
|
|
162860
|
-
Object.defineProperty(
|
|
162868
|
+
Object.defineProperty(ReconnectingWebSocket, "CLOSED", {
|
|
162861
162869
|
get: function() {
|
|
162862
162870
|
return 3;
|
|
162863
162871
|
},
|
|
162864
162872
|
enumerable: true,
|
|
162865
162873
|
configurable: true
|
|
162866
162874
|
});
|
|
162867
|
-
Object.defineProperty(
|
|
162875
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "CONNECTING", {
|
|
162868
162876
|
get: function() {
|
|
162869
|
-
return
|
|
162877
|
+
return ReconnectingWebSocket.CONNECTING;
|
|
162870
162878
|
},
|
|
162871
162879
|
enumerable: true,
|
|
162872
162880
|
configurable: true
|
|
162873
162881
|
});
|
|
162874
|
-
Object.defineProperty(
|
|
162882
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "OPEN", {
|
|
162875
162883
|
get: function() {
|
|
162876
|
-
return
|
|
162884
|
+
return ReconnectingWebSocket.OPEN;
|
|
162877
162885
|
},
|
|
162878
162886
|
enumerable: true,
|
|
162879
162887
|
configurable: true
|
|
162880
162888
|
});
|
|
162881
|
-
Object.defineProperty(
|
|
162889
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "CLOSING", {
|
|
162882
162890
|
get: function() {
|
|
162883
|
-
return
|
|
162891
|
+
return ReconnectingWebSocket.CLOSING;
|
|
162884
162892
|
},
|
|
162885
162893
|
enumerable: true,
|
|
162886
162894
|
configurable: true
|
|
162887
162895
|
});
|
|
162888
|
-
Object.defineProperty(
|
|
162896
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "CLOSED", {
|
|
162889
162897
|
get: function() {
|
|
162890
|
-
return
|
|
162898
|
+
return ReconnectingWebSocket.CLOSED;
|
|
162891
162899
|
},
|
|
162892
162900
|
enumerable: true,
|
|
162893
162901
|
configurable: true
|
|
162894
162902
|
});
|
|
162895
|
-
Object.defineProperty(
|
|
162903
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "binaryType", {
|
|
162896
162904
|
get: function() {
|
|
162897
162905
|
return this._ws ? this._ws.binaryType : this._binaryType;
|
|
162898
162906
|
},
|
|
@@ -162905,14 +162913,14 @@ var ReconnectingWebSocket = function() {
|
|
|
162905
162913
|
enumerable: true,
|
|
162906
162914
|
configurable: true
|
|
162907
162915
|
});
|
|
162908
|
-
Object.defineProperty(
|
|
162916
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "retryCount", {
|
|
162909
162917
|
get: function() {
|
|
162910
162918
|
return Math.max(this._retryCount, 0);
|
|
162911
162919
|
},
|
|
162912
162920
|
enumerable: true,
|
|
162913
162921
|
configurable: true
|
|
162914
162922
|
});
|
|
162915
|
-
Object.defineProperty(
|
|
162923
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "bufferedAmount", {
|
|
162916
162924
|
get: function() {
|
|
162917
162925
|
var bytes = this._messageQueue.reduce(function(acc, message) {
|
|
162918
162926
|
if (typeof message === "string") {
|
|
@@ -162929,38 +162937,38 @@ var ReconnectingWebSocket = function() {
|
|
|
162929
162937
|
enumerable: true,
|
|
162930
162938
|
configurable: true
|
|
162931
162939
|
});
|
|
162932
|
-
Object.defineProperty(
|
|
162940
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "extensions", {
|
|
162933
162941
|
get: function() {
|
|
162934
162942
|
return this._ws ? this._ws.extensions : "";
|
|
162935
162943
|
},
|
|
162936
162944
|
enumerable: true,
|
|
162937
162945
|
configurable: true
|
|
162938
162946
|
});
|
|
162939
|
-
Object.defineProperty(
|
|
162947
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "protocol", {
|
|
162940
162948
|
get: function() {
|
|
162941
162949
|
return this._ws ? this._ws.protocol : "";
|
|
162942
162950
|
},
|
|
162943
162951
|
enumerable: true,
|
|
162944
162952
|
configurable: true
|
|
162945
162953
|
});
|
|
162946
|
-
Object.defineProperty(
|
|
162954
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "readyState", {
|
|
162947
162955
|
get: function() {
|
|
162948
162956
|
if (this._ws) {
|
|
162949
162957
|
return this._ws.readyState;
|
|
162950
162958
|
}
|
|
162951
|
-
return this._options.startClosed ?
|
|
162959
|
+
return this._options.startClosed ? ReconnectingWebSocket.CLOSED : ReconnectingWebSocket.CONNECTING;
|
|
162952
162960
|
},
|
|
162953
162961
|
enumerable: true,
|
|
162954
162962
|
configurable: true
|
|
162955
162963
|
});
|
|
162956
|
-
Object.defineProperty(
|
|
162964
|
+
Object.defineProperty(ReconnectingWebSocket.prototype, "url", {
|
|
162957
162965
|
get: function() {
|
|
162958
162966
|
return this._ws ? this._ws.url : "";
|
|
162959
162967
|
},
|
|
162960
162968
|
enumerable: true,
|
|
162961
162969
|
configurable: true
|
|
162962
162970
|
});
|
|
162963
|
-
|
|
162971
|
+
ReconnectingWebSocket.prototype.close = function(code2, reason) {
|
|
162964
162972
|
if (code2 === void 0) {
|
|
162965
162973
|
code2 = 1e3;
|
|
162966
162974
|
}
|
|
@@ -162977,7 +162985,7 @@ var ReconnectingWebSocket = function() {
|
|
|
162977
162985
|
}
|
|
162978
162986
|
this._ws.close(code2, reason);
|
|
162979
162987
|
};
|
|
162980
|
-
|
|
162988
|
+
ReconnectingWebSocket.prototype.reconnect = function(code2, reason) {
|
|
162981
162989
|
this._shouldReconnect = true;
|
|
162982
162990
|
this._closeCalled = false;
|
|
162983
162991
|
this._retryCount = -1;
|
|
@@ -162988,7 +162996,7 @@ var ReconnectingWebSocket = function() {
|
|
|
162988
162996
|
this._connect();
|
|
162989
162997
|
}
|
|
162990
162998
|
};
|
|
162991
|
-
|
|
162999
|
+
ReconnectingWebSocket.prototype.send = function(data) {
|
|
162992
163000
|
if (this._ws && this._ws.readyState === this.OPEN) {
|
|
162993
163001
|
this._debug("send", data);
|
|
162994
163002
|
this._ws.send(data);
|
|
@@ -163000,12 +163008,12 @@ var ReconnectingWebSocket = function() {
|
|
|
163000
163008
|
}
|
|
163001
163009
|
}
|
|
163002
163010
|
};
|
|
163003
|
-
|
|
163011
|
+
ReconnectingWebSocket.prototype.addEventListener = function(type, listener) {
|
|
163004
163012
|
if (this._listeners[type]) {
|
|
163005
163013
|
this._listeners[type].push(listener);
|
|
163006
163014
|
}
|
|
163007
163015
|
};
|
|
163008
|
-
|
|
163016
|
+
ReconnectingWebSocket.prototype.dispatchEvent = function(event) {
|
|
163009
163017
|
var e_1, _a2;
|
|
163010
163018
|
var listeners2 = this._listeners[event.type];
|
|
163011
163019
|
if (listeners2) {
|
|
@@ -163028,14 +163036,14 @@ var ReconnectingWebSocket = function() {
|
|
|
163028
163036
|
}
|
|
163029
163037
|
return true;
|
|
163030
163038
|
};
|
|
163031
|
-
|
|
163039
|
+
ReconnectingWebSocket.prototype.removeEventListener = function(type, listener) {
|
|
163032
163040
|
if (this._listeners[type]) {
|
|
163033
163041
|
this._listeners[type] = this._listeners[type].filter(function(l2) {
|
|
163034
163042
|
return l2 !== listener;
|
|
163035
163043
|
});
|
|
163036
163044
|
}
|
|
163037
163045
|
};
|
|
163038
|
-
|
|
163046
|
+
ReconnectingWebSocket.prototype._debug = function() {
|
|
163039
163047
|
var args = [];
|
|
163040
163048
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
163041
163049
|
args[_i] = arguments[_i];
|
|
@@ -163044,7 +163052,7 @@ var ReconnectingWebSocket = function() {
|
|
|
163044
163052
|
console.log.apply(console, __spread(["RWS>"], args));
|
|
163045
163053
|
}
|
|
163046
163054
|
};
|
|
163047
|
-
|
|
163055
|
+
ReconnectingWebSocket.prototype._getNextDelay = function() {
|
|
163048
163056
|
var _a2 = this._options, _b2 = _a2.reconnectionDelayGrowFactor, reconnectionDelayGrowFactor = _b2 === void 0 ? DEFAULT.reconnectionDelayGrowFactor : _b2, _c2 = _a2.minReconnectionDelay, minReconnectionDelay = _c2 === void 0 ? DEFAULT.minReconnectionDelay : _c2, _d2 = _a2.maxReconnectionDelay, maxReconnectionDelay = _d2 === void 0 ? DEFAULT.maxReconnectionDelay : _d2;
|
|
163049
163057
|
var delay = 0;
|
|
163050
163058
|
if (this._retryCount > 0) {
|
|
@@ -163056,13 +163064,13 @@ var ReconnectingWebSocket = function() {
|
|
|
163056
163064
|
this._debug("next delay", delay);
|
|
163057
163065
|
return delay;
|
|
163058
163066
|
};
|
|
163059
|
-
|
|
163067
|
+
ReconnectingWebSocket.prototype._wait = function() {
|
|
163060
163068
|
var _this = this;
|
|
163061
163069
|
return new Promise(function(resolve2) {
|
|
163062
163070
|
setTimeout(resolve2, _this._getNextDelay());
|
|
163063
163071
|
});
|
|
163064
163072
|
};
|
|
163065
|
-
|
|
163073
|
+
ReconnectingWebSocket.prototype._getNextUrl = function(urlProvider) {
|
|
163066
163074
|
if (typeof urlProvider === "string") {
|
|
163067
163075
|
return Promise.resolve(urlProvider);
|
|
163068
163076
|
}
|
|
@@ -163077,7 +163085,7 @@ var ReconnectingWebSocket = function() {
|
|
|
163077
163085
|
}
|
|
163078
163086
|
throw Error("Invalid URL");
|
|
163079
163087
|
};
|
|
163080
|
-
|
|
163088
|
+
ReconnectingWebSocket.prototype._connect = function() {
|
|
163081
163089
|
var _this = this;
|
|
163082
163090
|
if (this._connectLock || !this._shouldReconnect) {
|
|
163083
163091
|
return;
|
|
@@ -163110,11 +163118,11 @@ var ReconnectingWebSocket = function() {
|
|
|
163110
163118
|
}, connectionTimeout);
|
|
163111
163119
|
});
|
|
163112
163120
|
};
|
|
163113
|
-
|
|
163121
|
+
ReconnectingWebSocket.prototype._handleTimeout = function() {
|
|
163114
163122
|
this._debug("timeout event");
|
|
163115
163123
|
this._handleError(new ErrorEvent$1(Error("TIMEOUT"), this));
|
|
163116
163124
|
};
|
|
163117
|
-
|
|
163125
|
+
ReconnectingWebSocket.prototype._disconnect = function(code2, reason) {
|
|
163118
163126
|
if (code2 === void 0) {
|
|
163119
163127
|
code2 = 1e3;
|
|
163120
163128
|
}
|
|
@@ -163129,18 +163137,18 @@ var ReconnectingWebSocket = function() {
|
|
|
163129
163137
|
} catch (error2) {
|
|
163130
163138
|
}
|
|
163131
163139
|
};
|
|
163132
|
-
|
|
163140
|
+
ReconnectingWebSocket.prototype._acceptOpen = function() {
|
|
163133
163141
|
this._debug("accept open");
|
|
163134
163142
|
this._retryCount = 0;
|
|
163135
163143
|
};
|
|
163136
|
-
|
|
163144
|
+
ReconnectingWebSocket.prototype._callEventListener = function(event, listener) {
|
|
163137
163145
|
if ("handleEvent" in listener) {
|
|
163138
163146
|
listener.handleEvent(event);
|
|
163139
163147
|
} else {
|
|
163140
163148
|
listener(event);
|
|
163141
163149
|
}
|
|
163142
163150
|
};
|
|
163143
|
-
|
|
163151
|
+
ReconnectingWebSocket.prototype._removeListeners = function() {
|
|
163144
163152
|
if (!this._ws) {
|
|
163145
163153
|
return;
|
|
163146
163154
|
}
|
|
@@ -163150,7 +163158,7 @@ var ReconnectingWebSocket = function() {
|
|
|
163150
163158
|
this._ws.removeEventListener("message", this._handleMessage);
|
|
163151
163159
|
this._ws.removeEventListener("error", this._handleError);
|
|
163152
163160
|
};
|
|
163153
|
-
|
|
163161
|
+
ReconnectingWebSocket.prototype._addListeners = function() {
|
|
163154
163162
|
if (!this._ws) {
|
|
163155
163163
|
return;
|
|
163156
163164
|
}
|
|
@@ -163160,12 +163168,12 @@ var ReconnectingWebSocket = function() {
|
|
|
163160
163168
|
this._ws.addEventListener("message", this._handleMessage);
|
|
163161
163169
|
this._ws.addEventListener("error", this._handleError);
|
|
163162
163170
|
};
|
|
163163
|
-
|
|
163171
|
+
ReconnectingWebSocket.prototype._clearTimeouts = function() {
|
|
163164
163172
|
clearTimeout(this._connectTimeout);
|
|
163165
163173
|
clearTimeout(this._uptimeTimeout);
|
|
163166
163174
|
};
|
|
163167
|
-
return
|
|
163168
|
-
}();
|
|
163175
|
+
return ReconnectingWebSocket;
|
|
163176
|
+
})();
|
|
163169
163177
|
var lib = {};
|
|
163170
163178
|
var disposable = {};
|
|
163171
163179
|
var services = {};
|
|
@@ -174690,7 +174698,9 @@ const EditorLayout = newStyled.div`
|
|
|
174690
174698
|
.stack-list {
|
|
174691
174699
|
width: 100%;
|
|
174692
174700
|
height: 40px;
|
|
174693
|
-
|
|
174701
|
+
transform: translate(0, -1px);
|
|
174702
|
+
overflow-x: auto;
|
|
174703
|
+
flex-wrap: nowrap;
|
|
174694
174704
|
li {
|
|
174695
174705
|
/* width: 100px; */
|
|
174696
174706
|
height: 100%;
|
|
@@ -174701,6 +174711,7 @@ const EditorLayout = newStyled.div`
|
|
|
174701
174711
|
|
|
174702
174712
|
.active {
|
|
174703
174713
|
background: #1e1e1e;
|
|
174714
|
+
box-shadow: 0px 1px 0px 0 #333;
|
|
174704
174715
|
/* border-left: 1px solid rgb(42 96 231);
|
|
174705
174716
|
border-right: 1px solid rgb(42 96 231); */
|
|
174706
174717
|
/* background: red; */
|
|
@@ -174794,7 +174805,6 @@ const Editor = ({
|
|
|
174794
174805
|
keepString += i2 === 0 ? 0 : change.text.length;
|
|
174795
174806
|
return new TextOperation().retain(i2 === 0 ? change.rangeOffset : change.rangeOffset - rangeLengthamount + keepString).delete(change.rangeLength).insert(change.text).retain(valuelength - change.rangeOffset - change.rangeLength);
|
|
174796
174807
|
}).reduce((a2, b2) => a2.compose(b2));
|
|
174797
|
-
setLocalFile((doc2 == null ? void 0 : doc2.path) ? doc2 == null ? void 0 : doc2.path : "singleFile", editor.getValue());
|
|
174798
174808
|
client2.applyClient(operation);
|
|
174799
174809
|
} else {
|
|
174800
174810
|
setValue(changes[0].text);
|
|
@@ -174883,45 +174893,7 @@ const Editor = ({
|
|
|
174883
174893
|
extensions: [".ts"],
|
|
174884
174894
|
aliases: ["TypeScript", "ts", "TS", "typescript"]
|
|
174885
174895
|
});
|
|
174886
|
-
|
|
174887
|
-
return;
|
|
174888
|
-
lib.MonacoServices.install(monaco);
|
|
174889
|
-
const {
|
|
174890
|
-
lspUrl,
|
|
174891
|
-
ticket
|
|
174892
|
-
} = oTStore.getState().dockerInfo;
|
|
174893
|
-
if (!lspUrl)
|
|
174894
|
-
return;
|
|
174895
|
-
const webSocket = new ReconnectingWebSocket(`wss://${lspUrl}/${ticket}`, [], {
|
|
174896
|
-
maxReconnectionDelay: 1e4,
|
|
174897
|
-
minReconnectionDelay: 1e3,
|
|
174898
|
-
reconnectionDelayGrowFactor: 1.3,
|
|
174899
|
-
connectionTimeout: 1e4,
|
|
174900
|
-
maxRetries: Infinity,
|
|
174901
|
-
debug: false
|
|
174902
|
-
});
|
|
174903
|
-
lib$1.listen({
|
|
174904
|
-
webSocket,
|
|
174905
|
-
onConnection: (connection2) => {
|
|
174906
|
-
const languageClient = new lib.MonacoLanguageClient({
|
|
174907
|
-
name: "Language Client",
|
|
174908
|
-
clientOptions: {
|
|
174909
|
-
documentSelector: ["java", "ruby"],
|
|
174910
|
-
errorHandler: {
|
|
174911
|
-
error: () => lib.ErrorAction.Continue,
|
|
174912
|
-
closed: () => lib.CloseAction.DoNotRestart
|
|
174913
|
-
}
|
|
174914
|
-
},
|
|
174915
|
-
connectionProvider: {
|
|
174916
|
-
get: (errorHandler2, closeHandler) => {
|
|
174917
|
-
return Promise.resolve(lib.createConnection(connection2, errorHandler2, closeHandler));
|
|
174918
|
-
}
|
|
174919
|
-
}
|
|
174920
|
-
});
|
|
174921
|
-
const disposable2 = languageClient.start();
|
|
174922
|
-
connection2.onClose(() => disposable2.dispose());
|
|
174923
|
-
}
|
|
174924
|
-
});
|
|
174896
|
+
return;
|
|
174925
174897
|
};
|
|
174926
174898
|
const switchModel = (model) => {
|
|
174927
174899
|
const {
|
|
@@ -175193,7 +175165,7 @@ const Editor = ({
|
|
|
175193
175165
|
})]
|
|
175194
175166
|
});
|
|
175195
175167
|
};
|
|
175196
|
-
var index$
|
|
175168
|
+
var index$4 = /* @__PURE__ */ Object.freeze({
|
|
175197
175169
|
__proto__: null,
|
|
175198
175170
|
[Symbol.toStringTag]: "Module",
|
|
175199
175171
|
Editor
|
|
@@ -182320,12 +182292,237 @@ const XTerm = (_a2) => {
|
|
|
182320
182292
|
})
|
|
182321
182293
|
});
|
|
182322
182294
|
};
|
|
182323
|
-
const
|
|
182295
|
+
const Console = (_c2) => {
|
|
182324
182296
|
var _d2 = _c2, {
|
|
182325
182297
|
options
|
|
182326
182298
|
} = _d2, props = __objRest(_d2, [
|
|
182327
182299
|
"options"
|
|
182328
182300
|
]);
|
|
182301
|
+
const defaultOptions2 = __spreadValues({
|
|
182302
|
+
convertEol: true,
|
|
182303
|
+
fontSize: 12,
|
|
182304
|
+
fontFamily: "Monaco, Menlo, monospace",
|
|
182305
|
+
lineHeight: 1,
|
|
182306
|
+
cursorBlink: true,
|
|
182307
|
+
cursorWidth: 1,
|
|
182308
|
+
cursorStyle: "block",
|
|
182309
|
+
rightClickSelectsWord: true,
|
|
182310
|
+
theme: {
|
|
182311
|
+
background: "#1E1E1E"
|
|
182312
|
+
}
|
|
182313
|
+
}, options);
|
|
182314
|
+
const [terminal, setTerminal] = react.exports.useState(null);
|
|
182315
|
+
const {
|
|
182316
|
+
CRDTInfo
|
|
182317
|
+
} = oTStore((state) => state);
|
|
182318
|
+
const {
|
|
182319
|
+
dockerStatus
|
|
182320
|
+
} = oTStore((state) => state);
|
|
182321
|
+
const initTerminalText = (terminal2, text2) => {
|
|
182322
|
+
terminal2.write("\r\n");
|
|
182323
|
+
terminal2.clear();
|
|
182324
|
+
writeText(terminal2, text2);
|
|
182325
|
+
};
|
|
182326
|
+
const writeText = (terminal2, text2) => {
|
|
182327
|
+
terminal2.write(text2);
|
|
182328
|
+
};
|
|
182329
|
+
react.exports.useEffect(() => {
|
|
182330
|
+
if (!terminal) {
|
|
182331
|
+
const term = new xterm.exports.Terminal(defaultOptions2);
|
|
182332
|
+
setTerminal(term);
|
|
182333
|
+
}
|
|
182334
|
+
}, []);
|
|
182335
|
+
react.exports.useEffect(() => {
|
|
182336
|
+
if (!terminal)
|
|
182337
|
+
return;
|
|
182338
|
+
if (dockerStatus === "STOP") {
|
|
182339
|
+
initTerminalText(terminal, "\u5E94\u7528\u672A\u542F\u52A8\r\n");
|
|
182340
|
+
} else {
|
|
182341
|
+
initTerminalText(terminal, oTStore.getState().dockerInfo.consoleHistory);
|
|
182342
|
+
}
|
|
182343
|
+
}, [terminal]);
|
|
182344
|
+
react.exports.useEffect(() => {
|
|
182345
|
+
const crdt = CRDTInfo.console;
|
|
182346
|
+
if (terminal && crdt) {
|
|
182347
|
+
if (crdt.doc.value === "^C") {
|
|
182348
|
+
writeText(terminal, crdt.doc.value);
|
|
182349
|
+
initTerminalText(terminal, "");
|
|
182350
|
+
return;
|
|
182351
|
+
}
|
|
182352
|
+
writeText(terminal, crdt.doc.value || "");
|
|
182353
|
+
}
|
|
182354
|
+
}, [CRDTInfo.console]);
|
|
182355
|
+
react.exports.useEffect(() => {
|
|
182356
|
+
if (!terminal)
|
|
182357
|
+
return;
|
|
182358
|
+
if (dockerStatus === "STOP") {
|
|
182359
|
+
setTimeout(() => {
|
|
182360
|
+
initTerminalText(terminal, "\u5E94\u7528\u672A\u542F\u52A8\r\n");
|
|
182361
|
+
}, 400);
|
|
182362
|
+
} else {
|
|
182363
|
+
initTerminalText(terminal, "");
|
|
182364
|
+
}
|
|
182365
|
+
}, [dockerStatus]);
|
|
182366
|
+
return /* @__PURE__ */ jsx("div", {
|
|
182367
|
+
style: {
|
|
182368
|
+
height: "100%",
|
|
182369
|
+
width: "100%"
|
|
182370
|
+
},
|
|
182371
|
+
children: /* @__PURE__ */ jsx(XTerm, __spreadValues({
|
|
182372
|
+
terminal
|
|
182373
|
+
}, props))
|
|
182374
|
+
});
|
|
182375
|
+
};
|
|
182376
|
+
var index$3 = /* @__PURE__ */ Object.freeze({
|
|
182377
|
+
__proto__: null,
|
|
182378
|
+
[Symbol.toStringTag]: "Module",
|
|
182379
|
+
"default": Console
|
|
182380
|
+
});
|
|
182381
|
+
const PROTOCOL = "https://";
|
|
182382
|
+
const NavBar = newStyled.div`
|
|
182383
|
+
background-color: white;
|
|
182384
|
+
height: 30px;
|
|
182385
|
+
display: flex;
|
|
182386
|
+
align-items: center;
|
|
182387
|
+
|
|
182388
|
+
i {
|
|
182389
|
+
margin: 0 10px;
|
|
182390
|
+
width: 24px;
|
|
182391
|
+
height: 24px;
|
|
182392
|
+
border-radius: 50%;
|
|
182393
|
+
display: flex;
|
|
182394
|
+
justify-content: center;
|
|
182395
|
+
align-items: center;
|
|
182396
|
+
|
|
182397
|
+
&.disabled {
|
|
182398
|
+
color: #f2fffe;
|
|
182399
|
+
&:hover {
|
|
182400
|
+
background-color: white;
|
|
182401
|
+
}
|
|
182402
|
+
}
|
|
182403
|
+
|
|
182404
|
+
&:hover {
|
|
182405
|
+
background-color: #e0e0e0;
|
|
182406
|
+
}
|
|
182407
|
+
}
|
|
182408
|
+
|
|
182409
|
+
input {
|
|
182410
|
+
flex: 1;
|
|
182411
|
+
display: inline-block;
|
|
182412
|
+
height: 26px;
|
|
182413
|
+
line-height: 26px;
|
|
182414
|
+
padding: 0 8px;
|
|
182415
|
+
border: 1px solid #adacac;
|
|
182416
|
+
border-radius: 5px;
|
|
182417
|
+
}
|
|
182418
|
+
`;
|
|
182419
|
+
const StopMask = newStyled.div`
|
|
182420
|
+
width: 100%;
|
|
182421
|
+
height: calc(100% - 30px);
|
|
182422
|
+
position: absolute;
|
|
182423
|
+
display: flex;
|
|
182424
|
+
justify-content: center;
|
|
182425
|
+
align-items: center;
|
|
182426
|
+
font-size: 18px;
|
|
182427
|
+
color: #ffffff;
|
|
182428
|
+
background-color: #5a5a5a;
|
|
182429
|
+
opacity: 0.6;
|
|
182430
|
+
`;
|
|
182431
|
+
const OutputBrowser = (_e2) => {
|
|
182432
|
+
var _f2 = _e2, {
|
|
182433
|
+
url: url2
|
|
182434
|
+
} = _f2, props = __objRest(_f2, [
|
|
182435
|
+
"url"
|
|
182436
|
+
]);
|
|
182437
|
+
const pStatus = oTStore((state) => state.playgroundStatus);
|
|
182438
|
+
const dStatus = oTStore((state) => state.dockerStatus);
|
|
182439
|
+
const [playgroundStatus, setPlaygroundStatus] = react.exports.useState("EMPTY");
|
|
182440
|
+
const [dockerStatus, setDockerStatus] = react.exports.useState("STOP");
|
|
182441
|
+
const urlWithProtocol = (url22) => {
|
|
182442
|
+
if (!url22)
|
|
182443
|
+
return `${PROTOCOL}showmebug.com`;
|
|
182444
|
+
if (url22.indexOf("http://") !== 0 && url22.indexOf("https://") !== 0) {
|
|
182445
|
+
url22 = `${PROTOCOL}${url22}`;
|
|
182446
|
+
}
|
|
182447
|
+
return url22;
|
|
182448
|
+
};
|
|
182449
|
+
react.exports.useEffect(() => {
|
|
182450
|
+
setPlaygroundStatus(pStatus);
|
|
182451
|
+
}, [pStatus]);
|
|
182452
|
+
react.exports.useEffect(() => {
|
|
182453
|
+
setDockerStatus(dStatus);
|
|
182454
|
+
setTimeout(() => {
|
|
182455
|
+
onRefresh();
|
|
182456
|
+
}, 800);
|
|
182457
|
+
}, [dStatus]);
|
|
182458
|
+
const iframeRef = react.exports.useRef(null);
|
|
182459
|
+
const [iframeSrc, setIframeSrc] = react.exports.useState(urlWithProtocol(url2));
|
|
182460
|
+
react.exports.useEffect(() => {
|
|
182461
|
+
setIframeSrc(urlWithProtocol(url2));
|
|
182462
|
+
}, [url2]);
|
|
182463
|
+
react.exports.useEffect(() => {
|
|
182464
|
+
}, [iframeRef]);
|
|
182465
|
+
const onEnterKey = (e2) => {
|
|
182466
|
+
if (e2.keyCode !== 13)
|
|
182467
|
+
return;
|
|
182468
|
+
const url22 = urlWithProtocol(e2.target.value);
|
|
182469
|
+
setIframeSrc(url22);
|
|
182470
|
+
iframeRef.current.contentWindow.location.replace(url22);
|
|
182471
|
+
};
|
|
182472
|
+
const onRefresh = () => {
|
|
182473
|
+
iframeRef.current.contentWindow.location.replace(iframeSrc);
|
|
182474
|
+
};
|
|
182475
|
+
const onOpenInNewTab = () => {
|
|
182476
|
+
window.open(iframeSrc);
|
|
182477
|
+
};
|
|
182478
|
+
react.exports.useEffect(() => {
|
|
182479
|
+
if (playgroundStatus === "EMPTY")
|
|
182480
|
+
return;
|
|
182481
|
+
if (playgroundStatus === "ACTIVE" && dockerStatus === "RUNNING") {
|
|
182482
|
+
if (iframeSrc !== "http://" && iframeSrc !== "https://") {
|
|
182483
|
+
iframeRef.current.contentWindow.location.replace(iframeSrc);
|
|
182484
|
+
}
|
|
182485
|
+
}
|
|
182486
|
+
}, [playgroundStatus, dockerStatus]);
|
|
182487
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
182488
|
+
children: [/* @__PURE__ */ jsxs(NavBar, {
|
|
182489
|
+
children: [/* @__PURE__ */ jsx("i", {
|
|
182490
|
+
className: "d42 text-xl reload cursor-pointer",
|
|
182491
|
+
onClick: onRefresh
|
|
182492
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
182493
|
+
type: "text",
|
|
182494
|
+
value: iframeSrc,
|
|
182495
|
+
onChange: (e2) => setIframeSrc(e2.target.value),
|
|
182496
|
+
onKeyDown: onEnterKey
|
|
182497
|
+
}), /* @__PURE__ */ jsx("i", {
|
|
182498
|
+
className: "d42 text-xl file-copy cursor-pointer",
|
|
182499
|
+
onClick: onOpenInNewTab
|
|
182500
|
+
})]
|
|
182501
|
+
}), dockerStatus === "STOP" && /* @__PURE__ */ jsx(StopMask, {
|
|
182502
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
182503
|
+
children: "\u70B9\u51FB\u201C\u8FD0\u884C\u201D\uFF0C\u542F\u52A8\u5E94\u7528"
|
|
182504
|
+
})
|
|
182505
|
+
}), /* @__PURE__ */ jsx("iframe", {
|
|
182506
|
+
ref: iframeRef,
|
|
182507
|
+
src: iframeSrc,
|
|
182508
|
+
style: {
|
|
182509
|
+
width: "100%",
|
|
182510
|
+
height: "calc(100% - 30px)"
|
|
182511
|
+
}
|
|
182512
|
+
})]
|
|
182513
|
+
});
|
|
182514
|
+
};
|
|
182515
|
+
var index$2 = /* @__PURE__ */ Object.freeze({
|
|
182516
|
+
__proto__: null,
|
|
182517
|
+
[Symbol.toStringTag]: "Module",
|
|
182518
|
+
"default": OutputBrowser
|
|
182519
|
+
});
|
|
182520
|
+
const TerminalComponent = (_g2) => {
|
|
182521
|
+
var _h2 = _g2, {
|
|
182522
|
+
options
|
|
182523
|
+
} = _h2, props = __objRest(_h2, [
|
|
182524
|
+
"options"
|
|
182525
|
+
]);
|
|
182329
182526
|
const defaultOptions2 = __spreadValues({}, options);
|
|
182330
182527
|
const userLabel = document.createElement("div");
|
|
182331
182528
|
userLabel.classList.add("xterm-helper-user-label");
|
|
@@ -182365,15 +182562,15 @@ const TerminalComponent = (_c2) => {
|
|
|
182365
182562
|
}
|
|
182366
182563
|
}, []);
|
|
182367
182564
|
react.exports.useEffect(() => {
|
|
182368
|
-
var _a2, _b2,
|
|
182565
|
+
var _a2, _b2, _c2, _d2;
|
|
182369
182566
|
if (!terminal)
|
|
182370
182567
|
return;
|
|
182371
182568
|
if (CRDTInfo.terminal) {
|
|
182372
|
-
initTerminalText(terminal, ((
|
|
182569
|
+
initTerminalText(terminal, ((_d2 = (_c2 = (_b2 = (_a2 = oTStore.getState()) == null ? void 0 : _a2.CRDTInfo) == null ? void 0 : _b2.terminal) == null ? void 0 : _c2.doc) == null ? void 0 : _d2.value) || "");
|
|
182373
182570
|
}
|
|
182374
182571
|
}, [terminal]);
|
|
182375
182572
|
react.exports.useEffect(() => {
|
|
182376
|
-
var _a2, _b2,
|
|
182573
|
+
var _a2, _b2, _c2;
|
|
182377
182574
|
const crdt = CRDTInfo.terminal;
|
|
182378
182575
|
if (terminal && crdt) {
|
|
182379
182576
|
if (((_a2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _a2.action) === "Get") {
|
|
@@ -182381,7 +182578,7 @@ const TerminalComponent = (_c2) => {
|
|
|
182381
182578
|
return;
|
|
182382
182579
|
}
|
|
182383
182580
|
writeText(terminal, ((_b2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _b2.value) || "");
|
|
182384
|
-
const postUser = userListStore.getState().userList[(
|
|
182581
|
+
const postUser = userListStore.getState().userList[(_c2 = CRDTInfo == null ? void 0 : CRDTInfo.userInfo) == null ? void 0 : _c2.uuid];
|
|
182385
182582
|
if (postUser && !IsMe(CRDTInfo.userInfo)) {
|
|
182386
182583
|
const helperContainer = terminal._core._helperContainer;
|
|
182387
182584
|
userLabel.innerText = postUser.name;
|
|
@@ -182428,12 +182625,12 @@ var index$1 = /* @__PURE__ */ Object.freeze({
|
|
|
182428
182625
|
[Symbol.toStringTag]: "Module",
|
|
182429
182626
|
"default": TerminalComponent
|
|
182430
182627
|
});
|
|
182431
|
-
const Tabs = (
|
|
182432
|
-
var
|
|
182628
|
+
const Tabs = (_i) => {
|
|
182629
|
+
var _j = _i, {
|
|
182433
182630
|
activeKey,
|
|
182434
182631
|
onSelect,
|
|
182435
182632
|
tabItems
|
|
182436
|
-
} =
|
|
182633
|
+
} = _j, props = __objRest(_j, [
|
|
182437
182634
|
"activeKey",
|
|
182438
182635
|
"onSelect",
|
|
182439
182636
|
"tabItems"
|
|
@@ -182751,10 +182948,10 @@ const AvatarLayout = newStyled.div`
|
|
|
182751
182948
|
border-color: ${(props) => props.user.color};
|
|
182752
182949
|
background-image: ${(props) => 'url("' + props.user.avatar + '")'};
|
|
182753
182950
|
`;
|
|
182754
|
-
const Avatar = (
|
|
182755
|
-
var
|
|
182951
|
+
const Avatar = (_k) => {
|
|
182952
|
+
var _l = _k, {
|
|
182756
182953
|
user
|
|
182757
|
-
} =
|
|
182954
|
+
} = _l, props = __objRest(_l, [
|
|
182758
182955
|
"user"
|
|
182759
182956
|
]);
|
|
182760
182957
|
return /* @__PURE__ */ jsx(AvatarLayout, __spreadValues({
|
|
@@ -182763,8 +182960,8 @@ const Avatar = (_g2) => {
|
|
|
182763
182960
|
}, props));
|
|
182764
182961
|
};
|
|
182765
182962
|
const SkeletonThemeContext = React.createContext({});
|
|
182766
|
-
function SkeletonTheme(
|
|
182767
|
-
var
|
|
182963
|
+
function SkeletonTheme(_m) {
|
|
182964
|
+
var _n = _m, { children } = _n, styleOptions = __objRest(_n, ["children"]);
|
|
182768
182965
|
return React.createElement(SkeletonThemeContext.Provider, { value: styleOptions }, children);
|
|
182769
182966
|
}
|
|
182770
182967
|
const defaultEnableAnimation = true;
|
|
@@ -182790,8 +182987,8 @@ function styleOptionsToCssProperties({ baseColor, highlightColor, width, height,
|
|
|
182790
182987
|
style["--highlight-color"] = highlightColor;
|
|
182791
182988
|
return style;
|
|
182792
182989
|
}
|
|
182793
|
-
function Skeleton$1(
|
|
182794
|
-
var
|
|
182990
|
+
function Skeleton$1(_o) {
|
|
182991
|
+
var _p = _o, { count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp } = _p, propsStyleOptions = __objRest(_p, ["count", "wrapper", "className", "containerClassName", "containerTestId", "circle", "style"]);
|
|
182795
182992
|
var _a2, _b2;
|
|
182796
182993
|
const contextStyleOptions = React.useContext(SkeletonThemeContext);
|
|
182797
182994
|
const styleOptions = __spreadProps(__spreadValues(__spreadValues({}, contextStyleOptions), propsStyleOptions), {
|
|
@@ -182842,87 +183039,6 @@ function Box({
|
|
|
182842
183039
|
children
|
|
182843
183040
|
});
|
|
182844
183041
|
}
|
|
182845
|
-
const Console = (_m) => {
|
|
182846
|
-
var _n = _m, {
|
|
182847
|
-
options
|
|
182848
|
-
} = _n, props = __objRest(_n, [
|
|
182849
|
-
"options"
|
|
182850
|
-
]);
|
|
182851
|
-
const defaultOptions2 = __spreadValues({
|
|
182852
|
-
convertEol: true,
|
|
182853
|
-
fontSize: 12,
|
|
182854
|
-
fontFamily: "Monaco, Menlo, monospace",
|
|
182855
|
-
lineHeight: 1,
|
|
182856
|
-
cursorBlink: true,
|
|
182857
|
-
cursorWidth: 1,
|
|
182858
|
-
cursorStyle: "block",
|
|
182859
|
-
rightClickSelectsWord: true,
|
|
182860
|
-
theme: {
|
|
182861
|
-
background: "#1E1E1E"
|
|
182862
|
-
}
|
|
182863
|
-
}, options);
|
|
182864
|
-
const [terminal, setTerminal] = react.exports.useState(null);
|
|
182865
|
-
const {
|
|
182866
|
-
CRDTInfo
|
|
182867
|
-
} = oTStore((state) => state);
|
|
182868
|
-
const {
|
|
182869
|
-
dockerStatus
|
|
182870
|
-
} = oTStore((state) => state);
|
|
182871
|
-
const initTerminalText = (terminal2, text2) => {
|
|
182872
|
-
terminal2.write("\r\n");
|
|
182873
|
-
terminal2.clear();
|
|
182874
|
-
writeText(terminal2, text2);
|
|
182875
|
-
};
|
|
182876
|
-
const writeText = (terminal2, text2) => {
|
|
182877
|
-
terminal2.write(text2);
|
|
182878
|
-
};
|
|
182879
|
-
react.exports.useEffect(() => {
|
|
182880
|
-
if (!terminal) {
|
|
182881
|
-
const term = new xterm.exports.Terminal(defaultOptions2);
|
|
182882
|
-
setTerminal(term);
|
|
182883
|
-
}
|
|
182884
|
-
}, []);
|
|
182885
|
-
react.exports.useEffect(() => {
|
|
182886
|
-
if (!terminal)
|
|
182887
|
-
return;
|
|
182888
|
-
if (dockerStatus === "STOP") {
|
|
182889
|
-
initTerminalText(terminal, "\u5E94\u7528\u672A\u542F\u52A8\r\n");
|
|
182890
|
-
} else {
|
|
182891
|
-
initTerminalText(terminal, oTStore.getState().dockerInfo.consoleHistory);
|
|
182892
|
-
}
|
|
182893
|
-
}, [terminal]);
|
|
182894
|
-
react.exports.useEffect(() => {
|
|
182895
|
-
const crdt = CRDTInfo.console;
|
|
182896
|
-
if (terminal && crdt) {
|
|
182897
|
-
if (crdt.doc.value === "^C") {
|
|
182898
|
-
writeText(terminal, crdt.doc.value);
|
|
182899
|
-
initTerminalText(terminal, "");
|
|
182900
|
-
return;
|
|
182901
|
-
}
|
|
182902
|
-
writeText(terminal, crdt.doc.value || "");
|
|
182903
|
-
}
|
|
182904
|
-
}, [CRDTInfo.console]);
|
|
182905
|
-
react.exports.useEffect(() => {
|
|
182906
|
-
if (!terminal)
|
|
182907
|
-
return;
|
|
182908
|
-
if (dockerStatus === "STOP") {
|
|
182909
|
-
setTimeout(() => {
|
|
182910
|
-
initTerminalText(terminal, "\u5E94\u7528\u672A\u542F\u52A8\r\n");
|
|
182911
|
-
}, 400);
|
|
182912
|
-
} else {
|
|
182913
|
-
initTerminalText(terminal, "");
|
|
182914
|
-
}
|
|
182915
|
-
}, [dockerStatus]);
|
|
182916
|
-
return /* @__PURE__ */ jsx("div", {
|
|
182917
|
-
style: {
|
|
182918
|
-
height: "100%",
|
|
182919
|
-
width: "100%"
|
|
182920
|
-
},
|
|
182921
|
-
children: /* @__PURE__ */ jsx(XTerm, __spreadValues({
|
|
182922
|
-
terminal
|
|
182923
|
-
}, props))
|
|
182924
|
-
});
|
|
182925
|
-
};
|
|
182926
183042
|
const ToolBarWrapper = newStyled.div`
|
|
182927
183043
|
position: relative;
|
|
182928
183044
|
display: flex;
|
|
@@ -182995,8 +183111,8 @@ const ButtonContent = ({
|
|
|
182995
183111
|
})()
|
|
182996
183112
|
});
|
|
182997
183113
|
};
|
|
182998
|
-
const ToolBar = (
|
|
182999
|
-
var props = __objRest(
|
|
183114
|
+
const ToolBar = (_q) => {
|
|
183115
|
+
var props = __objRest(_q, []);
|
|
183000
183116
|
const io = useOT((state) => state.socket);
|
|
183001
183117
|
const pStatus = oTStore((state) => state.playgroundStatus);
|
|
183002
183118
|
const dStatus = oTStore((state) => state.dockerStatus);
|
|
@@ -183062,140 +183178,6 @@ const ToolBar = (_o) => {
|
|
|
183062
183178
|
})]
|
|
183063
183179
|
});
|
|
183064
183180
|
};
|
|
183065
|
-
const PROTOCOL = "https://";
|
|
183066
|
-
const NavBar = newStyled.div`
|
|
183067
|
-
background-color: white;
|
|
183068
|
-
height: 30px;
|
|
183069
|
-
display: flex;
|
|
183070
|
-
align-items: center;
|
|
183071
|
-
|
|
183072
|
-
i {
|
|
183073
|
-
margin: 0 10px;
|
|
183074
|
-
width: 24px;
|
|
183075
|
-
height: 24px;
|
|
183076
|
-
border-radius: 50%;
|
|
183077
|
-
display: flex;
|
|
183078
|
-
justify-content: center;
|
|
183079
|
-
align-items: center;
|
|
183080
|
-
|
|
183081
|
-
&.disabled {
|
|
183082
|
-
color: #f2fffe;
|
|
183083
|
-
&:hover {
|
|
183084
|
-
background-color: white;
|
|
183085
|
-
}
|
|
183086
|
-
}
|
|
183087
|
-
|
|
183088
|
-
&:hover {
|
|
183089
|
-
background-color: #e0e0e0;
|
|
183090
|
-
}
|
|
183091
|
-
}
|
|
183092
|
-
|
|
183093
|
-
input {
|
|
183094
|
-
flex: 1;
|
|
183095
|
-
display: inline-block;
|
|
183096
|
-
height: 26px;
|
|
183097
|
-
line-height: 26px;
|
|
183098
|
-
padding: 0 8px;
|
|
183099
|
-
border: 1px solid #adacac;
|
|
183100
|
-
border-radius: 5px;
|
|
183101
|
-
}
|
|
183102
|
-
`;
|
|
183103
|
-
const StopMask = newStyled.div`
|
|
183104
|
-
width: 100%;
|
|
183105
|
-
height: calc(100% - 30px);
|
|
183106
|
-
position: absolute;
|
|
183107
|
-
display: flex;
|
|
183108
|
-
justify-content: center;
|
|
183109
|
-
align-items: center;
|
|
183110
|
-
font-size: 18px;
|
|
183111
|
-
color: #ffffff;
|
|
183112
|
-
background-color: #5a5a5a;
|
|
183113
|
-
opacity: 0.6;
|
|
183114
|
-
`;
|
|
183115
|
-
const OutputBrowser = (_p) => {
|
|
183116
|
-
var _q = _p, {
|
|
183117
|
-
url: url2
|
|
183118
|
-
} = _q, props = __objRest(_q, [
|
|
183119
|
-
"url"
|
|
183120
|
-
]);
|
|
183121
|
-
const pStatus = oTStore((state) => state.playgroundStatus);
|
|
183122
|
-
const dStatus = oTStore((state) => state.dockerStatus);
|
|
183123
|
-
const [playgroundStatus, setPlaygroundStatus] = react.exports.useState("EMPTY");
|
|
183124
|
-
const [dockerStatus, setDockerStatus] = react.exports.useState("STOP");
|
|
183125
|
-
const urlWithProtocol = (url22) => {
|
|
183126
|
-
if (!url22)
|
|
183127
|
-
return `${PROTOCOL}showmebug.com`;
|
|
183128
|
-
if (url22.indexOf("http://") !== 0 && url22.indexOf("https://") !== 0) {
|
|
183129
|
-
url22 = `${PROTOCOL}${url22}`;
|
|
183130
|
-
}
|
|
183131
|
-
return url22;
|
|
183132
|
-
};
|
|
183133
|
-
react.exports.useEffect(() => {
|
|
183134
|
-
setPlaygroundStatus(pStatus);
|
|
183135
|
-
}, [pStatus]);
|
|
183136
|
-
react.exports.useEffect(() => {
|
|
183137
|
-
setDockerStatus(dStatus);
|
|
183138
|
-
setTimeout(() => {
|
|
183139
|
-
onRefresh();
|
|
183140
|
-
}, 800);
|
|
183141
|
-
}, [dStatus]);
|
|
183142
|
-
const iframeRef = react.exports.useRef(null);
|
|
183143
|
-
const [iframeSrc, setIframeSrc] = react.exports.useState(urlWithProtocol(url2));
|
|
183144
|
-
react.exports.useEffect(() => {
|
|
183145
|
-
setIframeSrc(urlWithProtocol(url2));
|
|
183146
|
-
}, [url2]);
|
|
183147
|
-
react.exports.useEffect(() => {
|
|
183148
|
-
}, [iframeRef]);
|
|
183149
|
-
const onEnterKey = (e2) => {
|
|
183150
|
-
if (e2.keyCode !== 13)
|
|
183151
|
-
return;
|
|
183152
|
-
const url22 = urlWithProtocol(e2.target.value);
|
|
183153
|
-
setIframeSrc(url22);
|
|
183154
|
-
iframeRef.current.contentWindow.location.replace(url22);
|
|
183155
|
-
};
|
|
183156
|
-
const onRefresh = () => {
|
|
183157
|
-
iframeRef.current.contentWindow.location.replace(iframeSrc);
|
|
183158
|
-
};
|
|
183159
|
-
const onOpenInNewTab = () => {
|
|
183160
|
-
window.open(iframeSrc);
|
|
183161
|
-
};
|
|
183162
|
-
react.exports.useEffect(() => {
|
|
183163
|
-
if (playgroundStatus === "EMPTY")
|
|
183164
|
-
return;
|
|
183165
|
-
if (playgroundStatus === "ACTIVE" && dockerStatus === "RUNNING") {
|
|
183166
|
-
if (iframeSrc !== "http://" && iframeSrc !== "https://") {
|
|
183167
|
-
iframeRef.current.contentWindow.location.replace(iframeSrc);
|
|
183168
|
-
}
|
|
183169
|
-
}
|
|
183170
|
-
}, [playgroundStatus, dockerStatus]);
|
|
183171
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
183172
|
-
children: [/* @__PURE__ */ jsxs(NavBar, {
|
|
183173
|
-
children: [/* @__PURE__ */ jsx("i", {
|
|
183174
|
-
className: "d42 text-xl reload cursor-pointer",
|
|
183175
|
-
onClick: onRefresh
|
|
183176
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
183177
|
-
type: "text",
|
|
183178
|
-
value: iframeSrc,
|
|
183179
|
-
onChange: (e2) => setIframeSrc(e2.target.value),
|
|
183180
|
-
onKeyDown: onEnterKey
|
|
183181
|
-
}), /* @__PURE__ */ jsx("i", {
|
|
183182
|
-
className: "d42 text-xl file-copy cursor-pointer",
|
|
183183
|
-
onClick: onOpenInNewTab
|
|
183184
|
-
})]
|
|
183185
|
-
}), dockerStatus === "STOP" && /* @__PURE__ */ jsx(StopMask, {
|
|
183186
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
183187
|
-
children: "\u70B9\u51FB\u201C\u8FD0\u884C\u201D\uFF0C\u542F\u52A8\u5E94\u7528"
|
|
183188
|
-
})
|
|
183189
|
-
}), /* @__PURE__ */ jsx("iframe", {
|
|
183190
|
-
ref: iframeRef,
|
|
183191
|
-
src: iframeSrc,
|
|
183192
|
-
style: {
|
|
183193
|
-
width: "100%",
|
|
183194
|
-
height: "calc(100% - 30px)"
|
|
183195
|
-
}
|
|
183196
|
-
})]
|
|
183197
|
-
});
|
|
183198
|
-
};
|
|
183199
183181
|
var loglevel = { exports: {} };
|
|
183200
183182
|
(function(module2) {
|
|
183201
183183
|
(function(root2, definition) {
|