@netless/window-manager 1.0.0-canary.76 → 1.0.0-canary.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App/AppContext.d.ts +1 -1
- package/dist/App/AppPageStateImpl.d.ts +1 -1
- package/dist/App/AppProxy.d.ts +1 -1
- package/dist/App/MagixEvent/index.d.ts +7 -7
- package/dist/App/WhiteboardView.d.ts +2 -2
- package/dist/App/type.d.ts +1 -1
- package/dist/AttributesDelegate.d.ts +7 -7
- package/dist/BoxEmitter.d.ts +7 -7
- package/dist/BoxManager.d.ts +8 -8
- package/dist/Cursor/Cursor.d.ts +1 -1
- package/dist/Cursor/Cursor.svelte.d.ts +1 -0
- package/dist/Cursor/index.d.ts +2 -2
- package/dist/Helper.d.ts +1 -1
- package/dist/InternalEmitter.d.ts +3 -3
- package/dist/Page/PageController.d.ts +2 -2
- package/dist/ReconnectRefresher.d.ts +1 -1
- package/dist/RedoUndo.d.ts +1 -1
- package/dist/Register/index.d.ts +3 -3
- package/dist/Register/storage.d.ts +1 -1
- package/dist/Utils/AppCreateQueue.d.ts +1 -1
- package/dist/View/CameraSynchronizer.d.ts +1 -1
- package/dist/View/ScrollMode.d.ts +1 -1
- package/dist/View/ViewSync.d.ts +1 -1
- package/dist/callback.d.ts +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +663 -291
- package/dist/index.mjs +659 -291
- package/dist/index.umd.js +661 -293
- package/dist/storage.d.ts +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +26 -26
- package/src/Helper.ts +10 -2
- package/dist/image.d.ts +0 -19
- package/dist/shim.d.ts +0 -5
package/dist/index.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
|
));
|
@@ -794,11 +798,17 @@ const checkVersion = () => {
|
|
794
798
|
}
|
795
799
|
};
|
796
800
|
const findMemberByUid = (room, uid) => {
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
801
|
+
var _a;
|
802
|
+
const roomMembers = (room == null ? void 0 : room.state.roomMembers) || [];
|
803
|
+
let maxMemberId = -1;
|
804
|
+
let result = void 0;
|
805
|
+
for (const member of roomMembers) {
|
806
|
+
if (((_a = member.payload) == null ? void 0 : _a.uid) === uid && maxMemberId < member.memberId) {
|
807
|
+
maxMemberId = member.memberId;
|
808
|
+
result = member;
|
809
|
+
}
|
810
|
+
}
|
811
|
+
return result;
|
802
812
|
};
|
803
813
|
const serializeRoomMembers = (members) => {
|
804
814
|
return members.map((member) => {
|
@@ -987,9 +997,11 @@ class AppContext {
|
|
987
997
|
return this.displayer.calibrationTimestamp;
|
988
998
|
}
|
989
999
|
}
|
1000
|
+
/** Get App writable status. */
|
990
1001
|
get isWritable() {
|
991
1002
|
return this.appProxy.isWritable && !this.destroyed;
|
992
1003
|
}
|
1004
|
+
/** Get the App Window UI box. */
|
993
1005
|
get box() {
|
994
1006
|
const box = this.appProxy.box$.value;
|
995
1007
|
if (box) {
|
@@ -1004,6 +1016,7 @@ class AppContext {
|
|
1004
1016
|
get members() {
|
1005
1017
|
return this.manager.members$.value;
|
1006
1018
|
}
|
1019
|
+
//** currentMember is undefined in read-only and replay mode. */
|
1007
1020
|
get currentMember() {
|
1008
1021
|
const self = findMemberByUid(this.room, this.manager.uid);
|
1009
1022
|
if (!self) {
|
@@ -1289,9 +1302,15 @@ class AttributesDelegate {
|
|
1289
1302
|
this.context = context;
|
1290
1303
|
this.setAppFocus = (appId, focus) => {
|
1291
1304
|
if (focus) {
|
1292
|
-
this.context.safeSetAttributes({ [
|
1305
|
+
this.context.safeSetAttributes({ [
|
1306
|
+
"focus"
|
1307
|
+
/* Focus */
|
1308
|
+
]: appId });
|
1293
1309
|
} else {
|
1294
|
-
this.context.safeSetAttributes({ [
|
1310
|
+
this.context.safeSetAttributes({ [
|
1311
|
+
"focus"
|
1312
|
+
/* Focus */
|
1313
|
+
]: void 0 });
|
1295
1314
|
}
|
1296
1315
|
};
|
1297
1316
|
}
|
@@ -1302,16 +1321,26 @@ class AttributesDelegate {
|
|
1302
1321
|
return this.context.getAttributes();
|
1303
1322
|
}
|
1304
1323
|
apps() {
|
1305
|
-
return lodash.get(this.attributes, [
|
1324
|
+
return lodash.get(this.attributes, [
|
1325
|
+
"apps"
|
1326
|
+
/* Apps */
|
1327
|
+
]);
|
1306
1328
|
}
|
1307
1329
|
get focus() {
|
1308
|
-
return lodash.get(this.attributes, [
|
1330
|
+
return lodash.get(this.attributes, [
|
1331
|
+
"focus"
|
1332
|
+
/* Focus */
|
1333
|
+
]);
|
1309
1334
|
}
|
1310
1335
|
getAppAttributes(id) {
|
1311
1336
|
return lodash.get(this.apps(), [id]);
|
1312
1337
|
}
|
1313
1338
|
getAppState(id) {
|
1314
|
-
return lodash.get(this.apps(), [
|
1339
|
+
return lodash.get(this.apps(), [
|
1340
|
+
id,
|
1341
|
+
"state"
|
1342
|
+
/* State */
|
1343
|
+
]);
|
1315
1344
|
}
|
1316
1345
|
getMaximized() {
|
1317
1346
|
return lodash.get(this.attributes, ["maximized"]);
|
@@ -1335,14 +1364,24 @@ class AttributesDelegate {
|
|
1335
1364
|
}
|
1336
1365
|
attrs.createdAt = Date.now();
|
1337
1366
|
this.context.safeUpdateAttributes(["apps", id], attrs);
|
1338
|
-
this.context.safeUpdateAttributes([
|
1367
|
+
this.context.safeUpdateAttributes([
|
1368
|
+
"apps",
|
1369
|
+
id,
|
1370
|
+
"state"
|
1371
|
+
/* State */
|
1372
|
+
], {
|
1339
1373
|
[AppAttributes.Size]: {},
|
1340
1374
|
[AppAttributes.Position]: {},
|
1341
1375
|
[AppAttributes.SceneIndex]: 0
|
1342
1376
|
});
|
1343
1377
|
}
|
1344
1378
|
updateAppState(appId, stateName, state) {
|
1345
|
-
if (lodash.get(this.attributes, [
|
1379
|
+
if (lodash.get(this.attributes, [
|
1380
|
+
"apps",
|
1381
|
+
appId,
|
1382
|
+
"state"
|
1383
|
+
/* State */
|
1384
|
+
])) {
|
1346
1385
|
this.context.safeUpdateAttributes(["apps", appId, "state", stateName], state);
|
1347
1386
|
}
|
1348
1387
|
}
|
@@ -1352,13 +1391,19 @@ class AttributesDelegate {
|
|
1352
1391
|
cleanAppAttributes(id) {
|
1353
1392
|
this.context.safeUpdateAttributes(["apps", id], void 0);
|
1354
1393
|
this.context.safeSetAttributes({ [id]: void 0 });
|
1355
|
-
const focus = this.attributes[
|
1394
|
+
const focus = this.attributes[
|
1395
|
+
"focus"
|
1396
|
+
/* Focus */
|
1397
|
+
];
|
1356
1398
|
if (focus === id) {
|
1357
1399
|
this.cleanFocus();
|
1358
1400
|
}
|
1359
1401
|
}
|
1360
1402
|
cleanFocus() {
|
1361
|
-
this.context.safeSetAttributes({ [
|
1403
|
+
this.context.safeSetAttributes({ [
|
1404
|
+
"focus"
|
1405
|
+
/* Focus */
|
1406
|
+
]: void 0 });
|
1362
1407
|
}
|
1363
1408
|
getAppSceneIndex(id) {
|
1364
1409
|
var _a;
|
@@ -1375,7 +1420,10 @@ class AttributesDelegate {
|
|
1375
1420
|
return this.attributes["_mainSceneIndex"];
|
1376
1421
|
}
|
1377
1422
|
getBoxState() {
|
1378
|
-
return this.attributes[
|
1423
|
+
return this.attributes[
|
1424
|
+
"boxState"
|
1425
|
+
/* BoxState */
|
1426
|
+
];
|
1379
1427
|
}
|
1380
1428
|
setMainViewScenePath(scenePath) {
|
1381
1429
|
this.context.safeSetAttributes({ _mainScenePath: scenePath });
|
@@ -1384,44 +1432,84 @@ class AttributesDelegate {
|
|
1384
1432
|
this.context.safeSetAttributes({ _mainSceneIndex: index2 });
|
1385
1433
|
}
|
1386
1434
|
getMainViewCamera() {
|
1387
|
-
return lodash.get(this.attributes, [
|
1435
|
+
return lodash.get(this.attributes, [
|
1436
|
+
"mainViewCamera"
|
1437
|
+
/* MainViewCamera */
|
1438
|
+
]);
|
1388
1439
|
}
|
1389
1440
|
getMainViewSize() {
|
1390
|
-
return lodash.get(this.attributes, [
|
1441
|
+
return lodash.get(this.attributes, [
|
1442
|
+
"mainViewSize"
|
1443
|
+
/* MainViewSize */
|
1444
|
+
]);
|
1391
1445
|
}
|
1392
1446
|
setMainViewCamera(camera) {
|
1393
|
-
this.context.safeSetAttributes({ [
|
1447
|
+
this.context.safeSetAttributes({ [
|
1448
|
+
"mainViewCamera"
|
1449
|
+
/* MainViewCamera */
|
1450
|
+
]: { ...camera } });
|
1394
1451
|
}
|
1395
1452
|
setMainViewSize(size) {
|
1396
|
-
this.context.safeSetAttributes({ [
|
1453
|
+
this.context.safeSetAttributes({ [
|
1454
|
+
"mainViewSize"
|
1455
|
+
/* MainViewSize */
|
1456
|
+
]: { ...size } });
|
1397
1457
|
}
|
1398
1458
|
setMainViewCameraAndSize(camera, size) {
|
1399
1459
|
this.context.safeSetAttributes({
|
1400
|
-
[
|
1401
|
-
|
1460
|
+
[
|
1461
|
+
"mainViewCamera"
|
1462
|
+
/* MainViewCamera */
|
1463
|
+
]: { ...camera },
|
1464
|
+
[
|
1465
|
+
"mainViewSize"
|
1466
|
+
/* MainViewSize */
|
1467
|
+
]: { ...size }
|
1402
1468
|
});
|
1403
1469
|
}
|
1404
1470
|
updateCursor(uid, position) {
|
1405
|
-
if (!lodash.get(this.attributes, [
|
1406
|
-
|
1471
|
+
if (!lodash.get(this.attributes, [
|
1472
|
+
"cursors"
|
1473
|
+
/* Cursors */
|
1474
|
+
])) {
|
1475
|
+
this.context.safeUpdateAttributes([
|
1476
|
+
"cursors"
|
1477
|
+
/* Cursors */
|
1478
|
+
], {});
|
1407
1479
|
}
|
1408
1480
|
if (!lodash.get(this.attributes, ["cursors", uid])) {
|
1409
1481
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1410
1482
|
}
|
1411
|
-
this.context.safeUpdateAttributes([
|
1483
|
+
this.context.safeUpdateAttributes([
|
1484
|
+
"cursors",
|
1485
|
+
uid,
|
1486
|
+
"position"
|
1487
|
+
/* Position */
|
1488
|
+
], position);
|
1412
1489
|
}
|
1413
1490
|
updateCursorState(uid, cursorState) {
|
1414
1491
|
if (!lodash.get(this.attributes, ["cursors", uid])) {
|
1415
1492
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1416
1493
|
}
|
1417
|
-
this.context.safeUpdateAttributes([
|
1494
|
+
this.context.safeUpdateAttributes([
|
1495
|
+
"cursors",
|
1496
|
+
uid,
|
1497
|
+
"cursorState"
|
1498
|
+
/* CursorState */
|
1499
|
+
], cursorState);
|
1418
1500
|
}
|
1419
1501
|
getCursorState(uid) {
|
1420
|
-
return lodash.get(this.attributes, [
|
1502
|
+
return lodash.get(this.attributes, [
|
1503
|
+
"cursors",
|
1504
|
+
uid,
|
1505
|
+
"cursorState"
|
1506
|
+
/* CursorState */
|
1507
|
+
]);
|
1421
1508
|
}
|
1422
1509
|
cleanCursor(uid) {
|
1423
1510
|
this.context.safeUpdateAttributes(["cursors", uid], void 0);
|
1424
1511
|
}
|
1512
|
+
// TODO 状态中保存一个 SceneName 优化性能
|
1425
1513
|
setMainViewFocusPath(mainView) {
|
1426
1514
|
const scenePath = this.getMainViewScenePath();
|
1427
1515
|
if (scenePath) {
|
@@ -1869,6 +1957,7 @@ class AppProxy {
|
|
1869
1957
|
throw new Error(`[WindowManager]: app setup error: ${error.message}`);
|
1870
1958
|
}
|
1871
1959
|
}
|
1960
|
+
// 兼容移动端创建时会出现 PPT 不适配的问题
|
1872
1961
|
fixMobileSize() {
|
1873
1962
|
var _a, _b;
|
1874
1963
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(this.id);
|
@@ -1999,6 +2088,7 @@ class AppProxy {
|
|
1999
2088
|
get pageState() {
|
2000
2089
|
return this._pageState.toObject();
|
2001
2090
|
}
|
2091
|
+
// PageRemoveService
|
2002
2092
|
async removeSceneByIndex(index2) {
|
2003
2093
|
const scenePath = this._pageState.getFullPath(index2);
|
2004
2094
|
if (scenePath && this.pageState) {
|
@@ -2022,6 +2112,7 @@ class AppProxy {
|
|
2022
2112
|
this.view.focusSceneIndex = index2;
|
2023
2113
|
}
|
2024
2114
|
}
|
2115
|
+
// PageRemoveService end
|
2025
2116
|
setSceneIndex(index2) {
|
2026
2117
|
if (this.view) {
|
2027
2118
|
this.view.focusSceneIndex = index2;
|
@@ -2533,8 +2624,8 @@ const createScrollStorage = (manager) => {
|
|
2533
2624
|
defaultState: { scrollTop: 0 }
|
2534
2625
|
});
|
2535
2626
|
};
|
2536
|
-
function clamp$2(
|
2537
|
-
return
|
2627
|
+
function clamp$2(x, min, max) {
|
2628
|
+
return x < min ? min : x > max ? max : x;
|
2538
2629
|
}
|
2539
2630
|
class ScrollMode {
|
2540
2631
|
constructor(manager) {
|
@@ -3093,6 +3184,10 @@ class AppManager {
|
|
3093
3184
|
});
|
3094
3185
|
});
|
3095
3186
|
}
|
3187
|
+
/**
|
3188
|
+
* 根目录被删除时所有的 scene 都会被删除.
|
3189
|
+
* 所以需要关掉所有开启了 view 的 app
|
3190
|
+
*/
|
3096
3191
|
async onRootDirRemoved(needClose = true) {
|
3097
3192
|
await this.setMainViewScenePath(INIT_DIR);
|
3098
3193
|
this.createRootDirScenesCallback();
|
@@ -3197,6 +3292,12 @@ class AppManager {
|
|
3197
3292
|
return () => redoUndo.destroy();
|
3198
3293
|
});
|
3199
3294
|
}
|
3295
|
+
/**
|
3296
|
+
* 插件更新 apps 时的回调
|
3297
|
+
*
|
3298
|
+
* @param {*} apps
|
3299
|
+
* @memberof WindowManager
|
3300
|
+
*/
|
3200
3301
|
async _attributesUpdateCallback(apps) {
|
3201
3302
|
if (apps && WindowManager.container) {
|
3202
3303
|
const appIds = Object.keys(apps);
|
@@ -3463,6 +3564,20 @@ class AppManager {
|
|
3463
3564
|
(_a = this.scrollMode) == null ? void 0 : _a.dispose();
|
3464
3565
|
}
|
3465
3566
|
}
|
3567
|
+
/*! *****************************************************************************
|
3568
|
+
Copyright (c) Microsoft Corporation.
|
3569
|
+
|
3570
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
3571
|
+
purpose with or without fee is hereby granted.
|
3572
|
+
|
3573
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
3574
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
3575
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
3576
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
3577
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
3578
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
3579
|
+
PERFORMANCE OF THIS SOFTWARE.
|
3580
|
+
***************************************************************************** */
|
3466
3581
|
var __assign = function() {
|
3467
3582
|
__assign = Object.assign || function __assign2(t) {
|
3468
3583
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -4271,6 +4386,9 @@ function index(nodeOrSelector, props) {
|
|
4271
4386
|
var node = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
4272
4387
|
return getStyler(node, props);
|
4273
4388
|
}
|
4389
|
+
function getDefaultExportFromCjs(x) {
|
4390
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
4391
|
+
}
|
4274
4392
|
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
4275
4393
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
4276
4394
|
if (ret !== void 0) {
|
@@ -4302,6 +4420,7 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
4302
4420
|
}
|
4303
4421
|
return true;
|
4304
4422
|
};
|
4423
|
+
const shallowequal$1 = /* @__PURE__ */ getDefaultExportFromCjs(shallowequal);
|
4305
4424
|
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
4425
|
var TELE_BOX_COLOR_SCHEME = /* @__PURE__ */ ((TELE_BOX_COLOR_SCHEME2) => {
|
4307
4426
|
TELE_BOX_COLOR_SCHEME2["Light"] = "light";
|
@@ -4541,7 +4660,7 @@ class TeleBox {
|
|
4541
4660
|
height = 0.5,
|
4542
4661
|
minWidth = 0,
|
4543
4662
|
minHeight = 0,
|
4544
|
-
x
|
4663
|
+
x = 0.1,
|
4545
4664
|
y = 0.1,
|
4546
4665
|
resizable = true,
|
4547
4666
|
draggable = true,
|
@@ -4600,36 +4719,36 @@ class TeleBox {
|
|
4600
4719
|
const minSize$ = new valueEnhancer.Val({
|
4601
4720
|
width: clamp(minWidth, 0, 1),
|
4602
4721
|
height: clamp(minHeight, 0, 1)
|
4603
|
-
}, { compare: shallowequal });
|
4722
|
+
}, { compare: shallowequal$1 });
|
4604
4723
|
const pxMinSize$ = valueEnhancer.combine([minSize$, managerStageRect$], ([minSize, managerStageRect]) => ({
|
4605
4724
|
width: minSize.width * managerStageRect.width,
|
4606
4725
|
height: minSize.height * managerStageRect.height
|
4607
|
-
}), { compare: shallowequal });
|
4608
|
-
const intrinsicSize$ = new valueEnhancer.Val({ width, height }, { compare: shallowequal });
|
4726
|
+
}), { compare: shallowequal$1 });
|
4727
|
+
const intrinsicSize$ = new valueEnhancer.Val({ width, height }, { compare: shallowequal$1 });
|
4609
4728
|
this._sideEffect.addDisposer(minSize$.reaction((minSize, skipUpdate) => {
|
4610
4729
|
intrinsicSize$.setValue({
|
4611
4730
|
width: Math.max(width, minSize.width),
|
4612
4731
|
height: Math.max(height, minSize.height)
|
4613
4732
|
}, skipUpdate);
|
4614
4733
|
}));
|
4615
|
-
const intrinsicCoord$ = new valueEnhancer.Val({ x
|
4734
|
+
const intrinsicCoord$ = new valueEnhancer.Val({ x, y }, { compare: shallowequal$1 });
|
4616
4735
|
const pxIntrinsicSize$ = valueEnhancer.combine([intrinsicSize$, managerStageRect$], ([size, managerStageRect]) => ({
|
4617
4736
|
width: managerStageRect.width * size.width,
|
4618
4737
|
height: managerStageRect.height * size.height
|
4619
|
-
}), { compare: shallowequal });
|
4738
|
+
}), { compare: shallowequal$1 });
|
4620
4739
|
const pxIntrinsicCoord$ = valueEnhancer.combine([intrinsicCoord$, managerStageRect$], ([intrinsicCoord, managerStageRect]) => ({
|
4621
4740
|
x: intrinsicCoord.x * managerStageRect.width,
|
4622
4741
|
y: intrinsicCoord.y * managerStageRect.height
|
4623
|
-
}), { compare: shallowequal });
|
4742
|
+
}), { compare: shallowequal$1 });
|
4624
4743
|
const bodyStyle$ = new valueEnhancer.Val(bodyStyle);
|
4625
4744
|
const stageStyle$ = new valueEnhancer.Val(stageStyle);
|
4626
4745
|
const contentRoot$ = new valueEnhancer.Val(null);
|
4627
4746
|
const bodyRect$ = new valueEnhancer.Val(managerStageRect$.value, {
|
4628
|
-
compare: shallowequal
|
4747
|
+
compare: shallowequal$1
|
4629
4748
|
});
|
4630
4749
|
const stageRatio$ = new valueEnhancer.Val(stageRatio);
|
4631
4750
|
const finalStageRatio$ = valueEnhancer.combine([stageRatio$, managerStageRatio$], ([stageRatio2, managerStageRatio]) => stageRatio2 != null ? stageRatio2 : managerStageRatio);
|
4632
|
-
const stageRect$ = valueEnhancer.combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal });
|
4751
|
+
const stageRect$ = valueEnhancer.combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal$1 });
|
4633
4752
|
const propsValConfig = {
|
4634
4753
|
darkMode: darkMode$,
|
4635
4754
|
fence: fence$,
|
@@ -4762,16 +4881,16 @@ class TeleBox {
|
|
4762
4881
|
get intrinsicHeight() {
|
4763
4882
|
return this._intrinsicSize$.value.height;
|
4764
4883
|
}
|
4765
|
-
move(
|
4884
|
+
move(x, y, skipUpdate = false) {
|
4766
4885
|
let safeX;
|
4767
4886
|
let safeY;
|
4768
4887
|
const managerStageRect = this.managerStageRect;
|
4769
4888
|
const pxIntrinsicSize = this.pxIntrinsicSize;
|
4770
4889
|
if (this.fence) {
|
4771
|
-
safeX = clamp(
|
4890
|
+
safeX = clamp(x, 0, managerStageRect.width - pxIntrinsicSize.width);
|
4772
4891
|
safeY = clamp(y, 0, managerStageRect.height - pxIntrinsicSize.height);
|
4773
4892
|
} else {
|
4774
|
-
safeX = clamp(
|
4893
|
+
safeX = clamp(x, -(pxIntrinsicSize.width - 120), 0 + managerStageRect.width - 20);
|
4775
4894
|
safeY = clamp(y, 0, 0 + managerStageRect.height - 20);
|
4776
4895
|
}
|
4777
4896
|
this._intrinsicCoord$.setValue({
|
@@ -4779,7 +4898,7 @@ class TeleBox {
|
|
4779
4898
|
y: safeY / managerStageRect.height
|
4780
4899
|
}, skipUpdate);
|
4781
4900
|
}
|
4782
|
-
transform(
|
4901
|
+
transform(x, y, width, height, skipUpdate = false) {
|
4783
4902
|
const managerStageRect = this.managerStageRect;
|
4784
4903
|
width = Math.max(width, this.pxMinSize.width);
|
4785
4904
|
height = Math.max(height, this.pxMinSize.height);
|
@@ -4794,7 +4913,7 @@ class TeleBox {
|
|
4794
4913
|
y = 0;
|
4795
4914
|
height = this.pxIntrinsicSize.height;
|
4796
4915
|
}
|
4797
|
-
this.move(
|
4916
|
+
this.move(x, y, skipUpdate);
|
4798
4917
|
this._intrinsicSize$.setValue({
|
4799
4918
|
width: width / managerStageRect.width,
|
4800
4919
|
height: height / managerStageRect.height
|
@@ -4939,7 +5058,7 @@ class TeleBox {
|
|
4939
5058
|
styles.scaleY = collectorRect.height / boxHeight;
|
4940
5059
|
}
|
4941
5060
|
return styles;
|
4942
|
-
}, { compare: shallowequal });
|
5061
|
+
}, { compare: shallowequal$1 });
|
4943
5062
|
const boxStyles = boxStyles$.value;
|
4944
5063
|
this.$box.style.width = boxStyles.width + "px";
|
4945
5064
|
this.$box.style.height = boxStyles.height + "px";
|
@@ -5253,10 +5372,10 @@ class TeleBoxCollector {
|
|
5253
5372
|
}),
|
5254
5373
|
minimized$.subscribe((minimized) => {
|
5255
5374
|
if (minimized) {
|
5256
|
-
const { x
|
5375
|
+
const { x, y, width, height } = $collector.getBoundingClientRect();
|
5257
5376
|
const rootRect = root.getBoundingClientRect();
|
5258
5377
|
rect$.setValue({
|
5259
|
-
x:
|
5378
|
+
x: x - rootRect.x,
|
5260
5379
|
y: y - rootRect.y,
|
5261
5380
|
width,
|
5262
5381
|
height
|
@@ -5423,7 +5542,7 @@ class TeleBoxManager {
|
|
5423
5542
|
y: 0,
|
5424
5543
|
width: window.innerWidth,
|
5425
5544
|
height: window.innerHeight
|
5426
|
-
}, { compare: shallowequal });
|
5545
|
+
}, { compare: shallowequal$1 });
|
5427
5546
|
this._sideEffect.addDisposer(root$.subscribe((root2) => {
|
5428
5547
|
this._sideEffect.add(() => {
|
5429
5548
|
if (!root2) {
|
@@ -5443,7 +5562,7 @@ class TeleBoxManager {
|
|
5443
5562
|
}, "calc-root-rect");
|
5444
5563
|
}));
|
5445
5564
|
const stageRect$ = valueEnhancer.combine([rootRect$, stageRatio$], calcStageRect, {
|
5446
|
-
compare: shallowequal
|
5565
|
+
compare: shallowequal$1
|
5447
5566
|
});
|
5448
5567
|
this.boxes$ = new valueEnhancer.Val([]);
|
5449
5568
|
this.topBox$ = new valueEnhancer.Val(void 0);
|
@@ -5481,7 +5600,7 @@ class TeleBoxManager {
|
|
5481
5600
|
const darkMode$ = valueEnhancer.combine([prefersDark$, prefersColorScheme$], ([prefersDark, prefersColorScheme2]) => prefersColorScheme2 === "auto" ? prefersDark : prefersColorScheme2 === "dark");
|
5482
5601
|
const state$ = valueEnhancer.combine([minimized$, maximized$], ([minimized2, maximized2]) => minimized2 ? TELE_BOX_STATE.Minimized : maximized2 ? TELE_BOX_STATE.Maximized : TELE_BOX_STATE.Normal);
|
5483
5602
|
const theme$ = new valueEnhancer.Val(theme, {
|
5484
|
-
compare: shallowequal
|
5603
|
+
compare: shallowequal$1
|
5485
5604
|
});
|
5486
5605
|
const readonlyValConfig = {
|
5487
5606
|
darkMode: darkMode$,
|
@@ -5900,11 +6019,11 @@ class TeleBoxManager {
|
|
5900
6019
|
}
|
5901
6020
|
}
|
5902
6021
|
smartPosition(rect) {
|
5903
|
-
let { x
|
6022
|
+
let { x, y } = rect;
|
5904
6023
|
const { width = 0.5, height = 0.5 } = rect;
|
5905
6024
|
const stageRect = this.stageRect;
|
5906
6025
|
const topBox = this.topBox;
|
5907
|
-
if (
|
6026
|
+
if (x == null) {
|
5908
6027
|
let pxX = 20;
|
5909
6028
|
if (topBox) {
|
5910
6029
|
const pxPreferredX = topBox.pxIntrinsicCoord.x + 20;
|
@@ -5913,7 +6032,7 @@ class TeleBoxManager {
|
|
5913
6032
|
pxX = pxPreferredX;
|
5914
6033
|
}
|
5915
6034
|
}
|
5916
|
-
|
6035
|
+
x = pxX / stageRect.width;
|
5917
6036
|
}
|
5918
6037
|
if (y == null) {
|
5919
6038
|
let pxY = 20;
|
@@ -5926,7 +6045,7 @@ class TeleBoxManager {
|
|
5926
6045
|
}
|
5927
6046
|
y = pxY / stageRect.height;
|
5928
6047
|
}
|
5929
|
-
return { x
|
6048
|
+
return { x, y, width, height };
|
5930
6049
|
}
|
5931
6050
|
makeBoxTop(box, skipUpdate = false) {
|
5932
6051
|
if (this.topBox) {
|
@@ -5977,6 +6096,7 @@ class BoxManager {
|
|
5977
6096
|
const { emitter: emitter2, callbacks: callbacks2, boxEmitter: boxEmitter2 } = context;
|
5978
6097
|
this.teleBoxManager = this.setupBoxManager(createTeleBoxManagerConfig);
|
5979
6098
|
this.sideEffectManager.add(() => [
|
6099
|
+
// 使用 _xxx$.reaction 订阅修改的值, 不管有没有 skipUpdate, 修改值都会触发回调
|
5980
6100
|
this.teleBoxManager.onValChanged("state", (state) => {
|
5981
6101
|
callbacks2.emit("boxStateChange", state);
|
5982
6102
|
emitter2.emit("boxStateChange", state);
|
@@ -6193,10 +6313,10 @@ class BoxManager {
|
|
6193
6313
|
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
6194
6314
|
}
|
6195
6315
|
}
|
6196
|
-
moveBox({ appId, x
|
6316
|
+
moveBox({ appId, x, y }) {
|
6197
6317
|
const box = this.getBox(appId);
|
6198
6318
|
if (box) {
|
6199
|
-
box._intrinsicCoord$.setValue({ x
|
6319
|
+
box._intrinsicCoord$.setValue({ x, y }, true);
|
6200
6320
|
}
|
6201
6321
|
}
|
6202
6322
|
focusBox({ appId }, skipUpdate = true) {
|
@@ -6295,6 +6415,9 @@ function src_url_equal(element_src, url) {
|
|
6295
6415
|
function is_empty(obj) {
|
6296
6416
|
return Object.keys(obj).length === 0;
|
6297
6417
|
}
|
6418
|
+
/* @__PURE__ */ new Set();
|
6419
|
+
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
6420
|
+
"WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
6298
6421
|
function append(target, node) {
|
6299
6422
|
target.appendChild(node);
|
6300
6423
|
}
|
@@ -6326,25 +6449,27 @@ function children(element2) {
|
|
6326
6449
|
}
|
6327
6450
|
function set_data(text2, data) {
|
6328
6451
|
data = "" + data;
|
6329
|
-
if (text2.
|
6330
|
-
|
6452
|
+
if (text2.data === data)
|
6453
|
+
return;
|
6454
|
+
text2.data = data;
|
6331
6455
|
}
|
6332
6456
|
function set_style(node, key, value, important) {
|
6333
|
-
if (value
|
6457
|
+
if (value == null) {
|
6334
6458
|
node.style.removeProperty(key);
|
6335
6459
|
} else {
|
6336
6460
|
node.style.setProperty(key, value, important ? "important" : "");
|
6337
6461
|
}
|
6338
6462
|
}
|
6463
|
+
/* @__PURE__ */ new Map();
|
6339
6464
|
let current_component;
|
6340
6465
|
function set_current_component(component) {
|
6341
6466
|
current_component = component;
|
6342
6467
|
}
|
6343
6468
|
const dirty_components = [];
|
6344
6469
|
const binding_callbacks = [];
|
6345
|
-
|
6470
|
+
let render_callbacks = [];
|
6346
6471
|
const flush_callbacks = [];
|
6347
|
-
const resolved_promise = Promise.resolve();
|
6472
|
+
const resolved_promise = /* @__PURE__ */ Promise.resolve();
|
6348
6473
|
let update_scheduled = false;
|
6349
6474
|
function schedule_update() {
|
6350
6475
|
if (!update_scheduled) {
|
@@ -6358,13 +6483,22 @@ function add_render_callback(fn) {
|
|
6358
6483
|
const seen_callbacks = /* @__PURE__ */ new Set();
|
6359
6484
|
let flushidx = 0;
|
6360
6485
|
function flush() {
|
6486
|
+
if (flushidx !== 0) {
|
6487
|
+
return;
|
6488
|
+
}
|
6361
6489
|
const saved_component = current_component;
|
6362
6490
|
do {
|
6363
|
-
|
6364
|
-
|
6365
|
-
|
6366
|
-
|
6367
|
-
|
6491
|
+
try {
|
6492
|
+
while (flushidx < dirty_components.length) {
|
6493
|
+
const component = dirty_components[flushidx];
|
6494
|
+
flushidx++;
|
6495
|
+
set_current_component(component);
|
6496
|
+
update(component.$$);
|
6497
|
+
}
|
6498
|
+
} catch (e) {
|
6499
|
+
dirty_components.length = 0;
|
6500
|
+
flushidx = 0;
|
6501
|
+
throw e;
|
6368
6502
|
}
|
6369
6503
|
set_current_component(null);
|
6370
6504
|
dirty_components.length = 0;
|
@@ -6397,6 +6531,13 @@ function update($$) {
|
|
6397
6531
|
$$.after_update.forEach(add_render_callback);
|
6398
6532
|
}
|
6399
6533
|
}
|
6534
|
+
function flush_render_callbacks(fns) {
|
6535
|
+
const filtered = [];
|
6536
|
+
const targets = [];
|
6537
|
+
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
6538
|
+
targets.forEach((c) => c());
|
6539
|
+
render_callbacks = filtered;
|
6540
|
+
}
|
6400
6541
|
const outroing = /* @__PURE__ */ new Set();
|
6401
6542
|
function transition_in(block, local) {
|
6402
6543
|
if (block && block.i) {
|
@@ -6404,6 +6545,34 @@ function transition_in(block, local) {
|
|
6404
6545
|
block.i(local);
|
6405
6546
|
}
|
6406
6547
|
}
|
6548
|
+
const _boolean_attributes = [
|
6549
|
+
"allowfullscreen",
|
6550
|
+
"allowpaymentrequest",
|
6551
|
+
"async",
|
6552
|
+
"autofocus",
|
6553
|
+
"autoplay",
|
6554
|
+
"checked",
|
6555
|
+
"controls",
|
6556
|
+
"default",
|
6557
|
+
"defer",
|
6558
|
+
"disabled",
|
6559
|
+
"formnovalidate",
|
6560
|
+
"hidden",
|
6561
|
+
"inert",
|
6562
|
+
"ismap",
|
6563
|
+
"loop",
|
6564
|
+
"multiple",
|
6565
|
+
"muted",
|
6566
|
+
"nomodule",
|
6567
|
+
"novalidate",
|
6568
|
+
"open",
|
6569
|
+
"playsinline",
|
6570
|
+
"readonly",
|
6571
|
+
"required",
|
6572
|
+
"reversed",
|
6573
|
+
"selected"
|
6574
|
+
];
|
6575
|
+
/* @__PURE__ */ new Set([..._boolean_attributes]);
|
6407
6576
|
function mount_component(component, target, anchor, customElement) {
|
6408
6577
|
const { fragment, after_update } = component.$$;
|
6409
6578
|
fragment && fragment.m(target, anchor);
|
@@ -6423,6 +6592,7 @@ function mount_component(component, target, anchor, customElement) {
|
|
6423
6592
|
function destroy_component(component, detaching) {
|
6424
6593
|
const $$ = component.$$;
|
6425
6594
|
if ($$.fragment !== null) {
|
6595
|
+
flush_render_callbacks($$.after_update);
|
6426
6596
|
run_all($$.on_destroy);
|
6427
6597
|
$$.fragment && $$.fragment.d(detaching);
|
6428
6598
|
$$.on_destroy = $$.fragment = null;
|
@@ -6443,16 +6613,19 @@ function init(component, options, instance2, create_fragment2, not_equal, props,
|
|
6443
6613
|
const $$ = component.$$ = {
|
6444
6614
|
fragment: null,
|
6445
6615
|
ctx: [],
|
6616
|
+
// state
|
6446
6617
|
props,
|
6447
6618
|
update: noop,
|
6448
6619
|
not_equal,
|
6449
6620
|
bound: blank_object(),
|
6621
|
+
// lifecycle
|
6450
6622
|
on_mount: [],
|
6451
6623
|
on_destroy: [],
|
6452
6624
|
on_disconnect: [],
|
6453
6625
|
before_update: [],
|
6454
6626
|
after_update: [],
|
6455
6627
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
6628
|
+
// everything else
|
6456
6629
|
callbacks: blank_object(),
|
6457
6630
|
dirty,
|
6458
6631
|
skip_bound: false,
|
@@ -6522,8 +6695,14 @@ function create_if_block(ctx) {
|
|
6522
6695
|
let t1;
|
6523
6696
|
let t2;
|
6524
6697
|
let div1_class_value;
|
6525
|
-
let if_block0 =
|
6526
|
-
|
6698
|
+
let if_block0 = (
|
6699
|
+
/*hasAvatar*/
|
6700
|
+
ctx[16] && create_if_block_2(ctx)
|
6701
|
+
);
|
6702
|
+
let if_block1 = (
|
6703
|
+
/*hasTagName*/
|
6704
|
+
ctx[17] && create_if_block_1(ctx)
|
6705
|
+
);
|
6527
6706
|
return {
|
6528
6707
|
c() {
|
6529
6708
|
div1 = element("div");
|
@@ -6532,7 +6711,10 @@ function create_if_block(ctx) {
|
|
6532
6711
|
if_block0.c();
|
6533
6712
|
t0 = space();
|
6534
6713
|
span = element("span");
|
6535
|
-
t1 = text$1(
|
6714
|
+
t1 = text$1(
|
6715
|
+
/*cursorName*/
|
6716
|
+
ctx[0]
|
6717
|
+
);
|
6536
6718
|
t2 = space();
|
6537
6719
|
if (if_block1)
|
6538
6720
|
if_block1.c();
|
@@ -6540,11 +6722,33 @@ function create_if_block(ctx) {
|
|
6540
6722
|
set_style(span, "white-space", "nowrap");
|
6541
6723
|
set_style(span, "text-overflow", "ellipsis");
|
6542
6724
|
set_style(span, "max-width", "80px");
|
6543
|
-
attr(
|
6544
|
-
|
6545
|
-
|
6546
|
-
|
6547
|
-
|
6725
|
+
attr(
|
6726
|
+
div0,
|
6727
|
+
"class",
|
6728
|
+
/*theme*/
|
6729
|
+
ctx[8]
|
6730
|
+
);
|
6731
|
+
set_style(
|
6732
|
+
div0,
|
6733
|
+
"background-color",
|
6734
|
+
/*backgroundColor*/
|
6735
|
+
ctx[2]
|
6736
|
+
);
|
6737
|
+
set_style(
|
6738
|
+
div0,
|
6739
|
+
"color",
|
6740
|
+
/*color*/
|
6741
|
+
ctx[9]
|
6742
|
+
);
|
6743
|
+
set_style(
|
6744
|
+
div0,
|
6745
|
+
"opacity",
|
6746
|
+
/*opacity*/
|
6747
|
+
ctx[11]
|
6748
|
+
);
|
6749
|
+
attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6750
|
+
ctx[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6751
|
+
ctx[13]);
|
6548
6752
|
},
|
6549
6753
|
m(target, anchor) {
|
6550
6754
|
insert(target, div1, anchor);
|
@@ -6559,7 +6763,10 @@ function create_if_block(ctx) {
|
|
6559
6763
|
if_block1.m(div0, null);
|
6560
6764
|
},
|
6561
6765
|
p(ctx2, dirty) {
|
6562
|
-
if (
|
6766
|
+
if (
|
6767
|
+
/*hasAvatar*/
|
6768
|
+
ctx2[16]
|
6769
|
+
) {
|
6563
6770
|
if (if_block0) {
|
6564
6771
|
if_block0.p(ctx2, dirty);
|
6565
6772
|
} else {
|
@@ -6571,9 +6778,17 @@ function create_if_block(ctx) {
|
|
6571
6778
|
if_block0.d(1);
|
6572
6779
|
if_block0 = null;
|
6573
6780
|
}
|
6574
|
-
if (dirty &
|
6575
|
-
|
6576
|
-
|
6781
|
+
if (dirty & /*cursorName*/
|
6782
|
+
1)
|
6783
|
+
set_data(
|
6784
|
+
t1,
|
6785
|
+
/*cursorName*/
|
6786
|
+
ctx2[0]
|
6787
|
+
);
|
6788
|
+
if (
|
6789
|
+
/*hasTagName*/
|
6790
|
+
ctx2[17]
|
6791
|
+
) {
|
6577
6792
|
if (if_block1) {
|
6578
6793
|
if_block1.p(ctx2, dirty);
|
6579
6794
|
} else {
|
@@ -6585,19 +6800,46 @@ function create_if_block(ctx) {
|
|
6585
6800
|
if_block1.d(1);
|
6586
6801
|
if_block1 = null;
|
6587
6802
|
}
|
6588
|
-
if (dirty &
|
6589
|
-
|
6803
|
+
if (dirty & /*theme*/
|
6804
|
+
256) {
|
6805
|
+
attr(
|
6806
|
+
div0,
|
6807
|
+
"class",
|
6808
|
+
/*theme*/
|
6809
|
+
ctx2[8]
|
6810
|
+
);
|
6590
6811
|
}
|
6591
|
-
if (dirty &
|
6592
|
-
|
6812
|
+
if (dirty & /*backgroundColor*/
|
6813
|
+
4) {
|
6814
|
+
set_style(
|
6815
|
+
div0,
|
6816
|
+
"background-color",
|
6817
|
+
/*backgroundColor*/
|
6818
|
+
ctx2[2]
|
6819
|
+
);
|
6593
6820
|
}
|
6594
|
-
if (dirty &
|
6595
|
-
|
6821
|
+
if (dirty & /*color*/
|
6822
|
+
512) {
|
6823
|
+
set_style(
|
6824
|
+
div0,
|
6825
|
+
"color",
|
6826
|
+
/*color*/
|
6827
|
+
ctx2[9]
|
6828
|
+
);
|
6596
6829
|
}
|
6597
|
-
if (dirty &
|
6598
|
-
|
6830
|
+
if (dirty & /*opacity*/
|
6831
|
+
2048) {
|
6832
|
+
set_style(
|
6833
|
+
div0,
|
6834
|
+
"opacity",
|
6835
|
+
/*opacity*/
|
6836
|
+
ctx2[11]
|
6837
|
+
);
|
6599
6838
|
}
|
6600
|
-
if (dirty &
|
6839
|
+
if (dirty & /*offset, pencilEraserSize3ImageOffset*/
|
6840
|
+
24576 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6841
|
+
ctx2[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6842
|
+
ctx2[13])) {
|
6601
6843
|
attr(div1, "class", div1_class_value);
|
6602
6844
|
}
|
6603
6845
|
},
|
@@ -6618,8 +6860,14 @@ function create_if_block_2(ctx) {
|
|
6618
6860
|
c() {
|
6619
6861
|
img = element("img");
|
6620
6862
|
attr(img, "class", "netless-window-manager-cursor-selector-avatar");
|
6621
|
-
attr(
|
6622
|
-
|
6863
|
+
attr(
|
6864
|
+
img,
|
6865
|
+
"style",
|
6866
|
+
/*computedAvatarStyle*/
|
6867
|
+
ctx[18]()
|
6868
|
+
);
|
6869
|
+
if (!src_url_equal(img.src, img_src_value = /*avatar*/
|
6870
|
+
ctx[7]))
|
6623
6871
|
attr(img, "src", img_src_value);
|
6624
6872
|
attr(img, "alt", "avatar");
|
6625
6873
|
},
|
@@ -6627,7 +6875,9 @@ function create_if_block_2(ctx) {
|
|
6627
6875
|
insert(target, img, anchor);
|
6628
6876
|
},
|
6629
6877
|
p(ctx2, dirty) {
|
6630
|
-
if (dirty &
|
6878
|
+
if (dirty & /*avatar*/
|
6879
|
+
128 && !src_url_equal(img.src, img_src_value = /*avatar*/
|
6880
|
+
ctx2[7])) {
|
6631
6881
|
attr(img, "src", img_src_value);
|
6632
6882
|
}
|
6633
6883
|
},
|
@@ -6643,19 +6893,38 @@ function create_if_block_1(ctx) {
|
|
6643
6893
|
return {
|
6644
6894
|
c() {
|
6645
6895
|
span = element("span");
|
6646
|
-
t = text$1(
|
6896
|
+
t = text$1(
|
6897
|
+
/*tagName*/
|
6898
|
+
ctx[1]
|
6899
|
+
);
|
6647
6900
|
attr(span, "class", "netless-window-manager-cursor-tag-name");
|
6648
|
-
set_style(
|
6901
|
+
set_style(
|
6902
|
+
span,
|
6903
|
+
"background-color",
|
6904
|
+
/*cursorTagBackgroundColor*/
|
6905
|
+
ctx[10]
|
6906
|
+
);
|
6649
6907
|
},
|
6650
6908
|
m(target, anchor) {
|
6651
6909
|
insert(target, span, anchor);
|
6652
6910
|
append(span, t);
|
6653
6911
|
},
|
6654
6912
|
p(ctx2, dirty) {
|
6655
|
-
if (dirty &
|
6656
|
-
|
6657
|
-
|
6658
|
-
|
6913
|
+
if (dirty & /*tagName*/
|
6914
|
+
2)
|
6915
|
+
set_data(
|
6916
|
+
t,
|
6917
|
+
/*tagName*/
|
6918
|
+
ctx2[1]
|
6919
|
+
);
|
6920
|
+
if (dirty & /*cursorTagBackgroundColor*/
|
6921
|
+
1024) {
|
6922
|
+
set_style(
|
6923
|
+
span,
|
6924
|
+
"background-color",
|
6925
|
+
/*cursorTagBackgroundColor*/
|
6926
|
+
ctx2[10]
|
6927
|
+
);
|
6659
6928
|
}
|
6660
6929
|
},
|
6661
6930
|
d(detaching) {
|
@@ -6671,7 +6940,8 @@ function create_fragment(ctx) {
|
|
6671
6940
|
let img;
|
6672
6941
|
let img_class_value;
|
6673
6942
|
let img_src_value;
|
6674
|
-
let if_block =
|
6943
|
+
let if_block = !/*isLaserPointer*/
|
6944
|
+
ctx[12] && create_if_block(ctx);
|
6675
6945
|
return {
|
6676
6946
|
c() {
|
6677
6947
|
div1 = element("div");
|
@@ -6680,14 +6950,29 @@ function create_fragment(ctx) {
|
|
6680
6950
|
t = space();
|
6681
6951
|
div0 = element("div");
|
6682
6952
|
img = element("img");
|
6683
|
-
attr(img, "class", img_class_value = "netless-window-manager-cursor-" +
|
6684
|
-
|
6953
|
+
attr(img, "class", img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6954
|
+
ctx[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6955
|
+
ctx[13]);
|
6956
|
+
if (!src_url_equal(img.src, img_src_value = /*src*/
|
6957
|
+
ctx[6]))
|
6685
6958
|
attr(img, "src", img_src_value);
|
6686
|
-
attr(
|
6959
|
+
attr(
|
6960
|
+
img,
|
6961
|
+
"alt",
|
6962
|
+
/*appliance*/
|
6963
|
+
ctx[3]
|
6964
|
+
);
|
6687
6965
|
attr(div0, "class", "cursor-image-wrapper");
|
6688
6966
|
attr(div1, "class", "netless-window-manager-cursor-mid");
|
6689
|
-
set_style(div1, "transform", "translateX(" +
|
6690
|
-
|
6967
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
6968
|
+
ctx[4] + "px) translateY(" + /*y*/
|
6969
|
+
ctx[5] + "px)");
|
6970
|
+
set_style(
|
6971
|
+
div1,
|
6972
|
+
"display",
|
6973
|
+
/*display*/
|
6974
|
+
ctx[15]
|
6975
|
+
);
|
6691
6976
|
},
|
6692
6977
|
m(target, anchor) {
|
6693
6978
|
insert(target, div1, anchor);
|
@@ -6698,7 +6983,8 @@ function create_fragment(ctx) {
|
|
6698
6983
|
append(div0, img);
|
6699
6984
|
},
|
6700
6985
|
p(ctx2, [dirty]) {
|
6701
|
-
if (
|
6986
|
+
if (!/*isLaserPointer*/
|
6987
|
+
ctx2[12]) {
|
6702
6988
|
if (if_block) {
|
6703
6989
|
if_block.p(ctx2, dirty);
|
6704
6990
|
} else {
|
@@ -6710,20 +6996,40 @@ function create_fragment(ctx) {
|
|
6710
6996
|
if_block.d(1);
|
6711
6997
|
if_block = null;
|
6712
6998
|
}
|
6713
|
-
if (dirty &
|
6999
|
+
if (dirty & /*appliance, pencilEraserSize3ImageOffset*/
|
7000
|
+
8200 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
7001
|
+
ctx2[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
7002
|
+
ctx2[13])) {
|
6714
7003
|
attr(img, "class", img_class_value);
|
6715
7004
|
}
|
6716
|
-
if (dirty &
|
7005
|
+
if (dirty & /*src*/
|
7006
|
+
64 && !src_url_equal(img.src, img_src_value = /*src*/
|
7007
|
+
ctx2[6])) {
|
6717
7008
|
attr(img, "src", img_src_value);
|
6718
7009
|
}
|
6719
|
-
if (dirty &
|
6720
|
-
|
6721
|
-
|
6722
|
-
|
6723
|
-
|
7010
|
+
if (dirty & /*appliance*/
|
7011
|
+
8) {
|
7012
|
+
attr(
|
7013
|
+
img,
|
7014
|
+
"alt",
|
7015
|
+
/*appliance*/
|
7016
|
+
ctx2[3]
|
7017
|
+
);
|
6724
7018
|
}
|
6725
|
-
if (dirty &
|
6726
|
-
|
7019
|
+
if (dirty & /*x, y*/
|
7020
|
+
48) {
|
7021
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
7022
|
+
ctx2[4] + "px) translateY(" + /*y*/
|
7023
|
+
ctx2[5] + "px)");
|
7024
|
+
}
|
7025
|
+
if (dirty & /*display*/
|
7026
|
+
32768) {
|
7027
|
+
set_style(
|
7028
|
+
div1,
|
7029
|
+
"display",
|
7030
|
+
/*display*/
|
7031
|
+
ctx2[15]
|
7032
|
+
);
|
6727
7033
|
}
|
6728
7034
|
},
|
6729
7035
|
i: noop,
|
@@ -6749,7 +7055,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6749
7055
|
let { tagName } = $$props;
|
6750
7056
|
let { backgroundColor } = $$props;
|
6751
7057
|
let { appliance } = $$props;
|
6752
|
-
let { x
|
7058
|
+
let { x } = $$props;
|
6753
7059
|
let { y } = $$props;
|
6754
7060
|
let { src } = $$props;
|
6755
7061
|
let { visible } = $$props;
|
@@ -6778,7 +7084,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6778
7084
|
if ("appliance" in $$props2)
|
6779
7085
|
$$invalidate(3, appliance = $$props2.appliance);
|
6780
7086
|
if ("x" in $$props2)
|
6781
|
-
$$invalidate(4,
|
7087
|
+
$$invalidate(4, x = $$props2.x);
|
6782
7088
|
if ("y" in $$props2)
|
6783
7089
|
$$invalidate(5, y = $$props2.y);
|
6784
7090
|
if ("src" in $$props2)
|
@@ -6799,28 +7105,36 @@ function instance($$self, $$props, $$invalidate) {
|
|
6799
7105
|
$$invalidate(20, pencilEraserSize = $$props2.pencilEraserSize);
|
6800
7106
|
};
|
6801
7107
|
$$self.$$.update = () => {
|
6802
|
-
if ($$self.$$.dirty &
|
7108
|
+
if ($$self.$$.dirty & /*cursorName*/
|
7109
|
+
1) {
|
6803
7110
|
hasName = !lodash.isEmpty(cursorName);
|
6804
7111
|
}
|
6805
|
-
if ($$self.$$.dirty &
|
7112
|
+
if ($$self.$$.dirty & /*tagName*/
|
7113
|
+
2) {
|
6806
7114
|
$$invalidate(17, hasTagName = !lodash.isEmpty(tagName));
|
6807
7115
|
}
|
6808
|
-
if ($$self.$$.dirty &
|
7116
|
+
if ($$self.$$.dirty & /*avatar*/
|
7117
|
+
128) {
|
6809
7118
|
$$invalidate(16, hasAvatar = !lodash.isEmpty(avatar));
|
6810
7119
|
}
|
6811
|
-
if ($$self.$$.dirty &
|
7120
|
+
if ($$self.$$.dirty & /*visible*/
|
7121
|
+
524288) {
|
6812
7122
|
$$invalidate(15, display = visible ? "initial" : "none");
|
6813
7123
|
}
|
6814
|
-
if ($$self.$$.dirty &
|
7124
|
+
if ($$self.$$.dirty & /*appliance*/
|
7125
|
+
8) {
|
6815
7126
|
$$invalidate(12, isLaserPointer = appliance === whiteWebSdk.ApplianceNames.laserPointer);
|
6816
7127
|
}
|
6817
|
-
if ($$self.$$.dirty &
|
7128
|
+
if ($$self.$$.dirty & /*isLaserPointer, appliance*/
|
7129
|
+
4104) {
|
6818
7130
|
$$invalidate(21, isLaserPointerPencilEraser = isLaserPointer || appliance === whiteWebSdk.ApplianceNames.pencilEraser);
|
6819
7131
|
}
|
6820
|
-
if ($$self.$$.dirty &
|
7132
|
+
if ($$self.$$.dirty & /*isLaserPointerPencilEraser*/
|
7133
|
+
2097152) {
|
6821
7134
|
$$invalidate(14, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
|
6822
7135
|
}
|
6823
|
-
if ($$self.$$.dirty &
|
7136
|
+
if ($$self.$$.dirty & /*pencilEraserSize*/
|
7137
|
+
1048576) {
|
6824
7138
|
$$invalidate(13, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
|
6825
7139
|
}
|
6826
7140
|
};
|
@@ -6829,7 +7143,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6829
7143
|
tagName,
|
6830
7144
|
backgroundColor,
|
6831
7145
|
appliance,
|
6832
|
-
|
7146
|
+
x,
|
6833
7147
|
y,
|
6834
7148
|
src,
|
6835
7149
|
avatar,
|
@@ -6903,8 +7217,8 @@ class Cursor2 {
|
|
6903
7217
|
}
|
6904
7218
|
moveCursor(cursor, rect, view) {
|
6905
7219
|
var _a, _b;
|
6906
|
-
const { x
|
6907
|
-
const point = view == null ? void 0 : view.screen.convertPointToScreen(
|
7220
|
+
const { x, y, type } = cursor;
|
7221
|
+
const point = view == null ? void 0 : view.screen.convertPointToScreen(x, y);
|
6908
7222
|
if (point) {
|
6909
7223
|
let translateX = point.x - 2;
|
6910
7224
|
let translateY = point.y - 18;
|
@@ -8228,11 +8542,11 @@ let Y$1 = class Y {
|
|
8228
8542
|
sideEffect: s,
|
8229
8543
|
readonly$: i,
|
8230
8544
|
events: r,
|
8231
|
-
wrapClassName:
|
8545
|
+
wrapClassName: n,
|
8232
8546
|
root: l,
|
8233
8547
|
pagesIndex$: p
|
8234
8548
|
}) {
|
8235
|
-
this.showPreview$ = new valueEnhancer.Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName =
|
8549
|
+
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
8550
|
this.events.on("togglePreview", () => {
|
8237
8551
|
this.showPreview$.setValue(!this.showPreview$.value);
|
8238
8552
|
})
|
@@ -8242,11 +8556,11 @@ let Y$1 = class Y {
|
|
8242
8556
|
const c = this.renderPreview(), u = this.renderPreviewMask();
|
8243
8557
|
if (a) {
|
8244
8558
|
l.appendChild(c), l.appendChild(u), c.scrollTop;
|
8245
|
-
const
|
8559
|
+
const o2 = c.querySelector(
|
8246
8560
|
"." + this.wrapClassName(`preview-page-${p.value}`)
|
8247
8561
|
);
|
8248
|
-
return
|
8249
|
-
top:
|
8562
|
+
return o2 && c.scrollTo({
|
8563
|
+
top: o2.offsetTop - 16
|
8250
8564
|
}), c.classList.toggle(this.wrapClassName("preview-active"), true), this.previewLazyLoad = new LazyLoad({
|
8251
8565
|
container: this.$preview,
|
8252
8566
|
elements_selector: "." + this.wrapClassName("preview-page>img")
|
@@ -8280,14 +8594,14 @@ let Y$1 = class Y {
|
|
8280
8594
|
this.pages$.subscribe((t) => {
|
8281
8595
|
var s;
|
8282
8596
|
this.sideEffect.add(() => {
|
8283
|
-
const i = t.map((r,
|
8597
|
+
const i = t.map((r, n) => {
|
8284
8598
|
const l = r.thumbnail ?? (r.src.startsWith("ppt") ? void 0 : r.src);
|
8285
8599
|
if (!l)
|
8286
8600
|
return;
|
8287
|
-
const p = String(
|
8288
|
-
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${
|
8601
|
+
const p = String(n), a = document.createElement("a");
|
8602
|
+
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${n}`), a.setAttribute("href", "#"), a.dataset.pageIndex = p;
|
8289
8603
|
const c = document.createElement("span");
|
8290
|
-
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(
|
8604
|
+
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(n + 1), c.dataset.pageIndex = p;
|
8291
8605
|
const u = document.createElement("img");
|
8292
8606
|
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
8607
|
});
|
@@ -8356,7 +8670,7 @@ function q$1(h2) {
|
|
8356
8670
|
"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
8671
|
), t.appendChild(s), t;
|
8358
8672
|
}
|
8359
|
-
function
|
8673
|
+
function X$1(h2) {
|
8360
8674
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8361
8675
|
t.setAttribute("class", `${h2}-footer-icon-save`), t.setAttribute("viewBox", "0 0 448 512");
|
8362
8676
|
const s = document.createElementNS(e, "path");
|
@@ -8365,7 +8679,7 @@ function J$1(h2) {
|
|
8365
8679
|
"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
8680
|
), t.appendChild(s), t;
|
8367
8681
|
}
|
8368
|
-
function
|
8682
|
+
function J$1(h2) {
|
8369
8683
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8370
8684
|
t.setAttribute("class", `${h2}-footer-icon-spinner`), t.setAttribute("viewBox", "0 0 512 512");
|
8371
8685
|
const s = document.createElementNS(e, "path");
|
@@ -8385,12 +8699,12 @@ let K$1 = class K {
|
|
8385
8699
|
sideEffect: s,
|
8386
8700
|
readonly$: i,
|
8387
8701
|
events: r,
|
8388
|
-
playable:
|
8702
|
+
playable: n,
|
8389
8703
|
wrapClassName: l,
|
8390
8704
|
pagesIndex$: p,
|
8391
8705
|
root: a
|
8392
8706
|
}) {
|
8393
|
-
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable =
|
8707
|
+
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
8708
|
}
|
8395
8709
|
destroy() {
|
8396
8710
|
this.$footer.remove();
|
@@ -8399,15 +8713,15 @@ let K$1 = class K {
|
|
8399
8713
|
const e = document.createElement("div");
|
8400
8714
|
e.className = this.wrapClassName("footer"), this.sideEffect.addDisposer(
|
8401
8715
|
this.readonly$.subscribe(
|
8402
|
-
(
|
8716
|
+
(o2) => e.classList.toggle(this.wrapClassName("readonly"), o2)
|
8403
8717
|
)
|
8404
8718
|
);
|
8405
8719
|
const t = this.renderFooterBtn("btn-sidebar", W$1(this.namespace));
|
8406
8720
|
this.sideEffect.addEventListener(t, "click", () => {
|
8407
8721
|
this.readonly$.value || this.events.emit("togglePreview");
|
8408
8722
|
}), e.appendChild(t), this.sideEffect.addDisposer(
|
8409
|
-
this.pages$.subscribe((
|
8410
|
-
const d =
|
8723
|
+
this.pages$.subscribe((o2) => {
|
8724
|
+
const d = o2.some((g2) => g2.thumbnail || !g2.src.startsWith("ppt"));
|
8411
8725
|
t.style.display = d ? "" : "none";
|
8412
8726
|
})
|
8413
8727
|
);
|
@@ -8417,54 +8731,54 @@ let K$1 = class K {
|
|
8417
8731
|
if (this.sideEffect.addEventListener(i, "click", () => {
|
8418
8732
|
this.readonly$.value || this.events.emit("back");
|
8419
8733
|
}), s.appendChild(i), this.playable) {
|
8420
|
-
const
|
8734
|
+
const o2 = this.renderFooterBtn(
|
8421
8735
|
"btn-page-play",
|
8422
8736
|
G$1(this.namespace),
|
8423
8737
|
q$1(this.namespace)
|
8424
8738
|
);
|
8425
|
-
this.sideEffect.addEventListener(
|
8426
|
-
this.readonly$.value || (
|
8427
|
-
() =>
|
8739
|
+
this.sideEffect.addEventListener(o2, "click", () => {
|
8740
|
+
this.readonly$.value || (o2.classList.toggle(this.wrapClassName("footer-btn-playing"), true), this.events.emit("play"), this.sideEffect.setTimeout(
|
8741
|
+
() => o2.classList.toggle(this.wrapClassName("footer-btn-playing"), false),
|
8428
8742
|
500,
|
8429
8743
|
"returnPlay"
|
8430
8744
|
));
|
8431
|
-
}), s.appendChild(
|
8745
|
+
}), s.appendChild(o2);
|
8432
8746
|
}
|
8433
8747
|
const r = this.renderFooterBtn("btn-page-next", O$1(this.namespace));
|
8434
8748
|
this.sideEffect.addEventListener(r, "click", () => {
|
8435
8749
|
this.readonly$.value || this.events.emit("next");
|
8436
8750
|
}), s.appendChild(r);
|
8437
|
-
const
|
8438
|
-
|
8751
|
+
const n = document.createElement("div");
|
8752
|
+
n.className = this.wrapClassName("page-number");
|
8439
8753
|
const l = document.createElement("input");
|
8440
8754
|
l.className = this.wrapClassName("page-number-input"), this.sideEffect.addDisposer(
|
8441
|
-
this.readonly$.subscribe((
|
8755
|
+
this.readonly$.subscribe((o2) => l.disabled = o2)
|
8442
8756
|
), this.sideEffect.addDisposer(
|
8443
|
-
this.pagesIndex$.subscribe((
|
8757
|
+
this.pagesIndex$.subscribe((o2) => l.value = String(o2 + 1))
|
8444
8758
|
), this.sideEffect.addEventListener(l, "blur", () => {
|
8445
8759
|
l.value = String(this.pagesIndex$.value + 1);
|
8446
8760
|
}), this.sideEffect.addEventListener(l, "change", () => {
|
8447
8761
|
if (this.readonly$.value)
|
8448
8762
|
return;
|
8449
|
-
const
|
8450
|
-
|
8763
|
+
const o2 = l.value ? Number(l.value) - 1 : NaN;
|
8764
|
+
o2 >= 0 ? this.events.emit("jumpPage", o2) : l.value = String(this.pagesIndex$.value + 1);
|
8451
8765
|
});
|
8452
8766
|
const p = document.createElement("span");
|
8453
8767
|
this.sideEffect.addDisposer(
|
8454
|
-
this.pages$.subscribe((
|
8455
|
-
p.textContent = " / " +
|
8768
|
+
this.pages$.subscribe((o2) => {
|
8769
|
+
p.textContent = " / " + o2.length;
|
8456
8770
|
})
|
8457
|
-
),
|
8458
|
-
const a =
|
8771
|
+
), n.appendChild(l), n.appendChild(p), e.appendChild(s), e.appendChild(n);
|
8772
|
+
const a = X$1(this.namespace), c = J$1(this.namespace);
|
8459
8773
|
c.style.display = "none";
|
8460
8774
|
const u = document.createElement("button");
|
8461
8775
|
return u.className = this.wrapClassName("footer-btn"), u.appendChild(a), u.appendChild(c), this.sideEffect.addEventListener(u, "click", () => {
|
8462
8776
|
this.events.emit("save");
|
8463
|
-
}), this.events.on("saveProgress", (
|
8464
|
-
if (
|
8777
|
+
}), this.events.on("saveProgress", (o2) => {
|
8778
|
+
if (o2 < 99) {
|
8465
8779
|
c.style.display = "block", a.style.display = "none";
|
8466
8780
|
const d = c.querySelector("[data-id]");
|
8467
|
-
d && (d.textContent =
|
8781
|
+
d && (d.textContent = o2.toString().padStart(2, "0"));
|
8468
8782
|
} else
|
8469
8783
|
c.style.display = "none", a.style.display = "block";
|
8470
8784
|
}), e;
|
@@ -8481,7 +8795,7 @@ class T {
|
|
8481
8795
|
previewRoot: s,
|
8482
8796
|
footerRoot: i,
|
8483
8797
|
pages$: r,
|
8484
|
-
playable:
|
8798
|
+
playable: n
|
8485
8799
|
}) {
|
8486
8800
|
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
8801
|
pages$: r,
|
@@ -8495,7 +8809,7 @@ class T {
|
|
8495
8809
|
}), this.footer = new K$1({
|
8496
8810
|
pages$: r,
|
8497
8811
|
readonly$: e,
|
8498
|
-
playable:
|
8812
|
+
playable: n,
|
8499
8813
|
pagesIndex$: t,
|
8500
8814
|
root: i,
|
8501
8815
|
namespace: this.namespace,
|
@@ -8508,7 +8822,7 @@ class T {
|
|
8508
8822
|
this.preview.destroy(), this.footer.destroy(), this.sideEffect.flushAll(), this.events.destroy();
|
8509
8823
|
}
|
8510
8824
|
}
|
8511
|
-
function
|
8825
|
+
function E$1(h2, e, t) {
|
8512
8826
|
return Math.min(Math.max(h2, e), t);
|
8513
8827
|
}
|
8514
8828
|
function A$1(h2) {
|
@@ -8551,27 +8865,27 @@ let Q$1 = class Q {
|
|
8551
8865
|
}
|
8552
8866
|
};
|
8553
8867
|
let Z$1 = class Z {
|
8554
|
-
constructor(e, t, s, i, r,
|
8868
|
+
constructor(e, t, s, i, r, n) {
|
8555
8869
|
this.index = e, this.lastVisit = Date.now(), this.sideEffect = new sideEffectManager.SideEffectManager();
|
8556
|
-
const l = valueEnhancer.derive(t, (
|
8870
|
+
const l = valueEnhancer.derive(t, (o2) => o2[e] || { width: 0, height: 0 }), p = valueEnhancer.combine(
|
8557
8871
|
[l, s],
|
8558
|
-
([
|
8872
|
+
([o2, d]) => (d.width - o2.width) / 2
|
8559
8873
|
), a = valueEnhancer.combine(
|
8560
|
-
[r,
|
8561
|
-
([
|
8874
|
+
[r, n],
|
8875
|
+
([o2, d]) => (o2[e] || 0) - d
|
8562
8876
|
), c = document.createElement("div");
|
8563
8877
|
c.className = "page-renderer-page", c.dataset.index = `${e}`;
|
8564
8878
|
const u = document.createElement("img");
|
8565
8879
|
u.className = "page-renderer-page-img", c.appendChild(u), this.sideEffect.addDisposer([
|
8566
|
-
valueEnhancer.combine([l, i]).subscribe(([
|
8567
|
-
c.style.width = `${
|
8880
|
+
valueEnhancer.combine([l, i]).subscribe(([o2, d]) => {
|
8881
|
+
c.style.width = `${o2.width * d}px`, c.style.height = `${o2.height * d}px`;
|
8568
8882
|
}),
|
8569
|
-
l.subscribe((
|
8570
|
-
|
8883
|
+
l.subscribe((o2) => {
|
8884
|
+
o2.thumbnail && (c.style.backgroundImage = `url("${o2.thumbnail}")`), u.width = o2.width, u.height = o2.height, u.src = o2.src;
|
8571
8885
|
}),
|
8572
8886
|
valueEnhancer.combine([p, a, i]).subscribe(
|
8573
|
-
([
|
8574
|
-
c.style.transform = `translate(${
|
8887
|
+
([o2, d, g2]) => {
|
8888
|
+
c.style.transform = `translate(${o2 * g2}px, ${d * g2}px)`;
|
8575
8889
|
}
|
8576
8890
|
)
|
8577
8891
|
]), this.$page = c;
|
@@ -8583,13 +8897,13 @@ let Z$1 = class Z {
|
|
8583
8897
|
let ee$1 = class ee {
|
8584
8898
|
constructor(e, t, s, i, r) {
|
8585
8899
|
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
|
8900
|
+
var n;
|
8587
8901
|
if (this.gcTimer = null, this.els.size > this.maxElCount) {
|
8588
8902
|
const l = [...this.els.values()].sort((p, a) => a.lastVisit - p.lastVisit);
|
8589
8903
|
for (let p = Math.floor(this.maxElCount / 4); p < l.length; p++)
|
8590
|
-
(
|
8904
|
+
(n = this.els.get(l[p].index)) == null || n.destroy(), this.els.delete(l[p].index);
|
8591
8905
|
}
|
8592
|
-
}, this.schedule = window.requestIdleCallback || ((
|
8906
|
+
}, this.schedule = window.requestIdleCallback || ((n) => window.setTimeout(n, 5e3)), this.cancelSchedule = window.cancelIdleCallback || window.clearTimeout;
|
8593
8907
|
}
|
8594
8908
|
getEl(e) {
|
8595
8909
|
let t = this.els.get(e);
|
@@ -8626,7 +8940,7 @@ let te$1 = class te {
|
|
8626
8940
|
for (let w2 = 0; w2 < d.length; w2++)
|
8627
8941
|
g2[w2] = w2 > 0 ? g2[w2 - 1] + d[w2 - 1].height : 0;
|
8628
8942
|
return g2;
|
8629
|
-
}),
|
8943
|
+
}), n = valueEnhancer.derive(s, (d) => {
|
8630
8944
|
let g2 = 1 / 0;
|
8631
8945
|
for (let w2 = d.length - 1; w2 >= 0; w2--)
|
8632
8946
|
d[w2].height <= g2 && (g2 = d[w2].height);
|
@@ -8645,8 +8959,8 @@ let te$1 = class te {
|
|
8645
8959
|
[t, i],
|
8646
8960
|
([d, g2]) => d.width / g2.width || 1
|
8647
8961
|
), a = valueEnhancer.combine(
|
8648
|
-
[s, t,
|
8649
|
-
([d, g2, w2, f2]) =>
|
8962
|
+
[s, t, n, p],
|
8963
|
+
([d, g2, w2, f2]) => E$1(Math.ceil(g2.height / f2 / w2 / 2), 1, d.length)
|
8650
8964
|
);
|
8651
8965
|
valueEnhancer.withReadonlyValueEnhancer(this, {
|
8652
8966
|
pagesScrollTop: e,
|
@@ -8655,19 +8969,19 @@ let te$1 = class te {
|
|
8655
8969
|
pagesSize: i,
|
8656
8970
|
pagesIndex: l,
|
8657
8971
|
pagesYs: r,
|
8658
|
-
pagesMinHeight:
|
8972
|
+
pagesMinHeight: n,
|
8659
8973
|
scale: p
|
8660
8974
|
}), this.pageElManager = new ee$1(s, i, p, r, e), this.$pages = this.renderPages();
|
8661
8975
|
const c = new valueEnhancer.Val(false);
|
8662
8976
|
this.sideEffect.addDisposer(
|
8663
8977
|
c.subscribe((d) => this.$pages.classList.toggle("is-hwa", d))
|
8664
8978
|
);
|
8665
|
-
const u = () => c.setValue(false),
|
8979
|
+
const u = () => c.setValue(false), o2 = () => {
|
8666
8980
|
this.sideEffect.setTimeout(u, 1e3, "turn-off-hwa"), c.setValue(true);
|
8667
8981
|
};
|
8668
8982
|
this.sideEffect.addDisposer(
|
8669
8983
|
valueEnhancer.combine([l, a, s]).subscribe(([d, g2, w2]) => {
|
8670
|
-
|
8984
|
+
o2();
|
8671
8985
|
const f2 = Math.max(d - g2, 0), N = Math.min(d + g2, w2.length - 1);
|
8672
8986
|
for (let m = 0; m < this.$pages.children.length; m++) {
|
8673
8987
|
const S2 = this.$pages.children[m], k2 = Number(S2.dataset.index);
|
@@ -8701,23 +9015,23 @@ let ie$1 = class ie {
|
|
8701
9015
|
stageRect$: s,
|
8702
9016
|
pagesSize$: i,
|
8703
9017
|
readonly$: r,
|
8704
|
-
scrollbarMinHeight:
|
9018
|
+
scrollbarMinHeight: n = se,
|
8705
9019
|
wrapClassName: l,
|
8706
9020
|
onDragScroll: p
|
8707
9021
|
}) {
|
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 =
|
9022
|
+
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
9023
|
[t, s, i],
|
8710
|
-
([a, c, u]) =>
|
9024
|
+
([a, c, u]) => E$1(
|
8711
9025
|
c.height / (c.width / u.width * u.height) * a.height,
|
8712
|
-
|
9026
|
+
n,
|
8713
9027
|
a.height
|
8714
9028
|
)
|
8715
9029
|
), this.scrollTop$ = valueEnhancer.combine(
|
8716
9030
|
[t, s, i, this.scrollbarHeight$, this.pagesScrollTop$],
|
8717
|
-
([a, c, u,
|
8718
|
-
d / (u.height - u.width / c.width * c.height) * (a.height -
|
9031
|
+
([a, c, u, o2, d]) => E$1(
|
9032
|
+
d / (u.height - u.width / c.width * c.height) * (a.height - o2),
|
8719
9033
|
0,
|
8720
|
-
a.height -
|
9034
|
+
a.height - o2
|
8721
9035
|
)
|
8722
9036
|
), this.$scrollbar = this.renderScrollbar();
|
8723
9037
|
}
|
@@ -8748,15 +9062,15 @@ let ie$1 = class ie {
|
|
8748
9062
|
D(s);
|
8749
9063
|
const i = this.wrapClassName("scrollbar-dragging");
|
8750
9064
|
e.classList.toggle(i, true);
|
8751
|
-
const r = this.pagesScrollTop$.value, { clientY:
|
9065
|
+
const r = this.pagesScrollTop$.value, { clientY: n } = A$1(s), l = (a) => {
|
8752
9066
|
if (!a.isPrimary || this.readonly$.value)
|
8753
9067
|
return;
|
8754
|
-
const { clientY: c } = A$1(a), u = c -
|
9068
|
+
const { clientY: c } = A$1(a), u = c - n;
|
8755
9069
|
Math.abs(u) > 0 && this.onDragScroll && this.onDragScroll(
|
8756
9070
|
r + u / this.containerRect$.value.height * this.pagesSize$.value.height
|
8757
9071
|
);
|
8758
9072
|
}, p = (a) => {
|
8759
|
-
|
9073
|
+
a.isPrimary && (e.classList.toggle(i, false), window.removeEventListener("pointermove", l, true), window.removeEventListener("pointerup", p, true), window.removeEventListener("pointercancel", p, true));
|
8760
9074
|
};
|
8761
9075
|
window.addEventListener("pointermove", l, true), window.addEventListener("pointerup", p, true), window.addEventListener("pointercancel", p, true);
|
8762
9076
|
};
|
@@ -8770,36 +9084,36 @@ class re {
|
|
8770
9084
|
box: s,
|
8771
9085
|
pages: i,
|
8772
9086
|
pagesScrollTop: r = 0,
|
8773
|
-
onUserScroll:
|
9087
|
+
onUserScroll: n
|
8774
9088
|
}) {
|
8775
9089
|
this.sideEffect = new sideEffectManager.SideEffectManager(), this.userScrolling = false, this.toPdf = async () => {
|
8776
9090
|
const a = document.createElement("canvas"), c = a.getContext("2d");
|
8777
9091
|
if (!c)
|
8778
9092
|
return null;
|
8779
|
-
const u = this.whiteboard.pageState.pages[0],
|
8780
|
-
format: [
|
8781
|
-
orientation:
|
9093
|
+
const u = this.whiteboard.pageState.pages[0], o2 = this.pages[0], { jsPDF: d } = await import("jspdf"), g2 = new d({
|
9094
|
+
format: [o2.width, o2.height],
|
9095
|
+
orientation: o2.width > o2.height ? "l" : "p",
|
8782
9096
|
compress: true
|
8783
9097
|
});
|
8784
9098
|
for (const [S2, k2] of this.pages.entries()) {
|
8785
|
-
const { width: y, height: v, src:
|
9099
|
+
const { width: y, height: v, src: L } = k2;
|
8786
9100
|
a.width = y, a.height = v;
|
8787
|
-
const
|
8788
|
-
S2 > 0 && g2.addPage([y, v],
|
8789
|
-
const
|
8790
|
-
P2.src =
|
8791
|
-
const
|
9101
|
+
const M2 = y > v ? "l" : "p";
|
9102
|
+
S2 > 0 && g2.addPage([y, v], M2);
|
9103
|
+
const R2 = await this.getBase64FromUrl(L), P2 = document.createElement("img");
|
9104
|
+
P2.src = R2, await new Promise((_2) => P2.onload = _2), c.drawImage(P2, 0, 0);
|
9105
|
+
const V = a.toDataURL("image/jpeg", 0.6);
|
8792
9106
|
c.clearRect(0, 0, y, v), this.whiteboard.view.screenshotToCanvas(c, u, y, v, {
|
8793
9107
|
centerX: y / 2,
|
8794
9108
|
centerY: v / 2 + S2 * v,
|
8795
9109
|
scale: 1
|
8796
9110
|
});
|
8797
9111
|
const I2 = a.toDataURL("image/png");
|
8798
|
-
g2.addImage(
|
9112
|
+
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
9113
|
}
|
8800
9114
|
const w2 = g2.output("arraybuffer"), f2 = new Blob([w2]), N = URL.createObjectURL(f2), m = document.createElement("a");
|
8801
9115
|
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 =
|
9116
|
+
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll = n;
|
8803
9117
|
const l = () => {
|
8804
9118
|
var a;
|
8805
9119
|
this.userScrolling = false, (a = this.onUserScroll) == null || a.call(this, this.pagesScrollTop$.value);
|
@@ -8812,8 +9126,8 @@ class re {
|
|
8812
9126
|
p,
|
8813
9127
|
(a) => {
|
8814
9128
|
let c = 0, u = 0;
|
8815
|
-
for (let
|
8816
|
-
const d = a[
|
9129
|
+
for (let o2 = a.length - 1; o2 >= 0; o2--) {
|
9130
|
+
const d = a[o2];
|
8817
9131
|
d.width > c && (c = d.width), u += d.height;
|
8818
9132
|
}
|
8819
9133
|
return { width: Math.max(1, c), height: Math.max(1, u) };
|
@@ -8873,8 +9187,8 @@ class re {
|
|
8873
9187
|
return new Promise((i) => {
|
8874
9188
|
const r = new FileReader();
|
8875
9189
|
r.readAsDataURL(s), r.onloadend = () => {
|
8876
|
-
const
|
8877
|
-
i(
|
9190
|
+
const n = r.result;
|
9191
|
+
i(n);
|
8878
9192
|
};
|
8879
9193
|
});
|
8880
9194
|
}
|
@@ -8884,7 +9198,7 @@ class re {
|
|
8884
9198
|
pageScrollTo(e) {
|
8885
9199
|
const t = this.whiteboard.view.size.height / 2 / this.pageRenderer.scale;
|
8886
9200
|
this.whiteboard.view.moveCamera({
|
8887
|
-
centerY:
|
9201
|
+
centerY: E$1(
|
8888
9202
|
e + t,
|
8889
9203
|
t,
|
8890
9204
|
this.pagesSize$.value.height - t
|
@@ -8894,7 +9208,7 @@ class re {
|
|
8894
9208
|
}
|
8895
9209
|
userScrollToPageIndex(e) {
|
8896
9210
|
var t;
|
8897
|
-
if (e =
|
9211
|
+
if (e = E$1(e, 0, this.pages.length - 1), !this.readonly$.value && !Number.isNaN(e)) {
|
8898
9212
|
const s = this.pageRenderer.pagesYs[e];
|
8899
9213
|
s >= 0 && ((t = this.onUserScroll) == null || t.call(this, s + 5 / this.pageRenderer.scale));
|
8900
9214
|
}
|
@@ -8903,8 +9217,8 @@ class re {
|
|
8903
9217
|
var t;
|
8904
9218
|
this.readonly$.value || (t = this.onUserScroll) == null || t.call(
|
8905
9219
|
this,
|
8906
|
-
|
8907
|
-
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale *
|
9220
|
+
E$1(
|
9221
|
+
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale * E$1(e, -1, 1),
|
8908
9222
|
0,
|
8909
9223
|
this.pageRenderer.pagesSize.height - this.pageRenderer.containerRect.height / this.pageRenderer.scale
|
8910
9224
|
)
|
@@ -8914,52 +9228,59 @@ class re {
|
|
8914
9228
|
this.sideEffect.addEventListener(
|
8915
9229
|
this.box.$main,
|
8916
9230
|
"wheel",
|
8917
|
-
(
|
8918
|
-
D(
|
9231
|
+
(t) => {
|
9232
|
+
D(t), !this.readonly$.value && this.pageScrollStepper.paused && (this.pageScrollTo(this.pagesScrollTop + t.deltaY), this.debounceOnUserScroll());
|
8919
9233
|
},
|
8920
9234
|
{ passive: false }
|
8921
9235
|
), this.sideEffect.addEventListener(
|
8922
9236
|
this.box.$main,
|
8923
9237
|
"touchmove",
|
8924
|
-
(
|
8925
|
-
!this.readonly$.value &&
|
9238
|
+
(t) => {
|
9239
|
+
!this.readonly$.value && t.touches.length > 1 && this.debounceOnUserScroll();
|
8926
9240
|
},
|
8927
9241
|
{ passive: true, capture: true }
|
8928
9242
|
), this.sideEffect.add(() => {
|
8929
|
-
const
|
8930
|
-
const { width:
|
8931
|
-
if (
|
9243
|
+
const t = (s) => {
|
9244
|
+
const { width: i, height: r } = this.whiteboard.view.size;
|
9245
|
+
if (i <= 0 || r <= 0)
|
8932
9246
|
return;
|
8933
|
-
const
|
8934
|
-
this.pagesScrollTop$.setValue(Math.max(0,
|
9247
|
+
const n = s.centerY - this.pageRenderer.containerRect.height / this.pageRenderer.scale / 2;
|
9248
|
+
this.pagesScrollTop$.setValue(Math.max(0, n));
|
8935
9249
|
};
|
8936
|
-
return this.whiteboard.view.callbacks.on("onCameraUpdated",
|
9250
|
+
return this.whiteboard.view.callbacks.on("onCameraUpdated", t), () => this.whiteboard.view.callbacks.off("onCameraUpdated", t);
|
8937
9251
|
}), this.sideEffect.addDisposer(
|
8938
|
-
this.box._stageRect$.subscribe((
|
8939
|
-
const { width:
|
9252
|
+
this.box._stageRect$.subscribe((t) => {
|
9253
|
+
const { width: s, height: i } = this.pagesSize$.value;
|
8940
9254
|
this.whiteboard.view.moveCameraToContain({
|
8941
9255
|
originX: 0,
|
8942
9256
|
originY: this.pageRenderer.pagesScrollTop,
|
8943
|
-
width:
|
8944
|
-
height:
|
9257
|
+
width: s,
|
9258
|
+
height: t.height / this.pageRenderer.scale,
|
8945
9259
|
animationMode: "immediately"
|
8946
9260
|
}), this.whiteboard.view.setCameraBound({
|
8947
9261
|
damping: 1,
|
8948
9262
|
maxContentMode: () => this.pageRenderer.scale,
|
8949
9263
|
minContentMode: () => this.pageRenderer.scale,
|
8950
|
-
centerX:
|
8951
|
-
centerY:
|
8952
|
-
width:
|
8953
|
-
height:
|
9264
|
+
centerX: s / 2,
|
9265
|
+
centerY: i / 2,
|
9266
|
+
width: s,
|
9267
|
+
height: i
|
8954
9268
|
});
|
8955
9269
|
}),
|
8956
9270
|
"whiteboard-size-update"
|
8957
|
-
)
|
9271
|
+
);
|
9272
|
+
const e = (t) => {
|
9273
|
+
if (!t)
|
9274
|
+
return false;
|
9275
|
+
const s = t.tagName;
|
9276
|
+
return s === "INPUT" || s === "TEXTAREA" || s === "SELECT";
|
9277
|
+
};
|
9278
|
+
this.sideEffect.addEventListener(
|
8958
9279
|
window,
|
8959
9280
|
"keyup",
|
8960
|
-
(
|
8961
|
-
if (!(this.readonly$.value || !this.box.focus || this.box.minimized))
|
8962
|
-
switch (
|
9281
|
+
(t) => {
|
9282
|
+
if (!(this.readonly$.value || !this.box.focus || this.box.minimized || e(t.target)))
|
9283
|
+
switch (t.key) {
|
8963
9284
|
case "PageDown": {
|
8964
9285
|
this.userScrollByPercent(0.8);
|
8965
9286
|
break;
|
@@ -8996,15 +9317,15 @@ class re {
|
|
8996
9317
|
let ae$1 = class ae {
|
8997
9318
|
constructor({ readonly$: e, context: t, whiteboard: s, box: i, pages: r }) {
|
8998
9319
|
this.sideEffect = new sideEffectManager.SideEffectManager(), this.context = t, this.whiteboard = s, this.box = i, this.pages = r;
|
8999
|
-
const
|
9000
|
-
this.pagesIndex$ =
|
9320
|
+
const n = new valueEnhancer.Val(t.displayer.state.sceneState.index || 0);
|
9321
|
+
this.pagesIndex$ = n, this.sideEffect.add(() => {
|
9001
9322
|
const l = (p) => {
|
9002
9323
|
this.jumpToPage(p.index);
|
9003
9324
|
};
|
9004
9325
|
return this.context.emitter.on("sceneStateChange", l), () => this.context.emitter.off("sceneStateChange", l);
|
9005
9326
|
}), this.viewer = new T({
|
9006
9327
|
readonly$: e,
|
9007
|
-
pagesIndex$:
|
9328
|
+
pagesIndex$: n,
|
9008
9329
|
previewRoot: i.$body,
|
9009
9330
|
footerRoot: i.$footer,
|
9010
9331
|
pages$: new valueEnhancer.Val(r),
|
@@ -9018,11 +9339,11 @@ let ae$1 = class ae {
|
|
9018
9339
|
this.viewer.events.on("back", () => this.prevPage()),
|
9019
9340
|
this.viewer.events.on("next", () => this.nextPage())
|
9020
9341
|
]), this.render(), this.sideEffect.addDisposer(
|
9021
|
-
|
9022
|
-
var u,
|
9342
|
+
n.subscribe((l, p) => {
|
9343
|
+
var u, o2;
|
9023
9344
|
if (e.value)
|
9024
9345
|
return;
|
9025
|
-
const a = this.context.getInitScenePath(), c = (
|
9346
|
+
const a = this.context.getInitScenePath(), c = (o2 = (u = this.context.getScenes()) == null ? void 0 : u[l]) == null ? void 0 : o2.name;
|
9026
9347
|
if (a && c && this.context.setScenePath(`${a}/${c}`), p) {
|
9027
9348
|
const d = this.context.room;
|
9028
9349
|
if (d) {
|
@@ -9049,7 +9370,7 @@ let ae$1 = class ae {
|
|
9049
9370
|
this.jumpToPage(this.pagesIndex$.value - 1, true);
|
9050
9371
|
}
|
9051
9372
|
jumpToPage(e, t = false) {
|
9052
|
-
this.pagesIndex$.setValue(
|
9373
|
+
this.pagesIndex$.setValue(E$1(e, 0, this.pages.length - 1), t);
|
9053
9374
|
}
|
9054
9375
|
render() {
|
9055
9376
|
var t;
|
@@ -9074,8 +9395,8 @@ let ae$1 = class ae {
|
|
9074
9395
|
var r;
|
9075
9396
|
const i = this.context.room;
|
9076
9397
|
if (i && i.state.memberState.currentApplianceName === "clicker") {
|
9077
|
-
for (let
|
9078
|
-
if ((r =
|
9398
|
+
for (let n = s.target; n; n = n.parentElement)
|
9399
|
+
if ((r = n.classList) != null && r.contains("ppt-event-source"))
|
9079
9400
|
return;
|
9080
9401
|
i.pptNextStep();
|
9081
9402
|
}
|
@@ -9092,20 +9413,20 @@ const ne$1 = "DocsViewer", ue = {
|
|
9092
9413
|
if (!t)
|
9093
9414
|
throw new Error("[Docs Viewer]: scenes not found.");
|
9094
9415
|
const s = new sideEffectManager.SideEffectManager(), i = t.map(
|
9095
|
-
({ ppt:
|
9096
|
-
width:
|
9097
|
-
height:
|
9098
|
-
src:
|
9099
|
-
thumbnail:
|
9416
|
+
({ ppt: n }) => n ? {
|
9417
|
+
width: n.width,
|
9418
|
+
height: n.height,
|
9419
|
+
src: n.src,
|
9420
|
+
thumbnail: n.previewURL
|
9100
9421
|
} : null
|
9101
|
-
).filter((
|
9422
|
+
).filter((n) => Boolean(n));
|
9102
9423
|
if (i.length <= 0)
|
9103
9424
|
throw new Error("[Docs Viewer]: empty scenes.");
|
9104
9425
|
e.mountStyles(F);
|
9105
9426
|
const r = new valueEnhancer.Val(!h2.isWritable);
|
9106
9427
|
s.addDisposer(
|
9107
|
-
h2.emitter.on("writableChange", (
|
9108
|
-
r.setValue(!
|
9428
|
+
h2.emitter.on("writableChange", (n) => {
|
9429
|
+
r.setValue(!n);
|
9109
9430
|
})
|
9110
9431
|
), i[0].src.startsWith("ppt") ? le$1(
|
9111
9432
|
s,
|
@@ -9133,18 +9454,18 @@ function oe$1(h2, e, t, s, i) {
|
|
9133
9454
|
r.view.disableCameraTransform = p;
|
9134
9455
|
})
|
9135
9456
|
);
|
9136
|
-
const
|
9457
|
+
const n = e.createStorage("static-docs-viewer", { pagesScrollTop: 0 }), l = new re({
|
9137
9458
|
whiteboard: r,
|
9138
9459
|
readonly$: i,
|
9139
9460
|
box: t,
|
9140
9461
|
pages: s,
|
9141
|
-
pagesScrollTop:
|
9462
|
+
pagesScrollTop: n.state.pagesScrollTop,
|
9142
9463
|
onUserScroll: (p) => {
|
9143
|
-
e.isWritable &&
|
9464
|
+
e.isWritable && n.setState({ pagesScrollTop: p });
|
9144
9465
|
}
|
9145
9466
|
});
|
9146
9467
|
h2.addDisposer(() => l.destroy()), h2.addDisposer(
|
9147
|
-
|
9468
|
+
n.on("stateChanged", (p) => {
|
9148
9469
|
p.pagesScrollTop && l.syncPageScrollTop(p.pagesScrollTop.newValue || 0);
|
9149
9470
|
})
|
9150
9471
|
), h2.addDisposer(
|
@@ -9156,8 +9477,8 @@ function oe$1(h2, e, t, s, i) {
|
|
9156
9477
|
l.pagesSize$,
|
9157
9478
|
l.pageRenderer._pagesMinHeight$
|
9158
9479
|
],
|
9159
|
-
([p, a, c, u,
|
9160
|
-
|
9480
|
+
([p, a, c, u, o2]) => p ? Math.max(
|
9481
|
+
o2 / u.width * (2 / 5),
|
9161
9482
|
a.height / a.width
|
9162
9483
|
) : c.height / c.width * (a.height / a.width)
|
9163
9484
|
).subscribe((p) => {
|
@@ -9168,20 +9489,20 @@ function oe$1(h2, e, t, s, i) {
|
|
9168
9489
|
function le$1(h2, e, t, s, i) {
|
9169
9490
|
const r = e.createWhiteBoardView();
|
9170
9491
|
r.view.disableCameraTransform = true;
|
9171
|
-
const
|
9492
|
+
const n = new ae$1({
|
9172
9493
|
context: e,
|
9173
9494
|
whiteboard: r,
|
9174
9495
|
box: t,
|
9175
9496
|
pages: s,
|
9176
9497
|
readonly$: i
|
9177
9498
|
});
|
9178
|
-
h2.addDisposer(() =>
|
9499
|
+
h2.addDisposer(() => n.destroy());
|
9179
9500
|
const l = new valueEnhancer.Val(
|
9180
9501
|
{ width: s[0].width, height: s[0].height },
|
9181
9502
|
{ compare: z$1 }
|
9182
9503
|
);
|
9183
9504
|
if (h2.addDisposer(
|
9184
|
-
|
9505
|
+
n.pagesIndex$.subscribe((p) => {
|
9185
9506
|
const a = s[p];
|
9186
9507
|
a && l.setValue({ width: a.width, height: a.height });
|
9187
9508
|
})
|
@@ -9193,7 +9514,7 @@ function le$1(h2, e, t, s, i) {
|
|
9193
9514
|
const p = h2.add(() => {
|
9194
9515
|
const a = ({ width: c, height: u }) => {
|
9195
9516
|
if (s.length > 0 && t.state !== "maximized") {
|
9196
|
-
const { width:
|
9517
|
+
const { width: o2, height: d } = s[0], w2 = d / o2 * c - u;
|
9197
9518
|
w2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9198
9519
|
width: t.intrinsicWidth,
|
9199
9520
|
height: t.intrinsicHeight + w2 / t.rootRect.height
|
@@ -9561,13 +9882,13 @@ function Ni(e) {
|
|
9561
9882
|
return Array.isArray(e) ? e[0] : e;
|
9562
9883
|
}
|
9563
9884
|
function Li(e) {
|
9564
|
-
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N,
|
9885
|
+
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
9886
|
return {
|
9566
9887
|
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"),
|
9888
|
+
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
9889
|
},
|
9569
9890
|
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,
|
9891
|
+
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
9892
|
},
|
9572
9893
|
p: X,
|
9573
9894
|
i: X,
|
@@ -10451,19 +10772,19 @@ const h = { getIconUrl() {
|
|
10451
10772
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10452
10773
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10453
10774
|
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((
|
10775
|
+
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10455
10776
|
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,
|
10777
|
+
i.call(this, y, x), E.call(this, y, "click", () => {
|
10778
|
+
d.call(this, x, false);
|
10458
10779
|
});
|
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(
|
10780
|
+
const C = _("span", null, j.get(x, this.config)), L = _("span", { class: this.config.classNames.menu.value });
|
10781
|
+
L.innerHTML = e[x], C.appendChild(L), y.appendChild(C), N.appendChild(y);
|
10782
|
+
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10783
|
+
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
10784
|
V.key === "ArrowLeft" && (V.preventDefault(), V.stopPropagation(), d.call(this, "home", true));
|
10464
10785
|
}, false), E.call(this, D2, "click", () => {
|
10465
10786
|
d.call(this, "home", false);
|
10466
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[
|
10787
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10467
10788
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10468
10789
|
}
|
10469
10790
|
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 +11368,9 @@ var kr = xr(function(e, i) {
|
|
11047
11368
|
}, r = {}, s = {}, n = {};
|
11048
11369
|
function a(p, v) {
|
11049
11370
|
p = p.push ? p : [p];
|
11050
|
-
var b, T2, N,
|
11371
|
+
var b, T2, N, x = [], y = p.length, C = y;
|
11051
11372
|
for (b = function(L, $) {
|
11052
|
-
$.length &&
|
11373
|
+
$.length && x.push(L), --C || v(x);
|
11053
11374
|
}; y--; )
|
11054
11375
|
T2 = p[y], (N = s[T2]) ? b(T2, N) : (n[T2] = n[T2] || []).push(b);
|
11055
11376
|
}
|
@@ -11065,32 +11386,32 @@ var kr = xr(function(e, i) {
|
|
11065
11386
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11066
11387
|
}
|
11067
11388
|
function c(p, v, b, T2) {
|
11068
|
-
var N,
|
11069
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((
|
11389
|
+
var N, x, y = document, C = b.async, L = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V = p.replace(/^(css|img)!/, "");
|
11390
|
+
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
11391
|
var F2 = re2.type[0];
|
11071
11392
|
if (N)
|
11072
11393
|
try {
|
11073
|
-
|
11394
|
+
x.sheet.cssText.length || (F2 = "e");
|
11074
11395
|
} catch (ce) {
|
11075
11396
|
ce.code != 18 && (F2 = "e");
|
11076
11397
|
}
|
11077
11398
|
if (F2 == "e") {
|
11078
11399
|
if ((T2 += 1) < L)
|
11079
11400
|
return c(p, v, b, T2);
|
11080
|
-
} else if (
|
11081
|
-
return
|
11401
|
+
} else if (x.rel == "preload" && x.as == "style")
|
11402
|
+
return x.rel = "stylesheet";
|
11082
11403
|
v(p, F2, re2.defaultPrevented);
|
11083
|
-
}, $(p,
|
11404
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11084
11405
|
}
|
11085
11406
|
function u(p, v, b) {
|
11086
|
-
var T2, N,
|
11407
|
+
var T2, N, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11087
11408
|
for (T2 = function(L, $, D2) {
|
11088
11409
|
if ($ == "e" && C.push(L), $ == "b") {
|
11089
11410
|
if (!D2)
|
11090
11411
|
return;
|
11091
11412
|
C.push(L);
|
11092
11413
|
}
|
11093
|
-
--
|
11414
|
+
--x || v(C);
|
11094
11415
|
}, N = 0; N < y; N++)
|
11095
11416
|
c(p[N], T2, b);
|
11096
11417
|
}
|
@@ -11101,14 +11422,14 @@ var kr = xr(function(e, i) {
|
|
11101
11422
|
throw "LoadJS";
|
11102
11423
|
r[T2] = true;
|
11103
11424
|
}
|
11104
|
-
function
|
11425
|
+
function x(y, C) {
|
11105
11426
|
u(p, function(L) {
|
11106
11427
|
d(N, L), y && d({ success: y, error: C }, L), l(T2, L);
|
11107
11428
|
}, N);
|
11108
11429
|
}
|
11109
11430
|
if (N.returnPromise)
|
11110
|
-
return new Promise(
|
11111
|
-
|
11431
|
+
return new Promise(x);
|
11432
|
+
x();
|
11112
11433
|
}
|
11113
11434
|
return m.ready = function(p, v) {
|
11114
11435
|
return a(p, function(b) {
|
@@ -11191,11 +11512,11 @@ const nt = { setup() {
|
|
11191
11512
|
T2 = C, w.call(e, e.media, "volumechange");
|
11192
11513
|
});
|
11193
11514
|
} });
|
11194
|
-
let N, { loop:
|
11195
|
-
Object.defineProperty(e.media, "loop", { get: () =>
|
11515
|
+
let N, { loop: x } = e.config;
|
11516
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11196
11517
|
const C = o.boolean(y) ? y : e.config.loop.active;
|
11197
11518
|
e.embed.setLoop(C).then(() => {
|
11198
|
-
|
11519
|
+
x = C;
|
11199
11520
|
});
|
11200
11521
|
} }), e.embed.getVideoUrl().then((y) => {
|
11201
11522
|
N = y, h.setDownloadUrl.call(e);
|
@@ -12322,8 +12643,8 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12322
12643
|
const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
12323
12644
|
constructor(context) {
|
12324
12645
|
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.
|
12646
|
+
this.version = "1.0.0-canary.77";
|
12647
|
+
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
12648
|
this.emitter = callbacks;
|
12328
12649
|
this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
|
12329
12650
|
this.playground$ = new valueEnhancer.Val(void 0);
|
@@ -12339,7 +12660,7 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12339
12660
|
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12340
12661
|
};
|
12341
12662
|
_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.
|
12663
|
+
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
12664
|
}
|
12344
12665
|
static async mount(params) {
|
12345
12666
|
var _a;
|
@@ -12504,12 +12825,21 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12504
12825
|
}
|
12505
12826
|
}
|
12506
12827
|
}
|
12828
|
+
/**
|
12829
|
+
* 注册插件
|
12830
|
+
*/
|
12507
12831
|
static register(params) {
|
12508
12832
|
return appRegister.register(params);
|
12509
12833
|
}
|
12834
|
+
/**
|
12835
|
+
* 注销插件
|
12836
|
+
*/
|
12510
12837
|
static unregister(kind) {
|
12511
12838
|
return appRegister.unregister(kind);
|
12512
12839
|
}
|
12840
|
+
/**
|
12841
|
+
* 创建一个 app 至白板
|
12842
|
+
*/
|
12513
12843
|
async addApp(params) {
|
12514
12844
|
if (this.appManager) {
|
12515
12845
|
if (this.appManager.rootDirRemoving) {
|
@@ -12596,11 +12926,17 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12596
12926
|
}
|
12597
12927
|
return isDynamicPPT;
|
12598
12928
|
}
|
12929
|
+
/**
|
12930
|
+
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
12931
|
+
*/
|
12599
12932
|
async setMainViewScenePath(scenePath) {
|
12600
12933
|
if (this.appManager) {
|
12601
12934
|
await this.appManager.setMainViewScenePath(scenePath);
|
12602
12935
|
}
|
12603
12936
|
}
|
12937
|
+
/**
|
12938
|
+
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
12939
|
+
*/
|
12604
12940
|
async setMainViewSceneIndex(index2) {
|
12605
12941
|
if (this.appManager) {
|
12606
12942
|
await this.appManager.setMainViewSceneIndex(index2);
|
@@ -12656,6 +12992,11 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12656
12992
|
}
|
12657
12993
|
}
|
12658
12994
|
}
|
12995
|
+
/**
|
12996
|
+
* 删除一页
|
12997
|
+
* 默认删除当前页, 可以删除指定 index 页
|
12998
|
+
* 最低保留一页
|
12999
|
+
*/
|
12659
13000
|
async removePage(index2) {
|
12660
13001
|
if (this.appManager) {
|
12661
13002
|
const needRemoveIndex = index2 === void 0 ? this.pageState.index : index2;
|
@@ -12672,27 +13013,45 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12672
13013
|
return false;
|
12673
13014
|
}
|
12674
13015
|
}
|
13016
|
+
/**
|
13017
|
+
* 返回 mainView 的 ScenePath
|
13018
|
+
*/
|
12675
13019
|
getMainViewScenePath() {
|
12676
13020
|
var _a;
|
12677
13021
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewScenePath();
|
12678
13022
|
}
|
13023
|
+
/**
|
13024
|
+
* 返回 mainView 的 SceneIndex
|
13025
|
+
*/
|
12679
13026
|
getMainViewSceneIndex() {
|
12680
13027
|
var _a;
|
12681
13028
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewSceneIndex();
|
12682
13029
|
}
|
13030
|
+
/**
|
13031
|
+
* 设置所有 app 的 readonly 模式
|
13032
|
+
*/
|
12683
13033
|
setReadonly(readonly) {
|
12684
13034
|
var _a;
|
12685
13035
|
this.readonly = readonly;
|
12686
13036
|
(_a = this.boxManager) == null ? void 0 : _a.setReadonly(readonly);
|
12687
13037
|
emitter.emit("setReadonly", readonly);
|
12688
13038
|
}
|
13039
|
+
/**
|
13040
|
+
* 切换 mainView 为可写
|
13041
|
+
*/
|
12689
13042
|
switchMainViewToWriter() {
|
12690
13043
|
var _a;
|
12691
13044
|
return (_a = this.appManager) == null ? void 0 : _a.mainViewProxy.mainViewClickHandler();
|
12692
13045
|
}
|
13046
|
+
/**
|
13047
|
+
* app destroy 回调
|
13048
|
+
*/
|
12693
13049
|
onAppDestroy(kind, listener) {
|
12694
13050
|
addEmitterOnceListener(`destroy-${kind}`, listener);
|
12695
13051
|
}
|
13052
|
+
/**
|
13053
|
+
* 设置 ViewMode
|
13054
|
+
*/
|
12696
13055
|
setViewMode(mode) {
|
12697
13056
|
var _a;
|
12698
13057
|
log("setViewMode", mode);
|
@@ -12870,14 +13229,23 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12870
13229
|
}
|
12871
13230
|
return this.boxManager.teleBoxManager;
|
12872
13231
|
}
|
13232
|
+
/**
|
13233
|
+
* 查询所有的 App
|
13234
|
+
*/
|
12873
13235
|
queryAll() {
|
12874
13236
|
var _a;
|
12875
13237
|
return Array.from(((_a = this.appManager) == null ? void 0 : _a.appProxies.values()) || []);
|
12876
13238
|
}
|
13239
|
+
/**
|
13240
|
+
* 查询单个 App
|
13241
|
+
*/
|
12877
13242
|
queryOne(appId) {
|
12878
13243
|
var _a;
|
12879
13244
|
return (_a = this.appManager) == null ? void 0 : _a.appProxies.get(appId);
|
12880
13245
|
}
|
13246
|
+
/**
|
13247
|
+
* 关闭 APP
|
13248
|
+
*/
|
12881
13249
|
async closeApp(appId) {
|
12882
13250
|
var _a;
|
12883
13251
|
return (_a = this.appManager) == null ? void 0 : _a.closeApp(appId);
|
@@ -12974,9 +13342,9 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12974
13342
|
var _a;
|
12975
13343
|
(_a = this.focusedView) == null ? void 0 : _a.duplicate();
|
12976
13344
|
}
|
12977
|
-
insertText(
|
13345
|
+
insertText(x, y, text2) {
|
12978
13346
|
var _a;
|
12979
|
-
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(
|
13347
|
+
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(x, y, text2)) || "";
|
12980
13348
|
}
|
12981
13349
|
insertImage(info) {
|
12982
13350
|
var _a;
|
@@ -12999,6 +13367,7 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
12999
13367
|
this._refresh();
|
13000
13368
|
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.Refresh);
|
13001
13369
|
}
|
13370
|
+
/** @inner */
|
13002
13371
|
_refresh() {
|
13003
13372
|
var _a, _b;
|
13004
13373
|
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.rebind();
|
@@ -13036,6 +13405,9 @@ const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
|
13036
13405
|
});
|
13037
13406
|
}, 500);
|
13038
13407
|
}
|
13408
|
+
/**
|
13409
|
+
* 切换 focus 到指定的 app, 并且把这个 app 放到最前面
|
13410
|
+
*/
|
13039
13411
|
focusApp(appId) {
|
13040
13412
|
var _a, _b, _c;
|
13041
13413
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(appId);
|