@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.umd.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
(function(
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("p-retry"), require("emittery"), require("lodash"), require("white-web-sdk"), require("uuid"), require("@netless/synced-store"), require("value-enhancer"), require("side-effect-manager"), require("@juggle/resize-observer")) : typeof define === "function" && define.amd ? define(["exports", "p-retry", "emittery", "lodash", "white-web-sdk", "uuid", "@netless/synced-store", "value-enhancer", "side-effect-manager", "@juggle/resize-observer"], factory) : (
|
1
|
+
(function(global2, factory) {
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("p-retry"), require("emittery"), require("lodash"), require("white-web-sdk"), require("uuid"), require("@netless/synced-store"), require("value-enhancer"), require("side-effect-manager"), require("@juggle/resize-observer")) : typeof define === "function" && define.amd ? define(["exports", "p-retry", "emittery", "lodash", "white-web-sdk", "uuid", "@netless/synced-store", "value-enhancer", "side-effect-manager", "@juggle/resize-observer"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WindowManager = {}, global2.pRetry, global2.Emittery, global2.lodash, global2.whiteWebSdk, global2.uuid, global2.syncedStore, global2.valueEnhancer, global2.sideEffectManager, global2.resizeObserver));
|
3
3
|
})(this, function(exports2, pRetry, Emittery, lodash, whiteWebSdk, uuid, syncedStore, valueEnhancer, sideEffectManager, resizeObserver) {
|
4
4
|
"use strict";
|
5
5
|
var Events = /* @__PURE__ */ ((Events2) => {
|
@@ -590,9 +590,14 @@
|
|
590
590
|
this.moveCameraHandler = (payload) => {
|
591
591
|
const size$ = this.manager.mainViewProxy.size$;
|
592
592
|
if (size$.value) {
|
593
|
-
const
|
594
|
-
|
595
|
-
|
593
|
+
const nextCamera = { ...payload };
|
594
|
+
if (nextCamera.scale) {
|
595
|
+
const size = this.manager.mainView.size;
|
596
|
+
const diff = Math.max(size.height / size$.value.height, size.width / size$.value.width);
|
597
|
+
nextCamera.scale *= diff;
|
598
|
+
} else {
|
599
|
+
delete nextCamera.scale;
|
600
|
+
}
|
596
601
|
this.manager.mainView.moveCamera(nextCamera);
|
597
602
|
}
|
598
603
|
};
|
@@ -769,11 +774,17 @@
|
|
769
774
|
}
|
770
775
|
};
|
771
776
|
const findMemberByUid = (room, uid) => {
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
+
var _a;
|
778
|
+
const roomMembers = (room == null ? void 0 : room.state.roomMembers) || [];
|
779
|
+
let maxMemberId = -1;
|
780
|
+
let result = void 0;
|
781
|
+
for (const member of roomMembers) {
|
782
|
+
if (((_a = member.payload) == null ? void 0 : _a.uid) === uid && maxMemberId < member.memberId) {
|
783
|
+
maxMemberId = member.memberId;
|
784
|
+
result = member;
|
785
|
+
}
|
786
|
+
}
|
787
|
+
return result;
|
777
788
|
};
|
778
789
|
const serializeRoomMembers = (members) => {
|
779
790
|
return members.map((member) => {
|
@@ -962,9 +973,11 @@
|
|
962
973
|
return this.displayer.calibrationTimestamp;
|
963
974
|
}
|
964
975
|
}
|
976
|
+
/** Get App writable status. */
|
965
977
|
get isWritable() {
|
966
978
|
return this.appProxy.isWritable && !this.destroyed;
|
967
979
|
}
|
980
|
+
/** Get the App Window UI box. */
|
968
981
|
get box() {
|
969
982
|
const box = this.appProxy.box$.value;
|
970
983
|
if (box) {
|
@@ -979,6 +992,7 @@
|
|
979
992
|
get members() {
|
980
993
|
return this.manager.members$.value;
|
981
994
|
}
|
995
|
+
//** currentMember is undefined in read-only and replay mode. */
|
982
996
|
get currentMember() {
|
983
997
|
const self2 = findMemberByUid(this.room, this.manager.uid);
|
984
998
|
if (!self2) {
|
@@ -1264,9 +1278,15 @@
|
|
1264
1278
|
this.context = context;
|
1265
1279
|
this.setAppFocus = (appId, focus) => {
|
1266
1280
|
if (focus) {
|
1267
|
-
this.context.safeSetAttributes({ [
|
1281
|
+
this.context.safeSetAttributes({ [
|
1282
|
+
"focus"
|
1283
|
+
/* Focus */
|
1284
|
+
]: appId });
|
1268
1285
|
} else {
|
1269
|
-
this.context.safeSetAttributes({ [
|
1286
|
+
this.context.safeSetAttributes({ [
|
1287
|
+
"focus"
|
1288
|
+
/* Focus */
|
1289
|
+
]: void 0 });
|
1270
1290
|
}
|
1271
1291
|
};
|
1272
1292
|
}
|
@@ -1277,16 +1297,26 @@
|
|
1277
1297
|
return this.context.getAttributes();
|
1278
1298
|
}
|
1279
1299
|
apps() {
|
1280
|
-
return lodash.get(this.attributes, [
|
1300
|
+
return lodash.get(this.attributes, [
|
1301
|
+
"apps"
|
1302
|
+
/* Apps */
|
1303
|
+
]);
|
1281
1304
|
}
|
1282
1305
|
get focus() {
|
1283
|
-
return lodash.get(this.attributes, [
|
1306
|
+
return lodash.get(this.attributes, [
|
1307
|
+
"focus"
|
1308
|
+
/* Focus */
|
1309
|
+
]);
|
1284
1310
|
}
|
1285
1311
|
getAppAttributes(id) {
|
1286
1312
|
return lodash.get(this.apps(), [id]);
|
1287
1313
|
}
|
1288
1314
|
getAppState(id) {
|
1289
|
-
return lodash.get(this.apps(), [
|
1315
|
+
return lodash.get(this.apps(), [
|
1316
|
+
id,
|
1317
|
+
"state"
|
1318
|
+
/* State */
|
1319
|
+
]);
|
1290
1320
|
}
|
1291
1321
|
getMaximized() {
|
1292
1322
|
return lodash.get(this.attributes, ["maximized"]);
|
@@ -1310,14 +1340,24 @@
|
|
1310
1340
|
}
|
1311
1341
|
attrs.createdAt = Date.now();
|
1312
1342
|
this.context.safeUpdateAttributes(["apps", id], attrs);
|
1313
|
-
this.context.safeUpdateAttributes([
|
1343
|
+
this.context.safeUpdateAttributes([
|
1344
|
+
"apps",
|
1345
|
+
id,
|
1346
|
+
"state"
|
1347
|
+
/* State */
|
1348
|
+
], {
|
1314
1349
|
[AppAttributes.Size]: {},
|
1315
1350
|
[AppAttributes.Position]: {},
|
1316
1351
|
[AppAttributes.SceneIndex]: 0
|
1317
1352
|
});
|
1318
1353
|
}
|
1319
1354
|
updateAppState(appId, stateName, state) {
|
1320
|
-
if (lodash.get(this.attributes, [
|
1355
|
+
if (lodash.get(this.attributes, [
|
1356
|
+
"apps",
|
1357
|
+
appId,
|
1358
|
+
"state"
|
1359
|
+
/* State */
|
1360
|
+
])) {
|
1321
1361
|
this.context.safeUpdateAttributes(["apps", appId, "state", stateName], state);
|
1322
1362
|
}
|
1323
1363
|
}
|
@@ -1327,13 +1367,19 @@
|
|
1327
1367
|
cleanAppAttributes(id) {
|
1328
1368
|
this.context.safeUpdateAttributes(["apps", id], void 0);
|
1329
1369
|
this.context.safeSetAttributes({ [id]: void 0 });
|
1330
|
-
const focus = this.attributes[
|
1370
|
+
const focus = this.attributes[
|
1371
|
+
"focus"
|
1372
|
+
/* Focus */
|
1373
|
+
];
|
1331
1374
|
if (focus === id) {
|
1332
1375
|
this.cleanFocus();
|
1333
1376
|
}
|
1334
1377
|
}
|
1335
1378
|
cleanFocus() {
|
1336
|
-
this.context.safeSetAttributes({ [
|
1379
|
+
this.context.safeSetAttributes({ [
|
1380
|
+
"focus"
|
1381
|
+
/* Focus */
|
1382
|
+
]: void 0 });
|
1337
1383
|
}
|
1338
1384
|
getAppSceneIndex(id) {
|
1339
1385
|
var _a;
|
@@ -1350,7 +1396,10 @@
|
|
1350
1396
|
return this.attributes["_mainSceneIndex"];
|
1351
1397
|
}
|
1352
1398
|
getBoxState() {
|
1353
|
-
return this.attributes[
|
1399
|
+
return this.attributes[
|
1400
|
+
"boxState"
|
1401
|
+
/* BoxState */
|
1402
|
+
];
|
1354
1403
|
}
|
1355
1404
|
setMainViewScenePath(scenePath) {
|
1356
1405
|
this.context.safeSetAttributes({ _mainScenePath: scenePath });
|
@@ -1359,44 +1408,84 @@
|
|
1359
1408
|
this.context.safeSetAttributes({ _mainSceneIndex: index2 });
|
1360
1409
|
}
|
1361
1410
|
getMainViewCamera() {
|
1362
|
-
return lodash.get(this.attributes, [
|
1411
|
+
return lodash.get(this.attributes, [
|
1412
|
+
"mainViewCamera"
|
1413
|
+
/* MainViewCamera */
|
1414
|
+
]);
|
1363
1415
|
}
|
1364
1416
|
getMainViewSize() {
|
1365
|
-
return lodash.get(this.attributes, [
|
1417
|
+
return lodash.get(this.attributes, [
|
1418
|
+
"mainViewSize"
|
1419
|
+
/* MainViewSize */
|
1420
|
+
]);
|
1366
1421
|
}
|
1367
1422
|
setMainViewCamera(camera) {
|
1368
|
-
this.context.safeSetAttributes({ [
|
1423
|
+
this.context.safeSetAttributes({ [
|
1424
|
+
"mainViewCamera"
|
1425
|
+
/* MainViewCamera */
|
1426
|
+
]: { ...camera } });
|
1369
1427
|
}
|
1370
1428
|
setMainViewSize(size) {
|
1371
|
-
this.context.safeSetAttributes({ [
|
1429
|
+
this.context.safeSetAttributes({ [
|
1430
|
+
"mainViewSize"
|
1431
|
+
/* MainViewSize */
|
1432
|
+
]: { ...size } });
|
1372
1433
|
}
|
1373
1434
|
setMainViewCameraAndSize(camera, size) {
|
1374
1435
|
this.context.safeSetAttributes({
|
1375
|
-
[
|
1376
|
-
|
1436
|
+
[
|
1437
|
+
"mainViewCamera"
|
1438
|
+
/* MainViewCamera */
|
1439
|
+
]: { ...camera },
|
1440
|
+
[
|
1441
|
+
"mainViewSize"
|
1442
|
+
/* MainViewSize */
|
1443
|
+
]: { ...size }
|
1377
1444
|
});
|
1378
1445
|
}
|
1379
1446
|
updateCursor(uid, position) {
|
1380
|
-
if (!lodash.get(this.attributes, [
|
1381
|
-
|
1447
|
+
if (!lodash.get(this.attributes, [
|
1448
|
+
"cursors"
|
1449
|
+
/* Cursors */
|
1450
|
+
])) {
|
1451
|
+
this.context.safeUpdateAttributes([
|
1452
|
+
"cursors"
|
1453
|
+
/* Cursors */
|
1454
|
+
], {});
|
1382
1455
|
}
|
1383
1456
|
if (!lodash.get(this.attributes, ["cursors", uid])) {
|
1384
1457
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1385
1458
|
}
|
1386
|
-
this.context.safeUpdateAttributes([
|
1459
|
+
this.context.safeUpdateAttributes([
|
1460
|
+
"cursors",
|
1461
|
+
uid,
|
1462
|
+
"position"
|
1463
|
+
/* Position */
|
1464
|
+
], position);
|
1387
1465
|
}
|
1388
1466
|
updateCursorState(uid, cursorState) {
|
1389
1467
|
if (!lodash.get(this.attributes, ["cursors", uid])) {
|
1390
1468
|
this.context.safeUpdateAttributes(["cursors", uid], {});
|
1391
1469
|
}
|
1392
|
-
this.context.safeUpdateAttributes([
|
1470
|
+
this.context.safeUpdateAttributes([
|
1471
|
+
"cursors",
|
1472
|
+
uid,
|
1473
|
+
"cursorState"
|
1474
|
+
/* CursorState */
|
1475
|
+
], cursorState);
|
1393
1476
|
}
|
1394
1477
|
getCursorState(uid) {
|
1395
|
-
return lodash.get(this.attributes, [
|
1478
|
+
return lodash.get(this.attributes, [
|
1479
|
+
"cursors",
|
1480
|
+
uid,
|
1481
|
+
"cursorState"
|
1482
|
+
/* CursorState */
|
1483
|
+
]);
|
1396
1484
|
}
|
1397
1485
|
cleanCursor(uid) {
|
1398
1486
|
this.context.safeUpdateAttributes(["cursors", uid], void 0);
|
1399
1487
|
}
|
1488
|
+
// TODO 状态中保存一个 SceneName 优化性能
|
1400
1489
|
setMainViewFocusPath(mainView) {
|
1401
1490
|
const scenePath = this.getMainViewScenePath();
|
1402
1491
|
if (scenePath) {
|
@@ -1844,6 +1933,7 @@
|
|
1844
1933
|
throw new Error(`[WindowManager]: app setup error: ${error.message}`);
|
1845
1934
|
}
|
1846
1935
|
}
|
1936
|
+
// 兼容移动端创建时会出现 PPT 不适配的问题
|
1847
1937
|
fixMobileSize() {
|
1848
1938
|
var _a, _b;
|
1849
1939
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(this.id);
|
@@ -1974,6 +2064,7 @@
|
|
1974
2064
|
get pageState() {
|
1975
2065
|
return this._pageState.toObject();
|
1976
2066
|
}
|
2067
|
+
// PageRemoveService
|
1977
2068
|
async removeSceneByIndex(index2) {
|
1978
2069
|
const scenePath = this._pageState.getFullPath(index2);
|
1979
2070
|
if (scenePath && this.pageState) {
|
@@ -1997,6 +2088,7 @@
|
|
1997
2088
|
this.view.focusSceneIndex = index2;
|
1998
2089
|
}
|
1999
2090
|
}
|
2091
|
+
// PageRemoveService end
|
2000
2092
|
setSceneIndex(index2) {
|
2001
2093
|
if (this.view) {
|
2002
2094
|
this.view.focusSceneIndex = index2;
|
@@ -2508,8 +2600,8 @@
|
|
2508
2600
|
defaultState: { scrollTop: 0 }
|
2509
2601
|
});
|
2510
2602
|
};
|
2511
|
-
function clamp$2(
|
2512
|
-
return
|
2603
|
+
function clamp$2(x, min, max) {
|
2604
|
+
return x < min ? min : x > max ? max : x;
|
2513
2605
|
}
|
2514
2606
|
class ScrollMode {
|
2515
2607
|
constructor(manager) {
|
@@ -3068,6 +3160,10 @@
|
|
3068
3160
|
});
|
3069
3161
|
});
|
3070
3162
|
}
|
3163
|
+
/**
|
3164
|
+
* 根目录被删除时所有的 scene 都会被删除.
|
3165
|
+
* 所以需要关掉所有开启了 view 的 app
|
3166
|
+
*/
|
3071
3167
|
async onRootDirRemoved(needClose = true) {
|
3072
3168
|
await this.setMainViewScenePath(INIT_DIR);
|
3073
3169
|
this.createRootDirScenesCallback();
|
@@ -3172,6 +3268,12 @@
|
|
3172
3268
|
return () => redoUndo.destroy();
|
3173
3269
|
});
|
3174
3270
|
}
|
3271
|
+
/**
|
3272
|
+
* 插件更新 apps 时的回调
|
3273
|
+
*
|
3274
|
+
* @param {*} apps
|
3275
|
+
* @memberof WindowManager
|
3276
|
+
*/
|
3175
3277
|
async _attributesUpdateCallback(apps) {
|
3176
3278
|
if (apps && WindowManager.container) {
|
3177
3279
|
const appIds = Object.keys(apps);
|
@@ -3438,6 +3540,20 @@
|
|
3438
3540
|
(_a = this.scrollMode) == null ? void 0 : _a.dispose();
|
3439
3541
|
}
|
3440
3542
|
}
|
3543
|
+
/*! *****************************************************************************
|
3544
|
+
Copyright (c) Microsoft Corporation.
|
3545
|
+
|
3546
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
3547
|
+
purpose with or without fee is hereby granted.
|
3548
|
+
|
3549
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
3550
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
3551
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
3552
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
3553
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
3554
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
3555
|
+
PERFORMANCE OF THIS SOFTWARE.
|
3556
|
+
***************************************************************************** */
|
3441
3557
|
var __assign = function() {
|
3442
3558
|
__assign = Object.assign || function __assign2(t) {
|
3443
3559
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
@@ -4246,6 +4362,9 @@
|
|
4246
4362
|
var node = typeof nodeOrSelector === "string" ? document.querySelector(nodeOrSelector) : nodeOrSelector;
|
4247
4363
|
return getStyler(node, props);
|
4248
4364
|
}
|
4365
|
+
function getDefaultExportFromCjs(x) {
|
4366
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
4367
|
+
}
|
4249
4368
|
var shallowequal = function shallowEqual(objA, objB, compare, compareContext) {
|
4250
4369
|
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
4251
4370
|
if (ret !== void 0) {
|
@@ -4277,6 +4396,7 @@
|
|
4277
4396
|
}
|
4278
4397
|
return true;
|
4279
4398
|
};
|
4399
|
+
const shallowequal$1 = /* @__PURE__ */ getDefaultExportFromCjs(shallowequal);
|
4280
4400
|
var shadowStyles = /* @__PURE__ */ (() => '.tele-fancy-scrollbar {\n overscroll-behavior: contain;\n overflow: auto;\n overflow-y: scroll;\n overflow-y: overlay;\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n scrollbar-width: auto;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar {\n height: 8px;\n width: 8px;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-track {\n background-color: transparent;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb {\n background-color: rgba(68, 78, 96, 0.1);\n background-color: transparent;\n border-radius: 4px;\n transition: background-color 0.4s;\n}\n.tele-fancy-scrollbar:hover::-webkit-scrollbar-thumb {\n background-color: rgba(68, 78, 96, 0.1);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:hover {\n background-color: rgba(68, 78, 96, 0.2);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:active {\n background-color: rgba(68, 78, 96, 0.2);\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:vertical {\n min-height: 50px;\n}\n.tele-fancy-scrollbar::-webkit-scrollbar-thumb:horizontal {\n min-width: 50px;\n}\n.telebox-quarantine {\n all: initial;\n position: relative;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n.telebox-body-wrap {\n color: #191919;\n color: var(--tele-boxColor, #191919);\n flex: 1;\n width: 100%;\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n}\n.telebox-content {\n width: 100%;\n height: 100%;\n position: relative;\n background-color: #f9f9f9;\n background-color: var(--tele-boxContainerBackground, #f9f9f9);\n}\n.telebox-box-stage {\n position: absolute;\n z-index: 1;\n overflow: hidden;\n background-color: #fff;\n background-color: var(--tele-boxStageBackground, #fff);\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);\n box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.08));\n}\n.telebox-footer-wrap {\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n color: #191919;\n color: var(--tele-boxFooterColor, #191919);\n background-color: #fff;\n background-color: var(--tele-boxFooterBackground, #fff);\n}\n.telebox-footer-wrap::before {\n content: "";\n display: block;\n flex: 1;\n}\n.telebox-color-scheme-dark {\n color-scheme: dark;\n}\n.telebox-color-scheme-dark .telebox-body-wrap {\n color: #e9e9e9;\n color: var(--tele-boxColor, #e9e9e9);\n}\n.telebox-color-scheme-dark .telebox-content {\n background-color: #25282e;\n background-color: var(--tele-boxContainerBackground, #25282e);\n}\n.telebox-color-scheme-dark .telebox-box-stage {\n background-color: #272a30;\n background-color: var(--tele-boxStageBackground, #272a30);\n box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.24);\n box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.24));\n}\n.telebox-color-scheme-dark .telebox-footer-wrap {\n color: #e9e9e9;\n color: var(--tele-boxFooterColor, #e9e9e9);\n background-color: #383b42;\n background-color: var(--tele-boxFooterBackground, #383b42);\n}')();
|
4281
4401
|
var TELE_BOX_COLOR_SCHEME = /* @__PURE__ */ ((TELE_BOX_COLOR_SCHEME2) => {
|
4282
4402
|
TELE_BOX_COLOR_SCHEME2["Light"] = "light";
|
@@ -4516,7 +4636,7 @@
|
|
4516
4636
|
height = 0.5,
|
4517
4637
|
minWidth = 0,
|
4518
4638
|
minHeight = 0,
|
4519
|
-
x
|
4639
|
+
x = 0.1,
|
4520
4640
|
y = 0.1,
|
4521
4641
|
resizable = true,
|
4522
4642
|
draggable = true,
|
@@ -4575,36 +4695,36 @@
|
|
4575
4695
|
const minSize$ = new valueEnhancer.Val({
|
4576
4696
|
width: clamp(minWidth, 0, 1),
|
4577
4697
|
height: clamp(minHeight, 0, 1)
|
4578
|
-
}, { compare: shallowequal });
|
4698
|
+
}, { compare: shallowequal$1 });
|
4579
4699
|
const pxMinSize$ = valueEnhancer.combine([minSize$, managerStageRect$], ([minSize, managerStageRect]) => ({
|
4580
4700
|
width: minSize.width * managerStageRect.width,
|
4581
4701
|
height: minSize.height * managerStageRect.height
|
4582
|
-
}), { compare: shallowequal });
|
4583
|
-
const intrinsicSize$ = new valueEnhancer.Val({ width, height }, { compare: shallowequal });
|
4702
|
+
}), { compare: shallowequal$1 });
|
4703
|
+
const intrinsicSize$ = new valueEnhancer.Val({ width, height }, { compare: shallowequal$1 });
|
4584
4704
|
this._sideEffect.addDisposer(minSize$.reaction((minSize, skipUpdate) => {
|
4585
4705
|
intrinsicSize$.setValue({
|
4586
4706
|
width: Math.max(width, minSize.width),
|
4587
4707
|
height: Math.max(height, minSize.height)
|
4588
4708
|
}, skipUpdate);
|
4589
4709
|
}));
|
4590
|
-
const intrinsicCoord$ = new valueEnhancer.Val({ x
|
4710
|
+
const intrinsicCoord$ = new valueEnhancer.Val({ x, y }, { compare: shallowequal$1 });
|
4591
4711
|
const pxIntrinsicSize$ = valueEnhancer.combine([intrinsicSize$, managerStageRect$], ([size, managerStageRect]) => ({
|
4592
4712
|
width: managerStageRect.width * size.width,
|
4593
4713
|
height: managerStageRect.height * size.height
|
4594
|
-
}), { compare: shallowequal });
|
4714
|
+
}), { compare: shallowequal$1 });
|
4595
4715
|
const pxIntrinsicCoord$ = valueEnhancer.combine([intrinsicCoord$, managerStageRect$], ([intrinsicCoord, managerStageRect]) => ({
|
4596
4716
|
x: intrinsicCoord.x * managerStageRect.width,
|
4597
4717
|
y: intrinsicCoord.y * managerStageRect.height
|
4598
|
-
}), { compare: shallowequal });
|
4718
|
+
}), { compare: shallowequal$1 });
|
4599
4719
|
const bodyStyle$ = new valueEnhancer.Val(bodyStyle);
|
4600
4720
|
const stageStyle$ = new valueEnhancer.Val(stageStyle);
|
4601
4721
|
const contentRoot$ = new valueEnhancer.Val(null);
|
4602
4722
|
const bodyRect$ = new valueEnhancer.Val(managerStageRect$.value, {
|
4603
|
-
compare: shallowequal
|
4723
|
+
compare: shallowequal$1
|
4604
4724
|
});
|
4605
4725
|
const stageRatio$ = new valueEnhancer.Val(stageRatio);
|
4606
4726
|
const finalStageRatio$ = valueEnhancer.combine([stageRatio$, managerStageRatio$], ([stageRatio2, managerStageRatio]) => stageRatio2 != null ? stageRatio2 : managerStageRatio);
|
4607
|
-
const stageRect$ = valueEnhancer.combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal });
|
4727
|
+
const stageRect$ = valueEnhancer.combine([bodyRect$, finalStageRatio$], calcStageRect, { compare: shallowequal$1 });
|
4608
4728
|
const propsValConfig = {
|
4609
4729
|
darkMode: darkMode$,
|
4610
4730
|
fence: fence$,
|
@@ -4737,16 +4857,16 @@
|
|
4737
4857
|
get intrinsicHeight() {
|
4738
4858
|
return this._intrinsicSize$.value.height;
|
4739
4859
|
}
|
4740
|
-
move(
|
4860
|
+
move(x, y, skipUpdate = false) {
|
4741
4861
|
let safeX;
|
4742
4862
|
let safeY;
|
4743
4863
|
const managerStageRect = this.managerStageRect;
|
4744
4864
|
const pxIntrinsicSize = this.pxIntrinsicSize;
|
4745
4865
|
if (this.fence) {
|
4746
|
-
safeX = clamp(
|
4866
|
+
safeX = clamp(x, 0, managerStageRect.width - pxIntrinsicSize.width);
|
4747
4867
|
safeY = clamp(y, 0, managerStageRect.height - pxIntrinsicSize.height);
|
4748
4868
|
} else {
|
4749
|
-
safeX = clamp(
|
4869
|
+
safeX = clamp(x, -(pxIntrinsicSize.width - 120), 0 + managerStageRect.width - 20);
|
4750
4870
|
safeY = clamp(y, 0, 0 + managerStageRect.height - 20);
|
4751
4871
|
}
|
4752
4872
|
this._intrinsicCoord$.setValue({
|
@@ -4754,7 +4874,7 @@
|
|
4754
4874
|
y: safeY / managerStageRect.height
|
4755
4875
|
}, skipUpdate);
|
4756
4876
|
}
|
4757
|
-
transform(
|
4877
|
+
transform(x, y, width, height, skipUpdate = false) {
|
4758
4878
|
const managerStageRect = this.managerStageRect;
|
4759
4879
|
width = Math.max(width, this.pxMinSize.width);
|
4760
4880
|
height = Math.max(height, this.pxMinSize.height);
|
@@ -4769,7 +4889,7 @@
|
|
4769
4889
|
y = 0;
|
4770
4890
|
height = this.pxIntrinsicSize.height;
|
4771
4891
|
}
|
4772
|
-
this.move(
|
4892
|
+
this.move(x, y, skipUpdate);
|
4773
4893
|
this._intrinsicSize$.setValue({
|
4774
4894
|
width: width / managerStageRect.width,
|
4775
4895
|
height: height / managerStageRect.height
|
@@ -4914,7 +5034,7 @@
|
|
4914
5034
|
styles.scaleY = collectorRect.height / boxHeight;
|
4915
5035
|
}
|
4916
5036
|
return styles;
|
4917
|
-
}, { compare: shallowequal });
|
5037
|
+
}, { compare: shallowequal$1 });
|
4918
5038
|
const boxStyles = boxStyles$.value;
|
4919
5039
|
this.$box.style.width = boxStyles.width + "px";
|
4920
5040
|
this.$box.style.height = boxStyles.height + "px";
|
@@ -5228,10 +5348,10 @@
|
|
5228
5348
|
}),
|
5229
5349
|
minimized$.subscribe((minimized) => {
|
5230
5350
|
if (minimized) {
|
5231
|
-
const { x
|
5351
|
+
const { x, y, width, height } = $collector.getBoundingClientRect();
|
5232
5352
|
const rootRect = root.getBoundingClientRect();
|
5233
5353
|
rect$.setValue({
|
5234
|
-
x:
|
5354
|
+
x: x - rootRect.x,
|
5235
5355
|
y: y - rootRect.y,
|
5236
5356
|
width,
|
5237
5357
|
height
|
@@ -5398,7 +5518,7 @@
|
|
5398
5518
|
y: 0,
|
5399
5519
|
width: window.innerWidth,
|
5400
5520
|
height: window.innerHeight
|
5401
|
-
}, { compare: shallowequal });
|
5521
|
+
}, { compare: shallowequal$1 });
|
5402
5522
|
this._sideEffect.addDisposer(root$.subscribe((root2) => {
|
5403
5523
|
this._sideEffect.add(() => {
|
5404
5524
|
if (!root2) {
|
@@ -5418,7 +5538,7 @@
|
|
5418
5538
|
}, "calc-root-rect");
|
5419
5539
|
}));
|
5420
5540
|
const stageRect$ = valueEnhancer.combine([rootRect$, stageRatio$], calcStageRect, {
|
5421
|
-
compare: shallowequal
|
5541
|
+
compare: shallowequal$1
|
5422
5542
|
});
|
5423
5543
|
this.boxes$ = new valueEnhancer.Val([]);
|
5424
5544
|
this.topBox$ = new valueEnhancer.Val(void 0);
|
@@ -5456,7 +5576,7 @@
|
|
5456
5576
|
const darkMode$ = valueEnhancer.combine([prefersDark$, prefersColorScheme$], ([prefersDark, prefersColorScheme2]) => prefersColorScheme2 === "auto" ? prefersDark : prefersColorScheme2 === "dark");
|
5457
5577
|
const state$ = valueEnhancer.combine([minimized$, maximized$], ([minimized2, maximized2]) => minimized2 ? TELE_BOX_STATE.Minimized : maximized2 ? TELE_BOX_STATE.Maximized : TELE_BOX_STATE.Normal);
|
5458
5578
|
const theme$ = new valueEnhancer.Val(theme, {
|
5459
|
-
compare: shallowequal
|
5579
|
+
compare: shallowequal$1
|
5460
5580
|
});
|
5461
5581
|
const readonlyValConfig = {
|
5462
5582
|
darkMode: darkMode$,
|
@@ -5875,11 +5995,11 @@
|
|
5875
5995
|
}
|
5876
5996
|
}
|
5877
5997
|
smartPosition(rect) {
|
5878
|
-
let { x
|
5998
|
+
let { x, y } = rect;
|
5879
5999
|
const { width = 0.5, height = 0.5 } = rect;
|
5880
6000
|
const stageRect = this.stageRect;
|
5881
6001
|
const topBox = this.topBox;
|
5882
|
-
if (
|
6002
|
+
if (x == null) {
|
5883
6003
|
let pxX = 20;
|
5884
6004
|
if (topBox) {
|
5885
6005
|
const pxPreferredX = topBox.pxIntrinsicCoord.x + 20;
|
@@ -5888,7 +6008,7 @@
|
|
5888
6008
|
pxX = pxPreferredX;
|
5889
6009
|
}
|
5890
6010
|
}
|
5891
|
-
|
6011
|
+
x = pxX / stageRect.width;
|
5892
6012
|
}
|
5893
6013
|
if (y == null) {
|
5894
6014
|
let pxY = 20;
|
@@ -5901,7 +6021,7 @@
|
|
5901
6021
|
}
|
5902
6022
|
y = pxY / stageRect.height;
|
5903
6023
|
}
|
5904
|
-
return { x
|
6024
|
+
return { x, y, width, height };
|
5905
6025
|
}
|
5906
6026
|
makeBoxTop(box, skipUpdate = false) {
|
5907
6027
|
if (this.topBox) {
|
@@ -5952,6 +6072,10 @@
|
|
5952
6072
|
const { emitter: emitter2, callbacks: callbacks2, boxEmitter: boxEmitter2 } = context;
|
5953
6073
|
this.teleBoxManager = this.setupBoxManager(createTeleBoxManagerConfig);
|
5954
6074
|
this.sideEffectManager.add(() => [
|
6075
|
+
this.teleBoxManager.onValChanged("rootRect", (rect) => {
|
6076
|
+
emitter2.emit("playgroundSizeChange", rect);
|
6077
|
+
}),
|
6078
|
+
// 使用 _xxx$.reaction 订阅修改的值, 不管有没有 skipUpdate, 修改值都会触发回调
|
5955
6079
|
this.teleBoxManager.onValChanged("state", (state) => {
|
5956
6080
|
callbacks2.emit("boxStateChange", state);
|
5957
6081
|
emitter2.emit("boxStateChange", state);
|
@@ -6168,10 +6292,10 @@
|
|
6168
6292
|
this.context.callbacks.emit("boxStateChange", this.teleBoxManager.state);
|
6169
6293
|
}
|
6170
6294
|
}
|
6171
|
-
moveBox({ appId, x
|
6295
|
+
moveBox({ appId, x, y }) {
|
6172
6296
|
const box = this.getBox(appId);
|
6173
6297
|
if (box) {
|
6174
|
-
box._intrinsicCoord$.setValue({ x
|
6298
|
+
box._intrinsicCoord$.setValue({ x, y }, true);
|
6175
6299
|
}
|
6176
6300
|
}
|
6177
6301
|
focusBox({ appId }, skipUpdate = true) {
|
@@ -6270,6 +6394,9 @@
|
|
6270
6394
|
function is_empty(obj) {
|
6271
6395
|
return Object.keys(obj).length === 0;
|
6272
6396
|
}
|
6397
|
+
/* @__PURE__ */ new Set();
|
6398
|
+
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
6399
|
+
"WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
6273
6400
|
function append(target, node) {
|
6274
6401
|
target.appendChild(node);
|
6275
6402
|
}
|
@@ -6301,25 +6428,27 @@
|
|
6301
6428
|
}
|
6302
6429
|
function set_data(text2, data) {
|
6303
6430
|
data = "" + data;
|
6304
|
-
if (text2.
|
6305
|
-
|
6431
|
+
if (text2.data === data)
|
6432
|
+
return;
|
6433
|
+
text2.data = data;
|
6306
6434
|
}
|
6307
6435
|
function set_style(node, key, value, important) {
|
6308
|
-
if (value
|
6436
|
+
if (value == null) {
|
6309
6437
|
node.style.removeProperty(key);
|
6310
6438
|
} else {
|
6311
6439
|
node.style.setProperty(key, value, important ? "important" : "");
|
6312
6440
|
}
|
6313
6441
|
}
|
6442
|
+
/* @__PURE__ */ new Map();
|
6314
6443
|
let current_component;
|
6315
6444
|
function set_current_component(component) {
|
6316
6445
|
current_component = component;
|
6317
6446
|
}
|
6318
6447
|
const dirty_components = [];
|
6319
6448
|
const binding_callbacks = [];
|
6320
|
-
|
6449
|
+
let render_callbacks = [];
|
6321
6450
|
const flush_callbacks = [];
|
6322
|
-
const resolved_promise = Promise.resolve();
|
6451
|
+
const resolved_promise = /* @__PURE__ */ Promise.resolve();
|
6323
6452
|
let update_scheduled = false;
|
6324
6453
|
function schedule_update() {
|
6325
6454
|
if (!update_scheduled) {
|
@@ -6333,13 +6462,22 @@
|
|
6333
6462
|
const seen_callbacks = /* @__PURE__ */ new Set();
|
6334
6463
|
let flushidx = 0;
|
6335
6464
|
function flush() {
|
6465
|
+
if (flushidx !== 0) {
|
6466
|
+
return;
|
6467
|
+
}
|
6336
6468
|
const saved_component = current_component;
|
6337
6469
|
do {
|
6338
|
-
|
6339
|
-
|
6340
|
-
|
6341
|
-
|
6342
|
-
|
6470
|
+
try {
|
6471
|
+
while (flushidx < dirty_components.length) {
|
6472
|
+
const component = dirty_components[flushidx];
|
6473
|
+
flushidx++;
|
6474
|
+
set_current_component(component);
|
6475
|
+
update(component.$$);
|
6476
|
+
}
|
6477
|
+
} catch (e) {
|
6478
|
+
dirty_components.length = 0;
|
6479
|
+
flushidx = 0;
|
6480
|
+
throw e;
|
6343
6481
|
}
|
6344
6482
|
set_current_component(null);
|
6345
6483
|
dirty_components.length = 0;
|
@@ -6372,6 +6510,13 @@
|
|
6372
6510
|
$$.after_update.forEach(add_render_callback);
|
6373
6511
|
}
|
6374
6512
|
}
|
6513
|
+
function flush_render_callbacks(fns) {
|
6514
|
+
const filtered = [];
|
6515
|
+
const targets = [];
|
6516
|
+
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
6517
|
+
targets.forEach((c) => c());
|
6518
|
+
render_callbacks = filtered;
|
6519
|
+
}
|
6375
6520
|
const outroing = /* @__PURE__ */ new Set();
|
6376
6521
|
function transition_in(block, local) {
|
6377
6522
|
if (block && block.i) {
|
@@ -6379,6 +6524,34 @@
|
|
6379
6524
|
block.i(local);
|
6380
6525
|
}
|
6381
6526
|
}
|
6527
|
+
const _boolean_attributes = [
|
6528
|
+
"allowfullscreen",
|
6529
|
+
"allowpaymentrequest",
|
6530
|
+
"async",
|
6531
|
+
"autofocus",
|
6532
|
+
"autoplay",
|
6533
|
+
"checked",
|
6534
|
+
"controls",
|
6535
|
+
"default",
|
6536
|
+
"defer",
|
6537
|
+
"disabled",
|
6538
|
+
"formnovalidate",
|
6539
|
+
"hidden",
|
6540
|
+
"inert",
|
6541
|
+
"ismap",
|
6542
|
+
"loop",
|
6543
|
+
"multiple",
|
6544
|
+
"muted",
|
6545
|
+
"nomodule",
|
6546
|
+
"novalidate",
|
6547
|
+
"open",
|
6548
|
+
"playsinline",
|
6549
|
+
"readonly",
|
6550
|
+
"required",
|
6551
|
+
"reversed",
|
6552
|
+
"selected"
|
6553
|
+
];
|
6554
|
+
/* @__PURE__ */ new Set([..._boolean_attributes]);
|
6382
6555
|
function mount_component(component, target, anchor, customElement) {
|
6383
6556
|
const { fragment, after_update } = component.$$;
|
6384
6557
|
fragment && fragment.m(target, anchor);
|
@@ -6398,6 +6571,7 @@
|
|
6398
6571
|
function destroy_component(component, detaching) {
|
6399
6572
|
const $$ = component.$$;
|
6400
6573
|
if ($$.fragment !== null) {
|
6574
|
+
flush_render_callbacks($$.after_update);
|
6401
6575
|
run_all($$.on_destroy);
|
6402
6576
|
$$.fragment && $$.fragment.d(detaching);
|
6403
6577
|
$$.on_destroy = $$.fragment = null;
|
@@ -6418,16 +6592,19 @@
|
|
6418
6592
|
const $$ = component.$$ = {
|
6419
6593
|
fragment: null,
|
6420
6594
|
ctx: [],
|
6595
|
+
// state
|
6421
6596
|
props,
|
6422
6597
|
update: noop,
|
6423
6598
|
not_equal,
|
6424
6599
|
bound: blank_object(),
|
6600
|
+
// lifecycle
|
6425
6601
|
on_mount: [],
|
6426
6602
|
on_destroy: [],
|
6427
6603
|
on_disconnect: [],
|
6428
6604
|
before_update: [],
|
6429
6605
|
after_update: [],
|
6430
6606
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
6607
|
+
// everything else
|
6431
6608
|
callbacks: blank_object(),
|
6432
6609
|
dirty,
|
6433
6610
|
skip_bound: false,
|
@@ -6497,8 +6674,14 @@
|
|
6497
6674
|
let t1;
|
6498
6675
|
let t2;
|
6499
6676
|
let div1_class_value;
|
6500
|
-
let if_block0 =
|
6501
|
-
|
6677
|
+
let if_block0 = (
|
6678
|
+
/*hasAvatar*/
|
6679
|
+
ctx[16] && create_if_block_2(ctx)
|
6680
|
+
);
|
6681
|
+
let if_block1 = (
|
6682
|
+
/*hasTagName*/
|
6683
|
+
ctx[17] && create_if_block_1(ctx)
|
6684
|
+
);
|
6502
6685
|
return {
|
6503
6686
|
c() {
|
6504
6687
|
div1 = element("div");
|
@@ -6507,7 +6690,10 @@
|
|
6507
6690
|
if_block0.c();
|
6508
6691
|
t0 = space();
|
6509
6692
|
span = element("span");
|
6510
|
-
t1 = text$1(
|
6693
|
+
t1 = text$1(
|
6694
|
+
/*cursorName*/
|
6695
|
+
ctx[0]
|
6696
|
+
);
|
6511
6697
|
t2 = space();
|
6512
6698
|
if (if_block1)
|
6513
6699
|
if_block1.c();
|
@@ -6515,11 +6701,33 @@
|
|
6515
6701
|
set_style(span, "white-space", "nowrap");
|
6516
6702
|
set_style(span, "text-overflow", "ellipsis");
|
6517
6703
|
set_style(span, "max-width", "80px");
|
6518
|
-
attr(
|
6519
|
-
|
6520
|
-
|
6521
|
-
|
6522
|
-
|
6704
|
+
attr(
|
6705
|
+
div0,
|
6706
|
+
"class",
|
6707
|
+
/*theme*/
|
6708
|
+
ctx[8]
|
6709
|
+
);
|
6710
|
+
set_style(
|
6711
|
+
div0,
|
6712
|
+
"background-color",
|
6713
|
+
/*backgroundColor*/
|
6714
|
+
ctx[2]
|
6715
|
+
);
|
6716
|
+
set_style(
|
6717
|
+
div0,
|
6718
|
+
"color",
|
6719
|
+
/*color*/
|
6720
|
+
ctx[9]
|
6721
|
+
);
|
6722
|
+
set_style(
|
6723
|
+
div0,
|
6724
|
+
"opacity",
|
6725
|
+
/*opacity*/
|
6726
|
+
ctx[11]
|
6727
|
+
);
|
6728
|
+
attr(div1, "class", div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6729
|
+
ctx[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6730
|
+
ctx[13]);
|
6523
6731
|
},
|
6524
6732
|
m(target, anchor) {
|
6525
6733
|
insert(target, div1, anchor);
|
@@ -6534,7 +6742,10 @@
|
|
6534
6742
|
if_block1.m(div0, null);
|
6535
6743
|
},
|
6536
6744
|
p(ctx2, dirty) {
|
6537
|
-
if (
|
6745
|
+
if (
|
6746
|
+
/*hasAvatar*/
|
6747
|
+
ctx2[16]
|
6748
|
+
) {
|
6538
6749
|
if (if_block0) {
|
6539
6750
|
if_block0.p(ctx2, dirty);
|
6540
6751
|
} else {
|
@@ -6546,9 +6757,17 @@
|
|
6546
6757
|
if_block0.d(1);
|
6547
6758
|
if_block0 = null;
|
6548
6759
|
}
|
6549
|
-
if (dirty &
|
6550
|
-
|
6551
|
-
|
6760
|
+
if (dirty & /*cursorName*/
|
6761
|
+
1)
|
6762
|
+
set_data(
|
6763
|
+
t1,
|
6764
|
+
/*cursorName*/
|
6765
|
+
ctx2[0]
|
6766
|
+
);
|
6767
|
+
if (
|
6768
|
+
/*hasTagName*/
|
6769
|
+
ctx2[17]
|
6770
|
+
) {
|
6552
6771
|
if (if_block1) {
|
6553
6772
|
if_block1.p(ctx2, dirty);
|
6554
6773
|
} else {
|
@@ -6560,19 +6779,46 @@
|
|
6560
6779
|
if_block1.d(1);
|
6561
6780
|
if_block1 = null;
|
6562
6781
|
}
|
6563
|
-
if (dirty &
|
6564
|
-
|
6782
|
+
if (dirty & /*theme*/
|
6783
|
+
256) {
|
6784
|
+
attr(
|
6785
|
+
div0,
|
6786
|
+
"class",
|
6787
|
+
/*theme*/
|
6788
|
+
ctx2[8]
|
6789
|
+
);
|
6565
6790
|
}
|
6566
|
-
if (dirty &
|
6567
|
-
|
6791
|
+
if (dirty & /*backgroundColor*/
|
6792
|
+
4) {
|
6793
|
+
set_style(
|
6794
|
+
div0,
|
6795
|
+
"background-color",
|
6796
|
+
/*backgroundColor*/
|
6797
|
+
ctx2[2]
|
6798
|
+
);
|
6568
6799
|
}
|
6569
|
-
if (dirty &
|
6570
|
-
|
6800
|
+
if (dirty & /*color*/
|
6801
|
+
512) {
|
6802
|
+
set_style(
|
6803
|
+
div0,
|
6804
|
+
"color",
|
6805
|
+
/*color*/
|
6806
|
+
ctx2[9]
|
6807
|
+
);
|
6571
6808
|
}
|
6572
|
-
if (dirty &
|
6573
|
-
|
6809
|
+
if (dirty & /*opacity*/
|
6810
|
+
2048) {
|
6811
|
+
set_style(
|
6812
|
+
div0,
|
6813
|
+
"opacity",
|
6814
|
+
/*opacity*/
|
6815
|
+
ctx2[11]
|
6816
|
+
);
|
6574
6817
|
}
|
6575
|
-
if (dirty &
|
6818
|
+
if (dirty & /*offset, pencilEraserSize3ImageOffset*/
|
6819
|
+
24576 && div1_class_value !== (div1_class_value = "netless-window-manager-cursor-name " + /*offset*/
|
6820
|
+
ctx2[14] + " " + /*pencilEraserSize3ImageOffset*/
|
6821
|
+
ctx2[13])) {
|
6576
6822
|
attr(div1, "class", div1_class_value);
|
6577
6823
|
}
|
6578
6824
|
},
|
@@ -6593,8 +6839,14 @@
|
|
6593
6839
|
c() {
|
6594
6840
|
img = element("img");
|
6595
6841
|
attr(img, "class", "netless-window-manager-cursor-selector-avatar");
|
6596
|
-
attr(
|
6597
|
-
|
6842
|
+
attr(
|
6843
|
+
img,
|
6844
|
+
"style",
|
6845
|
+
/*computedAvatarStyle*/
|
6846
|
+
ctx[18]()
|
6847
|
+
);
|
6848
|
+
if (!src_url_equal(img.src, img_src_value = /*avatar*/
|
6849
|
+
ctx[7]))
|
6598
6850
|
attr(img, "src", img_src_value);
|
6599
6851
|
attr(img, "alt", "avatar");
|
6600
6852
|
},
|
@@ -6602,7 +6854,9 @@
|
|
6602
6854
|
insert(target, img, anchor);
|
6603
6855
|
},
|
6604
6856
|
p(ctx2, dirty) {
|
6605
|
-
if (dirty &
|
6857
|
+
if (dirty & /*avatar*/
|
6858
|
+
128 && !src_url_equal(img.src, img_src_value = /*avatar*/
|
6859
|
+
ctx2[7])) {
|
6606
6860
|
attr(img, "src", img_src_value);
|
6607
6861
|
}
|
6608
6862
|
},
|
@@ -6618,19 +6872,38 @@
|
|
6618
6872
|
return {
|
6619
6873
|
c() {
|
6620
6874
|
span = element("span");
|
6621
|
-
t = text$1(
|
6875
|
+
t = text$1(
|
6876
|
+
/*tagName*/
|
6877
|
+
ctx[1]
|
6878
|
+
);
|
6622
6879
|
attr(span, "class", "netless-window-manager-cursor-tag-name");
|
6623
|
-
set_style(
|
6880
|
+
set_style(
|
6881
|
+
span,
|
6882
|
+
"background-color",
|
6883
|
+
/*cursorTagBackgroundColor*/
|
6884
|
+
ctx[10]
|
6885
|
+
);
|
6624
6886
|
},
|
6625
6887
|
m(target, anchor) {
|
6626
6888
|
insert(target, span, anchor);
|
6627
6889
|
append(span, t);
|
6628
6890
|
},
|
6629
6891
|
p(ctx2, dirty) {
|
6630
|
-
if (dirty &
|
6631
|
-
|
6632
|
-
|
6633
|
-
|
6892
|
+
if (dirty & /*tagName*/
|
6893
|
+
2)
|
6894
|
+
set_data(
|
6895
|
+
t,
|
6896
|
+
/*tagName*/
|
6897
|
+
ctx2[1]
|
6898
|
+
);
|
6899
|
+
if (dirty & /*cursorTagBackgroundColor*/
|
6900
|
+
1024) {
|
6901
|
+
set_style(
|
6902
|
+
span,
|
6903
|
+
"background-color",
|
6904
|
+
/*cursorTagBackgroundColor*/
|
6905
|
+
ctx2[10]
|
6906
|
+
);
|
6634
6907
|
}
|
6635
6908
|
},
|
6636
6909
|
d(detaching) {
|
@@ -6646,7 +6919,8 @@
|
|
6646
6919
|
let img;
|
6647
6920
|
let img_class_value;
|
6648
6921
|
let img_src_value;
|
6649
|
-
let if_block =
|
6922
|
+
let if_block = !/*isLaserPointer*/
|
6923
|
+
ctx[12] && create_if_block(ctx);
|
6650
6924
|
return {
|
6651
6925
|
c() {
|
6652
6926
|
div1 = element("div");
|
@@ -6655,14 +6929,29 @@
|
|
6655
6929
|
t = space();
|
6656
6930
|
div0 = element("div");
|
6657
6931
|
img = element("img");
|
6658
|
-
attr(img, "class", img_class_value = "netless-window-manager-cursor-" +
|
6659
|
-
|
6932
|
+
attr(img, "class", img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6933
|
+
ctx[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6934
|
+
ctx[13]);
|
6935
|
+
if (!src_url_equal(img.src, img_src_value = /*src*/
|
6936
|
+
ctx[6]))
|
6660
6937
|
attr(img, "src", img_src_value);
|
6661
|
-
attr(
|
6938
|
+
attr(
|
6939
|
+
img,
|
6940
|
+
"alt",
|
6941
|
+
/*appliance*/
|
6942
|
+
ctx[3]
|
6943
|
+
);
|
6662
6944
|
attr(div0, "class", "cursor-image-wrapper");
|
6663
6945
|
attr(div1, "class", "netless-window-manager-cursor-mid");
|
6664
|
-
set_style(div1, "transform", "translateX(" +
|
6665
|
-
|
6946
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
6947
|
+
ctx[4] + "px) translateY(" + /*y*/
|
6948
|
+
ctx[5] + "px)");
|
6949
|
+
set_style(
|
6950
|
+
div1,
|
6951
|
+
"display",
|
6952
|
+
/*display*/
|
6953
|
+
ctx[15]
|
6954
|
+
);
|
6666
6955
|
},
|
6667
6956
|
m(target, anchor) {
|
6668
6957
|
insert(target, div1, anchor);
|
@@ -6673,7 +6962,8 @@
|
|
6673
6962
|
append(div0, img);
|
6674
6963
|
},
|
6675
6964
|
p(ctx2, [dirty]) {
|
6676
|
-
if (
|
6965
|
+
if (!/*isLaserPointer*/
|
6966
|
+
ctx2[12]) {
|
6677
6967
|
if (if_block) {
|
6678
6968
|
if_block.p(ctx2, dirty);
|
6679
6969
|
} else {
|
@@ -6685,20 +6975,40 @@
|
|
6685
6975
|
if_block.d(1);
|
6686
6976
|
if_block = null;
|
6687
6977
|
}
|
6688
|
-
if (dirty &
|
6978
|
+
if (dirty & /*appliance, pencilEraserSize3ImageOffset*/
|
6979
|
+
8200 && img_class_value !== (img_class_value = "netless-window-manager-cursor-" + /*appliance*/
|
6980
|
+
ctx2[3] + "-image " + /*pencilEraserSize3ImageOffset*/
|
6981
|
+
ctx2[13])) {
|
6689
6982
|
attr(img, "class", img_class_value);
|
6690
6983
|
}
|
6691
|
-
if (dirty &
|
6984
|
+
if (dirty & /*src*/
|
6985
|
+
64 && !src_url_equal(img.src, img_src_value = /*src*/
|
6986
|
+
ctx2[6])) {
|
6692
6987
|
attr(img, "src", img_src_value);
|
6693
6988
|
}
|
6694
|
-
if (dirty &
|
6695
|
-
|
6696
|
-
|
6697
|
-
|
6698
|
-
|
6989
|
+
if (dirty & /*appliance*/
|
6990
|
+
8) {
|
6991
|
+
attr(
|
6992
|
+
img,
|
6993
|
+
"alt",
|
6994
|
+
/*appliance*/
|
6995
|
+
ctx2[3]
|
6996
|
+
);
|
6699
6997
|
}
|
6700
|
-
if (dirty &
|
6701
|
-
|
6998
|
+
if (dirty & /*x, y*/
|
6999
|
+
48) {
|
7000
|
+
set_style(div1, "transform", "translateX(" + /*x*/
|
7001
|
+
ctx2[4] + "px) translateY(" + /*y*/
|
7002
|
+
ctx2[5] + "px)");
|
7003
|
+
}
|
7004
|
+
if (dirty & /*display*/
|
7005
|
+
32768) {
|
7006
|
+
set_style(
|
7007
|
+
div1,
|
7008
|
+
"display",
|
7009
|
+
/*display*/
|
7010
|
+
ctx2[15]
|
7011
|
+
);
|
6702
7012
|
}
|
6703
7013
|
},
|
6704
7014
|
i: noop,
|
@@ -6724,7 +7034,7 @@
|
|
6724
7034
|
let { tagName } = $$props;
|
6725
7035
|
let { backgroundColor } = $$props;
|
6726
7036
|
let { appliance } = $$props;
|
6727
|
-
let { x
|
7037
|
+
let { x } = $$props;
|
6728
7038
|
let { y } = $$props;
|
6729
7039
|
let { src } = $$props;
|
6730
7040
|
let { visible } = $$props;
|
@@ -6753,7 +7063,7 @@
|
|
6753
7063
|
if ("appliance" in $$props2)
|
6754
7064
|
$$invalidate(3, appliance = $$props2.appliance);
|
6755
7065
|
if ("x" in $$props2)
|
6756
|
-
$$invalidate(4,
|
7066
|
+
$$invalidate(4, x = $$props2.x);
|
6757
7067
|
if ("y" in $$props2)
|
6758
7068
|
$$invalidate(5, y = $$props2.y);
|
6759
7069
|
if ("src" in $$props2)
|
@@ -6774,28 +7084,36 @@
|
|
6774
7084
|
$$invalidate(20, pencilEraserSize = $$props2.pencilEraserSize);
|
6775
7085
|
};
|
6776
7086
|
$$self.$$.update = () => {
|
6777
|
-
if ($$self.$$.dirty &
|
7087
|
+
if ($$self.$$.dirty & /*cursorName*/
|
7088
|
+
1) {
|
6778
7089
|
hasName = !lodash.isEmpty(cursorName);
|
6779
7090
|
}
|
6780
|
-
if ($$self.$$.dirty &
|
7091
|
+
if ($$self.$$.dirty & /*tagName*/
|
7092
|
+
2) {
|
6781
7093
|
$$invalidate(17, hasTagName = !lodash.isEmpty(tagName));
|
6782
7094
|
}
|
6783
|
-
if ($$self.$$.dirty &
|
7095
|
+
if ($$self.$$.dirty & /*avatar*/
|
7096
|
+
128) {
|
6784
7097
|
$$invalidate(16, hasAvatar = !lodash.isEmpty(avatar));
|
6785
7098
|
}
|
6786
|
-
if ($$self.$$.dirty &
|
7099
|
+
if ($$self.$$.dirty & /*visible*/
|
7100
|
+
524288) {
|
6787
7101
|
$$invalidate(15, display = visible ? "initial" : "none");
|
6788
7102
|
}
|
6789
|
-
if ($$self.$$.dirty &
|
7103
|
+
if ($$self.$$.dirty & /*appliance*/
|
7104
|
+
8) {
|
6790
7105
|
$$invalidate(12, isLaserPointer = appliance === whiteWebSdk.ApplianceNames.laserPointer);
|
6791
7106
|
}
|
6792
|
-
if ($$self.$$.dirty &
|
7107
|
+
if ($$self.$$.dirty & /*isLaserPointer, appliance*/
|
7108
|
+
4104) {
|
6793
7109
|
$$invalidate(21, isLaserPointerPencilEraser = isLaserPointer || appliance === whiteWebSdk.ApplianceNames.pencilEraser);
|
6794
7110
|
}
|
6795
|
-
if ($$self.$$.dirty &
|
7111
|
+
if ($$self.$$.dirty & /*isLaserPointerPencilEraser*/
|
7112
|
+
2097152) {
|
6796
7113
|
$$invalidate(14, offset = isLaserPointerPencilEraser ? "netless-window-manager-laserPointer-pencilEraser-offset" : "");
|
6797
7114
|
}
|
6798
|
-
if ($$self.$$.dirty &
|
7115
|
+
if ($$self.$$.dirty & /*pencilEraserSize*/
|
7116
|
+
1048576) {
|
6799
7117
|
$$invalidate(13, pencilEraserSize3ImageOffset = pencilEraserSize === 3 ? "netless-window-manager-pencilEraser-3-offset" : "");
|
6800
7118
|
}
|
6801
7119
|
};
|
@@ -6804,7 +7122,7 @@
|
|
6804
7122
|
tagName,
|
6805
7123
|
backgroundColor,
|
6806
7124
|
appliance,
|
6807
|
-
|
7125
|
+
x,
|
6808
7126
|
y,
|
6809
7127
|
src,
|
6810
7128
|
avatar,
|
@@ -6878,8 +7196,8 @@
|
|
6878
7196
|
}
|
6879
7197
|
moveCursor(cursor, rect, view) {
|
6880
7198
|
var _a, _b;
|
6881
|
-
const { x
|
6882
|
-
const point = view == null ? void 0 : view.screen.convertPointToScreen(
|
7199
|
+
const { x, y, type } = cursor;
|
7200
|
+
const point = view == null ? void 0 : view.screen.convertPointToScreen(x, y);
|
6883
7201
|
if (point) {
|
6884
7202
|
let translateX = point.x - 2;
|
6885
7203
|
let translateY = point.y - 18;
|
@@ -8203,11 +8521,11 @@
|
|
8203
8521
|
sideEffect: s,
|
8204
8522
|
readonly$: i,
|
8205
8523
|
events: r,
|
8206
|
-
wrapClassName:
|
8524
|
+
wrapClassName: n,
|
8207
8525
|
root: l,
|
8208
8526
|
pagesIndex$: p
|
8209
8527
|
}) {
|
8210
|
-
this.showPreview$ = new valueEnhancer.Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName =
|
8528
|
+
this.showPreview$ = new valueEnhancer.Val(false), this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = n, this.sideEffect.addDisposer(
|
8211
8529
|
this.events.on("togglePreview", () => {
|
8212
8530
|
this.showPreview$.setValue(!this.showPreview$.value);
|
8213
8531
|
})
|
@@ -8217,11 +8535,11 @@
|
|
8217
8535
|
const c = this.renderPreview(), u = this.renderPreviewMask();
|
8218
8536
|
if (a) {
|
8219
8537
|
l.appendChild(c), l.appendChild(u), c.scrollTop;
|
8220
|
-
const
|
8538
|
+
const o2 = c.querySelector(
|
8221
8539
|
"." + this.wrapClassName(`preview-page-${p.value}`)
|
8222
8540
|
);
|
8223
|
-
return
|
8224
|
-
top:
|
8541
|
+
return o2 && c.scrollTo({
|
8542
|
+
top: o2.offsetTop - 16
|
8225
8543
|
}), c.classList.toggle(this.wrapClassName("preview-active"), true), this.previewLazyLoad = new LazyLoad({
|
8226
8544
|
container: this.$preview,
|
8227
8545
|
elements_selector: "." + this.wrapClassName("preview-page>img")
|
@@ -8255,14 +8573,14 @@
|
|
8255
8573
|
this.pages$.subscribe((t) => {
|
8256
8574
|
var s;
|
8257
8575
|
this.sideEffect.add(() => {
|
8258
|
-
const i = t.map((r,
|
8576
|
+
const i = t.map((r, n) => {
|
8259
8577
|
const l = r.thumbnail ?? (r.src.startsWith("ppt") ? void 0 : r.src);
|
8260
8578
|
if (!l)
|
8261
8579
|
return;
|
8262
|
-
const p = String(
|
8263
|
-
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${
|
8580
|
+
const p = String(n), a = document.createElement("a");
|
8581
|
+
a.className = this.wrapClassName("preview-page") + " " + this.wrapClassName(`preview-page-${n}`), a.setAttribute("href", "#"), a.dataset.pageIndex = p;
|
8264
8582
|
const c = document.createElement("span");
|
8265
|
-
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(
|
8583
|
+
c.className = this.wrapClassName("preview-page-name"), c.textContent = String(n + 1), c.dataset.pageIndex = p;
|
8266
8584
|
const u = document.createElement("img");
|
8267
8585
|
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;
|
8268
8586
|
});
|
@@ -8331,7 +8649,7 @@
|
|
8331
8649
|
"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"
|
8332
8650
|
), t.appendChild(s), t;
|
8333
8651
|
}
|
8334
|
-
function
|
8652
|
+
function X$1(h2) {
|
8335
8653
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8336
8654
|
t.setAttribute("class", `${h2}-footer-icon-save`), t.setAttribute("viewBox", "0 0 448 512");
|
8337
8655
|
const s = document.createElementNS(e, "path");
|
@@ -8340,7 +8658,7 @@
|
|
8340
8658
|
"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"
|
8341
8659
|
), t.appendChild(s), t;
|
8342
8660
|
}
|
8343
|
-
function
|
8661
|
+
function J$1(h2) {
|
8344
8662
|
const e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
|
8345
8663
|
t.setAttribute("class", `${h2}-footer-icon-spinner`), t.setAttribute("viewBox", "0 0 512 512");
|
8346
8664
|
const s = document.createElementNS(e, "path");
|
@@ -8360,12 +8678,12 @@
|
|
8360
8678
|
sideEffect: s,
|
8361
8679
|
readonly$: i,
|
8362
8680
|
events: r,
|
8363
|
-
playable:
|
8681
|
+
playable: n,
|
8364
8682
|
wrapClassName: l,
|
8365
8683
|
pagesIndex$: p,
|
8366
8684
|
root: a
|
8367
8685
|
}) {
|
8368
|
-
this.namespace = e, this.pages$ = t, this.sideEffect = s, this.readonly$ = i, this.events = r, this.wrapClassName = l, this.pagesIndex$ = p, this.playable =
|
8686
|
+
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);
|
8369
8687
|
}
|
8370
8688
|
destroy() {
|
8371
8689
|
this.$footer.remove();
|
@@ -8374,15 +8692,15 @@
|
|
8374
8692
|
const e = document.createElement("div");
|
8375
8693
|
e.className = this.wrapClassName("footer"), this.sideEffect.addDisposer(
|
8376
8694
|
this.readonly$.subscribe(
|
8377
|
-
(
|
8695
|
+
(o2) => e.classList.toggle(this.wrapClassName("readonly"), o2)
|
8378
8696
|
)
|
8379
8697
|
);
|
8380
8698
|
const t = this.renderFooterBtn("btn-sidebar", W$1(this.namespace));
|
8381
8699
|
this.sideEffect.addEventListener(t, "click", () => {
|
8382
8700
|
this.readonly$.value || this.events.emit("togglePreview");
|
8383
8701
|
}), e.appendChild(t), this.sideEffect.addDisposer(
|
8384
|
-
this.pages$.subscribe((
|
8385
|
-
const d =
|
8702
|
+
this.pages$.subscribe((o2) => {
|
8703
|
+
const d = o2.some((g2) => g2.thumbnail || !g2.src.startsWith("ppt"));
|
8386
8704
|
t.style.display = d ? "" : "none";
|
8387
8705
|
})
|
8388
8706
|
);
|
@@ -8392,54 +8710,54 @@
|
|
8392
8710
|
if (this.sideEffect.addEventListener(i, "click", () => {
|
8393
8711
|
this.readonly$.value || this.events.emit("back");
|
8394
8712
|
}), s.appendChild(i), this.playable) {
|
8395
|
-
const
|
8713
|
+
const o2 = this.renderFooterBtn(
|
8396
8714
|
"btn-page-play",
|
8397
8715
|
G$1(this.namespace),
|
8398
8716
|
q$1(this.namespace)
|
8399
8717
|
);
|
8400
|
-
this.sideEffect.addEventListener(
|
8401
|
-
this.readonly$.value || (
|
8402
|
-
() =>
|
8718
|
+
this.sideEffect.addEventListener(o2, "click", () => {
|
8719
|
+
this.readonly$.value || (o2.classList.toggle(this.wrapClassName("footer-btn-playing"), true), this.events.emit("play"), this.sideEffect.setTimeout(
|
8720
|
+
() => o2.classList.toggle(this.wrapClassName("footer-btn-playing"), false),
|
8403
8721
|
500,
|
8404
8722
|
"returnPlay"
|
8405
8723
|
));
|
8406
|
-
}), s.appendChild(
|
8724
|
+
}), s.appendChild(o2);
|
8407
8725
|
}
|
8408
8726
|
const r = this.renderFooterBtn("btn-page-next", O$1(this.namespace));
|
8409
8727
|
this.sideEffect.addEventListener(r, "click", () => {
|
8410
8728
|
this.readonly$.value || this.events.emit("next");
|
8411
8729
|
}), s.appendChild(r);
|
8412
|
-
const
|
8413
|
-
|
8730
|
+
const n = document.createElement("div");
|
8731
|
+
n.className = this.wrapClassName("page-number");
|
8414
8732
|
const l = document.createElement("input");
|
8415
8733
|
l.className = this.wrapClassName("page-number-input"), this.sideEffect.addDisposer(
|
8416
|
-
this.readonly$.subscribe((
|
8734
|
+
this.readonly$.subscribe((o2) => l.disabled = o2)
|
8417
8735
|
), this.sideEffect.addDisposer(
|
8418
|
-
this.pagesIndex$.subscribe((
|
8736
|
+
this.pagesIndex$.subscribe((o2) => l.value = String(o2 + 1))
|
8419
8737
|
), this.sideEffect.addEventListener(l, "blur", () => {
|
8420
8738
|
l.value = String(this.pagesIndex$.value + 1);
|
8421
8739
|
}), this.sideEffect.addEventListener(l, "change", () => {
|
8422
8740
|
if (this.readonly$.value)
|
8423
8741
|
return;
|
8424
|
-
const
|
8425
|
-
|
8742
|
+
const o2 = l.value ? Number(l.value) - 1 : NaN;
|
8743
|
+
o2 >= 0 ? this.events.emit("jumpPage", o2) : l.value = String(this.pagesIndex$.value + 1);
|
8426
8744
|
});
|
8427
8745
|
const p = document.createElement("span");
|
8428
8746
|
this.sideEffect.addDisposer(
|
8429
|
-
this.pages$.subscribe((
|
8430
|
-
p.textContent = " / " +
|
8747
|
+
this.pages$.subscribe((o2) => {
|
8748
|
+
p.textContent = " / " + o2.length;
|
8431
8749
|
})
|
8432
|
-
),
|
8433
|
-
const a =
|
8750
|
+
), n.appendChild(l), n.appendChild(p), e.appendChild(s), e.appendChild(n);
|
8751
|
+
const a = X$1(this.namespace), c = J$1(this.namespace);
|
8434
8752
|
c.style.display = "none";
|
8435
8753
|
const u = document.createElement("button");
|
8436
8754
|
return u.className = this.wrapClassName("footer-btn"), u.appendChild(a), u.appendChild(c), this.sideEffect.addEventListener(u, "click", () => {
|
8437
8755
|
this.events.emit("save");
|
8438
|
-
}), this.events.on("saveProgress", (
|
8439
|
-
if (
|
8756
|
+
}), this.events.on("saveProgress", (o2) => {
|
8757
|
+
if (o2 < 99) {
|
8440
8758
|
c.style.display = "block", a.style.display = "none";
|
8441
8759
|
const d = c.querySelector("[data-id]");
|
8442
|
-
d && (d.textContent =
|
8760
|
+
d && (d.textContent = o2.toString().padStart(2, "0"));
|
8443
8761
|
} else
|
8444
8762
|
c.style.display = "none", a.style.display = "block";
|
8445
8763
|
}), e;
|
@@ -8456,7 +8774,7 @@
|
|
8456
8774
|
previewRoot: s,
|
8457
8775
|
footerRoot: i,
|
8458
8776
|
pages$: r,
|
8459
|
-
playable:
|
8777
|
+
playable: n
|
8460
8778
|
}) {
|
8461
8779
|
this.wrapClassName = (l) => `${this.namespace}-${l}`, this.namespace = "netless-app-docs-viewer", this.sideEffect = new sideEffectManager.SideEffectManager(), this.events = new Remitter(), this.preview = new Y$1({
|
8462
8780
|
pages$: r,
|
@@ -8470,7 +8788,7 @@
|
|
8470
8788
|
}), this.footer = new K$1({
|
8471
8789
|
pages$: r,
|
8472
8790
|
readonly$: e,
|
8473
|
-
playable:
|
8791
|
+
playable: n,
|
8474
8792
|
pagesIndex$: t,
|
8475
8793
|
root: i,
|
8476
8794
|
namespace: this.namespace,
|
@@ -8483,7 +8801,7 @@
|
|
8483
8801
|
this.preview.destroy(), this.footer.destroy(), this.sideEffect.flushAll(), this.events.destroy();
|
8484
8802
|
}
|
8485
8803
|
}
|
8486
|
-
function
|
8804
|
+
function E$1(h2, e, t) {
|
8487
8805
|
return Math.min(Math.max(h2, e), t);
|
8488
8806
|
}
|
8489
8807
|
function A$1(h2) {
|
@@ -8526,27 +8844,27 @@
|
|
8526
8844
|
}
|
8527
8845
|
};
|
8528
8846
|
let Z$1 = class Z {
|
8529
|
-
constructor(e, t, s, i, r,
|
8847
|
+
constructor(e, t, s, i, r, n) {
|
8530
8848
|
this.index = e, this.lastVisit = Date.now(), this.sideEffect = new sideEffectManager.SideEffectManager();
|
8531
|
-
const l = valueEnhancer.derive(t, (
|
8849
|
+
const l = valueEnhancer.derive(t, (o2) => o2[e] || { width: 0, height: 0 }), p = valueEnhancer.combine(
|
8532
8850
|
[l, s],
|
8533
|
-
([
|
8851
|
+
([o2, d]) => (d.width - o2.width) / 2
|
8534
8852
|
), a = valueEnhancer.combine(
|
8535
|
-
[r,
|
8536
|
-
([
|
8853
|
+
[r, n],
|
8854
|
+
([o2, d]) => (o2[e] || 0) - d
|
8537
8855
|
), c = document.createElement("div");
|
8538
8856
|
c.className = "page-renderer-page", c.dataset.index = `${e}`;
|
8539
8857
|
const u = document.createElement("img");
|
8540
8858
|
u.className = "page-renderer-page-img", c.appendChild(u), this.sideEffect.addDisposer([
|
8541
|
-
valueEnhancer.combine([l, i]).subscribe(([
|
8542
|
-
c.style.width = `${
|
8859
|
+
valueEnhancer.combine([l, i]).subscribe(([o2, d]) => {
|
8860
|
+
c.style.width = `${o2.width * d}px`, c.style.height = `${o2.height * d}px`;
|
8543
8861
|
}),
|
8544
|
-
l.subscribe((
|
8545
|
-
|
8862
|
+
l.subscribe((o2) => {
|
8863
|
+
o2.thumbnail && (c.style.backgroundImage = `url("${o2.thumbnail}")`), u.width = o2.width, u.height = o2.height, u.src = o2.src;
|
8546
8864
|
}),
|
8547
8865
|
valueEnhancer.combine([p, a, i]).subscribe(
|
8548
|
-
([
|
8549
|
-
c.style.transform = `translate(${
|
8866
|
+
([o2, d, g2]) => {
|
8867
|
+
c.style.transform = `translate(${o2 * g2}px, ${d * g2}px)`;
|
8550
8868
|
}
|
8551
8869
|
)
|
8552
8870
|
]), this.$page = c;
|
@@ -8558,13 +8876,13 @@
|
|
8558
8876
|
let ee$1 = class ee {
|
8559
8877
|
constructor(e, t, s, i, r) {
|
8560
8878
|
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 = () => {
|
8561
|
-
var
|
8879
|
+
var n;
|
8562
8880
|
if (this.gcTimer = null, this.els.size > this.maxElCount) {
|
8563
8881
|
const l = [...this.els.values()].sort((p, a) => a.lastVisit - p.lastVisit);
|
8564
8882
|
for (let p = Math.floor(this.maxElCount / 4); p < l.length; p++)
|
8565
|
-
(
|
8883
|
+
(n = this.els.get(l[p].index)) == null || n.destroy(), this.els.delete(l[p].index);
|
8566
8884
|
}
|
8567
|
-
}, this.schedule = window.requestIdleCallback || ((
|
8885
|
+
}, this.schedule = window.requestIdleCallback || ((n) => window.setTimeout(n, 5e3)), this.cancelSchedule = window.cancelIdleCallback || window.clearTimeout;
|
8568
8886
|
}
|
8569
8887
|
getEl(e) {
|
8570
8888
|
let t = this.els.get(e);
|
@@ -8601,7 +8919,7 @@
|
|
8601
8919
|
for (let w2 = 0; w2 < d.length; w2++)
|
8602
8920
|
g2[w2] = w2 > 0 ? g2[w2 - 1] + d[w2 - 1].height : 0;
|
8603
8921
|
return g2;
|
8604
|
-
}),
|
8922
|
+
}), n = valueEnhancer.derive(s, (d) => {
|
8605
8923
|
let g2 = 1 / 0;
|
8606
8924
|
for (let w2 = d.length - 1; w2 >= 0; w2--)
|
8607
8925
|
d[w2].height <= g2 && (g2 = d[w2].height);
|
@@ -8620,8 +8938,8 @@
|
|
8620
8938
|
[t, i],
|
8621
8939
|
([d, g2]) => d.width / g2.width || 1
|
8622
8940
|
), a = valueEnhancer.combine(
|
8623
|
-
[s, t,
|
8624
|
-
([d, g2, w2, f2]) =>
|
8941
|
+
[s, t, n, p],
|
8942
|
+
([d, g2, w2, f2]) => E$1(Math.ceil(g2.height / f2 / w2 / 2), 1, d.length)
|
8625
8943
|
);
|
8626
8944
|
valueEnhancer.withReadonlyValueEnhancer(this, {
|
8627
8945
|
pagesScrollTop: e,
|
@@ -8630,19 +8948,19 @@
|
|
8630
8948
|
pagesSize: i,
|
8631
8949
|
pagesIndex: l,
|
8632
8950
|
pagesYs: r,
|
8633
|
-
pagesMinHeight:
|
8951
|
+
pagesMinHeight: n,
|
8634
8952
|
scale: p
|
8635
8953
|
}), this.pageElManager = new ee$1(s, i, p, r, e), this.$pages = this.renderPages();
|
8636
8954
|
const c = new valueEnhancer.Val(false);
|
8637
8955
|
this.sideEffect.addDisposer(
|
8638
8956
|
c.subscribe((d) => this.$pages.classList.toggle("is-hwa", d))
|
8639
8957
|
);
|
8640
|
-
const u = () => c.setValue(false),
|
8958
|
+
const u = () => c.setValue(false), o2 = () => {
|
8641
8959
|
this.sideEffect.setTimeout(u, 1e3, "turn-off-hwa"), c.setValue(true);
|
8642
8960
|
};
|
8643
8961
|
this.sideEffect.addDisposer(
|
8644
8962
|
valueEnhancer.combine([l, a, s]).subscribe(([d, g2, w2]) => {
|
8645
|
-
|
8963
|
+
o2();
|
8646
8964
|
const f2 = Math.max(d - g2, 0), N = Math.min(d + g2, w2.length - 1);
|
8647
8965
|
for (let m = 0; m < this.$pages.children.length; m++) {
|
8648
8966
|
const S2 = this.$pages.children[m], k2 = Number(S2.dataset.index);
|
@@ -8676,23 +8994,23 @@
|
|
8676
8994
|
stageRect$: s,
|
8677
8995
|
pagesSize$: i,
|
8678
8996
|
readonly$: r,
|
8679
|
-
scrollbarMinHeight:
|
8997
|
+
scrollbarMinHeight: n = se,
|
8680
8998
|
wrapClassName: l,
|
8681
8999
|
onDragScroll: p
|
8682
9000
|
}) {
|
8683
|
-
this.sideEffect = new sideEffectManager.SideEffectManager(), this.scrolling$ = new valueEnhancer.Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight =
|
9001
|
+
this.sideEffect = new sideEffectManager.SideEffectManager(), this.scrolling$ = new valueEnhancer.Val(false), this.pagesScrollTop$ = e, this.containerRect$ = t, this.stageRect$ = s, this.pagesSize$ = i, this.scrollbarMinHeight = n, this.readonly$ = r, this.wrapClassName = l, this.onDragScroll = p, this.scrollbarHeight$ = valueEnhancer.combine(
|
8684
9002
|
[t, s, i],
|
8685
|
-
([a, c, u]) =>
|
9003
|
+
([a, c, u]) => E$1(
|
8686
9004
|
c.height / (c.width / u.width * u.height) * a.height,
|
8687
|
-
|
9005
|
+
n,
|
8688
9006
|
a.height
|
8689
9007
|
)
|
8690
9008
|
), this.scrollTop$ = valueEnhancer.combine(
|
8691
9009
|
[t, s, i, this.scrollbarHeight$, this.pagesScrollTop$],
|
8692
|
-
([a, c, u,
|
8693
|
-
d / (u.height - u.width / c.width * c.height) * (a.height -
|
9010
|
+
([a, c, u, o2, d]) => E$1(
|
9011
|
+
d / (u.height - u.width / c.width * c.height) * (a.height - o2),
|
8694
9012
|
0,
|
8695
|
-
a.height -
|
9013
|
+
a.height - o2
|
8696
9014
|
)
|
8697
9015
|
), this.$scrollbar = this.renderScrollbar();
|
8698
9016
|
}
|
@@ -8723,15 +9041,15 @@
|
|
8723
9041
|
D(s);
|
8724
9042
|
const i = this.wrapClassName("scrollbar-dragging");
|
8725
9043
|
e.classList.toggle(i, true);
|
8726
|
-
const r = this.pagesScrollTop$.value, { clientY:
|
9044
|
+
const r = this.pagesScrollTop$.value, { clientY: n } = A$1(s), l = (a) => {
|
8727
9045
|
if (!a.isPrimary || this.readonly$.value)
|
8728
9046
|
return;
|
8729
|
-
const { clientY: c } = A$1(a), u = c -
|
9047
|
+
const { clientY: c } = A$1(a), u = c - n;
|
8730
9048
|
Math.abs(u) > 0 && this.onDragScroll && this.onDragScroll(
|
8731
9049
|
r + u / this.containerRect$.value.height * this.pagesSize$.value.height
|
8732
9050
|
);
|
8733
9051
|
}, p = (a) => {
|
8734
|
-
|
9052
|
+
a.isPrimary && (e.classList.toggle(i, false), window.removeEventListener("pointermove", l, true), window.removeEventListener("pointerup", p, true), window.removeEventListener("pointercancel", p, true));
|
8735
9053
|
};
|
8736
9054
|
window.addEventListener("pointermove", l, true), window.addEventListener("pointerup", p, true), window.addEventListener("pointercancel", p, true);
|
8737
9055
|
};
|
@@ -8745,36 +9063,36 @@
|
|
8745
9063
|
box: s,
|
8746
9064
|
pages: i,
|
8747
9065
|
pagesScrollTop: r = 0,
|
8748
|
-
onUserScroll:
|
9066
|
+
onUserScroll: n
|
8749
9067
|
}) {
|
8750
9068
|
this.sideEffect = new sideEffectManager.SideEffectManager(), this.userScrolling = false, this.toPdf = async () => {
|
8751
9069
|
const a = document.createElement("canvas"), c = a.getContext("2d");
|
8752
9070
|
if (!c)
|
8753
9071
|
return null;
|
8754
|
-
const u = this.whiteboard.pageState.pages[0],
|
8755
|
-
format: [
|
8756
|
-
orientation:
|
9072
|
+
const u = this.whiteboard.pageState.pages[0], o2 = this.pages[0], { jsPDF: d } = await import("jspdf"), g2 = new d({
|
9073
|
+
format: [o2.width, o2.height],
|
9074
|
+
orientation: o2.width > o2.height ? "l" : "p",
|
8757
9075
|
compress: true
|
8758
9076
|
});
|
8759
9077
|
for (const [S2, k2] of this.pages.entries()) {
|
8760
|
-
const { width: y, height: v, src:
|
9078
|
+
const { width: y, height: v, src: L } = k2;
|
8761
9079
|
a.width = y, a.height = v;
|
8762
|
-
const
|
8763
|
-
S2 > 0 && g2.addPage([y, v],
|
8764
|
-
const
|
8765
|
-
P2.src =
|
8766
|
-
const
|
9080
|
+
const M2 = y > v ? "l" : "p";
|
9081
|
+
S2 > 0 && g2.addPage([y, v], M2);
|
9082
|
+
const R2 = await this.getBase64FromUrl(L), P2 = document.createElement("img");
|
9083
|
+
P2.src = R2, await new Promise((_2) => P2.onload = _2), c.drawImage(P2, 0, 0);
|
9084
|
+
const V = a.toDataURL("image/jpeg", 0.6);
|
8767
9085
|
c.clearRect(0, 0, y, v), this.whiteboard.view.screenshotToCanvas(c, u, y, v, {
|
8768
9086
|
centerX: y / 2,
|
8769
9087
|
centerY: v / 2 + S2 * v,
|
8770
9088
|
scale: 1
|
8771
9089
|
});
|
8772
9090
|
const I2 = a.toDataURL("image/png");
|
8773
|
-
g2.addImage(
|
9091
|
+
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));
|
8774
9092
|
}
|
8775
9093
|
const w2 = g2.output("arraybuffer"), f2 = new Blob([w2]), N = URL.createObjectURL(f2), m = document.createElement("a");
|
8776
9094
|
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 });
|
8777
|
-
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll =
|
9095
|
+
}, this.whiteboard = e, this.readonly$ = t, this.box = s, this.pages = i, this.onUserScroll = n;
|
8778
9096
|
const l = () => {
|
8779
9097
|
var a;
|
8780
9098
|
this.userScrolling = false, (a = this.onUserScroll) == null || a.call(this, this.pagesScrollTop$.value);
|
@@ -8787,8 +9105,8 @@
|
|
8787
9105
|
p,
|
8788
9106
|
(a) => {
|
8789
9107
|
let c = 0, u = 0;
|
8790
|
-
for (let
|
8791
|
-
const d = a[
|
9108
|
+
for (let o2 = a.length - 1; o2 >= 0; o2--) {
|
9109
|
+
const d = a[o2];
|
8792
9110
|
d.width > c && (c = d.width), u += d.height;
|
8793
9111
|
}
|
8794
9112
|
return { width: Math.max(1, c), height: Math.max(1, u) };
|
@@ -8848,8 +9166,8 @@
|
|
8848
9166
|
return new Promise((i) => {
|
8849
9167
|
const r = new FileReader();
|
8850
9168
|
r.readAsDataURL(s), r.onloadend = () => {
|
8851
|
-
const
|
8852
|
-
i(
|
9169
|
+
const n = r.result;
|
9170
|
+
i(n);
|
8853
9171
|
};
|
8854
9172
|
});
|
8855
9173
|
}
|
@@ -8859,7 +9177,7 @@
|
|
8859
9177
|
pageScrollTo(e) {
|
8860
9178
|
const t = this.whiteboard.view.size.height / 2 / this.pageRenderer.scale;
|
8861
9179
|
this.whiteboard.view.moveCamera({
|
8862
|
-
centerY:
|
9180
|
+
centerY: E$1(
|
8863
9181
|
e + t,
|
8864
9182
|
t,
|
8865
9183
|
this.pagesSize$.value.height - t
|
@@ -8869,7 +9187,7 @@
|
|
8869
9187
|
}
|
8870
9188
|
userScrollToPageIndex(e) {
|
8871
9189
|
var t;
|
8872
|
-
if (e =
|
9190
|
+
if (e = E$1(e, 0, this.pages.length - 1), !this.readonly$.value && !Number.isNaN(e)) {
|
8873
9191
|
const s = this.pageRenderer.pagesYs[e];
|
8874
9192
|
s >= 0 && ((t = this.onUserScroll) == null || t.call(this, s + 5 / this.pageRenderer.scale));
|
8875
9193
|
}
|
@@ -8878,8 +9196,8 @@
|
|
8878
9196
|
var t;
|
8879
9197
|
this.readonly$.value || (t = this.onUserScroll) == null || t.call(
|
8880
9198
|
this,
|
8881
|
-
|
8882
|
-
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale *
|
9199
|
+
E$1(
|
9200
|
+
this.pageRenderer.pagesScrollTop + this.pageRenderer.containerRect.height / this.pageRenderer.scale * E$1(e, -1, 1),
|
8883
9201
|
0,
|
8884
9202
|
this.pageRenderer.pagesSize.height - this.pageRenderer.containerRect.height / this.pageRenderer.scale
|
8885
9203
|
)
|
@@ -8889,52 +9207,59 @@
|
|
8889
9207
|
this.sideEffect.addEventListener(
|
8890
9208
|
this.box.$main,
|
8891
9209
|
"wheel",
|
8892
|
-
(
|
8893
|
-
D(
|
9210
|
+
(t) => {
|
9211
|
+
D(t), !this.readonly$.value && this.pageScrollStepper.paused && (this.pageScrollTo(this.pagesScrollTop + t.deltaY), this.debounceOnUserScroll());
|
8894
9212
|
},
|
8895
9213
|
{ passive: false }
|
8896
9214
|
), this.sideEffect.addEventListener(
|
8897
9215
|
this.box.$main,
|
8898
9216
|
"touchmove",
|
8899
|
-
(
|
8900
|
-
!this.readonly$.value &&
|
9217
|
+
(t) => {
|
9218
|
+
!this.readonly$.value && t.touches.length > 1 && this.debounceOnUserScroll();
|
8901
9219
|
},
|
8902
9220
|
{ passive: true, capture: true }
|
8903
9221
|
), this.sideEffect.add(() => {
|
8904
|
-
const
|
8905
|
-
const { width:
|
8906
|
-
if (
|
9222
|
+
const t = (s) => {
|
9223
|
+
const { width: i, height: r } = this.whiteboard.view.size;
|
9224
|
+
if (i <= 0 || r <= 0)
|
8907
9225
|
return;
|
8908
|
-
const
|
8909
|
-
this.pagesScrollTop$.setValue(Math.max(0,
|
9226
|
+
const n = s.centerY - this.pageRenderer.containerRect.height / this.pageRenderer.scale / 2;
|
9227
|
+
this.pagesScrollTop$.setValue(Math.max(0, n));
|
8910
9228
|
};
|
8911
|
-
return this.whiteboard.view.callbacks.on("onCameraUpdated",
|
9229
|
+
return this.whiteboard.view.callbacks.on("onCameraUpdated", t), () => this.whiteboard.view.callbacks.off("onCameraUpdated", t);
|
8912
9230
|
}), this.sideEffect.addDisposer(
|
8913
|
-
this.box._stageRect$.subscribe((
|
8914
|
-
const { width:
|
9231
|
+
this.box._stageRect$.subscribe((t) => {
|
9232
|
+
const { width: s, height: i } = this.pagesSize$.value;
|
8915
9233
|
this.whiteboard.view.moveCameraToContain({
|
8916
9234
|
originX: 0,
|
8917
9235
|
originY: this.pageRenderer.pagesScrollTop,
|
8918
|
-
width:
|
8919
|
-
height:
|
9236
|
+
width: s,
|
9237
|
+
height: t.height / this.pageRenderer.scale,
|
8920
9238
|
animationMode: "immediately"
|
8921
9239
|
}), this.whiteboard.view.setCameraBound({
|
8922
9240
|
damping: 1,
|
8923
9241
|
maxContentMode: () => this.pageRenderer.scale,
|
8924
9242
|
minContentMode: () => this.pageRenderer.scale,
|
8925
|
-
centerX:
|
8926
|
-
centerY:
|
8927
|
-
width:
|
8928
|
-
height:
|
9243
|
+
centerX: s / 2,
|
9244
|
+
centerY: i / 2,
|
9245
|
+
width: s,
|
9246
|
+
height: i
|
8929
9247
|
});
|
8930
9248
|
}),
|
8931
9249
|
"whiteboard-size-update"
|
8932
|
-
)
|
9250
|
+
);
|
9251
|
+
const e = (t) => {
|
9252
|
+
if (!t)
|
9253
|
+
return false;
|
9254
|
+
const s = t.tagName;
|
9255
|
+
return s === "INPUT" || s === "TEXTAREA" || s === "SELECT";
|
9256
|
+
};
|
9257
|
+
this.sideEffect.addEventListener(
|
8933
9258
|
window,
|
8934
9259
|
"keyup",
|
8935
|
-
(
|
8936
|
-
if (!(this.readonly$.value || !this.box.focus || this.box.minimized))
|
8937
|
-
switch (
|
9260
|
+
(t) => {
|
9261
|
+
if (!(this.readonly$.value || !this.box.focus || this.box.minimized || e(t.target)))
|
9262
|
+
switch (t.key) {
|
8938
9263
|
case "PageDown": {
|
8939
9264
|
this.userScrollByPercent(0.8);
|
8940
9265
|
break;
|
@@ -8971,15 +9296,15 @@
|
|
8971
9296
|
let ae$1 = class ae {
|
8972
9297
|
constructor({ readonly$: e, context: t, whiteboard: s, box: i, pages: r }) {
|
8973
9298
|
this.sideEffect = new sideEffectManager.SideEffectManager(), this.context = t, this.whiteboard = s, this.box = i, this.pages = r;
|
8974
|
-
const
|
8975
|
-
this.pagesIndex$ =
|
9299
|
+
const n = new valueEnhancer.Val(t.displayer.state.sceneState.index || 0);
|
9300
|
+
this.pagesIndex$ = n, this.sideEffect.add(() => {
|
8976
9301
|
const l = (p) => {
|
8977
9302
|
this.jumpToPage(p.index);
|
8978
9303
|
};
|
8979
9304
|
return this.context.emitter.on("sceneStateChange", l), () => this.context.emitter.off("sceneStateChange", l);
|
8980
9305
|
}), this.viewer = new T({
|
8981
9306
|
readonly$: e,
|
8982
|
-
pagesIndex$:
|
9307
|
+
pagesIndex$: n,
|
8983
9308
|
previewRoot: i.$body,
|
8984
9309
|
footerRoot: i.$footer,
|
8985
9310
|
pages$: new valueEnhancer.Val(r),
|
@@ -8993,11 +9318,11 @@
|
|
8993
9318
|
this.viewer.events.on("back", () => this.prevPage()),
|
8994
9319
|
this.viewer.events.on("next", () => this.nextPage())
|
8995
9320
|
]), this.render(), this.sideEffect.addDisposer(
|
8996
|
-
|
8997
|
-
var u,
|
9321
|
+
n.subscribe((l, p) => {
|
9322
|
+
var u, o2;
|
8998
9323
|
if (e.value)
|
8999
9324
|
return;
|
9000
|
-
const a = this.context.getInitScenePath(), c = (
|
9325
|
+
const a = this.context.getInitScenePath(), c = (o2 = (u = this.context.getScenes()) == null ? void 0 : u[l]) == null ? void 0 : o2.name;
|
9001
9326
|
if (a && c && this.context.setScenePath(`${a}/${c}`), p) {
|
9002
9327
|
const d = this.context.room;
|
9003
9328
|
if (d) {
|
@@ -9024,7 +9349,7 @@
|
|
9024
9349
|
this.jumpToPage(this.pagesIndex$.value - 1, true);
|
9025
9350
|
}
|
9026
9351
|
jumpToPage(e, t = false) {
|
9027
|
-
this.pagesIndex$.setValue(
|
9352
|
+
this.pagesIndex$.setValue(E$1(e, 0, this.pages.length - 1), t);
|
9028
9353
|
}
|
9029
9354
|
render() {
|
9030
9355
|
var t;
|
@@ -9049,8 +9374,8 @@
|
|
9049
9374
|
var r;
|
9050
9375
|
const i = this.context.room;
|
9051
9376
|
if (i && i.state.memberState.currentApplianceName === "clicker") {
|
9052
|
-
for (let
|
9053
|
-
if ((r =
|
9377
|
+
for (let n = s.target; n; n = n.parentElement)
|
9378
|
+
if ((r = n.classList) != null && r.contains("ppt-event-source"))
|
9054
9379
|
return;
|
9055
9380
|
i.pptNextStep();
|
9056
9381
|
}
|
@@ -9067,20 +9392,20 @@
|
|
9067
9392
|
if (!t)
|
9068
9393
|
throw new Error("[Docs Viewer]: scenes not found.");
|
9069
9394
|
const s = new sideEffectManager.SideEffectManager(), i = t.map(
|
9070
|
-
({ ppt:
|
9071
|
-
width:
|
9072
|
-
height:
|
9073
|
-
src:
|
9074
|
-
thumbnail:
|
9395
|
+
({ ppt: n }) => n ? {
|
9396
|
+
width: n.width,
|
9397
|
+
height: n.height,
|
9398
|
+
src: n.src,
|
9399
|
+
thumbnail: n.previewURL
|
9075
9400
|
} : null
|
9076
|
-
).filter((
|
9401
|
+
).filter((n) => Boolean(n));
|
9077
9402
|
if (i.length <= 0)
|
9078
9403
|
throw new Error("[Docs Viewer]: empty scenes.");
|
9079
9404
|
e.mountStyles(F);
|
9080
9405
|
const r = new valueEnhancer.Val(!h2.isWritable);
|
9081
9406
|
s.addDisposer(
|
9082
|
-
h2.emitter.on("writableChange", (
|
9083
|
-
r.setValue(!
|
9407
|
+
h2.emitter.on("writableChange", (n) => {
|
9408
|
+
r.setValue(!n);
|
9084
9409
|
})
|
9085
9410
|
), i[0].src.startsWith("ppt") ? le$1(
|
9086
9411
|
s,
|
@@ -9108,18 +9433,18 @@
|
|
9108
9433
|
r.view.disableCameraTransform = p;
|
9109
9434
|
})
|
9110
9435
|
);
|
9111
|
-
const
|
9436
|
+
const n = e.createStorage("static-docs-viewer", { pagesScrollTop: 0 }), l = new re({
|
9112
9437
|
whiteboard: r,
|
9113
9438
|
readonly$: i,
|
9114
9439
|
box: t,
|
9115
9440
|
pages: s,
|
9116
|
-
pagesScrollTop:
|
9441
|
+
pagesScrollTop: n.state.pagesScrollTop,
|
9117
9442
|
onUserScroll: (p) => {
|
9118
|
-
e.isWritable &&
|
9443
|
+
e.isWritable && n.setState({ pagesScrollTop: p });
|
9119
9444
|
}
|
9120
9445
|
});
|
9121
9446
|
h2.addDisposer(() => l.destroy()), h2.addDisposer(
|
9122
|
-
|
9447
|
+
n.on("stateChanged", (p) => {
|
9123
9448
|
p.pagesScrollTop && l.syncPageScrollTop(p.pagesScrollTop.newValue || 0);
|
9124
9449
|
})
|
9125
9450
|
), h2.addDisposer(
|
@@ -9131,8 +9456,8 @@
|
|
9131
9456
|
l.pagesSize$,
|
9132
9457
|
l.pageRenderer._pagesMinHeight$
|
9133
9458
|
],
|
9134
|
-
([p, a, c, u,
|
9135
|
-
|
9459
|
+
([p, a, c, u, o2]) => p ? Math.max(
|
9460
|
+
o2 / u.width * (2 / 5),
|
9136
9461
|
a.height / a.width
|
9137
9462
|
) : c.height / c.width * (a.height / a.width)
|
9138
9463
|
).subscribe((p) => {
|
@@ -9143,20 +9468,20 @@
|
|
9143
9468
|
function le$1(h2, e, t, s, i) {
|
9144
9469
|
const r = e.createWhiteBoardView();
|
9145
9470
|
r.view.disableCameraTransform = true;
|
9146
|
-
const
|
9471
|
+
const n = new ae$1({
|
9147
9472
|
context: e,
|
9148
9473
|
whiteboard: r,
|
9149
9474
|
box: t,
|
9150
9475
|
pages: s,
|
9151
9476
|
readonly$: i
|
9152
9477
|
});
|
9153
|
-
h2.addDisposer(() =>
|
9478
|
+
h2.addDisposer(() => n.destroy());
|
9154
9479
|
const l = new valueEnhancer.Val(
|
9155
9480
|
{ width: s[0].width, height: s[0].height },
|
9156
9481
|
{ compare: z$1 }
|
9157
9482
|
);
|
9158
9483
|
if (h2.addDisposer(
|
9159
|
-
|
9484
|
+
n.pagesIndex$.subscribe((p) => {
|
9160
9485
|
const a = s[p];
|
9161
9486
|
a && l.setValue({ width: a.width, height: a.height });
|
9162
9487
|
})
|
@@ -9168,7 +9493,7 @@
|
|
9168
9493
|
const p = h2.add(() => {
|
9169
9494
|
const a = ({ width: c, height: u }) => {
|
9170
9495
|
if (s.length > 0 && t.state !== "maximized") {
|
9171
|
-
const { width:
|
9496
|
+
const { width: o2, height: d } = s[0], w2 = d / o2 * c - u;
|
9172
9497
|
w2 !== 0 && e.isWritable && e.emitter.emit("setBoxSize", {
|
9173
9498
|
width: t.intrinsicWidth,
|
9174
9499
|
height: t.intrinsicHeight + w2 / t.rootRect.height
|
@@ -9536,13 +9861,13 @@
|
|
9536
9861
|
return Array.isArray(e) ? e[0] : e;
|
9537
9862
|
}
|
9538
9863
|
function Li(e) {
|
9539
|
-
let i, t, r, s, n, a, l, d, c, u, m, p, v, b, T2, N,
|
9864
|
+
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;
|
9540
9865
|
return {
|
9541
9866
|
c() {
|
9542
|
-
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"),
|
9867
|
+
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");
|
9543
9868
|
},
|
9544
9869
|
m(We, ni) {
|
9545
|
-
te(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,
|
9870
|
+
te(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);
|
9546
9871
|
},
|
9547
9872
|
p: X,
|
9548
9873
|
i: X,
|
@@ -10426,19 +10751,19 @@
|
|
10426
10751
|
const p = _("div", z({}, u, { class: `${u.class} plyr__menu`.trim(), hidden: "" }));
|
10427
10752
|
p.appendChild(t.call(this, "settings", { "aria-haspopup": true, "aria-controls": `plyr-settings-${e.id}`, "aria-expanded": false }));
|
10428
10753
|
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" });
|
10429
|
-
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((
|
10754
|
+
T2.appendChild(N), b.appendChild(T2), this.elements.settings.panels.home = T2, this.config.settings.forEach((x) => {
|
10430
10755
|
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: "" }));
|
10431
|
-
i.call(this, y,
|
10432
|
-
d.call(this,
|
10756
|
+
i.call(this, y, x), E.call(this, y, "click", () => {
|
10757
|
+
d.call(this, x, false);
|
10433
10758
|
});
|
10434
|
-
const C = _("span", null, j.get(
|
10435
|
-
L.innerHTML = e[
|
10436
|
-
const $ = _("div", { id: `plyr-settings-${e.id}-${
|
10437
|
-
D2.appendChild(_("span", { "aria-hidden": true }, j.get(
|
10759
|
+
const C = _("span", null, j.get(x, this.config)), L = _("span", { class: this.config.classNames.menu.value });
|
10760
|
+
L.innerHTML = e[x], C.appendChild(L), y.appendChild(C), N.appendChild(y);
|
10761
|
+
const $ = _("div", { id: `plyr-settings-${e.id}-${x}`, hidden: "" }), D2 = _("button", { type: "button", class: `${this.config.classNames.control} ${this.config.classNames.control}--back` });
|
10762
|
+
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) => {
|
10438
10763
|
V.key === "ArrowLeft" && (V.preventDefault(), V.stopPropagation(), d.call(this, "home", true));
|
10439
10764
|
}, false), E.call(this, D2, "click", () => {
|
10440
10765
|
d.call(this, "home", false);
|
10441
|
-
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[
|
10766
|
+
}), $.appendChild(D2), $.appendChild(_("div", { role: "menu" })), b.appendChild($), this.elements.settings.buttons[x] = y, this.elements.settings.panels[x] = $;
|
10442
10767
|
}), v.appendChild(b), p.appendChild(v), c.appendChild(p), this.elements.settings.popup = v, this.elements.settings.menu = p;
|
10443
10768
|
}
|
10444
10769
|
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") {
|
@@ -11022,9 +11347,9 @@
|
|
11022
11347
|
}, r = {}, s = {}, n = {};
|
11023
11348
|
function a(p, v) {
|
11024
11349
|
p = p.push ? p : [p];
|
11025
|
-
var b, T2, N,
|
11350
|
+
var b, T2, N, x = [], y = p.length, C = y;
|
11026
11351
|
for (b = function(L, $) {
|
11027
|
-
$.length &&
|
11352
|
+
$.length && x.push(L), --C || v(x);
|
11028
11353
|
}; y--; )
|
11029
11354
|
T2 = p[y], (N = s[T2]) ? b(T2, N) : (n[T2] = n[T2] || []).push(b);
|
11030
11355
|
}
|
@@ -11040,32 +11365,32 @@
|
|
11040
11365
|
p.call && (p = { success: p }), v.length ? (p.error || t)(v) : (p.success || t)(p);
|
11041
11366
|
}
|
11042
11367
|
function c(p, v, b, T2) {
|
11043
|
-
var N,
|
11044
|
-
T2 = T2 || 0, /(^css!|\.css$)/.test(D2) ? ((
|
11368
|
+
var N, x, y = document, C = b.async, L = (b.numRetries || 0) + 1, $ = b.before || t, D2 = p.replace(/[\?|#].*$/, ""), V = p.replace(/^(css|img)!/, "");
|
11369
|
+
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) {
|
11045
11370
|
var F2 = re2.type[0];
|
11046
11371
|
if (N)
|
11047
11372
|
try {
|
11048
|
-
|
11373
|
+
x.sheet.cssText.length || (F2 = "e");
|
11049
11374
|
} catch (ce) {
|
11050
11375
|
ce.code != 18 && (F2 = "e");
|
11051
11376
|
}
|
11052
11377
|
if (F2 == "e") {
|
11053
11378
|
if ((T2 += 1) < L)
|
11054
11379
|
return c(p, v, b, T2);
|
11055
|
-
} else if (
|
11056
|
-
return
|
11380
|
+
} else if (x.rel == "preload" && x.as == "style")
|
11381
|
+
return x.rel = "stylesheet";
|
11057
11382
|
v(p, F2, re2.defaultPrevented);
|
11058
|
-
}, $(p,
|
11383
|
+
}, $(p, x) !== false && y.head.appendChild(x);
|
11059
11384
|
}
|
11060
11385
|
function u(p, v, b) {
|
11061
|
-
var T2, N,
|
11386
|
+
var T2, N, x = (p = p.push ? p : [p]).length, y = x, C = [];
|
11062
11387
|
for (T2 = function(L, $, D2) {
|
11063
11388
|
if ($ == "e" && C.push(L), $ == "b") {
|
11064
11389
|
if (!D2)
|
11065
11390
|
return;
|
11066
11391
|
C.push(L);
|
11067
11392
|
}
|
11068
|
-
--
|
11393
|
+
--x || v(C);
|
11069
11394
|
}, N = 0; N < y; N++)
|
11070
11395
|
c(p[N], T2, b);
|
11071
11396
|
}
|
@@ -11076,14 +11401,14 @@
|
|
11076
11401
|
throw "LoadJS";
|
11077
11402
|
r[T2] = true;
|
11078
11403
|
}
|
11079
|
-
function
|
11404
|
+
function x(y, C) {
|
11080
11405
|
u(p, function(L) {
|
11081
11406
|
d(N, L), y && d({ success: y, error: C }, L), l(T2, L);
|
11082
11407
|
}, N);
|
11083
11408
|
}
|
11084
11409
|
if (N.returnPromise)
|
11085
|
-
return new Promise(
|
11086
|
-
|
11410
|
+
return new Promise(x);
|
11411
|
+
x();
|
11087
11412
|
}
|
11088
11413
|
return m.ready = function(p, v) {
|
11089
11414
|
return a(p, function(b) {
|
@@ -11166,11 +11491,11 @@
|
|
11166
11491
|
T2 = C, w.call(e, e.media, "volumechange");
|
11167
11492
|
});
|
11168
11493
|
} });
|
11169
|
-
let N, { loop:
|
11170
|
-
Object.defineProperty(e.media, "loop", { get: () =>
|
11494
|
+
let N, { loop: x } = e.config;
|
11495
|
+
Object.defineProperty(e.media, "loop", { get: () => x, set(y) {
|
11171
11496
|
const C = o.boolean(y) ? y : e.config.loop.active;
|
11172
11497
|
e.embed.setLoop(C).then(() => {
|
11173
|
-
|
11498
|
+
x = C;
|
11174
11499
|
});
|
11175
11500
|
} }), e.embed.getVideoUrl().then((y) => {
|
11176
11501
|
N = y, h.setDownloadUrl.call(e);
|
@@ -12297,8 +12622,8 @@
|
|
12297
12622
|
const _WindowManager = class extends whiteWebSdk.InvisiblePlugin {
|
12298
12623
|
constructor(context) {
|
12299
12624
|
super(context);
|
12300
|
-
this.version = "1.0.0-canary.
|
12301
|
-
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.
|
12625
|
+
this.version = "1.0.0-canary.78";
|
12626
|
+
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" } };
|
12302
12627
|
this.emitter = callbacks;
|
12303
12628
|
this.viewMode$ = new valueEnhancer.Val(whiteWebSdk.ViewMode.Broadcaster);
|
12304
12629
|
this.playground$ = new valueEnhancer.Val(void 0);
|
@@ -12314,7 +12639,7 @@
|
|
12314
12639
|
(_b = this.appManager) == null ? void 0 : _b.dispatchInternalEvent(Events.MoveCamera, camera);
|
12315
12640
|
};
|
12316
12641
|
_WindowManager.displayer = context.displayer;
|
12317
|
-
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.
|
12642
|
+
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" } };
|
12318
12643
|
}
|
12319
12644
|
static async mount(params) {
|
12320
12645
|
var _a;
|
@@ -12479,12 +12804,21 @@
|
|
12479
12804
|
}
|
12480
12805
|
}
|
12481
12806
|
}
|
12807
|
+
/**
|
12808
|
+
* 注册插件
|
12809
|
+
*/
|
12482
12810
|
static register(params) {
|
12483
12811
|
return appRegister.register(params);
|
12484
12812
|
}
|
12813
|
+
/**
|
12814
|
+
* 注销插件
|
12815
|
+
*/
|
12485
12816
|
static unregister(kind) {
|
12486
12817
|
return appRegister.unregister(kind);
|
12487
12818
|
}
|
12819
|
+
/**
|
12820
|
+
* 创建一个 app 至白板
|
12821
|
+
*/
|
12488
12822
|
async addApp(params) {
|
12489
12823
|
if (this.appManager) {
|
12490
12824
|
if (this.appManager.rootDirRemoving) {
|
@@ -12571,11 +12905,17 @@
|
|
12571
12905
|
}
|
12572
12906
|
return isDynamicPPT;
|
12573
12907
|
}
|
12908
|
+
/**
|
12909
|
+
* 设置 mainView 的 ScenePath, 并且切换白板为可写状态
|
12910
|
+
*/
|
12574
12911
|
async setMainViewScenePath(scenePath) {
|
12575
12912
|
if (this.appManager) {
|
12576
12913
|
await this.appManager.setMainViewScenePath(scenePath);
|
12577
12914
|
}
|
12578
12915
|
}
|
12916
|
+
/**
|
12917
|
+
* 设置 mainView 的 SceneIndex, 并且切换白板为可写状态
|
12918
|
+
*/
|
12579
12919
|
async setMainViewSceneIndex(index2) {
|
12580
12920
|
if (this.appManager) {
|
12581
12921
|
await this.appManager.setMainViewSceneIndex(index2);
|
@@ -12631,6 +12971,11 @@
|
|
12631
12971
|
}
|
12632
12972
|
}
|
12633
12973
|
}
|
12974
|
+
/**
|
12975
|
+
* 删除一页
|
12976
|
+
* 默认删除当前页, 可以删除指定 index 页
|
12977
|
+
* 最低保留一页
|
12978
|
+
*/
|
12634
12979
|
async removePage(index2) {
|
12635
12980
|
if (this.appManager) {
|
12636
12981
|
const needRemoveIndex = index2 === void 0 ? this.pageState.index : index2;
|
@@ -12647,27 +12992,45 @@
|
|
12647
12992
|
return false;
|
12648
12993
|
}
|
12649
12994
|
}
|
12995
|
+
/**
|
12996
|
+
* 返回 mainView 的 ScenePath
|
12997
|
+
*/
|
12650
12998
|
getMainViewScenePath() {
|
12651
12999
|
var _a;
|
12652
13000
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewScenePath();
|
12653
13001
|
}
|
13002
|
+
/**
|
13003
|
+
* 返回 mainView 的 SceneIndex
|
13004
|
+
*/
|
12654
13005
|
getMainViewSceneIndex() {
|
12655
13006
|
var _a;
|
12656
13007
|
return (_a = this.appManager) == null ? void 0 : _a.store.getMainViewSceneIndex();
|
12657
13008
|
}
|
13009
|
+
/**
|
13010
|
+
* 设置所有 app 的 readonly 模式
|
13011
|
+
*/
|
12658
13012
|
setReadonly(readonly) {
|
12659
13013
|
var _a;
|
12660
13014
|
this.readonly = readonly;
|
12661
13015
|
(_a = this.boxManager) == null ? void 0 : _a.setReadonly(readonly);
|
12662
13016
|
emitter.emit("setReadonly", readonly);
|
12663
13017
|
}
|
13018
|
+
/**
|
13019
|
+
* 切换 mainView 为可写
|
13020
|
+
*/
|
12664
13021
|
switchMainViewToWriter() {
|
12665
13022
|
var _a;
|
12666
13023
|
return (_a = this.appManager) == null ? void 0 : _a.mainViewProxy.mainViewClickHandler();
|
12667
13024
|
}
|
13025
|
+
/**
|
13026
|
+
* app destroy 回调
|
13027
|
+
*/
|
12668
13028
|
onAppDestroy(kind, listener) {
|
12669
13029
|
addEmitterOnceListener(`destroy-${kind}`, listener);
|
12670
13030
|
}
|
13031
|
+
/**
|
13032
|
+
* 设置 ViewMode
|
13033
|
+
*/
|
12671
13034
|
setViewMode(mode) {
|
12672
13035
|
var _a;
|
12673
13036
|
log("setViewMode", mode);
|
@@ -12845,14 +13208,23 @@
|
|
12845
13208
|
}
|
12846
13209
|
return this.boxManager.teleBoxManager;
|
12847
13210
|
}
|
13211
|
+
/**
|
13212
|
+
* 查询所有的 App
|
13213
|
+
*/
|
12848
13214
|
queryAll() {
|
12849
13215
|
var _a;
|
12850
13216
|
return Array.from(((_a = this.appManager) == null ? void 0 : _a.appProxies.values()) || []);
|
12851
13217
|
}
|
13218
|
+
/**
|
13219
|
+
* 查询单个 App
|
13220
|
+
*/
|
12852
13221
|
queryOne(appId) {
|
12853
13222
|
var _a;
|
12854
13223
|
return (_a = this.appManager) == null ? void 0 : _a.appProxies.get(appId);
|
12855
13224
|
}
|
13225
|
+
/**
|
13226
|
+
* 关闭 APP
|
13227
|
+
*/
|
12856
13228
|
async closeApp(appId) {
|
12857
13229
|
var _a;
|
12858
13230
|
return (_a = this.appManager) == null ? void 0 : _a.closeApp(appId);
|
@@ -12949,9 +13321,9 @@
|
|
12949
13321
|
var _a;
|
12950
13322
|
(_a = this.focusedView) == null ? void 0 : _a.duplicate();
|
12951
13323
|
}
|
12952
|
-
insertText(
|
13324
|
+
insertText(x, y, text2) {
|
12953
13325
|
var _a;
|
12954
|
-
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(
|
13326
|
+
return ((_a = this.focusedView) == null ? void 0 : _a.insertText(x, y, text2)) || "";
|
12955
13327
|
}
|
12956
13328
|
insertImage(info) {
|
12957
13329
|
var _a;
|
@@ -12974,6 +13346,7 @@
|
|
12974
13346
|
this._refresh();
|
12975
13347
|
(_a = this.appManager) == null ? void 0 : _a.dispatchInternalEvent(Events.Refresh);
|
12976
13348
|
}
|
13349
|
+
/** @inner */
|
12977
13350
|
_refresh() {
|
12978
13351
|
var _a, _b;
|
12979
13352
|
(_a = this.appManager) == null ? void 0 : _a.mainViewProxy.rebind();
|
@@ -13011,6 +13384,9 @@
|
|
13011
13384
|
});
|
13012
13385
|
}, 500);
|
13013
13386
|
}
|
13387
|
+
/**
|
13388
|
+
* 切换 focus 到指定的 app, 并且把这个 app 放到最前面
|
13389
|
+
*/
|
13014
13390
|
focusApp(appId) {
|
13015
13391
|
var _a, _b, _c;
|
13016
13392
|
const box = (_a = this.boxManager) == null ? void 0 : _a.getBox(appId);
|