@dao42/d42paas-front 0.8.1 → 0.8.3
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 +775 -398
- package/dist/DaoPaaS.umd.js +387 -387
- package/dist/sdk/docs/classes/DaoPaaS.html +18 -18
- package/dist/sdk/docs/index.html +9 -2
- package/dist/sdk/docs/interfaces/BrowserProps.html +5 -5
- package/dist/sdk/docs/interfaces/Component.html +2 -2
- package/dist/sdk/docs/interfaces/ConsoleOrShellProps.html +8 -8
- package/dist/sdk/docs/interfaces/DiffPatternInfo.html +1 -1
- package/dist/sdk/docs/interfaces/EditorProps.html +4 -4
- package/dist/sdk/docs/interfaces/ErrorType.html +1 -1
- package/dist/sdk/docs/interfaces/MenuTagProps.html +1 -1
- package/dist/sdk/docs/interfaces/MessageType.html +5 -5
- package/dist/sdk/docs/interfaces/Options.html +8 -8
- package/dist/sdk/docs/interfaces/TreeProps.html +8 -8
- package/dist/sdk/docs/interfaces/UserInfo.html +2 -2
- package/dist/sdk/docs/modules.html +2 -2
- package/dist/style.css +2 -2
- package/package.json +8 -6
package/dist/DaoPaaS.es.js
CHANGED
|
@@ -9287,223 +9287,6 @@ const emitFollowingEditorScroll = (editorScroll) => {
|
|
|
9287
9287
|
(_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("followingEditorScroll", editorScroll);
|
|
9288
9288
|
}
|
|
9289
9289
|
};
|
|
9290
|
-
const instanceOfAny = (object, constructors) => constructors.some((c2) => object instanceof c2);
|
|
9291
|
-
let idbProxyableTypes;
|
|
9292
|
-
let cursorAdvanceMethods;
|
|
9293
|
-
function getIdbProxyableTypes() {
|
|
9294
|
-
return idbProxyableTypes || (idbProxyableTypes = [
|
|
9295
|
-
IDBDatabase,
|
|
9296
|
-
IDBObjectStore,
|
|
9297
|
-
IDBIndex,
|
|
9298
|
-
IDBCursor,
|
|
9299
|
-
IDBTransaction
|
|
9300
|
-
]);
|
|
9301
|
-
}
|
|
9302
|
-
function getCursorAdvanceMethods() {
|
|
9303
|
-
return cursorAdvanceMethods || (cursorAdvanceMethods = [
|
|
9304
|
-
IDBCursor.prototype.advance,
|
|
9305
|
-
IDBCursor.prototype.continue,
|
|
9306
|
-
IDBCursor.prototype.continuePrimaryKey
|
|
9307
|
-
]);
|
|
9308
|
-
}
|
|
9309
|
-
const cursorRequestMap = /* @__PURE__ */ new WeakMap();
|
|
9310
|
-
const transactionDoneMap = /* @__PURE__ */ new WeakMap();
|
|
9311
|
-
const transactionStoreNamesMap = /* @__PURE__ */ new WeakMap();
|
|
9312
|
-
const transformCache = /* @__PURE__ */ new WeakMap();
|
|
9313
|
-
const reverseTransformCache = /* @__PURE__ */ new WeakMap();
|
|
9314
|
-
function promisifyRequest(request) {
|
|
9315
|
-
const promise = new Promise((resolve2, reject) => {
|
|
9316
|
-
const unlisten = () => {
|
|
9317
|
-
request.removeEventListener("success", success);
|
|
9318
|
-
request.removeEventListener("error", error2);
|
|
9319
|
-
};
|
|
9320
|
-
const success = () => {
|
|
9321
|
-
resolve2(wrap(request.result));
|
|
9322
|
-
unlisten();
|
|
9323
|
-
};
|
|
9324
|
-
const error2 = () => {
|
|
9325
|
-
reject(request.error);
|
|
9326
|
-
unlisten();
|
|
9327
|
-
};
|
|
9328
|
-
request.addEventListener("success", success);
|
|
9329
|
-
request.addEventListener("error", error2);
|
|
9330
|
-
});
|
|
9331
|
-
promise.then((value) => {
|
|
9332
|
-
if (value instanceof IDBCursor) {
|
|
9333
|
-
cursorRequestMap.set(value, request);
|
|
9334
|
-
}
|
|
9335
|
-
}).catch(() => {
|
|
9336
|
-
});
|
|
9337
|
-
reverseTransformCache.set(promise, request);
|
|
9338
|
-
return promise;
|
|
9339
|
-
}
|
|
9340
|
-
function cacheDonePromiseForTransaction(tx) {
|
|
9341
|
-
if (transactionDoneMap.has(tx))
|
|
9342
|
-
return;
|
|
9343
|
-
const done = new Promise((resolve2, reject) => {
|
|
9344
|
-
const unlisten = () => {
|
|
9345
|
-
tx.removeEventListener("complete", complete);
|
|
9346
|
-
tx.removeEventListener("error", error2);
|
|
9347
|
-
tx.removeEventListener("abort", error2);
|
|
9348
|
-
};
|
|
9349
|
-
const complete = () => {
|
|
9350
|
-
resolve2();
|
|
9351
|
-
unlisten();
|
|
9352
|
-
};
|
|
9353
|
-
const error2 = () => {
|
|
9354
|
-
reject(tx.error || new DOMException("AbortError", "AbortError"));
|
|
9355
|
-
unlisten();
|
|
9356
|
-
};
|
|
9357
|
-
tx.addEventListener("complete", complete);
|
|
9358
|
-
tx.addEventListener("error", error2);
|
|
9359
|
-
tx.addEventListener("abort", error2);
|
|
9360
|
-
});
|
|
9361
|
-
transactionDoneMap.set(tx, done);
|
|
9362
|
-
}
|
|
9363
|
-
let idbProxyTraps = {
|
|
9364
|
-
get(target, prop, receiver) {
|
|
9365
|
-
if (target instanceof IDBTransaction) {
|
|
9366
|
-
if (prop === "done")
|
|
9367
|
-
return transactionDoneMap.get(target);
|
|
9368
|
-
if (prop === "objectStoreNames") {
|
|
9369
|
-
return target.objectStoreNames || transactionStoreNamesMap.get(target);
|
|
9370
|
-
}
|
|
9371
|
-
if (prop === "store") {
|
|
9372
|
-
return receiver.objectStoreNames[1] ? void 0 : receiver.objectStore(receiver.objectStoreNames[0]);
|
|
9373
|
-
}
|
|
9374
|
-
}
|
|
9375
|
-
return wrap(target[prop]);
|
|
9376
|
-
},
|
|
9377
|
-
set(target, prop, value) {
|
|
9378
|
-
target[prop] = value;
|
|
9379
|
-
return true;
|
|
9380
|
-
},
|
|
9381
|
-
has(target, prop) {
|
|
9382
|
-
if (target instanceof IDBTransaction && (prop === "done" || prop === "store")) {
|
|
9383
|
-
return true;
|
|
9384
|
-
}
|
|
9385
|
-
return prop in target;
|
|
9386
|
-
}
|
|
9387
|
-
};
|
|
9388
|
-
function replaceTraps(callback) {
|
|
9389
|
-
idbProxyTraps = callback(idbProxyTraps);
|
|
9390
|
-
}
|
|
9391
|
-
function wrapFunction(func2) {
|
|
9392
|
-
if (func2 === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype)) {
|
|
9393
|
-
return function(storeNames, ...args) {
|
|
9394
|
-
const tx = func2.call(unwrap(this), storeNames, ...args);
|
|
9395
|
-
transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]);
|
|
9396
|
-
return wrap(tx);
|
|
9397
|
-
};
|
|
9398
|
-
}
|
|
9399
|
-
if (getCursorAdvanceMethods().includes(func2)) {
|
|
9400
|
-
return function(...args) {
|
|
9401
|
-
func2.apply(unwrap(this), args);
|
|
9402
|
-
return wrap(cursorRequestMap.get(this));
|
|
9403
|
-
};
|
|
9404
|
-
}
|
|
9405
|
-
return function(...args) {
|
|
9406
|
-
return wrap(func2.apply(unwrap(this), args));
|
|
9407
|
-
};
|
|
9408
|
-
}
|
|
9409
|
-
function transformCachableValue(value) {
|
|
9410
|
-
if (typeof value === "function")
|
|
9411
|
-
return wrapFunction(value);
|
|
9412
|
-
if (value instanceof IDBTransaction)
|
|
9413
|
-
cacheDonePromiseForTransaction(value);
|
|
9414
|
-
if (instanceOfAny(value, getIdbProxyableTypes()))
|
|
9415
|
-
return new Proxy(value, idbProxyTraps);
|
|
9416
|
-
return value;
|
|
9417
|
-
}
|
|
9418
|
-
function wrap(value) {
|
|
9419
|
-
if (value instanceof IDBRequest)
|
|
9420
|
-
return promisifyRequest(value);
|
|
9421
|
-
if (transformCache.has(value))
|
|
9422
|
-
return transformCache.get(value);
|
|
9423
|
-
const newValue = transformCachableValue(value);
|
|
9424
|
-
if (newValue !== value) {
|
|
9425
|
-
transformCache.set(value, newValue);
|
|
9426
|
-
reverseTransformCache.set(newValue, value);
|
|
9427
|
-
}
|
|
9428
|
-
return newValue;
|
|
9429
|
-
}
|
|
9430
|
-
const unwrap = (value) => reverseTransformCache.get(value);
|
|
9431
|
-
function openDB(name, version, { blocked, upgrade, blocking, terminated } = {}) {
|
|
9432
|
-
const request = indexedDB.open(name, version);
|
|
9433
|
-
const openPromise = wrap(request);
|
|
9434
|
-
if (upgrade) {
|
|
9435
|
-
request.addEventListener("upgradeneeded", (event) => {
|
|
9436
|
-
upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction));
|
|
9437
|
-
});
|
|
9438
|
-
}
|
|
9439
|
-
if (blocked)
|
|
9440
|
-
request.addEventListener("blocked", () => blocked());
|
|
9441
|
-
openPromise.then((db2) => {
|
|
9442
|
-
if (terminated)
|
|
9443
|
-
db2.addEventListener("close", () => terminated());
|
|
9444
|
-
if (blocking)
|
|
9445
|
-
db2.addEventListener("versionchange", () => blocking());
|
|
9446
|
-
}).catch(() => {
|
|
9447
|
-
});
|
|
9448
|
-
return openPromise;
|
|
9449
|
-
}
|
|
9450
|
-
const readMethods = ["get", "getKey", "getAll", "getAllKeys", "count"];
|
|
9451
|
-
const writeMethods = ["put", "add", "delete", "clear"];
|
|
9452
|
-
const cachedMethods = /* @__PURE__ */ new Map();
|
|
9453
|
-
function getMethod(target, prop) {
|
|
9454
|
-
if (!(target instanceof IDBDatabase && !(prop in target) && typeof prop === "string")) {
|
|
9455
|
-
return;
|
|
9456
|
-
}
|
|
9457
|
-
if (cachedMethods.get(prop))
|
|
9458
|
-
return cachedMethods.get(prop);
|
|
9459
|
-
const targetFuncName = prop.replace(/FromIndex$/, "");
|
|
9460
|
-
const useIndex = prop !== targetFuncName;
|
|
9461
|
-
const isWrite = writeMethods.includes(targetFuncName);
|
|
9462
|
-
if (!(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || !(isWrite || readMethods.includes(targetFuncName))) {
|
|
9463
|
-
return;
|
|
9464
|
-
}
|
|
9465
|
-
const method = async function(storeName, ...args) {
|
|
9466
|
-
const tx = this.transaction(storeName, isWrite ? "readwrite" : "readonly");
|
|
9467
|
-
let target2 = tx.store;
|
|
9468
|
-
if (useIndex)
|
|
9469
|
-
target2 = target2.index(args.shift());
|
|
9470
|
-
return (await Promise.all([
|
|
9471
|
-
target2[targetFuncName](...args),
|
|
9472
|
-
isWrite && tx.done
|
|
9473
|
-
]))[0];
|
|
9474
|
-
};
|
|
9475
|
-
cachedMethods.set(prop, method);
|
|
9476
|
-
return method;
|
|
9477
|
-
}
|
|
9478
|
-
replaceTraps((oldTraps) => __spreadProps(__spreadValues({}, oldTraps), {
|
|
9479
|
-
get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),
|
|
9480
|
-
has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop)
|
|
9481
|
-
}));
|
|
9482
|
-
const daopaasDB = async () => {
|
|
9483
|
-
return openDB("daopaas", 1, {
|
|
9484
|
-
upgrade(db2) {
|
|
9485
|
-
db2.createObjectStore("crdts");
|
|
9486
|
-
db2.createObjectStore("targetFiles");
|
|
9487
|
-
db2.createObjectStore("originFiles");
|
|
9488
|
-
db2.createObjectStore("users");
|
|
9489
|
-
}
|
|
9490
|
-
});
|
|
9491
|
-
};
|
|
9492
|
-
async function setReplaySource(val) {
|
|
9493
|
-
daoStore.getState();
|
|
9494
|
-
}
|
|
9495
|
-
async function getLocalFile(key) {
|
|
9496
|
-
return (await daopaasDB()).get("targetFiles", key);
|
|
9497
|
-
}
|
|
9498
|
-
async function setLocalFile(key, val) {
|
|
9499
|
-
return (await daopaasDB()).put("targetFiles", val, key);
|
|
9500
|
-
}
|
|
9501
|
-
async function getLocalReplayFile(key) {
|
|
9502
|
-
return (await daopaasDB()).get("originFiles", key);
|
|
9503
|
-
}
|
|
9504
|
-
async function setLocalReplayFile(key, val) {
|
|
9505
|
-
return (await daopaasDB()).put("originFiles", val, key);
|
|
9506
|
-
}
|
|
9507
9290
|
const onConnect = () => {
|
|
9508
9291
|
var _a2;
|
|
9509
9292
|
let heartbeatInterval = null;
|
|
@@ -9640,20 +9423,8 @@ const onLspStatus = () => {
|
|
|
9640
9423
|
const onFolderEvent = () => {
|
|
9641
9424
|
var _a2;
|
|
9642
9425
|
(_a2 = useOT.getState().socket) == null ? void 0 : _a2.on("folderEvent", async (data) => {
|
|
9643
|
-
var _a3;
|
|
9644
9426
|
const { setCRDTInfo } = daoStore.getState();
|
|
9645
9427
|
setCRDTInfo(data);
|
|
9646
|
-
setReplaySource(__spreadProps(__spreadValues({}, data), {
|
|
9647
|
-
event: "file"
|
|
9648
|
-
}));
|
|
9649
|
-
const localReplayFile = await getLocalReplayFile(data.file.path);
|
|
9650
|
-
if (!localReplayFile) {
|
|
9651
|
-
setLocalReplayFile((_a3 = data == null ? void 0 : data.file) == null ? void 0 : _a3.path, {
|
|
9652
|
-
value: data.file.value,
|
|
9653
|
-
revision: 0,
|
|
9654
|
-
path: data.file.path
|
|
9655
|
-
});
|
|
9656
|
-
}
|
|
9657
9428
|
});
|
|
9658
9429
|
};
|
|
9659
9430
|
const onFileContent = () => {
|
|
@@ -9663,17 +9434,6 @@ const onFileContent = () => {
|
|
|
9663
9434
|
const file = data.file;
|
|
9664
9435
|
const { agentUsers, agentUserId } = playgroundInfo;
|
|
9665
9436
|
setCRDTInfo(data);
|
|
9666
|
-
setReplaySource(__spreadProps(__spreadValues({}, data), {
|
|
9667
|
-
event: "file"
|
|
9668
|
-
}));
|
|
9669
|
-
const localReplayFile = await getLocalReplayFile(file.path);
|
|
9670
|
-
if (!localReplayFile) {
|
|
9671
|
-
setLocalReplayFile(file.path, {
|
|
9672
|
-
value: file.value,
|
|
9673
|
-
path: file.path,
|
|
9674
|
-
revision: 0
|
|
9675
|
-
});
|
|
9676
|
-
}
|
|
9677
9437
|
const currentAgentUser = getCurrentAgentUser();
|
|
9678
9438
|
if (data.agentUserId === agentUserId || currentAgentUser.followingAgentUserId === data.agentUserId) {
|
|
9679
9439
|
currentDoc$1.getState().switchDoc(file);
|
|
@@ -9741,9 +9501,6 @@ const onConsole = () => {
|
|
|
9741
9501
|
const { setCRDTInfo } = daoStore.getState();
|
|
9742
9502
|
(_a2 = useOT.getState().socket) == null ? void 0 : _a2.on("console", (data) => {
|
|
9743
9503
|
setCRDTInfo(data);
|
|
9744
|
-
setReplaySource(__spreadProps(__spreadValues({}, data), {
|
|
9745
|
-
event: "console"
|
|
9746
|
-
}));
|
|
9747
9504
|
});
|
|
9748
9505
|
};
|
|
9749
9506
|
const onErrorHandler = () => {
|
|
@@ -11127,7 +10884,7 @@ var ThemeContext = /* @__PURE__ */ react.exports.createContext({});
|
|
|
11127
10884
|
React$1["useInsertionEffect"] ? React$1["useInsertionEffect"] : function useInsertionEffect(create2) {
|
|
11128
10885
|
create2();
|
|
11129
10886
|
};
|
|
11130
|
-
var isBrowser = true;
|
|
10887
|
+
var isBrowser$3 = true;
|
|
11131
10888
|
function getRegisteredStyles(registered, registeredStyles, classNames2) {
|
|
11132
10889
|
var rawClassName = "";
|
|
11133
10890
|
classNames2.split(" ").forEach(function(className) {
|
|
@@ -11141,7 +10898,7 @@ function getRegisteredStyles(registered, registeredStyles, classNames2) {
|
|
|
11141
10898
|
}
|
|
11142
10899
|
var registerStyles = function registerStyles2(cache2, serialized, isStringTag) {
|
|
11143
10900
|
var className = cache2.key + "-" + serialized.name;
|
|
11144
|
-
if ((isStringTag === false || isBrowser === false) && cache2.registered[className] === void 0) {
|
|
10901
|
+
if ((isStringTag === false || isBrowser$3 === false) && cache2.registered[className] === void 0) {
|
|
11145
10902
|
cache2.registered[className] = serialized.styles;
|
|
11146
10903
|
}
|
|
11147
10904
|
};
|
|
@@ -11894,7 +11651,7 @@ const Loading = () => {
|
|
|
11894
11651
|
});
|
|
11895
11652
|
};
|
|
11896
11653
|
const agentUserColorSetter = (index2) => ["#d904c7", "#49cf5b", "#D9C589", "#F27B13", "#A0D9D9", "#45858C", "#8C311C", "#4A5B8C", "#8C4F2B", "#34401A", "#CAD959", "#0476D9"][index2];
|
|
11897
|
-
var index$
|
|
11654
|
+
var index$7 = "";
|
|
11898
11655
|
const ignoreReplayerStore = create$2((set) => ({
|
|
11899
11656
|
ignoreReplayers: [],
|
|
11900
11657
|
setIgnoreReplayer: (arg) => set(() => ({
|
|
@@ -15831,7 +15588,7 @@ var lodash$2 = { exports: {} };
|
|
|
15831
15588
|
return apply2(func2, this, otherArgs);
|
|
15832
15589
|
});
|
|
15833
15590
|
}
|
|
15834
|
-
function
|
|
15591
|
+
function throttle2(func2, wait, options) {
|
|
15835
15592
|
var leading = true, trailing = true;
|
|
15836
15593
|
if (typeof func2 != "function") {
|
|
15837
15594
|
throw new TypeError2(FUNC_ERROR_TEXT2);
|
|
@@ -15849,7 +15606,7 @@ var lodash$2 = { exports: {} };
|
|
|
15849
15606
|
function unary(func2) {
|
|
15850
15607
|
return ary(func2, 1);
|
|
15851
15608
|
}
|
|
15852
|
-
function
|
|
15609
|
+
function wrap(value, wrapper) {
|
|
15853
15610
|
return partial(castFunction(wrapper), value);
|
|
15854
15611
|
}
|
|
15855
15612
|
function castArray() {
|
|
@@ -16945,7 +16702,7 @@ var lodash$2 = { exports: {} };
|
|
|
16945
16702
|
lodash2.takeRightWhile = takeRightWhile;
|
|
16946
16703
|
lodash2.takeWhile = takeWhile;
|
|
16947
16704
|
lodash2.tap = tap;
|
|
16948
|
-
lodash2.throttle =
|
|
16705
|
+
lodash2.throttle = throttle2;
|
|
16949
16706
|
lodash2.thru = thru;
|
|
16950
16707
|
lodash2.toArray = toArray;
|
|
16951
16708
|
lodash2.toPairs = toPairs;
|
|
@@ -16969,7 +16726,7 @@ var lodash$2 = { exports: {} };
|
|
|
16969
16726
|
lodash2.valuesIn = valuesIn;
|
|
16970
16727
|
lodash2.without = without;
|
|
16971
16728
|
lodash2.words = words2;
|
|
16972
|
-
lodash2.wrap =
|
|
16729
|
+
lodash2.wrap = wrap;
|
|
16973
16730
|
lodash2.xor = xor;
|
|
16974
16731
|
lodash2.xorBy = xorBy;
|
|
16975
16732
|
lodash2.xorWith = xorWith;
|
|
@@ -17314,10 +17071,10 @@ var lodash$2 = { exports: {} };
|
|
|
17314
17071
|
})(lodash$2, lodash$2.exports);
|
|
17315
17072
|
let activeTimer;
|
|
17316
17073
|
const LazyTreeComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
17317
|
-
return index$
|
|
17074
|
+
return index$6;
|
|
17318
17075
|
})).FileTree);
|
|
17319
17076
|
const LazyEditorComponent$1 = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
17320
|
-
return index$
|
|
17077
|
+
return index$5;
|
|
17321
17078
|
})).Editor);
|
|
17322
17079
|
const LazyConsoleComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
17323
17080
|
return index$3;
|
|
@@ -17552,7 +17309,7 @@ class DaoPaaS {
|
|
|
17552
17309
|
return daoStore.getState();
|
|
17553
17310
|
}
|
|
17554
17311
|
async init() {
|
|
17555
|
-
const SDK_VERSION = "0.8.
|
|
17312
|
+
const SDK_VERSION = "0.8.3";
|
|
17556
17313
|
const {
|
|
17557
17314
|
setSocket
|
|
17558
17315
|
} = useOT.getState();
|
|
@@ -17644,6 +17401,12 @@ class DaoPaaS {
|
|
|
17644
17401
|
components == null ? void 0 : components.forEach((arg, _index) => {
|
|
17645
17402
|
const omitObj = lodash$2.exports.omit(__spreadValues({}, arg), ["item", "container"]);
|
|
17646
17403
|
switch (arg.item) {
|
|
17404
|
+
case "Page":
|
|
17405
|
+
this.Page({
|
|
17406
|
+
container: arg.container,
|
|
17407
|
+
props: arg.props || omitObj
|
|
17408
|
+
});
|
|
17409
|
+
break;
|
|
17647
17410
|
case "Tree":
|
|
17648
17411
|
this.Tree({
|
|
17649
17412
|
container: arg.container,
|
|
@@ -153033,7 +152796,7 @@ var ResizeObserverSize = function() {
|
|
|
153033
152796
|
}
|
|
153034
152797
|
return ResizeObserverSize2;
|
|
153035
152798
|
}();
|
|
153036
|
-
var DOMRectReadOnly = function() {
|
|
152799
|
+
var DOMRectReadOnly$1 = function() {
|
|
153037
152800
|
function DOMRectReadOnly2(x2, y2, width, height) {
|
|
153038
152801
|
this.x = x2;
|
|
153039
152802
|
this.y = y2;
|
|
@@ -153090,11 +152853,11 @@ var isReplacedElement = function(target) {
|
|
|
153090
152853
|
}
|
|
153091
152854
|
return false;
|
|
153092
152855
|
};
|
|
153093
|
-
var global$
|
|
152856
|
+
var global$2 = typeof window !== "undefined" ? window : {};
|
|
153094
152857
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
153095
152858
|
var scrollRegexp = /auto|scroll/;
|
|
153096
152859
|
var verticalRegexp = /^tb|vertical/;
|
|
153097
|
-
var IE = /msie|trident/i.test(global$
|
|
152860
|
+
var IE = /msie|trident/i.test(global$2.navigator && global$2.navigator.userAgent);
|
|
153098
152861
|
var parseDimension = function(pixel) {
|
|
153099
152862
|
return parseFloat(pixel || "0");
|
|
153100
152863
|
};
|
|
@@ -153114,7 +152877,7 @@ var zeroBoxes = freeze({
|
|
|
153114
152877
|
devicePixelContentBoxSize: size(),
|
|
153115
152878
|
borderBoxSize: size(),
|
|
153116
152879
|
contentBoxSize: size(),
|
|
153117
|
-
contentRect: new DOMRectReadOnly(0, 0, 0, 0)
|
|
152880
|
+
contentRect: new DOMRectReadOnly$1(0, 0, 0, 0)
|
|
153118
152881
|
});
|
|
153119
152882
|
var calculateBoxSizes = function(target, forceRecalculation) {
|
|
153120
152883
|
if (forceRecalculation === void 0) {
|
|
@@ -153157,7 +152920,7 @@ var calculateBoxSizes = function(target, forceRecalculation) {
|
|
|
153157
152920
|
devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
|
|
153158
152921
|
borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes),
|
|
153159
152922
|
contentBoxSize: size(contentWidth, contentHeight, switchSizes),
|
|
153160
|
-
contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight)
|
|
152923
|
+
contentRect: new DOMRectReadOnly$1(paddingLeft, paddingTop, contentWidth, contentHeight)
|
|
153161
152924
|
});
|
|
153162
152925
|
cache.set(target, boxes);
|
|
153163
152926
|
return boxes;
|
|
@@ -153173,7 +152936,7 @@ var calculateBoxSize = function(target, observedBox, forceRecalculation) {
|
|
|
153173
152936
|
return contentBoxSize;
|
|
153174
152937
|
}
|
|
153175
152938
|
};
|
|
153176
|
-
var ResizeObserverEntry = function() {
|
|
152939
|
+
var ResizeObserverEntry$1 = function() {
|
|
153177
152940
|
function ResizeObserverEntry2(target) {
|
|
153178
152941
|
var boxes = calculateBoxSizes(target);
|
|
153179
152942
|
this.target = target;
|
|
@@ -153205,7 +152968,7 @@ var broadcastActiveObservations = function() {
|
|
|
153205
152968
|
}
|
|
153206
152969
|
var entries = [];
|
|
153207
152970
|
ro2.activeTargets.forEach(function processTarget(ot2) {
|
|
153208
|
-
var entry = new ResizeObserverEntry(ot2.target);
|
|
152971
|
+
var entry = new ResizeObserverEntry$1(ot2.target);
|
|
153209
152972
|
var targetDepth = calculateDepthForNode(ot2.target);
|
|
153210
152973
|
entries.push(entry);
|
|
153211
152974
|
ot2.lastReportedSize = calculateBoxSize(ot2.target, ot2.observedBox);
|
|
@@ -153354,7 +153117,7 @@ var Scheduler = function() {
|
|
|
153354
153117
|
var cb2 = function() {
|
|
153355
153118
|
return _this.observer && _this.observer.observe(document.body, observerConfig);
|
|
153356
153119
|
};
|
|
153357
|
-
document.body ? cb2() : global$
|
|
153120
|
+
document.body ? cb2() : global$2.addEventListener("DOMContentLoaded", cb2);
|
|
153358
153121
|
};
|
|
153359
153122
|
Scheduler2.prototype.start = function() {
|
|
153360
153123
|
var _this = this;
|
|
@@ -153363,7 +153126,7 @@ var Scheduler = function() {
|
|
|
153363
153126
|
this.observer = new MutationObserver(this.listener);
|
|
153364
153127
|
this.observe();
|
|
153365
153128
|
events$2.forEach(function(name) {
|
|
153366
|
-
return global$
|
|
153129
|
+
return global$2.addEventListener(name, _this.listener, true);
|
|
153367
153130
|
});
|
|
153368
153131
|
}
|
|
153369
153132
|
};
|
|
@@ -153372,7 +153135,7 @@ var Scheduler = function() {
|
|
|
153372
153135
|
if (!this.stopped) {
|
|
153373
153136
|
this.observer && this.observer.disconnect();
|
|
153374
153137
|
events$2.forEach(function(name) {
|
|
153375
|
-
return global$
|
|
153138
|
+
return global$2.removeEventListener(name, _this.listener, true);
|
|
153376
153139
|
});
|
|
153377
153140
|
this.stopped = true;
|
|
153378
153141
|
}
|
|
@@ -153388,7 +153151,7 @@ var updateCount = function(n2) {
|
|
|
153388
153151
|
var skipNotifyOnElement = function(target) {
|
|
153389
153152
|
return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
|
|
153390
153153
|
};
|
|
153391
|
-
var ResizeObservation = function() {
|
|
153154
|
+
var ResizeObservation$1 = function() {
|
|
153392
153155
|
function ResizeObservation2(target, observedBox) {
|
|
153393
153156
|
this.target = target;
|
|
153394
153157
|
this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;
|
|
@@ -153428,7 +153191,7 @@ var getObservationIndex = function(observationTargets, target) {
|
|
|
153428
153191
|
}
|
|
153429
153192
|
return -1;
|
|
153430
153193
|
};
|
|
153431
|
-
var ResizeObserverController = function() {
|
|
153194
|
+
var ResizeObserverController$1 = function() {
|
|
153432
153195
|
function ResizeObserverController2() {
|
|
153433
153196
|
}
|
|
153434
153197
|
ResizeObserverController2.connect = function(resizeObserver, callback) {
|
|
@@ -153440,7 +153203,7 @@ var ResizeObserverController = function() {
|
|
|
153440
153203
|
var firstObservation = detail.observationTargets.length === 0;
|
|
153441
153204
|
if (getObservationIndex(detail.observationTargets, target) < 0) {
|
|
153442
153205
|
firstObservation && resizeObservers.push(detail);
|
|
153443
|
-
detail.observationTargets.push(new ResizeObservation(target, options && options.box));
|
|
153206
|
+
detail.observationTargets.push(new ResizeObservation$1(target, options && options.box));
|
|
153444
153207
|
updateCount(1);
|
|
153445
153208
|
scheduler.schedule();
|
|
153446
153209
|
}
|
|
@@ -153465,7 +153228,7 @@ var ResizeObserverController = function() {
|
|
|
153465
153228
|
};
|
|
153466
153229
|
return ResizeObserverController2;
|
|
153467
153230
|
}();
|
|
153468
|
-
var ResizeObserver$
|
|
153231
|
+
var ResizeObserver$2 = function() {
|
|
153469
153232
|
function ResizeObserver2(callback) {
|
|
153470
153233
|
if (arguments.length === 0) {
|
|
153471
153234
|
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
|
@@ -153473,7 +153236,7 @@ var ResizeObserver$1 = function() {
|
|
|
153473
153236
|
if (typeof callback !== "function") {
|
|
153474
153237
|
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
|
153475
153238
|
}
|
|
153476
|
-
ResizeObserverController.connect(this, callback);
|
|
153239
|
+
ResizeObserverController$1.connect(this, callback);
|
|
153477
153240
|
}
|
|
153478
153241
|
ResizeObserver2.prototype.observe = function(target, options) {
|
|
153479
153242
|
if (arguments.length === 0) {
|
|
@@ -153482,7 +153245,7 @@ var ResizeObserver$1 = function() {
|
|
|
153482
153245
|
if (!isElement$2(target)) {
|
|
153483
153246
|
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
153484
153247
|
}
|
|
153485
|
-
ResizeObserverController.observe(this, target, options);
|
|
153248
|
+
ResizeObserverController$1.observe(this, target, options);
|
|
153486
153249
|
};
|
|
153487
153250
|
ResizeObserver2.prototype.unobserve = function(target) {
|
|
153488
153251
|
if (arguments.length === 0) {
|
|
@@ -153491,10 +153254,10 @@ var ResizeObserver$1 = function() {
|
|
|
153491
153254
|
if (!isElement$2(target)) {
|
|
153492
153255
|
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
|
153493
153256
|
}
|
|
153494
|
-
ResizeObserverController.unobserve(this, target);
|
|
153257
|
+
ResizeObserverController$1.unobserve(this, target);
|
|
153495
153258
|
};
|
|
153496
153259
|
ResizeObserver2.prototype.disconnect = function() {
|
|
153497
|
-
ResizeObserverController.disconnect(this);
|
|
153260
|
+
ResizeObserverController$1.disconnect(this);
|
|
153498
153261
|
};
|
|
153499
153262
|
ResizeObserver2.toString = function() {
|
|
153500
153263
|
return "function ResizeObserver () { [polyfill code] }";
|
|
@@ -154237,7 +154000,7 @@ var usePosition = function usePosition2(props, ref) {
|
|
|
154237
154000
|
return updatePosition(true, true);
|
|
154238
154001
|
});
|
|
154239
154002
|
if (overlay) {
|
|
154240
|
-
overlayResizeObserver.current = new ResizeObserver$
|
|
154003
|
+
overlayResizeObserver.current = new ResizeObserver$2(function() {
|
|
154241
154004
|
return updatePosition(true, true);
|
|
154242
154005
|
});
|
|
154243
154006
|
overlayResizeObserver.current.observe(overlay);
|
|
@@ -159276,7 +159039,7 @@ const FileTree = ({
|
|
|
159276
159039
|
})]
|
|
159277
159040
|
});
|
|
159278
159041
|
};
|
|
159279
|
-
var index$
|
|
159042
|
+
var index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
159280
159043
|
__proto__: null,
|
|
159281
159044
|
getStringFromFile,
|
|
159282
159045
|
FileTree
|
|
@@ -160357,7 +160120,7 @@ EventEmitter$1.prototype.removeAllListeners = function removeAllListeners(type)
|
|
|
160357
160120
|
}
|
|
160358
160121
|
return this;
|
|
160359
160122
|
};
|
|
160360
|
-
function _listeners(target, type,
|
|
160123
|
+
function _listeners(target, type, unwrap) {
|
|
160361
160124
|
var events2 = target._events;
|
|
160362
160125
|
if (events2 === void 0)
|
|
160363
160126
|
return [];
|
|
@@ -160365,8 +160128,8 @@ function _listeners(target, type, unwrap2) {
|
|
|
160365
160128
|
if (evlistener === void 0)
|
|
160366
160129
|
return [];
|
|
160367
160130
|
if (typeof evlistener === "function")
|
|
160368
|
-
return
|
|
160369
|
-
return
|
|
160131
|
+
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
|
160132
|
+
return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
|
160370
160133
|
}
|
|
160371
160134
|
EventEmitter$1.prototype.listeners = function listeners(type) {
|
|
160372
160135
|
return _listeners(this, type, true);
|
|
@@ -164600,7 +164363,7 @@ function __values$1(o) {
|
|
|
164600
164363
|
}
|
|
164601
164364
|
};
|
|
164602
164365
|
}
|
|
164603
|
-
function __read(o, n2) {
|
|
164366
|
+
function __read$2(o, n2) {
|
|
164604
164367
|
var m2 = typeof Symbol === "function" && o[Symbol.iterator];
|
|
164605
164368
|
if (!m2)
|
|
164606
164369
|
return o;
|
|
@@ -164623,7 +164386,7 @@ function __read(o, n2) {
|
|
|
164623
164386
|
}
|
|
164624
164387
|
function __spread() {
|
|
164625
164388
|
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
164626
|
-
ar = ar.concat(__read(arguments[i]));
|
|
164389
|
+
ar = ar.concat(__read$2(arguments[i]));
|
|
164627
164390
|
return ar;
|
|
164628
164391
|
}
|
|
164629
164392
|
var Event = function() {
|
|
@@ -177548,10 +177311,6 @@ const Editor = ({
|
|
|
177548
177311
|
var _a2;
|
|
177549
177312
|
const applyDoc = currentDoc$1.getState().doc;
|
|
177550
177313
|
client.applyClient(operation);
|
|
177551
|
-
setLocalFile((applyDoc == null ? void 0 : applyDoc.path) ? applyDoc == null ? void 0 : applyDoc.path : "singleFile", {
|
|
177552
|
-
value: editor.getModel().getValue(editor$1.EndOfLinePreference.LF),
|
|
177553
|
-
revision: client.revision
|
|
177554
|
-
});
|
|
177555
177314
|
if ((_a2 = applyDoc == null ? void 0 : applyDoc.path) == null ? void 0 : _a2.includes("md")) {
|
|
177556
177315
|
setMarkdownVal(editor.getModel().getValue(editor$1.EndOfLinePreference.LF));
|
|
177557
177316
|
}
|
|
@@ -177672,10 +177431,6 @@ const Editor = ({
|
|
|
177672
177431
|
revision: client.revision,
|
|
177673
177432
|
value: file2.value
|
|
177674
177433
|
});
|
|
177675
|
-
daoStore.getState().amDoing !== "replaying" && setLocalFile(file2 == null ? void 0 : file2.path, {
|
|
177676
|
-
value: file2.value,
|
|
177677
|
-
revision: client.revision
|
|
177678
|
-
});
|
|
177679
177434
|
}
|
|
177680
177435
|
}, true);
|
|
177681
177436
|
}
|
|
@@ -177762,7 +177517,7 @@ const Editor = ({
|
|
|
177762
177517
|
}, [clientEditor]);
|
|
177763
177518
|
react.exports.useEffect(() => {
|
|
177764
177519
|
io == null ? void 0 : io.on("editFile", async (d2) => {
|
|
177765
|
-
var _a2, _b2
|
|
177520
|
+
var _a2, _b2;
|
|
177766
177521
|
const _d2 = d2;
|
|
177767
177522
|
if ((_b2 = editor == null ? void 0 : editor.getModel()) == null ? void 0 : _b2.uri.path.includes((_a2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _a2.path)) {
|
|
177768
177523
|
client.applyServer(TextOperation.fromJSON(_d2.editor.operation));
|
|
@@ -177782,33 +177537,15 @@ const Editor = ({
|
|
|
177782
177537
|
}, 100);
|
|
177783
177538
|
}
|
|
177784
177539
|
setCRDTInfo(_d2);
|
|
177785
|
-
setReplaySource(__spreadProps(__spreadValues({}, _d2), {
|
|
177786
|
-
event: "editor",
|
|
177787
|
-
editor: __spreadProps(__spreadValues({}, _d2.editor), {
|
|
177788
|
-
revision: (_c2 = _d2.editor) == null ? void 0 : _c2.revision
|
|
177789
|
-
})
|
|
177790
|
-
}));
|
|
177791
177540
|
});
|
|
177792
177541
|
io == null ? void 0 : io.on("serverAck", async (d2) => {
|
|
177793
|
-
var _a2, _b2
|
|
177542
|
+
var _a2, _b2;
|
|
177794
177543
|
const _d2 = d2;
|
|
177795
177544
|
client.serverAck();
|
|
177796
177545
|
setCRDTInfo(_d2);
|
|
177797
177546
|
docServer.set((_a2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _a2.path, __spreadProps(__spreadValues({}, docServer.get((_b2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _b2.path)), {
|
|
177798
177547
|
operation: client.operation
|
|
177799
177548
|
}));
|
|
177800
|
-
const file2 = await getLocalReplayFile(_d2.file.path);
|
|
177801
|
-
setLocalReplayFile((_c2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _c2.path, {
|
|
177802
|
-
value: file2.value,
|
|
177803
|
-
revision: file2.revision + 1,
|
|
177804
|
-
path: _d2.file.path
|
|
177805
|
-
});
|
|
177806
|
-
setReplaySource(__spreadProps(__spreadValues({}, _d2), {
|
|
177807
|
-
event: "editor",
|
|
177808
|
-
editor: __spreadProps(__spreadValues({}, _d2.editor), {
|
|
177809
|
-
revision: (_d3 = _d2.editor) == null ? void 0 : _d3.revision
|
|
177810
|
-
})
|
|
177811
|
-
}));
|
|
177812
177549
|
return;
|
|
177813
177550
|
});
|
|
177814
177551
|
io == null ? void 0 : io.on("selection", async (_d2) => {
|
|
@@ -177877,14 +177614,7 @@ const Editor = ({
|
|
|
177877
177614
|
APP_DIR = (_a2 = dockerInfo == null ? void 0 : dockerInfo.lspRoot) != null ? _a2 : "";
|
|
177878
177615
|
}, [dockerInfo == null ? void 0 : dockerInfo.lspRoot]);
|
|
177879
177616
|
react.exports.useEffect(() => {
|
|
177880
|
-
|
|
177881
|
-
amDoing: amDoing2
|
|
177882
|
-
} = daoStore.getState();
|
|
177883
|
-
if (amDoing2 === "replaying") {
|
|
177884
|
-
getLocalFile(CRDTInfo.file.path).then((d2) => {
|
|
177885
|
-
editor.setValue(d2.value);
|
|
177886
|
-
});
|
|
177887
|
-
}
|
|
177617
|
+
daoStore.getState();
|
|
177888
177618
|
}, [CRDTInfo]);
|
|
177889
177619
|
react.exports.useEffect(() => {
|
|
177890
177620
|
}, [fileTree]);
|
|
@@ -177922,7 +177652,7 @@ const Editor = ({
|
|
|
177922
177652
|
})]
|
|
177923
177653
|
});
|
|
177924
177654
|
};
|
|
177925
|
-
var index$
|
|
177655
|
+
var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
177926
177656
|
__proto__: null,
|
|
177927
177657
|
Editor
|
|
177928
177658
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -185065,6 +184795,645 @@ var xterm = { exports: {} };
|
|
|
185065
184795
|
})();
|
|
185066
184796
|
});
|
|
185067
184797
|
})(xterm);
|
|
184798
|
+
function depsAreSame(oldDeps, deps) {
|
|
184799
|
+
if (oldDeps === deps)
|
|
184800
|
+
return true;
|
|
184801
|
+
for (var i = 0; i < oldDeps.length; i++) {
|
|
184802
|
+
if (!Object.is(oldDeps[i], deps[i]))
|
|
184803
|
+
return false;
|
|
184804
|
+
}
|
|
184805
|
+
return true;
|
|
184806
|
+
}
|
|
184807
|
+
function useLatest(value) {
|
|
184808
|
+
var ref = react.exports.useRef(value);
|
|
184809
|
+
ref.current = value;
|
|
184810
|
+
return ref;
|
|
184811
|
+
}
|
|
184812
|
+
var useUnmount = function useUnmount2(fn) {
|
|
184813
|
+
var fnRef = useLatest(fn);
|
|
184814
|
+
react.exports.useEffect(function() {
|
|
184815
|
+
return function() {
|
|
184816
|
+
fnRef.current();
|
|
184817
|
+
};
|
|
184818
|
+
}, []);
|
|
184819
|
+
};
|
|
184820
|
+
var useUnmount$1 = useUnmount;
|
|
184821
|
+
var isBrowser$1 = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
184822
|
+
var isBrowser$2 = isBrowser$1;
|
|
184823
|
+
function getTargetElement(target, defaultElement) {
|
|
184824
|
+
if (!isBrowser$2) {
|
|
184825
|
+
return void 0;
|
|
184826
|
+
}
|
|
184827
|
+
if (!target) {
|
|
184828
|
+
return defaultElement;
|
|
184829
|
+
}
|
|
184830
|
+
var targetElement;
|
|
184831
|
+
if (typeof target === "function") {
|
|
184832
|
+
targetElement = target();
|
|
184833
|
+
} else if ("current" in target) {
|
|
184834
|
+
targetElement = target.current;
|
|
184835
|
+
} else {
|
|
184836
|
+
targetElement = target;
|
|
184837
|
+
}
|
|
184838
|
+
return targetElement;
|
|
184839
|
+
}
|
|
184840
|
+
var createEffectWithTarget = function createEffectWithTarget2(useEffectType) {
|
|
184841
|
+
var useEffectWithTarget2 = function useEffectWithTarget3(effect, deps, target) {
|
|
184842
|
+
var hasInitRef = react.exports.useRef(false);
|
|
184843
|
+
var lastElementRef = react.exports.useRef([]);
|
|
184844
|
+
var lastDepsRef = react.exports.useRef([]);
|
|
184845
|
+
var unLoadRef = react.exports.useRef();
|
|
184846
|
+
useEffectType(function() {
|
|
184847
|
+
var _a2;
|
|
184848
|
+
var targets = Array.isArray(target) ? target : [target];
|
|
184849
|
+
var els = targets.map(function(item) {
|
|
184850
|
+
return getTargetElement(item);
|
|
184851
|
+
});
|
|
184852
|
+
if (!hasInitRef.current) {
|
|
184853
|
+
hasInitRef.current = true;
|
|
184854
|
+
lastElementRef.current = els;
|
|
184855
|
+
lastDepsRef.current = deps;
|
|
184856
|
+
unLoadRef.current = effect();
|
|
184857
|
+
return;
|
|
184858
|
+
}
|
|
184859
|
+
if (els.length !== lastElementRef.current.length || !depsAreSame(els, lastElementRef.current) || !depsAreSame(deps, lastDepsRef.current)) {
|
|
184860
|
+
(_a2 = unLoadRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(unLoadRef);
|
|
184861
|
+
lastElementRef.current = els;
|
|
184862
|
+
lastDepsRef.current = deps;
|
|
184863
|
+
unLoadRef.current = effect();
|
|
184864
|
+
}
|
|
184865
|
+
});
|
|
184866
|
+
useUnmount$1(function() {
|
|
184867
|
+
var _a2;
|
|
184868
|
+
(_a2 = unLoadRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(unLoadRef);
|
|
184869
|
+
hasInitRef.current = false;
|
|
184870
|
+
});
|
|
184871
|
+
};
|
|
184872
|
+
return useEffectWithTarget2;
|
|
184873
|
+
};
|
|
184874
|
+
var createEffectWithTarget$1 = createEffectWithTarget;
|
|
184875
|
+
var useEffectWithTarget$1 = createEffectWithTarget$1(react.exports.useEffect);
|
|
184876
|
+
var useEffectWithTarget$2 = useEffectWithTarget$1;
|
|
184877
|
+
var __read$1 = globalThis && globalThis.__read || function(o, n2) {
|
|
184878
|
+
var m2 = typeof Symbol === "function" && o[Symbol.iterator];
|
|
184879
|
+
if (!m2)
|
|
184880
|
+
return o;
|
|
184881
|
+
var i = m2.call(o), r2, ar = [], e2;
|
|
184882
|
+
try {
|
|
184883
|
+
while ((n2 === void 0 || n2-- > 0) && !(r2 = i.next()).done) {
|
|
184884
|
+
ar.push(r2.value);
|
|
184885
|
+
}
|
|
184886
|
+
} catch (error2) {
|
|
184887
|
+
e2 = {
|
|
184888
|
+
error: error2
|
|
184889
|
+
};
|
|
184890
|
+
} finally {
|
|
184891
|
+
try {
|
|
184892
|
+
if (r2 && !r2.done && (m2 = i["return"]))
|
|
184893
|
+
m2.call(i);
|
|
184894
|
+
} finally {
|
|
184895
|
+
if (e2)
|
|
184896
|
+
throw e2.error;
|
|
184897
|
+
}
|
|
184898
|
+
}
|
|
184899
|
+
return ar;
|
|
184900
|
+
};
|
|
184901
|
+
function useRafState(initialState2) {
|
|
184902
|
+
var ref = react.exports.useRef(0);
|
|
184903
|
+
var _a2 = __read$1(react.exports.useState(initialState2), 2), state = _a2[0], setState = _a2[1];
|
|
184904
|
+
var setRafState = react.exports.useCallback(function(value) {
|
|
184905
|
+
cancelAnimationFrame(ref.current);
|
|
184906
|
+
ref.current = requestAnimationFrame(function() {
|
|
184907
|
+
setState(value);
|
|
184908
|
+
});
|
|
184909
|
+
}, []);
|
|
184910
|
+
useUnmount$1(function() {
|
|
184911
|
+
cancelAnimationFrame(ref.current);
|
|
184912
|
+
});
|
|
184913
|
+
return [state, setRafState];
|
|
184914
|
+
}
|
|
184915
|
+
var MapShim = function() {
|
|
184916
|
+
if (typeof Map !== "undefined") {
|
|
184917
|
+
return Map;
|
|
184918
|
+
}
|
|
184919
|
+
function getIndex(arr, key) {
|
|
184920
|
+
var result = -1;
|
|
184921
|
+
arr.some(function(entry, index2) {
|
|
184922
|
+
if (entry[0] === key) {
|
|
184923
|
+
result = index2;
|
|
184924
|
+
return true;
|
|
184925
|
+
}
|
|
184926
|
+
return false;
|
|
184927
|
+
});
|
|
184928
|
+
return result;
|
|
184929
|
+
}
|
|
184930
|
+
return function() {
|
|
184931
|
+
function class_1() {
|
|
184932
|
+
this.__entries__ = [];
|
|
184933
|
+
}
|
|
184934
|
+
Object.defineProperty(class_1.prototype, "size", {
|
|
184935
|
+
get: function() {
|
|
184936
|
+
return this.__entries__.length;
|
|
184937
|
+
},
|
|
184938
|
+
enumerable: true,
|
|
184939
|
+
configurable: true
|
|
184940
|
+
});
|
|
184941
|
+
class_1.prototype.get = function(key) {
|
|
184942
|
+
var index2 = getIndex(this.__entries__, key);
|
|
184943
|
+
var entry = this.__entries__[index2];
|
|
184944
|
+
return entry && entry[1];
|
|
184945
|
+
};
|
|
184946
|
+
class_1.prototype.set = function(key, value) {
|
|
184947
|
+
var index2 = getIndex(this.__entries__, key);
|
|
184948
|
+
if (~index2) {
|
|
184949
|
+
this.__entries__[index2][1] = value;
|
|
184950
|
+
} else {
|
|
184951
|
+
this.__entries__.push([key, value]);
|
|
184952
|
+
}
|
|
184953
|
+
};
|
|
184954
|
+
class_1.prototype.delete = function(key) {
|
|
184955
|
+
var entries = this.__entries__;
|
|
184956
|
+
var index2 = getIndex(entries, key);
|
|
184957
|
+
if (~index2) {
|
|
184958
|
+
entries.splice(index2, 1);
|
|
184959
|
+
}
|
|
184960
|
+
};
|
|
184961
|
+
class_1.prototype.has = function(key) {
|
|
184962
|
+
return !!~getIndex(this.__entries__, key);
|
|
184963
|
+
};
|
|
184964
|
+
class_1.prototype.clear = function() {
|
|
184965
|
+
this.__entries__.splice(0);
|
|
184966
|
+
};
|
|
184967
|
+
class_1.prototype.forEach = function(callback, ctx) {
|
|
184968
|
+
if (ctx === void 0) {
|
|
184969
|
+
ctx = null;
|
|
184970
|
+
}
|
|
184971
|
+
for (var _i = 0, _a2 = this.__entries__; _i < _a2.length; _i++) {
|
|
184972
|
+
var entry = _a2[_i];
|
|
184973
|
+
callback.call(ctx, entry[1], entry[0]);
|
|
184974
|
+
}
|
|
184975
|
+
};
|
|
184976
|
+
return class_1;
|
|
184977
|
+
}();
|
|
184978
|
+
}();
|
|
184979
|
+
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined" && window.document === document;
|
|
184980
|
+
var global$1 = function() {
|
|
184981
|
+
if (typeof global !== "undefined" && global.Math === Math) {
|
|
184982
|
+
return global;
|
|
184983
|
+
}
|
|
184984
|
+
if (typeof self !== "undefined" && self.Math === Math) {
|
|
184985
|
+
return self;
|
|
184986
|
+
}
|
|
184987
|
+
if (typeof window !== "undefined" && window.Math === Math) {
|
|
184988
|
+
return window;
|
|
184989
|
+
}
|
|
184990
|
+
return Function("return this")();
|
|
184991
|
+
}();
|
|
184992
|
+
var requestAnimationFrame$1 = function() {
|
|
184993
|
+
if (typeof requestAnimationFrame === "function") {
|
|
184994
|
+
return requestAnimationFrame.bind(global$1);
|
|
184995
|
+
}
|
|
184996
|
+
return function(callback) {
|
|
184997
|
+
return setTimeout(function() {
|
|
184998
|
+
return callback(Date.now());
|
|
184999
|
+
}, 1e3 / 60);
|
|
185000
|
+
};
|
|
185001
|
+
}();
|
|
185002
|
+
var trailingTimeout = 2;
|
|
185003
|
+
function throttle(callback, delay) {
|
|
185004
|
+
var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
|
185005
|
+
function resolvePending() {
|
|
185006
|
+
if (leadingCall) {
|
|
185007
|
+
leadingCall = false;
|
|
185008
|
+
callback();
|
|
185009
|
+
}
|
|
185010
|
+
if (trailingCall) {
|
|
185011
|
+
proxy();
|
|
185012
|
+
}
|
|
185013
|
+
}
|
|
185014
|
+
function timeoutCallback() {
|
|
185015
|
+
requestAnimationFrame$1(resolvePending);
|
|
185016
|
+
}
|
|
185017
|
+
function proxy() {
|
|
185018
|
+
var timeStamp = Date.now();
|
|
185019
|
+
if (leadingCall) {
|
|
185020
|
+
if (timeStamp - lastCallTime < trailingTimeout) {
|
|
185021
|
+
return;
|
|
185022
|
+
}
|
|
185023
|
+
trailingCall = true;
|
|
185024
|
+
} else {
|
|
185025
|
+
leadingCall = true;
|
|
185026
|
+
trailingCall = false;
|
|
185027
|
+
setTimeout(timeoutCallback, delay);
|
|
185028
|
+
}
|
|
185029
|
+
lastCallTime = timeStamp;
|
|
185030
|
+
}
|
|
185031
|
+
return proxy;
|
|
185032
|
+
}
|
|
185033
|
+
var REFRESH_DELAY = 20;
|
|
185034
|
+
var transitionKeys = ["top", "right", "bottom", "left", "width", "height", "size", "weight"];
|
|
185035
|
+
var mutationObserverSupported = typeof MutationObserver !== "undefined";
|
|
185036
|
+
var ResizeObserverController = function() {
|
|
185037
|
+
function ResizeObserverController2() {
|
|
185038
|
+
this.connected_ = false;
|
|
185039
|
+
this.mutationEventsAdded_ = false;
|
|
185040
|
+
this.mutationsObserver_ = null;
|
|
185041
|
+
this.observers_ = [];
|
|
185042
|
+
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
|
185043
|
+
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
185044
|
+
}
|
|
185045
|
+
ResizeObserverController2.prototype.addObserver = function(observer) {
|
|
185046
|
+
if (!~this.observers_.indexOf(observer)) {
|
|
185047
|
+
this.observers_.push(observer);
|
|
185048
|
+
}
|
|
185049
|
+
if (!this.connected_) {
|
|
185050
|
+
this.connect_();
|
|
185051
|
+
}
|
|
185052
|
+
};
|
|
185053
|
+
ResizeObserverController2.prototype.removeObserver = function(observer) {
|
|
185054
|
+
var observers2 = this.observers_;
|
|
185055
|
+
var index2 = observers2.indexOf(observer);
|
|
185056
|
+
if (~index2) {
|
|
185057
|
+
observers2.splice(index2, 1);
|
|
185058
|
+
}
|
|
185059
|
+
if (!observers2.length && this.connected_) {
|
|
185060
|
+
this.disconnect_();
|
|
185061
|
+
}
|
|
185062
|
+
};
|
|
185063
|
+
ResizeObserverController2.prototype.refresh = function() {
|
|
185064
|
+
var changesDetected = this.updateObservers_();
|
|
185065
|
+
if (changesDetected) {
|
|
185066
|
+
this.refresh();
|
|
185067
|
+
}
|
|
185068
|
+
};
|
|
185069
|
+
ResizeObserverController2.prototype.updateObservers_ = function() {
|
|
185070
|
+
var activeObservers = this.observers_.filter(function(observer) {
|
|
185071
|
+
return observer.gatherActive(), observer.hasActive();
|
|
185072
|
+
});
|
|
185073
|
+
activeObservers.forEach(function(observer) {
|
|
185074
|
+
return observer.broadcastActive();
|
|
185075
|
+
});
|
|
185076
|
+
return activeObservers.length > 0;
|
|
185077
|
+
};
|
|
185078
|
+
ResizeObserverController2.prototype.connect_ = function() {
|
|
185079
|
+
if (!isBrowser || this.connected_) {
|
|
185080
|
+
return;
|
|
185081
|
+
}
|
|
185082
|
+
document.addEventListener("transitionend", this.onTransitionEnd_);
|
|
185083
|
+
window.addEventListener("resize", this.refresh);
|
|
185084
|
+
if (mutationObserverSupported) {
|
|
185085
|
+
this.mutationsObserver_ = new MutationObserver(this.refresh);
|
|
185086
|
+
this.mutationsObserver_.observe(document, {
|
|
185087
|
+
attributes: true,
|
|
185088
|
+
childList: true,
|
|
185089
|
+
characterData: true,
|
|
185090
|
+
subtree: true
|
|
185091
|
+
});
|
|
185092
|
+
} else {
|
|
185093
|
+
document.addEventListener("DOMSubtreeModified", this.refresh);
|
|
185094
|
+
this.mutationEventsAdded_ = true;
|
|
185095
|
+
}
|
|
185096
|
+
this.connected_ = true;
|
|
185097
|
+
};
|
|
185098
|
+
ResizeObserverController2.prototype.disconnect_ = function() {
|
|
185099
|
+
if (!isBrowser || !this.connected_) {
|
|
185100
|
+
return;
|
|
185101
|
+
}
|
|
185102
|
+
document.removeEventListener("transitionend", this.onTransitionEnd_);
|
|
185103
|
+
window.removeEventListener("resize", this.refresh);
|
|
185104
|
+
if (this.mutationsObserver_) {
|
|
185105
|
+
this.mutationsObserver_.disconnect();
|
|
185106
|
+
}
|
|
185107
|
+
if (this.mutationEventsAdded_) {
|
|
185108
|
+
document.removeEventListener("DOMSubtreeModified", this.refresh);
|
|
185109
|
+
}
|
|
185110
|
+
this.mutationsObserver_ = null;
|
|
185111
|
+
this.mutationEventsAdded_ = false;
|
|
185112
|
+
this.connected_ = false;
|
|
185113
|
+
};
|
|
185114
|
+
ResizeObserverController2.prototype.onTransitionEnd_ = function(_a2) {
|
|
185115
|
+
var _b2 = _a2.propertyName, propertyName = _b2 === void 0 ? "" : _b2;
|
|
185116
|
+
var isReflowProperty = transitionKeys.some(function(key) {
|
|
185117
|
+
return !!~propertyName.indexOf(key);
|
|
185118
|
+
});
|
|
185119
|
+
if (isReflowProperty) {
|
|
185120
|
+
this.refresh();
|
|
185121
|
+
}
|
|
185122
|
+
};
|
|
185123
|
+
ResizeObserverController2.getInstance = function() {
|
|
185124
|
+
if (!this.instance_) {
|
|
185125
|
+
this.instance_ = new ResizeObserverController2();
|
|
185126
|
+
}
|
|
185127
|
+
return this.instance_;
|
|
185128
|
+
};
|
|
185129
|
+
ResizeObserverController2.instance_ = null;
|
|
185130
|
+
return ResizeObserverController2;
|
|
185131
|
+
}();
|
|
185132
|
+
var defineConfigurable = function(target, props) {
|
|
185133
|
+
for (var _i = 0, _a2 = Object.keys(props); _i < _a2.length; _i++) {
|
|
185134
|
+
var key = _a2[_i];
|
|
185135
|
+
Object.defineProperty(target, key, {
|
|
185136
|
+
value: props[key],
|
|
185137
|
+
enumerable: false,
|
|
185138
|
+
writable: false,
|
|
185139
|
+
configurable: true
|
|
185140
|
+
});
|
|
185141
|
+
}
|
|
185142
|
+
return target;
|
|
185143
|
+
};
|
|
185144
|
+
var getWindowOf = function(target) {
|
|
185145
|
+
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
185146
|
+
return ownerGlobal || global$1;
|
|
185147
|
+
};
|
|
185148
|
+
var emptyRect = createRectInit(0, 0, 0, 0);
|
|
185149
|
+
function toFloat(value) {
|
|
185150
|
+
return parseFloat(value) || 0;
|
|
185151
|
+
}
|
|
185152
|
+
function getBordersSize(styles) {
|
|
185153
|
+
var positions = [];
|
|
185154
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
185155
|
+
positions[_i - 1] = arguments[_i];
|
|
185156
|
+
}
|
|
185157
|
+
return positions.reduce(function(size2, position2) {
|
|
185158
|
+
var value = styles["border-" + position2 + "-width"];
|
|
185159
|
+
return size2 + toFloat(value);
|
|
185160
|
+
}, 0);
|
|
185161
|
+
}
|
|
185162
|
+
function getPaddings(styles) {
|
|
185163
|
+
var positions = ["top", "right", "bottom", "left"];
|
|
185164
|
+
var paddings = {};
|
|
185165
|
+
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
185166
|
+
var position2 = positions_1[_i];
|
|
185167
|
+
var value = styles["padding-" + position2];
|
|
185168
|
+
paddings[position2] = toFloat(value);
|
|
185169
|
+
}
|
|
185170
|
+
return paddings;
|
|
185171
|
+
}
|
|
185172
|
+
function getSVGContentRect(target) {
|
|
185173
|
+
var bbox = target.getBBox();
|
|
185174
|
+
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
185175
|
+
}
|
|
185176
|
+
function getHTMLElementContentRect(target) {
|
|
185177
|
+
var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
|
185178
|
+
if (!clientWidth && !clientHeight) {
|
|
185179
|
+
return emptyRect;
|
|
185180
|
+
}
|
|
185181
|
+
var styles = getWindowOf(target).getComputedStyle(target);
|
|
185182
|
+
var paddings = getPaddings(styles);
|
|
185183
|
+
var horizPad = paddings.left + paddings.right;
|
|
185184
|
+
var vertPad = paddings.top + paddings.bottom;
|
|
185185
|
+
var width = toFloat(styles.width), height = toFloat(styles.height);
|
|
185186
|
+
if (styles.boxSizing === "border-box") {
|
|
185187
|
+
if (Math.round(width + horizPad) !== clientWidth) {
|
|
185188
|
+
width -= getBordersSize(styles, "left", "right") + horizPad;
|
|
185189
|
+
}
|
|
185190
|
+
if (Math.round(height + vertPad) !== clientHeight) {
|
|
185191
|
+
height -= getBordersSize(styles, "top", "bottom") + vertPad;
|
|
185192
|
+
}
|
|
185193
|
+
}
|
|
185194
|
+
if (!isDocumentElement(target)) {
|
|
185195
|
+
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
|
185196
|
+
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
185197
|
+
if (Math.abs(vertScrollbar) !== 1) {
|
|
185198
|
+
width -= vertScrollbar;
|
|
185199
|
+
}
|
|
185200
|
+
if (Math.abs(horizScrollbar) !== 1) {
|
|
185201
|
+
height -= horizScrollbar;
|
|
185202
|
+
}
|
|
185203
|
+
}
|
|
185204
|
+
return createRectInit(paddings.left, paddings.top, width, height);
|
|
185205
|
+
}
|
|
185206
|
+
var isSVGGraphicsElement = function() {
|
|
185207
|
+
if (typeof SVGGraphicsElement !== "undefined") {
|
|
185208
|
+
return function(target) {
|
|
185209
|
+
return target instanceof getWindowOf(target).SVGGraphicsElement;
|
|
185210
|
+
};
|
|
185211
|
+
}
|
|
185212
|
+
return function(target) {
|
|
185213
|
+
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === "function";
|
|
185214
|
+
};
|
|
185215
|
+
}();
|
|
185216
|
+
function isDocumentElement(target) {
|
|
185217
|
+
return target === getWindowOf(target).document.documentElement;
|
|
185218
|
+
}
|
|
185219
|
+
function getContentRect(target) {
|
|
185220
|
+
if (!isBrowser) {
|
|
185221
|
+
return emptyRect;
|
|
185222
|
+
}
|
|
185223
|
+
if (isSVGGraphicsElement(target)) {
|
|
185224
|
+
return getSVGContentRect(target);
|
|
185225
|
+
}
|
|
185226
|
+
return getHTMLElementContentRect(target);
|
|
185227
|
+
}
|
|
185228
|
+
function createReadOnlyRect(_a2) {
|
|
185229
|
+
var x2 = _a2.x, y2 = _a2.y, width = _a2.width, height = _a2.height;
|
|
185230
|
+
var Constr = typeof DOMRectReadOnly !== "undefined" ? DOMRectReadOnly : Object;
|
|
185231
|
+
var rect = Object.create(Constr.prototype);
|
|
185232
|
+
defineConfigurable(rect, {
|
|
185233
|
+
x: x2,
|
|
185234
|
+
y: y2,
|
|
185235
|
+
width,
|
|
185236
|
+
height,
|
|
185237
|
+
top: y2,
|
|
185238
|
+
right: x2 + width,
|
|
185239
|
+
bottom: height + y2,
|
|
185240
|
+
left: x2
|
|
185241
|
+
});
|
|
185242
|
+
return rect;
|
|
185243
|
+
}
|
|
185244
|
+
function createRectInit(x2, y2, width, height) {
|
|
185245
|
+
return { x: x2, y: y2, width, height };
|
|
185246
|
+
}
|
|
185247
|
+
var ResizeObservation = function() {
|
|
185248
|
+
function ResizeObservation2(target) {
|
|
185249
|
+
this.broadcastWidth = 0;
|
|
185250
|
+
this.broadcastHeight = 0;
|
|
185251
|
+
this.contentRect_ = createRectInit(0, 0, 0, 0);
|
|
185252
|
+
this.target = target;
|
|
185253
|
+
}
|
|
185254
|
+
ResizeObservation2.prototype.isActive = function() {
|
|
185255
|
+
var rect = getContentRect(this.target);
|
|
185256
|
+
this.contentRect_ = rect;
|
|
185257
|
+
return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
|
|
185258
|
+
};
|
|
185259
|
+
ResizeObservation2.prototype.broadcastRect = function() {
|
|
185260
|
+
var rect = this.contentRect_;
|
|
185261
|
+
this.broadcastWidth = rect.width;
|
|
185262
|
+
this.broadcastHeight = rect.height;
|
|
185263
|
+
return rect;
|
|
185264
|
+
};
|
|
185265
|
+
return ResizeObservation2;
|
|
185266
|
+
}();
|
|
185267
|
+
var ResizeObserverEntry = function() {
|
|
185268
|
+
function ResizeObserverEntry2(target, rectInit) {
|
|
185269
|
+
var contentRect = createReadOnlyRect(rectInit);
|
|
185270
|
+
defineConfigurable(this, { target, contentRect });
|
|
185271
|
+
}
|
|
185272
|
+
return ResizeObserverEntry2;
|
|
185273
|
+
}();
|
|
185274
|
+
var ResizeObserverSPI = function() {
|
|
185275
|
+
function ResizeObserverSPI2(callback, controller, callbackCtx) {
|
|
185276
|
+
this.activeObservations_ = [];
|
|
185277
|
+
this.observations_ = new MapShim();
|
|
185278
|
+
if (typeof callback !== "function") {
|
|
185279
|
+
throw new TypeError("The callback provided as parameter 1 is not a function.");
|
|
185280
|
+
}
|
|
185281
|
+
this.callback_ = callback;
|
|
185282
|
+
this.controller_ = controller;
|
|
185283
|
+
this.callbackCtx_ = callbackCtx;
|
|
185284
|
+
}
|
|
185285
|
+
ResizeObserverSPI2.prototype.observe = function(target) {
|
|
185286
|
+
if (!arguments.length) {
|
|
185287
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
185288
|
+
}
|
|
185289
|
+
if (typeof Element === "undefined" || !(Element instanceof Object)) {
|
|
185290
|
+
return;
|
|
185291
|
+
}
|
|
185292
|
+
if (!(target instanceof getWindowOf(target).Element)) {
|
|
185293
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
185294
|
+
}
|
|
185295
|
+
var observations = this.observations_;
|
|
185296
|
+
if (observations.has(target)) {
|
|
185297
|
+
return;
|
|
185298
|
+
}
|
|
185299
|
+
observations.set(target, new ResizeObservation(target));
|
|
185300
|
+
this.controller_.addObserver(this);
|
|
185301
|
+
this.controller_.refresh();
|
|
185302
|
+
};
|
|
185303
|
+
ResizeObserverSPI2.prototype.unobserve = function(target) {
|
|
185304
|
+
if (!arguments.length) {
|
|
185305
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
185306
|
+
}
|
|
185307
|
+
if (typeof Element === "undefined" || !(Element instanceof Object)) {
|
|
185308
|
+
return;
|
|
185309
|
+
}
|
|
185310
|
+
if (!(target instanceof getWindowOf(target).Element)) {
|
|
185311
|
+
throw new TypeError('parameter 1 is not of type "Element".');
|
|
185312
|
+
}
|
|
185313
|
+
var observations = this.observations_;
|
|
185314
|
+
if (!observations.has(target)) {
|
|
185315
|
+
return;
|
|
185316
|
+
}
|
|
185317
|
+
observations.delete(target);
|
|
185318
|
+
if (!observations.size) {
|
|
185319
|
+
this.controller_.removeObserver(this);
|
|
185320
|
+
}
|
|
185321
|
+
};
|
|
185322
|
+
ResizeObserverSPI2.prototype.disconnect = function() {
|
|
185323
|
+
this.clearActive();
|
|
185324
|
+
this.observations_.clear();
|
|
185325
|
+
this.controller_.removeObserver(this);
|
|
185326
|
+
};
|
|
185327
|
+
ResizeObserverSPI2.prototype.gatherActive = function() {
|
|
185328
|
+
var _this = this;
|
|
185329
|
+
this.clearActive();
|
|
185330
|
+
this.observations_.forEach(function(observation) {
|
|
185331
|
+
if (observation.isActive()) {
|
|
185332
|
+
_this.activeObservations_.push(observation);
|
|
185333
|
+
}
|
|
185334
|
+
});
|
|
185335
|
+
};
|
|
185336
|
+
ResizeObserverSPI2.prototype.broadcastActive = function() {
|
|
185337
|
+
if (!this.hasActive()) {
|
|
185338
|
+
return;
|
|
185339
|
+
}
|
|
185340
|
+
var ctx = this.callbackCtx_;
|
|
185341
|
+
var entries = this.activeObservations_.map(function(observation) {
|
|
185342
|
+
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
185343
|
+
});
|
|
185344
|
+
this.callback_.call(ctx, entries, ctx);
|
|
185345
|
+
this.clearActive();
|
|
185346
|
+
};
|
|
185347
|
+
ResizeObserverSPI2.prototype.clearActive = function() {
|
|
185348
|
+
this.activeObservations_.splice(0);
|
|
185349
|
+
};
|
|
185350
|
+
ResizeObserverSPI2.prototype.hasActive = function() {
|
|
185351
|
+
return this.activeObservations_.length > 0;
|
|
185352
|
+
};
|
|
185353
|
+
return ResizeObserverSPI2;
|
|
185354
|
+
}();
|
|
185355
|
+
var observers = typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : new MapShim();
|
|
185356
|
+
var ResizeObserver$1 = function() {
|
|
185357
|
+
function ResizeObserver2(callback) {
|
|
185358
|
+
if (!(this instanceof ResizeObserver2)) {
|
|
185359
|
+
throw new TypeError("Cannot call a class as a function.");
|
|
185360
|
+
}
|
|
185361
|
+
if (!arguments.length) {
|
|
185362
|
+
throw new TypeError("1 argument required, but only 0 present.");
|
|
185363
|
+
}
|
|
185364
|
+
var controller = ResizeObserverController.getInstance();
|
|
185365
|
+
var observer = new ResizeObserverSPI(callback, controller, this);
|
|
185366
|
+
observers.set(this, observer);
|
|
185367
|
+
}
|
|
185368
|
+
return ResizeObserver2;
|
|
185369
|
+
}();
|
|
185370
|
+
[
|
|
185371
|
+
"observe",
|
|
185372
|
+
"unobserve",
|
|
185373
|
+
"disconnect"
|
|
185374
|
+
].forEach(function(method) {
|
|
185375
|
+
ResizeObserver$1.prototype[method] = function() {
|
|
185376
|
+
var _a2;
|
|
185377
|
+
return (_a2 = observers.get(this))[method].apply(_a2, arguments);
|
|
185378
|
+
};
|
|
185379
|
+
});
|
|
185380
|
+
var index$4 = function() {
|
|
185381
|
+
if (typeof global$1.ResizeObserver !== "undefined") {
|
|
185382
|
+
return global$1.ResizeObserver;
|
|
185383
|
+
}
|
|
185384
|
+
return ResizeObserver$1;
|
|
185385
|
+
}();
|
|
185386
|
+
var useEffectWithTarget = createEffectWithTarget$1(react.exports.useLayoutEffect);
|
|
185387
|
+
var useLayoutEffectWithTarget = useEffectWithTarget;
|
|
185388
|
+
var useIsomorphicLayoutEffectWithTarget = isBrowser$2 ? useLayoutEffectWithTarget : useEffectWithTarget$2;
|
|
185389
|
+
var useIsomorphicLayoutEffectWithTarget$1 = useIsomorphicLayoutEffectWithTarget;
|
|
185390
|
+
var __read = globalThis && globalThis.__read || function(o, n2) {
|
|
185391
|
+
var m2 = typeof Symbol === "function" && o[Symbol.iterator];
|
|
185392
|
+
if (!m2)
|
|
185393
|
+
return o;
|
|
185394
|
+
var i = m2.call(o), r2, ar = [], e2;
|
|
185395
|
+
try {
|
|
185396
|
+
while ((n2 === void 0 || n2-- > 0) && !(r2 = i.next()).done) {
|
|
185397
|
+
ar.push(r2.value);
|
|
185398
|
+
}
|
|
185399
|
+
} catch (error2) {
|
|
185400
|
+
e2 = {
|
|
185401
|
+
error: error2
|
|
185402
|
+
};
|
|
185403
|
+
} finally {
|
|
185404
|
+
try {
|
|
185405
|
+
if (r2 && !r2.done && (m2 = i["return"]))
|
|
185406
|
+
m2.call(i);
|
|
185407
|
+
} finally {
|
|
185408
|
+
if (e2)
|
|
185409
|
+
throw e2.error;
|
|
185410
|
+
}
|
|
185411
|
+
}
|
|
185412
|
+
return ar;
|
|
185413
|
+
};
|
|
185414
|
+
function useSize(target) {
|
|
185415
|
+
var _a2 = __read(useRafState(), 2), state = _a2[0], setState = _a2[1];
|
|
185416
|
+
useIsomorphicLayoutEffectWithTarget$1(function() {
|
|
185417
|
+
var el = getTargetElement(target);
|
|
185418
|
+
if (!el) {
|
|
185419
|
+
return;
|
|
185420
|
+
}
|
|
185421
|
+
var resizeObserver = new index$4(function(entries) {
|
|
185422
|
+
entries.forEach(function(entry) {
|
|
185423
|
+
var _a3 = entry.target, clientWidth = _a3.clientWidth, clientHeight = _a3.clientHeight;
|
|
185424
|
+
setState({
|
|
185425
|
+
width: clientWidth,
|
|
185426
|
+
height: clientHeight
|
|
185427
|
+
});
|
|
185428
|
+
});
|
|
185429
|
+
});
|
|
185430
|
+
resizeObserver.observe(el);
|
|
185431
|
+
return function() {
|
|
185432
|
+
resizeObserver.disconnect();
|
|
185433
|
+
};
|
|
185434
|
+
}, [], target);
|
|
185435
|
+
return state;
|
|
185436
|
+
}
|
|
185068
185437
|
var xtermAddonFit = { exports: {} };
|
|
185069
185438
|
(function(module2, exports2) {
|
|
185070
185439
|
!function(e2, t2) {
|
|
@@ -185106,6 +185475,7 @@ var xtermAddonFit = { exports: {} };
|
|
|
185106
185475
|
})();
|
|
185107
185476
|
});
|
|
185108
185477
|
})(xtermAddonFit);
|
|
185478
|
+
const xtermFitAddon = new xtermAddonFit.exports.FitAddon();
|
|
185109
185479
|
const XTerm = (_a2) => {
|
|
185110
185480
|
var _b2 = _a2, {
|
|
185111
185481
|
terminal,
|
|
@@ -185121,76 +185491,85 @@ const XTerm = (_a2) => {
|
|
|
185121
185491
|
width: "100%",
|
|
185122
185492
|
padding: "5px 5px"
|
|
185123
185493
|
}, props);
|
|
185124
|
-
const xtermFitAddon = new xtermAddonFit.exports.FitAddon();
|
|
185125
185494
|
const terminalRef = react.exports.useRef(null);
|
|
185126
|
-
const
|
|
185127
|
-
|
|
185128
|
-
|
|
185129
|
-
|
|
185130
|
-
}) => {
|
|
185131
|
-
let character2 = key;
|
|
185132
|
-
switch (key.charCodeAt(0)) {
|
|
185133
|
-
case 13:
|
|
185134
|
-
break;
|
|
185135
|
-
case 27:
|
|
185136
|
-
switch (domEvent.key) {
|
|
185137
|
-
case "ArrowLeft":
|
|
185138
|
-
if (term.buffer.active.cursorX <= 2) {
|
|
185139
|
-
return;
|
|
185140
|
-
}
|
|
185141
|
-
break;
|
|
185142
|
-
}
|
|
185143
|
-
break;
|
|
185144
|
-
case 8:
|
|
185145
|
-
case 127:
|
|
185146
|
-
if (term.buffer.active.cursorX > 2) {
|
|
185147
|
-
character2 = "\b";
|
|
185148
|
-
}
|
|
185149
|
-
break;
|
|
185150
|
-
}
|
|
185151
|
-
onKey == null ? void 0 : onKey(character2);
|
|
185152
|
-
});
|
|
185153
|
-
term.attachCustomKeyEventHandler((e2) => {
|
|
185154
|
-
var _a3, _b3;
|
|
185155
|
-
const ctrlOrCmd = e2.metaKey || e2.ctrlKey;
|
|
185156
|
-
if (e2.type === "keyup")
|
|
185157
|
-
return false;
|
|
185158
|
-
if (e2.key === "v" && ctrlOrCmd) {
|
|
185159
|
-
if ((_a3 = e2.view) == null ? void 0 : _a3.navigator.clipboard) {
|
|
185160
|
-
(_b3 = e2.view) == null ? void 0 : _b3.navigator.clipboard.readText().then((res) => onKey == null ? void 0 : onKey(res));
|
|
185161
|
-
} else {
|
|
185162
|
-
onKey == null ? void 0 : onKey(e2.target.value);
|
|
185163
|
-
}
|
|
185164
|
-
return false;
|
|
185165
|
-
}
|
|
185166
|
-
return !(e2.key === "r" && ctrlOrCmd);
|
|
185167
|
-
});
|
|
185168
|
-
};
|
|
185169
|
-
const fitTerminal = () => {
|
|
185170
|
-
try {
|
|
185171
|
-
setTimeout(() => {
|
|
185172
|
-
xtermFitAddon.fit();
|
|
185173
|
-
}, 0);
|
|
185174
|
-
} catch (err) {
|
|
185175
|
-
throw err;
|
|
185176
|
-
}
|
|
185177
|
-
};
|
|
185178
|
-
react.exports.useEffect(() => {
|
|
185179
|
-
if (terminal) {
|
|
185180
|
-
terminal.loadAddon(xtermFitAddon);
|
|
185181
|
-
initTerminalEvents(terminal);
|
|
185182
|
-
terminal.open(terminalRef.current);
|
|
185183
|
-
fitTerminal();
|
|
185184
|
-
}
|
|
185185
|
-
}, [terminal]);
|
|
185495
|
+
const {
|
|
185496
|
+
fitTerminal
|
|
185497
|
+
} = useTerminal();
|
|
185498
|
+
useObserverContainerAndResize();
|
|
185186
185499
|
react.exports.useEffect(() => {
|
|
185187
185500
|
fitTerminal();
|
|
185188
185501
|
}, [fitHook]);
|
|
185189
|
-
|
|
185190
|
-
|
|
185191
|
-
|
|
185192
|
-
|
|
185193
|
-
|
|
185502
|
+
function useTerminal() {
|
|
185503
|
+
const initTerminal = react.exports.useCallback((node2) => {
|
|
185504
|
+
if (node2 == null ? void 0 : node2.parentElement) {
|
|
185505
|
+
terminal.loadAddon(xtermFitAddon);
|
|
185506
|
+
initTerminalEvents(terminal);
|
|
185507
|
+
terminal.open(node2);
|
|
185508
|
+
fitTerminal2();
|
|
185509
|
+
}
|
|
185510
|
+
}, []);
|
|
185511
|
+
const initTerminalEvents = (term) => {
|
|
185512
|
+
term.onKey(({
|
|
185513
|
+
key,
|
|
185514
|
+
domEvent
|
|
185515
|
+
}) => {
|
|
185516
|
+
let character2 = key;
|
|
185517
|
+
switch (key.charCodeAt(0)) {
|
|
185518
|
+
case 13:
|
|
185519
|
+
break;
|
|
185520
|
+
case 27:
|
|
185521
|
+
switch (domEvent.key) {
|
|
185522
|
+
case "ArrowLeft":
|
|
185523
|
+
if (term.buffer.active.cursorX <= 2) {
|
|
185524
|
+
return;
|
|
185525
|
+
}
|
|
185526
|
+
break;
|
|
185527
|
+
}
|
|
185528
|
+
break;
|
|
185529
|
+
case 8:
|
|
185530
|
+
case 127:
|
|
185531
|
+
if (term.buffer.active.cursorX > 2) {
|
|
185532
|
+
character2 = "\b";
|
|
185533
|
+
}
|
|
185534
|
+
break;
|
|
185535
|
+
}
|
|
185536
|
+
onKey == null ? void 0 : onKey(character2);
|
|
185537
|
+
});
|
|
185538
|
+
term.attachCustomKeyEventHandler((e2) => {
|
|
185539
|
+
var _a3, _b3;
|
|
185540
|
+
const ctrlOrCmd = e2.metaKey || e2.ctrlKey;
|
|
185541
|
+
if (e2.type === "keyup")
|
|
185542
|
+
return false;
|
|
185543
|
+
if (e2.key === "v" && ctrlOrCmd) {
|
|
185544
|
+
if ((_a3 = e2.view) == null ? void 0 : _a3.navigator.clipboard) {
|
|
185545
|
+
(_b3 = e2.view) == null ? void 0 : _b3.navigator.clipboard.readText().then((res) => onKey == null ? void 0 : onKey(res));
|
|
185546
|
+
} else {
|
|
185547
|
+
onKey == null ? void 0 : onKey(e2.target.value);
|
|
185548
|
+
}
|
|
185549
|
+
return false;
|
|
185550
|
+
}
|
|
185551
|
+
return !(e2.key === "r" && ctrlOrCmd);
|
|
185552
|
+
});
|
|
185553
|
+
};
|
|
185554
|
+
const fitTerminal2 = () => {
|
|
185555
|
+
xtermFitAddon.fit();
|
|
185556
|
+
};
|
|
185557
|
+
react.exports.useEffect(() => {
|
|
185558
|
+
initTerminal(terminalRef.current);
|
|
185559
|
+
}, [terminalRef]);
|
|
185560
|
+
return {
|
|
185561
|
+
fitTerminal: fitTerminal2
|
|
185562
|
+
};
|
|
185563
|
+
}
|
|
185564
|
+
function useObserverContainerAndResize() {
|
|
185565
|
+
const size2 = useSize(terminalRef);
|
|
185566
|
+
react.exports.useEffect(() => {
|
|
185567
|
+
fitTerminal();
|
|
185568
|
+
}, [size2]);
|
|
185569
|
+
}
|
|
185570
|
+
return /* @__PURE__ */ jsx("div", {
|
|
185571
|
+
ref: terminalRef,
|
|
185572
|
+
style: stateStyle
|
|
185194
185573
|
});
|
|
185195
185574
|
};
|
|
185196
185575
|
function Console(_c2, ref) {
|
|
@@ -185456,11 +185835,13 @@ const TerminalComponent = (_g2) => {
|
|
|
185456
185835
|
} = _h2, props = __objRest(_h2, [
|
|
185457
185836
|
"options"
|
|
185458
185837
|
]);
|
|
185459
|
-
const defaultOptions2 =
|
|
185460
|
-
|
|
185461
|
-
|
|
185462
|
-
|
|
185463
|
-
|
|
185838
|
+
const defaultOptions2 = react.exports.useMemo(() => {
|
|
185839
|
+
return __spreadProps(__spreadValues(__spreadValues({}, options), props), {
|
|
185840
|
+
theme: {
|
|
185841
|
+
background: theme.extend.colors["dao-light-green"]
|
|
185842
|
+
}
|
|
185843
|
+
});
|
|
185844
|
+
}, [options, props]);
|
|
185464
185845
|
const userLabel = document.createElement("div");
|
|
185465
185846
|
userLabel.classList.add("xterm-helper-user-label");
|
|
185466
185847
|
const isFocus = useFocusCommponent("Terminal");
|
|
@@ -185468,7 +185849,13 @@ const TerminalComponent = (_g2) => {
|
|
|
185468
185849
|
agentUserId,
|
|
185469
185850
|
agentUsers
|
|
185470
185851
|
} = daoStore((state) => state.playgroundInfo);
|
|
185471
|
-
const [terminal
|
|
185852
|
+
const [terminal] = react.exports.useState(() => {
|
|
185853
|
+
return new xterm.exports.Terminal(__spreadProps(__spreadValues({}, defaultOptions2), {
|
|
185854
|
+
fontSize: 14,
|
|
185855
|
+
lineHeight: 1.5,
|
|
185856
|
+
fontFamily: "UbuntuMono, Ubuntu Mono, courier-new, courier, monospace"
|
|
185857
|
+
}));
|
|
185858
|
+
});
|
|
185472
185859
|
const {
|
|
185473
185860
|
CRDTInfo
|
|
185474
185861
|
} = daoStore((state) => state);
|
|
@@ -185497,16 +185884,6 @@ const TerminalComponent = (_g2) => {
|
|
|
185497
185884
|
};
|
|
185498
185885
|
(_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("terminal", crdt);
|
|
185499
185886
|
};
|
|
185500
|
-
react.exports.useEffect(() => {
|
|
185501
|
-
if (!terminal) {
|
|
185502
|
-
const term = new xterm.exports.Terminal(__spreadProps(__spreadValues({}, defaultOptions2), {
|
|
185503
|
-
fontSize: 14,
|
|
185504
|
-
lineHeight: 1.5,
|
|
185505
|
-
fontFamily: "UbuntuMono, Ubuntu Mono, courier-new, courier, monospace"
|
|
185506
|
-
}));
|
|
185507
|
-
setTerminal(term);
|
|
185508
|
-
}
|
|
185509
|
-
}, []);
|
|
185510
185887
|
react.exports.useEffect(() => {
|
|
185511
185888
|
var _a2, _b2, _c2;
|
|
185512
185889
|
if (!terminal)
|
|
@@ -187991,7 +188368,7 @@ const useIndexState = create$2((set) => ({
|
|
|
187991
188368
|
})
|
|
187992
188369
|
}));
|
|
187993
188370
|
const LazyEditorComponent = lazy$2(async () => (await Promise.resolve().then(function() {
|
|
187994
|
-
return index$
|
|
188371
|
+
return index$5;
|
|
187995
188372
|
})).Editor);
|
|
187996
188373
|
const MainLayout = newStyled.div`
|
|
187997
188374
|
width: 100vw;
|