@netless/window-manager 1.0.0-canary.76 → 1.0.0-canary.77
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/App/AppContext.d.ts +1 -1
- package/dist/App/AppPageStateImpl.d.ts +1 -1
- package/dist/App/AppProxy.d.ts +1 -1
- package/dist/App/MagixEvent/index.d.ts +7 -7
- package/dist/App/WhiteboardView.d.ts +2 -2
- package/dist/App/type.d.ts +1 -1
- package/dist/AttributesDelegate.d.ts +7 -7
- package/dist/BoxEmitter.d.ts +7 -7
- package/dist/BoxManager.d.ts +8 -8
- package/dist/Cursor/Cursor.d.ts +1 -1
- package/dist/Cursor/Cursor.svelte.d.ts +1 -0
- package/dist/Cursor/index.d.ts +2 -2
- package/dist/Helper.d.ts +1 -1
- package/dist/InternalEmitter.d.ts +3 -3
- package/dist/Page/PageController.d.ts +2 -2
- package/dist/ReconnectRefresher.d.ts +1 -1
- package/dist/RedoUndo.d.ts +1 -1
- package/dist/Register/index.d.ts +3 -3
- package/dist/Register/storage.d.ts +1 -1
- package/dist/Utils/AppCreateQueue.d.ts +1 -1
- package/dist/View/CameraSynchronizer.d.ts +1 -1
- package/dist/View/ScrollMode.d.ts +1 -1
- package/dist/View/ViewSync.d.ts +1 -1
- package/dist/callback.d.ts +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +663 -291
- package/dist/index.mjs +659 -291
- package/dist/index.umd.js +661 -293
- package/dist/storage.d.ts +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +26 -26
- package/src/Helper.ts +10 -2
- package/dist/image.d.ts +0 -19
- package/dist/shim.d.ts +0 -5
package/dist/index.mjs
CHANGED
@@ -774,11 +774,17 @@ const checkVersion = () => {
|
|
774
774
|
}
|
775
775
|
};
|
776
776
|
const findMemberByUid = (room, uid) => {
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
777
|
+
var _a;
|
778
|
+
const roomMembers = (room == null ? void 0 : room.state.roomMembers) || [];
|
779
|
+
let maxMemberId = -1;
|
780
|
+
let result = void 0;
|
781
|
+
for (const member of roomMembers) {
|
782
|
+
if (((_a = member.payload) == null ? void 0 : _a.uid) === uid && maxMemberId < member.memberId) {
|
783
|
+
maxMemberId = member.memberId;
|
784
|
+
result = member;
|
785
|
+
}
|
786
|
+
}
|
787
|
+
return result;
|
782
788
|
};
|
783
789
|
const serializeRoomMembers = (members) => {
|
784
790
|
return members.map((member) => {
|
@@ -967,9 +973,11 @@ class AppContext {
|
|
967
973
|
return this.displayer.calibrationTimestamp;
|
968
974
|
}
|
969
975
|
}
|
976
|
+
/** Get App writable status. */
|
970
977
|
get isWritable() {
|
971
978
|
return this.appProxy.isWritable && !this.destroyed;
|
972
979
|
}
|
980
|
+
/** Get the App Window UI box. */
|
973
981
|
get box() {
|
974
982
|
const box = this.appProxy.box$.value;
|
975
983
|
if (box) {
|
@@ -984,6 +992,7 @@ class AppContext {
|
|
984
992
|
get members() {
|
985
993
|
return this.manager.members$.value;
|
986
994
|
}
|
995
|
+
//** currentMember is undefined in read-only and replay mode. */
|
987
996
|
get currentMember() {
|
988
997
|
const self = findMemberByUid(this.room, this.manager.uid);
|
989
998
|
if (!self) {
|
@@ -1269,9 +1278,15 @@ class AttributesDelegate {
|
|
1269
1278
|
this.context = context;
|
1270
1279
|
this.setAppFocus = (appId, focus) => {
|
1271
1280
|
if (focus) {
|
1272
|
-
this.context.safeSetAttributes({ [
|
1281
|
+
this.context.safeSetAttributes({ [
|
1282
|
+
"focus"
|
1283
|
+
/* Focus */
|
1284
|
+
]: appId });
|
1273
1285
|
} else {
|
1274
|
-
this.context.safeSetAttributes({ [
|
1286
|
+
this.context.safeSetAttributes({ [
|
1287
|
+
"focus"
|
1288
|
+
/* Focus */
|
1289
|
+
]: void 0 });
|
1275
1290
|
}
|
1276
1291
|
};
|
1277
1292
|
}
|
@@ -1282,16 +1297,26 @@ class AttributesDelegate {
|
|
1282
1297
|
return this.context.getAttributes();
|
1283
1298
|
}
|
1284
1299
|
apps() {
|
1285
|
-
return get(this.attributes, [
|
1300
|
+
return get(this.attributes, [
|
1301
|
+
"apps"
|
1302
|
+
/* Apps */
|
1303
|
+
]);
|
1286
1304
|
}
|
1287
1305
|
get focus() {
|
1288
|
-
return get(this.attributes, [
|
1306
|
+
return get(this.attributes, [
|
1307
|
+
"focus"
|
1308
|
+
/* Focus */
|
1309
|
+
]);
|
1289
1310
|
}
|
1290
1311
|
getAppAttributes(id) {
|
1291
1312
|
return get(this.apps(), [id]);
|
1292
1313
|
}
|
1293
1314
|
getAppState(id) {
|
1294
|
-
return get(this.apps(), [
|
1315
|
+
return get(this.apps(), [
|
1316
|
+
id,
|
1317
|
+
"state"
|
1318
|
+
/* State */
|
1319
|
+
]);
|
1295
1320
|
}
|
1296
1321
|
getMaximized() {
|
1297
1322
|
return get(this.attributes, ["maximized"]);
|
@@ -1315,14 +1340,24 @@ class AttributesDelegate {
|
|
1315
1340
|
}
|
1316
1341
|
attrs.createdAt = Date.now();
|
1317
1342
|
this.context.safeUpdateAttributes(["apps", id], attrs);
|
1318
|
-
this.context.safeUpdateAttributes([
|
1343
|
+
this.context.safeUpdateAttributes([
|
1344
|
+
"apps",
|
1345
|
+
id,
|
1346
|
+
"state"
|
1347
|
+
/* State */
|
1348
|
+
], {
|
1319
1349
|
[AppAttributes.Size]: {},
|
1320
1350
|
[AppAttributes.Position]: {},
|
1321
1351
|
[AppAttributes.SceneIndex]: 0
|
1322
1352
|
});
|
1323
1353
|
}
|
1324
1354
|
updateAppState(appId, stateName, state) {
|
1325
|
-
if (get(this.attributes, [
|
1355
|
+
if (get(this.attributes, [
|
1356
|
+
"apps",
|
1357
|
+
appId,
|
1358
|
+
"state"
|
1359
|
+
/* State */
|
1360
|
+
])) {
|
1326
1361
|
this.context.safeUpdateAttributes(["apps", appId, "state", stateName], state);
|
1327
1362
|
}
|
1328
1363
|
}
|
@@ -1332,13 +1367,19 @@ class AttributesDelegate {
|
|
1332
1367
|
cleanAppAttributes(id) {
|
1333
1368
|
this.context.safeUpdateAttributes(["apps", id], void 0);
|
1334
1369
|
this.context.safeSetAttributes({ [id]: void 0 });
|
1335
|
-
const focus = this.attributes[
|
1370
|
+
const focus = this.attributes[
|
1371
|
+
"focus"
|
1372
|
+
/* Focus */
|
1373
|
+
];
|
1336
1374
|
if (focus === id) {
|
1337
1375
|
this.cleanFocus();
|
1338
1376
|
}
|
1339
1377
|
}
|
1340
1378
|
cleanFocus() {
|
1341
|
-
this.context.safeSetAttributes({ [
|
1379
|
+
this.context.safeSetAttributes({ [
|
1380
|
+
"focus"
|
1381
|
+
/* Focus */
|
1382
|
+
]: void 0 });
|
1342
1383
|
}
|
1343
1384
|
getAppSceneIndex(id) {
|
1344
1385
|
var _a;
|
@@ -1355,7 +1396,10 @@ class AttributesDelegate {
|
|
1355
1396
|
return this.attributes["_mainSceneIndex"];
|
1356
1397
|
}
|
1357
1398
|
getBoxState() {
|
1358
|
-
return this.attributes[
|
1399
|
+
return this.attributes[
|
1400
|
+
"boxState"
|
1401
|
+
/* BoxState */
|
1402
|
+
];
|
1359
1403
|
}
|
1360
1404
|
setMainViewScenePath(scenePath) {
|
1361
1405
|
this.context.safeSetAttributes({ _mainScenePath: scenePath });
|
@@ -1364,44 +1408,84 @@ class AttributesDelegate {
|
|
1364
1408
|
this.context.safeSetAttributes({ _mainSceneIndex: index2 });
|
1365
1409
|
}
|
1366
1410
|
getMainViewCamera() {
|
1367
|
-
return get(this.attributes, [
|
1411
|
+
return get(this.attributes, [
|
1412
|
+
"mainViewCamera"
|
1413
|
+
/* MainViewCamera */
|
1414
|
+
]);
|
1368
1415
|
}
|
1369
1416
|
getMainViewSize() {
|
1370
|
-
return get(this.attributes, [
|
1417
|
+
return get(this.attributes, [
|
1418
|
+
"mainViewSize"
|
1419
|
+
/* MainViewSize */
|
1420
|
+
]);
|
1371
1421
|
}
|
1372
1422
|
setMainViewCamera(camera) {
|
1373
|
-
this.context.safeSetAttributes({ [
|
1423
|
+
this.context.safeSetAttributes({ [
|
1424
|
+
"mainViewCamera"
|
1425
|
+
/* MainViewCamera */
|
1426
|
+
]: { ...camera } });
|
1374
1427
|
}
|
1375
1428
|
setMainViewSize(size) {
|
1376
|
-
this.context.safeSetAttributes({ [
|
1429
|
+
this.context.safeSetAttributes({ [
|
1430
|
+
"mainViewSize"
|
1431
|
+
/* MainViewSize */
|
1432
|
+
]: { ...size } });
|
1377
1433
|
}
|
1378
1434
|
setMainViewCameraAndSize(camera, size) {
|
1379
1435
|
this.context.safeSetAttributes({
|
1380
|
-
[
|
1381
|
-
|
1436
|
+
[
|
1437
|
+
"mainViewCamera"
|
1438
|
+
/* MainViewCamera */
|
1439
|
+
]: { ...camera },
|
1440
|
+
[
|
1441
|
+
"mainViewSize"
|
1442
|
+
/* MainViewSize */
|
1443
|
+
]: { ...size }
|
1382
1444
|
});
|
1383
1445
|
}
|
1384
1446
|
updateCursor(uid, position) {
|
1385
|
-
if (!get(this.attributes, [
|
1386
|
-
|
1447
|
+
if (!get(this.attributes, [
|
1448
|
+
"cursors"
|
1449
|
+
/* Cursors */
|
1450
|
+
])) {
|
1451
|
+
this.context.safeUpdateAttributes([
|
1452
|
+
"cursors"
|
1453
|
+
/* Cursors */
|
1454
|
+
], {});
|
1387
1455
|
}
|
1388
1456
|
if (!get(this.attributes, ["cursors", uid])) {
|
1389
1457
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1390
1458
|
}
|
1391
|
-
this.context.safeUpdateAttributes([
|
1459
|
+
this.context.safeUpdateAttributes([
|
1460
|
+
"cursors",
|
1461
|
+
uid,
|
1462
|
+
"position"
|
1463
|
+
/* Position */
|
1464
|
+
], position);
|
1392
1465
|
}
|
1393
1466
|
updateCursorState(uid, cursorState) {
|
1394
1467
|
if (!get(this.attributes, ["cursors", uid])) {
|
1395
1468
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1396
1469
|
}
|
1397
|
-
this.context.safeUpdateAttributes([
|
1470
|
+
this.context.safeUpdateAttributes([
|
1471
|
+
"cursors",
|
1472
|
+
uid,
|
1473
|
+
"cursorState"
|
1474
|
+
/* CursorState */
|
1475
|
+
], cursorState);
|
1398
1476
|
}
|
1399
1477
|
getCursorState(uid) {
|
1400
|
-
return get(this.attributes, [
|
1478
|
+
return get(this.attributes, [
|
1479
|
+
"cursors",
|
1480
|
+
uid,
|
1481
|
+
"cursorState"
|
1482
|
+
/* CursorState */
|
1483
|
+
]);
|
1401
1484
|
}
|
1402
1485
|
cleanCursor(uid) {
|
1403
1486
|
this.context.safeUpdateAttributes(["cursors", uid], void 0);
|
1404
1487
|
}
|
1488
|
+
// TODO 状态中保存一个 SceneName 优化性能
|
1405
1489
|
setMainViewFocusPath(mainView) {
|
1406
1490
|
const scenePath = this.getMainViewScenePath();
|
1407
1491
|
if (scenePath) {
|
@@ -1849,6 +1933,7 @@ class AppProxy {
|
|
1849
1933
|
throw new Error(`[WindowManager]: app setup error: ${error.message}`);
|
1850
1934
|
}
|
1851
1935
|
}
|
1936
|
+
// 兼容移动端创建时会出现 PPT 不适配的问题
|
1852
1937
|
fixMobileSize() {
|
1853
1938
|
var _a, _b;
|
1854
1939
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(this.id);
|
@@ -1979,6 +2064,7 @@ class AppProxy {
|
|
1979
2064
|
get pageState() {
|
1980
2065
|
return this._pageState.toObject();
|
1981
2066
|
}
|
2067
|
+
// PageRemoveService
|
1982
2068
|
async removeSceneByIndex(index2) {
|
1983
2069
|
const scenePath = this._pageState.getFullPath(index2);
|
1984
2070
|
if (scenePath && this.pageState) {
|
@@ -2002,6 +2088,7 @@ class AppProxy {
|
|
2002
2088
|
this.view.focusSceneIndex = index2;
|
2003
2089
|
}
|
2004
2090
|
}
|
2091
|
+
// PageRemoveService end
|
2005
2092
|
setSceneIndex(index2) {
|
2006
2093
|
if (this.view) {
|
2007
2094
|
this.view.focusSceneIndex = index2;
|
@@ -2513,8 +2600,8 @@ const createScrollStorage = (manager) => {
|
|
2513
2600
|
defaultState: { scrollTop: 0 }
|
2514
2601
|
});
|
2515
2602
|
};
|
2516
|
-
function clamp$2(
|
2517
|
-
return
|
2603
|
+
function clamp$2(x, min, max) {
|
2604
|
+
return x < min ? min : x > max ? max : x;
|
2518
2605
|
}
|
2519
2606
|
class ScrollMode {
|
2520
2607
|
constructor(manager) {
|
@@ -3073,6 +3160,10 @@ class AppManager {
|
|
3073
3160
|
});
|
3074
3161
|
});
|
3075
3162
|
}
|
3163
|
+
/**
|
3164
|
+
* 根目录被删除时所有的 scene 都会被删除.
|
3165
|
+
* 所以需要关掉所有开启了 view 的 app
|
3166
|
+
*/
|
3076
3167
|
async onRootDirRemoved(needClose = true) {
|
3077
3168
|
await this.setMainViewScenePath(INIT_DIR);
|
3078
3169
|
this.createRootDirScenesCallback();
|
@@ -3177,6 +3268,12 @@ class AppManager {
|
|
3177
3268
|
return () => redoUndo.destroy();
|
3178
3269
|
});
|
3179
3270
|
}
|
3271
|
+
/**
|
3272
|
+
* 插件更新 apps 时的回调
|
3273
|
+
*
|
3274
|
+
* @param {*} apps
|
3275
|
+
* @memberof WindowManager
|
3276
|
+
*/
|
3180
3277
|
async _attributesUpdateCallback(apps) {
|
3181
3278
|
if (apps && WindowManager.container) {
|
3182
3279
|
const appIds = Object.keys(apps);
|
@@ -3443,6 +3540,20 @@ class AppManager {
|
|
3443
3540
|
(_a = this.scrollMode) == null ? void 0 : _a.dispose();
|
3444
3541
|
}
|
3445
3542
|
}
|
3543
|
+
/*! *****************************************************************************
|
3544
|
+
Copyright (c) Microsoft Corporation.
|
3545
|
+
|
3546
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
3547
|
+
purpose with or without fee is hereby granted.
|
3548
|
+
|
3549
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
3550
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
3551
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
3552
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
3553
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
3554
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
3555
|
+
PERFORMANCE OF THIS SOFTWARE.
|
3556
|
+
***************************************************************************** */
|
3446
3557
|
var __assign = function() {
|
3447
3558
|
__assign = Object.assign || function __assign2(t) {
|
3448
3559
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -4251,6 +4362,9 @@ function index(nodeOrSelector, props) {
|
|
4251
4362
|
var node = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
4252
4363
|
return getStyler(node, props);
|
4253
4364
|
}
|
4365
|
+
function getDefaultExportFromCjs(x) {
|
4366
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
4367
|
+
}
|
4254
4368
|
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
4255
4369
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
4256
4370
|
if (ret !== void 0) {
|
@@ -4282,6 +4396,7 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
4282
4396
|
}
|
4283
4397
|
return true;
|
4284
4398
|
};
|
4399
|
+
const shallowequal$1 = /* @__PURE__ */ getDefaultExportFromCjs(shallowequal);
|
4285
4400
|
var shadowStyles = /* @__PURE__ */ (() => '.tele-fancy-scrollbar {\n overscroll-behavior: contain;\n overflow: auto;\n overflow-y: scroll;\n overflow-y: overlay;\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n scrollbar-width: auto;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar {\n height: 8px;\n width: 8px;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-track {\n background-color: transparent;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb {\n background-color: rgba(68, 78, 96, 0.1);\n background-color: transparent;\n border-radius: 4px;\n transition: background-color 0.4s;\n}\n.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb {\n background-color: rgba(68, 78, 96, 0.1);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover {\n background-color: rgba(68, 78, 96, 0.2);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active {\n background-color: rgba(68, 78, 96, 0.2);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical {\n min-height: 50px;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal {\n min-width: 50px;\n}\n.telebox-quarantine {\n all: initial;\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.telebox-body-wrap {\n color: #191919;\n color: var(--tele-boxColor, #191919);\n flex: 1;\n width: 100%;\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n}\n.telebox-content {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #f9f9f9;\n background-color: var(--tele-boxContainerBackground, #f9f9f9);\n}\n.telebox-box-stage {\n position: absolute;\n z-index: 1;\n overflow: hidden;\n background-color: #fff;\n background-color: var(--tele-boxStageBackground, #fff);\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);\n box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.08));\n}\n.telebox-footer-wrap {\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n color: #191919;\n color: var(--tele-boxFooterColor, #191919);\n background-color: #fff;\n background-color: var(--tele-boxFooterBackground, #fff);\n}\n.telebox-footer-wrap::before {\n content: "";\n display: block;\n flex: 1;\n}\n.telebox-color-scheme-dark {\n color-scheme: dark;\n}\n.telebox-color-scheme-dark .telebox-body-wrap {\n color: #e9e9e9;\n color: var(--tele-boxColor, #e9e9e9);\n}\n.telebox-color-scheme-dark .telebox-content {\n background-color: #25282e;\n background-color: var(--tele-boxContainerBackground, #25282e);\n}\n.telebox-color-scheme-dark .telebox-box-stage {\n background-color: #272a30;\n background-color: var(--tele-boxStageBackground, #272a30);\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.24);\n box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.24));\n}\n.telebox-color-scheme-dark .telebox-footer-wrap {\n color: #e9e9e9;\n color: var(--tele-boxFooterColor, #e9e9e9);\n background-color: #383b42;\n background-color: var(--tele-boxFooterBackground, #383b42);\n}')();
|
4286
4401
|
var TELE_BOX_COLOR_SCHEME = /* @__PURE__ */ ((TELE_BOX_COLOR_SCHEME2) => {
|
4287
4402
|
TELE_BOX_COLOR_SCHEME2["Light"] = "light";
|
@@ -4521,7 +4636,7 @@ class TeleBox {
|
|
4521
4636
|
height = 0.5,
|
4522
4637
|
minWidth = 0,
|
4523
4638
|
minHeight = 0,
|
4524
|
-
x
|
4639
|
+
x = 0.1,
|
4525
4640
|
y = 0.1,
|
4526
4641
|
resizable = true,
|
4527
4642
|
draggable = true,
|
@@ -4580,36 +4695,36 @@ class TeleBox {
|
|
4580
4695
|
const minSize$ = new Val({
|
4581
4696
|
width: clamp(minWidth, 0, 1),
|
4582
4697
|
height: clamp(minHeight, 0, 1)
|
4583
|
-
}, { compare: shallowequal });
|
4698
|
+
}, { compare: shallowequal$1 });
|
4584
4699
|
const pxMinSize$ = combine([minSize$, managerStageRect$], ([minSize, managerStageRect]) => ({
|
4585
4700
|
width: minSize.width * managerStageRect.width,
|
4586
4701
|
height: minSize.height * managerStageRect.height
|
4587
|
-
}), { compare: shallowequal });
|
4588
|
-
const intrinsicSize$ = new Val({ width, height }, { compare: shallowequal });
|
4702
|
+
}), { compare: shallowequal$1 });
|
4703
|
+
const intrinsicSize$ = new Val({ width, height }, { compare: shallowequal$1 });
|
4589
4704
|
this._sideEffect.addDisposer(minSize$.reaction((minSize, skipUpdate) => {
|
4590
4705
|
intrinsicSize$.setValue({
|
4591
4706
|
width: Math.max(width, minSize.width),
|
4592
4707
|
height: Math.max(height, minSize.height)
|
4593
4708
|
}, skipUpdate);
|
4594
4709
|
}));
|
4595
|
-
const intrinsicCoord$ = new Val({ x
|
4710
|
+
const intrinsicCoord$ = new Val({ x, y }, { compare: shallowequal$1 });
|
4596
4711
|
const pxIntrinsicSize$ = combine([intrinsicSize$, managerStageRect$], ([size, managerStageRect]) => ({
|
4597
4712
|
width: managerStageRect.width * size.width,
|
4598
4713
|
height: managerStageRect.height * size.height
|
4599
|
-
}), { compare: shallowequal });
|
4714
|
+
}), { compare: shallowequal$1 });
|
4600
4715
|
const pxIntrinsicCoord$ = combine([intrinsicCoord$, managerStageRect$], ([intrinsicCoord, managerStageRect]) => ({
|
4601
4716
|
x: intrinsicCoord.x * managerStageRect.width,
|
4602
4717
|
y: intrinsicCoord.y * managerStageRect.height
|
4603
|
-
}), { compare: shallowequal });
|
4718
|
+
}), { compare: shallowequal$1 });
|
4604
4719
|
const bodyStyle$ = new Val(bodyStyle);
|
4605
4720
|
const stageStyle$ = new Val(stageStyle);
|
4606
4721
|
const contentRoot$ = new Val(null);
|
4607
4722
|
const bodyRect$ = new Val(managerStageRect$.value, {
|
4608
|
-
compare: shallowequal
|
4723
|
+
compare: shallowequal$1
|
4609
4724
|
});
|
4610
4725
|
const stageRatio$ = new Val(stageRatio);
|
4611
4726
|
const finalStageRatio$ = combine([stageRatio$, managerStageRatio$], ([stageRatio2, managerStageRatio]) => stageRatio2 != null ? stageRatio2 : managerStageRatio);
|
4612
|
-
const stageRect$ = combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal });
|
4727
|
+
const stageRect$ = combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal$1 });
|
4613
4728
|
const propsValConfig = {
|
4614
4729
|
darkMode: darkMode$,
|
4615
4730
|
fence: fence$,
|
@@ -4742,16 +4857,16 @@ class TeleBox {
|
|
4742
4857
|
get intrinsicHeight() {
|
4743
4858
|
return this._intrinsicSize$.value.height;
|
4744
4859
|
}
|
4745
|
-
move(
|
4860
|
+
move(x, y, skipUpdate = false) {
|
4746
4861
|
let safeX;
|
4747
4862
|
let safeY;
|
4748
4863
|
const managerStageRect = this.managerStageRect;
|
4749
4864
|
const pxIntrinsicSize = this.pxIntrinsicSize;
|
4750
4865
|
if (this.fence) {
|
4751
|
-
safeX = clamp(
|
4866
|
+
safeX = clamp(x, 0, managerStageRect.width - pxIntrinsicSize.width);
|
4752
4867
|
safeY = clamp(y, 0, managerStageRect.height - pxIntrinsicSize.height);
|
4753
4868
|
} else {
|
4754
|
-
safeX = clamp(
|
4869
|
+
safeX = clamp(x, -(pxIntrinsicSize.width - 120), 0 + managerStageRect.width - 20);
|
4755
4870
|
safeY = clamp(y, 0, 0 + managerStageRect.height - 20);
|
4756
4871
|
}
|
4757
4872
|
this._intrinsicCoord$.setValue({
|
@@ -4759,7 +4874,7 @@ class TeleBox {
|
|
4759
4874
|
y: safeY / managerStageRect.height
|
4760
4875
|
}, skipUpdate);
|
4761
4876
|
}
|
4762
|
-
transform(
|
4877
|
+
transform(x, y, width, height, skipUpdate = false) {
|
4763
4878
|
const managerStageRect = this.managerStageRect;
|
4764
4879
|
width = Math.max(width, this.pxMinSize.width);
|
4765
4880
|
height = Math.max(height, this.pxMinSize.height);
|
@@ -4774,7 +4889,7 @@ class TeleBox {
|
|
4774
4889
|
y = 0;
|
4775
4890
|
height = this.pxIntrinsicSize.height;
|
4776
4891
|
}
|
4777
|
-
this.move(
|
4892
|
+
this.move(x, y, skipUpdate);
|
4778
4893
|
this._intrinsicSize$.setValue({
|
4779
4894
|
width: width / managerStageRect.width,
|
4780
4895
|
height: height / managerStageRect.height
|
@@ -4919,7 +5034,7 @@ class TeleBox {
|
|
4919
5034
|
styles.scaleY = collectorRect.height / boxHeight;
|
4920
5035
|
}
|
4921
5036
|
return styles;
|
4922
|
-
}, { compare: shallowequal });
|
5037
|
+
}, { compare: shallowequal$1 });
|
4923
5038
|
const boxStyles = boxStyles$.value;
|
4924
5039
|
this.$box.style.width = boxStyles.width + "px";
|
4925
5040
|
this.$box.style.height = boxStyles.height + "px";
|
@@ -5233,10 +5348,10 @@ class TeleBoxCollector {
|
|
5233
5348
|
}),
|
5234
5349
|
minimized$.subscribe((minimized) => {
|
5235
5350
|
if (minimized) {
|
5236
|
-
const { x
|
5351
|
+
const { x, y, width, height } = $collector.getBoundingClientRect();
|
5237
5352
|
const rootRect = root.getBoundingClientRect();
|
5238
5353
|
rect$.setValue({
|
5239
|
-
x:
|
5354
|
+
x: x - rootRect.x,
|
5240
5355
|
y: y - rootRect.y,
|
5241
5356
|
width,
|
5242
5357
|
height
|
@@ -5403,7 +5518,7 @@ class TeleBoxManager {
|
|
5403
5518
|
y: 0,
|
5404
5519
|
width: window.innerWidth,
|
5405
5520
|
height: window.innerHeight
|
5406
|
-
}, { compare: shallowequal });
|
5521
|
+
}, { compare: shallowequal$1 });
|
5407
5522
|
this._sideEffect.addDisposer(root$.subscribe((root2) => {
|
5408
5523
|
this._sideEffect.add(() => {
|
5409
5524
|
if (!root2) {
|
@@ -5423,7 +5538,7 @@ class TeleBoxManager {
|
|
5423
5538
|
}, "calc-root-rect");
|
5424
5539
|
}));
|
5425
5540
|
const stageRect$ = combine([rootRect$, stageRatio$], calcStageRect, {
|
5426
|
-
compare: shallowequal
|
5541
|
+
compare: shallowequal$1
|
5427
5542
|
});
|
5428
5543
|
this.boxes$ = new Val([]);
|
5429
5544
|
this.topBox$ = new Val(void 0);
|
@@ -5461,7 +5576,7 @@ class TeleBoxManager {
|
|
5461
5576
|
const darkMode$ = combine([prefersDark$, prefersColorScheme$], ([prefersDark, prefersColorScheme2]) => prefersColorScheme2 === "auto" ? prefersDark : prefersColorScheme2 === "dark");
|
5462
5577
|
const state$ = combine([minimized$, maximized$], ([minimized2, maximized2]) => minimized2 ? TELE_BOX_STATE.Minimized : maximized2 ? TELE_BOX_STATE.Maximized : TELE_BOX_STATE.Normal);
|
5463
5578
|
const theme$ = new Val(theme, {
|
5464
|
-
compare: shallowequal
|
5579
|
+
compare: shallowequal$1
|
5465
5580
|
});
|
5466
5581
|
const readonlyValConfig = {
|
5467
5582
|
darkMode: darkMode$,
|
@@ -5880,11 +5995,11 @@ class TeleBoxManager {
|
|
5880
5995
|
}
|
5881
5996
|
}
|
5882
5997
|
smartPosition(rect) {
|
5883
|
-
let { x
|
5998
|
+
let { x, y } = rect;
|
5884
5999
|
const { width = 0.5, height = 0.5 } = rect;
|
5885
6000
|
const stageRect = this.stageRect;
|
5886
6001
|
const topBox = this.topBox;
|
5887
|
-
if (
|
6002
|
+
if (x == null) {
|
5888
6003
|
let pxX = 20;
|
5889
6004
|
if (topBox) {
|
5890
6005
|
const pxPreferredX = topBox.pxIntrinsicCoord.x + 20;
|
@@ -5893,7 +6008,7 @@ class TeleBoxManager {
|
|
5893
6008
|
pxX = pxPreferredX;
|
5894
6009
|
}
|
5895
6010
|
}
|
5896
|
-
|
6011
|
+
x = pxX / stageRect.width;
|
5897
6012
|
}
|
5898
6013
|
if (y == null) {
|
5899
6014
|
let pxY = 20;
|
@@ -5906,7 +6021,7 @@ class TeleBoxManager {
|
|
5906
6021
|
}
|
5907
6022
|
y = pxY / stageRect.height;
|
5908
6023
|
}
|
5909
|
-
return { x
|
6024
|
+
return { x, y, width, height };
|
5910
6025
|
}
|
5911
6026
|
makeBoxTop(box, skipUpdate = false) {
|
5912
6027
|
if (this.topBox) {
|
@@ -5957,6 +6072,7 @@ class BoxManager {
|
|
5957
6072
|
const { emitter: emitter2, callbacks: callbacks2, boxEmitter: boxEmitter2 } = context;
|
5958
6073
|
this.teleBoxManager = this.setupBoxManager(createTeleBoxManagerConfig);
|
5959
6074
|
this.sideEffectManager.add(() => [
|
6075
|
+
// 使用 _xxx$.reaction 订阅修改的值, 不管有没有 skipUpdate, 修改值都会触发回调
|
5960
6076
|
this.teleBoxManager.onValChanged("state", (state) => {
|
5961
6077
|
callbacks2.emit("boxStateChange", state);
|
5962
6078
|
emitter2.emit("boxStateChange", state);
|
@@ -6173,10 +6289,10 @@ class BoxManager {
|
|
6173
6289
|
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
6174
6290
|
}
|
6175
6291
|
}
|
6176
|
-
moveBox({ appId, x
|
6292
|
+
moveBox({ appId, x, y }) {
|
6177
6293
|
const box = this.getBox(appId);
|
6178
6294
|
if (box) {
|
6179
|
-
box._intrinsicCoord$.setValue({ x
|
6295
|
+
box._intrinsicCoord$.setValue({ x, y }, true);
|
6180
6296
|
}
|
6181
6297
|
}
|
6182
6298
|
focusBox({ appId }, skipUpdate = true) {
|
@@ -6275,6 +6391,9 @@ function src_url_equal(element_src, url) {
|
|
6275
6391
|
function is_empty(obj) {
|
6276
6392
|
return Object.keys(obj).length === 0;
|
6277
6393
|
}
|
6394
|
+
/* @__PURE__ */ new Set();
|
6395
|
+
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
6396
|
+
"WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
6278
6397
|
function append(target, node) {
|
6279
6398
|
target.appendChild(node);
|
6280
6399
|
}
|
@@ -6306,25 +6425,27 @@ function children(element2) {
|
|
6306
6425
|
}
|
6307
6426
|
function set_data(text2, data) {
|
6308
6427
|
data = "" + data;
|
6309
|
-
if (text2.
|
6310
|
-
|
6428
|
+
if (text2.data === data)
|
6429
|
+
return;
|
6430
|
+
text2.data = data;
|
6311
6431
|
}
|
6312
6432
|
function set_style(node, key, value, important) {
|
6313
|
-
if (value
|
6433
|
+
if (value == null) {
|
6314
6434
|
node.style.removeProperty(key);
|
6315
6435
|
} else {
|
6316
6436
|
node.style.setProperty(key, value, important ? "important" : "");
|
6317
6437
|
}
|
6318
6438
|
}
|
6439
|
+
/* @__PURE__ */ new Map();
|
6319
6440
|
let current_component;
|
6320
6441
|
function set_current_component(component) {
|
6321
6442
|
current_component = component;
|
6322
6443
|
}
|
6323
6444
|
const dirty_components = [];
|
6324
6445
|
const binding_callbacks = [];
|
6325
|
-
|
6446
|
+
let render_callbacks = [];
|
6326
6447
|
const flush_callbacks = [];
|
6327
|
-
const resolved_promise = Promise.resolve();
|
6448
|
+
const resolved_promise = /* @__PURE__ */ Promise.resolve();
|
6328
6449
|
let update_scheduled = false;
|
6329
6450
|
function schedule_update() {
|
6330
6451
|
if (!update_scheduled) {
|
@@ -6338,13 +6459,22 @@ function add_render_callback(fn) {
|
|
6338
6459
|
const seen_callbacks = /* @__PURE__ */ new Set();
|
6339
6460
|
let flushidx = 0;
|
6340
6461
|
function flush() {
|
6462
|
+
if (flushidx !== 0) {
|
6463
|
+
return;
|
6464
|
+
}
|
6341
6465
|
const saved_component = current_component;
|
6342
6466
|
do {
|
6343
|
-
|
6344
|
-
|
6345
|
-
|
6346
|
-
|
6347
|
-
|
6467
|
+
try {
|
6468
|
+
while (flushidx < dirty_components.length) {
|
6469
|
+
const component = dirty_components[flushidx];
|
6470
|
+
flushidx++;
|
6471
|
+
set_current_component(component);
|
6472
|
+
update(component.$$);
|
6473
|
+
}
|
6474
|
+
} catch (e) {
|
6475
|
+
dirty_components.length = 0;
|
6476
|
+
flushidx = 0;
|
6477
|
+
throw e;
|
6348
6478
|
}
|
6349
6479
|
set_current_component(null);
|
6350
6480
|
dirty_components.length = 0;
|
@@ -6377,6 +6507,13 @@ function update($$) {
|
|
6377
6507
|
$$.after_update.forEach(add_render_callback);
|
6378
6508
|
}
|
6379
6509
|
}
|
6510
|
+
function flush_render_callbacks(fns) {
|
6511
|
+
const filtered = [];
|
6512
|
+
const targets = [];
|
6513
|
+
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
6514
|
+
targets.forEach((c) => c());
|
6515
|
+
render_callbacks = filtered;
|
6516
|
+
}
|
6380
6517
|
const outroing = /* @__PURE__ */ new Set();
|
6381
6518
|
function transition_in(block, local) {
|
6382
6519
|
if (block && block.i) {
|
@@ -6384,6 +6521,34 @@ function transition_in(block, local) {
|
|
6384
6521
|
block.i(local);
|
6385
6522
|
}
|
6386
6523
|
}
|
6524
|
+
const _boolean_attributes = [
|
6525
|
+
"allowfullscreen",
|
6526
|
+
"allowpaymentrequest",
|
6527
|
+
"async",
|
6528
|
+
"autofocus",
|
6529
|
+
"autoplay",
|
6530
|
+
"checked",
|
6531
|
+
"controls",
|
6532
|
+
"default",
|
6533
|
+
"defer",
|
6534
|
+
"disabled",
|
6535
|
+
"formnovalidate",
|
6536
|
+
"hidden",
|
6537
|
+
"inert",
|
6538
|
+
"ismap",
|
6539
|
+
"loop",
|
6540
|
+
"multiple",
|
6541
|
+
"muted",
|
6542
|
+
"nomodule",
|
6543
|
+
"novalidate",
|
6544
|
+
"open",
|
6545
|
+
"playsinline",
|
6546
|
+
"readonly",
|
6547
|
+
"required",
|
6548
|
+
"reversed",
|
6549
|
+
"selected"
|
6550
|
+
];
|
6551
|
+
/* @__PURE__ */ new Set([..._boolean_attributes]);
|
6387
6552
|
function mount_component(component, target, anchor, customElement) {
|
6388
6553
|
const { fragment, after_update } = component.$$;
|
6389
6554
|
fragment && fragment.m(target, anchor);
|
@@ -6403,6 +6568,7 @@ function mount_component(component, target, anchor, customElement) {
|
|
6403
6568
|
function destroy_component(component, detaching) {
|
6404
6569
|
const $$ = component.$$;
|
6405
6570
|
if ($$.fragment !== null) {
|
6571
|
+
flush_render_callbacks($$.after_update);
|
6406
6572
|
run_all($$.on_destroy);
|
6407
6573
|
$$.fragment && $$.fragment.d(detaching);
|
6408
6574
|
$$.on_destroy = $$.fragment = null;
|
@@ -6423,16 +6589,19 @@ function init(component, options, instance2, create_fragment2, not_equal, props,
|
|
6423
6589
|
const $$ = component.$$ = {
|
6424
6590
|
fragment: null,
|
6425
6591
|
ctx: [],
|
6592
|
+
// state
|
6426
6593
|
props,
|
6427
6594
|
update: noop,
|
6428
6595
|
not_equal,
|
6429
6596
|
bound: blank_object(),
|
6597
|
+
// lifecycle
|
6430
6598
|
on_mount: [],
|
6431
6599
|
on_destroy: [],
|
6432
6600
|
on_disconnect: [],
|
6433
6601
|
before_update: [],
|
6434
6602
|
after_update: [],
|
6435
6603
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
6604
|
+
// everything else
|
6436
6605
|
callbacks: blank_object(),
|
6437
6606
|
dirty,
|
6438
6607
|
skip_bound: false,
|
@@ -6502,8 +6671,14 @@ function create_if_block(ctx) {
|
|
6502
6671
|
let t1;
|
6503
6672
|
let t2;
|
6504
6673
|
let div1_class_value;
|
6505
|
-
let if_block0 =
|
6506
|
-
|
6674
|
+
let if_block0 = (
|
6675
|
+
/*hasAvatar*/
|
6676
|
+
ctx[16] && create_if_block_2(ctx)
|
6677
|
+
);
|
6678
|
+
let if_block1 = (
|
6679
|
+
/*hasTagName*/
|
6680
|
+
ctx[17] && create_if_block_1(ctx)
|
6681
|
+
);
|
6507
6682
|
return {
|
6508
6683
|
c() {
|
6509
6684
|
div1 = element("div");
|
@@ -6512,7 +6687,10 @@ function create_if_block(ctx) {
|
|
6512
6687
|
if_block0.c();
|
6513
6688
|
t0 = space();
|
6514
6689
|
span = element("span");
|
6515
|
-
t1 = text$1(
|
6690
|
+
t1 = text$1(
|
6691
|
+
/*cursorName*/
|
6692
|
+
ctx[0]
|
6693
|
+
);
|
6516
6694
|
t2 = space();
|
6517
6695
|
if (if_block1)
|
6518
6696
|
if_block1.c();
|
@@ -6520,11 +6698,33 @@ function create_if_block(ctx) {
|
|
6520
6698
|
set_style(span, "white-space", "nowrap");
|
6521
6699
|
set_style(span, "text-overflow", "ellipsis");
|
6522
6700
|
set_style(span, "max-width", "80px");
|
6523
|
-
attr(
|
6524
|
-
|
6525
|
-
|
6526
|
-
|
6527
|
-
|
6701
|
+
attr(
|
6702
|
+
div0,
|
6703
|
+
"class",
|
6704
|
+
/*theme*/
|
6705
|
+
ctx[8]
|
6706
|
+
);
|
6707
|
+
set_style(
|
6708
|
+
div0,
|
6709
|
+
"background-color",
|
6710
|
+
/*backgroundColor*/
|
6711
|
+
ctx[2]
|
6712
|
+
);
|
6713
|
+
set_style(
|
6714
|
+
div0,
|
6715
|
+
"color",
|
6716
|
+
/*color*/
|
6717
|
+
ctx[9]
|
6718
|
+
);
|
6719
|
+
set_style(
|
6720
|
+
div0,
|
6721
|
+
"opacity",
|
6722
|
+
/*opacity*/
|
6723
|
+
ctx[11]
|
6724
|
+
);
|
6725
|
+
attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6726
|
+
ctx[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6727
|
+
ctx[13]);
|
6528
6728
|
},
|
6529
6729
|
m(target, anchor) {
|
6530
6730
|
insert(target, div1, anchor);
|
@@ -6539,7 +6739,10 @@ function create_if_block(ctx) {
|
|
6539
6739
|
if_block1.m(div0, null);
|
6540
6740
|
},
|
6541
6741
|
p(ctx2, dirty) {
|
6542
|
-
if (
|
6742
|
+
if (
|
6743
|
+
/*hasAvatar*/
|
6744
|
+
ctx2[16]
|
6745
|
+
) {
|
6543
6746
|
if (if_block0) {
|
6544
6747
|
if_block0.p(ctx2, dirty);
|
6545
6748
|
} else {
|
@@ -6551,9 +6754,17 @@ function create_if_block(ctx) {
|
|
6551
6754
|
if_block0.d(1);
|
6552
6755
|
if_block0 = null;
|
6553
6756
|
}
|
6554
|
-
if (dirty &
|
6555
|
-
|
6556
|
-
|
6757
|
+
if (dirty & /*cursorName*/
|
6758
|
+
1)
|
6759
|
+
set_data(
|
6760
|
+
t1,
|
6761
|
+
/*cursorName*/
|
6762
|
+
ctx2[0]
|
6763
|
+
);
|
6764
|
+
if (
|
6765
|
+
/*hasTagName*/
|
6766
|
+
ctx2[17]
|
6767
|
+
) {
|
6557
6768
|
if (if_block1) {
|
6558
6769
|
if_block1.p(ctx2, dirty);
|
6559
6770
|
} else {
|
@@ -6565,19 +6776,46 @@ function create_if_block(ctx) {
|
|
6565
6776
|
if_block1.d(1);
|
6566
6777
|
if_block1 = null;
|
6567
6778
|
}
|
6568
|
-
if (dirty &
|
6569
|
-
|
6779
|
+
if (dirty & /*theme*/
|
6780
|
+
256) {
|
6781
|
+
attr(
|
6782
|
+
div0,
|
6783
|
+
"class",
|
6784
|
+
/*theme*/
|
6785
|
+
ctx2[8]
|
6786
|
+
);
|
6570
6787
|
}
|
6571
|
-
if (dirty &
|
6572
|
-
|
6788
|
+
if (dirty & /*backgroundColor*/
|
6789
|
+
4) {
|
6790
|
+
set_style(
|
6791
|
+
div0,
|
6792
|
+
"background-color",
|
6793
|
+
/*backgroundColor*/
|
6794
|
+
ctx2[2]
|
6795
|
+
);
|
6573
6796
|
}
|
6574
|
-
if (dirty &
|
6575
|
-
|
6797
|
+
if (dirty & /*color*/
|
6798
|
+
512) {
|
6799
|
+
set_style(
|
6800
|
+
div0,
|
6801
|
+
"color",
|
6802
|
+
/*color*/
|
6803
|
+
ctx2[9]
|
6804
|
+
);
|
6576
6805
|
}
|
6577
|
-
if (dirty &
|
6578
|
-
|
6806
|
+
if (dirty & /*opacity*/
|
6807
|
+
2048) {
|
6808
|
+
set_style(
|
6809
|
+
div0,
|
6810
|
+
"opacity",
|
6811
|
+
/*opacity*/
|
6812
|
+
ctx2[11]
|
6813
|
+
);
|
6579
6814
|
}
|
6580
|
-
if (dirty &
|
6815
|
+
if (dirty & /*offset, pencilEraserSize3ImageOffset*/
|
6816
|
+
24576 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6817
|
+
ctx2[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6818
|
+
ctx2[13])) {
|
6581
6819
|
attr(div1, "class", div1_class_value);
|
6582
6820
|
}
|
6583
6821
|
},
|
@@ -6598,8 +6836,14 @@ function create_if_block_2(ctx) {
|
|
6598
6836
|
c() {
|
6599
6837
|
img = element("img");
|
6600
6838
|
attr(img, "class", "netless-window-manager-cursor-selector-avatar");
|
6601
|
-
attr(
|
6602
|
-
|
6839
|
+
attr(
|
6840
|
+
img,
|
6841
|
+
"style",
|
6842
|
+
/*computedAvatarStyle*/
|
6843
|
+
ctx[18]()
|
6844
|
+
);
|
6845
|
+
if (!src_url_equal(img.src, img_src_value = /*avatar*/
|
6846
|
+
ctx[7]))
|
6603
6847
|
attr(img, "src", img_src_value);
|
6604
6848
|
attr(img, "alt", "avatar");
|
6605
6849
|
},
|
@@ -6607,7 +6851,9 @@ function create_if_block_2(ctx) {
|
|
6607
6851
|
insert(target, img, anchor);
|
6608
6852
|
},
|
6609
6853
|
p(ctx2, dirty) {
|
6610
|
-
if (dirty &
|
6854
|
+
if (dirty & /*avatar*/
|
6855
|
+
128 && !src_url_equal(img.src, img_src_value = /*avatar*/
|
6856
|
+
ctx2[7])) {
|
6611
6857
|
attr(img, "src", img_src_value);
|
6612
6858
|
}
|
6613
6859
|
},
|
@@ -6623,19 +6869,38 @@ function create_if_block_1(ctx) {
|
|
6623
6869
|
return {
|
6624
6870
|
c() {
|
6625
6871
|
span = element("span");
|
6626
|
-
t = text$1(
|
6872
|
+
t = text$1(
|
6873
|
+
/*tagName*/
|
6874
|
+
ctx[1]
|
6875
|
+
);
|
6627
6876
|
attr(span, "class", "netless-window-manager-cursor-tag-name");
|
6628
|
-
set_style(
|
6877
|
+
set_style(
|
6878
|
+
span,
|
6879
|
+
"background-color",
|
6880
|
+
/*cursorTagBackgroundColor*/
|
6881
|
+
ctx[10]
|
6882
|
+
);
|
6629
6883
|
},
|
6630
6884
|
m(target, anchor) {
|
6631
6885
|
insert(target, span, anchor);
|
6632
6886
|
append(span, t);
|
6633
6887
|
},
|
6634
6888
|
p(ctx2, dirty) {
|
6635
|
-
if (dirty &
|
6636
|
-
|
6637
|
-
|
6638
|
-
|
6889
|
+
if (dirty & /*tagName*/
|
6890
|
+
2)
|
6891
|
+
set_data(
|
6892
|
+
t,
|
6893
|
+
/*tagName*/
|
6894
|
+
ctx2[1]
|
6895
|
+
);
|
6896
|
+
if (dirty & /*cursorTagBackgroundColor*/
|
6897
|
+
1024) {
|
6898
|
+
set_style(
|
6899
|
+
span,
|
6900
|
+
"background-color",
|
6901
|
+
/*cursorTagBackgroundColor*/
|
6902
|
+
ctx2[10]
|
6903
|
+
);
|
6639
6904
|
}
|
6640
6905
|
},
|
6641
6906
|
d(detaching) {
|
@@ -6651,7 +6916,8 @@ function create_fragment(ctx) {
|
|
6651
6916
|
let img;
|
6652
6917
|
let img_class_value;
|
6653
6918
|
let img_src_value;
|
6654
|
-
let if_block =
|
6919
|
+
let if_block = !/*isLaserPointer*/
|
6920
|
+
ctx[12] && create_if_block(ctx);
|
6655
6921
|
return {
|
6656
6922
|
c() {
|
6657
6923
|
div1 = element("div");
|
@@ -6660,14 +6926,29 @@ function create_fragment(ctx) {
|
|
6660
6926
|
t = space();
|
6661
6927
|
div0 = element("div");
|
6662
6928
|
img = element("img");
|
6663
|
-
attr(img, "class", img_class_value = "netless-window-manager-cursor-" +
|
6664
|
-
|
6929
|
+
attr(img, "class", img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6930
|
+
ctx[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6931
|
+
ctx[13]);
|
6932
|
+
if (!src_url_equal(img.src, img_src_value = /*src*/
|
6933
|
+
ctx[6]))
|
6665
6934
|
attr(img, "src", img_src_value);
|
6666
|
-
attr(
|
6935
|
+
attr(
|
6936
|
+
img,
|
6937
|
+
"alt",
|
6938
|
+
/*appliance*/
|
6939
|
+
ctx[3]
|
6940
|
+
);
|
6667
6941
|
attr(div0, "class", "cursor-image-wrapper");
|
6668
6942
|
attr(div1, "class", "netless-window-manager-cursor-mid");
|
6669
|
-
set_style(div1, "transform", "translateX(" +
|
6670
|
-
|
6943
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
6944
|
+
ctx[4] + "px) translateY(" + /*y*/
|
6945
|
+
ctx[5] + "px)");
|
6946
|
+
set_style(
|
6947
|
+
div1,
|
6948
|
+
"display",
|
6949
|
+
/*display*/
|
6950
|
+
ctx[15]
|
6951
|
+
);
|
6671
6952
|
},
|
6672
6953
|
m(target, anchor) {
|
6673
6954
|
insert(target, div1, anchor);
|
@@ -6678,7 +6959,8 @@ function create_fragment(ctx) {
|
|
6678
6959
|
append(div0, img);
|
6679
6960
|
},
|
6680
6961
|
p(ctx2, [dirty]) {
|
6681
|
-
if (
|
6962
|
+
if (!/*isLaserPointer*/
|
6963
|
+
ctx2[12]) {
|
6682
6964
|
if (if_block) {
|
6683
6965
|
if_block.p(ctx2, dirty);
|
6684
6966
|
} else {
|
@@ -6690,20 +6972,40 @@ function create_fragment(ctx) {
|
|
6690
6972
|
if_block.d(1);
|
6691
6973
|
if_block = null;
|
6692
6974
|
}
|
6693
|
-
if (dirty &
|
6975
|
+
if (dirty & /*appliance, pencilEraserSize3ImageOffset*/
|
6976
|
+
8200 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6977
|
+
ctx2[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6978
|
+
ctx2[13])) {
|
6694
6979
|
attr(img, "class", img_class_value);
|
6695
6980
|
}
|
6696
|
-
if (dirty &
|
6981
|
+
if (dirty & /*src*/
|
6982
|
+
64 && !src_url_equal(img.src, img_src_value = /*src*/
|
6983
|
+
ctx2[6])) {
|
6697
6984
|
attr(img, "src", img_src_value);
|
6698
6985
|
}
|
6699
|
-
if (dirty &
|
6700
|
-
|
6701
|
-
|
6702
|
-
|
6703
|
-
|
6986
|
+
if (dirty & /*appliance*/
|
6987
|
+
8) {
|
6988
|
+
attr(
|
6989
|
+
img,
|
6990
|
+
"alt",
|
6991
|
+
/*appliance*/
|
6992
|
+
ctx2[3]
|
6993
|
+
);
|
6704
6994
|
}
|
6705
|
-
if (dirty &
|
6706
|
-
|
6995
|
+
if (dirty & /*x, y*/
|
6996
|
+
48) {
|
6997
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
6998
|
+
ctx2[4] + "px) translateY(" + /*y*/
|
6999
|
+
ctx2[5] + "px)");
|
7000
|
+
}
|
7001
|
+
if (dirty & /*display*/
|
7002
|
+
32768) {
|
7003
|
+
set_style(
|
7004
|
+
div1,
|
7005
|
+
"display",
|
7006
|
+
/*display*/
|
7007
|
+
ctx2[15]
|
7008
|
+
);
|
6707
7009
|
}
|
6708
7010
|
},
|
6709
7011
|
i: noop,
|
@@ -6729,7 +7031,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6729
7031
|
let { tagName } = $$props;
|
6730
7032
|
let { backgroundColor } = $$props;
|
6731
7033
|
let { appliance } = $$props;
|
6732
|
-
let { x
|
7034
|
+
let { x } = $$props;
|
6733
7035
|
let { y } = $$props;
|
6734
7036
|
let { src } = $$props;
|
6735
7037
|
let { visible } = $$props;
|
@@ -6758,7 +7060,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6758
7060
|
if ("appliance" in $$props2)
|
6759
7061
|
$$invalidate(3, appliance = $$props2.appliance);
|
6760
7062
|
if ("x" in $$props2)
|
6761
|
-
$$invalidate(4,
|
7063
|
+
$$invalidate(4, x = $$props2.x);
|
6762
7064
|
if ("y" in $$props2)
|
6763
7065
|
$$invalidate(5, y = $$props2.y);
|
6764
7066
|
if ("src" in $$props2)
|
@@ -6779,28 +7081,36 @@ function instance($$self, $$props, $$invalidate) {
|
|
6779
7081
|
$$invalidate(20, pencilEraserSize = $$props2.pencilEraserSize);
|
6780
7082
|
};
|
6781
7083
|
$$self.$$.update = () => {
|
6782
|
-
if ($$self.$$.dirty &
|
7084
|
+
if ($$self.$$.dirty & /*cursorName*/
|
7085
|
+
1) {
|
6783
7086
|
hasName = !isEmpty(cursorName);
|
6784
7087
|
}
|
6785
|
-
if ($$self.$$.dirty &
|
7088
|
+
if ($$self.$$.dirty & /*tagName*/
|
7089
|
+
2) {
|
6786
7090
|
$$invalidate(17, hasTagName = !isEmpty(tagName));
|
6787
7091
|
}
|
6788
|
-
if ($$self.$$.dirty &
|
7092
|
+
if ($$self.$$.dirty & /*avatar*/
|
7093
|
+
128) {
|
6789
7094
|
$$invalidate(16, hasAvatar = !isEmpty(avatar));
|
6790
7095
|
}
|
6791
|
-
if ($$self.$$.dirty &
|
7096
|
+
if ($$self.$$.dirty & /*visible*/
|
7097
|
+
524288) {
|
6792
7098
|
$$invalidate(15, display = visible ? "initial" : "none");
|
6793
7099
|
}
|
6794
|
-
if ($$self.$$.dirty &
|
7100
|
+
if ($$self.$$.dirty & /*appliance*/
|
7101
|
+
8) {
|
6795
7102
|
$$invalidate(12, isLaserPointer = appliance === ApplianceNames.laserPointer);
|
6796
7103
|
}
|
6797
|
-
if ($$self.$$.dirty &
|
7104
|
+
if ($$self.$$.dirty & /*isLaserPointer, appliance*/
|
7105
|
+
4104) {
|
6798
7106
|
$$invalidate(21, isLaserPointerPencilEraser = isLaserPointer || appliance === ApplianceNames.pencilEraser);
|
6799
7107
|
}
|
6800
|
-
if ($$self.$$.dirty &
|
7108
|
+
if ($$self.$$.dirty & /*isLaserPointerPencilEraser*/
|
7109
|
+
2097152) {
|
6801
7110
|
$$invalidate(14, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
|
6802
7111
|
}
|
6803
|
-
if ($$self.$$.dirty &
|
7112
|
+
if ($$self.$$.dirty & /*pencilEraserSize*/
|
7113
|
+
1048576) {
|
6804
7114
|
$$invalidate(13, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
|
6805
7115
|
}
|
6806
7116
|
};
|
@@ -6809,7 +7119,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6809
7119
|
tagName,
|
6810
7120
|
backgroundColor,
|
6811
7121
|
appliance,
|
6812
|
-
|
7122
|
+
x,
|
6813
7123
|
y,
|
6814
7124
|
src,
|
6815
7125
|
avatar,
|
@@ -6883,8 +7193,8 @@ class Cursor2 {
|
|
6883
7193
|
}
|
6884
7194
|
moveCursor(cursor, rect, view) {
|
6885
7195
|
var _a, _b;
|
6886
|
-
const { x
|
6887
|
-
const point = view == null ? void 0 : view.screen.convertPointToScreen(
|
7196
|
+
const { x, y, type } = cursor;
|
7197
|
+
const point = view == null ? void 0 : view.screen.convertPointToScreen(x, y);
|
6888
7198
|
if (point) {
|
6889
7199
|
let translateX = point.x - 2;
|
6890
7200
|
let translateY = point.y - 18;
|
@@ -8208,11 +8518,11 @@ let Y$1 = class Y {
|
|
8208
8518
|
sideEffect: s,
|
8209
8519
|
readonly$: i,
|
8210
8520
|
events: r,
|
8211
|
-
wrapClassName:
|
8521
|
+
wrapClassName: n,
|
8212
8522
|
root: l,
|
8213
8523
|
pagesIndex$: p
|
8214
8524
|
}) {
|
8215
|
-
this.showPreview$ = new Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName =
|
8525
|
+
this.showPreview$ = new Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = n, this.sideEffect.addDisposer(
|
8216
8526
|
this.events.on("togglePreview", () => {
|
8217
8527
|
this.showPreview$.setValue(!this.showPreview$.value);
|
8218
8528
|
})
|
@@ -8222,11 +8532,11 @@ let Y$1 = class Y {
|
|
8222
8532
|
const c = this.renderPreview(), u = this.renderPreviewMask();
|
8223
8533
|
if (a) {
|
8224
8534
|
l.appendChild(c), l.appendChild(u), c.scrollTop;
|
8225
|
-
const
|
8535
|
+
const o2 = c.querySelector(
|
8226
8536
|
"." + this.wrapClassName(`preview-page-${p.value}`)
|
8227
8537
|
);
|
8228
|
-
return
|
8229
|
-
top:
|
8538
|
+
return o2 && c.scrollTo({
|
8539
|
+
top: o2.offsetTop - 16
|
8230
8540
|
}), c.classList.toggle(this.wrapClassName("preview-active"), true), this.previewLazyLoad = new LazyLoad({
|
8231
8541
|
container: this.$preview,
|
8232
8542
|
elements_selector: "." + this.wrapClassName("preview-page>img")
|
@@ -8260,14 +8570,14 @@ let Y$1 = class Y {
|
|
8260
8570
|
this.pages$.subscribe((t) => {
|
8261
8571
|
var s;
|
8262
8572
|
this.sideEffect.add(() => {
|
8263
|
-
const i = t.map((r,
|
8573
|
+
const i = t.map((r, n) => {
|
8264
8574
|
const l = r.thumbnail ?? (r.src.startsWith("ppt") ? void 0 : r.src);
|
8265
8575
|
if (!l)
|
8266
8576
|
return;
|
8267
|
-
const p = String(
|
8268
|
-
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${
|
8577
|
+
const p = String(n), a = document.createElement("a");
|
8578
|
+
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${n}`), a.setAttribute("href", "#"), a.dataset.pageIndex = p;
|
8269
8579
|
const c = document.createElement("span");
|
8270
|
-
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(
|
8580
|
+
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(n + 1), c.dataset.pageIndex = p;
|
8271
8581
|
const u = document.createElement("img");
|
8272
8582
|
return u.width = r.width, u.height = r.height, u.dataset.src = l, u.dataset.pageIndex = p, a.appendChild(u), a.appendChild(c), e.appendChild(a), a;
|
8273
8583
|
});
|
@@ -8336,7 +8646,7 @@ function q$1(h2) {
|
|
8336
8646
|
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
8337
8647
|
), t.appendChild(s), t;
|
8338
8648
|
}
|
8339
|
-
function
|
8649
|
+
function X$1(h2) {
|
8340
8650
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8341
8651
|
t.setAttribute("class", `${h2}-footer-icon-save`), t.setAttribute("viewBox", "0 0 448 512");
|
8342
8652
|
const s = document.createElementNS(e, "path");
|
@@ -8345,7 +8655,7 @@ function J$1(h2) {
|
|
8345
8655
|
"M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z"
|
8346
8656
|
), t.appendChild(s), t;
|
8347
8657
|
}
|
8348
|
-
function
|
8658
|
+
function J$1(h2) {
|
8349
8659
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8350
8660
|
t.setAttribute("class", `${h2}-footer-icon-spinner`), t.setAttribute("viewBox", "0 0 512 512");
|
8351
8661
|
const s = document.createElementNS(e, "path");
|
@@ -8365,12 +8675,12 @@ let K$1 = class K {
|
|
8365
8675
|
sideEffect: s,
|
8366
8676
|
readonly$: i,
|
8367
8677
|
events: r,
|
8368
|
-
playable:
|
8678
|
+
playable: n,
|
8369
8679
|
wrapClassName: l,
|
8370
8680
|
pagesIndex$: p,
|
8371
8681
|
root: a
|
8372
8682
|
}) {
|
8373
|
-
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable =
|
8683
|
+
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable = n, this.$footer = this.render(), a.appendChild(this.$footer);
|
8374
8684
|
}
|
8375
8685
|
destroy() {
|
8376
8686
|
this.$footer.remove();
|
@@ -8379,15 +8689,15 @@ let K$1 = class K {
|
|
8379
8689
|
const e = document.createElement("div");
|
8380
8690
|
e.className = this.wrapClassName("footer"), this.sideEffect.addDisposer(
|
8381
8691
|
this.readonly$.subscribe(
|
8382
|
-
(
|
8692
|
+
(o2) => e.classList.toggle(this.wrapClassName("readonly"), o2)
|
8383
8693
|
)
|
8384
8694
|
);
|
8385
8695
|
const t = this.renderFooterBtn("btn-sidebar", W$1(this.namespace));
|
8386
8696
|
this.sideEffect.addEventListener(t, "click", () => {
|
8387
8697
|
this.readonly$.value || this.events.emit("togglePreview");
|
8388
8698
|
}), e.appendChild(t), this.sideEffect.addDisposer(
|
8389
|
-
this.pages$.subscribe((
|
8390
|
-
const d =
|
8699
|
+
this.pages$.subscribe((o2) => {
|
8700
|
+
const d = o2.some((g2) => g2.thumbnail || !g2.src.startsWith("ppt"));
|
8391
8701
|
t.style.display = d ? "" : "none";
|
8392
8702
|
})
|
8393
8703
|
);
|
@@ -8397,54 +8707,54 @@ let K$1 = class K {
|
|
8397
8707
|
if (this.sideEffect.addEventListener(i, "click", () => {
|
8398
8708
|
this.readonly$.value || this.events.emit("back");
|
8399
8709
|
}), s.appendChild(i), this.playable) {
|
8400
|
-
const
|
8710
|
+
const o2 = this.renderFooterBtn(
|
8401
8711
|
"btn-page-play",
|
8402
8712
|
G$1(this.namespace),
|
8403
8713
|
q$1(this.namespace)
|
8404
8714
|
);
|
8405
|
-
this.sideEffect.addEventListener(
|
8406
|
-
this.readonly$.value || (
|
8407
|
-
() =>
|
8715
|
+
this.sideEffect.addEventListener(o2, "click", () => {
|
8716
|
+
this.readonly$.value || (o2.classList.toggle(this.wrapClassName("footer-btn-playing"), true), this.events.emit("play"), this.sideEffect.setTimeout(
|
8717
|
+
() => o2.classList.toggle(this.wrapClassName("footer-btn-playing"), false),
|
8408
8718
|
500,
|
8409
8719
|
"returnPlay"
|
8410
8720
|
));
|
8411
|
-
}), s.appendChild(
|
8721
|
+
}), s.appendChild(o2);
|
8412
8722
|
}
|
8413
8723
|
const r = this.renderFooterBtn("btn-page-next", O$1(this.namespace));
|
8414
8724
|
this.sideEffect.addEventListener(r, "click", () => {
|
8415
8725
|
this.readonly$.value || this.events.emit("next");
|
8416
8726
|
}), s.appendChild(r);
|
8417
|
-
const
|
8418
|
-
|
8727
|
+
const n = document.createElement("div");
|
8728
|
+
n.className = this.wrapClassName("page-number");
|
8419
8729
|
const l = document.createElement("input");
|
8420
8730
|
l.className = this.wrapClassName("page-number-input"), this.sideEffect.addDisposer(
|
8421
|
-
this.readonly$.subscribe((
|
8731
|
+
this.readonly$.subscribe((o2) => l.disabled = o2)
|
8422
8732
|
), this.sideEffect.addDisposer(
|
8423
|
-
this.pagesIndex$.subscribe((
|
8733
|
+
this.pagesIndex$.subscribe((o2) => l.value = String(o2 + 1))
|
8424
8734
|
), this.sideEffect.addEventListener(l, "blur", () => {
|
8425
8735
|
l.value = String(this.pagesIndex$.value + 1);
|
8426
8736
|
}), this.sideEffect.addEventListener(l, "change", () => {
|
8427
8737
|
if (this.readonly$.value)
|
8428
8738
|
return;
|
8429
|
-
const
|
8430
|
-
|
8739
|
+
const o2 = l.value ? Number(l.value) - 1 : NaN;
|
8740
|
+
o2 >= 0 ? this.events.emit("jumpPage", o2) : l.value = String(this.pagesIndex$.value + 1);
|
8431
8741
|
});
|
8432
8742
|
const p = document.createElement("span");
|
8433
8743
|
this.sideEffect.addDisposer(
|
8434
|
-
this.pages$.subscribe((
|
8435
|
-
p.textContent = " / " +
|
8744
|
+
this.pages$.subscribe((o2) => {
|
8745
|
+
p.textContent = " / " + o2.length;
|
8436
8746
|
})
|
8437
|
-
),
|
8438
|
-
const a =
|
8747
|
+
), n.appendChild(l), n.appendChild(p), e.appendChild(s), e.appendChild(n);
|
8748
|
+
const a = X$1(this.namespace), c = J$1(this.namespace);
|
8439
8749
|
c.style.display = "none";
|
8440
8750
|
const u = document.createElement("button");
|
8441
8751
|
return u.className = this.wrapClassName("footer-btn"), u.appendChild(a), u.appendChild(c), this.sideEffect.addEventListener(u, "click", () => {
|
8442
8752
|
this.events.emit("save");
|
8443
|
-
}), this.events.on("saveProgress", (
|
8444
|
-
if (
|
8753
|
+
}), this.events.on("saveProgress", (o2) => {
|
8754
|
+
if (o2 < 99) {
|
8445
8755
|
c.style.display = "block", a.style.display = "none";
|
8446
8756
|
const d = c.querySelector("[data-id]");
|
8447
|
-
d && (d.textContent =
|
8757
|
+
d && (d.textContent = o2.toString().padStart(2, "0"));
|
8448
8758
|
} else
|
8449
8759
|
c.style.display = "none", a.style.display = "block";
|
8450
8760
|
}), e;
|
@@ -8461,7 +8771,7 @@ class T {
|
|
8461
8771
|
previewRoot: s,
|
8462
8772
|
footerRoot: i,
|
8463
8773
|
pages$: r,
|
8464
|
-
playable:
|
8774
|
+
playable: n
|
8465
8775
|
}) {
|
8466
8776
|
this.wrapClassName = (l) => `${this.namespace}-${l}`, this.namespace = "netless-app-docs-viewer", this.sideEffect = new SideEffectManager(), this.events = new Remitter(), this.preview = new Y$1({
|
8467
8777
|
pages$: r,
|
@@ -8475,7 +8785,7 @@ class T {
|
|
8475
8785
|
}), this.footer = new K$1({
|
8476
8786
|
pages$: r,
|
8477
8787
|
readonly$: e,
|
8478
|
-
playable:
|
8788
|
+
playable: n,
|
8479
8789
|
pagesIndex$: t,
|
8480
8790
|
root: i,
|
8481
8791
|
namespace: this.namespace,
|
@@ -8488,7 +8798,7 @@ class T {
|
|
8488
8798
|
this.preview.destroy(), this.footer.destroy(), this.sideEffect.flushAll(), this.events.destroy();
|
8489
8799
|
}
|
8490
8800
|
}
|
8491
|
-
function
|
8801
|
+
function E$1(h2, e, t) {
|
8492
8802
|
return Math.min(Math.max(h2, e), t);
|
8493
8803
|
}
|
8494
8804
|
function A$1(h2) {
|
@@ -8531,27 +8841,27 @@ let Q$1 = class Q {
|
|
8531
8841
|
}
|
8532
8842
|
};
|
8533
8843
|
let Z$1 = class Z {
|
8534
|
-
constructor(e, t, s, i, r,
|
8844
|
+
constructor(e, t, s, i, r, n) {
|
8535
8845
|
this.index = e, this.lastVisit = Date.now(), this.sideEffect = new SideEffectManager();
|
8536
|
-
const l = derive(t, (
|
8846
|
+
const l = derive(t, (o2) => o2[e] || { width: 0, height: 0 }), p = combine(
|
8537
8847
|
[l, s],
|
8538
|
-
([
|
8848
|
+
([o2, d]) => (d.width - o2.width) / 2
|
8539
8849
|
), a = combine(
|
8540
|
-
[r,
|
8541
|
-
([
|
8850
|
+
[r, n],
|
8851
|
+
([o2, d]) => (o2[e] || 0) - d
|
8542
8852
|
), c = document.createElement("div");
|
8543
8853
|
c.className = "page-renderer-page", c.dataset.index = `${e}`;
|
8544
8854
|
const u = document.createElement("img");
|
8545
8855
|
u.className = "page-renderer-page-img", c.appendChild(u), this.sideEffect.addDisposer([
|
8546
|
-
combine([l, i]).subscribe(([
|
8547
|
-
c.style.width = `${
|
8856
|
+
combine([l, i]).subscribe(([o2, d]) => {
|
8857
|
+
c.style.width = `${o2.width * d}px`, c.style.height = `${o2.height * d}px`;
|
8548
8858
|
}),
|
8549
|
-
l.subscribe((
|
8550
|
-
|
8859
|
+
l.subscribe((o2) => {
|
8860
|
+
o2.thumbnail && (c.style.backgroundImage = `url("${o2.thumbnail}")`), u.width = o2.width, u.height = o2.height, u.src = o2.src;
|
8551
8861
|
}),
|
8552
8862
|
combine([p, a, i]).subscribe(
|
8553
|
-
([
|
8554
|
-
c.style.transform = `translate(${
|
8863
|
+
([o2, d, g2]) => {
|
8864
|
+
c.style.transform = `translate(${o2 * g2}px, ${d * g2}px)`;
|
8555
8865
|
}
|
8556
8866
|
)
|
8557
8867
|
]), this.$page = c;
|
@@ -8563,13 +8873,13 @@ let Z$1 = class Z {
|
|
8563
8873
|
let ee$1 = class ee {
|
8564
8874
|
constructor(e, t, s, i, r) {
|
8565
8875
|
this.pages$ = e, this.pagesSize$ = t, this.scale$ = s, this.pagesYs$ = i, this.pagesScrollTop$ = r, this.els = /* @__PURE__ */ new Map(), this.maxElCount = 200, this.gcTimer = null, this.gc = () => {
|
8566
|
-
var
|
8876
|
+
var n;
|
8567
8877
|
if (this.gcTimer = null, this.els.size > this.maxElCount) {
|
8568
8878
|
const l = [...this.els.values()].sort((p, a) => a.lastVisit - p.lastVisit);
|
8569
8879
|
for (let p = Math.floor(this.maxElCount / 4); p < l.length; p++)
|
8570
|
-
(
|
8880
|
+
(n = this.els.get(l[p].index)) == null || n.destroy(), this.els.delete(l[p].index);
|
8571
8881
|
}
|
8572
|
-
}, this.schedule = window.requestIdleCallback || ((
|
8882
|
+
}, this.schedule = window.requestIdleCallback || ((n) => window.setTimeout(n, 5e3)), this.cancelSchedule = window.cancelIdleCallback || window.clearTimeout;
|
8573
8883
|
}
|
8574
8884
|
getEl(e) {
|
8575
8885
|
let t = this.els.get(e);
|
@@ -8606,7 +8916,7 @@ let te$1 = class te {
|
|
8606
8916
|
for (let w2 = 0; w2 < d.length; w2++)
|
8607
8917
|
g2[w2] = w2 > 0 ? g2[w2 - 1] + d[w2 - 1].height : 0;
|
8608
8918
|
return g2;
|
8609
|
-
}),
|
8919
|
+
}), n = derive(s, (d) => {
|
8610
8920
|
let g2 = 1 / 0;
|
8611
8921
|
for (let w2 = d.length - 1; w2 >= 0; w2--)
|
8612
8922
|
d[w2].height <= g2 && (g2 = d[w2].height);
|
@@ -8625,8 +8935,8 @@ let te$1 = class te {
|
|
8625
8935
|
[t, i],
|
8626
8936
|
([d, g2]) => d.width / g2.width || 1
|
8627
8937
|
), a = combine(
|
8628
|
-
[s, t,
|
8629
|
-
([d, g2, w2, f2]) =>
|
8938
|
+
[s, t, n, p],
|
8939
|
+
([d, g2, w2, f2]) => E$1(Math.ceil(g2.height / f2 / w2 / 2), 1, d.length)
|
8630
8940
|
);
|
8631
8941
|
withReadonlyValueEnhancer(this, {
|
8632
8942
|
pagesScrollTop: e,
|
@@ -8635,19 +8945,19 @@ let te$1 = class te {
|
|
8635
8945
|
pagesSize: i,
|
8636
8946
|
pagesIndex: l,
|
8637
8947
|
pagesYs: r,
|
8638
|
-
pagesMinHeight:
|
8948
|
+
pagesMinHeight: n,
|
8639
8949
|
scale: p
|
8640
8950
|
}), this.pageElManager = new ee$1(s, i, p, r, e), this.$pages = this.renderPages();
|
8641
8951
|
const c = new Val(false);
|
8642
8952
|
this.sideEffect.addDisposer(
|
8643
8953
|
c.subscribe((d) => this.$pages.classList.toggle("is-hwa", d))
|
8644
8954
|
);
|
8645
|
-
const u = () => c.setValue(false),
|
8955
|
+
const u = () => c.setValue(false), o2 = () => {
|
8646
8956
|
this.sideEffect.setTimeout(u, 1e3, "turn-off-hwa"), c.setValue(true);
|
8647
8957
|
};
|
8648
8958
|
this.sideEffect.addDisposer(
|
8649
8959
|
combine([l, a, s]).subscribe(([d, g2, w2]) => {
|
8650
|
-
|
8960
|
+
o2();
|
8651
8961
|
const f2 = Math.max(d - g2, 0), N = Math.min(d + g2, w2.length - 1);
|
8652
8962
|
for (let m = 0; m < this.$pages.children.length; m++) {
|
8653
8963
|
const S2 = this.$pages.children[m], k2 = Number(S2.dataset.index);
|
@@ -8681,23 +8991,23 @@ let ie$1 = class ie {
|
|
8681
8991
|
stageRect$: s,
|
8682
8992
|
pagesSize$: i,
|
8683
8993
|
readonly$: r,
|
8684
|
-
scrollbarMinHeight:
|
8994
|
+
scrollbarMinHeight: n = se,
|
8685
8995
|
wrapClassName: l,
|
8686
8996
|
onDragScroll: p
|
8687
8997
|
}) {
|
8688
|
-
this.sideEffect = new SideEffectManager(), this.scrolling$ = new Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight =
|
8998
|
+
this.sideEffect = new SideEffectManager(), this.scrolling$ = new Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight = n, this.readonly$ = r, this.wrapClassName = l, this.onDragScroll = p, this.scrollbarHeight$ = combine(
|
8689
8999
|
[t, s, i],
|
8690
|
-
([a, c, u]) =>
|
9000
|
+
([a, c, u]) => E$1(
|
8691
9001
|
c.height / (c.width / u.width * u.height) * a.height,
|
8692
|
-
|
9002
|
+
n,
|
8693
9003
|
a.height
|
8694
9004
|
)
|
8695
9005
|
), this.scrollTop$ = combine(
|
8696
9006
|
[t, s, i, this.scrollbarHeight$, this.pagesScrollTop$],
|
8697
|
-
([a, c, u,
|
8698
|
-
d / (u.height - u.width / c.width * c.height) * (a.height -
|
9007
|
+
([a, c, u, o2, d]) => E$1(
|
9008
|
+
d / (u.height - u.width / c.width * c.height) * (a.height - o2),
|
8699
9009
|
0,
|
8700
|
-
a.height -
|
9010
|
+
a.height - o2
|
8701
9011
|
)
|
8702
9012
|
), this.$scrollbar = this.renderScrollbar();
|
8703
9013
|
}
|
@@ -8728,15 +9038,15 @@ let ie$1 = class ie {
|
|
8728
9038
|
D(s);
|
8729
9039
|
const i = this.wrapClassName("scrollbar-dragging");
|
8730
9040
|
e.classList.toggle(i, true);
|
8731
|
-
const r = this.pagesScrollTop$.value, { clientY:
|
9041
|
+
const r = this.pagesScrollTop$.value, { clientY: n } = A$1(s), l = (a) => {
|
8732
9042
|
if (!a.isPrimary || this.readonly$.value)
|
8733
9043
|
return;
|
8734
|
-
const { clientY: c } = A$1(a), u = c -
|
9044
|
+
const { clientY: c } = A$1(a), u = c - n;
|
8735
9045
|
Math.abs(u) > 0 && this.onDragScroll && this.onDragScroll(
|
8736
9046
|
r + u / this.containerRect$.value.height * this.pagesSize$.value.height
|
8737
9047
|
);
|
8738
9048
|
}, p = (a) => {
|
8739
|
-
|
9049
|
+
a.isPrimary && (e.classList.toggle(i, false), window.removeEventListener("pointermove", l, true), window.removeEventListener("pointerup", p, true), window.removeEventListener("pointercancel", p, true));
|
8740
9050
|
};
|
8741
9051
|
window.addEventListener("pointermove", l, true), window.addEventListener("pointerup", p, true), window.addEventListener("pointercancel", p, true);
|
8742
9052
|
};
|
@@ -8750,36 +9060,36 @@ class re {
|
|
8750
9060
|
box: s,
|
8751
9061
|
pages: i,
|
8752
9062
|
pagesScrollTop: r = 0,
|
8753
|
-
onUserScroll:
|
9063
|
+
onUserScroll: n
|
8754
9064
|
}) {
|
8755
9065
|
this.sideEffect = new SideEffectManager(), this.userScrolling = false, this.toPdf = async () => {
|
8756
9066
|
const a = document.createElement("canvas"), c = a.getContext("2d");
|
8757
9067
|
if (!c)
|
8758
9068
|
return null;
|
8759
|
-
const u = this.whiteboard.pageState.pages[0],
|
8760
|
-
format: [
|
8761
|
-
orientation:
|
9069
|
+
const u = this.whiteboard.pageState.pages[0], o2 = this.pages[0], { jsPDF: d } = await import("jspdf"), g2 = new d({
|
9070
|
+
format: [o2.width, o2.height],
|
9071
|
+
orientation: o2.width > o2.height ? "l" : "p",
|
8762
9072
|
compress: true
|
8763
9073
|
});
|
8764
9074
|
for (const [S2, k2] of this.pages.entries()) {
|
8765
|
-
const { width: y, height: v, src:
|
9075
|
+
const { width: y, height: v, src: L } = k2;
|
8766
9076
|
a.width = y, a.height = v;
|
8767
|
-
const
|
8768
|
-
S2 > 0 && g2.addPage([y, v],
|
8769
|
-
const
|
8770
|
-
P2.src =
|
8771
|
-
const
|
9077
|
+
const M2 = y > v ? "l" : "p";
|
9078
|
+
S2 > 0 && g2.addPage([y, v], M2);
|
9079
|
+
const R2 = await this.getBase64FromUrl(L), P2 = document.createElement("img");
|
9080
|
+
P2.src = R2, await new Promise((_2) => P2.onload = _2), c.drawImage(P2, 0, 0);
|
9081
|
+
const V = a.toDataURL("image/jpeg", 0.6);
|
8772
9082
|
c.clearRect(0, 0, y, v), this.whiteboard.view.screenshotToCanvas(c, u, y, v, {
|
8773
9083
|
centerX: y / 2,
|
8774
9084
|
centerY: v / 2 + S2 * v,
|
8775
9085
|
scale: 1
|
8776
9086
|
});
|
8777
9087
|
const I2 = a.toDataURL("image/png");
|
8778
|
-
g2.addImage(
|
9088
|
+
g2.addImage(V, "JPEG", 0, 0, y, v, "", "FAST"), g2.addImage(I2, "PNG", 0, 0, y, v, "", "FAST"), c.clearRect(0, 0, y, v), this.viewer.events.emit("saveProgress", Math.ceil((S2 + 1) / this.pages.length * 100));
|
8779
9089
|
}
|
8780
9090
|
const w2 = g2.output("arraybuffer"), f2 = new Blob([w2]), N = URL.createObjectURL(f2), m = document.createElement("a");
|
8781
9091
|
m.setAttribute("href", N), m.setAttribute("download", `${this.box.title}.pdf`), m.style.display = "none", document.body.appendChild(m), m.click(), document.body.removeChild(m), window.postMessage({ type: "@app-slide/_download_pdf_", buf: w2 });
|
8782
|
-
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll =
|
9092
|
+
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll = n;
|
8783
9093
|
const l = () => {
|
8784
9094
|
var a;
|
8785
9095
|
this.userScrolling = false, (a = this.onUserScroll) == null || a.call(this, this.pagesScrollTop$.value);
|
@@ -8792,8 +9102,8 @@ class re {
|
|
8792
9102
|
p,
|
8793
9103
|
(a) => {
|
8794
9104
|
let c = 0, u = 0;
|
8795
|
-
for (let
|
8796
|
-
const d = a[
|
9105
|
+
for (let o2 = a.length - 1; o2 >= 0; o2--) {
|
9106
|
+
const d = a[o2];
|
8797
9107
|
d.width > c && (c = d.width), u += d.height;
|
8798
9108
|
}
|
8799
9109
|
return { width: Math.max(1, c), height: Math.max(1, u) };
|
@@ -8853,8 +9163,8 @@ class re {
|
|
8853
9163
|
return new Promise((i) => {
|
8854
9164
|
const r = new FileReader();
|
8855
9165
|
r.readAsDataURL(s), r.onloadend = () => {
|
8856
|
-
const
|
8857
|
-
i(
|
9166
|
+
const n = r.result;
|
9167
|
+
i(n);
|
8858
9168
|
};
|
8859
9169
|
});
|
8860
9170
|
}
|
@@ -8864,7 +9174,7 @@ class re {
|
|
8864
9174
|
pageScrollTo(e) {
|
8865
9175
|
const t = this.whiteboard.view.size.height / 2 / this.pageRenderer.scale;
|
8866
9176
|
this.whiteboard.view.moveCamera({
|
8867
|
-
centerY:
|
9177
|
+
centerY: E$1(
|
8868
9178
|
e + t,
|
8869
9179
|
t,
|
8870
9180
|
this.pagesSize$.value.height - t
|
@@ -8874,7 +9184,7 @@ class re {
|
|
8874
9184
|
}
|
8875
9185
|
userScrollToPageIndex(e) {
|
8876
9186
|
var t;
|
8877
|
-
if (e =
|
9187
|
+
if (e = E$1(e, 0, this.pages.length - 1), !this.readonly$.value && !Number.isNaN(e)) {
|
8878
9188
|
const s = this.pageRenderer.pagesYs[e];
|
8879
9189
|
s >= 0 && ((t = this.onUserScroll) == null || t.call(this, s + 5 / this.pageRenderer.scale));
|
8880
9190
|
}
|
@@ -8883,8 +9193,8 @@ class re {
|
|
8883
9193
|
var t;
|
8884
9194
|
this.readonly$.value || (t = this.onUserScroll) == null || t.call(
|
8885
9195
|
this,
|
8886
|
-
|
8887
|
-
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale *
|
9196
|
+
E$1(
|
9197
|
+
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale * E$1(e, -1, 1),
|
8888
9198
|
0,
|
8889
9199
|
this.pageRenderer.pagesSize.height - this.pageRenderer.containerRect.height / this.pageRenderer.scale
|
8890
9200
|
)
|
@@ -8894,52 +9204,59 @@ class re {
|
|
8894
9204
|
this.sideEffect.addEventListener(
|
8895
9205
|
this.box.$main,
|
8896
9206
|
"wheel",
|
8897
|
-
(
|
8898
|
-
D(
|
9207
|
+
(t) => {
|
9208
|
+
D(t), !this.readonly$.value && this.pageScrollStepper.paused && (this.pageScrollTo(this.pagesScrollTop + t.deltaY), this.debounceOnUserScroll());
|
8899
9209
|
},
|
8900
9210
|
{ passive: false }
|
8901
9211
|
), this.sideEffect.addEventListener(
|
8902
9212
|
this.box.$main,
|
8903
9213
|
"touchmove",
|
8904
|
-
(
|
8905
|
-
!this.readonly$.value &&
|
9214
|
+
(t) => {
|
9215
|
+
!this.readonly$.value && t.touches.length > 1 && this.debounceOnUserScroll();
|
8906
9216
|
},
|
8907
9217
|
{ passive: true, capture: true }
|
8908
9218
|
), this.sideEffect.add(() => {
|
8909
|
-
const
|
8910
|
-
const { width:
|
8911
|
-
if (
|
9219
|
+
const t = (s) => {
|
9220
|
+
const { width: i, height: r } = this.whiteboard.view.size;
|
9221
|
+
if (i <= 0 || r <= 0)
|
8912
9222
|
return;
|
8913
|
-
const
|
8914
|
-
this.pagesScrollTop$.setValue(Math.max(0,
|
9223
|
+
const n = s.centerY - this.pageRenderer.containerRect.height / this.pageRenderer.scale / 2;
|
9224
|
+
this.pagesScrollTop$.setValue(Math.max(0, n));
|
8915
9225
|
};
|
8916
|
-
return this.whiteboard.view.callbacks.on("onCameraUpdated",
|
9226
|
+
return this.whiteboard.view.callbacks.on("onCameraUpdated", t), () => this.whiteboard.view.callbacks.off("onCameraUpdated", t);
|
8917
9227
|
}), this.sideEffect.addDisposer(
|
8918
|
-
this.box._stageRect$.subscribe((
|
8919
|
-
const { width:
|
9228
|
+
this.box._stageRect$.subscribe((t) => {
|
9229
|
+
const { width: s, height: i } = this.pagesSize$.value;
|
8920
9230
|
this.whiteboard.view.moveCameraToContain({
|
8921
9231
|
originX: 0,
|
8922
9232
|
originY: this.pageRenderer.pagesScrollTop,
|
8923
|
-
width:
|
8924
|
-
height:
|
9233
|
+
width: s,
|
9234
|
+
height: t.height / this.pageRenderer.scale,
|
8925
9235
|
animationMode: "immediately"
|
8926
9236
|
}), this.whiteboard.view.setCameraBound({
|
8927
9237
|
damping: 1,
|
8928
9238
|
maxContentMode: () => this.pageRenderer.scale,
|
8929
9239
|
minContentMode: () => this.pageRenderer.scale,
|
8930
|
-
centerX:
|
8931
|
-
centerY:
|
8932
|
-
width:
|
8933
|
-
height:
|
9240
|
+
centerX: s / 2,
|
9241
|
+
centerY: i / 2,
|
9242
|
+
width: s,
|
9243
|
+
height: i
|
8934
9244
|
});
|
8935
9245
|
}),
|
8936
9246
|
"whiteboard-size-update"
|
8937
|
-
)
|
9247
|
+
);
|
9248
|
+
const e = (t) => {
|
9249
|
+
if (!t)
|
9250
|
+
return false;
|
9251
|
+
const s = t.tagName;
|
9252
|
+
return s === "INPUT" || s === "TEXTAREA" || s === "SELECT";
|
9253
|
+
};
|
9254
|
+
this.sideEffect.addEventListener(
|
8938
9255
|
window,
|
8939
9256
|
"keyup",
|
8940
|
-
(
|
8941
|
-
if (!(this.readonly$.value || !this.box.focus || this.box.minimized))
|
8942
|
-
switch (
|
9257
|
+
(t) => {
|
9258
|
+
if (!(this.readonly$.value || !this.box.focus || this.box.minimized || e(t.target)))
|
9259
|
+
switch (t.key) {
|
8943
9260
|
case "PageDown": {
|
8944
9261
|
this.userScrollByPercent(0.8);
|
8945
9262
|
break;
|
@@ -8976,15 +9293,15 @@ class re {
|
|
8976
9293
|
let ae$1 = class ae {
|
8977
9294
|
constructor({ readonly$: e, context: t, whiteboard: s, box: i, pages: r }) {
|
8978
9295
|
this.sideEffect = new SideEffectManager(), this.context = t, this.whiteboard = s, this.box = i, this.pages = r;
|
8979
|
-
const
|
8980
|
-
this.pagesIndex$ =
|
9296
|
+
const n = new Val(t.displayer.state.sceneState.index || 0);
|
9297
|
+
this.pagesIndex$ = n, this.sideEffect.add(() => {
|
8981
9298
|
const l = (p) => {
|
8982
9299
|
this.jumpToPage(p.index);
|
8983
9300
|
};
|
8984
9301
|
return this.context.emitter.on("sceneStateChange", l), () => this.context.emitter.off("sceneStateChange", l);
|
8985
9302
|
}), this.viewer = new T({
|
8986
9303
|
readonly$: e,
|
8987
|
-
pagesIndex$:
|
9304
|
+
pagesIndex$: n,
|
8988
9305
|
previewRoot: i.$body,
|
8989
9306
|
footerRoot: i.$footer,
|
8990
9307
|
pages$: new Val(r),
|
@@ -8998,11 +9315,11 @@ let ae$1 = class ae {
|
|
8998
9315
|
this.viewer.events.on("back", () => this.prevPage()),
|
8999
9316
|
this.viewer.events.on("next", () => this.nextPage())
|
9000
9317
|
]), this.render(), this.sideEffect.addDisposer(
|
9001
|
-
|
9002
|
-
var u,
|
9318
|
+
n.subscribe((l, p) => {
|
9319
|
+
var u, o2;
|
9003
9320
|
if (e.value)
|
9004
9321
|
return;
|
9005
|
-
const a = this.context.getInitScenePath(), c = (
|
9322
|
+
const a = this.context.getInitScenePath(), c = (o2 = (u = this.context.getScenes()) == null ? void 0 : u[l]) == null ? void 0 : o2.name;
|
9006
9323
|
if (a && c && this.context.setScenePath(`${a}/${c}`), p) {
|
9007
9324
|
const d = this.context.room;
|
9008
9325
|
if (d) {
|
@@ -9029,7 +9346,7 @@ let ae$1 = class ae {
|
|
9029
9346
|
this.jumpToPage(this.pagesIndex$.value - 1, true);
|
9030
9347
|
}
|
9031
9348
|
jumpToPage(e, t = false) {
|
9032
|
-
this.pagesIndex$.setValue(
|
9349
|
+
this.pagesIndex$.setValue(E$1(e, 0, this.pages.length - 1), t);
|
9033
9350
|
}
|
9034
9351
|
render() {
|
9035
9352
|
var t;
|
@@ -9054,8 +9371,8 @@ let ae$1 = class ae {
|
|
9054
9371
|
var r;
|
9055
9372
|
const i = this.context.room;
|
9056
9373
|
if (i && i.state.memberState.currentApplianceName === "clicker") {
|
9057
|
-
for (let
|
9058
|
-
if ((r =
|
9374
|
+
for (let n = s.target; n; n = n.parentElement)
|
9375
|
+
if ((r = n.classList) != null && r.contains("ppt-event-source"))
|
9059
9376
|
return;
|
9060
9377
|
i.pptNextStep();
|
9061
9378
|
}
|
@@ -9072,20 +9389,20 @@ const ne$1 = "DocsViewer", ue = {
|
|
9072
9389
|
if (!t)
|
9073
9390
|
throw new Error("[Docs Viewer]: scenes not found.");
|
9074
9391
|
const s = new SideEffectManager(), i = t.map(
|
9075
|
-
({ ppt:
|
9076
|
-
width:
|
9077
|
-
height:
|
9078
|
-
src:
|
9079
|
-
thumbnail:
|
9392
|
+
({ ppt: n }) => n ? {
|
9393
|
+
width: n.width,
|
9394
|
+
height: n.height,
|
9395
|
+
src: n.src,
|
9396
|
+
thumbnail: n.previewURL
|
9080
9397
|
} : null
|
9081
|
-
).filter((
|
9398
|
+
).filter((n) => Boolean(n));
|
9082
9399
|
if (i.length <= 0)
|
9083
9400
|
throw new Error("[Docs Viewer]: empty scenes.");
|
9084
9401
|
e.mountStyles(F);
|
9085
9402
|
const r = new Val(!h2.isWritable);
|
9086
9403
|
s.addDisposer(
|
9087
|
-
h2.emitter.on("writableChange", (
|
9088
|
-
r.setValue(!
|
9404
|
+
h2.emitter.on("writableChange", (n) => {
|
9405
|
+
r.setValue(!n);
|
9089
9406
|
})
|
9090
9407
|
), i[0].src.startsWith("ppt") ? le$1(
|
9091
9408
|
s,
|
@@ -9113,18 +9430,18 @@ function oe$1(h2, e, t, s, i) {
|
|
9113
9430
|
r.view.disableCameraTransform = p;
|
9114
9431
|
})
|
9115
9432
|
);
|
9116
|
-
const
|
9433
|
+
const n = e.createStorage("static-docs-viewer", { pagesScrollTop: 0 }), l = new re({
|
9117
9434
|
whiteboard: r,
|
9118
9435
|
readonly$: i,
|
9119
9436
|
box: t,
|
9120
9437
|
pages: s,
|
9121
|
-
pagesScrollTop:
|
9438
|
+
pagesScrollTop: n.state.pagesScrollTop,
|
9122
9439
|
onUserScroll: (p) => {
|
9123
|
-
e.isWritable &&
|
9440
|
+
e.isWritable && n.setState({ pagesScrollTop: p });
|
9124
9441
|
}
|
9125
9442
|
});
|
9126
9443
|
h2.addDisposer(() => l.destroy()), h2.addDisposer(
|
9127
|
-
|
9444
|
+
n.on("stateChanged", (p) => {
|
9128
9445
|
p.pagesScrollTop && l.syncPageScrollTop(p.pagesScrollTop.newValue || 0);
|
9129
9446
|
})
|
9130
9447
|
), h2.addDisposer(
|
@@ -9136,8 +9453,8 @@ function oe$1(h2, e, t, s, i) {
|
|
9136
9453
|
l.pagesSize$,
|
9137
9454
|
l.pageRenderer._pagesMinHeight$
|
9138
9455
|
],
|
9139
|
-
([p, a, c, u,
|
9140
|
-
|
9456
|
+
([p, a, c, u, o2]) => p ? Math.max(
|
9457
|
+
o2 / u.width * (2 / 5),
|
9141
9458
|
a.height / a.width
|
9142
9459
|
) : c.height / c.width * (a.height / a.width)
|
9143
9460
|
).subscribe((p) => {
|
@@ -9148,20 +9465,20 @@ function oe$1(h2, e, t, s, i) {
|
|
9148
9465
|
function le$1(h2, e, t, s, i) {
|
9149
9466
|
const r = e.createWhiteBoardView();
|
9150
9467
|
r.view.disableCameraTransform = true;
|
9151
|
-
const
|
9468
|
+
const n = new ae$1({
|
9152
9469
|
context: e,
|
9153
9470
|
whiteboard: r,
|
9154
9471
|
box: t,
|
9155
9472
|
pages: s,
|
9156
9473
|
readonly$: i
|
9157
9474
|
});
|
9158
|
-
h2.addDisposer(() =>
|
9475
|
+
h2.addDisposer(() => n.destroy());
|
9159
9476
|
const l = new Val(
|
9160
9477
|
{ width: s[0].width, height: s[0].height },
|
9161
9478
|
{ compare: z$1 }
|
9162
9479
|
);
|
9163
9480
|
if (h2.addDisposer(
|
9164
|
-
|
9481
|
+
n.pagesIndex$.subscribe((p) => {
|
9165
9482
|
const a = s[p];
|
9166
9483
|
a && l.setValue({ width: a.width, height: a.height });
|
9167
9484
|
})
|
@@ -9173,7 +9490,7 @@ function le$1(h2, e, t, s, i) {
|
|
9173
9490
|
const p = h2.add(() => {
|
9174
9491
|
const a = ({ width: c, height: u }) => {
|
9175
9492
|
if (s.length > 0 && t.state !== "maximized") {
|
9176
|
-
const { width:
|
9493
|
+
const { width: o2, height: d } = s[0], w2 = d / o2 * c - u;
|
9177
9494
|
w2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9178
9495
|
width: t.intrinsicWidth,
|
9179
9496
|
height: t.intrinsicHeight + w2 / t.rootRect.height
|
@@ -9541,13 +9858,13 @@ function Ni(e) {
|
|
9541
9858
|
return Array.isArray(e) ? e[0] : e;
|
9542
9859
|
}
|
9543
9860
|
function Li(e) {
|
9544
|
-
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N,
|
9861
|
+
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N, x, y, C, L, $, D2, V, re2, F2, ce, Ve, de, qe, pe, De, ue2, Re, he, Fe, se2, Be, Ue;
|
9545
9862
|
return {
|
9546
9863
|
c() {
|
9547
|
-
i = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), m = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N = S("path"),
|
9864
|
+
i = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), m = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N = S("path"), x = S("symbol"), y = S("path"), C = S("symbol"), L = S("path"), $ = S("symbol"), D2 = S("path"), V = S("symbol"), re2 = S("path"), F2 = S("symbol"), ce = S("path"), Ve = S("path"), de = S("symbol"), qe = S("path"), pe = S("symbol"), De = S("path"), ue2 = S("symbol"), Re = S("path"), he = S("symbol"), Fe = S("path"), se2 = S("symbol"), Be = S("path"), Ue = S("path"), g(r, "d", "M16 1H2a1 1 0 00-1 1v10a1 1 0 001 1h3v-2H3V3h12v8h-2v2h3a1 1 0 001-1V2a1 1 0 00-1-1z"), g(s, "d", "M4 17h10l-5-6z"), g(t, "id", "plyr-airplay"), g(t, "viewBox", "0 0 18 18"), g(a, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(a, "fill-rule", "evenodd"), g(a, "fill-opacity", ".5"), g(n, "id", "plyr-captions-off"), g(n, "viewBox", "0 0 18 18"), g(d, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(d, "fill-rule", "evenodd"), g(l, "id", "plyr-captions-on"), g(l, "viewBox", "0 0 18 18"), g(u, "d", "M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z"), g(c, "id", "plyr-download"), g(c, "viewBox", "0 0 18 18"), g(p, "d", "M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"), g(m, "id", "plyr-enter-fullscreen"), g(m, "viewBox", "0 0 18 18"), g(b, "d", "M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"), g(v, "id", "plyr-exit-fullscreen"), g(v, "viewBox", "0 0 18 18"), g(N, "d", "M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"), g(T2, "id", "plyr-fast-forward"), g(T2, "viewBox", "0 0 18 18"), g(y, "d", "M17 5.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C5 10.9 4.4 6 3 6c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"), g(x, "id", "plyr-logo-vimeo"), g(x, "viewBox", "0 0 18 18"), g(L, "d", "M16.8 5.8c-.2-1.3-.8-2.2-2.2-2.4C12.4 3 9 3 9 3s-3.4 0-5.6.4C2 3.6 1.3 4.5 1.2 5.8 1 7.1 1 9 1 9s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C5.6 15 9 15 9 15s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4.2-1.3.2-3.2.2-3.2s0-1.9-.2-3.2zM7 12V6l5 3-5 3z"), g(C, "id", "plyr-logo-youtube"), g(C, "viewBox", "0 0 18 18"), g(D2, "d", "M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g($, "id", "plyr-muted"), g($, "viewBox", "0 0 18 18"), g(re2, "d", "M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zm6 0c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"), g(V, "id", "plyr-pause"), g(V, "viewBox", "0 0 18 18"), g(ce, "d", "M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"), g(Ve, "d", "M13 15H3V5h5V3H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1v-6h-2v5z"), g(F2, "id", "plyr-pip"), g(F2, "viewBox", "0 0 18 18"), g(qe, "d", "M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"), g(de, "id", "plyr-play"), g(de, "viewBox", "0 0 18 18"), g(De, "d", "M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"), g(pe, "id", "plyr-restart"), g(pe, "viewBox", "0 0 18 18"), g(Re, "d", "M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"), g(ue2, "id", "plyr-rewind"), g(ue2, "viewBox", "0 0 18 18"), g(Fe, "d", "M16.135 7.784a2 2 0 01-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 01-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 01-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 01-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 011.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 012.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 012.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 011.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 110-6 3 3 0 010 6z"), g(he, "id", "plyr-settings"), g(he, "viewBox", "0 0 18 18"), g(Be, "d", "M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"), g(Ue, "d", "M11.282 5.282a.909.909 0 000 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 000 1.316c.145.145.636.262 1.018.156a.725.725 0 00.298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 00-1.316 0zm-7.496.726H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g(se2, "id", "plyr-volume"), g(se2, "viewBox", "0 0 18 18"), g(i, "xmlns", "http://www.w3.org/2000/svg"), g(i, "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
9548
9865
|
},
|
9549
9866
|
m(We, ni) {
|
9550
|
-
te2(We, i, ni), k(i, t), k(t, r), k(t, s), k(i, n), k(n, a), k(i, l), k(l, d), k(i, c), k(c, u), k(i, m), k(m, p), k(i, v), k(v, b), k(i, T2), k(T2, N), k(i,
|
9867
|
+
te2(We, i, ni), k(i, t), k(t, r), k(t, s), k(i, n), k(n, a), k(i, l), k(l, d), k(i, c), k(c, u), k(i, m), k(m, p), k(i, v), k(v, b), k(i, T2), k(T2, N), k(i, x), k(x, y), k(i, C), k(C, L), k(i, $), k($, D2), k(i, V), k(V, re2), k(i, F2), k(F2, ce), k(F2, Ve), k(i, de), k(de, qe), k(i, pe), k(pe, De), k(i, ue2), k(ue2, Re), k(i, he), k(he, Fe), k(i, se2), k(se2, Be), k(se2, Ue);
|
9551
9868
|
},
|
9552
9869
|
p: X,
|
9553
9870
|
i: X,
|
@@ -10431,19 +10748,19 @@ const h = { getIconUrl() {
|
|
10431
10748
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10432
10749
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10433
10750
|
const v = _("div", { class: "plyr__menu__container", id: `plyr-settings-${e.id}`, hidden: "" }), b = _("div"), T2 = _("div", { id: `plyr-settings-${e.id}-home` }), N = _("div", { role: "menu" });
|
10434
|
-
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((
|
10751
|
+
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10435
10752
|
const y = _("button", z(B(this.config.selectors.buttons.settings), { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`, role: "menuitem", "aria-haspopup": true, hidden: "" }));
|
10436
|
-
i.call(this, y,
|
10437
|
-
d.call(this,
|
10753
|
+
i.call(this, y, x), E.call(this, y, "click", () => {
|
10754
|
+
d.call(this, x, false);
|
10438
10755
|
});
|
10439
|
-
const C = _("span", null, j.get(
|
10440
|
-
L.innerHTML = e[
|
10441
|
-
const $ = _("div", { id: `plyr-settings-${e.id}-${
|
10442
|
-
D2.appendChild(_("span", { "aria-hidden": true }, j.get(
|
10756
|
+
const C = _("span", null, j.get(x, this.config)), L = _("span", { class: this.config.classNames.menu.value });
|
10757
|
+
L.innerHTML = e[x], C.appendChild(L), y.appendChild(C), N.appendChild(y);
|
10758
|
+
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10759
|
+
D2.appendChild(_("span", { "aria-hidden": true }, j.get(x, this.config))), D2.appendChild(_("span", { class: this.config.classNames.hidden }, j.get("menuBack", this.config))), E.call(this, $, "keydown", (V) => {
|
10443
10760
|
V.key === "ArrowLeft" && (V.preventDefault(), V.stopPropagation(), d.call(this, "home", true));
|
10444
10761
|
}, false), E.call(this, D2, "click", () => {
|
10445
10762
|
d.call(this, "home", false);
|
10446
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[
|
10763
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10447
10764
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10448
10765
|
}
|
10449
10766
|
if (m === "pip" && I.pip && c.appendChild(t.call(this, "pip", u)), m === "airplay" && I.airplay && c.appendChild(t.call(this, "airplay", u)), m === "download") {
|
@@ -11027,9 +11344,9 @@ var kr = xr(function(e, i) {
|
|
11027
11344
|
}, r = {}, s = {}, n = {};
|
11028
11345
|
function a(p, v) {
|
11029
11346
|
p = p.push ? p : [p];
|
11030
|
-
var b, T2, N,
|
11347
|
+
var b, T2, N, x = [], y = p.length, C = y;
|
11031
11348
|
for (b = function(L, $) {
|
11032
|
-
$.length &&
|
11349
|
+
$.length && x.push(L), --C || v(x);
|
11033
11350
|
}; y--; )
|
11034
11351
|
T2 = p[y], (N = s[T2]) ? b(T2, N) : (n[T2] = n[T2] || []).push(b);
|
11035
11352
|
}
|
@@ -11045,32 +11362,32 @@ var kr = xr(function(e, i) {
|
|
11045
11362
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11046
11363
|
}
|
11047
11364
|
function c(p, v, b, T2) {
|
11048
|
-
var N,
|
11049
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((
|
11365
|
+
var N, x, y = document, C = b.async, L = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V = p.replace(/^(css|img)!/, "");
|
11366
|
+
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x = y.createElement("link")).rel = "stylesheet", x.href = V, (N = "hideFocus" in x) && x.relList && (N = 0, x.rel = "preload", x.as = "style")) : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(D2) ? (x = y.createElement("img")).src = V : ((x = y.createElement("script")).src = p, x.async = C === void 0 || C), x.onload = x.onerror = x.onbeforeload = function(re2) {
|
11050
11367
|
var F2 = re2.type[0];
|
11051
11368
|
if (N)
|
11052
11369
|
try {
|
11053
|
-
|
11370
|
+
x.sheet.cssText.length || (F2 = "e");
|
11054
11371
|
} catch (ce) {
|
11055
11372
|
ce.code != 18 && (F2 = "e");
|
11056
11373
|
}
|
11057
11374
|
if (F2 == "e") {
|
11058
11375
|
if ((T2 += 1) < L)
|
11059
11376
|
return c(p, v, b, T2);
|
11060
|
-
} else if (
|
11061
|
-
return
|
11377
|
+
} else if (x.rel == "preload" && x.as == "style")
|
11378
|
+
return x.rel = "stylesheet";
|
11062
11379
|
v(p, F2, re2.defaultPrevented);
|
11063
|
-
}, $(p,
|
11380
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11064
11381
|
}
|
11065
11382
|
function u(p, v, b) {
|
11066
|
-
var T2, N,
|
11383
|
+
var T2, N, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11067
11384
|
for (T2 = function(L, $, D2) {
|
11068
11385
|
if ($ == "e" && C.push(L), $ == "b") {
|
11069
11386
|
if (!D2)
|
11070
11387
|
return;
|
11071
11388
|
C.push(L);
|
11072
11389
|
}
|
11073
|
-
--
|
11390
|
+
--x || v(C);
|
11074
11391
|
}, N = 0; N < y; N++)
|
11075
11392
|
c(p[N], T2, b);
|
11076
11393
|
}
|
@@ -11081,14 +11398,14 @@ var kr = xr(function(e, i) {
|
|
11081
11398
|
throw "LoadJS";
|
11082
11399
|
r[T2] = true;
|
11083
11400
|
}
|
11084
|
-
function
|
11401
|
+
function x(y, C) {
|
11085
11402
|
u(p, function(L) {
|
11086
11403
|
d(N, L), y && d({ success: y, error: C }, L), l(T2, L);
|
11087
11404
|
}, N);
|
11088
11405
|
}
|
11089
11406
|
if (N.returnPromise)
|
11090
|
-
return new Promise(
|
11091
|
-
|
11407
|
+
return new Promise(x);
|
11408
|
+
x();
|
11092
11409
|
}
|
11093
11410
|
return m.ready = function(p, v) {
|
11094
11411
|
return a(p, function(b) {
|
@@ -11171,11 +11488,11 @@ const nt = { setup() {
|
|
11171
11488
|
T2 = C, w.call(e, e.media, "volumechange");
|
11172
11489
|
});
|
11173
11490
|
} });
|
11174
|
-
let N, { loop:
|
11175
|
-
Object.defineProperty(e.media, "loop", { get: () =>
|
11491
|
+
let N, { loop: x } = e.config;
|
11492
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11176
11493
|
const C = o.boolean(y) ? y : e.config.loop.active;
|
11177
11494
|
e.embed.setLoop(C).then(() => {
|
11178
|
-
|
11495
|
+
x = C;
|
11179
11496
|
});
|
11180
11497
|
} }), e.embed.getVideoUrl().then((y) => {
|
11181
11498
|
N = y, h.setDownloadUrl.call(e);
|
@@ -12302,8 +12619,8 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12302
12619
|
const _WindowManager = class extends InvisiblePlugin {
|
12303
12620
|
constructor(context) {
|
12304
12621
|
super(context);
|
12305
|
-
this.version = "1.0.0-canary.
|
12306
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.
|
12622
|
+
this.version = "1.0.0-canary.77";
|
12623
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.6", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.33.0", "@rollup/plugin-commonjs": "^24.1.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-url": "^8.0.1", "@sveltejs/vite-plugin-svelte": "^2.2.0", "@tsconfig/svelte": "^4.0.1", "@types/debug": "^4.1.7", "@types/node": "^18.0.3", "@types/lodash": "^4.14.194", "@types/lodash-es": "^4.17.7", "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/parser": "^5.59.5", "@vitest/ui": "^0.31.0", "cypress": "^12.12.0", "dotenv": "^16.0.3", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-svelte3": "^4.0.0", "jsdom": "^22.0.0", "less": "^4.1.3", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^4.0.0", "svelte": "^3.59.1", "typescript": "^5.0.4", "vite": "^4.3.5", "vite-plugin-dts": "^2.3.0", "vitest": "^0.31.0", "white-web-sdk": "^2.16.42" } };
|
12307
12624
|
this.emitter = callbacks;
|
12308
12625
|
this.viewMode$ = new Val(ViewMode.Broadcaster);
|
12309
12626
|
this.playground$ = new Val(void 0);
|
@@ -12319,7 +12636,7 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12319
12636
|
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12320
12637
|
};
|
12321
12638
|
_WindowManager.displayer = context.displayer;
|
12322
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.
|
12639
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.6", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.33.0", "@rollup/plugin-commonjs": "^24.1.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-url": "^8.0.1", "@sveltejs/vite-plugin-svelte": "^2.2.0", "@tsconfig/svelte": "^4.0.1", "@types/debug": "^4.1.7", "@types/node": "^18.0.3", "@types/lodash": "^4.14.194", "@types/lodash-es": "^4.17.7", "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/parser": "^5.59.5", "@vitest/ui": "^0.31.0", "cypress": "^12.12.0", "dotenv": "^16.0.3", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-svelte3": "^4.0.0", "jsdom": "^22.0.0", "less": "^4.1.3", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^4.0.0", "svelte": "^3.59.1", "typescript": "^5.0.4", "vite": "^4.3.5", "vite-plugin-dts": "^2.3.0", "vitest": "^0.31.0", "white-web-sdk": "^2.16.42" } };
|
12323
12640
|
}
|
12324
12641
|
static async mount(params) {
|
12325
12642
|
var _a;
|
@@ -12484,12 +12801,21 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12484
12801
|
}
|
12485
12802
|
}
|
12486
12803
|
}
|
12804
|
+
/**
|
12805
|
+
* 注册插件
|
12806
|
+
*/
|
12487
12807
|
static register(params) {
|
12488
12808
|
return appRegister.register(params);
|
12489
12809
|
}
|
12810
|
+
/**
|
12811
|
+
* 注销插件
|
12812
|
+
*/
|
12490
12813
|
static unregister(kind) {
|
12491
12814
|
return appRegister.unregister(kind);
|
12492
12815
|
}
|
12816
|
+
/**
|
12817
|
+
* 创建一个 app 至白板
|
12818
|
+
*/
|
12493
12819
|
async addApp(params) {
|
12494
12820
|
if (this.appManager) {
|
12495
12821
|
if (this.appManager.rootDirRemoving) {
|
@@ -12576,11 +12902,17 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12576
12902
|
}
|
12577
12903
|
return isDynamicPPT;
|
12578
12904
|
}
|
12905
|
+
/**
|
12906
|
+
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
12907
|
+
*/
|
12579
12908
|
async setMainViewScenePath(scenePath) {
|
12580
12909
|
if (this.appManager) {
|
12581
12910
|
await this.appManager.setMainViewScenePath(scenePath);
|
12582
12911
|
}
|
12583
12912
|
}
|
12913
|
+
/**
|
12914
|
+
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
12915
|
+
*/
|
12584
12916
|
async setMainViewSceneIndex(index2) {
|
12585
12917
|
if (this.appManager) {
|
12586
12918
|
await this.appManager.setMainViewSceneIndex(index2);
|
@@ -12636,6 +12968,11 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12636
12968
|
}
|
12637
12969
|
}
|
12638
12970
|
}
|
12971
|
+
/**
|
12972
|
+
* 删除一页
|
12973
|
+
* 默认删除当前页, 可以删除指定 index 页
|
12974
|
+
* 最低保留一页
|
12975
|
+
*/
|
12639
12976
|
async removePage(index2) {
|
12640
12977
|
if (this.appManager) {
|
12641
12978
|
const needRemoveIndex = index2 === void 0 ? this.pageState.index : index2;
|
@@ -12652,27 +12989,45 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12652
12989
|
return false;
|
12653
12990
|
}
|
12654
12991
|
}
|
12992
|
+
/**
|
12993
|
+
* 返回 mainView 的 ScenePath
|
12994
|
+
*/
|
12655
12995
|
getMainViewScenePath() {
|
12656
12996
|
var _a;
|
12657
12997
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewScenePath();
|
12658
12998
|
}
|
12999
|
+
/**
|
13000
|
+
* 返回 mainView 的 SceneIndex
|
13001
|
+
*/
|
12659
13002
|
getMainViewSceneIndex() {
|
12660
13003
|
var _a;
|
12661
13004
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewSceneIndex();
|
12662
13005
|
}
|
13006
|
+
/**
|
13007
|
+
* 设置所有 app 的 readonly 模式
|
13008
|
+
*/
|
12663
13009
|
setReadonly(readonly) {
|
12664
13010
|
var _a;
|
12665
13011
|
this.readonly = readonly;
|
12666
13012
|
(_a = this.boxManager) == null ? void 0 : _a.setReadonly(readonly);
|
12667
13013
|
emitter.emit("setReadonly", readonly);
|
12668
13014
|
}
|
13015
|
+
/**
|
13016
|
+
* 切换 mainView 为可写
|
13017
|
+
*/
|
12669
13018
|
switchMainViewToWriter() {
|
12670
13019
|
var _a;
|
12671
13020
|
return (_a = this.appManager) == null ? void 0 : _a.mainViewProxy.mainViewClickHandler();
|
12672
13021
|
}
|
13022
|
+
/**
|
13023
|
+
* app destroy 回调
|
13024
|
+
*/
|
12673
13025
|
onAppDestroy(kind, listener) {
|
12674
13026
|
addEmitterOnceListener(`destroy-${kind}`, listener);
|
12675
13027
|
}
|
13028
|
+
/**
|
13029
|
+
* 设置 ViewMode
|
13030
|
+
*/
|
12676
13031
|
setViewMode(mode) {
|
12677
13032
|
var _a;
|
12678
13033
|
log("setViewMode", mode);
|
@@ -12850,14 +13205,23 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12850
13205
|
}
|
12851
13206
|
return this.boxManager.teleBoxManager;
|
12852
13207
|
}
|
13208
|
+
/**
|
13209
|
+
* 查询所有的 App
|
13210
|
+
*/
|
12853
13211
|
queryAll() {
|
12854
13212
|
var _a;
|
12855
13213
|
return Array.from(((_a = this.appManager) == null ? void 0 : _a.appProxies.values()) || []);
|
12856
13214
|
}
|
13215
|
+
/**
|
13216
|
+
* 查询单个 App
|
13217
|
+
*/
|
12857
13218
|
queryOne(appId) {
|
12858
13219
|
var _a;
|
12859
13220
|
return (_a = this.appManager) == null ? void 0 : _a.appProxies.get(appId);
|
12860
13221
|
}
|
13222
|
+
/**
|
13223
|
+
* 关闭 APP
|
13224
|
+
*/
|
12861
13225
|
async closeApp(appId) {
|
12862
13226
|
var _a;
|
12863
13227
|
return (_a = this.appManager) == null ? void 0 : _a.closeApp(appId);
|
@@ -12954,9 +13318,9 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12954
13318
|
var _a;
|
12955
13319
|
(_a = this.focusedView) == null ? void 0 : _a.duplicate();
|
12956
13320
|
}
|
12957
|
-
insertText(
|
13321
|
+
insertText(x, y, text2) {
|
12958
13322
|
var _a;
|
12959
|
-
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(
|
13323
|
+
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(x, y, text2)) || "";
|
12960
13324
|
}
|
12961
13325
|
insertImage(info) {
|
12962
13326
|
var _a;
|
@@ -12979,6 +13343,7 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12979
13343
|
this._refresh();
|
12980
13344
|
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.Refresh);
|
12981
13345
|
}
|
13346
|
+
/** @inner */
|
12982
13347
|
_refresh() {
|
12983
13348
|
var _a, _b;
|
12984
13349
|
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.rebind();
|
@@ -13016,6 +13381,9 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13016
13381
|
});
|
13017
13382
|
}, 500);
|
13018
13383
|
}
|
13384
|
+
/**
|
13385
|
+
* 切换 focus 到指定的 app, 并且把这个 app 放到最前面
|
13386
|
+
*/
|
13019
13387
|
focusApp(appId) {
|
13020
13388
|
var _a, _b, _c;
|
13021
13389
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(appId);
|