@netless/window-manager 1.0.0-canary.76 → 1.0.0-canary.78
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 +674 -294
- package/dist/index.mjs +670 -294
- package/dist/index.umd.js +672 -296
- package/dist/storage.d.ts +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +38 -38
- package/src/AppListener.ts +16 -4
- package/src/BoxManager.ts +3 -0
- package/src/Helper.ts +10 -2
- package/dist/image.d.ts +0 -19
- package/dist/shim.d.ts +0 -5
package/dist/index.js
CHANGED
@@ -14,6 +14,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
14
14
|
return to;
|
15
15
|
};
|
16
16
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
17
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
18
22
|
mod
|
19
23
|
));
|
@@ -615,9 +619,14 @@ class AppListeners {
|
|
615
619
|
this.moveCameraHandler = (payload) => {
|
616
620
|
const size$ = this.manager.mainViewProxy.size$;
|
617
621
|
if (size$.value) {
|
618
|
-
const
|
619
|
-
|
620
|
-
|
622
|
+
const nextCamera = { ...payload };
|
623
|
+
if (nextCamera.scale) {
|
624
|
+
const size = this.manager.mainView.size;
|
625
|
+
const diff = Math.max(size.height / size$.value.height, size.width / size$.value.width);
|
626
|
+
nextCamera.scale *= diff;
|
627
|
+
} else {
|
628
|
+
delete nextCamera.scale;
|
629
|
+
}
|
621
630
|
this.manager.mainView.moveCamera(nextCamera);
|
622
631
|
}
|
623
632
|
};
|
@@ -794,11 +803,17 @@ const checkVersion = () => {
|
|
794
803
|
}
|
795
804
|
};
|
796
805
|
const findMemberByUid = (room, uid) => {
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
806
|
+
var _a;
|
807
|
+
const roomMembers = (room == null ? void 0 : room.state.roomMembers) || [];
|
808
|
+
let maxMemberId = -1;
|
809
|
+
let result = void 0;
|
810
|
+
for (const member of roomMembers) {
|
811
|
+
if (((_a = member.payload) == null ? void 0 : _a.uid) === uid && maxMemberId < member.memberId) {
|
812
|
+
maxMemberId = member.memberId;
|
813
|
+
result = member;
|
814
|
+
}
|
815
|
+
}
|
816
|
+
return result;
|
802
817
|
};
|
803
818
|
const serializeRoomMembers = (members) => {
|
804
819
|
return members.map((member) => {
|
@@ -987,9 +1002,11 @@ class AppContext {
|
|
987
1002
|
return this.displayer.calibrationTimestamp;
|
988
1003
|
}
|
989
1004
|
}
|
1005
|
+
/** Get App writable status. */
|
990
1006
|
get isWritable() {
|
991
1007
|
return this.appProxy.isWritable && !this.destroyed;
|
992
1008
|
}
|
1009
|
+
/** Get the App Window UI box. */
|
993
1010
|
get box() {
|
994
1011
|
const box = this.appProxy.box$.value;
|
995
1012
|
if (box) {
|
@@ -1004,6 +1021,7 @@ class AppContext {
|
|
1004
1021
|
get members() {
|
1005
1022
|
return this.manager.members$.value;
|
1006
1023
|
}
|
1024
|
+
//** currentMember is undefined in read-only and replay mode. */
|
1007
1025
|
get currentMember() {
|
1008
1026
|
const self = findMemberByUid(this.room, this.manager.uid);
|
1009
1027
|
if (!self) {
|
@@ -1289,9 +1307,15 @@ class AttributesDelegate {
|
|
1289
1307
|
this.context = context;
|
1290
1308
|
this.setAppFocus = (appId, focus) => {
|
1291
1309
|
if (focus) {
|
1292
|
-
this.context.safeSetAttributes({ [
|
1310
|
+
this.context.safeSetAttributes({ [
|
1311
|
+
"focus"
|
1312
|
+
/* Focus */
|
1313
|
+
]: appId });
|
1293
1314
|
} else {
|
1294
|
-
this.context.safeSetAttributes({ [
|
1315
|
+
this.context.safeSetAttributes({ [
|
1316
|
+
"focus"
|
1317
|
+
/* Focus */
|
1318
|
+
]: void 0 });
|
1295
1319
|
}
|
1296
1320
|
};
|
1297
1321
|
}
|
@@ -1302,16 +1326,26 @@ class AttributesDelegate {
|
|
1302
1326
|
return this.context.getAttributes();
|
1303
1327
|
}
|
1304
1328
|
apps() {
|
1305
|
-
return lodash.get(this.attributes, [
|
1329
|
+
return lodash.get(this.attributes, [
|
1330
|
+
"apps"
|
1331
|
+
/* Apps */
|
1332
|
+
]);
|
1306
1333
|
}
|
1307
1334
|
get focus() {
|
1308
|
-
return lodash.get(this.attributes, [
|
1335
|
+
return lodash.get(this.attributes, [
|
1336
|
+
"focus"
|
1337
|
+
/* Focus */
|
1338
|
+
]);
|
1309
1339
|
}
|
1310
1340
|
getAppAttributes(id) {
|
1311
1341
|
return lodash.get(this.apps(), [id]);
|
1312
1342
|
}
|
1313
1343
|
getAppState(id) {
|
1314
|
-
return lodash.get(this.apps(), [
|
1344
|
+
return lodash.get(this.apps(), [
|
1345
|
+
id,
|
1346
|
+
"state"
|
1347
|
+
/* State */
|
1348
|
+
]);
|
1315
1349
|
}
|
1316
1350
|
getMaximized() {
|
1317
1351
|
return lodash.get(this.attributes, ["maximized"]);
|
@@ -1335,14 +1369,24 @@ class AttributesDelegate {
|
|
1335
1369
|
}
|
1336
1370
|
attrs.createdAt = Date.now();
|
1337
1371
|
this.context.safeUpdateAttributes(["apps", id], attrs);
|
1338
|
-
this.context.safeUpdateAttributes([
|
1372
|
+
this.context.safeUpdateAttributes([
|
1373
|
+
"apps",
|
1374
|
+
id,
|
1375
|
+
"state"
|
1376
|
+
/* State */
|
1377
|
+
], {
|
1339
1378
|
[AppAttributes.Size]: {},
|
1340
1379
|
[AppAttributes.Position]: {},
|
1341
1380
|
[AppAttributes.SceneIndex]: 0
|
1342
1381
|
});
|
1343
1382
|
}
|
1344
1383
|
updateAppState(appId, stateName, state) {
|
1345
|
-
if (lodash.get(this.attributes, [
|
1384
|
+
if (lodash.get(this.attributes, [
|
1385
|
+
"apps",
|
1386
|
+
appId,
|
1387
|
+
"state"
|
1388
|
+
/* State */
|
1389
|
+
])) {
|
1346
1390
|
this.context.safeUpdateAttributes(["apps", appId, "state", stateName], state);
|
1347
1391
|
}
|
1348
1392
|
}
|
@@ -1352,13 +1396,19 @@ class AttributesDelegate {
|
|
1352
1396
|
cleanAppAttributes(id) {
|
1353
1397
|
this.context.safeUpdateAttributes(["apps", id], void 0);
|
1354
1398
|
this.context.safeSetAttributes({ [id]: void 0 });
|
1355
|
-
const focus = this.attributes[
|
1399
|
+
const focus = this.attributes[
|
1400
|
+
"focus"
|
1401
|
+
/* Focus */
|
1402
|
+
];
|
1356
1403
|
if (focus === id) {
|
1357
1404
|
this.cleanFocus();
|
1358
1405
|
}
|
1359
1406
|
}
|
1360
1407
|
cleanFocus() {
|
1361
|
-
this.context.safeSetAttributes({ [
|
1408
|
+
this.context.safeSetAttributes({ [
|
1409
|
+
"focus"
|
1410
|
+
/* Focus */
|
1411
|
+
]: void 0 });
|
1362
1412
|
}
|
1363
1413
|
getAppSceneIndex(id) {
|
1364
1414
|
var _a;
|
@@ -1375,7 +1425,10 @@ class AttributesDelegate {
|
|
1375
1425
|
return this.attributes["_mainSceneIndex"];
|
1376
1426
|
}
|
1377
1427
|
getBoxState() {
|
1378
|
-
return this.attributes[
|
1428
|
+
return this.attributes[
|
1429
|
+
"boxState"
|
1430
|
+
/* BoxState */
|
1431
|
+
];
|
1379
1432
|
}
|
1380
1433
|
setMainViewScenePath(scenePath) {
|
1381
1434
|
this.context.safeSetAttributes({ _mainScenePath: scenePath });
|
@@ -1384,44 +1437,84 @@ class AttributesDelegate {
|
|
1384
1437
|
this.context.safeSetAttributes({ _mainSceneIndex: index2 });
|
1385
1438
|
}
|
1386
1439
|
getMainViewCamera() {
|
1387
|
-
return lodash.get(this.attributes, [
|
1440
|
+
return lodash.get(this.attributes, [
|
1441
|
+
"mainViewCamera"
|
1442
|
+
/* MainViewCamera */
|
1443
|
+
]);
|
1388
1444
|
}
|
1389
1445
|
getMainViewSize() {
|
1390
|
-
return lodash.get(this.attributes, [
|
1446
|
+
return lodash.get(this.attributes, [
|
1447
|
+
"mainViewSize"
|
1448
|
+
/* MainViewSize */
|
1449
|
+
]);
|
1391
1450
|
}
|
1392
1451
|
setMainViewCamera(camera) {
|
1393
|
-
this.context.safeSetAttributes({ [
|
1452
|
+
this.context.safeSetAttributes({ [
|
1453
|
+
"mainViewCamera"
|
1454
|
+
/* MainViewCamera */
|
1455
|
+
]: { ...camera } });
|
1394
1456
|
}
|
1395
1457
|
setMainViewSize(size) {
|
1396
|
-
this.context.safeSetAttributes({ [
|
1458
|
+
this.context.safeSetAttributes({ [
|
1459
|
+
"mainViewSize"
|
1460
|
+
/* MainViewSize */
|
1461
|
+
]: { ...size } });
|
1397
1462
|
}
|
1398
1463
|
setMainViewCameraAndSize(camera, size) {
|
1399
1464
|
this.context.safeSetAttributes({
|
1400
|
-
[
|
1401
|
-
|
1465
|
+
[
|
1466
|
+
"mainViewCamera"
|
1467
|
+
/* MainViewCamera */
|
1468
|
+
]: { ...camera },
|
1469
|
+
[
|
1470
|
+
"mainViewSize"
|
1471
|
+
/* MainViewSize */
|
1472
|
+
]: { ...size }
|
1402
1473
|
});
|
1403
1474
|
}
|
1404
1475
|
updateCursor(uid, position) {
|
1405
|
-
if (!lodash.get(this.attributes, [
|
1406
|
-
|
1476
|
+
if (!lodash.get(this.attributes, [
|
1477
|
+
"cursors"
|
1478
|
+
/* Cursors */
|
1479
|
+
])) {
|
1480
|
+
this.context.safeUpdateAttributes([
|
1481
|
+
"cursors"
|
1482
|
+
/* Cursors */
|
1483
|
+
], {});
|
1407
1484
|
}
|
1408
1485
|
if (!lodash.get(this.attributes, ["cursors", uid])) {
|
1409
1486
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1410
1487
|
}
|
1411
|
-
this.context.safeUpdateAttributes([
|
1488
|
+
this.context.safeUpdateAttributes([
|
1489
|
+
"cursors",
|
1490
|
+
uid,
|
1491
|
+
"position"
|
1492
|
+
/* Position */
|
1493
|
+
], position);
|
1412
1494
|
}
|
1413
1495
|
updateCursorState(uid, cursorState) {
|
1414
1496
|
if (!lodash.get(this.attributes, ["cursors", uid])) {
|
1415
1497
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1416
1498
|
}
|
1417
|
-
this.context.safeUpdateAttributes([
|
1499
|
+
this.context.safeUpdateAttributes([
|
1500
|
+
"cursors",
|
1501
|
+
uid,
|
1502
|
+
"cursorState"
|
1503
|
+
/* CursorState */
|
1504
|
+
], cursorState);
|
1418
1505
|
}
|
1419
1506
|
getCursorState(uid) {
|
1420
|
-
return lodash.get(this.attributes, [
|
1507
|
+
return lodash.get(this.attributes, [
|
1508
|
+
"cursors",
|
1509
|
+
uid,
|
1510
|
+
"cursorState"
|
1511
|
+
/* CursorState */
|
1512
|
+
]);
|
1421
1513
|
}
|
1422
1514
|
cleanCursor(uid) {
|
1423
1515
|
this.context.safeUpdateAttributes(["cursors", uid], void 0);
|
1424
1516
|
}
|
1517
|
+
// TODO 状态中保存一个 SceneName 优化性能
|
1425
1518
|
setMainViewFocusPath(mainView) {
|
1426
1519
|
const scenePath = this.getMainViewScenePath();
|
1427
1520
|
if (scenePath) {
|
@@ -1869,6 +1962,7 @@ class AppProxy {
|
|
1869
1962
|
throw new Error(`[WindowManager]: app setup error: ${error.message}`);
|
1870
1963
|
}
|
1871
1964
|
}
|
1965
|
+
// 兼容移动端创建时会出现 PPT 不适配的问题
|
1872
1966
|
fixMobileSize() {
|
1873
1967
|
var _a, _b;
|
1874
1968
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(this.id);
|
@@ -1999,6 +2093,7 @@ class AppProxy {
|
|
1999
2093
|
get pageState() {
|
2000
2094
|
return this._pageState.toObject();
|
2001
2095
|
}
|
2096
|
+
// PageRemoveService
|
2002
2097
|
async removeSceneByIndex(index2) {
|
2003
2098
|
const scenePath = this._pageState.getFullPath(index2);
|
2004
2099
|
if (scenePath && this.pageState) {
|
@@ -2022,6 +2117,7 @@ class AppProxy {
|
|
2022
2117
|
this.view.focusSceneIndex = index2;
|
2023
2118
|
}
|
2024
2119
|
}
|
2120
|
+
// PageRemoveService end
|
2025
2121
|
setSceneIndex(index2) {
|
2026
2122
|
if (this.view) {
|
2027
2123
|
this.view.focusSceneIndex = index2;
|
@@ -2533,8 +2629,8 @@ const createScrollStorage = (manager) => {
|
|
2533
2629
|
defaultState: { scrollTop: 0 }
|
2534
2630
|
});
|
2535
2631
|
};
|
2536
|
-
function clamp$2(
|
2537
|
-
return
|
2632
|
+
function clamp$2(x, min, max) {
|
2633
|
+
return x < min ? min : x > max ? max : x;
|
2538
2634
|
}
|
2539
2635
|
class ScrollMode {
|
2540
2636
|
constructor(manager) {
|
@@ -3093,6 +3189,10 @@ class AppManager {
|
|
3093
3189
|
});
|
3094
3190
|
});
|
3095
3191
|
}
|
3192
|
+
/**
|
3193
|
+
* 根目录被删除时所有的 scene 都会被删除.
|
3194
|
+
* 所以需要关掉所有开启了 view 的 app
|
3195
|
+
*/
|
3096
3196
|
async onRootDirRemoved(needClose = true) {
|
3097
3197
|
await this.setMainViewScenePath(INIT_DIR);
|
3098
3198
|
this.createRootDirScenesCallback();
|
@@ -3197,6 +3297,12 @@ class AppManager {
|
|
3197
3297
|
return () => redoUndo.destroy();
|
3198
3298
|
});
|
3199
3299
|
}
|
3300
|
+
/**
|
3301
|
+
* 插件更新 apps 时的回调
|
3302
|
+
*
|
3303
|
+
* @param {*} apps
|
3304
|
+
* @memberof WindowManager
|
3305
|
+
*/
|
3200
3306
|
async _attributesUpdateCallback(apps) {
|
3201
3307
|
if (apps && WindowManager.container) {
|
3202
3308
|
const appIds = Object.keys(apps);
|
@@ -3463,6 +3569,20 @@ class AppManager {
|
|
3463
3569
|
(_a = this.scrollMode) == null ? void 0 : _a.dispose();
|
3464
3570
|
}
|
3465
3571
|
}
|
3572
|
+
/*! *****************************************************************************
|
3573
|
+
Copyright (c) Microsoft Corporation.
|
3574
|
+
|
3575
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
3576
|
+
purpose with or without fee is hereby granted.
|
3577
|
+
|
3578
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
3579
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
3580
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
3581
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
3582
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
3583
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
3584
|
+
PERFORMANCE OF THIS SOFTWARE.
|
3585
|
+
***************************************************************************** */
|
3466
3586
|
var __assign = function() {
|
3467
3587
|
__assign = Object.assign || function __assign2(t) {
|
3468
3588
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -4271,6 +4391,9 @@ function index(nodeOrSelector, props) {
|
|
4271
4391
|
var node = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
4272
4392
|
return getStyler(node, props);
|
4273
4393
|
}
|
4394
|
+
function getDefaultExportFromCjs(x) {
|
4395
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
4396
|
+
}
|
4274
4397
|
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
4275
4398
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
4276
4399
|
if (ret !== void 0) {
|
@@ -4302,6 +4425,7 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
4302
4425
|
}
|
4303
4426
|
return true;
|
4304
4427
|
};
|
4428
|
+
const shallowequal$1 = /* @__PURE__ */ getDefaultExportFromCjs(shallowequal);
|
4305
4429
|
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}')();
|
4306
4430
|
var TELE_BOX_COLOR_SCHEME = /* @__PURE__ */ ((TELE_BOX_COLOR_SCHEME2) => {
|
4307
4431
|
TELE_BOX_COLOR_SCHEME2["Light"] = "light";
|
@@ -4541,7 +4665,7 @@ class TeleBox {
|
|
4541
4665
|
height = 0.5,
|
4542
4666
|
minWidth = 0,
|
4543
4667
|
minHeight = 0,
|
4544
|
-
x
|
4668
|
+
x = 0.1,
|
4545
4669
|
y = 0.1,
|
4546
4670
|
resizable = true,
|
4547
4671
|
draggable = true,
|
@@ -4600,36 +4724,36 @@ class TeleBox {
|
|
4600
4724
|
const minSize$ = new valueEnhancer.Val({
|
4601
4725
|
width: clamp(minWidth, 0, 1),
|
4602
4726
|
height: clamp(minHeight, 0, 1)
|
4603
|
-
}, { compare: shallowequal });
|
4727
|
+
}, { compare: shallowequal$1 });
|
4604
4728
|
const pxMinSize$ = valueEnhancer.combine([minSize$, managerStageRect$], ([minSize, managerStageRect]) => ({
|
4605
4729
|
width: minSize.width * managerStageRect.width,
|
4606
4730
|
height: minSize.height * managerStageRect.height
|
4607
|
-
}), { compare: shallowequal });
|
4608
|
-
const intrinsicSize$ = new valueEnhancer.Val({ width, height }, { compare: shallowequal });
|
4731
|
+
}), { compare: shallowequal$1 });
|
4732
|
+
const intrinsicSize$ = new valueEnhancer.Val({ width, height }, { compare: shallowequal$1 });
|
4609
4733
|
this._sideEffect.addDisposer(minSize$.reaction((minSize, skipUpdate) => {
|
4610
4734
|
intrinsicSize$.setValue({
|
4611
4735
|
width: Math.max(width, minSize.width),
|
4612
4736
|
height: Math.max(height, minSize.height)
|
4613
4737
|
}, skipUpdate);
|
4614
4738
|
}));
|
4615
|
-
const intrinsicCoord$ = new valueEnhancer.Val({ x
|
4739
|
+
const intrinsicCoord$ = new valueEnhancer.Val({ x, y }, { compare: shallowequal$1 });
|
4616
4740
|
const pxIntrinsicSize$ = valueEnhancer.combine([intrinsicSize$, managerStageRect$], ([size, managerStageRect]) => ({
|
4617
4741
|
width: managerStageRect.width * size.width,
|
4618
4742
|
height: managerStageRect.height * size.height
|
4619
|
-
}), { compare: shallowequal });
|
4743
|
+
}), { compare: shallowequal$1 });
|
4620
4744
|
const pxIntrinsicCoord$ = valueEnhancer.combine([intrinsicCoord$, managerStageRect$], ([intrinsicCoord, managerStageRect]) => ({
|
4621
4745
|
x: intrinsicCoord.x * managerStageRect.width,
|
4622
4746
|
y: intrinsicCoord.y * managerStageRect.height
|
4623
|
-
}), { compare: shallowequal });
|
4747
|
+
}), { compare: shallowequal$1 });
|
4624
4748
|
const bodyStyle$ = new valueEnhancer.Val(bodyStyle);
|
4625
4749
|
const stageStyle$ = new valueEnhancer.Val(stageStyle);
|
4626
4750
|
const contentRoot$ = new valueEnhancer.Val(null);
|
4627
4751
|
const bodyRect$ = new valueEnhancer.Val(managerStageRect$.value, {
|
4628
|
-
compare: shallowequal
|
4752
|
+
compare: shallowequal$1
|
4629
4753
|
});
|
4630
4754
|
const stageRatio$ = new valueEnhancer.Val(stageRatio);
|
4631
4755
|
const finalStageRatio$ = valueEnhancer.combine([stageRatio$, managerStageRatio$], ([stageRatio2, managerStageRatio]) => stageRatio2 != null ? stageRatio2 : managerStageRatio);
|
4632
|
-
const stageRect$ = valueEnhancer.combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal });
|
4756
|
+
const stageRect$ = valueEnhancer.combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal$1 });
|
4633
4757
|
const propsValConfig = {
|
4634
4758
|
darkMode: darkMode$,
|
4635
4759
|
fence: fence$,
|
@@ -4762,16 +4886,16 @@ class TeleBox {
|
|
4762
4886
|
get intrinsicHeight() {
|
4763
4887
|
return this._intrinsicSize$.value.height;
|
4764
4888
|
}
|
4765
|
-
move(
|
4889
|
+
move(x, y, skipUpdate = false) {
|
4766
4890
|
let safeX;
|
4767
4891
|
let safeY;
|
4768
4892
|
const managerStageRect = this.managerStageRect;
|
4769
4893
|
const pxIntrinsicSize = this.pxIntrinsicSize;
|
4770
4894
|
if (this.fence) {
|
4771
|
-
safeX = clamp(
|
4895
|
+
safeX = clamp(x, 0, managerStageRect.width - pxIntrinsicSize.width);
|
4772
4896
|
safeY = clamp(y, 0, managerStageRect.height - pxIntrinsicSize.height);
|
4773
4897
|
} else {
|
4774
|
-
safeX = clamp(
|
4898
|
+
safeX = clamp(x, -(pxIntrinsicSize.width - 120), 0 + managerStageRect.width - 20);
|
4775
4899
|
safeY = clamp(y, 0, 0 + managerStageRect.height - 20);
|
4776
4900
|
}
|
4777
4901
|
this._intrinsicCoord$.setValue({
|
@@ -4779,7 +4903,7 @@ class TeleBox {
|
|
4779
4903
|
y: safeY / managerStageRect.height
|
4780
4904
|
}, skipUpdate);
|
4781
4905
|
}
|
4782
|
-
transform(
|
4906
|
+
transform(x, y, width, height, skipUpdate = false) {
|
4783
4907
|
const managerStageRect = this.managerStageRect;
|
4784
4908
|
width = Math.max(width, this.pxMinSize.width);
|
4785
4909
|
height = Math.max(height, this.pxMinSize.height);
|
@@ -4794,7 +4918,7 @@ class TeleBox {
|
|
4794
4918
|
y = 0;
|
4795
4919
|
height = this.pxIntrinsicSize.height;
|
4796
4920
|
}
|
4797
|
-
this.move(
|
4921
|
+
this.move(x, y, skipUpdate);
|
4798
4922
|
this._intrinsicSize$.setValue({
|
4799
4923
|
width: width / managerStageRect.width,
|
4800
4924
|
height: height / managerStageRect.height
|
@@ -4939,7 +5063,7 @@ class TeleBox {
|
|
4939
5063
|
styles.scaleY = collectorRect.height / boxHeight;
|
4940
5064
|
}
|
4941
5065
|
return styles;
|
4942
|
-
}, { compare: shallowequal });
|
5066
|
+
}, { compare: shallowequal$1 });
|
4943
5067
|
const boxStyles = boxStyles$.value;
|
4944
5068
|
this.$box.style.width = boxStyles.width + "px";
|
4945
5069
|
this.$box.style.height = boxStyles.height + "px";
|
@@ -5253,10 +5377,10 @@ class TeleBoxCollector {
|
|
5253
5377
|
}),
|
5254
5378
|
minimized$.subscribe((minimized) => {
|
5255
5379
|
if (minimized) {
|
5256
|
-
const { x
|
5380
|
+
const { x, y, width, height } = $collector.getBoundingClientRect();
|
5257
5381
|
const rootRect = root.getBoundingClientRect();
|
5258
5382
|
rect$.setValue({
|
5259
|
-
x:
|
5383
|
+
x: x - rootRect.x,
|
5260
5384
|
y: y - rootRect.y,
|
5261
5385
|
width,
|
5262
5386
|
height
|
@@ -5423,7 +5547,7 @@ class TeleBoxManager {
|
|
5423
5547
|
y: 0,
|
5424
5548
|
width: window.innerWidth,
|
5425
5549
|
height: window.innerHeight
|
5426
|
-
}, { compare: shallowequal });
|
5550
|
+
}, { compare: shallowequal$1 });
|
5427
5551
|
this._sideEffect.addDisposer(root$.subscribe((root2) => {
|
5428
5552
|
this._sideEffect.add(() => {
|
5429
5553
|
if (!root2) {
|
@@ -5443,7 +5567,7 @@ class TeleBoxManager {
|
|
5443
5567
|
}, "calc-root-rect");
|
5444
5568
|
}));
|
5445
5569
|
const stageRect$ = valueEnhancer.combine([rootRect$, stageRatio$], calcStageRect, {
|
5446
|
-
compare: shallowequal
|
5570
|
+
compare: shallowequal$1
|
5447
5571
|
});
|
5448
5572
|
this.boxes$ = new valueEnhancer.Val([]);
|
5449
5573
|
this.topBox$ = new valueEnhancer.Val(void 0);
|
@@ -5481,7 +5605,7 @@ class TeleBoxManager {
|
|
5481
5605
|
const darkMode$ = valueEnhancer.combine([prefersDark$, prefersColorScheme$], ([prefersDark, prefersColorScheme2]) => prefersColorScheme2 === "auto" ? prefersDark : prefersColorScheme2 === "dark");
|
5482
5606
|
const state$ = valueEnhancer.combine([minimized$, maximized$], ([minimized2, maximized2]) => minimized2 ? TELE_BOX_STATE.Minimized : maximized2 ? TELE_BOX_STATE.Maximized : TELE_BOX_STATE.Normal);
|
5483
5607
|
const theme$ = new valueEnhancer.Val(theme, {
|
5484
|
-
compare: shallowequal
|
5608
|
+
compare: shallowequal$1
|
5485
5609
|
});
|
5486
5610
|
const readonlyValConfig = {
|
5487
5611
|
darkMode: darkMode$,
|
@@ -5900,11 +6024,11 @@ class TeleBoxManager {
|
|
5900
6024
|
}
|
5901
6025
|
}
|
5902
6026
|
smartPosition(rect) {
|
5903
|
-
let { x
|
6027
|
+
let { x, y } = rect;
|
5904
6028
|
const { width = 0.5, height = 0.5 } = rect;
|
5905
6029
|
const stageRect = this.stageRect;
|
5906
6030
|
const topBox = this.topBox;
|
5907
|
-
if (
|
6031
|
+
if (x == null) {
|
5908
6032
|
let pxX = 20;
|
5909
6033
|
if (topBox) {
|
5910
6034
|
const pxPreferredX = topBox.pxIntrinsicCoord.x + 20;
|
@@ -5913,7 +6037,7 @@ class TeleBoxManager {
|
|
5913
6037
|
pxX = pxPreferredX;
|
5914
6038
|
}
|
5915
6039
|
}
|
5916
|
-
|
6040
|
+
x = pxX / stageRect.width;
|
5917
6041
|
}
|
5918
6042
|
if (y == null) {
|
5919
6043
|
let pxY = 20;
|
@@ -5926,7 +6050,7 @@ class TeleBoxManager {
|
|
5926
6050
|
}
|
5927
6051
|
y = pxY / stageRect.height;
|
5928
6052
|
}
|
5929
|
-
return { x
|
6053
|
+
return { x, y, width, height };
|
5930
6054
|
}
|
5931
6055
|
makeBoxTop(box, skipUpdate = false) {
|
5932
6056
|
if (this.topBox) {
|
@@ -5977,6 +6101,10 @@ class BoxManager {
|
|
5977
6101
|
const { emitter: emitter2, callbacks: callbacks2, boxEmitter: boxEmitter2 } = context;
|
5978
6102
|
this.teleBoxManager = this.setupBoxManager(createTeleBoxManagerConfig);
|
5979
6103
|
this.sideEffectManager.add(() => [
|
6104
|
+
this.teleBoxManager.onValChanged("rootRect", (rect) => {
|
6105
|
+
emitter2.emit("playgroundSizeChange", rect);
|
6106
|
+
}),
|
6107
|
+
// 使用 _xxx$.reaction 订阅修改的值, 不管有没有 skipUpdate, 修改值都会触发回调
|
5980
6108
|
this.teleBoxManager.onValChanged("state", (state) => {
|
5981
6109
|
callbacks2.emit("boxStateChange", state);
|
5982
6110
|
emitter2.emit("boxStateChange", state);
|
@@ -6193,10 +6321,10 @@ class BoxManager {
|
|
6193
6321
|
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
6194
6322
|
}
|
6195
6323
|
}
|
6196
|
-
moveBox({ appId, x
|
6324
|
+
moveBox({ appId, x, y }) {
|
6197
6325
|
const box = this.getBox(appId);
|
6198
6326
|
if (box) {
|
6199
|
-
box._intrinsicCoord$.setValue({ x
|
6327
|
+
box._intrinsicCoord$.setValue({ x, y }, true);
|
6200
6328
|
}
|
6201
6329
|
}
|
6202
6330
|
focusBox({ appId }, skipUpdate = true) {
|
@@ -6295,6 +6423,9 @@ function src_url_equal(element_src, url) {
|
|
6295
6423
|
function is_empty(obj) {
|
6296
6424
|
return Object.keys(obj).length === 0;
|
6297
6425
|
}
|
6426
|
+
/* @__PURE__ */ new Set();
|
6427
|
+
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
6428
|
+
"WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
6298
6429
|
function append(target, node) {
|
6299
6430
|
target.appendChild(node);
|
6300
6431
|
}
|
@@ -6326,25 +6457,27 @@ function children(element2) {
|
|
6326
6457
|
}
|
6327
6458
|
function set_data(text2, data) {
|
6328
6459
|
data = "" + data;
|
6329
|
-
if (text2.
|
6330
|
-
|
6460
|
+
if (text2.data === data)
|
6461
|
+
return;
|
6462
|
+
text2.data = data;
|
6331
6463
|
}
|
6332
6464
|
function set_style(node, key, value, important) {
|
6333
|
-
if (value
|
6465
|
+
if (value == null) {
|
6334
6466
|
node.style.removeProperty(key);
|
6335
6467
|
} else {
|
6336
6468
|
node.style.setProperty(key, value, important ? "important" : "");
|
6337
6469
|
}
|
6338
6470
|
}
|
6471
|
+
/* @__PURE__ */ new Map();
|
6339
6472
|
let current_component;
|
6340
6473
|
function set_current_component(component) {
|
6341
6474
|
current_component = component;
|
6342
6475
|
}
|
6343
6476
|
const dirty_components = [];
|
6344
6477
|
const binding_callbacks = [];
|
6345
|
-
|
6478
|
+
let render_callbacks = [];
|
6346
6479
|
const flush_callbacks = [];
|
6347
|
-
const resolved_promise = Promise.resolve();
|
6480
|
+
const resolved_promise = /* @__PURE__ */ Promise.resolve();
|
6348
6481
|
let update_scheduled = false;
|
6349
6482
|
function schedule_update() {
|
6350
6483
|
if (!update_scheduled) {
|
@@ -6358,13 +6491,22 @@ function add_render_callback(fn) {
|
|
6358
6491
|
const seen_callbacks = /* @__PURE__ */ new Set();
|
6359
6492
|
let flushidx = 0;
|
6360
6493
|
function flush() {
|
6494
|
+
if (flushidx !== 0) {
|
6495
|
+
return;
|
6496
|
+
}
|
6361
6497
|
const saved_component = current_component;
|
6362
6498
|
do {
|
6363
|
-
|
6364
|
-
|
6365
|
-
|
6366
|
-
|
6367
|
-
|
6499
|
+
try {
|
6500
|
+
while (flushidx < dirty_components.length) {
|
6501
|
+
const component = dirty_components[flushidx];
|
6502
|
+
flushidx++;
|
6503
|
+
set_current_component(component);
|
6504
|
+
update(component.$$);
|
6505
|
+
}
|
6506
|
+
} catch (e) {
|
6507
|
+
dirty_components.length = 0;
|
6508
|
+
flushidx = 0;
|
6509
|
+
throw e;
|
6368
6510
|
}
|
6369
6511
|
set_current_component(null);
|
6370
6512
|
dirty_components.length = 0;
|
@@ -6397,6 +6539,13 @@ function update($$) {
|
|
6397
6539
|
$$.after_update.forEach(add_render_callback);
|
6398
6540
|
}
|
6399
6541
|
}
|
6542
|
+
function flush_render_callbacks(fns) {
|
6543
|
+
const filtered = [];
|
6544
|
+
const targets = [];
|
6545
|
+
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
6546
|
+
targets.forEach((c) => c());
|
6547
|
+
render_callbacks = filtered;
|
6548
|
+
}
|
6400
6549
|
const outroing = /* @__PURE__ */ new Set();
|
6401
6550
|
function transition_in(block, local) {
|
6402
6551
|
if (block && block.i) {
|
@@ -6404,6 +6553,34 @@ function transition_in(block, local) {
|
|
6404
6553
|
block.i(local);
|
6405
6554
|
}
|
6406
6555
|
}
|
6556
|
+
const _boolean_attributes = [
|
6557
|
+
"allowfullscreen",
|
6558
|
+
"allowpaymentrequest",
|
6559
|
+
"async",
|
6560
|
+
"autofocus",
|
6561
|
+
"autoplay",
|
6562
|
+
"checked",
|
6563
|
+
"controls",
|
6564
|
+
"default",
|
6565
|
+
"defer",
|
6566
|
+
"disabled",
|
6567
|
+
"formnovalidate",
|
6568
|
+
"hidden",
|
6569
|
+
"inert",
|
6570
|
+
"ismap",
|
6571
|
+
"loop",
|
6572
|
+
"multiple",
|
6573
|
+
"muted",
|
6574
|
+
"nomodule",
|
6575
|
+
"novalidate",
|
6576
|
+
"open",
|
6577
|
+
"playsinline",
|
6578
|
+
"readonly",
|
6579
|
+
"required",
|
6580
|
+
"reversed",
|
6581
|
+
"selected"
|
6582
|
+
];
|
6583
|
+
/* @__PURE__ */ new Set([..._boolean_attributes]);
|
6407
6584
|
function mount_component(component, target, anchor, customElement) {
|
6408
6585
|
const { fragment, after_update } = component.$$;
|
6409
6586
|
fragment && fragment.m(target, anchor);
|
@@ -6423,6 +6600,7 @@ function mount_component(component, target, anchor, customElement) {
|
|
6423
6600
|
function destroy_component(component, detaching) {
|
6424
6601
|
const $$ = component.$$;
|
6425
6602
|
if ($$.fragment !== null) {
|
6603
|
+
flush_render_callbacks($$.after_update);
|
6426
6604
|
run_all($$.on_destroy);
|
6427
6605
|
$$.fragment && $$.fragment.d(detaching);
|
6428
6606
|
$$.on_destroy = $$.fragment = null;
|
@@ -6443,16 +6621,19 @@ function init(component, options, instance2, create_fragment2, not_equal, props,
|
|
6443
6621
|
const $$ = component.$$ = {
|
6444
6622
|
fragment: null,
|
6445
6623
|
ctx: [],
|
6624
|
+
// state
|
6446
6625
|
props,
|
6447
6626
|
update: noop,
|
6448
6627
|
not_equal,
|
6449
6628
|
bound: blank_object(),
|
6629
|
+
// lifecycle
|
6450
6630
|
on_mount: [],
|
6451
6631
|
on_destroy: [],
|
6452
6632
|
on_disconnect: [],
|
6453
6633
|
before_update: [],
|
6454
6634
|
after_update: [],
|
6455
6635
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
6636
|
+
// everything else
|
6456
6637
|
callbacks: blank_object(),
|
6457
6638
|
dirty,
|
6458
6639
|
skip_bound: false,
|
@@ -6522,8 +6703,14 @@ function create_if_block(ctx) {
|
|
6522
6703
|
let t1;
|
6523
6704
|
let t2;
|
6524
6705
|
let div1_class_value;
|
6525
|
-
let if_block0 =
|
6526
|
-
|
6706
|
+
let if_block0 = (
|
6707
|
+
/*hasAvatar*/
|
6708
|
+
ctx[16] && create_if_block_2(ctx)
|
6709
|
+
);
|
6710
|
+
let if_block1 = (
|
6711
|
+
/*hasTagName*/
|
6712
|
+
ctx[17] && create_if_block_1(ctx)
|
6713
|
+
);
|
6527
6714
|
return {
|
6528
6715
|
c() {
|
6529
6716
|
div1 = element("div");
|
@@ -6532,7 +6719,10 @@ function create_if_block(ctx) {
|
|
6532
6719
|
if_block0.c();
|
6533
6720
|
t0 = space();
|
6534
6721
|
span = element("span");
|
6535
|
-
t1 = text$1(
|
6722
|
+
t1 = text$1(
|
6723
|
+
/*cursorName*/
|
6724
|
+
ctx[0]
|
6725
|
+
);
|
6536
6726
|
t2 = space();
|
6537
6727
|
if (if_block1)
|
6538
6728
|
if_block1.c();
|
@@ -6540,11 +6730,33 @@ function create_if_block(ctx) {
|
|
6540
6730
|
set_style(span, "white-space", "nowrap");
|
6541
6731
|
set_style(span, "text-overflow", "ellipsis");
|
6542
6732
|
set_style(span, "max-width", "80px");
|
6543
|
-
attr(
|
6544
|
-
|
6545
|
-
|
6546
|
-
|
6547
|
-
|
6733
|
+
attr(
|
6734
|
+
div0,
|
6735
|
+
"class",
|
6736
|
+
/*theme*/
|
6737
|
+
ctx[8]
|
6738
|
+
);
|
6739
|
+
set_style(
|
6740
|
+
div0,
|
6741
|
+
"background-color",
|
6742
|
+
/*backgroundColor*/
|
6743
|
+
ctx[2]
|
6744
|
+
);
|
6745
|
+
set_style(
|
6746
|
+
div0,
|
6747
|
+
"color",
|
6748
|
+
/*color*/
|
6749
|
+
ctx[9]
|
6750
|
+
);
|
6751
|
+
set_style(
|
6752
|
+
div0,
|
6753
|
+
"opacity",
|
6754
|
+
/*opacity*/
|
6755
|
+
ctx[11]
|
6756
|
+
);
|
6757
|
+
attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6758
|
+
ctx[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6759
|
+
ctx[13]);
|
6548
6760
|
},
|
6549
6761
|
m(target, anchor) {
|
6550
6762
|
insert(target, div1, anchor);
|
@@ -6559,7 +6771,10 @@ function create_if_block(ctx) {
|
|
6559
6771
|
if_block1.m(div0, null);
|
6560
6772
|
},
|
6561
6773
|
p(ctx2, dirty) {
|
6562
|
-
if (
|
6774
|
+
if (
|
6775
|
+
/*hasAvatar*/
|
6776
|
+
ctx2[16]
|
6777
|
+
) {
|
6563
6778
|
if (if_block0) {
|
6564
6779
|
if_block0.p(ctx2, dirty);
|
6565
6780
|
} else {
|
@@ -6571,9 +6786,17 @@ function create_if_block(ctx) {
|
|
6571
6786
|
if_block0.d(1);
|
6572
6787
|
if_block0 = null;
|
6573
6788
|
}
|
6574
|
-
if (dirty &
|
6575
|
-
|
6576
|
-
|
6789
|
+
if (dirty & /*cursorName*/
|
6790
|
+
1)
|
6791
|
+
set_data(
|
6792
|
+
t1,
|
6793
|
+
/*cursorName*/
|
6794
|
+
ctx2[0]
|
6795
|
+
);
|
6796
|
+
if (
|
6797
|
+
/*hasTagName*/
|
6798
|
+
ctx2[17]
|
6799
|
+
) {
|
6577
6800
|
if (if_block1) {
|
6578
6801
|
if_block1.p(ctx2, dirty);
|
6579
6802
|
} else {
|
@@ -6585,19 +6808,46 @@ function create_if_block(ctx) {
|
|
6585
6808
|
if_block1.d(1);
|
6586
6809
|
if_block1 = null;
|
6587
6810
|
}
|
6588
|
-
if (dirty &
|
6589
|
-
|
6811
|
+
if (dirty & /*theme*/
|
6812
|
+
256) {
|
6813
|
+
attr(
|
6814
|
+
div0,
|
6815
|
+
"class",
|
6816
|
+
/*theme*/
|
6817
|
+
ctx2[8]
|
6818
|
+
);
|
6590
6819
|
}
|
6591
|
-
if (dirty &
|
6592
|
-
|
6820
|
+
if (dirty & /*backgroundColor*/
|
6821
|
+
4) {
|
6822
|
+
set_style(
|
6823
|
+
div0,
|
6824
|
+
"background-color",
|
6825
|
+
/*backgroundColor*/
|
6826
|
+
ctx2[2]
|
6827
|
+
);
|
6593
6828
|
}
|
6594
|
-
if (dirty &
|
6595
|
-
|
6829
|
+
if (dirty & /*color*/
|
6830
|
+
512) {
|
6831
|
+
set_style(
|
6832
|
+
div0,
|
6833
|
+
"color",
|
6834
|
+
/*color*/
|
6835
|
+
ctx2[9]
|
6836
|
+
);
|
6596
6837
|
}
|
6597
|
-
if (dirty &
|
6598
|
-
|
6838
|
+
if (dirty & /*opacity*/
|
6839
|
+
2048) {
|
6840
|
+
set_style(
|
6841
|
+
div0,
|
6842
|
+
"opacity",
|
6843
|
+
/*opacity*/
|
6844
|
+
ctx2[11]
|
6845
|
+
);
|
6599
6846
|
}
|
6600
|
-
if (dirty &
|
6847
|
+
if (dirty & /*offset, pencilEraserSize3ImageOffset*/
|
6848
|
+
24576 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6849
|
+
ctx2[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6850
|
+
ctx2[13])) {
|
6601
6851
|
attr(div1, "class", div1_class_value);
|
6602
6852
|
}
|
6603
6853
|
},
|
@@ -6618,8 +6868,14 @@ function create_if_block_2(ctx) {
|
|
6618
6868
|
c() {
|
6619
6869
|
img = element("img");
|
6620
6870
|
attr(img, "class", "netless-window-manager-cursor-selector-avatar");
|
6621
|
-
attr(
|
6622
|
-
|
6871
|
+
attr(
|
6872
|
+
img,
|
6873
|
+
"style",
|
6874
|
+
/*computedAvatarStyle*/
|
6875
|
+
ctx[18]()
|
6876
|
+
);
|
6877
|
+
if (!src_url_equal(img.src, img_src_value = /*avatar*/
|
6878
|
+
ctx[7]))
|
6623
6879
|
attr(img, "src", img_src_value);
|
6624
6880
|
attr(img, "alt", "avatar");
|
6625
6881
|
},
|
@@ -6627,7 +6883,9 @@ function create_if_block_2(ctx) {
|
|
6627
6883
|
insert(target, img, anchor);
|
6628
6884
|
},
|
6629
6885
|
p(ctx2, dirty) {
|
6630
|
-
if (dirty &
|
6886
|
+
if (dirty & /*avatar*/
|
6887
|
+
128 && !src_url_equal(img.src, img_src_value = /*avatar*/
|
6888
|
+
ctx2[7])) {
|
6631
6889
|
attr(img, "src", img_src_value);
|
6632
6890
|
}
|
6633
6891
|
},
|
@@ -6643,19 +6901,38 @@ function create_if_block_1(ctx) {
|
|
6643
6901
|
return {
|
6644
6902
|
c() {
|
6645
6903
|
span = element("span");
|
6646
|
-
t = text$1(
|
6904
|
+
t = text$1(
|
6905
|
+
/*tagName*/
|
6906
|
+
ctx[1]
|
6907
|
+
);
|
6647
6908
|
attr(span, "class", "netless-window-manager-cursor-tag-name");
|
6648
|
-
set_style(
|
6909
|
+
set_style(
|
6910
|
+
span,
|
6911
|
+
"background-color",
|
6912
|
+
/*cursorTagBackgroundColor*/
|
6913
|
+
ctx[10]
|
6914
|
+
);
|
6649
6915
|
},
|
6650
6916
|
m(target, anchor) {
|
6651
6917
|
insert(target, span, anchor);
|
6652
6918
|
append(span, t);
|
6653
6919
|
},
|
6654
6920
|
p(ctx2, dirty) {
|
6655
|
-
if (dirty &
|
6656
|
-
|
6657
|
-
|
6658
|
-
|
6921
|
+
if (dirty & /*tagName*/
|
6922
|
+
2)
|
6923
|
+
set_data(
|
6924
|
+
t,
|
6925
|
+
/*tagName*/
|
6926
|
+
ctx2[1]
|
6927
|
+
);
|
6928
|
+
if (dirty & /*cursorTagBackgroundColor*/
|
6929
|
+
1024) {
|
6930
|
+
set_style(
|
6931
|
+
span,
|
6932
|
+
"background-color",
|
6933
|
+
/*cursorTagBackgroundColor*/
|
6934
|
+
ctx2[10]
|
6935
|
+
);
|
6659
6936
|
}
|
6660
6937
|
},
|
6661
6938
|
d(detaching) {
|
@@ -6671,7 +6948,8 @@ function create_fragment(ctx) {
|
|
6671
6948
|
let img;
|
6672
6949
|
let img_class_value;
|
6673
6950
|
let img_src_value;
|
6674
|
-
let if_block =
|
6951
|
+
let if_block = !/*isLaserPointer*/
|
6952
|
+
ctx[12] && create_if_block(ctx);
|
6675
6953
|
return {
|
6676
6954
|
c() {
|
6677
6955
|
div1 = element("div");
|
@@ -6680,14 +6958,29 @@ function create_fragment(ctx) {
|
|
6680
6958
|
t = space();
|
6681
6959
|
div0 = element("div");
|
6682
6960
|
img = element("img");
|
6683
|
-
attr(img, "class", img_class_value = "netless-window-manager-cursor-" +
|
6684
|
-
|
6961
|
+
attr(img, "class", img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6962
|
+
ctx[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6963
|
+
ctx[13]);
|
6964
|
+
if (!src_url_equal(img.src, img_src_value = /*src*/
|
6965
|
+
ctx[6]))
|
6685
6966
|
attr(img, "src", img_src_value);
|
6686
|
-
attr(
|
6967
|
+
attr(
|
6968
|
+
img,
|
6969
|
+
"alt",
|
6970
|
+
/*appliance*/
|
6971
|
+
ctx[3]
|
6972
|
+
);
|
6687
6973
|
attr(div0, "class", "cursor-image-wrapper");
|
6688
6974
|
attr(div1, "class", "netless-window-manager-cursor-mid");
|
6689
|
-
set_style(div1, "transform", "translateX(" +
|
6690
|
-
|
6975
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
6976
|
+
ctx[4] + "px) translateY(" + /*y*/
|
6977
|
+
ctx[5] + "px)");
|
6978
|
+
set_style(
|
6979
|
+
div1,
|
6980
|
+
"display",
|
6981
|
+
/*display*/
|
6982
|
+
ctx[15]
|
6983
|
+
);
|
6691
6984
|
},
|
6692
6985
|
m(target, anchor) {
|
6693
6986
|
insert(target, div1, anchor);
|
@@ -6698,7 +6991,8 @@ function create_fragment(ctx) {
|
|
6698
6991
|
append(div0, img);
|
6699
6992
|
},
|
6700
6993
|
p(ctx2, [dirty]) {
|
6701
|
-
if (
|
6994
|
+
if (!/*isLaserPointer*/
|
6995
|
+
ctx2[12]) {
|
6702
6996
|
if (if_block) {
|
6703
6997
|
if_block.p(ctx2, dirty);
|
6704
6998
|
} else {
|
@@ -6710,20 +7004,40 @@ function create_fragment(ctx) {
|
|
6710
7004
|
if_block.d(1);
|
6711
7005
|
if_block = null;
|
6712
7006
|
}
|
6713
|
-
if (dirty &
|
7007
|
+
if (dirty & /*appliance, pencilEraserSize3ImageOffset*/
|
7008
|
+
8200 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
7009
|
+
ctx2[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
7010
|
+
ctx2[13])) {
|
6714
7011
|
attr(img, "class", img_class_value);
|
6715
7012
|
}
|
6716
|
-
if (dirty &
|
7013
|
+
if (dirty & /*src*/
|
7014
|
+
64 && !src_url_equal(img.src, img_src_value = /*src*/
|
7015
|
+
ctx2[6])) {
|
6717
7016
|
attr(img, "src", img_src_value);
|
6718
7017
|
}
|
6719
|
-
if (dirty &
|
6720
|
-
|
6721
|
-
|
6722
|
-
|
6723
|
-
|
7018
|
+
if (dirty & /*appliance*/
|
7019
|
+
8) {
|
7020
|
+
attr(
|
7021
|
+
img,
|
7022
|
+
"alt",
|
7023
|
+
/*appliance*/
|
7024
|
+
ctx2[3]
|
7025
|
+
);
|
6724
7026
|
}
|
6725
|
-
if (dirty &
|
6726
|
-
|
7027
|
+
if (dirty & /*x, y*/
|
7028
|
+
48) {
|
7029
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
7030
|
+
ctx2[4] + "px) translateY(" + /*y*/
|
7031
|
+
ctx2[5] + "px)");
|
7032
|
+
}
|
7033
|
+
if (dirty & /*display*/
|
7034
|
+
32768) {
|
7035
|
+
set_style(
|
7036
|
+
div1,
|
7037
|
+
"display",
|
7038
|
+
/*display*/
|
7039
|
+
ctx2[15]
|
7040
|
+
);
|
6727
7041
|
}
|
6728
7042
|
},
|
6729
7043
|
i: noop,
|
@@ -6749,7 +7063,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6749
7063
|
let { tagName } = $$props;
|
6750
7064
|
let { backgroundColor } = $$props;
|
6751
7065
|
let { appliance } = $$props;
|
6752
|
-
let { x
|
7066
|
+
let { x } = $$props;
|
6753
7067
|
let { y } = $$props;
|
6754
7068
|
let { src } = $$props;
|
6755
7069
|
let { visible } = $$props;
|
@@ -6778,7 +7092,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6778
7092
|
if ("appliance" in $$props2)
|
6779
7093
|
$$invalidate(3, appliance = $$props2.appliance);
|
6780
7094
|
if ("x" in $$props2)
|
6781
|
-
$$invalidate(4,
|
7095
|
+
$$invalidate(4, x = $$props2.x);
|
6782
7096
|
if ("y" in $$props2)
|
6783
7097
|
$$invalidate(5, y = $$props2.y);
|
6784
7098
|
if ("src" in $$props2)
|
@@ -6799,28 +7113,36 @@ function instance($$self, $$props, $$invalidate) {
|
|
6799
7113
|
$$invalidate(20, pencilEraserSize = $$props2.pencilEraserSize);
|
6800
7114
|
};
|
6801
7115
|
$$self.$$.update = () => {
|
6802
|
-
if ($$self.$$.dirty &
|
7116
|
+
if ($$self.$$.dirty & /*cursorName*/
|
7117
|
+
1) {
|
6803
7118
|
hasName = !lodash.isEmpty(cursorName);
|
6804
7119
|
}
|
6805
|
-
if ($$self.$$.dirty &
|
7120
|
+
if ($$self.$$.dirty & /*tagName*/
|
7121
|
+
2) {
|
6806
7122
|
$$invalidate(17, hasTagName = !lodash.isEmpty(tagName));
|
6807
7123
|
}
|
6808
|
-
if ($$self.$$.dirty &
|
7124
|
+
if ($$self.$$.dirty & /*avatar*/
|
7125
|
+
128) {
|
6809
7126
|
$$invalidate(16, hasAvatar = !lodash.isEmpty(avatar));
|
6810
7127
|
}
|
6811
|
-
if ($$self.$$.dirty &
|
7128
|
+
if ($$self.$$.dirty & /*visible*/
|
7129
|
+
524288) {
|
6812
7130
|
$$invalidate(15, display = visible ? "initial" : "none");
|
6813
7131
|
}
|
6814
|
-
if ($$self.$$.dirty &
|
7132
|
+
if ($$self.$$.dirty & /*appliance*/
|
7133
|
+
8) {
|
6815
7134
|
$$invalidate(12, isLaserPointer = appliance === whiteWebSdk.ApplianceNames.laserPointer);
|
6816
7135
|
}
|
6817
|
-
if ($$self.$$.dirty &
|
7136
|
+
if ($$self.$$.dirty & /*isLaserPointer, appliance*/
|
7137
|
+
4104) {
|
6818
7138
|
$$invalidate(21, isLaserPointerPencilEraser = isLaserPointer || appliance === whiteWebSdk.ApplianceNames.pencilEraser);
|
6819
7139
|
}
|
6820
|
-
if ($$self.$$.dirty &
|
7140
|
+
if ($$self.$$.dirty & /*isLaserPointerPencilEraser*/
|
7141
|
+
2097152) {
|
6821
7142
|
$$invalidate(14, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
|
6822
7143
|
}
|
6823
|
-
if ($$self.$$.dirty &
|
7144
|
+
if ($$self.$$.dirty & /*pencilEraserSize*/
|
7145
|
+
1048576) {
|
6824
7146
|
$$invalidate(13, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
|
6825
7147
|
}
|
6826
7148
|
};
|
@@ -6829,7 +7151,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6829
7151
|
tagName,
|
6830
7152
|
backgroundColor,
|
6831
7153
|
appliance,
|
6832
|
-
|
7154
|
+
x,
|
6833
7155
|
y,
|
6834
7156
|
src,
|
6835
7157
|
avatar,
|
@@ -6903,8 +7225,8 @@ class Cursor2 {
|
|
6903
7225
|
}
|
6904
7226
|
moveCursor(cursor, rect, view) {
|
6905
7227
|
var _a, _b;
|
6906
|
-
const { x
|
6907
|
-
const point = view == null ? void 0 : view.screen.convertPointToScreen(
|
7228
|
+
const { x, y, type } = cursor;
|
7229
|
+
const point = view == null ? void 0 : view.screen.convertPointToScreen(x, y);
|
6908
7230
|
if (point) {
|
6909
7231
|
let translateX = point.x - 2;
|
6910
7232
|
let translateY = point.y - 18;
|
@@ -8228,11 +8550,11 @@ let Y$1 = class Y {
|
|
8228
8550
|
sideEffect: s,
|
8229
8551
|
readonly$: i,
|
8230
8552
|
events: r,
|
8231
|
-
wrapClassName:
|
8553
|
+
wrapClassName: n,
|
8232
8554
|
root: l,
|
8233
8555
|
pagesIndex$: p
|
8234
8556
|
}) {
|
8235
|
-
this.showPreview$ = new valueEnhancer.Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName =
|
8557
|
+
this.showPreview$ = new valueEnhancer.Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = n, this.sideEffect.addDisposer(
|
8236
8558
|
this.events.on("togglePreview", () => {
|
8237
8559
|
this.showPreview$.setValue(!this.showPreview$.value);
|
8238
8560
|
})
|
@@ -8242,11 +8564,11 @@ let Y$1 = class Y {
|
|
8242
8564
|
const c = this.renderPreview(), u = this.renderPreviewMask();
|
8243
8565
|
if (a) {
|
8244
8566
|
l.appendChild(c), l.appendChild(u), c.scrollTop;
|
8245
|
-
const
|
8567
|
+
const o2 = c.querySelector(
|
8246
8568
|
"." + this.wrapClassName(`preview-page-${p.value}`)
|
8247
8569
|
);
|
8248
|
-
return
|
8249
|
-
top:
|
8570
|
+
return o2 && c.scrollTo({
|
8571
|
+
top: o2.offsetTop - 16
|
8250
8572
|
}), c.classList.toggle(this.wrapClassName("preview-active"), true), this.previewLazyLoad = new LazyLoad({
|
8251
8573
|
container: this.$preview,
|
8252
8574
|
elements_selector: "." + this.wrapClassName("preview-page>img")
|
@@ -8280,14 +8602,14 @@ let Y$1 = class Y {
|
|
8280
8602
|
this.pages$.subscribe((t) => {
|
8281
8603
|
var s;
|
8282
8604
|
this.sideEffect.add(() => {
|
8283
|
-
const i = t.map((r,
|
8605
|
+
const i = t.map((r, n) => {
|
8284
8606
|
const l = r.thumbnail ?? (r.src.startsWith("ppt") ? void 0 : r.src);
|
8285
8607
|
if (!l)
|
8286
8608
|
return;
|
8287
|
-
const p = String(
|
8288
|
-
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${
|
8609
|
+
const p = String(n), a = document.createElement("a");
|
8610
|
+
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${n}`), a.setAttribute("href", "#"), a.dataset.pageIndex = p;
|
8289
8611
|
const c = document.createElement("span");
|
8290
|
-
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(
|
8612
|
+
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(n + 1), c.dataset.pageIndex = p;
|
8291
8613
|
const u = document.createElement("img");
|
8292
8614
|
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;
|
8293
8615
|
});
|
@@ -8356,7 +8678,7 @@ function q$1(h2) {
|
|
8356
8678
|
"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"
|
8357
8679
|
), t.appendChild(s), t;
|
8358
8680
|
}
|
8359
|
-
function
|
8681
|
+
function X$1(h2) {
|
8360
8682
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8361
8683
|
t.setAttribute("class", `${h2}-footer-icon-save`), t.setAttribute("viewBox", "0 0 448 512");
|
8362
8684
|
const s = document.createElementNS(e, "path");
|
@@ -8365,7 +8687,7 @@ function J$1(h2) {
|
|
8365
8687
|
"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"
|
8366
8688
|
), t.appendChild(s), t;
|
8367
8689
|
}
|
8368
|
-
function
|
8690
|
+
function J$1(h2) {
|
8369
8691
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8370
8692
|
t.setAttribute("class", `${h2}-footer-icon-spinner`), t.setAttribute("viewBox", "0 0 512 512");
|
8371
8693
|
const s = document.createElementNS(e, "path");
|
@@ -8385,12 +8707,12 @@ let K$1 = class K {
|
|
8385
8707
|
sideEffect: s,
|
8386
8708
|
readonly$: i,
|
8387
8709
|
events: r,
|
8388
|
-
playable:
|
8710
|
+
playable: n,
|
8389
8711
|
wrapClassName: l,
|
8390
8712
|
pagesIndex$: p,
|
8391
8713
|
root: a
|
8392
8714
|
}) {
|
8393
|
-
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable =
|
8715
|
+
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);
|
8394
8716
|
}
|
8395
8717
|
destroy() {
|
8396
8718
|
this.$footer.remove();
|
@@ -8399,15 +8721,15 @@ let K$1 = class K {
|
|
8399
8721
|
const e = document.createElement("div");
|
8400
8722
|
e.className = this.wrapClassName("footer"), this.sideEffect.addDisposer(
|
8401
8723
|
this.readonly$.subscribe(
|
8402
|
-
(
|
8724
|
+
(o2) => e.classList.toggle(this.wrapClassName("readonly"), o2)
|
8403
8725
|
)
|
8404
8726
|
);
|
8405
8727
|
const t = this.renderFooterBtn("btn-sidebar", W$1(this.namespace));
|
8406
8728
|
this.sideEffect.addEventListener(t, "click", () => {
|
8407
8729
|
this.readonly$.value || this.events.emit("togglePreview");
|
8408
8730
|
}), e.appendChild(t), this.sideEffect.addDisposer(
|
8409
|
-
this.pages$.subscribe((
|
8410
|
-
const d =
|
8731
|
+
this.pages$.subscribe((o2) => {
|
8732
|
+
const d = o2.some((g2) => g2.thumbnail || !g2.src.startsWith("ppt"));
|
8411
8733
|
t.style.display = d ? "" : "none";
|
8412
8734
|
})
|
8413
8735
|
);
|
@@ -8417,54 +8739,54 @@ let K$1 = class K {
|
|
8417
8739
|
if (this.sideEffect.addEventListener(i, "click", () => {
|
8418
8740
|
this.readonly$.value || this.events.emit("back");
|
8419
8741
|
}), s.appendChild(i), this.playable) {
|
8420
|
-
const
|
8742
|
+
const o2 = this.renderFooterBtn(
|
8421
8743
|
"btn-page-play",
|
8422
8744
|
G$1(this.namespace),
|
8423
8745
|
q$1(this.namespace)
|
8424
8746
|
);
|
8425
|
-
this.sideEffect.addEventListener(
|
8426
|
-
this.readonly$.value || (
|
8427
|
-
() =>
|
8747
|
+
this.sideEffect.addEventListener(o2, "click", () => {
|
8748
|
+
this.readonly$.value || (o2.classList.toggle(this.wrapClassName("footer-btn-playing"), true), this.events.emit("play"), this.sideEffect.setTimeout(
|
8749
|
+
() => o2.classList.toggle(this.wrapClassName("footer-btn-playing"), false),
|
8428
8750
|
500,
|
8429
8751
|
"returnPlay"
|
8430
8752
|
));
|
8431
|
-
}), s.appendChild(
|
8753
|
+
}), s.appendChild(o2);
|
8432
8754
|
}
|
8433
8755
|
const r = this.renderFooterBtn("btn-page-next", O$1(this.namespace));
|
8434
8756
|
this.sideEffect.addEventListener(r, "click", () => {
|
8435
8757
|
this.readonly$.value || this.events.emit("next");
|
8436
8758
|
}), s.appendChild(r);
|
8437
|
-
const
|
8438
|
-
|
8759
|
+
const n = document.createElement("div");
|
8760
|
+
n.className = this.wrapClassName("page-number");
|
8439
8761
|
const l = document.createElement("input");
|
8440
8762
|
l.className = this.wrapClassName("page-number-input"), this.sideEffect.addDisposer(
|
8441
|
-
this.readonly$.subscribe((
|
8763
|
+
this.readonly$.subscribe((o2) => l.disabled = o2)
|
8442
8764
|
), this.sideEffect.addDisposer(
|
8443
|
-
this.pagesIndex$.subscribe((
|
8765
|
+
this.pagesIndex$.subscribe((o2) => l.value = String(o2 + 1))
|
8444
8766
|
), this.sideEffect.addEventListener(l, "blur", () => {
|
8445
8767
|
l.value = String(this.pagesIndex$.value + 1);
|
8446
8768
|
}), this.sideEffect.addEventListener(l, "change", () => {
|
8447
8769
|
if (this.readonly$.value)
|
8448
8770
|
return;
|
8449
|
-
const
|
8450
|
-
|
8771
|
+
const o2 = l.value ? Number(l.value) - 1 : NaN;
|
8772
|
+
o2 >= 0 ? this.events.emit("jumpPage", o2) : l.value = String(this.pagesIndex$.value + 1);
|
8451
8773
|
});
|
8452
8774
|
const p = document.createElement("span");
|
8453
8775
|
this.sideEffect.addDisposer(
|
8454
|
-
this.pages$.subscribe((
|
8455
|
-
p.textContent = " / " +
|
8776
|
+
this.pages$.subscribe((o2) => {
|
8777
|
+
p.textContent = " / " + o2.length;
|
8456
8778
|
})
|
8457
|
-
),
|
8458
|
-
const a =
|
8779
|
+
), n.appendChild(l), n.appendChild(p), e.appendChild(s), e.appendChild(n);
|
8780
|
+
const a = X$1(this.namespace), c = J$1(this.namespace);
|
8459
8781
|
c.style.display = "none";
|
8460
8782
|
const u = document.createElement("button");
|
8461
8783
|
return u.className = this.wrapClassName("footer-btn"), u.appendChild(a), u.appendChild(c), this.sideEffect.addEventListener(u, "click", () => {
|
8462
8784
|
this.events.emit("save");
|
8463
|
-
}), this.events.on("saveProgress", (
|
8464
|
-
if (
|
8785
|
+
}), this.events.on("saveProgress", (o2) => {
|
8786
|
+
if (o2 < 99) {
|
8465
8787
|
c.style.display = "block", a.style.display = "none";
|
8466
8788
|
const d = c.querySelector("[data-id]");
|
8467
|
-
d && (d.textContent =
|
8789
|
+
d && (d.textContent = o2.toString().padStart(2, "0"));
|
8468
8790
|
} else
|
8469
8791
|
c.style.display = "none", a.style.display = "block";
|
8470
8792
|
}), e;
|
@@ -8481,7 +8803,7 @@ class T {
|
|
8481
8803
|
previewRoot: s,
|
8482
8804
|
footerRoot: i,
|
8483
8805
|
pages$: r,
|
8484
|
-
playable:
|
8806
|
+
playable: n
|
8485
8807
|
}) {
|
8486
8808
|
this.wrapClassName = (l) => `${this.namespace}-${l}`, this.namespace = "netless-app-docs-viewer", this.sideEffect = new sideEffectManager.SideEffectManager(), this.events = new Remitter(), this.preview = new Y$1({
|
8487
8809
|
pages$: r,
|
@@ -8495,7 +8817,7 @@ class T {
|
|
8495
8817
|
}), this.footer = new K$1({
|
8496
8818
|
pages$: r,
|
8497
8819
|
readonly$: e,
|
8498
|
-
playable:
|
8820
|
+
playable: n,
|
8499
8821
|
pagesIndex$: t,
|
8500
8822
|
root: i,
|
8501
8823
|
namespace: this.namespace,
|
@@ -8508,7 +8830,7 @@ class T {
|
|
8508
8830
|
this.preview.destroy(), this.footer.destroy(), this.sideEffect.flushAll(), this.events.destroy();
|
8509
8831
|
}
|
8510
8832
|
}
|
8511
|
-
function
|
8833
|
+
function E$1(h2, e, t) {
|
8512
8834
|
return Math.min(Math.max(h2, e), t);
|
8513
8835
|
}
|
8514
8836
|
function A$1(h2) {
|
@@ -8551,27 +8873,27 @@ let Q$1 = class Q {
|
|
8551
8873
|
}
|
8552
8874
|
};
|
8553
8875
|
let Z$1 = class Z {
|
8554
|
-
constructor(e, t, s, i, r,
|
8876
|
+
constructor(e, t, s, i, r, n) {
|
8555
8877
|
this.index = e, this.lastVisit = Date.now(), this.sideEffect = new sideEffectManager.SideEffectManager();
|
8556
|
-
const l = valueEnhancer.derive(t, (
|
8878
|
+
const l = valueEnhancer.derive(t, (o2) => o2[e] || { width: 0, height: 0 }), p = valueEnhancer.combine(
|
8557
8879
|
[l, s],
|
8558
|
-
([
|
8880
|
+
([o2, d]) => (d.width - o2.width) / 2
|
8559
8881
|
), a = valueEnhancer.combine(
|
8560
|
-
[r,
|
8561
|
-
([
|
8882
|
+
[r, n],
|
8883
|
+
([o2, d]) => (o2[e] || 0) - d
|
8562
8884
|
), c = document.createElement("div");
|
8563
8885
|
c.className = "page-renderer-page", c.dataset.index = `${e}`;
|
8564
8886
|
const u = document.createElement("img");
|
8565
8887
|
u.className = "page-renderer-page-img", c.appendChild(u), this.sideEffect.addDisposer([
|
8566
|
-
valueEnhancer.combine([l, i]).subscribe(([
|
8567
|
-
c.style.width = `${
|
8888
|
+
valueEnhancer.combine([l, i]).subscribe(([o2, d]) => {
|
8889
|
+
c.style.width = `${o2.width * d}px`, c.style.height = `${o2.height * d}px`;
|
8568
8890
|
}),
|
8569
|
-
l.subscribe((
|
8570
|
-
|
8891
|
+
l.subscribe((o2) => {
|
8892
|
+
o2.thumbnail && (c.style.backgroundImage = `url("${o2.thumbnail}")`), u.width = o2.width, u.height = o2.height, u.src = o2.src;
|
8571
8893
|
}),
|
8572
8894
|
valueEnhancer.combine([p, a, i]).subscribe(
|
8573
|
-
([
|
8574
|
-
c.style.transform = `translate(${
|
8895
|
+
([o2, d, g2]) => {
|
8896
|
+
c.style.transform = `translate(${o2 * g2}px, ${d * g2}px)`;
|
8575
8897
|
}
|
8576
8898
|
)
|
8577
8899
|
]), this.$page = c;
|
@@ -8583,13 +8905,13 @@ let Z$1 = class Z {
|
|
8583
8905
|
let ee$1 = class ee {
|
8584
8906
|
constructor(e, t, s, i, r) {
|
8585
8907
|
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 = () => {
|
8586
|
-
var
|
8908
|
+
var n;
|
8587
8909
|
if (this.gcTimer = null, this.els.size > this.maxElCount) {
|
8588
8910
|
const l = [...this.els.values()].sort((p, a) => a.lastVisit - p.lastVisit);
|
8589
8911
|
for (let p = Math.floor(this.maxElCount / 4); p < l.length; p++)
|
8590
|
-
(
|
8912
|
+
(n = this.els.get(l[p].index)) == null || n.destroy(), this.els.delete(l[p].index);
|
8591
8913
|
}
|
8592
|
-
}, this.schedule = window.requestIdleCallback || ((
|
8914
|
+
}, this.schedule = window.requestIdleCallback || ((n) => window.setTimeout(n, 5e3)), this.cancelSchedule = window.cancelIdleCallback || window.clearTimeout;
|
8593
8915
|
}
|
8594
8916
|
getEl(e) {
|
8595
8917
|
let t = this.els.get(e);
|
@@ -8626,7 +8948,7 @@ let te$1 = class te {
|
|
8626
8948
|
for (let w2 = 0; w2 < d.length; w2++)
|
8627
8949
|
g2[w2] = w2 > 0 ? g2[w2 - 1] + d[w2 - 1].height : 0;
|
8628
8950
|
return g2;
|
8629
|
-
}),
|
8951
|
+
}), n = valueEnhancer.derive(s, (d) => {
|
8630
8952
|
let g2 = 1 / 0;
|
8631
8953
|
for (let w2 = d.length - 1; w2 >= 0; w2--)
|
8632
8954
|
d[w2].height <= g2 && (g2 = d[w2].height);
|
@@ -8645,8 +8967,8 @@ let te$1 = class te {
|
|
8645
8967
|
[t, i],
|
8646
8968
|
([d, g2]) => d.width / g2.width || 1
|
8647
8969
|
), a = valueEnhancer.combine(
|
8648
|
-
[s, t,
|
8649
|
-
([d, g2, w2, f2]) =>
|
8970
|
+
[s, t, n, p],
|
8971
|
+
([d, g2, w2, f2]) => E$1(Math.ceil(g2.height / f2 / w2 / 2), 1, d.length)
|
8650
8972
|
);
|
8651
8973
|
valueEnhancer.withReadonlyValueEnhancer(this, {
|
8652
8974
|
pagesScrollTop: e,
|
@@ -8655,19 +8977,19 @@ let te$1 = class te {
|
|
8655
8977
|
pagesSize: i,
|
8656
8978
|
pagesIndex: l,
|
8657
8979
|
pagesYs: r,
|
8658
|
-
pagesMinHeight:
|
8980
|
+
pagesMinHeight: n,
|
8659
8981
|
scale: p
|
8660
8982
|
}), this.pageElManager = new ee$1(s, i, p, r, e), this.$pages = this.renderPages();
|
8661
8983
|
const c = new valueEnhancer.Val(false);
|
8662
8984
|
this.sideEffect.addDisposer(
|
8663
8985
|
c.subscribe((d) => this.$pages.classList.toggle("is-hwa", d))
|
8664
8986
|
);
|
8665
|
-
const u = () => c.setValue(false),
|
8987
|
+
const u = () => c.setValue(false), o2 = () => {
|
8666
8988
|
this.sideEffect.setTimeout(u, 1e3, "turn-off-hwa"), c.setValue(true);
|
8667
8989
|
};
|
8668
8990
|
this.sideEffect.addDisposer(
|
8669
8991
|
valueEnhancer.combine([l, a, s]).subscribe(([d, g2, w2]) => {
|
8670
|
-
|
8992
|
+
o2();
|
8671
8993
|
const f2 = Math.max(d - g2, 0), N = Math.min(d + g2, w2.length - 1);
|
8672
8994
|
for (let m = 0; m < this.$pages.children.length; m++) {
|
8673
8995
|
const S2 = this.$pages.children[m], k2 = Number(S2.dataset.index);
|
@@ -8701,23 +9023,23 @@ let ie$1 = class ie {
|
|
8701
9023
|
stageRect$: s,
|
8702
9024
|
pagesSize$: i,
|
8703
9025
|
readonly$: r,
|
8704
|
-
scrollbarMinHeight:
|
9026
|
+
scrollbarMinHeight: n = se,
|
8705
9027
|
wrapClassName: l,
|
8706
9028
|
onDragScroll: p
|
8707
9029
|
}) {
|
8708
|
-
this.sideEffect = new sideEffectManager.SideEffectManager(), this.scrolling$ = new valueEnhancer.Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight =
|
9030
|
+
this.sideEffect = new sideEffectManager.SideEffectManager(), this.scrolling$ = new valueEnhancer.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$ = valueEnhancer.combine(
|
8709
9031
|
[t, s, i],
|
8710
|
-
([a, c, u]) =>
|
9032
|
+
([a, c, u]) => E$1(
|
8711
9033
|
c.height / (c.width / u.width * u.height) * a.height,
|
8712
|
-
|
9034
|
+
n,
|
8713
9035
|
a.height
|
8714
9036
|
)
|
8715
9037
|
), this.scrollTop$ = valueEnhancer.combine(
|
8716
9038
|
[t, s, i, this.scrollbarHeight$, this.pagesScrollTop$],
|
8717
|
-
([a, c, u,
|
8718
|
-
d / (u.height - u.width / c.width * c.height) * (a.height -
|
9039
|
+
([a, c, u, o2, d]) => E$1(
|
9040
|
+
d / (u.height - u.width / c.width * c.height) * (a.height - o2),
|
8719
9041
|
0,
|
8720
|
-
a.height -
|
9042
|
+
a.height - o2
|
8721
9043
|
)
|
8722
9044
|
), this.$scrollbar = this.renderScrollbar();
|
8723
9045
|
}
|
@@ -8748,15 +9070,15 @@ let ie$1 = class ie {
|
|
8748
9070
|
D(s);
|
8749
9071
|
const i = this.wrapClassName("scrollbar-dragging");
|
8750
9072
|
e.classList.toggle(i, true);
|
8751
|
-
const r = this.pagesScrollTop$.value, { clientY:
|
9073
|
+
const r = this.pagesScrollTop$.value, { clientY: n } = A$1(s), l = (a) => {
|
8752
9074
|
if (!a.isPrimary || this.readonly$.value)
|
8753
9075
|
return;
|
8754
|
-
const { clientY: c } = A$1(a), u = c -
|
9076
|
+
const { clientY: c } = A$1(a), u = c - n;
|
8755
9077
|
Math.abs(u) > 0 && this.onDragScroll && this.onDragScroll(
|
8756
9078
|
r + u / this.containerRect$.value.height * this.pagesSize$.value.height
|
8757
9079
|
);
|
8758
9080
|
}, p = (a) => {
|
8759
|
-
|
9081
|
+
a.isPrimary && (e.classList.toggle(i, false), window.removeEventListener("pointermove", l, true), window.removeEventListener("pointerup", p, true), window.removeEventListener("pointercancel", p, true));
|
8760
9082
|
};
|
8761
9083
|
window.addEventListener("pointermove", l, true), window.addEventListener("pointerup", p, true), window.addEventListener("pointercancel", p, true);
|
8762
9084
|
};
|
@@ -8770,36 +9092,36 @@ class re {
|
|
8770
9092
|
box: s,
|
8771
9093
|
pages: i,
|
8772
9094
|
pagesScrollTop: r = 0,
|
8773
|
-
onUserScroll:
|
9095
|
+
onUserScroll: n
|
8774
9096
|
}) {
|
8775
9097
|
this.sideEffect = new sideEffectManager.SideEffectManager(), this.userScrolling = false, this.toPdf = async () => {
|
8776
9098
|
const a = document.createElement("canvas"), c = a.getContext("2d");
|
8777
9099
|
if (!c)
|
8778
9100
|
return null;
|
8779
|
-
const u = this.whiteboard.pageState.pages[0],
|
8780
|
-
format: [
|
8781
|
-
orientation:
|
9101
|
+
const u = this.whiteboard.pageState.pages[0], o2 = this.pages[0], { jsPDF: d } = await import("jspdf"), g2 = new d({
|
9102
|
+
format: [o2.width, o2.height],
|
9103
|
+
orientation: o2.width > o2.height ? "l" : "p",
|
8782
9104
|
compress: true
|
8783
9105
|
});
|
8784
9106
|
for (const [S2, k2] of this.pages.entries()) {
|
8785
|
-
const { width: y, height: v, src:
|
9107
|
+
const { width: y, height: v, src: L } = k2;
|
8786
9108
|
a.width = y, a.height = v;
|
8787
|
-
const
|
8788
|
-
S2 > 0 && g2.addPage([y, v],
|
8789
|
-
const
|
8790
|
-
P2.src =
|
8791
|
-
const
|
9109
|
+
const M2 = y > v ? "l" : "p";
|
9110
|
+
S2 > 0 && g2.addPage([y, v], M2);
|
9111
|
+
const R2 = await this.getBase64FromUrl(L), P2 = document.createElement("img");
|
9112
|
+
P2.src = R2, await new Promise((_2) => P2.onload = _2), c.drawImage(P2, 0, 0);
|
9113
|
+
const V = a.toDataURL("image/jpeg", 0.6);
|
8792
9114
|
c.clearRect(0, 0, y, v), this.whiteboard.view.screenshotToCanvas(c, u, y, v, {
|
8793
9115
|
centerX: y / 2,
|
8794
9116
|
centerY: v / 2 + S2 * v,
|
8795
9117
|
scale: 1
|
8796
9118
|
});
|
8797
9119
|
const I2 = a.toDataURL("image/png");
|
8798
|
-
g2.addImage(
|
9120
|
+
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));
|
8799
9121
|
}
|
8800
9122
|
const w2 = g2.output("arraybuffer"), f2 = new Blob([w2]), N = URL.createObjectURL(f2), m = document.createElement("a");
|
8801
9123
|
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 });
|
8802
|
-
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll =
|
9124
|
+
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll = n;
|
8803
9125
|
const l = () => {
|
8804
9126
|
var a;
|
8805
9127
|
this.userScrolling = false, (a = this.onUserScroll) == null || a.call(this, this.pagesScrollTop$.value);
|
@@ -8812,8 +9134,8 @@ class re {
|
|
8812
9134
|
p,
|
8813
9135
|
(a) => {
|
8814
9136
|
let c = 0, u = 0;
|
8815
|
-
for (let
|
8816
|
-
const d = a[
|
9137
|
+
for (let o2 = a.length - 1; o2 >= 0; o2--) {
|
9138
|
+
const d = a[o2];
|
8817
9139
|
d.width > c && (c = d.width), u += d.height;
|
8818
9140
|
}
|
8819
9141
|
return { width: Math.max(1, c), height: Math.max(1, u) };
|
@@ -8873,8 +9195,8 @@ class re {
|
|
8873
9195
|
return new Promise((i) => {
|
8874
9196
|
const r = new FileReader();
|
8875
9197
|
r.readAsDataURL(s), r.onloadend = () => {
|
8876
|
-
const
|
8877
|
-
i(
|
9198
|
+
const n = r.result;
|
9199
|
+
i(n);
|
8878
9200
|
};
|
8879
9201
|
});
|
8880
9202
|
}
|
@@ -8884,7 +9206,7 @@ class re {
|
|
8884
9206
|
pageScrollTo(e) {
|
8885
9207
|
const t = this.whiteboard.view.size.height / 2 / this.pageRenderer.scale;
|
8886
9208
|
this.whiteboard.view.moveCamera({
|
8887
|
-
centerY:
|
9209
|
+
centerY: E$1(
|
8888
9210
|
e + t,
|
8889
9211
|
t,
|
8890
9212
|
this.pagesSize$.value.height - t
|
@@ -8894,7 +9216,7 @@ class re {
|
|
8894
9216
|
}
|
8895
9217
|
userScrollToPageIndex(e) {
|
8896
9218
|
var t;
|
8897
|
-
if (e =
|
9219
|
+
if (e = E$1(e, 0, this.pages.length - 1), !this.readonly$.value && !Number.isNaN(e)) {
|
8898
9220
|
const s = this.pageRenderer.pagesYs[e];
|
8899
9221
|
s >= 0 && ((t = this.onUserScroll) == null || t.call(this, s + 5 / this.pageRenderer.scale));
|
8900
9222
|
}
|
@@ -8903,8 +9225,8 @@ class re {
|
|
8903
9225
|
var t;
|
8904
9226
|
this.readonly$.value || (t = this.onUserScroll) == null || t.call(
|
8905
9227
|
this,
|
8906
|
-
|
8907
|
-
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale *
|
9228
|
+
E$1(
|
9229
|
+
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale * E$1(e, -1, 1),
|
8908
9230
|
0,
|
8909
9231
|
this.pageRenderer.pagesSize.height - this.pageRenderer.containerRect.height / this.pageRenderer.scale
|
8910
9232
|
)
|
@@ -8914,52 +9236,59 @@ class re {
|
|
8914
9236
|
this.sideEffect.addEventListener(
|
8915
9237
|
this.box.$main,
|
8916
9238
|
"wheel",
|
8917
|
-
(
|
8918
|
-
D(
|
9239
|
+
(t) => {
|
9240
|
+
D(t), !this.readonly$.value && this.pageScrollStepper.paused && (this.pageScrollTo(this.pagesScrollTop + t.deltaY), this.debounceOnUserScroll());
|
8919
9241
|
},
|
8920
9242
|
{ passive: false }
|
8921
9243
|
), this.sideEffect.addEventListener(
|
8922
9244
|
this.box.$main,
|
8923
9245
|
"touchmove",
|
8924
|
-
(
|
8925
|
-
!this.readonly$.value &&
|
9246
|
+
(t) => {
|
9247
|
+
!this.readonly$.value && t.touches.length > 1 && this.debounceOnUserScroll();
|
8926
9248
|
},
|
8927
9249
|
{ passive: true, capture: true }
|
8928
9250
|
), this.sideEffect.add(() => {
|
8929
|
-
const
|
8930
|
-
const { width:
|
8931
|
-
if (
|
9251
|
+
const t = (s) => {
|
9252
|
+
const { width: i, height: r } = this.whiteboard.view.size;
|
9253
|
+
if (i <= 0 || r <= 0)
|
8932
9254
|
return;
|
8933
|
-
const
|
8934
|
-
this.pagesScrollTop$.setValue(Math.max(0,
|
9255
|
+
const n = s.centerY - this.pageRenderer.containerRect.height / this.pageRenderer.scale / 2;
|
9256
|
+
this.pagesScrollTop$.setValue(Math.max(0, n));
|
8935
9257
|
};
|
8936
|
-
return this.whiteboard.view.callbacks.on("onCameraUpdated",
|
9258
|
+
return this.whiteboard.view.callbacks.on("onCameraUpdated", t), () => this.whiteboard.view.callbacks.off("onCameraUpdated", t);
|
8937
9259
|
}), this.sideEffect.addDisposer(
|
8938
|
-
this.box._stageRect$.subscribe((
|
8939
|
-
const { width:
|
9260
|
+
this.box._stageRect$.subscribe((t) => {
|
9261
|
+
const { width: s, height: i } = this.pagesSize$.value;
|
8940
9262
|
this.whiteboard.view.moveCameraToContain({
|
8941
9263
|
originX: 0,
|
8942
9264
|
originY: this.pageRenderer.pagesScrollTop,
|
8943
|
-
width:
|
8944
|
-
height:
|
9265
|
+
width: s,
|
9266
|
+
height: t.height / this.pageRenderer.scale,
|
8945
9267
|
animationMode: "immediately"
|
8946
9268
|
}), this.whiteboard.view.setCameraBound({
|
8947
9269
|
damping: 1,
|
8948
9270
|
maxContentMode: () => this.pageRenderer.scale,
|
8949
9271
|
minContentMode: () => this.pageRenderer.scale,
|
8950
|
-
centerX:
|
8951
|
-
centerY:
|
8952
|
-
width:
|
8953
|
-
height:
|
9272
|
+
centerX: s / 2,
|
9273
|
+
centerY: i / 2,
|
9274
|
+
width: s,
|
9275
|
+
height: i
|
8954
9276
|
});
|
8955
9277
|
}),
|
8956
9278
|
"whiteboard-size-update"
|
8957
|
-
)
|
9279
|
+
);
|
9280
|
+
const e = (t) => {
|
9281
|
+
if (!t)
|
9282
|
+
return false;
|
9283
|
+
const s = t.tagName;
|
9284
|
+
return s === "INPUT" || s === "TEXTAREA" || s === "SELECT";
|
9285
|
+
};
|
9286
|
+
this.sideEffect.addEventListener(
|
8958
9287
|
window,
|
8959
9288
|
"keyup",
|
8960
|
-
(
|
8961
|
-
if (!(this.readonly$.value || !this.box.focus || this.box.minimized))
|
8962
|
-
switch (
|
9289
|
+
(t) => {
|
9290
|
+
if (!(this.readonly$.value || !this.box.focus || this.box.minimized || e(t.target)))
|
9291
|
+
switch (t.key) {
|
8963
9292
|
case "PageDown": {
|
8964
9293
|
this.userScrollByPercent(0.8);
|
8965
9294
|
break;
|
@@ -8996,15 +9325,15 @@ class re {
|
|
8996
9325
|
let ae$1 = class ae {
|
8997
9326
|
constructor({ readonly$: e, context: t, whiteboard: s, box: i, pages: r }) {
|
8998
9327
|
this.sideEffect = new sideEffectManager.SideEffectManager(), this.context = t, this.whiteboard = s, this.box = i, this.pages = r;
|
8999
|
-
const
|
9000
|
-
this.pagesIndex$ =
|
9328
|
+
const n = new valueEnhancer.Val(t.displayer.state.sceneState.index || 0);
|
9329
|
+
this.pagesIndex$ = n, this.sideEffect.add(() => {
|
9001
9330
|
const l = (p) => {
|
9002
9331
|
this.jumpToPage(p.index);
|
9003
9332
|
};
|
9004
9333
|
return this.context.emitter.on("sceneStateChange", l), () => this.context.emitter.off("sceneStateChange", l);
|
9005
9334
|
}), this.viewer = new T({
|
9006
9335
|
readonly$: e,
|
9007
|
-
pagesIndex$:
|
9336
|
+
pagesIndex$: n,
|
9008
9337
|
previewRoot: i.$body,
|
9009
9338
|
footerRoot: i.$footer,
|
9010
9339
|
pages$: new valueEnhancer.Val(r),
|
@@ -9018,11 +9347,11 @@ let ae$1 = class ae {
|
|
9018
9347
|
this.viewer.events.on("back", () => this.prevPage()),
|
9019
9348
|
this.viewer.events.on("next", () => this.nextPage())
|
9020
9349
|
]), this.render(), this.sideEffect.addDisposer(
|
9021
|
-
|
9022
|
-
var u,
|
9350
|
+
n.subscribe((l, p) => {
|
9351
|
+
var u, o2;
|
9023
9352
|
if (e.value)
|
9024
9353
|
return;
|
9025
|
-
const a = this.context.getInitScenePath(), c = (
|
9354
|
+
const a = this.context.getInitScenePath(), c = (o2 = (u = this.context.getScenes()) == null ? void 0 : u[l]) == null ? void 0 : o2.name;
|
9026
9355
|
if (a && c && this.context.setScenePath(`${a}/${c}`), p) {
|
9027
9356
|
const d = this.context.room;
|
9028
9357
|
if (d) {
|
@@ -9049,7 +9378,7 @@ let ae$1 = class ae {
|
|
9049
9378
|
this.jumpToPage(this.pagesIndex$.value - 1, true);
|
9050
9379
|
}
|
9051
9380
|
jumpToPage(e, t = false) {
|
9052
|
-
this.pagesIndex$.setValue(
|
9381
|
+
this.pagesIndex$.setValue(E$1(e, 0, this.pages.length - 1), t);
|
9053
9382
|
}
|
9054
9383
|
render() {
|
9055
9384
|
var t;
|
@@ -9074,8 +9403,8 @@ let ae$1 = class ae {
|
|
9074
9403
|
var r;
|
9075
9404
|
const i = this.context.room;
|
9076
9405
|
if (i && i.state.memberState.currentApplianceName === "clicker") {
|
9077
|
-
for (let
|
9078
|
-
if ((r =
|
9406
|
+
for (let n = s.target; n; n = n.parentElement)
|
9407
|
+
if ((r = n.classList) != null && r.contains("ppt-event-source"))
|
9079
9408
|
return;
|
9080
9409
|
i.pptNextStep();
|
9081
9410
|
}
|
@@ -9092,20 +9421,20 @@ const ne$1 = "DocsViewer", ue = {
|
|
9092
9421
|
if (!t)
|
9093
9422
|
throw new Error("[Docs Viewer]: scenes not found.");
|
9094
9423
|
const s = new sideEffectManager.SideEffectManager(), i = t.map(
|
9095
|
-
({ ppt:
|
9096
|
-
width:
|
9097
|
-
height:
|
9098
|
-
src:
|
9099
|
-
thumbnail:
|
9424
|
+
({ ppt: n }) => n ? {
|
9425
|
+
width: n.width,
|
9426
|
+
height: n.height,
|
9427
|
+
src: n.src,
|
9428
|
+
thumbnail: n.previewURL
|
9100
9429
|
} : null
|
9101
|
-
).filter((
|
9430
|
+
).filter((n) => Boolean(n));
|
9102
9431
|
if (i.length <= 0)
|
9103
9432
|
throw new Error("[Docs Viewer]: empty scenes.");
|
9104
9433
|
e.mountStyles(F);
|
9105
9434
|
const r = new valueEnhancer.Val(!h2.isWritable);
|
9106
9435
|
s.addDisposer(
|
9107
|
-
h2.emitter.on("writableChange", (
|
9108
|
-
r.setValue(!
|
9436
|
+
h2.emitter.on("writableChange", (n) => {
|
9437
|
+
r.setValue(!n);
|
9109
9438
|
})
|
9110
9439
|
), i[0].src.startsWith("ppt") ? le$1(
|
9111
9440
|
s,
|
@@ -9133,18 +9462,18 @@ function oe$1(h2, e, t, s, i) {
|
|
9133
9462
|
r.view.disableCameraTransform = p;
|
9134
9463
|
})
|
9135
9464
|
);
|
9136
|
-
const
|
9465
|
+
const n = e.createStorage("static-docs-viewer", { pagesScrollTop: 0 }), l = new re({
|
9137
9466
|
whiteboard: r,
|
9138
9467
|
readonly$: i,
|
9139
9468
|
box: t,
|
9140
9469
|
pages: s,
|
9141
|
-
pagesScrollTop:
|
9470
|
+
pagesScrollTop: n.state.pagesScrollTop,
|
9142
9471
|
onUserScroll: (p) => {
|
9143
|
-
e.isWritable &&
|
9472
|
+
e.isWritable && n.setState({ pagesScrollTop: p });
|
9144
9473
|
}
|
9145
9474
|
});
|
9146
9475
|
h2.addDisposer(() => l.destroy()), h2.addDisposer(
|
9147
|
-
|
9476
|
+
n.on("stateChanged", (p) => {
|
9148
9477
|
p.pagesScrollTop && l.syncPageScrollTop(p.pagesScrollTop.newValue || 0);
|
9149
9478
|
})
|
9150
9479
|
), h2.addDisposer(
|
@@ -9156,8 +9485,8 @@ function oe$1(h2, e, t, s, i) {
|
|
9156
9485
|
l.pagesSize$,
|
9157
9486
|
l.pageRenderer._pagesMinHeight$
|
9158
9487
|
],
|
9159
|
-
([p, a, c, u,
|
9160
|
-
|
9488
|
+
([p, a, c, u, o2]) => p ? Math.max(
|
9489
|
+
o2 / u.width * (2 / 5),
|
9161
9490
|
a.height / a.width
|
9162
9491
|
) : c.height / c.width * (a.height / a.width)
|
9163
9492
|
).subscribe((p) => {
|
@@ -9168,20 +9497,20 @@ function oe$1(h2, e, t, s, i) {
|
|
9168
9497
|
function le$1(h2, e, t, s, i) {
|
9169
9498
|
const r = e.createWhiteBoardView();
|
9170
9499
|
r.view.disableCameraTransform = true;
|
9171
|
-
const
|
9500
|
+
const n = new ae$1({
|
9172
9501
|
context: e,
|
9173
9502
|
whiteboard: r,
|
9174
9503
|
box: t,
|
9175
9504
|
pages: s,
|
9176
9505
|
readonly$: i
|
9177
9506
|
});
|
9178
|
-
h2.addDisposer(() =>
|
9507
|
+
h2.addDisposer(() => n.destroy());
|
9179
9508
|
const l = new valueEnhancer.Val(
|
9180
9509
|
{ width: s[0].width, height: s[0].height },
|
9181
9510
|
{ compare: z$1 }
|
9182
9511
|
);
|
9183
9512
|
if (h2.addDisposer(
|
9184
|
-
|
9513
|
+
n.pagesIndex$.subscribe((p) => {
|
9185
9514
|
const a = s[p];
|
9186
9515
|
a && l.setValue({ width: a.width, height: a.height });
|
9187
9516
|
})
|
@@ -9193,7 +9522,7 @@ function le$1(h2, e, t, s, i) {
|
|
9193
9522
|
const p = h2.add(() => {
|
9194
9523
|
const a = ({ width: c, height: u }) => {
|
9195
9524
|
if (s.length > 0 && t.state !== "maximized") {
|
9196
|
-
const { width:
|
9525
|
+
const { width: o2, height: d } = s[0], w2 = d / o2 * c - u;
|
9197
9526
|
w2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9198
9527
|
width: t.intrinsicWidth,
|
9199
9528
|
height: t.intrinsicHeight + w2 / t.rootRect.height
|
@@ -9561,13 +9890,13 @@ function Ni(e) {
|
|
9561
9890
|
return Array.isArray(e) ? e[0] : e;
|
9562
9891
|
}
|
9563
9892
|
function Li(e) {
|
9564
|
-
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N,
|
9893
|
+
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;
|
9565
9894
|
return {
|
9566
9895
|
c() {
|
9567
|
-
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"),
|
9896
|
+
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");
|
9568
9897
|
},
|
9569
9898
|
m(We, ni) {
|
9570
|
-
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,
|
9899
|
+
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);
|
9571
9900
|
},
|
9572
9901
|
p: X,
|
9573
9902
|
i: X,
|
@@ -10451,19 +10780,19 @@ const h = { getIconUrl() {
|
|
10451
10780
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10452
10781
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10453
10782
|
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" });
|
10454
|
-
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((
|
10783
|
+
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10455
10784
|
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: "" }));
|
10456
|
-
i.call(this, y,
|
10457
|
-
d.call(this,
|
10785
|
+
i.call(this, y, x), E.call(this, y, "click", () => {
|
10786
|
+
d.call(this, x, false);
|
10458
10787
|
});
|
10459
|
-
const C = _("span", null, j.get(
|
10460
|
-
L.innerHTML = e[
|
10461
|
-
const $ = _("div", { id: `plyr-settings-${e.id}-${
|
10462
|
-
D2.appendChild(_("span", { "aria-hidden": true }, j.get(
|
10788
|
+
const C = _("span", null, j.get(x, this.config)), L = _("span", { class: this.config.classNames.menu.value });
|
10789
|
+
L.innerHTML = e[x], C.appendChild(L), y.appendChild(C), N.appendChild(y);
|
10790
|
+
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10791
|
+
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) => {
|
10463
10792
|
V.key === "ArrowLeft" && (V.preventDefault(), V.stopPropagation(), d.call(this, "home", true));
|
10464
10793
|
}, false), E.call(this, D2, "click", () => {
|
10465
10794
|
d.call(this, "home", false);
|
10466
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[
|
10795
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10467
10796
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10468
10797
|
}
|
10469
10798
|
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") {
|
@@ -11047,9 +11376,9 @@ var kr = xr(function(e, i) {
|
|
11047
11376
|
}, r = {}, s = {}, n = {};
|
11048
11377
|
function a(p, v) {
|
11049
11378
|
p = p.push ? p : [p];
|
11050
|
-
var b, T2, N,
|
11379
|
+
var b, T2, N, x = [], y = p.length, C = y;
|
11051
11380
|
for (b = function(L, $) {
|
11052
|
-
$.length &&
|
11381
|
+
$.length && x.push(L), --C || v(x);
|
11053
11382
|
}; y--; )
|
11054
11383
|
T2 = p[y], (N = s[T2]) ? b(T2, N) : (n[T2] = n[T2] || []).push(b);
|
11055
11384
|
}
|
@@ -11065,32 +11394,32 @@ var kr = xr(function(e, i) {
|
|
11065
11394
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11066
11395
|
}
|
11067
11396
|
function c(p, v, b, T2) {
|
11068
|
-
var N,
|
11069
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((
|
11397
|
+
var N, x, y = document, C = b.async, L = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V = p.replace(/^(css|img)!/, "");
|
11398
|
+
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) {
|
11070
11399
|
var F2 = re2.type[0];
|
11071
11400
|
if (N)
|
11072
11401
|
try {
|
11073
|
-
|
11402
|
+
x.sheet.cssText.length || (F2 = "e");
|
11074
11403
|
} catch (ce) {
|
11075
11404
|
ce.code != 18 && (F2 = "e");
|
11076
11405
|
}
|
11077
11406
|
if (F2 == "e") {
|
11078
11407
|
if ((T2 += 1) < L)
|
11079
11408
|
return c(p, v, b, T2);
|
11080
|
-
} else if (
|
11081
|
-
return
|
11409
|
+
} else if (x.rel == "preload" && x.as == "style")
|
11410
|
+
return x.rel = "stylesheet";
|
11082
11411
|
v(p, F2, re2.defaultPrevented);
|
11083
|
-
}, $(p,
|
11412
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11084
11413
|
}
|
11085
11414
|
function u(p, v, b) {
|
11086
|
-
var T2, N,
|
11415
|
+
var T2, N, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11087
11416
|
for (T2 = function(L, $, D2) {
|
11088
11417
|
if ($ == "e" && C.push(L), $ == "b") {
|
11089
11418
|
if (!D2)
|
11090
11419
|
return;
|
11091
11420
|
C.push(L);
|
11092
11421
|
}
|
11093
|
-
--
|
11422
|
+
--x || v(C);
|
11094
11423
|
}, N = 0; N < y; N++)
|
11095
11424
|
c(p[N], T2, b);
|
11096
11425
|
}
|
@@ -11101,14 +11430,14 @@ var kr = xr(function(e, i) {
|
|
11101
11430
|
throw "LoadJS";
|
11102
11431
|
r[T2] = true;
|
11103
11432
|
}
|
11104
|
-
function
|
11433
|
+
function x(y, C) {
|
11105
11434
|
u(p, function(L) {
|
11106
11435
|
d(N, L), y && d({ success: y, error: C }, L), l(T2, L);
|
11107
11436
|
}, N);
|
11108
11437
|
}
|
11109
11438
|
if (N.returnPromise)
|
11110
|
-
return new Promise(
|
11111
|
-
|
11439
|
+
return new Promise(x);
|
11440
|
+
x();
|
11112
11441
|
}
|
11113
11442
|
return m.ready = function(p, v) {
|
11114
11443
|
return a(p, function(b) {
|
@@ -11191,11 +11520,11 @@ const nt = { setup() {
|
|
11191
11520
|
T2 = C, w.call(e, e.media, "volumechange");
|
11192
11521
|
});
|
11193
11522
|
} });
|
11194
|
-
let N, { loop:
|
11195
|
-
Object.defineProperty(e.media, "loop", { get: () =>
|
11523
|
+
let N, { loop: x } = e.config;
|
11524
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11196
11525
|
const C = o.boolean(y) ? y : e.config.loop.active;
|
11197
11526
|
e.embed.setLoop(C).then(() => {
|
11198
|
-
|
11527
|
+
x = C;
|
11199
11528
|
});
|
11200
11529
|
} }), e.embed.getVideoUrl().then((y) => {
|
11201
11530
|
N = y, h.setDownloadUrl.call(e);
|
@@ -12322,8 +12651,8 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12322
12651
|
const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
12323
12652
|
constructor(context) {
|
12324
12653
|
super(context);
|
12325
|
-
this.version = "1.0.0-canary.
|
12326
|
-
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.
|
12654
|
+
this.version = "1.0.0-canary.78";
|
12655
|
+
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" } };
|
12327
12656
|
this.emitter = callbacks;
|
12328
12657
|
this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
|
12329
12658
|
this.playground$ = new valueEnhancer.Val(void 0);
|
@@ -12339,7 +12668,7 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12339
12668
|
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12340
12669
|
};
|
12341
12670
|
_WindowManager.displayer = context.displayer;
|
12342
|
-
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.
|
12671
|
+
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" } };
|
12343
12672
|
}
|
12344
12673
|
static async mount(params) {
|
12345
12674
|
var _a;
|
@@ -12504,12 +12833,21 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12504
12833
|
}
|
12505
12834
|
}
|
12506
12835
|
}
|
12836
|
+
/**
|
12837
|
+
* 注册插件
|
12838
|
+
*/
|
12507
12839
|
static register(params) {
|
12508
12840
|
return appRegister.register(params);
|
12509
12841
|
}
|
12842
|
+
/**
|
12843
|
+
* 注销插件
|
12844
|
+
*/
|
12510
12845
|
static unregister(kind) {
|
12511
12846
|
return appRegister.unregister(kind);
|
12512
12847
|
}
|
12848
|
+
/**
|
12849
|
+
* 创建一个 app 至白板
|
12850
|
+
*/
|
12513
12851
|
async addApp(params) {
|
12514
12852
|
if (this.appManager) {
|
12515
12853
|
if (this.appManager.rootDirRemoving) {
|
@@ -12596,11 +12934,17 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12596
12934
|
}
|
12597
12935
|
return isDynamicPPT;
|
12598
12936
|
}
|
12937
|
+
/**
|
12938
|
+
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
12939
|
+
*/
|
12599
12940
|
async setMainViewScenePath(scenePath) {
|
12600
12941
|
if (this.appManager) {
|
12601
12942
|
await this.appManager.setMainViewScenePath(scenePath);
|
12602
12943
|
}
|
12603
12944
|
}
|
12945
|
+
/**
|
12946
|
+
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
12947
|
+
*/
|
12604
12948
|
async setMainViewSceneIndex(index2) {
|
12605
12949
|
if (this.appManager) {
|
12606
12950
|
await this.appManager.setMainViewSceneIndex(index2);
|
@@ -12656,6 +13000,11 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12656
13000
|
}
|
12657
13001
|
}
|
12658
13002
|
}
|
13003
|
+
/**
|
13004
|
+
* 删除一页
|
13005
|
+
* 默认删除当前页, 可以删除指定 index 页
|
13006
|
+
* 最低保留一页
|
13007
|
+
*/
|
12659
13008
|
async removePage(index2) {
|
12660
13009
|
if (this.appManager) {
|
12661
13010
|
const needRemoveIndex = index2 === void 0 ? this.pageState.index : index2;
|
@@ -12672,27 +13021,45 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12672
13021
|
return false;
|
12673
13022
|
}
|
12674
13023
|
}
|
13024
|
+
/**
|
13025
|
+
* 返回 mainView 的 ScenePath
|
13026
|
+
*/
|
12675
13027
|
getMainViewScenePath() {
|
12676
13028
|
var _a;
|
12677
13029
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewScenePath();
|
12678
13030
|
}
|
13031
|
+
/**
|
13032
|
+
* 返回 mainView 的 SceneIndex
|
13033
|
+
*/
|
12679
13034
|
getMainViewSceneIndex() {
|
12680
13035
|
var _a;
|
12681
13036
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewSceneIndex();
|
12682
13037
|
}
|
13038
|
+
/**
|
13039
|
+
* 设置所有 app 的 readonly 模式
|
13040
|
+
*/
|
12683
13041
|
setReadonly(readonly) {
|
12684
13042
|
var _a;
|
12685
13043
|
this.readonly = readonly;
|
12686
13044
|
(_a = this.boxManager) == null ? void 0 : _a.setReadonly(readonly);
|
12687
13045
|
emitter.emit("setReadonly", readonly);
|
12688
13046
|
}
|
13047
|
+
/**
|
13048
|
+
* 切换 mainView 为可写
|
13049
|
+
*/
|
12689
13050
|
switchMainViewToWriter() {
|
12690
13051
|
var _a;
|
12691
13052
|
return (_a = this.appManager) == null ? void 0 : _a.mainViewProxy.mainViewClickHandler();
|
12692
13053
|
}
|
13054
|
+
/**
|
13055
|
+
* app destroy 回调
|
13056
|
+
*/
|
12693
13057
|
onAppDestroy(kind, listener) {
|
12694
13058
|
addEmitterOnceListener(`destroy-${kind}`, listener);
|
12695
13059
|
}
|
13060
|
+
/**
|
13061
|
+
* 设置 ViewMode
|
13062
|
+
*/
|
12696
13063
|
setViewMode(mode) {
|
12697
13064
|
var _a;
|
12698
13065
|
log("setViewMode", mode);
|
@@ -12870,14 +13237,23 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12870
13237
|
}
|
12871
13238
|
return this.boxManager.teleBoxManager;
|
12872
13239
|
}
|
13240
|
+
/**
|
13241
|
+
* 查询所有的 App
|
13242
|
+
*/
|
12873
13243
|
queryAll() {
|
12874
13244
|
var _a;
|
12875
13245
|
return Array.from(((_a = this.appManager) == null ? void 0 : _a.appProxies.values()) || []);
|
12876
13246
|
}
|
13247
|
+
/**
|
13248
|
+
* 查询单个 App
|
13249
|
+
*/
|
12877
13250
|
queryOne(appId) {
|
12878
13251
|
var _a;
|
12879
13252
|
return (_a = this.appManager) == null ? void 0 : _a.appProxies.get(appId);
|
12880
13253
|
}
|
13254
|
+
/**
|
13255
|
+
* 关闭 APP
|
13256
|
+
*/
|
12881
13257
|
async closeApp(appId) {
|
12882
13258
|
var _a;
|
12883
13259
|
return (_a = this.appManager) == null ? void 0 : _a.closeApp(appId);
|
@@ -12974,9 +13350,9 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12974
13350
|
var _a;
|
12975
13351
|
(_a = this.focusedView) == null ? void 0 : _a.duplicate();
|
12976
13352
|
}
|
12977
|
-
insertText(
|
13353
|
+
insertText(x, y, text2) {
|
12978
13354
|
var _a;
|
12979
|
-
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(
|
13355
|
+
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(x, y, text2)) || "";
|
12980
13356
|
}
|
12981
13357
|
insertImage(info) {
|
12982
13358
|
var _a;
|
@@ -12999,6 +13375,7 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12999
13375
|
this._refresh();
|
13000
13376
|
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.Refresh);
|
13001
13377
|
}
|
13378
|
+
/** @inner */
|
13002
13379
|
_refresh() {
|
13003
13380
|
var _a, _b;
|
13004
13381
|
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.rebind();
|
@@ -13036,6 +13413,9 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
13036
13413
|
});
|
13037
13414
|
}, 500);
|
13038
13415
|
}
|
13416
|
+
/**
|
13417
|
+
* 切换 focus 到指定的 app, 并且把这个 app 放到最前面
|
13418
|
+
*/
|
13039
13419
|
focusApp(appId) {
|
13040
13420
|
var _a, _b, _c;
|
13041
13421
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(appId);
|