@netless/window-manager 1.0.0-canary.76 → 1.0.0-canary.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App/AppContext.d.ts +1 -1
- package/dist/App/AppPageStateImpl.d.ts +1 -1
- package/dist/App/AppProxy.d.ts +1 -1
- package/dist/App/MagixEvent/index.d.ts +7 -7
- package/dist/App/WhiteboardView.d.ts +2 -2
- package/dist/App/type.d.ts +1 -1
- package/dist/AttributesDelegate.d.ts +7 -7
- package/dist/BoxEmitter.d.ts +7 -7
- package/dist/BoxManager.d.ts +8 -8
- package/dist/Cursor/Cursor.d.ts +1 -1
- package/dist/Cursor/Cursor.svelte.d.ts +1 -0
- package/dist/Cursor/index.d.ts +2 -2
- package/dist/Helper.d.ts +1 -1
- package/dist/InternalEmitter.d.ts +3 -3
- package/dist/Page/PageController.d.ts +2 -2
- package/dist/ReconnectRefresher.d.ts +1 -1
- package/dist/RedoUndo.d.ts +1 -1
- package/dist/Register/index.d.ts +3 -3
- package/dist/Register/storage.d.ts +1 -1
- package/dist/Utils/AppCreateQueue.d.ts +1 -1
- package/dist/View/CameraSynchronizer.d.ts +1 -1
- package/dist/View/ScrollMode.d.ts +1 -1
- package/dist/View/ViewSync.d.ts +1 -1
- package/dist/callback.d.ts +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +674 -294
- package/dist/index.mjs +670 -294
- package/dist/index.umd.js +672 -296
- package/dist/storage.d.ts +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +38 -38
- package/src/AppListener.ts +16 -4
- package/src/BoxManager.ts +3 -0
- package/src/Helper.ts +10 -2
- package/dist/image.d.ts +0 -19
- package/dist/shim.d.ts +0 -5
package/dist/index.mjs
CHANGED
@@ -595,9 +595,14 @@ class AppListeners {
|
|
595
595
|
this.moveCameraHandler = (payload) => {
|
596
596
|
const size$ = this.manager.mainViewProxy.size$;
|
597
597
|
if (size$.value) {
|
598
|
-
const
|
599
|
-
|
600
|
-
|
598
|
+
const nextCamera = { ...payload };
|
599
|
+
if (nextCamera.scale) {
|
600
|
+
const size = this.manager.mainView.size;
|
601
|
+
const diff = Math.max(size.height / size$.value.height, size.width / size$.value.width);
|
602
|
+
nextCamera.scale *= diff;
|
603
|
+
} else {
|
604
|
+
delete nextCamera.scale;
|
605
|
+
}
|
601
606
|
this.manager.mainView.moveCamera(nextCamera);
|
602
607
|
}
|
603
608
|
};
|
@@ -774,11 +779,17 @@ const checkVersion = () => {
|
|
774
779
|
}
|
775
780
|
};
|
776
781
|
const findMemberByUid = (room, uid) => {
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
+
var _a;
|
783
|
+
const roomMembers = (room == null ? void 0 : room.state.roomMembers) || [];
|
784
|
+
let maxMemberId = -1;
|
785
|
+
let result = void 0;
|
786
|
+
for (const member of roomMembers) {
|
787
|
+
if (((_a = member.payload) == null ? void 0 : _a.uid) === uid && maxMemberId < member.memberId) {
|
788
|
+
maxMemberId = member.memberId;
|
789
|
+
result = member;
|
790
|
+
}
|
791
|
+
}
|
792
|
+
return result;
|
782
793
|
};
|
783
794
|
const serializeRoomMembers = (members) => {
|
784
795
|
return members.map((member) => {
|
@@ -967,9 +978,11 @@ class AppContext {
|
|
967
978
|
return this.displayer.calibrationTimestamp;
|
968
979
|
}
|
969
980
|
}
|
981
|
+
/** Get App writable status. */
|
970
982
|
get isWritable() {
|
971
983
|
return this.appProxy.isWritable && !this.destroyed;
|
972
984
|
}
|
985
|
+
/** Get the App Window UI box. */
|
973
986
|
get box() {
|
974
987
|
const box = this.appProxy.box$.value;
|
975
988
|
if (box) {
|
@@ -984,6 +997,7 @@ class AppContext {
|
|
984
997
|
get members() {
|
985
998
|
return this.manager.members$.value;
|
986
999
|
}
|
1000
|
+
//** currentMember is undefined in read-only and replay mode. */
|
987
1001
|
get currentMember() {
|
988
1002
|
const self = findMemberByUid(this.room, this.manager.uid);
|
989
1003
|
if (!self) {
|
@@ -1269,9 +1283,15 @@ class AttributesDelegate {
|
|
1269
1283
|
this.context = context;
|
1270
1284
|
this.setAppFocus = (appId, focus) => {
|
1271
1285
|
if (focus) {
|
1272
|
-
this.context.safeSetAttributes({ [
|
1286
|
+
this.context.safeSetAttributes({ [
|
1287
|
+
"focus"
|
1288
|
+
/* Focus */
|
1289
|
+
]: appId });
|
1273
1290
|
} else {
|
1274
|
-
this.context.safeSetAttributes({ [
|
1291
|
+
this.context.safeSetAttributes({ [
|
1292
|
+
"focus"
|
1293
|
+
/* Focus */
|
1294
|
+
]: void 0 });
|
1275
1295
|
}
|
1276
1296
|
};
|
1277
1297
|
}
|
@@ -1282,16 +1302,26 @@ class AttributesDelegate {
|
|
1282
1302
|
return this.context.getAttributes();
|
1283
1303
|
}
|
1284
1304
|
apps() {
|
1285
|
-
return get(this.attributes, [
|
1305
|
+
return get(this.attributes, [
|
1306
|
+
"apps"
|
1307
|
+
/* Apps */
|
1308
|
+
]);
|
1286
1309
|
}
|
1287
1310
|
get focus() {
|
1288
|
-
return get(this.attributes, [
|
1311
|
+
return get(this.attributes, [
|
1312
|
+
"focus"
|
1313
|
+
/* Focus */
|
1314
|
+
]);
|
1289
1315
|
}
|
1290
1316
|
getAppAttributes(id) {
|
1291
1317
|
return get(this.apps(), [id]);
|
1292
1318
|
}
|
1293
1319
|
getAppState(id) {
|
1294
|
-
return get(this.apps(), [
|
1320
|
+
return get(this.apps(), [
|
1321
|
+
id,
|
1322
|
+
"state"
|
1323
|
+
/* State */
|
1324
|
+
]);
|
1295
1325
|
}
|
1296
1326
|
getMaximized() {
|
1297
1327
|
return get(this.attributes, ["maximized"]);
|
@@ -1315,14 +1345,24 @@ class AttributesDelegate {
|
|
1315
1345
|
}
|
1316
1346
|
attrs.createdAt = Date.now();
|
1317
1347
|
this.context.safeUpdateAttributes(["apps", id], attrs);
|
1318
|
-
this.context.safeUpdateAttributes([
|
1348
|
+
this.context.safeUpdateAttributes([
|
1349
|
+
"apps",
|
1350
|
+
id,
|
1351
|
+
"state"
|
1352
|
+
/* State */
|
1353
|
+
], {
|
1319
1354
|
[AppAttributes.Size]: {},
|
1320
1355
|
[AppAttributes.Position]: {},
|
1321
1356
|
[AppAttributes.SceneIndex]: 0
|
1322
1357
|
});
|
1323
1358
|
}
|
1324
1359
|
updateAppState(appId, stateName, state) {
|
1325
|
-
if (get(this.attributes, [
|
1360
|
+
if (get(this.attributes, [
|
1361
|
+
"apps",
|
1362
|
+
appId,
|
1363
|
+
"state"
|
1364
|
+
/* State */
|
1365
|
+
])) {
|
1326
1366
|
this.context.safeUpdateAttributes(["apps", appId, "state", stateName], state);
|
1327
1367
|
}
|
1328
1368
|
}
|
@@ -1332,13 +1372,19 @@ class AttributesDelegate {
|
|
1332
1372
|
cleanAppAttributes(id) {
|
1333
1373
|
this.context.safeUpdateAttributes(["apps", id], void 0);
|
1334
1374
|
this.context.safeSetAttributes({ [id]: void 0 });
|
1335
|
-
const focus = this.attributes[
|
1375
|
+
const focus = this.attributes[
|
1376
|
+
"focus"
|
1377
|
+
/* Focus */
|
1378
|
+
];
|
1336
1379
|
if (focus === id) {
|
1337
1380
|
this.cleanFocus();
|
1338
1381
|
}
|
1339
1382
|
}
|
1340
1383
|
cleanFocus() {
|
1341
|
-
this.context.safeSetAttributes({ [
|
1384
|
+
this.context.safeSetAttributes({ [
|
1385
|
+
"focus"
|
1386
|
+
/* Focus */
|
1387
|
+
]: void 0 });
|
1342
1388
|
}
|
1343
1389
|
getAppSceneIndex(id) {
|
1344
1390
|
var _a;
|
@@ -1355,7 +1401,10 @@ class AttributesDelegate {
|
|
1355
1401
|
return this.attributes["_mainSceneIndex"];
|
1356
1402
|
}
|
1357
1403
|
getBoxState() {
|
1358
|
-
return this.attributes[
|
1404
|
+
return this.attributes[
|
1405
|
+
"boxState"
|
1406
|
+
/* BoxState */
|
1407
|
+
];
|
1359
1408
|
}
|
1360
1409
|
setMainViewScenePath(scenePath) {
|
1361
1410
|
this.context.safeSetAttributes({ _mainScenePath: scenePath });
|
@@ -1364,44 +1413,84 @@ class AttributesDelegate {
|
|
1364
1413
|
this.context.safeSetAttributes({ _mainSceneIndex: index2 });
|
1365
1414
|
}
|
1366
1415
|
getMainViewCamera() {
|
1367
|
-
return get(this.attributes, [
|
1416
|
+
return get(this.attributes, [
|
1417
|
+
"mainViewCamera"
|
1418
|
+
/* MainViewCamera */
|
1419
|
+
]);
|
1368
1420
|
}
|
1369
1421
|
getMainViewSize() {
|
1370
|
-
return get(this.attributes, [
|
1422
|
+
return get(this.attributes, [
|
1423
|
+
"mainViewSize"
|
1424
|
+
/* MainViewSize */
|
1425
|
+
]);
|
1371
1426
|
}
|
1372
1427
|
setMainViewCamera(camera) {
|
1373
|
-
this.context.safeSetAttributes({ [
|
1428
|
+
this.context.safeSetAttributes({ [
|
1429
|
+
"mainViewCamera"
|
1430
|
+
/* MainViewCamera */
|
1431
|
+
]: { ...camera } });
|
1374
1432
|
}
|
1375
1433
|
setMainViewSize(size) {
|
1376
|
-
this.context.safeSetAttributes({ [
|
1434
|
+
this.context.safeSetAttributes({ [
|
1435
|
+
"mainViewSize"
|
1436
|
+
/* MainViewSize */
|
1437
|
+
]: { ...size } });
|
1377
1438
|
}
|
1378
1439
|
setMainViewCameraAndSize(camera, size) {
|
1379
1440
|
this.context.safeSetAttributes({
|
1380
|
-
[
|
1381
|
-
|
1441
|
+
[
|
1442
|
+
"mainViewCamera"
|
1443
|
+
/* MainViewCamera */
|
1444
|
+
]: { ...camera },
|
1445
|
+
[
|
1446
|
+
"mainViewSize"
|
1447
|
+
/* MainViewSize */
|
1448
|
+
]: { ...size }
|
1382
1449
|
});
|
1383
1450
|
}
|
1384
1451
|
updateCursor(uid, position) {
|
1385
|
-
if (!get(this.attributes, [
|
1386
|
-
|
1452
|
+
if (!get(this.attributes, [
|
1453
|
+
"cursors"
|
1454
|
+
/* Cursors */
|
1455
|
+
])) {
|
1456
|
+
this.context.safeUpdateAttributes([
|
1457
|
+
"cursors"
|
1458
|
+
/* Cursors */
|
1459
|
+
], {});
|
1387
1460
|
}
|
1388
1461
|
if (!get(this.attributes, ["cursors", uid])) {
|
1389
1462
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1390
1463
|
}
|
1391
|
-
this.context.safeUpdateAttributes([
|
1464
|
+
this.context.safeUpdateAttributes([
|
1465
|
+
"cursors",
|
1466
|
+
uid,
|
1467
|
+
"position"
|
1468
|
+
/* Position */
|
1469
|
+
], position);
|
1392
1470
|
}
|
1393
1471
|
updateCursorState(uid, cursorState) {
|
1394
1472
|
if (!get(this.attributes, ["cursors", uid])) {
|
1395
1473
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1396
1474
|
}
|
1397
|
-
this.context.safeUpdateAttributes([
|
1475
|
+
this.context.safeUpdateAttributes([
|
1476
|
+
"cursors",
|
1477
|
+
uid,
|
1478
|
+
"cursorState"
|
1479
|
+
/* CursorState */
|
1480
|
+
], cursorState);
|
1398
1481
|
}
|
1399
1482
|
getCursorState(uid) {
|
1400
|
-
return get(this.attributes, [
|
1483
|
+
return get(this.attributes, [
|
1484
|
+
"cursors",
|
1485
|
+
uid,
|
1486
|
+
"cursorState"
|
1487
|
+
/* CursorState */
|
1488
|
+
]);
|
1401
1489
|
}
|
1402
1490
|
cleanCursor(uid) {
|
1403
1491
|
this.context.safeUpdateAttributes(["cursors", uid], void 0);
|
1404
1492
|
}
|
1493
|
+
// TODO 状态中保存一个 SceneName 优化性能
|
1405
1494
|
setMainViewFocusPath(mainView) {
|
1406
1495
|
const scenePath = this.getMainViewScenePath();
|
1407
1496
|
if (scenePath) {
|
@@ -1849,6 +1938,7 @@ class AppProxy {
|
|
1849
1938
|
throw new Error(`[WindowManager]: app setup error: ${error.message}`);
|
1850
1939
|
}
|
1851
1940
|
}
|
1941
|
+
// 兼容移动端创建时会出现 PPT 不适配的问题
|
1852
1942
|
fixMobileSize() {
|
1853
1943
|
var _a, _b;
|
1854
1944
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(this.id);
|
@@ -1979,6 +2069,7 @@ class AppProxy {
|
|
1979
2069
|
get pageState() {
|
1980
2070
|
return this._pageState.toObject();
|
1981
2071
|
}
|
2072
|
+
// PageRemoveService
|
1982
2073
|
async removeSceneByIndex(index2) {
|
1983
2074
|
const scenePath = this._pageState.getFullPath(index2);
|
1984
2075
|
if (scenePath && this.pageState) {
|
@@ -2002,6 +2093,7 @@ class AppProxy {
|
|
2002
2093
|
this.view.focusSceneIndex = index2;
|
2003
2094
|
}
|
2004
2095
|
}
|
2096
|
+
// PageRemoveService end
|
2005
2097
|
setSceneIndex(index2) {
|
2006
2098
|
if (this.view) {
|
2007
2099
|
this.view.focusSceneIndex = index2;
|
@@ -2513,8 +2605,8 @@ const createScrollStorage = (manager) => {
|
|
2513
2605
|
defaultState: { scrollTop: 0 }
|
2514
2606
|
});
|
2515
2607
|
};
|
2516
|
-
function clamp$2(
|
2517
|
-
return
|
2608
|
+
function clamp$2(x, min, max) {
|
2609
|
+
return x < min ? min : x > max ? max : x;
|
2518
2610
|
}
|
2519
2611
|
class ScrollMode {
|
2520
2612
|
constructor(manager) {
|
@@ -3073,6 +3165,10 @@ class AppManager {
|
|
3073
3165
|
});
|
3074
3166
|
});
|
3075
3167
|
}
|
3168
|
+
/**
|
3169
|
+
* 根目录被删除时所有的 scene 都会被删除.
|
3170
|
+
* 所以需要关掉所有开启了 view 的 app
|
3171
|
+
*/
|
3076
3172
|
async onRootDirRemoved(needClose = true) {
|
3077
3173
|
await this.setMainViewScenePath(INIT_DIR);
|
3078
3174
|
this.createRootDirScenesCallback();
|
@@ -3177,6 +3273,12 @@ class AppManager {
|
|
3177
3273
|
return () => redoUndo.destroy();
|
3178
3274
|
});
|
3179
3275
|
}
|
3276
|
+
/**
|
3277
|
+
* 插件更新 apps 时的回调
|
3278
|
+
*
|
3279
|
+
* @param {*} apps
|
3280
|
+
* @memberof WindowManager
|
3281
|
+
*/
|
3180
3282
|
async _attributesUpdateCallback(apps) {
|
3181
3283
|
if (apps && WindowManager.container) {
|
3182
3284
|
const appIds = Object.keys(apps);
|
@@ -3443,6 +3545,20 @@ class AppManager {
|
|
3443
3545
|
(_a = this.scrollMode) == null ? void 0 : _a.dispose();
|
3444
3546
|
}
|
3445
3547
|
}
|
3548
|
+
/*! *****************************************************************************
|
3549
|
+
Copyright (c) Microsoft Corporation.
|
3550
|
+
|
3551
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
3552
|
+
purpose with or without fee is hereby granted.
|
3553
|
+
|
3554
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
3555
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
3556
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
3557
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
3558
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
3559
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
3560
|
+
PERFORMANCE OF THIS SOFTWARE.
|
3561
|
+
***************************************************************************** */
|
3446
3562
|
var __assign = function() {
|
3447
3563
|
__assign = Object.assign || function __assign2(t) {
|
3448
3564
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -4251,6 +4367,9 @@ function index(nodeOrSelector, props) {
|
|
4251
4367
|
var node = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
4252
4368
|
return getStyler(node, props);
|
4253
4369
|
}
|
4370
|
+
function getDefaultExportFromCjs(x) {
|
4371
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
4372
|
+
}
|
4254
4373
|
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
4255
4374
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
4256
4375
|
if (ret !== void 0) {
|
@@ -4282,6 +4401,7 @@ var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
|
4282
4401
|
}
|
4283
4402
|
return true;
|
4284
4403
|
};
|
4404
|
+
const shallowequal$1 = /* @__PURE__ */ getDefaultExportFromCjs(shallowequal);
|
4285
4405
|
var shadowStyles = /* @__PURE__ */ (() => '.tele-fancy-scrollbar {\n overscroll-behavior: contain;\n overflow: auto;\n overflow-y: scroll;\n overflow-y: overlay;\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n scrollbar-width: auto;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar {\n height: 8px;\n width: 8px;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-track {\n background-color: transparent;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb {\n background-color: rgba(68, 78, 96, 0.1);\n background-color: transparent;\n border-radius: 4px;\n transition: background-color 0.4s;\n}\n.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb {\n background-color: rgba(68, 78, 96, 0.1);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover {\n background-color: rgba(68, 78, 96, 0.2);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active {\n background-color: rgba(68, 78, 96, 0.2);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical {\n min-height: 50px;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal {\n min-width: 50px;\n}\n.telebox-quarantine {\n all: initial;\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.telebox-body-wrap {\n color: #191919;\n color: var(--tele-boxColor, #191919);\n flex: 1;\n width: 100%;\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n}\n.telebox-content {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #f9f9f9;\n background-color: var(--tele-boxContainerBackground, #f9f9f9);\n}\n.telebox-box-stage {\n position: absolute;\n z-index: 1;\n overflow: hidden;\n background-color: #fff;\n background-color: var(--tele-boxStageBackground, #fff);\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);\n box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.08));\n}\n.telebox-footer-wrap {\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n color: #191919;\n color: var(--tele-boxFooterColor, #191919);\n background-color: #fff;\n background-color: var(--tele-boxFooterBackground, #fff);\n}\n.telebox-footer-wrap::before {\n content: "";\n display: block;\n flex: 1;\n}\n.telebox-color-scheme-dark {\n color-scheme: dark;\n}\n.telebox-color-scheme-dark .telebox-body-wrap {\n color: #e9e9e9;\n color: var(--tele-boxColor, #e9e9e9);\n}\n.telebox-color-scheme-dark .telebox-content {\n background-color: #25282e;\n background-color: var(--tele-boxContainerBackground, #25282e);\n}\n.telebox-color-scheme-dark .telebox-box-stage {\n background-color: #272a30;\n background-color: var(--tele-boxStageBackground, #272a30);\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.24);\n box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.24));\n}\n.telebox-color-scheme-dark .telebox-footer-wrap {\n color: #e9e9e9;\n color: var(--tele-boxFooterColor, #e9e9e9);\n background-color: #383b42;\n background-color: var(--tele-boxFooterBackground, #383b42);\n}')();
|
4286
4406
|
var TELE_BOX_COLOR_SCHEME = /* @__PURE__ */ ((TELE_BOX_COLOR_SCHEME2) => {
|
4287
4407
|
TELE_BOX_COLOR_SCHEME2["Light"] = "light";
|
@@ -4521,7 +4641,7 @@ class TeleBox {
|
|
4521
4641
|
height = 0.5,
|
4522
4642
|
minWidth = 0,
|
4523
4643
|
minHeight = 0,
|
4524
|
-
x
|
4644
|
+
x = 0.1,
|
4525
4645
|
y = 0.1,
|
4526
4646
|
resizable = true,
|
4527
4647
|
draggable = true,
|
@@ -4580,36 +4700,36 @@ class TeleBox {
|
|
4580
4700
|
const minSize$ = new Val({
|
4581
4701
|
width: clamp(minWidth, 0, 1),
|
4582
4702
|
height: clamp(minHeight, 0, 1)
|
4583
|
-
}, { compare: shallowequal });
|
4703
|
+
}, { compare: shallowequal$1 });
|
4584
4704
|
const pxMinSize$ = combine([minSize$, managerStageRect$], ([minSize, managerStageRect]) => ({
|
4585
4705
|
width: minSize.width * managerStageRect.width,
|
4586
4706
|
height: minSize.height * managerStageRect.height
|
4587
|
-
}), { compare: shallowequal });
|
4588
|
-
const intrinsicSize$ = new Val({ width, height }, { compare: shallowequal });
|
4707
|
+
}), { compare: shallowequal$1 });
|
4708
|
+
const intrinsicSize$ = new Val({ width, height }, { compare: shallowequal$1 });
|
4589
4709
|
this._sideEffect.addDisposer(minSize$.reaction((minSize, skipUpdate) => {
|
4590
4710
|
intrinsicSize$.setValue({
|
4591
4711
|
width: Math.max(width, minSize.width),
|
4592
4712
|
height: Math.max(height, minSize.height)
|
4593
4713
|
}, skipUpdate);
|
4594
4714
|
}));
|
4595
|
-
const intrinsicCoord$ = new Val({ x
|
4715
|
+
const intrinsicCoord$ = new Val({ x, y }, { compare: shallowequal$1 });
|
4596
4716
|
const pxIntrinsicSize$ = combine([intrinsicSize$, managerStageRect$], ([size, managerStageRect]) => ({
|
4597
4717
|
width: managerStageRect.width * size.width,
|
4598
4718
|
height: managerStageRect.height * size.height
|
4599
|
-
}), { compare: shallowequal });
|
4719
|
+
}), { compare: shallowequal$1 });
|
4600
4720
|
const pxIntrinsicCoord$ = combine([intrinsicCoord$, managerStageRect$], ([intrinsicCoord, managerStageRect]) => ({
|
4601
4721
|
x: intrinsicCoord.x * managerStageRect.width,
|
4602
4722
|
y: intrinsicCoord.y * managerStageRect.height
|
4603
|
-
}), { compare: shallowequal });
|
4723
|
+
}), { compare: shallowequal$1 });
|
4604
4724
|
const bodyStyle$ = new Val(bodyStyle);
|
4605
4725
|
const stageStyle$ = new Val(stageStyle);
|
4606
4726
|
const contentRoot$ = new Val(null);
|
4607
4727
|
const bodyRect$ = new Val(managerStageRect$.value, {
|
4608
|
-
compare: shallowequal
|
4728
|
+
compare: shallowequal$1
|
4609
4729
|
});
|
4610
4730
|
const stageRatio$ = new Val(stageRatio);
|
4611
4731
|
const finalStageRatio$ = combine([stageRatio$, managerStageRatio$], ([stageRatio2, managerStageRatio]) => stageRatio2 != null ? stageRatio2 : managerStageRatio);
|
4612
|
-
const stageRect$ = combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal });
|
4732
|
+
const stageRect$ = combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal$1 });
|
4613
4733
|
const propsValConfig = {
|
4614
4734
|
darkMode: darkMode$,
|
4615
4735
|
fence: fence$,
|
@@ -4742,16 +4862,16 @@ class TeleBox {
|
|
4742
4862
|
get intrinsicHeight() {
|
4743
4863
|
return this._intrinsicSize$.value.height;
|
4744
4864
|
}
|
4745
|
-
move(
|
4865
|
+
move(x, y, skipUpdate = false) {
|
4746
4866
|
let safeX;
|
4747
4867
|
let safeY;
|
4748
4868
|
const managerStageRect = this.managerStageRect;
|
4749
4869
|
const pxIntrinsicSize = this.pxIntrinsicSize;
|
4750
4870
|
if (this.fence) {
|
4751
|
-
safeX = clamp(
|
4871
|
+
safeX = clamp(x, 0, managerStageRect.width - pxIntrinsicSize.width);
|
4752
4872
|
safeY = clamp(y, 0, managerStageRect.height - pxIntrinsicSize.height);
|
4753
4873
|
} else {
|
4754
|
-
safeX = clamp(
|
4874
|
+
safeX = clamp(x, -(pxIntrinsicSize.width - 120), 0 + managerStageRect.width - 20);
|
4755
4875
|
safeY = clamp(y, 0, 0 + managerStageRect.height - 20);
|
4756
4876
|
}
|
4757
4877
|
this._intrinsicCoord$.setValue({
|
@@ -4759,7 +4879,7 @@ class TeleBox {
|
|
4759
4879
|
y: safeY / managerStageRect.height
|
4760
4880
|
}, skipUpdate);
|
4761
4881
|
}
|
4762
|
-
transform(
|
4882
|
+
transform(x, y, width, height, skipUpdate = false) {
|
4763
4883
|
const managerStageRect = this.managerStageRect;
|
4764
4884
|
width = Math.max(width, this.pxMinSize.width);
|
4765
4885
|
height = Math.max(height, this.pxMinSize.height);
|
@@ -4774,7 +4894,7 @@ class TeleBox {
|
|
4774
4894
|
y = 0;
|
4775
4895
|
height = this.pxIntrinsicSize.height;
|
4776
4896
|
}
|
4777
|
-
this.move(
|
4897
|
+
this.move(x, y, skipUpdate);
|
4778
4898
|
this._intrinsicSize$.setValue({
|
4779
4899
|
width: width / managerStageRect.width,
|
4780
4900
|
height: height / managerStageRect.height
|
@@ -4919,7 +5039,7 @@ class TeleBox {
|
|
4919
5039
|
styles.scaleY = collectorRect.height / boxHeight;
|
4920
5040
|
}
|
4921
5041
|
return styles;
|
4922
|
-
}, { compare: shallowequal });
|
5042
|
+
}, { compare: shallowequal$1 });
|
4923
5043
|
const boxStyles = boxStyles$.value;
|
4924
5044
|
this.$box.style.width = boxStyles.width + "px";
|
4925
5045
|
this.$box.style.height = boxStyles.height + "px";
|
@@ -5233,10 +5353,10 @@ class TeleBoxCollector {
|
|
5233
5353
|
}),
|
5234
5354
|
minimized$.subscribe((minimized) => {
|
5235
5355
|
if (minimized) {
|
5236
|
-
const { x
|
5356
|
+
const { x, y, width, height } = $collector.getBoundingClientRect();
|
5237
5357
|
const rootRect = root.getBoundingClientRect();
|
5238
5358
|
rect$.setValue({
|
5239
|
-
x:
|
5359
|
+
x: x - rootRect.x,
|
5240
5360
|
y: y - rootRect.y,
|
5241
5361
|
width,
|
5242
5362
|
height
|
@@ -5403,7 +5523,7 @@ class TeleBoxManager {
|
|
5403
5523
|
y: 0,
|
5404
5524
|
width: window.innerWidth,
|
5405
5525
|
height: window.innerHeight
|
5406
|
-
}, { compare: shallowequal });
|
5526
|
+
}, { compare: shallowequal$1 });
|
5407
5527
|
this._sideEffect.addDisposer(root$.subscribe((root2) => {
|
5408
5528
|
this._sideEffect.add(() => {
|
5409
5529
|
if (!root2) {
|
@@ -5423,7 +5543,7 @@ class TeleBoxManager {
|
|
5423
5543
|
}, "calc-root-rect");
|
5424
5544
|
}));
|
5425
5545
|
const stageRect$ = combine([rootRect$, stageRatio$], calcStageRect, {
|
5426
|
-
compare: shallowequal
|
5546
|
+
compare: shallowequal$1
|
5427
5547
|
});
|
5428
5548
|
this.boxes$ = new Val([]);
|
5429
5549
|
this.topBox$ = new Val(void 0);
|
@@ -5461,7 +5581,7 @@ class TeleBoxManager {
|
|
5461
5581
|
const darkMode$ = combine([prefersDark$, prefersColorScheme$], ([prefersDark, prefersColorScheme2]) => prefersColorScheme2 === "auto" ? prefersDark : prefersColorScheme2 === "dark");
|
5462
5582
|
const state$ = combine([minimized$, maximized$], ([minimized2, maximized2]) => minimized2 ? TELE_BOX_STATE.Minimized : maximized2 ? TELE_BOX_STATE.Maximized : TELE_BOX_STATE.Normal);
|
5463
5583
|
const theme$ = new Val(theme, {
|
5464
|
-
compare: shallowequal
|
5584
|
+
compare: shallowequal$1
|
5465
5585
|
});
|
5466
5586
|
const readonlyValConfig = {
|
5467
5587
|
darkMode: darkMode$,
|
@@ -5880,11 +6000,11 @@ class TeleBoxManager {
|
|
5880
6000
|
}
|
5881
6001
|
}
|
5882
6002
|
smartPosition(rect) {
|
5883
|
-
let { x
|
6003
|
+
let { x, y } = rect;
|
5884
6004
|
const { width = 0.5, height = 0.5 } = rect;
|
5885
6005
|
const stageRect = this.stageRect;
|
5886
6006
|
const topBox = this.topBox;
|
5887
|
-
if (
|
6007
|
+
if (x == null) {
|
5888
6008
|
let pxX = 20;
|
5889
6009
|
if (topBox) {
|
5890
6010
|
const pxPreferredX = topBox.pxIntrinsicCoord.x + 20;
|
@@ -5893,7 +6013,7 @@ class TeleBoxManager {
|
|
5893
6013
|
pxX = pxPreferredX;
|
5894
6014
|
}
|
5895
6015
|
}
|
5896
|
-
|
6016
|
+
x = pxX / stageRect.width;
|
5897
6017
|
}
|
5898
6018
|
if (y == null) {
|
5899
6019
|
let pxY = 20;
|
@@ -5906,7 +6026,7 @@ class TeleBoxManager {
|
|
5906
6026
|
}
|
5907
6027
|
y = pxY / stageRect.height;
|
5908
6028
|
}
|
5909
|
-
return { x
|
6029
|
+
return { x, y, width, height };
|
5910
6030
|
}
|
5911
6031
|
makeBoxTop(box, skipUpdate = false) {
|
5912
6032
|
if (this.topBox) {
|
@@ -5957,6 +6077,10 @@ class BoxManager {
|
|
5957
6077
|
const { emitter: emitter2, callbacks: callbacks2, boxEmitter: boxEmitter2 } = context;
|
5958
6078
|
this.teleBoxManager = this.setupBoxManager(createTeleBoxManagerConfig);
|
5959
6079
|
this.sideEffectManager.add(() => [
|
6080
|
+
this.teleBoxManager.onValChanged("rootRect", (rect) => {
|
6081
|
+
emitter2.emit("playgroundSizeChange", rect);
|
6082
|
+
}),
|
6083
|
+
// 使用 _xxx$.reaction 订阅修改的值, 不管有没有 skipUpdate, 修改值都会触发回调
|
5960
6084
|
this.teleBoxManager.onValChanged("state", (state) => {
|
5961
6085
|
callbacks2.emit("boxStateChange", state);
|
5962
6086
|
emitter2.emit("boxStateChange", state);
|
@@ -6173,10 +6297,10 @@ class BoxManager {
|
|
6173
6297
|
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
6174
6298
|
}
|
6175
6299
|
}
|
6176
|
-
moveBox({ appId, x
|
6300
|
+
moveBox({ appId, x, y }) {
|
6177
6301
|
const box = this.getBox(appId);
|
6178
6302
|
if (box) {
|
6179
|
-
box._intrinsicCoord$.setValue({ x
|
6303
|
+
box._intrinsicCoord$.setValue({ x, y }, true);
|
6180
6304
|
}
|
6181
6305
|
}
|
6182
6306
|
focusBox({ appId }, skipUpdate = true) {
|
@@ -6275,6 +6399,9 @@ function src_url_equal(element_src, url) {
|
|
6275
6399
|
function is_empty(obj) {
|
6276
6400
|
return Object.keys(obj).length === 0;
|
6277
6401
|
}
|
6402
|
+
/* @__PURE__ */ new Set();
|
6403
|
+
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
6404
|
+
"WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
6278
6405
|
function append(target, node) {
|
6279
6406
|
target.appendChild(node);
|
6280
6407
|
}
|
@@ -6306,25 +6433,27 @@ function children(element2) {
|
|
6306
6433
|
}
|
6307
6434
|
function set_data(text2, data) {
|
6308
6435
|
data = "" + data;
|
6309
|
-
if (text2.
|
6310
|
-
|
6436
|
+
if (text2.data === data)
|
6437
|
+
return;
|
6438
|
+
text2.data = data;
|
6311
6439
|
}
|
6312
6440
|
function set_style(node, key, value, important) {
|
6313
|
-
if (value
|
6441
|
+
if (value == null) {
|
6314
6442
|
node.style.removeProperty(key);
|
6315
6443
|
} else {
|
6316
6444
|
node.style.setProperty(key, value, important ? "important" : "");
|
6317
6445
|
}
|
6318
6446
|
}
|
6447
|
+
/* @__PURE__ */ new Map();
|
6319
6448
|
let current_component;
|
6320
6449
|
function set_current_component(component) {
|
6321
6450
|
current_component = component;
|
6322
6451
|
}
|
6323
6452
|
const dirty_components = [];
|
6324
6453
|
const binding_callbacks = [];
|
6325
|
-
|
6454
|
+
let render_callbacks = [];
|
6326
6455
|
const flush_callbacks = [];
|
6327
|
-
const resolved_promise = Promise.resolve();
|
6456
|
+
const resolved_promise = /* @__PURE__ */ Promise.resolve();
|
6328
6457
|
let update_scheduled = false;
|
6329
6458
|
function schedule_update() {
|
6330
6459
|
if (!update_scheduled) {
|
@@ -6338,13 +6467,22 @@ function add_render_callback(fn) {
|
|
6338
6467
|
const seen_callbacks = /* @__PURE__ */ new Set();
|
6339
6468
|
let flushidx = 0;
|
6340
6469
|
function flush() {
|
6470
|
+
if (flushidx !== 0) {
|
6471
|
+
return;
|
6472
|
+
}
|
6341
6473
|
const saved_component = current_component;
|
6342
6474
|
do {
|
6343
|
-
|
6344
|
-
|
6345
|
-
|
6346
|
-
|
6347
|
-
|
6475
|
+
try {
|
6476
|
+
while (flushidx < dirty_components.length) {
|
6477
|
+
const component = dirty_components[flushidx];
|
6478
|
+
flushidx++;
|
6479
|
+
set_current_component(component);
|
6480
|
+
update(component.$$);
|
6481
|
+
}
|
6482
|
+
} catch (e) {
|
6483
|
+
dirty_components.length = 0;
|
6484
|
+
flushidx = 0;
|
6485
|
+
throw e;
|
6348
6486
|
}
|
6349
6487
|
set_current_component(null);
|
6350
6488
|
dirty_components.length = 0;
|
@@ -6377,6 +6515,13 @@ function update($$) {
|
|
6377
6515
|
$$.after_update.forEach(add_render_callback);
|
6378
6516
|
}
|
6379
6517
|
}
|
6518
|
+
function flush_render_callbacks(fns) {
|
6519
|
+
const filtered = [];
|
6520
|
+
const targets = [];
|
6521
|
+
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
6522
|
+
targets.forEach((c) => c());
|
6523
|
+
render_callbacks = filtered;
|
6524
|
+
}
|
6380
6525
|
const outroing = /* @__PURE__ */ new Set();
|
6381
6526
|
function transition_in(block, local) {
|
6382
6527
|
if (block && block.i) {
|
@@ -6384,6 +6529,34 @@ function transition_in(block, local) {
|
|
6384
6529
|
block.i(local);
|
6385
6530
|
}
|
6386
6531
|
}
|
6532
|
+
const _boolean_attributes = [
|
6533
|
+
"allowfullscreen",
|
6534
|
+
"allowpaymentrequest",
|
6535
|
+
"async",
|
6536
|
+
"autofocus",
|
6537
|
+
"autoplay",
|
6538
|
+
"checked",
|
6539
|
+
"controls",
|
6540
|
+
"default",
|
6541
|
+
"defer",
|
6542
|
+
"disabled",
|
6543
|
+
"formnovalidate",
|
6544
|
+
"hidden",
|
6545
|
+
"inert",
|
6546
|
+
"ismap",
|
6547
|
+
"loop",
|
6548
|
+
"multiple",
|
6549
|
+
"muted",
|
6550
|
+
"nomodule",
|
6551
|
+
"novalidate",
|
6552
|
+
"open",
|
6553
|
+
"playsinline",
|
6554
|
+
"readonly",
|
6555
|
+
"required",
|
6556
|
+
"reversed",
|
6557
|
+
"selected"
|
6558
|
+
];
|
6559
|
+
/* @__PURE__ */ new Set([..._boolean_attributes]);
|
6387
6560
|
function mount_component(component, target, anchor, customElement) {
|
6388
6561
|
const { fragment, after_update } = component.$$;
|
6389
6562
|
fragment && fragment.m(target, anchor);
|
@@ -6403,6 +6576,7 @@ function mount_component(component, target, anchor, customElement) {
|
|
6403
6576
|
function destroy_component(component, detaching) {
|
6404
6577
|
const $$ = component.$$;
|
6405
6578
|
if ($$.fragment !== null) {
|
6579
|
+
flush_render_callbacks($$.after_update);
|
6406
6580
|
run_all($$.on_destroy);
|
6407
6581
|
$$.fragment && $$.fragment.d(detaching);
|
6408
6582
|
$$.on_destroy = $$.fragment = null;
|
@@ -6423,16 +6597,19 @@ function init(component, options, instance2, create_fragment2, not_equal, props,
|
|
6423
6597
|
const $$ = component.$$ = {
|
6424
6598
|
fragment: null,
|
6425
6599
|
ctx: [],
|
6600
|
+
// state
|
6426
6601
|
props,
|
6427
6602
|
update: noop,
|
6428
6603
|
not_equal,
|
6429
6604
|
bound: blank_object(),
|
6605
|
+
// lifecycle
|
6430
6606
|
on_mount: [],
|
6431
6607
|
on_destroy: [],
|
6432
6608
|
on_disconnect: [],
|
6433
6609
|
before_update: [],
|
6434
6610
|
after_update: [],
|
6435
6611
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
6612
|
+
// everything else
|
6436
6613
|
callbacks: blank_object(),
|
6437
6614
|
dirty,
|
6438
6615
|
skip_bound: false,
|
@@ -6502,8 +6679,14 @@ function create_if_block(ctx) {
|
|
6502
6679
|
let t1;
|
6503
6680
|
let t2;
|
6504
6681
|
let div1_class_value;
|
6505
|
-
let if_block0 =
|
6506
|
-
|
6682
|
+
let if_block0 = (
|
6683
|
+
/*hasAvatar*/
|
6684
|
+
ctx[16] && create_if_block_2(ctx)
|
6685
|
+
);
|
6686
|
+
let if_block1 = (
|
6687
|
+
/*hasTagName*/
|
6688
|
+
ctx[17] && create_if_block_1(ctx)
|
6689
|
+
);
|
6507
6690
|
return {
|
6508
6691
|
c() {
|
6509
6692
|
div1 = element("div");
|
@@ -6512,7 +6695,10 @@ function create_if_block(ctx) {
|
|
6512
6695
|
if_block0.c();
|
6513
6696
|
t0 = space();
|
6514
6697
|
span = element("span");
|
6515
|
-
t1 = text$1(
|
6698
|
+
t1 = text$1(
|
6699
|
+
/*cursorName*/
|
6700
|
+
ctx[0]
|
6701
|
+
);
|
6516
6702
|
t2 = space();
|
6517
6703
|
if (if_block1)
|
6518
6704
|
if_block1.c();
|
@@ -6520,11 +6706,33 @@ function create_if_block(ctx) {
|
|
6520
6706
|
set_style(span, "white-space", "nowrap");
|
6521
6707
|
set_style(span, "text-overflow", "ellipsis");
|
6522
6708
|
set_style(span, "max-width", "80px");
|
6523
|
-
attr(
|
6524
|
-
|
6525
|
-
|
6526
|
-
|
6527
|
-
|
6709
|
+
attr(
|
6710
|
+
div0,
|
6711
|
+
"class",
|
6712
|
+
/*theme*/
|
6713
|
+
ctx[8]
|
6714
|
+
);
|
6715
|
+
set_style(
|
6716
|
+
div0,
|
6717
|
+
"background-color",
|
6718
|
+
/*backgroundColor*/
|
6719
|
+
ctx[2]
|
6720
|
+
);
|
6721
|
+
set_style(
|
6722
|
+
div0,
|
6723
|
+
"color",
|
6724
|
+
/*color*/
|
6725
|
+
ctx[9]
|
6726
|
+
);
|
6727
|
+
set_style(
|
6728
|
+
div0,
|
6729
|
+
"opacity",
|
6730
|
+
/*opacity*/
|
6731
|
+
ctx[11]
|
6732
|
+
);
|
6733
|
+
attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6734
|
+
ctx[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6735
|
+
ctx[13]);
|
6528
6736
|
},
|
6529
6737
|
m(target, anchor) {
|
6530
6738
|
insert(target, div1, anchor);
|
@@ -6539,7 +6747,10 @@ function create_if_block(ctx) {
|
|
6539
6747
|
if_block1.m(div0, null);
|
6540
6748
|
},
|
6541
6749
|
p(ctx2, dirty) {
|
6542
|
-
if (
|
6750
|
+
if (
|
6751
|
+
/*hasAvatar*/
|
6752
|
+
ctx2[16]
|
6753
|
+
) {
|
6543
6754
|
if (if_block0) {
|
6544
6755
|
if_block0.p(ctx2, dirty);
|
6545
6756
|
} else {
|
@@ -6551,9 +6762,17 @@ function create_if_block(ctx) {
|
|
6551
6762
|
if_block0.d(1);
|
6552
6763
|
if_block0 = null;
|
6553
6764
|
}
|
6554
|
-
if (dirty &
|
6555
|
-
|
6556
|
-
|
6765
|
+
if (dirty & /*cursorName*/
|
6766
|
+
1)
|
6767
|
+
set_data(
|
6768
|
+
t1,
|
6769
|
+
/*cursorName*/
|
6770
|
+
ctx2[0]
|
6771
|
+
);
|
6772
|
+
if (
|
6773
|
+
/*hasTagName*/
|
6774
|
+
ctx2[17]
|
6775
|
+
) {
|
6557
6776
|
if (if_block1) {
|
6558
6777
|
if_block1.p(ctx2, dirty);
|
6559
6778
|
} else {
|
@@ -6565,19 +6784,46 @@ function create_if_block(ctx) {
|
|
6565
6784
|
if_block1.d(1);
|
6566
6785
|
if_block1 = null;
|
6567
6786
|
}
|
6568
|
-
if (dirty &
|
6569
|
-
|
6787
|
+
if (dirty & /*theme*/
|
6788
|
+
256) {
|
6789
|
+
attr(
|
6790
|
+
div0,
|
6791
|
+
"class",
|
6792
|
+
/*theme*/
|
6793
|
+
ctx2[8]
|
6794
|
+
);
|
6570
6795
|
}
|
6571
|
-
if (dirty &
|
6572
|
-
|
6796
|
+
if (dirty & /*backgroundColor*/
|
6797
|
+
4) {
|
6798
|
+
set_style(
|
6799
|
+
div0,
|
6800
|
+
"background-color",
|
6801
|
+
/*backgroundColor*/
|
6802
|
+
ctx2[2]
|
6803
|
+
);
|
6573
6804
|
}
|
6574
|
-
if (dirty &
|
6575
|
-
|
6805
|
+
if (dirty & /*color*/
|
6806
|
+
512) {
|
6807
|
+
set_style(
|
6808
|
+
div0,
|
6809
|
+
"color",
|
6810
|
+
/*color*/
|
6811
|
+
ctx2[9]
|
6812
|
+
);
|
6576
6813
|
}
|
6577
|
-
if (dirty &
|
6578
|
-
|
6814
|
+
if (dirty & /*opacity*/
|
6815
|
+
2048) {
|
6816
|
+
set_style(
|
6817
|
+
div0,
|
6818
|
+
"opacity",
|
6819
|
+
/*opacity*/
|
6820
|
+
ctx2[11]
|
6821
|
+
);
|
6579
6822
|
}
|
6580
|
-
if (dirty &
|
6823
|
+
if (dirty & /*offset, pencilEraserSize3ImageOffset*/
|
6824
|
+
24576 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6825
|
+
ctx2[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6826
|
+
ctx2[13])) {
|
6581
6827
|
attr(div1, "class", div1_class_value);
|
6582
6828
|
}
|
6583
6829
|
},
|
@@ -6598,8 +6844,14 @@ function create_if_block_2(ctx) {
|
|
6598
6844
|
c() {
|
6599
6845
|
img = element("img");
|
6600
6846
|
attr(img, "class", "netless-window-manager-cursor-selector-avatar");
|
6601
|
-
attr(
|
6602
|
-
|
6847
|
+
attr(
|
6848
|
+
img,
|
6849
|
+
"style",
|
6850
|
+
/*computedAvatarStyle*/
|
6851
|
+
ctx[18]()
|
6852
|
+
);
|
6853
|
+
if (!src_url_equal(img.src, img_src_value = /*avatar*/
|
6854
|
+
ctx[7]))
|
6603
6855
|
attr(img, "src", img_src_value);
|
6604
6856
|
attr(img, "alt", "avatar");
|
6605
6857
|
},
|
@@ -6607,7 +6859,9 @@ function create_if_block_2(ctx) {
|
|
6607
6859
|
insert(target, img, anchor);
|
6608
6860
|
},
|
6609
6861
|
p(ctx2, dirty) {
|
6610
|
-
if (dirty &
|
6862
|
+
if (dirty & /*avatar*/
|
6863
|
+
128 && !src_url_equal(img.src, img_src_value = /*avatar*/
|
6864
|
+
ctx2[7])) {
|
6611
6865
|
attr(img, "src", img_src_value);
|
6612
6866
|
}
|
6613
6867
|
},
|
@@ -6623,19 +6877,38 @@ function create_if_block_1(ctx) {
|
|
6623
6877
|
return {
|
6624
6878
|
c() {
|
6625
6879
|
span = element("span");
|
6626
|
-
t = text$1(
|
6880
|
+
t = text$1(
|
6881
|
+
/*tagName*/
|
6882
|
+
ctx[1]
|
6883
|
+
);
|
6627
6884
|
attr(span, "class", "netless-window-manager-cursor-tag-name");
|
6628
|
-
set_style(
|
6885
|
+
set_style(
|
6886
|
+
span,
|
6887
|
+
"background-color",
|
6888
|
+
/*cursorTagBackgroundColor*/
|
6889
|
+
ctx[10]
|
6890
|
+
);
|
6629
6891
|
},
|
6630
6892
|
m(target, anchor) {
|
6631
6893
|
insert(target, span, anchor);
|
6632
6894
|
append(span, t);
|
6633
6895
|
},
|
6634
6896
|
p(ctx2, dirty) {
|
6635
|
-
if (dirty &
|
6636
|
-
|
6637
|
-
|
6638
|
-
|
6897
|
+
if (dirty & /*tagName*/
|
6898
|
+
2)
|
6899
|
+
set_data(
|
6900
|
+
t,
|
6901
|
+
/*tagName*/
|
6902
|
+
ctx2[1]
|
6903
|
+
);
|
6904
|
+
if (dirty & /*cursorTagBackgroundColor*/
|
6905
|
+
1024) {
|
6906
|
+
set_style(
|
6907
|
+
span,
|
6908
|
+
"background-color",
|
6909
|
+
/*cursorTagBackgroundColor*/
|
6910
|
+
ctx2[10]
|
6911
|
+
);
|
6639
6912
|
}
|
6640
6913
|
},
|
6641
6914
|
d(detaching) {
|
@@ -6651,7 +6924,8 @@ function create_fragment(ctx) {
|
|
6651
6924
|
let img;
|
6652
6925
|
let img_class_value;
|
6653
6926
|
let img_src_value;
|
6654
|
-
let if_block =
|
6927
|
+
let if_block = !/*isLaserPointer*/
|
6928
|
+
ctx[12] && create_if_block(ctx);
|
6655
6929
|
return {
|
6656
6930
|
c() {
|
6657
6931
|
div1 = element("div");
|
@@ -6660,14 +6934,29 @@ function create_fragment(ctx) {
|
|
6660
6934
|
t = space();
|
6661
6935
|
div0 = element("div");
|
6662
6936
|
img = element("img");
|
6663
|
-
attr(img, "class", img_class_value = "netless-window-manager-cursor-" +
|
6664
|
-
|
6937
|
+
attr(img, "class", img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6938
|
+
ctx[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6939
|
+
ctx[13]);
|
6940
|
+
if (!src_url_equal(img.src, img_src_value = /*src*/
|
6941
|
+
ctx[6]))
|
6665
6942
|
attr(img, "src", img_src_value);
|
6666
|
-
attr(
|
6943
|
+
attr(
|
6944
|
+
img,
|
6945
|
+
"alt",
|
6946
|
+
/*appliance*/
|
6947
|
+
ctx[3]
|
6948
|
+
);
|
6667
6949
|
attr(div0, "class", "cursor-image-wrapper");
|
6668
6950
|
attr(div1, "class", "netless-window-manager-cursor-mid");
|
6669
|
-
set_style(div1, "transform", "translateX(" +
|
6670
|
-
|
6951
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
6952
|
+
ctx[4] + "px) translateY(" + /*y*/
|
6953
|
+
ctx[5] + "px)");
|
6954
|
+
set_style(
|
6955
|
+
div1,
|
6956
|
+
"display",
|
6957
|
+
/*display*/
|
6958
|
+
ctx[15]
|
6959
|
+
);
|
6671
6960
|
},
|
6672
6961
|
m(target, anchor) {
|
6673
6962
|
insert(target, div1, anchor);
|
@@ -6678,7 +6967,8 @@ function create_fragment(ctx) {
|
|
6678
6967
|
append(div0, img);
|
6679
6968
|
},
|
6680
6969
|
p(ctx2, [dirty]) {
|
6681
|
-
if (
|
6970
|
+
if (!/*isLaserPointer*/
|
6971
|
+
ctx2[12]) {
|
6682
6972
|
if (if_block) {
|
6683
6973
|
if_block.p(ctx2, dirty);
|
6684
6974
|
} else {
|
@@ -6690,20 +6980,40 @@ function create_fragment(ctx) {
|
|
6690
6980
|
if_block.d(1);
|
6691
6981
|
if_block = null;
|
6692
6982
|
}
|
6693
|
-
if (dirty &
|
6983
|
+
if (dirty & /*appliance, pencilEraserSize3ImageOffset*/
|
6984
|
+
8200 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6985
|
+
ctx2[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6986
|
+
ctx2[13])) {
|
6694
6987
|
attr(img, "class", img_class_value);
|
6695
6988
|
}
|
6696
|
-
if (dirty &
|
6989
|
+
if (dirty & /*src*/
|
6990
|
+
64 && !src_url_equal(img.src, img_src_value = /*src*/
|
6991
|
+
ctx2[6])) {
|
6697
6992
|
attr(img, "src", img_src_value);
|
6698
6993
|
}
|
6699
|
-
if (dirty &
|
6700
|
-
|
6701
|
-
|
6702
|
-
|
6703
|
-
|
6994
|
+
if (dirty & /*appliance*/
|
6995
|
+
8) {
|
6996
|
+
attr(
|
6997
|
+
img,
|
6998
|
+
"alt",
|
6999
|
+
/*appliance*/
|
7000
|
+
ctx2[3]
|
7001
|
+
);
|
6704
7002
|
}
|
6705
|
-
if (dirty &
|
6706
|
-
|
7003
|
+
if (dirty & /*x, y*/
|
7004
|
+
48) {
|
7005
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
7006
|
+
ctx2[4] + "px) translateY(" + /*y*/
|
7007
|
+
ctx2[5] + "px)");
|
7008
|
+
}
|
7009
|
+
if (dirty & /*display*/
|
7010
|
+
32768) {
|
7011
|
+
set_style(
|
7012
|
+
div1,
|
7013
|
+
"display",
|
7014
|
+
/*display*/
|
7015
|
+
ctx2[15]
|
7016
|
+
);
|
6707
7017
|
}
|
6708
7018
|
},
|
6709
7019
|
i: noop,
|
@@ -6729,7 +7039,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6729
7039
|
let { tagName } = $$props;
|
6730
7040
|
let { backgroundColor } = $$props;
|
6731
7041
|
let { appliance } = $$props;
|
6732
|
-
let { x
|
7042
|
+
let { x } = $$props;
|
6733
7043
|
let { y } = $$props;
|
6734
7044
|
let { src } = $$props;
|
6735
7045
|
let { visible } = $$props;
|
@@ -6758,7 +7068,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6758
7068
|
if ("appliance" in $$props2)
|
6759
7069
|
$$invalidate(3, appliance = $$props2.appliance);
|
6760
7070
|
if ("x" in $$props2)
|
6761
|
-
$$invalidate(4,
|
7071
|
+
$$invalidate(4, x = $$props2.x);
|
6762
7072
|
if ("y" in $$props2)
|
6763
7073
|
$$invalidate(5, y = $$props2.y);
|
6764
7074
|
if ("src" in $$props2)
|
@@ -6779,28 +7089,36 @@ function instance($$self, $$props, $$invalidate) {
|
|
6779
7089
|
$$invalidate(20, pencilEraserSize = $$props2.pencilEraserSize);
|
6780
7090
|
};
|
6781
7091
|
$$self.$$.update = () => {
|
6782
|
-
if ($$self.$$.dirty &
|
7092
|
+
if ($$self.$$.dirty & /*cursorName*/
|
7093
|
+
1) {
|
6783
7094
|
hasName = !isEmpty(cursorName);
|
6784
7095
|
}
|
6785
|
-
if ($$self.$$.dirty &
|
7096
|
+
if ($$self.$$.dirty & /*tagName*/
|
7097
|
+
2) {
|
6786
7098
|
$$invalidate(17, hasTagName = !isEmpty(tagName));
|
6787
7099
|
}
|
6788
|
-
if ($$self.$$.dirty &
|
7100
|
+
if ($$self.$$.dirty & /*avatar*/
|
7101
|
+
128) {
|
6789
7102
|
$$invalidate(16, hasAvatar = !isEmpty(avatar));
|
6790
7103
|
}
|
6791
|
-
if ($$self.$$.dirty &
|
7104
|
+
if ($$self.$$.dirty & /*visible*/
|
7105
|
+
524288) {
|
6792
7106
|
$$invalidate(15, display = visible ? "initial" : "none");
|
6793
7107
|
}
|
6794
|
-
if ($$self.$$.dirty &
|
7108
|
+
if ($$self.$$.dirty & /*appliance*/
|
7109
|
+
8) {
|
6795
7110
|
$$invalidate(12, isLaserPointer = appliance === ApplianceNames.laserPointer);
|
6796
7111
|
}
|
6797
|
-
if ($$self.$$.dirty &
|
7112
|
+
if ($$self.$$.dirty & /*isLaserPointer, appliance*/
|
7113
|
+
4104) {
|
6798
7114
|
$$invalidate(21, isLaserPointerPencilEraser = isLaserPointer || appliance === ApplianceNames.pencilEraser);
|
6799
7115
|
}
|
6800
|
-
if ($$self.$$.dirty &
|
7116
|
+
if ($$self.$$.dirty & /*isLaserPointerPencilEraser*/
|
7117
|
+
2097152) {
|
6801
7118
|
$$invalidate(14, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
|
6802
7119
|
}
|
6803
|
-
if ($$self.$$.dirty &
|
7120
|
+
if ($$self.$$.dirty & /*pencilEraserSize*/
|
7121
|
+
1048576) {
|
6804
7122
|
$$invalidate(13, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
|
6805
7123
|
}
|
6806
7124
|
};
|
@@ -6809,7 +7127,7 @@ function instance($$self, $$props, $$invalidate) {
|
|
6809
7127
|
tagName,
|
6810
7128
|
backgroundColor,
|
6811
7129
|
appliance,
|
6812
|
-
|
7130
|
+
x,
|
6813
7131
|
y,
|
6814
7132
|
src,
|
6815
7133
|
avatar,
|
@@ -6883,8 +7201,8 @@ class Cursor2 {
|
|
6883
7201
|
}
|
6884
7202
|
moveCursor(cursor, rect, view) {
|
6885
7203
|
var _a, _b;
|
6886
|
-
const { x
|
6887
|
-
const point = view == null ? void 0 : view.screen.convertPointToScreen(
|
7204
|
+
const { x, y, type } = cursor;
|
7205
|
+
const point = view == null ? void 0 : view.screen.convertPointToScreen(x, y);
|
6888
7206
|
if (point) {
|
6889
7207
|
let translateX = point.x - 2;
|
6890
7208
|
let translateY = point.y - 18;
|
@@ -8208,11 +8526,11 @@ let Y$1 = class Y {
|
|
8208
8526
|
sideEffect: s,
|
8209
8527
|
readonly$: i,
|
8210
8528
|
events: r,
|
8211
|
-
wrapClassName:
|
8529
|
+
wrapClassName: n,
|
8212
8530
|
root: l,
|
8213
8531
|
pagesIndex$: p
|
8214
8532
|
}) {
|
8215
|
-
this.showPreview$ = new Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName =
|
8533
|
+
this.showPreview$ = new Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = n, this.sideEffect.addDisposer(
|
8216
8534
|
this.events.on("togglePreview", () => {
|
8217
8535
|
this.showPreview$.setValue(!this.showPreview$.value);
|
8218
8536
|
})
|
@@ -8222,11 +8540,11 @@ let Y$1 = class Y {
|
|
8222
8540
|
const c = this.renderPreview(), u = this.renderPreviewMask();
|
8223
8541
|
if (a) {
|
8224
8542
|
l.appendChild(c), l.appendChild(u), c.scrollTop;
|
8225
|
-
const
|
8543
|
+
const o2 = c.querySelector(
|
8226
8544
|
"." + this.wrapClassName(`preview-page-${p.value}`)
|
8227
8545
|
);
|
8228
|
-
return
|
8229
|
-
top:
|
8546
|
+
return o2 && c.scrollTo({
|
8547
|
+
top: o2.offsetTop - 16
|
8230
8548
|
}), c.classList.toggle(this.wrapClassName("preview-active"), true), this.previewLazyLoad = new LazyLoad({
|
8231
8549
|
container: this.$preview,
|
8232
8550
|
elements_selector: "." + this.wrapClassName("preview-page>img")
|
@@ -8260,14 +8578,14 @@ let Y$1 = class Y {
|
|
8260
8578
|
this.pages$.subscribe((t) => {
|
8261
8579
|
var s;
|
8262
8580
|
this.sideEffect.add(() => {
|
8263
|
-
const i = t.map((r,
|
8581
|
+
const i = t.map((r, n) => {
|
8264
8582
|
const l = r.thumbnail ?? (r.src.startsWith("ppt") ? void 0 : r.src);
|
8265
8583
|
if (!l)
|
8266
8584
|
return;
|
8267
|
-
const p = String(
|
8268
|
-
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${
|
8585
|
+
const p = String(n), a = document.createElement("a");
|
8586
|
+
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${n}`), a.setAttribute("href", "#"), a.dataset.pageIndex = p;
|
8269
8587
|
const c = document.createElement("span");
|
8270
|
-
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(
|
8588
|
+
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(n + 1), c.dataset.pageIndex = p;
|
8271
8589
|
const u = document.createElement("img");
|
8272
8590
|
return u.width = r.width, u.height = r.height, u.dataset.src = l, u.dataset.pageIndex = p, a.appendChild(u), a.appendChild(c), e.appendChild(a), a;
|
8273
8591
|
});
|
@@ -8336,7 +8654,7 @@ function q$1(h2) {
|
|
8336
8654
|
"M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"
|
8337
8655
|
), t.appendChild(s), t;
|
8338
8656
|
}
|
8339
|
-
function
|
8657
|
+
function X$1(h2) {
|
8340
8658
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8341
8659
|
t.setAttribute("class", `${h2}-footer-icon-save`), t.setAttribute("viewBox", "0 0 448 512");
|
8342
8660
|
const s = document.createElementNS(e, "path");
|
@@ -8345,7 +8663,7 @@ function J$1(h2) {
|
|
8345
8663
|
"M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z"
|
8346
8664
|
), t.appendChild(s), t;
|
8347
8665
|
}
|
8348
|
-
function
|
8666
|
+
function J$1(h2) {
|
8349
8667
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8350
8668
|
t.setAttribute("class", `${h2}-footer-icon-spinner`), t.setAttribute("viewBox", "0 0 512 512");
|
8351
8669
|
const s = document.createElementNS(e, "path");
|
@@ -8365,12 +8683,12 @@ let K$1 = class K {
|
|
8365
8683
|
sideEffect: s,
|
8366
8684
|
readonly$: i,
|
8367
8685
|
events: r,
|
8368
|
-
playable:
|
8686
|
+
playable: n,
|
8369
8687
|
wrapClassName: l,
|
8370
8688
|
pagesIndex$: p,
|
8371
8689
|
root: a
|
8372
8690
|
}) {
|
8373
|
-
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable =
|
8691
|
+
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable = n, this.$footer = this.render(), a.appendChild(this.$footer);
|
8374
8692
|
}
|
8375
8693
|
destroy() {
|
8376
8694
|
this.$footer.remove();
|
@@ -8379,15 +8697,15 @@ let K$1 = class K {
|
|
8379
8697
|
const e = document.createElement("div");
|
8380
8698
|
e.className = this.wrapClassName("footer"), this.sideEffect.addDisposer(
|
8381
8699
|
this.readonly$.subscribe(
|
8382
|
-
(
|
8700
|
+
(o2) => e.classList.toggle(this.wrapClassName("readonly"), o2)
|
8383
8701
|
)
|
8384
8702
|
);
|
8385
8703
|
const t = this.renderFooterBtn("btn-sidebar", W$1(this.namespace));
|
8386
8704
|
this.sideEffect.addEventListener(t, "click", () => {
|
8387
8705
|
this.readonly$.value || this.events.emit("togglePreview");
|
8388
8706
|
}), e.appendChild(t), this.sideEffect.addDisposer(
|
8389
|
-
this.pages$.subscribe((
|
8390
|
-
const d =
|
8707
|
+
this.pages$.subscribe((o2) => {
|
8708
|
+
const d = o2.some((g2) => g2.thumbnail || !g2.src.startsWith("ppt"));
|
8391
8709
|
t.style.display = d ? "" : "none";
|
8392
8710
|
})
|
8393
8711
|
);
|
@@ -8397,54 +8715,54 @@ let K$1 = class K {
|
|
8397
8715
|
if (this.sideEffect.addEventListener(i, "click", () => {
|
8398
8716
|
this.readonly$.value || this.events.emit("back");
|
8399
8717
|
}), s.appendChild(i), this.playable) {
|
8400
|
-
const
|
8718
|
+
const o2 = this.renderFooterBtn(
|
8401
8719
|
"btn-page-play",
|
8402
8720
|
G$1(this.namespace),
|
8403
8721
|
q$1(this.namespace)
|
8404
8722
|
);
|
8405
|
-
this.sideEffect.addEventListener(
|
8406
|
-
this.readonly$.value || (
|
8407
|
-
() =>
|
8723
|
+
this.sideEffect.addEventListener(o2, "click", () => {
|
8724
|
+
this.readonly$.value || (o2.classList.toggle(this.wrapClassName("footer-btn-playing"), true), this.events.emit("play"), this.sideEffect.setTimeout(
|
8725
|
+
() => o2.classList.toggle(this.wrapClassName("footer-btn-playing"), false),
|
8408
8726
|
500,
|
8409
8727
|
"returnPlay"
|
8410
8728
|
));
|
8411
|
-
}), s.appendChild(
|
8729
|
+
}), s.appendChild(o2);
|
8412
8730
|
}
|
8413
8731
|
const r = this.renderFooterBtn("btn-page-next", O$1(this.namespace));
|
8414
8732
|
this.sideEffect.addEventListener(r, "click", () => {
|
8415
8733
|
this.readonly$.value || this.events.emit("next");
|
8416
8734
|
}), s.appendChild(r);
|
8417
|
-
const
|
8418
|
-
|
8735
|
+
const n = document.createElement("div");
|
8736
|
+
n.className = this.wrapClassName("page-number");
|
8419
8737
|
const l = document.createElement("input");
|
8420
8738
|
l.className = this.wrapClassName("page-number-input"), this.sideEffect.addDisposer(
|
8421
|
-
this.readonly$.subscribe((
|
8739
|
+
this.readonly$.subscribe((o2) => l.disabled = o2)
|
8422
8740
|
), this.sideEffect.addDisposer(
|
8423
|
-
this.pagesIndex$.subscribe((
|
8741
|
+
this.pagesIndex$.subscribe((o2) => l.value = String(o2 + 1))
|
8424
8742
|
), this.sideEffect.addEventListener(l, "blur", () => {
|
8425
8743
|
l.value = String(this.pagesIndex$.value + 1);
|
8426
8744
|
}), this.sideEffect.addEventListener(l, "change", () => {
|
8427
8745
|
if (this.readonly$.value)
|
8428
8746
|
return;
|
8429
|
-
const
|
8430
|
-
|
8747
|
+
const o2 = l.value ? Number(l.value) - 1 : NaN;
|
8748
|
+
o2 >= 0 ? this.events.emit("jumpPage", o2) : l.value = String(this.pagesIndex$.value + 1);
|
8431
8749
|
});
|
8432
8750
|
const p = document.createElement("span");
|
8433
8751
|
this.sideEffect.addDisposer(
|
8434
|
-
this.pages$.subscribe((
|
8435
|
-
p.textContent = " / " +
|
8752
|
+
this.pages$.subscribe((o2) => {
|
8753
|
+
p.textContent = " / " + o2.length;
|
8436
8754
|
})
|
8437
|
-
),
|
8438
|
-
const a =
|
8755
|
+
), n.appendChild(l), n.appendChild(p), e.appendChild(s), e.appendChild(n);
|
8756
|
+
const a = X$1(this.namespace), c = J$1(this.namespace);
|
8439
8757
|
c.style.display = "none";
|
8440
8758
|
const u = document.createElement("button");
|
8441
8759
|
return u.className = this.wrapClassName("footer-btn"), u.appendChild(a), u.appendChild(c), this.sideEffect.addEventListener(u, "click", () => {
|
8442
8760
|
this.events.emit("save");
|
8443
|
-
}), this.events.on("saveProgress", (
|
8444
|
-
if (
|
8761
|
+
}), this.events.on("saveProgress", (o2) => {
|
8762
|
+
if (o2 < 99) {
|
8445
8763
|
c.style.display = "block", a.style.display = "none";
|
8446
8764
|
const d = c.querySelector("[data-id]");
|
8447
|
-
d && (d.textContent =
|
8765
|
+
d && (d.textContent = o2.toString().padStart(2, "0"));
|
8448
8766
|
} else
|
8449
8767
|
c.style.display = "none", a.style.display = "block";
|
8450
8768
|
}), e;
|
@@ -8461,7 +8779,7 @@ class T {
|
|
8461
8779
|
previewRoot: s,
|
8462
8780
|
footerRoot: i,
|
8463
8781
|
pages$: r,
|
8464
|
-
playable:
|
8782
|
+
playable: n
|
8465
8783
|
}) {
|
8466
8784
|
this.wrapClassName = (l) => `${this.namespace}-${l}`, this.namespace = "netless-app-docs-viewer", this.sideEffect = new SideEffectManager(), this.events = new Remitter(), this.preview = new Y$1({
|
8467
8785
|
pages$: r,
|
@@ -8475,7 +8793,7 @@ class T {
|
|
8475
8793
|
}), this.footer = new K$1({
|
8476
8794
|
pages$: r,
|
8477
8795
|
readonly$: e,
|
8478
|
-
playable:
|
8796
|
+
playable: n,
|
8479
8797
|
pagesIndex$: t,
|
8480
8798
|
root: i,
|
8481
8799
|
namespace: this.namespace,
|
@@ -8488,7 +8806,7 @@ class T {
|
|
8488
8806
|
this.preview.destroy(), this.footer.destroy(), this.sideEffect.flushAll(), this.events.destroy();
|
8489
8807
|
}
|
8490
8808
|
}
|
8491
|
-
function
|
8809
|
+
function E$1(h2, e, t) {
|
8492
8810
|
return Math.min(Math.max(h2, e), t);
|
8493
8811
|
}
|
8494
8812
|
function A$1(h2) {
|
@@ -8531,27 +8849,27 @@ let Q$1 = class Q {
|
|
8531
8849
|
}
|
8532
8850
|
};
|
8533
8851
|
let Z$1 = class Z {
|
8534
|
-
constructor(e, t, s, i, r,
|
8852
|
+
constructor(e, t, s, i, r, n) {
|
8535
8853
|
this.index = e, this.lastVisit = Date.now(), this.sideEffect = new SideEffectManager();
|
8536
|
-
const l = derive(t, (
|
8854
|
+
const l = derive(t, (o2) => o2[e] || { width: 0, height: 0 }), p = combine(
|
8537
8855
|
[l, s],
|
8538
|
-
([
|
8856
|
+
([o2, d]) => (d.width - o2.width) / 2
|
8539
8857
|
), a = combine(
|
8540
|
-
[r,
|
8541
|
-
([
|
8858
|
+
[r, n],
|
8859
|
+
([o2, d]) => (o2[e] || 0) - d
|
8542
8860
|
), c = document.createElement("div");
|
8543
8861
|
c.className = "page-renderer-page", c.dataset.index = `${e}`;
|
8544
8862
|
const u = document.createElement("img");
|
8545
8863
|
u.className = "page-renderer-page-img", c.appendChild(u), this.sideEffect.addDisposer([
|
8546
|
-
combine([l, i]).subscribe(([
|
8547
|
-
c.style.width = `${
|
8864
|
+
combine([l, i]).subscribe(([o2, d]) => {
|
8865
|
+
c.style.width = `${o2.width * d}px`, c.style.height = `${o2.height * d}px`;
|
8548
8866
|
}),
|
8549
|
-
l.subscribe((
|
8550
|
-
|
8867
|
+
l.subscribe((o2) => {
|
8868
|
+
o2.thumbnail && (c.style.backgroundImage = `url("${o2.thumbnail}")`), u.width = o2.width, u.height = o2.height, u.src = o2.src;
|
8551
8869
|
}),
|
8552
8870
|
combine([p, a, i]).subscribe(
|
8553
|
-
([
|
8554
|
-
c.style.transform = `translate(${
|
8871
|
+
([o2, d, g2]) => {
|
8872
|
+
c.style.transform = `translate(${o2 * g2}px, ${d * g2}px)`;
|
8555
8873
|
}
|
8556
8874
|
)
|
8557
8875
|
]), this.$page = c;
|
@@ -8563,13 +8881,13 @@ let Z$1 = class Z {
|
|
8563
8881
|
let ee$1 = class ee {
|
8564
8882
|
constructor(e, t, s, i, r) {
|
8565
8883
|
this.pages$ = e, this.pagesSize$ = t, this.scale$ = s, this.pagesYs$ = i, this.pagesScrollTop$ = r, this.els = /* @__PURE__ */ new Map(), this.maxElCount = 200, this.gcTimer = null, this.gc = () => {
|
8566
|
-
var
|
8884
|
+
var n;
|
8567
8885
|
if (this.gcTimer = null, this.els.size > this.maxElCount) {
|
8568
8886
|
const l = [...this.els.values()].sort((p, a) => a.lastVisit - p.lastVisit);
|
8569
8887
|
for (let p = Math.floor(this.maxElCount / 4); p < l.length; p++)
|
8570
|
-
(
|
8888
|
+
(n = this.els.get(l[p].index)) == null || n.destroy(), this.els.delete(l[p].index);
|
8571
8889
|
}
|
8572
|
-
}, this.schedule = window.requestIdleCallback || ((
|
8890
|
+
}, this.schedule = window.requestIdleCallback || ((n) => window.setTimeout(n, 5e3)), this.cancelSchedule = window.cancelIdleCallback || window.clearTimeout;
|
8573
8891
|
}
|
8574
8892
|
getEl(e) {
|
8575
8893
|
let t = this.els.get(e);
|
@@ -8606,7 +8924,7 @@ let te$1 = class te {
|
|
8606
8924
|
for (let w2 = 0; w2 < d.length; w2++)
|
8607
8925
|
g2[w2] = w2 > 0 ? g2[w2 - 1] + d[w2 - 1].height : 0;
|
8608
8926
|
return g2;
|
8609
|
-
}),
|
8927
|
+
}), n = derive(s, (d) => {
|
8610
8928
|
let g2 = 1 / 0;
|
8611
8929
|
for (let w2 = d.length - 1; w2 >= 0; w2--)
|
8612
8930
|
d[w2].height <= g2 && (g2 = d[w2].height);
|
@@ -8625,8 +8943,8 @@ let te$1 = class te {
|
|
8625
8943
|
[t, i],
|
8626
8944
|
([d, g2]) => d.width / g2.width || 1
|
8627
8945
|
), a = combine(
|
8628
|
-
[s, t,
|
8629
|
-
([d, g2, w2, f2]) =>
|
8946
|
+
[s, t, n, p],
|
8947
|
+
([d, g2, w2, f2]) => E$1(Math.ceil(g2.height / f2 / w2 / 2), 1, d.length)
|
8630
8948
|
);
|
8631
8949
|
withReadonlyValueEnhancer(this, {
|
8632
8950
|
pagesScrollTop: e,
|
@@ -8635,19 +8953,19 @@ let te$1 = class te {
|
|
8635
8953
|
pagesSize: i,
|
8636
8954
|
pagesIndex: l,
|
8637
8955
|
pagesYs: r,
|
8638
|
-
pagesMinHeight:
|
8956
|
+
pagesMinHeight: n,
|
8639
8957
|
scale: p
|
8640
8958
|
}), this.pageElManager = new ee$1(s, i, p, r, e), this.$pages = this.renderPages();
|
8641
8959
|
const c = new Val(false);
|
8642
8960
|
this.sideEffect.addDisposer(
|
8643
8961
|
c.subscribe((d) => this.$pages.classList.toggle("is-hwa", d))
|
8644
8962
|
);
|
8645
|
-
const u = () => c.setValue(false),
|
8963
|
+
const u = () => c.setValue(false), o2 = () => {
|
8646
8964
|
this.sideEffect.setTimeout(u, 1e3, "turn-off-hwa"), c.setValue(true);
|
8647
8965
|
};
|
8648
8966
|
this.sideEffect.addDisposer(
|
8649
8967
|
combine([l, a, s]).subscribe(([d, g2, w2]) => {
|
8650
|
-
|
8968
|
+
o2();
|
8651
8969
|
const f2 = Math.max(d - g2, 0), N = Math.min(d + g2, w2.length - 1);
|
8652
8970
|
for (let m = 0; m < this.$pages.children.length; m++) {
|
8653
8971
|
const S2 = this.$pages.children[m], k2 = Number(S2.dataset.index);
|
@@ -8681,23 +8999,23 @@ let ie$1 = class ie {
|
|
8681
8999
|
stageRect$: s,
|
8682
9000
|
pagesSize$: i,
|
8683
9001
|
readonly$: r,
|
8684
|
-
scrollbarMinHeight:
|
9002
|
+
scrollbarMinHeight: n = se,
|
8685
9003
|
wrapClassName: l,
|
8686
9004
|
onDragScroll: p
|
8687
9005
|
}) {
|
8688
|
-
this.sideEffect = new SideEffectManager(), this.scrolling$ = new Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight =
|
9006
|
+
this.sideEffect = new SideEffectManager(), this.scrolling$ = new Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight = n, this.readonly$ = r, this.wrapClassName = l, this.onDragScroll = p, this.scrollbarHeight$ = combine(
|
8689
9007
|
[t, s, i],
|
8690
|
-
([a, c, u]) =>
|
9008
|
+
([a, c, u]) => E$1(
|
8691
9009
|
c.height / (c.width / u.width * u.height) * a.height,
|
8692
|
-
|
9010
|
+
n,
|
8693
9011
|
a.height
|
8694
9012
|
)
|
8695
9013
|
), this.scrollTop$ = combine(
|
8696
9014
|
[t, s, i, this.scrollbarHeight$, this.pagesScrollTop$],
|
8697
|
-
([a, c, u,
|
8698
|
-
d / (u.height - u.width / c.width * c.height) * (a.height -
|
9015
|
+
([a, c, u, o2, d]) => E$1(
|
9016
|
+
d / (u.height - u.width / c.width * c.height) * (a.height - o2),
|
8699
9017
|
0,
|
8700
|
-
a.height -
|
9018
|
+
a.height - o2
|
8701
9019
|
)
|
8702
9020
|
), this.$scrollbar = this.renderScrollbar();
|
8703
9021
|
}
|
@@ -8728,15 +9046,15 @@ let ie$1 = class ie {
|
|
8728
9046
|
D(s);
|
8729
9047
|
const i = this.wrapClassName("scrollbar-dragging");
|
8730
9048
|
e.classList.toggle(i, true);
|
8731
|
-
const r = this.pagesScrollTop$.value, { clientY:
|
9049
|
+
const r = this.pagesScrollTop$.value, { clientY: n } = A$1(s), l = (a) => {
|
8732
9050
|
if (!a.isPrimary || this.readonly$.value)
|
8733
9051
|
return;
|
8734
|
-
const { clientY: c } = A$1(a), u = c -
|
9052
|
+
const { clientY: c } = A$1(a), u = c - n;
|
8735
9053
|
Math.abs(u) > 0 && this.onDragScroll && this.onDragScroll(
|
8736
9054
|
r + u / this.containerRect$.value.height * this.pagesSize$.value.height
|
8737
9055
|
);
|
8738
9056
|
}, p = (a) => {
|
8739
|
-
|
9057
|
+
a.isPrimary && (e.classList.toggle(i, false), window.removeEventListener("pointermove", l, true), window.removeEventListener("pointerup", p, true), window.removeEventListener("pointercancel", p, true));
|
8740
9058
|
};
|
8741
9059
|
window.addEventListener("pointermove", l, true), window.addEventListener("pointerup", p, true), window.addEventListener("pointercancel", p, true);
|
8742
9060
|
};
|
@@ -8750,36 +9068,36 @@ class re {
|
|
8750
9068
|
box: s,
|
8751
9069
|
pages: i,
|
8752
9070
|
pagesScrollTop: r = 0,
|
8753
|
-
onUserScroll:
|
9071
|
+
onUserScroll: n
|
8754
9072
|
}) {
|
8755
9073
|
this.sideEffect = new SideEffectManager(), this.userScrolling = false, this.toPdf = async () => {
|
8756
9074
|
const a = document.createElement("canvas"), c = a.getContext("2d");
|
8757
9075
|
if (!c)
|
8758
9076
|
return null;
|
8759
|
-
const u = this.whiteboard.pageState.pages[0],
|
8760
|
-
format: [
|
8761
|
-
orientation:
|
9077
|
+
const u = this.whiteboard.pageState.pages[0], o2 = this.pages[0], { jsPDF: d } = await import("jspdf"), g2 = new d({
|
9078
|
+
format: [o2.width, o2.height],
|
9079
|
+
orientation: o2.width > o2.height ? "l" : "p",
|
8762
9080
|
compress: true
|
8763
9081
|
});
|
8764
9082
|
for (const [S2, k2] of this.pages.entries()) {
|
8765
|
-
const { width: y, height: v, src:
|
9083
|
+
const { width: y, height: v, src: L } = k2;
|
8766
9084
|
a.width = y, a.height = v;
|
8767
|
-
const
|
8768
|
-
S2 > 0 && g2.addPage([y, v],
|
8769
|
-
const
|
8770
|
-
P2.src =
|
8771
|
-
const
|
9085
|
+
const M2 = y > v ? "l" : "p";
|
9086
|
+
S2 > 0 && g2.addPage([y, v], M2);
|
9087
|
+
const R2 = await this.getBase64FromUrl(L), P2 = document.createElement("img");
|
9088
|
+
P2.src = R2, await new Promise((_2) => P2.onload = _2), c.drawImage(P2, 0, 0);
|
9089
|
+
const V = a.toDataURL("image/jpeg", 0.6);
|
8772
9090
|
c.clearRect(0, 0, y, v), this.whiteboard.view.screenshotToCanvas(c, u, y, v, {
|
8773
9091
|
centerX: y / 2,
|
8774
9092
|
centerY: v / 2 + S2 * v,
|
8775
9093
|
scale: 1
|
8776
9094
|
});
|
8777
9095
|
const I2 = a.toDataURL("image/png");
|
8778
|
-
g2.addImage(
|
9096
|
+
g2.addImage(V, "JPEG", 0, 0, y, v, "", "FAST"), g2.addImage(I2, "PNG", 0, 0, y, v, "", "FAST"), c.clearRect(0, 0, y, v), this.viewer.events.emit("saveProgress", Math.ceil((S2 + 1) / this.pages.length * 100));
|
8779
9097
|
}
|
8780
9098
|
const w2 = g2.output("arraybuffer"), f2 = new Blob([w2]), N = URL.createObjectURL(f2), m = document.createElement("a");
|
8781
9099
|
m.setAttribute("href", N), m.setAttribute("download", `${this.box.title}.pdf`), m.style.display = "none", document.body.appendChild(m), m.click(), document.body.removeChild(m), window.postMessage({ type: "@app-slide/_download_pdf_", buf: w2 });
|
8782
|
-
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll =
|
9100
|
+
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll = n;
|
8783
9101
|
const l = () => {
|
8784
9102
|
var a;
|
8785
9103
|
this.userScrolling = false, (a = this.onUserScroll) == null || a.call(this, this.pagesScrollTop$.value);
|
@@ -8792,8 +9110,8 @@ class re {
|
|
8792
9110
|
p,
|
8793
9111
|
(a) => {
|
8794
9112
|
let c = 0, u = 0;
|
8795
|
-
for (let
|
8796
|
-
const d = a[
|
9113
|
+
for (let o2 = a.length - 1; o2 >= 0; o2--) {
|
9114
|
+
const d = a[o2];
|
8797
9115
|
d.width > c && (c = d.width), u += d.height;
|
8798
9116
|
}
|
8799
9117
|
return { width: Math.max(1, c), height: Math.max(1, u) };
|
@@ -8853,8 +9171,8 @@ class re {
|
|
8853
9171
|
return new Promise((i) => {
|
8854
9172
|
const r = new FileReader();
|
8855
9173
|
r.readAsDataURL(s), r.onloadend = () => {
|
8856
|
-
const
|
8857
|
-
i(
|
9174
|
+
const n = r.result;
|
9175
|
+
i(n);
|
8858
9176
|
};
|
8859
9177
|
});
|
8860
9178
|
}
|
@@ -8864,7 +9182,7 @@ class re {
|
|
8864
9182
|
pageScrollTo(e) {
|
8865
9183
|
const t = this.whiteboard.view.size.height / 2 / this.pageRenderer.scale;
|
8866
9184
|
this.whiteboard.view.moveCamera({
|
8867
|
-
centerY:
|
9185
|
+
centerY: E$1(
|
8868
9186
|
e + t,
|
8869
9187
|
t,
|
8870
9188
|
this.pagesSize$.value.height - t
|
@@ -8874,7 +9192,7 @@ class re {
|
|
8874
9192
|
}
|
8875
9193
|
userScrollToPageIndex(e) {
|
8876
9194
|
var t;
|
8877
|
-
if (e =
|
9195
|
+
if (e = E$1(e, 0, this.pages.length - 1), !this.readonly$.value && !Number.isNaN(e)) {
|
8878
9196
|
const s = this.pageRenderer.pagesYs[e];
|
8879
9197
|
s >= 0 && ((t = this.onUserScroll) == null || t.call(this, s + 5 / this.pageRenderer.scale));
|
8880
9198
|
}
|
@@ -8883,8 +9201,8 @@ class re {
|
|
8883
9201
|
var t;
|
8884
9202
|
this.readonly$.value || (t = this.onUserScroll) == null || t.call(
|
8885
9203
|
this,
|
8886
|
-
|
8887
|
-
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale *
|
9204
|
+
E$1(
|
9205
|
+
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale * E$1(e, -1, 1),
|
8888
9206
|
0,
|
8889
9207
|
this.pageRenderer.pagesSize.height - this.pageRenderer.containerRect.height / this.pageRenderer.scale
|
8890
9208
|
)
|
@@ -8894,52 +9212,59 @@ class re {
|
|
8894
9212
|
this.sideEffect.addEventListener(
|
8895
9213
|
this.box.$main,
|
8896
9214
|
"wheel",
|
8897
|
-
(
|
8898
|
-
D(
|
9215
|
+
(t) => {
|
9216
|
+
D(t), !this.readonly$.value && this.pageScrollStepper.paused && (this.pageScrollTo(this.pagesScrollTop + t.deltaY), this.debounceOnUserScroll());
|
8899
9217
|
},
|
8900
9218
|
{ passive: false }
|
8901
9219
|
), this.sideEffect.addEventListener(
|
8902
9220
|
this.box.$main,
|
8903
9221
|
"touchmove",
|
8904
|
-
(
|
8905
|
-
!this.readonly$.value &&
|
9222
|
+
(t) => {
|
9223
|
+
!this.readonly$.value && t.touches.length > 1 && this.debounceOnUserScroll();
|
8906
9224
|
},
|
8907
9225
|
{ passive: true, capture: true }
|
8908
9226
|
), this.sideEffect.add(() => {
|
8909
|
-
const
|
8910
|
-
const { width:
|
8911
|
-
if (
|
9227
|
+
const t = (s) => {
|
9228
|
+
const { width: i, height: r } = this.whiteboard.view.size;
|
9229
|
+
if (i <= 0 || r <= 0)
|
8912
9230
|
return;
|
8913
|
-
const
|
8914
|
-
this.pagesScrollTop$.setValue(Math.max(0,
|
9231
|
+
const n = s.centerY - this.pageRenderer.containerRect.height / this.pageRenderer.scale / 2;
|
9232
|
+
this.pagesScrollTop$.setValue(Math.max(0, n));
|
8915
9233
|
};
|
8916
|
-
return this.whiteboard.view.callbacks.on("onCameraUpdated",
|
9234
|
+
return this.whiteboard.view.callbacks.on("onCameraUpdated", t), () => this.whiteboard.view.callbacks.off("onCameraUpdated", t);
|
8917
9235
|
}), this.sideEffect.addDisposer(
|
8918
|
-
this.box._stageRect$.subscribe((
|
8919
|
-
const { width:
|
9236
|
+
this.box._stageRect$.subscribe((t) => {
|
9237
|
+
const { width: s, height: i } = this.pagesSize$.value;
|
8920
9238
|
this.whiteboard.view.moveCameraToContain({
|
8921
9239
|
originX: 0,
|
8922
9240
|
originY: this.pageRenderer.pagesScrollTop,
|
8923
|
-
width:
|
8924
|
-
height:
|
9241
|
+
width: s,
|
9242
|
+
height: t.height / this.pageRenderer.scale,
|
8925
9243
|
animationMode: "immediately"
|
8926
9244
|
}), this.whiteboard.view.setCameraBound({
|
8927
9245
|
damping: 1,
|
8928
9246
|
maxContentMode: () => this.pageRenderer.scale,
|
8929
9247
|
minContentMode: () => this.pageRenderer.scale,
|
8930
|
-
centerX:
|
8931
|
-
centerY:
|
8932
|
-
width:
|
8933
|
-
height:
|
9248
|
+
centerX: s / 2,
|
9249
|
+
centerY: i / 2,
|
9250
|
+
width: s,
|
9251
|
+
height: i
|
8934
9252
|
});
|
8935
9253
|
}),
|
8936
9254
|
"whiteboard-size-update"
|
8937
|
-
)
|
9255
|
+
);
|
9256
|
+
const e = (t) => {
|
9257
|
+
if (!t)
|
9258
|
+
return false;
|
9259
|
+
const s = t.tagName;
|
9260
|
+
return s === "INPUT" || s === "TEXTAREA" || s === "SELECT";
|
9261
|
+
};
|
9262
|
+
this.sideEffect.addEventListener(
|
8938
9263
|
window,
|
8939
9264
|
"keyup",
|
8940
|
-
(
|
8941
|
-
if (!(this.readonly$.value || !this.box.focus || this.box.minimized))
|
8942
|
-
switch (
|
9265
|
+
(t) => {
|
9266
|
+
if (!(this.readonly$.value || !this.box.focus || this.box.minimized || e(t.target)))
|
9267
|
+
switch (t.key) {
|
8943
9268
|
case "PageDown": {
|
8944
9269
|
this.userScrollByPercent(0.8);
|
8945
9270
|
break;
|
@@ -8976,15 +9301,15 @@ class re {
|
|
8976
9301
|
let ae$1 = class ae {
|
8977
9302
|
constructor({ readonly$: e, context: t, whiteboard: s, box: i, pages: r }) {
|
8978
9303
|
this.sideEffect = new SideEffectManager(), this.context = t, this.whiteboard = s, this.box = i, this.pages = r;
|
8979
|
-
const
|
8980
|
-
this.pagesIndex$ =
|
9304
|
+
const n = new Val(t.displayer.state.sceneState.index || 0);
|
9305
|
+
this.pagesIndex$ = n, this.sideEffect.add(() => {
|
8981
9306
|
const l = (p) => {
|
8982
9307
|
this.jumpToPage(p.index);
|
8983
9308
|
};
|
8984
9309
|
return this.context.emitter.on("sceneStateChange", l), () => this.context.emitter.off("sceneStateChange", l);
|
8985
9310
|
}), this.viewer = new T({
|
8986
9311
|
readonly$: e,
|
8987
|
-
pagesIndex$:
|
9312
|
+
pagesIndex$: n,
|
8988
9313
|
previewRoot: i.$body,
|
8989
9314
|
footerRoot: i.$footer,
|
8990
9315
|
pages$: new Val(r),
|
@@ -8998,11 +9323,11 @@ let ae$1 = class ae {
|
|
8998
9323
|
this.viewer.events.on("back", () => this.prevPage()),
|
8999
9324
|
this.viewer.events.on("next", () => this.nextPage())
|
9000
9325
|
]), this.render(), this.sideEffect.addDisposer(
|
9001
|
-
|
9002
|
-
var u,
|
9326
|
+
n.subscribe((l, p) => {
|
9327
|
+
var u, o2;
|
9003
9328
|
if (e.value)
|
9004
9329
|
return;
|
9005
|
-
const a = this.context.getInitScenePath(), c = (
|
9330
|
+
const a = this.context.getInitScenePath(), c = (o2 = (u = this.context.getScenes()) == null ? void 0 : u[l]) == null ? void 0 : o2.name;
|
9006
9331
|
if (a && c && this.context.setScenePath(`${a}/${c}`), p) {
|
9007
9332
|
const d = this.context.room;
|
9008
9333
|
if (d) {
|
@@ -9029,7 +9354,7 @@ let ae$1 = class ae {
|
|
9029
9354
|
this.jumpToPage(this.pagesIndex$.value - 1, true);
|
9030
9355
|
}
|
9031
9356
|
jumpToPage(e, t = false) {
|
9032
|
-
this.pagesIndex$.setValue(
|
9357
|
+
this.pagesIndex$.setValue(E$1(e, 0, this.pages.length - 1), t);
|
9033
9358
|
}
|
9034
9359
|
render() {
|
9035
9360
|
var t;
|
@@ -9054,8 +9379,8 @@ let ae$1 = class ae {
|
|
9054
9379
|
var r;
|
9055
9380
|
const i = this.context.room;
|
9056
9381
|
if (i && i.state.memberState.currentApplianceName === "clicker") {
|
9057
|
-
for (let
|
9058
|
-
if ((r =
|
9382
|
+
for (let n = s.target; n; n = n.parentElement)
|
9383
|
+
if ((r = n.classList) != null && r.contains("ppt-event-source"))
|
9059
9384
|
return;
|
9060
9385
|
i.pptNextStep();
|
9061
9386
|
}
|
@@ -9072,20 +9397,20 @@ const ne$1 = "DocsViewer", ue = {
|
|
9072
9397
|
if (!t)
|
9073
9398
|
throw new Error("[Docs Viewer]: scenes not found.");
|
9074
9399
|
const s = new SideEffectManager(), i = t.map(
|
9075
|
-
({ ppt:
|
9076
|
-
width:
|
9077
|
-
height:
|
9078
|
-
src:
|
9079
|
-
thumbnail:
|
9400
|
+
({ ppt: n }) => n ? {
|
9401
|
+
width: n.width,
|
9402
|
+
height: n.height,
|
9403
|
+
src: n.src,
|
9404
|
+
thumbnail: n.previewURL
|
9080
9405
|
} : null
|
9081
|
-
).filter((
|
9406
|
+
).filter((n) => Boolean(n));
|
9082
9407
|
if (i.length <= 0)
|
9083
9408
|
throw new Error("[Docs Viewer]: empty scenes.");
|
9084
9409
|
e.mountStyles(F);
|
9085
9410
|
const r = new Val(!h2.isWritable);
|
9086
9411
|
s.addDisposer(
|
9087
|
-
h2.emitter.on("writableChange", (
|
9088
|
-
r.setValue(!
|
9412
|
+
h2.emitter.on("writableChange", (n) => {
|
9413
|
+
r.setValue(!n);
|
9089
9414
|
})
|
9090
9415
|
), i[0].src.startsWith("ppt") ? le$1(
|
9091
9416
|
s,
|
@@ -9113,18 +9438,18 @@ function oe$1(h2, e, t, s, i) {
|
|
9113
9438
|
r.view.disableCameraTransform = p;
|
9114
9439
|
})
|
9115
9440
|
);
|
9116
|
-
const
|
9441
|
+
const n = e.createStorage("static-docs-viewer", { pagesScrollTop: 0 }), l = new re({
|
9117
9442
|
whiteboard: r,
|
9118
9443
|
readonly$: i,
|
9119
9444
|
box: t,
|
9120
9445
|
pages: s,
|
9121
|
-
pagesScrollTop:
|
9446
|
+
pagesScrollTop: n.state.pagesScrollTop,
|
9122
9447
|
onUserScroll: (p) => {
|
9123
|
-
e.isWritable &&
|
9448
|
+
e.isWritable && n.setState({ pagesScrollTop: p });
|
9124
9449
|
}
|
9125
9450
|
});
|
9126
9451
|
h2.addDisposer(() => l.destroy()), h2.addDisposer(
|
9127
|
-
|
9452
|
+
n.on("stateChanged", (p) => {
|
9128
9453
|
p.pagesScrollTop && l.syncPageScrollTop(p.pagesScrollTop.newValue || 0);
|
9129
9454
|
})
|
9130
9455
|
), h2.addDisposer(
|
@@ -9136,8 +9461,8 @@ function oe$1(h2, e, t, s, i) {
|
|
9136
9461
|
l.pagesSize$,
|
9137
9462
|
l.pageRenderer._pagesMinHeight$
|
9138
9463
|
],
|
9139
|
-
([p, a, c, u,
|
9140
|
-
|
9464
|
+
([p, a, c, u, o2]) => p ? Math.max(
|
9465
|
+
o2 / u.width * (2 / 5),
|
9141
9466
|
a.height / a.width
|
9142
9467
|
) : c.height / c.width * (a.height / a.width)
|
9143
9468
|
).subscribe((p) => {
|
@@ -9148,20 +9473,20 @@ function oe$1(h2, e, t, s, i) {
|
|
9148
9473
|
function le$1(h2, e, t, s, i) {
|
9149
9474
|
const r = e.createWhiteBoardView();
|
9150
9475
|
r.view.disableCameraTransform = true;
|
9151
|
-
const
|
9476
|
+
const n = new ae$1({
|
9152
9477
|
context: e,
|
9153
9478
|
whiteboard: r,
|
9154
9479
|
box: t,
|
9155
9480
|
pages: s,
|
9156
9481
|
readonly$: i
|
9157
9482
|
});
|
9158
|
-
h2.addDisposer(() =>
|
9483
|
+
h2.addDisposer(() => n.destroy());
|
9159
9484
|
const l = new Val(
|
9160
9485
|
{ width: s[0].width, height: s[0].height },
|
9161
9486
|
{ compare: z$1 }
|
9162
9487
|
);
|
9163
9488
|
if (h2.addDisposer(
|
9164
|
-
|
9489
|
+
n.pagesIndex$.subscribe((p) => {
|
9165
9490
|
const a = s[p];
|
9166
9491
|
a && l.setValue({ width: a.width, height: a.height });
|
9167
9492
|
})
|
@@ -9173,7 +9498,7 @@ function le$1(h2, e, t, s, i) {
|
|
9173
9498
|
const p = h2.add(() => {
|
9174
9499
|
const a = ({ width: c, height: u }) => {
|
9175
9500
|
if (s.length > 0 && t.state !== "maximized") {
|
9176
|
-
const { width:
|
9501
|
+
const { width: o2, height: d } = s[0], w2 = d / o2 * c - u;
|
9177
9502
|
w2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9178
9503
|
width: t.intrinsicWidth,
|
9179
9504
|
height: t.intrinsicHeight + w2 / t.rootRect.height
|
@@ -9541,13 +9866,13 @@ function Ni(e) {
|
|
9541
9866
|
return Array.isArray(e) ? e[0] : e;
|
9542
9867
|
}
|
9543
9868
|
function Li(e) {
|
9544
|
-
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N,
|
9869
|
+
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N, x, y, C, L, $, D2, V, re2, F2, ce, Ve, de, qe, pe, De, ue2, Re, he, Fe, se2, Be, Ue;
|
9545
9870
|
return {
|
9546
9871
|
c() {
|
9547
|
-
i = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), m = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N = S("path"),
|
9872
|
+
i = S("svg"), t = S("symbol"), r = S("path"), s = S("path"), n = S("symbol"), a = S("path"), l = S("symbol"), d = S("path"), c = S("symbol"), u = S("path"), m = S("symbol"), p = S("path"), v = S("symbol"), b = S("path"), T2 = S("symbol"), N = S("path"), x = S("symbol"), y = S("path"), C = S("symbol"), L = S("path"), $ = S("symbol"), D2 = S("path"), V = S("symbol"), re2 = S("path"), F2 = S("symbol"), ce = S("path"), Ve = S("path"), de = S("symbol"), qe = S("path"), pe = S("symbol"), De = S("path"), ue2 = S("symbol"), Re = S("path"), he = S("symbol"), Fe = S("path"), se2 = S("symbol"), Be = S("path"), Ue = S("path"), g(r, "d", "M16 1H2a1 1 0 00-1 1v10a1 1 0 001 1h3v-2H3V3h12v8h-2v2h3a1 1 0 001-1V2a1 1 0 00-1-1z"), g(s, "d", "M4 17h10l-5-6z"), g(t, "id", "plyr-airplay"), g(t, "viewBox", "0 0 18 18"), g(a, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(a, "fill-rule", "evenodd"), g(a, "fill-opacity", ".5"), g(n, "id", "plyr-captions-off"), g(n, "viewBox", "0 0 18 18"), g(d, "d", "M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"), g(d, "fill-rule", "evenodd"), g(l, "id", "plyr-captions-on"), g(l, "viewBox", "0 0 18 18"), g(u, "d", "M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z"), g(c, "id", "plyr-download"), g(c, "viewBox", "0 0 18 18"), g(p, "d", "M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"), g(m, "id", "plyr-enter-fullscreen"), g(m, "viewBox", "0 0 18 18"), g(b, "d", "M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"), g(v, "id", "plyr-exit-fullscreen"), g(v, "viewBox", "0 0 18 18"), g(N, "d", "M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"), g(T2, "id", "plyr-fast-forward"), g(T2, "viewBox", "0 0 18 18"), g(y, "d", "M17 5.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C5 10.9 4.4 6 3 6c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"), g(x, "id", "plyr-logo-vimeo"), g(x, "viewBox", "0 0 18 18"), g(L, "d", "M16.8 5.8c-.2-1.3-.8-2.2-2.2-2.4C12.4 3 9 3 9 3s-3.4 0-5.6.4C2 3.6 1.3 4.5 1.2 5.8 1 7.1 1 9 1 9s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C5.6 15 9 15 9 15s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4.2-1.3.2-3.2.2-3.2s0-1.9-.2-3.2zM7 12V6l5 3-5 3z"), g(C, "id", "plyr-logo-youtube"), g(C, "viewBox", "0 0 18 18"), g(D2, "d", "M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g($, "id", "plyr-muted"), g($, "viewBox", "0 0 18 18"), g(re2, "d", "M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zm6 0c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"), g(V, "id", "plyr-pause"), g(V, "viewBox", "0 0 18 18"), g(ce, "d", "M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"), g(Ve, "d", "M13 15H3V5h5V3H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1v-6h-2v5z"), g(F2, "id", "plyr-pip"), g(F2, "viewBox", "0 0 18 18"), g(qe, "d", "M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"), g(de, "id", "plyr-play"), g(de, "viewBox", "0 0 18 18"), g(De, "d", "M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"), g(pe, "id", "plyr-restart"), g(pe, "viewBox", "0 0 18 18"), g(Re, "d", "M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"), g(ue2, "id", "plyr-rewind"), g(ue2, "viewBox", "0 0 18 18"), g(Fe, "d", "M16.135 7.784a2 2 0 01-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 01-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 01-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 01-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 011.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 012.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 012.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 011.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 110-6 3 3 0 010 6z"), g(he, "id", "plyr-settings"), g(he, "viewBox", "0 0 18 18"), g(Be, "d", "M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"), g(Ue, "d", "M11.282 5.282a.909.909 0 000 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 000 1.316c.145.145.636.262 1.018.156a.725.725 0 00.298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 00-1.316 0zm-7.496.726H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"), g(se2, "id", "plyr-volume"), g(se2, "viewBox", "0 0 18 18"), g(i, "xmlns", "http://www.w3.org/2000/svg"), g(i, "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
9548
9873
|
},
|
9549
9874
|
m(We, ni) {
|
9550
|
-
te2(We, i, ni), k(i, t), k(t, r), k(t, s), k(i, n), k(n, a), k(i, l), k(l, d), k(i, c), k(c, u), k(i, m), k(m, p), k(i, v), k(v, b), k(i, T2), k(T2, N), k(i,
|
9875
|
+
te2(We, i, ni), k(i, t), k(t, r), k(t, s), k(i, n), k(n, a), k(i, l), k(l, d), k(i, c), k(c, u), k(i, m), k(m, p), k(i, v), k(v, b), k(i, T2), k(T2, N), k(i, x), k(x, y), k(i, C), k(C, L), k(i, $), k($, D2), k(i, V), k(V, re2), k(i, F2), k(F2, ce), k(F2, Ve), k(i, de), k(de, qe), k(i, pe), k(pe, De), k(i, ue2), k(ue2, Re), k(i, he), k(he, Fe), k(i, se2), k(se2, Be), k(se2, Ue);
|
9551
9876
|
},
|
9552
9877
|
p: X,
|
9553
9878
|
i: X,
|
@@ -10431,19 +10756,19 @@ const h = { getIconUrl() {
|
|
10431
10756
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10432
10757
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10433
10758
|
const v = _("div", { class: "plyr__menu__container", id: `plyr-settings-${e.id}`, hidden: "" }), b = _("div"), T2 = _("div", { id: `plyr-settings-${e.id}-home` }), N = _("div", { role: "menu" });
|
10434
|
-
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((
|
10759
|
+
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10435
10760
|
const y = _("button", z(B(this.config.selectors.buttons.settings), { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--forward`, role: "menuitem", "aria-haspopup": true, hidden: "" }));
|
10436
|
-
i.call(this, y,
|
10437
|
-
d.call(this,
|
10761
|
+
i.call(this, y, x), E.call(this, y, "click", () => {
|
10762
|
+
d.call(this, x, false);
|
10438
10763
|
});
|
10439
|
-
const C = _("span", null, j.get(
|
10440
|
-
L.innerHTML = e[
|
10441
|
-
const $ = _("div", { id: `plyr-settings-${e.id}-${
|
10442
|
-
D2.appendChild(_("span", { "aria-hidden": true }, j.get(
|
10764
|
+
const C = _("span", null, j.get(x, this.config)), L = _("span", { class: this.config.classNames.menu.value });
|
10765
|
+
L.innerHTML = e[x], C.appendChild(L), y.appendChild(C), N.appendChild(y);
|
10766
|
+
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10767
|
+
D2.appendChild(_("span", { "aria-hidden": true }, j.get(x, this.config))), D2.appendChild(_("span", { class: this.config.classNames.hidden }, j.get("menuBack", this.config))), E.call(this, $, "keydown", (V) => {
|
10443
10768
|
V.key === "ArrowLeft" && (V.preventDefault(), V.stopPropagation(), d.call(this, "home", true));
|
10444
10769
|
}, false), E.call(this, D2, "click", () => {
|
10445
10770
|
d.call(this, "home", false);
|
10446
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[
|
10771
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10447
10772
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10448
10773
|
}
|
10449
10774
|
if (m === "pip" && I.pip && c.appendChild(t.call(this, "pip", u)), m === "airplay" && I.airplay && c.appendChild(t.call(this, "airplay", u)), m === "download") {
|
@@ -11027,9 +11352,9 @@ var kr = xr(function(e, i) {
|
|
11027
11352
|
}, r = {}, s = {}, n = {};
|
11028
11353
|
function a(p, v) {
|
11029
11354
|
p = p.push ? p : [p];
|
11030
|
-
var b, T2, N,
|
11355
|
+
var b, T2, N, x = [], y = p.length, C = y;
|
11031
11356
|
for (b = function(L, $) {
|
11032
|
-
$.length &&
|
11357
|
+
$.length && x.push(L), --C || v(x);
|
11033
11358
|
}; y--; )
|
11034
11359
|
T2 = p[y], (N = s[T2]) ? b(T2, N) : (n[T2] = n[T2] || []).push(b);
|
11035
11360
|
}
|
@@ -11045,32 +11370,32 @@ var kr = xr(function(e, i) {
|
|
11045
11370
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11046
11371
|
}
|
11047
11372
|
function c(p, v, b, T2) {
|
11048
|
-
var N,
|
11049
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((
|
11373
|
+
var N, x, y = document, C = b.async, L = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V = p.replace(/^(css|img)!/, "");
|
11374
|
+
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((x = y.createElement("link")).rel = "stylesheet", x.href = V, (N = "hideFocus" in x) && x.relList && (N = 0, x.rel = "preload", x.as = "style")) : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(D2) ? (x = y.createElement("img")).src = V : ((x = y.createElement("script")).src = p, x.async = C === void 0 || C), x.onload = x.onerror = x.onbeforeload = function(re2) {
|
11050
11375
|
var F2 = re2.type[0];
|
11051
11376
|
if (N)
|
11052
11377
|
try {
|
11053
|
-
|
11378
|
+
x.sheet.cssText.length || (F2 = "e");
|
11054
11379
|
} catch (ce) {
|
11055
11380
|
ce.code != 18 && (F2 = "e");
|
11056
11381
|
}
|
11057
11382
|
if (F2 == "e") {
|
11058
11383
|
if ((T2 += 1) < L)
|
11059
11384
|
return c(p, v, b, T2);
|
11060
|
-
} else if (
|
11061
|
-
return
|
11385
|
+
} else if (x.rel == "preload" && x.as == "style")
|
11386
|
+
return x.rel = "stylesheet";
|
11062
11387
|
v(p, F2, re2.defaultPrevented);
|
11063
|
-
}, $(p,
|
11388
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11064
11389
|
}
|
11065
11390
|
function u(p, v, b) {
|
11066
|
-
var T2, N,
|
11391
|
+
var T2, N, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11067
11392
|
for (T2 = function(L, $, D2) {
|
11068
11393
|
if ($ == "e" && C.push(L), $ == "b") {
|
11069
11394
|
if (!D2)
|
11070
11395
|
return;
|
11071
11396
|
C.push(L);
|
11072
11397
|
}
|
11073
|
-
--
|
11398
|
+
--x || v(C);
|
11074
11399
|
}, N = 0; N < y; N++)
|
11075
11400
|
c(p[N], T2, b);
|
11076
11401
|
}
|
@@ -11081,14 +11406,14 @@ var kr = xr(function(e, i) {
|
|
11081
11406
|
throw "LoadJS";
|
11082
11407
|
r[T2] = true;
|
11083
11408
|
}
|
11084
|
-
function
|
11409
|
+
function x(y, C) {
|
11085
11410
|
u(p, function(L) {
|
11086
11411
|
d(N, L), y && d({ success: y, error: C }, L), l(T2, L);
|
11087
11412
|
}, N);
|
11088
11413
|
}
|
11089
11414
|
if (N.returnPromise)
|
11090
|
-
return new Promise(
|
11091
|
-
|
11415
|
+
return new Promise(x);
|
11416
|
+
x();
|
11092
11417
|
}
|
11093
11418
|
return m.ready = function(p, v) {
|
11094
11419
|
return a(p, function(b) {
|
@@ -11171,11 +11496,11 @@ const nt = { setup() {
|
|
11171
11496
|
T2 = C, w.call(e, e.media, "volumechange");
|
11172
11497
|
});
|
11173
11498
|
} });
|
11174
|
-
let N, { loop:
|
11175
|
-
Object.defineProperty(e.media, "loop", { get: () =>
|
11499
|
+
let N, { loop: x } = e.config;
|
11500
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11176
11501
|
const C = o.boolean(y) ? y : e.config.loop.active;
|
11177
11502
|
e.embed.setLoop(C).then(() => {
|
11178
|
-
|
11503
|
+
x = C;
|
11179
11504
|
});
|
11180
11505
|
} }), e.embed.getVideoUrl().then((y) => {
|
11181
11506
|
N = y, h.setDownloadUrl.call(e);
|
@@ -12302,8 +12627,8 @@ const reconnectRefresher = new ReconnectRefresher({ emitter });
|
|
12302
12627
|
const _WindowManager = class extends InvisiblePlugin {
|
12303
12628
|
constructor(context) {
|
12304
12629
|
super(context);
|
12305
|
-
this.version = "1.0.0-canary.
|
12306
|
-
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.
|
12630
|
+
this.version = "1.0.0-canary.78";
|
12631
|
+
this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.6", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.33.0", "@rollup/plugin-commonjs": "^24.1.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-url": "^8.0.1", "@sveltejs/vite-plugin-svelte": "^2.2.0", "@tsconfig/svelte": "^4.0.1", "@types/debug": "^4.1.7", "@types/node": "^18.0.3", "@types/lodash": "^4.14.194", "@types/lodash-es": "^4.17.7", "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/parser": "^5.59.5", "@vitest/ui": "^0.31.0", "cypress": "^12.12.0", "dotenv": "^16.0.3", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-svelte3": "^4.0.0", "jsdom": "^22.0.0", "less": "^4.1.3", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^4.0.0", "svelte": "^3.59.1", "typescript": "^5.0.4", "vite": "^4.3.5", "vite-plugin-dts": "^2.3.0", "vitest": "^0.31.0", "white-web-sdk": "^2.16.42" } };
|
12307
12632
|
this.emitter = callbacks;
|
12308
12633
|
this.viewMode$ = new Val(ViewMode.Broadcaster);
|
12309
12634
|
this.playground$ = new Val(void 0);
|
@@ -12319,7 +12644,7 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12319
12644
|
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12320
12645
|
};
|
12321
12646
|
_WindowManager.displayer = context.displayer;
|
12322
|
-
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.
|
12647
|
+
window.NETLESS_DEPS = { "dependencies": { "@juggle/resize-observer": "^3.4.0", "@netless/synced-store": "^2.0.7", "@netless/telebox-insider": "1.0.0-alpha.37", "emittery": "^0.11.0", "jspdf": "^2.5.1", "lodash": "^4.17.21", "p-retry": "^5.1.2", "side-effect-manager": "^1.2.1", "uuid": "^9.0.0", "value-enhancer": "^1.3.2" }, "peerDependencies": { "white-web-sdk": "^2.16.0" }, "devDependencies": { "@netless/app-docs-viewer": "1.0.0-canary.6", "@netless/app-plyr": "^0.2.4", "@playwright/test": "^1.33.0", "@rollup/plugin-commonjs": "^24.1.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-url": "^8.0.1", "@sveltejs/vite-plugin-svelte": "^2.2.0", "@tsconfig/svelte": "^4.0.1", "@types/debug": "^4.1.7", "@types/node": "^18.0.3", "@types/lodash": "^4.14.194", "@types/lodash-es": "^4.17.7", "@types/uuid": "^9.0.1", "@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/parser": "^5.59.5", "@vitest/ui": "^0.31.0", "cypress": "^12.12.0", "dotenv": "^16.0.3", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-svelte3": "^4.0.0", "jsdom": "^22.0.0", "less": "^4.1.3", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^4.0.0", "svelte": "^3.59.1", "typescript": "^5.0.4", "vite": "^4.3.5", "vite-plugin-dts": "^2.3.0", "vitest": "^0.31.0", "white-web-sdk": "^2.16.42" } };
|
12323
12648
|
}
|
12324
12649
|
static async mount(params) {
|
12325
12650
|
var _a;
|
@@ -12484,12 +12809,21 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12484
12809
|
}
|
12485
12810
|
}
|
12486
12811
|
}
|
12812
|
+
/**
|
12813
|
+
* 注册插件
|
12814
|
+
*/
|
12487
12815
|
static register(params) {
|
12488
12816
|
return appRegister.register(params);
|
12489
12817
|
}
|
12818
|
+
/**
|
12819
|
+
* 注销插件
|
12820
|
+
*/
|
12490
12821
|
static unregister(kind) {
|
12491
12822
|
return appRegister.unregister(kind);
|
12492
12823
|
}
|
12824
|
+
/**
|
12825
|
+
* 创建一个 app 至白板
|
12826
|
+
*/
|
12493
12827
|
async addApp(params) {
|
12494
12828
|
if (this.appManager) {
|
12495
12829
|
if (this.appManager.rootDirRemoving) {
|
@@ -12576,11 +12910,17 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12576
12910
|
}
|
12577
12911
|
return isDynamicPPT;
|
12578
12912
|
}
|
12913
|
+
/**
|
12914
|
+
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
12915
|
+
*/
|
12579
12916
|
async setMainViewScenePath(scenePath) {
|
12580
12917
|
if (this.appManager) {
|
12581
12918
|
await this.appManager.setMainViewScenePath(scenePath);
|
12582
12919
|
}
|
12583
12920
|
}
|
12921
|
+
/**
|
12922
|
+
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
12923
|
+
*/
|
12584
12924
|
async setMainViewSceneIndex(index2) {
|
12585
12925
|
if (this.appManager) {
|
12586
12926
|
await this.appManager.setMainViewSceneIndex(index2);
|
@@ -12636,6 +12976,11 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12636
12976
|
}
|
12637
12977
|
}
|
12638
12978
|
}
|
12979
|
+
/**
|
12980
|
+
* 删除一页
|
12981
|
+
* 默认删除当前页, 可以删除指定 index 页
|
12982
|
+
* 最低保留一页
|
12983
|
+
*/
|
12639
12984
|
async removePage(index2) {
|
12640
12985
|
if (this.appManager) {
|
12641
12986
|
const needRemoveIndex = index2 === void 0 ? this.pageState.index : index2;
|
@@ -12652,27 +12997,45 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12652
12997
|
return false;
|
12653
12998
|
}
|
12654
12999
|
}
|
13000
|
+
/**
|
13001
|
+
* 返回 mainView 的 ScenePath
|
13002
|
+
*/
|
12655
13003
|
getMainViewScenePath() {
|
12656
13004
|
var _a;
|
12657
13005
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewScenePath();
|
12658
13006
|
}
|
13007
|
+
/**
|
13008
|
+
* 返回 mainView 的 SceneIndex
|
13009
|
+
*/
|
12659
13010
|
getMainViewSceneIndex() {
|
12660
13011
|
var _a;
|
12661
13012
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewSceneIndex();
|
12662
13013
|
}
|
13014
|
+
/**
|
13015
|
+
* 设置所有 app 的 readonly 模式
|
13016
|
+
*/
|
12663
13017
|
setReadonly(readonly) {
|
12664
13018
|
var _a;
|
12665
13019
|
this.readonly = readonly;
|
12666
13020
|
(_a = this.boxManager) == null ? void 0 : _a.setReadonly(readonly);
|
12667
13021
|
emitter.emit("setReadonly", readonly);
|
12668
13022
|
}
|
13023
|
+
/**
|
13024
|
+
* 切换 mainView 为可写
|
13025
|
+
*/
|
12669
13026
|
switchMainViewToWriter() {
|
12670
13027
|
var _a;
|
12671
13028
|
return (_a = this.appManager) == null ? void 0 : _a.mainViewProxy.mainViewClickHandler();
|
12672
13029
|
}
|
13030
|
+
/**
|
13031
|
+
* app destroy 回调
|
13032
|
+
*/
|
12673
13033
|
onAppDestroy(kind, listener) {
|
12674
13034
|
addEmitterOnceListener(`destroy-${kind}`, listener);
|
12675
13035
|
}
|
13036
|
+
/**
|
13037
|
+
* 设置 ViewMode
|
13038
|
+
*/
|
12676
13039
|
setViewMode(mode) {
|
12677
13040
|
var _a;
|
12678
13041
|
log("setViewMode", mode);
|
@@ -12850,14 +13213,23 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12850
13213
|
}
|
12851
13214
|
return this.boxManager.teleBoxManager;
|
12852
13215
|
}
|
13216
|
+
/**
|
13217
|
+
* 查询所有的 App
|
13218
|
+
*/
|
12853
13219
|
queryAll() {
|
12854
13220
|
var _a;
|
12855
13221
|
return Array.from(((_a = this.appManager) == null ? void 0 : _a.appProxies.values()) || []);
|
12856
13222
|
}
|
13223
|
+
/**
|
13224
|
+
* 查询单个 App
|
13225
|
+
*/
|
12857
13226
|
queryOne(appId) {
|
12858
13227
|
var _a;
|
12859
13228
|
return (_a = this.appManager) == null ? void 0 : _a.appProxies.get(appId);
|
12860
13229
|
}
|
13230
|
+
/**
|
13231
|
+
* 关闭 APP
|
13232
|
+
*/
|
12861
13233
|
async closeApp(appId) {
|
12862
13234
|
var _a;
|
12863
13235
|
return (_a = this.appManager) == null ? void 0 : _a.closeApp(appId);
|
@@ -12954,9 +13326,9 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12954
13326
|
var _a;
|
12955
13327
|
(_a = this.focusedView) == null ? void 0 : _a.duplicate();
|
12956
13328
|
}
|
12957
|
-
insertText(
|
13329
|
+
insertText(x, y, text2) {
|
12958
13330
|
var _a;
|
12959
|
-
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(
|
13331
|
+
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(x, y, text2)) || "";
|
12960
13332
|
}
|
12961
13333
|
insertImage(info) {
|
12962
13334
|
var _a;
|
@@ -12979,6 +13351,7 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
12979
13351
|
this._refresh();
|
12980
13352
|
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.Refresh);
|
12981
13353
|
}
|
13354
|
+
/** @inner */
|
12982
13355
|
_refresh() {
|
12983
13356
|
var _a, _b;
|
12984
13357
|
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.rebind();
|
@@ -13016,6 +13389,9 @@ const _WindowManager = class extends InvisiblePlugin {
|
|
13016
13389
|
});
|
13017
13390
|
}, 500);
|
13018
13391
|
}
|
13392
|
+
/**
|
13393
|
+
* 切换 focus 到指定的 app, 并且把这个 app 放到最前面
|
13394
|
+
*/
|
13019
13395
|
focusApp(appId) {
|
13020
13396
|
var _a, _b, _c;
|
13021
13397
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(appId);
|