@interopio/groups-ui-react 2.6.2 → 2.7.1
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/cjs/GroupWrapper.d.ts +2 -1
- package/dist/cjs/index.js +272 -177
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/tests/buttons/BaseButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/CloneButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/CloseButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/CustomButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/ExtractButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/FeedbackButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/LockButtons.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/MaximizeButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/MinimizeButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/OverflowButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/RestoreButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/StickyButton.test.d.ts +1 -0
- package/dist/cjs/tests/buttons/UnlockButton.test.d.ts +1 -0
- package/dist/cjs/tests/captionEditor/CaptionEditor.test.d.ts +1 -0
- package/dist/cjs/tests/channelSelector/BaseChannelSelector.test.d.ts +1 -0
- package/dist/cjs/tests/flatCaptionBar/FlatCaptionBar.test.d.ts +1 -0
- package/dist/cjs/tests/groupCaptionBar/GroupCaptionBar.test.d.ts +1 -0
- package/dist/cjs/tests/htmlButtonBar/HtmlButtonBar.test.d.ts +1 -0
- package/dist/cjs/tests/popups/TabOverflowPopup.test.d.ts +1 -0
- package/dist/cjs/tests/tabs/Tab.test.d.ts +1 -0
- package/dist/cjs/types/api.d.ts +10 -1
- package/dist/cjs/types/defaultComponents.d.ts +0 -1
- package/dist/cjs/types/internal.d.ts +21 -0
- package/dist/cjs/webGroupsManager.d.ts +4 -1
- package/dist/esm/GroupWrapper.d.ts +2 -1
- package/dist/esm/index.js +285 -190
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tests/buttons/BaseButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/CloneButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/CloseButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/CustomButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/ExtractButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/FeedbackButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/LockButtons.test.d.ts +1 -0
- package/dist/esm/tests/buttons/MaximizeButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/MinimizeButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/OverflowButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/RestoreButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/StickyButton.test.d.ts +1 -0
- package/dist/esm/tests/buttons/UnlockButton.test.d.ts +1 -0
- package/dist/esm/tests/captionEditor/CaptionEditor.test.d.ts +1 -0
- package/dist/esm/tests/channelSelector/BaseChannelSelector.test.d.ts +1 -0
- package/dist/esm/tests/flatCaptionBar/FlatCaptionBar.test.d.ts +1 -0
- package/dist/esm/tests/groupCaptionBar/GroupCaptionBar.test.d.ts +1 -0
- package/dist/esm/tests/htmlButtonBar/HtmlButtonBar.test.d.ts +1 -0
- package/dist/esm/tests/popups/TabOverflowPopup.test.d.ts +1 -0
- package/dist/esm/tests/tabs/Tab.test.d.ts +1 -0
- package/dist/esm/types/api.d.ts +10 -1
- package/dist/esm/types/defaultComponents.d.ts +0 -1
- package/dist/esm/types/internal.d.ts +21 -0
- package/dist/esm/webGroupsManager.d.ts +4 -1
- package/dist/styles/groups.css +6 -36
- package/dist/styles/vars.css +2 -1
- package/package.json +36 -28
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useRef, useEffect
|
|
1
|
+
import React, { useRef, useEffect, useLayoutEffect, useState, useContext } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import { IOConnectContext } from '@interopio/react-hooks';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/******************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
7
7
|
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -16,16 +16,18 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
18
|
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise */
|
|
19
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
20
20
|
|
|
21
21
|
var extendStatics = function(d, b) {
|
|
22
22
|
extendStatics = Object.setPrototypeOf ||
|
|
23
23
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
24
|
-
function (d, b) { for (var p in b) if (
|
|
24
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
25
25
|
return extendStatics(d, b);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
function __extends(d, b) {
|
|
29
|
+
if (typeof b !== "function" && b !== null)
|
|
30
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
29
31
|
extendStatics(d, b);
|
|
30
32
|
function __() { this.constructor = d; }
|
|
31
33
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -52,7 +54,12 @@ function __rest(s, e) {
|
|
|
52
54
|
t[p[i]] = s[p[i]];
|
|
53
55
|
}
|
|
54
56
|
return t;
|
|
55
|
-
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
60
|
+
var e = new Error(message);
|
|
61
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
62
|
+
};
|
|
56
63
|
|
|
57
64
|
var TargetType;
|
|
58
65
|
(function (TargetType) {
|
|
@@ -319,6 +326,15 @@ var WebGroupsManagerDecorator = /** @class */ (function () {
|
|
|
319
326
|
WebGroupsManagerDecorator.prototype.requestCommitCaptionEditing = function (targetType, targetId) {
|
|
320
327
|
this.registry.execute(targetType + "-" + targetId);
|
|
321
328
|
};
|
|
329
|
+
WebGroupsManagerDecorator.prototype.updateTabHeaderStyles = function (styles) {
|
|
330
|
+
window.webGroupsManager.externalLibraryFactory.updateTabHeaderStyles(styles);
|
|
331
|
+
};
|
|
332
|
+
WebGroupsManagerDecorator.prototype.updateTabMoveAreaStyles = function (styles) {
|
|
333
|
+
window.webGroupsManager.externalLibraryFactory.updateTabMoveAreaStyles(styles);
|
|
334
|
+
};
|
|
335
|
+
WebGroupsManagerDecorator.prototype.updateFrameStyles = function (styles) {
|
|
336
|
+
window.webGroupsManager.externalLibraryFactory.updateFrameStyles(styles);
|
|
337
|
+
};
|
|
322
338
|
WebGroupsManagerDecorator.prototype.selectTab = function (windowId) {
|
|
323
339
|
window.webGroupsManager.externalLibraryFactory.selectTab(windowId);
|
|
324
340
|
};
|
|
@@ -349,7 +365,7 @@ var webGroupsManager = new WebGroupsManagerDecorator();
|
|
|
349
365
|
|
|
350
366
|
var BaseButton = function (_a) {
|
|
351
367
|
var outerElement = _a.outerElement, innerElement = _a.innerElement;
|
|
352
|
-
return React.createElement("li", __assign({}, outerElement, { className: webGroupsManager.skipFocusStyle + " " + outerElement.className }),
|
|
368
|
+
return React.createElement("li", __assign({}, outerElement, { "data-testid": "outer-element", className: webGroupsManager.skipFocusStyle + " " + outerElement.className }),
|
|
353
369
|
React.createElement("div", __assign({}, innerElement)));
|
|
354
370
|
};
|
|
355
371
|
|
|
@@ -373,9 +389,7 @@ class ColorError extends Error {
|
|
|
373
389
|
constructor(color) {
|
|
374
390
|
super(`Failed to parse color: "${color}"`);
|
|
375
391
|
}
|
|
376
|
-
|
|
377
392
|
}
|
|
378
|
-
|
|
379
393
|
var ColorError$1 = ColorError;
|
|
380
394
|
|
|
381
395
|
/**
|
|
@@ -383,115 +397,94 @@ var ColorError$1 = ColorError;
|
|
|
383
397
|
*
|
|
384
398
|
* @param color the input color. Can be a RGB, RBGA, HSL, HSLA, or named color
|
|
385
399
|
*/
|
|
386
|
-
|
|
387
400
|
function parseToRgba(color) {
|
|
388
401
|
if (typeof color !== 'string') throw new ColorError$1(color);
|
|
389
402
|
if (color.trim().toLowerCase() === 'transparent') return [0, 0, 0, 0];
|
|
390
403
|
let normalizedColor = color.trim();
|
|
391
404
|
normalizedColor = namedColorRegex.test(color) ? nameToHex(color) : color;
|
|
392
405
|
const reducedHexMatch = reducedHexRegex.exec(normalizedColor);
|
|
393
|
-
|
|
394
406
|
if (reducedHexMatch) {
|
|
395
407
|
const arr = Array.from(reducedHexMatch).slice(1);
|
|
396
|
-
return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];
|
|
408
|
+
return [...arr.slice(0, 3).map(x => parseInt(r$1(x, 2), 16)), parseInt(r$1(arr[3] || 'f', 2), 16) / 255];
|
|
397
409
|
}
|
|
398
|
-
|
|
399
410
|
const hexMatch = hexRegex.exec(normalizedColor);
|
|
400
|
-
|
|
401
411
|
if (hexMatch) {
|
|
402
412
|
const arr = Array.from(hexMatch).slice(1);
|
|
403
413
|
return [...arr.slice(0, 3).map(x => parseInt(x, 16)), parseInt(arr[3] || 'ff', 16) / 255];
|
|
404
414
|
}
|
|
405
|
-
|
|
406
415
|
const rgbaMatch = rgbaRegex.exec(normalizedColor);
|
|
407
|
-
|
|
408
416
|
if (rgbaMatch) {
|
|
409
417
|
const arr = Array.from(rgbaMatch).slice(1);
|
|
410
418
|
return [...arr.slice(0, 3).map(x => parseInt(x, 10)), parseFloat(arr[3] || '1')];
|
|
411
419
|
}
|
|
412
|
-
|
|
413
420
|
const hslaMatch = hslaRegex.exec(normalizedColor);
|
|
414
|
-
|
|
415
421
|
if (hslaMatch) {
|
|
416
422
|
const [h, s, l, a] = Array.from(hslaMatch).slice(1).map(parseFloat);
|
|
417
423
|
if (guard(0, 100, s) !== s) throw new ColorError$1(color);
|
|
418
424
|
if (guard(0, 100, l) !== l) throw new ColorError$1(color);
|
|
419
|
-
return [...hslToRgb(h, s, l), a
|
|
425
|
+
return [...hslToRgb(h, s, l), Number.isNaN(a) ? 1 : a];
|
|
420
426
|
}
|
|
421
|
-
|
|
422
427
|
throw new ColorError$1(color);
|
|
423
428
|
}
|
|
424
|
-
|
|
425
429
|
function hash(str) {
|
|
426
430
|
let hash = 5381;
|
|
427
431
|
let i = str.length;
|
|
428
|
-
|
|
429
432
|
while (i) {
|
|
430
433
|
hash = hash * 33 ^ str.charCodeAt(--i);
|
|
431
434
|
}
|
|
435
|
+
|
|
432
436
|
/* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
|
|
433
437
|
* integers. Since we want the results to be always positive, convert the
|
|
434
438
|
* signed int to an unsigned by doing an unsigned bitshift. */
|
|
435
|
-
|
|
436
|
-
|
|
437
439
|
return (hash >>> 0) % 2341;
|
|
438
440
|
}
|
|
439
|
-
|
|
440
441
|
const colorToInt = x => parseInt(x.replace(/_/g, ''), 36);
|
|
441
|
-
|
|
442
442
|
const compressedColorMap = '1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm'.split(' ').reduce((acc, next) => {
|
|
443
443
|
const key = colorToInt(next.substring(0, 3));
|
|
444
|
-
const hex = colorToInt(next.substring(3)).toString(16);
|
|
445
|
-
// https://github.com/ricokahler/color2k/issues/351
|
|
444
|
+
const hex = colorToInt(next.substring(3)).toString(16);
|
|
446
445
|
|
|
446
|
+
// NOTE: padStart could be used here but it breaks Node 6 compat
|
|
447
|
+
// https://github.com/ricokahler/color2k/issues/351
|
|
447
448
|
let prefix = '';
|
|
448
|
-
|
|
449
449
|
for (let i = 0; i < 6 - hex.length; i++) {
|
|
450
450
|
prefix += '0';
|
|
451
451
|
}
|
|
452
|
-
|
|
453
452
|
acc[key] = `${prefix}${hex}`;
|
|
454
453
|
return acc;
|
|
455
454
|
}, {});
|
|
455
|
+
|
|
456
456
|
/**
|
|
457
457
|
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
458
458
|
*/
|
|
459
|
-
|
|
460
459
|
function nameToHex(color) {
|
|
461
460
|
const normalizedColorName = color.toLowerCase().trim();
|
|
462
461
|
const result = compressedColorMap[hash(normalizedColorName)];
|
|
463
462
|
if (!result) throw new ColorError$1(color);
|
|
464
463
|
return `#${result}`;
|
|
465
464
|
}
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
const
|
|
470
|
-
const hexRegex = new RegExp(`^#${r('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');
|
|
471
|
-
const rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r(',\\s*(\\d+)\\s*', 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, 'i');
|
|
465
|
+
const r$1 = (str, amount) => Array.from(Array(amount)).map(() => str).join('');
|
|
466
|
+
const reducedHexRegex = new RegExp(`^#${r$1('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');
|
|
467
|
+
const hexRegex = new RegExp(`^#${r$1('([a-f0-9]{2})', 3)}([a-f0-9]{2})?$`, 'i');
|
|
468
|
+
const rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$1(',\\s*(\\d+)\\s*', 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, 'i');
|
|
472
469
|
const hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;
|
|
473
470
|
const namedColorRegex = /^[a-z]+$/i;
|
|
474
|
-
|
|
475
471
|
const roundColor = color => {
|
|
476
472
|
return Math.round(color * 255);
|
|
477
473
|
};
|
|
478
|
-
|
|
479
474
|
const hslToRgb = (hue, saturation, lightness) => {
|
|
480
475
|
let l = lightness / 100;
|
|
481
|
-
|
|
482
476
|
if (saturation === 0) {
|
|
483
477
|
// achromatic
|
|
484
478
|
return [l, l, l].map(roundColor);
|
|
485
|
-
}
|
|
486
|
-
|
|
479
|
+
}
|
|
487
480
|
|
|
481
|
+
// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
488
482
|
const huePrime = (hue % 360 + 360) % 360 / 60;
|
|
489
483
|
const chroma = (1 - Math.abs(2 * l - 1)) * (saturation / 100);
|
|
490
484
|
const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
491
485
|
let red = 0;
|
|
492
486
|
let green = 0;
|
|
493
487
|
let blue = 0;
|
|
494
|
-
|
|
495
488
|
if (huePrime >= 0 && huePrime < 1) {
|
|
496
489
|
red = chroma;
|
|
497
490
|
green = secondComponent;
|
|
@@ -511,7 +504,6 @@ const hslToRgb = (hue, saturation, lightness) => {
|
|
|
511
504
|
red = chroma;
|
|
512
505
|
blue = secondComponent;
|
|
513
506
|
}
|
|
514
|
-
|
|
515
507
|
const lightnessModification = l - chroma / 2;
|
|
516
508
|
const finalRed = red + lightnessModification;
|
|
517
509
|
const finalGreen = green + lightnessModification;
|
|
@@ -519,20 +511,18 @@ const hslToRgb = (hue, saturation, lightness) => {
|
|
|
519
511
|
return [finalRed, finalGreen, finalBlue].map(roundColor);
|
|
520
512
|
};
|
|
521
513
|
|
|
514
|
+
// taken from:
|
|
522
515
|
// https://github.com/styled-components/polished/blob/0764c982551b487469043acb56281b0358b3107b/src/color/getLuminance.js
|
|
523
516
|
|
|
524
517
|
/**
|
|
525
518
|
* Returns a number (float) representing the luminance of a color.
|
|
526
519
|
*/
|
|
527
|
-
|
|
528
520
|
function getLuminance(color) {
|
|
529
521
|
if (color === 'transparent') return 0;
|
|
530
|
-
|
|
531
522
|
function f(x) {
|
|
532
523
|
const channel = x / 255;
|
|
533
|
-
return channel <= 0.
|
|
524
|
+
return channel <= 0.04045 ? channel / 12.92 : Math.pow((channel + 0.055) / 1.055, 2.4);
|
|
534
525
|
}
|
|
535
|
-
|
|
536
526
|
const [r, g, b] = parseToRgba(color);
|
|
537
527
|
return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b);
|
|
538
528
|
}
|
|
@@ -542,7 +532,6 @@ function getLuminance(color) {
|
|
|
542
532
|
* readable color (i.e. the color to be place on top the input color) should be
|
|
543
533
|
* black.
|
|
544
534
|
*/
|
|
545
|
-
|
|
546
535
|
function readableColorIsBlack(color) {
|
|
547
536
|
return getLuminance(color) > 0.179;
|
|
548
537
|
}
|
|
@@ -607,7 +596,7 @@ var BaseChannelSelector = function (_a) {
|
|
|
607
596
|
height: bounds.height,
|
|
608
597
|
});
|
|
609
598
|
};
|
|
610
|
-
useEffect
|
|
599
|
+
useEffect(function () {
|
|
611
600
|
var handler = function (e) {
|
|
612
601
|
e.stopPropagation();
|
|
613
602
|
};
|
|
@@ -1658,7 +1647,7 @@ var index = (function () {
|
|
|
1658
1647
|
})();
|
|
1659
1648
|
|
|
1660
1649
|
function useEditableCaption(ref, options) {
|
|
1661
|
-
useLayoutEffect
|
|
1650
|
+
useLayoutEffect(function () {
|
|
1662
1651
|
if (!ref.current) {
|
|
1663
1652
|
return;
|
|
1664
1653
|
}
|
|
@@ -1685,7 +1674,7 @@ var FlatCaption = function (_a) {
|
|
|
1685
1674
|
};
|
|
1686
1675
|
|
|
1687
1676
|
function useCaptionEditor(ref, options) {
|
|
1688
|
-
useEffect
|
|
1677
|
+
useEffect(function () {
|
|
1689
1678
|
if (!(ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
1690
1679
|
return;
|
|
1691
1680
|
}
|
|
@@ -1707,7 +1696,7 @@ function useCaptionEditor(ref, options) {
|
|
|
1707
1696
|
}
|
|
1708
1697
|
|
|
1709
1698
|
function useCommitEditingRequested(targetType, targetId, text) {
|
|
1710
|
-
useEffect
|
|
1699
|
+
useEffect(function () {
|
|
1711
1700
|
var unsub = webGroupsManager.onCommitCaptionEditingRequested(targetType, targetId, function () {
|
|
1712
1701
|
webGroupsManager.commitCaptionEditing(targetType, targetId, text);
|
|
1713
1702
|
});
|
|
@@ -1719,8 +1708,8 @@ function useCommitEditingRequested(targetType, targetId, text) {
|
|
|
1719
1708
|
|
|
1720
1709
|
var CaptionEditor = function (_a) {
|
|
1721
1710
|
var className = _a.className, commitChanges = _a.commitChanges, hideEditor = _a.hideEditor, notifyBoundsChanged = _a.notifyBoundsChanged, caption = _a.caption, notifyEditorVisibilityChanged = _a.notifyEditorVisibilityChanged, targetType = _a.targetType, targetId = _a.targetId;
|
|
1722
|
-
var _b = useState
|
|
1723
|
-
var _c = useState
|
|
1711
|
+
var _b = useState(caption), captionInEditor = _b[0], setCaptionInEditor = _b[1];
|
|
1712
|
+
var _c = useState(0), inputWidth = _c[0], setInputWidth = _c[1];
|
|
1724
1713
|
var ref = useRef(null);
|
|
1725
1714
|
var measurementRef = useRef(null);
|
|
1726
1715
|
var onBlur = function () {
|
|
@@ -1745,7 +1734,7 @@ var CaptionEditor = function (_a) {
|
|
|
1745
1734
|
};
|
|
1746
1735
|
useCaptionEditor(ref, { notifyBoundsChanged: notifyBoundsChanged, notifyEditorVisibilityChanged: notifyEditorVisibilityChanged });
|
|
1747
1736
|
useCommitEditingRequested(targetType, targetId, captionInEditor);
|
|
1748
|
-
useEffect
|
|
1737
|
+
useEffect(function () {
|
|
1749
1738
|
if (!ref.current) {
|
|
1750
1739
|
return;
|
|
1751
1740
|
}
|
|
@@ -1765,7 +1754,7 @@ var CaptionEditor = function (_a) {
|
|
|
1765
1754
|
element === null || element === void 0 ? void 0 : element.removeEventListener("mousedown", onMouseDown);
|
|
1766
1755
|
};
|
|
1767
1756
|
}, [ref]);
|
|
1768
|
-
useEffect
|
|
1757
|
+
useEffect(function () {
|
|
1769
1758
|
if (!measurementRef.current) {
|
|
1770
1759
|
return;
|
|
1771
1760
|
}
|
|
@@ -1805,7 +1794,7 @@ var BaseMultiChannelSelector = function (_a) {
|
|
|
1805
1794
|
height: bounds.height,
|
|
1806
1795
|
});
|
|
1807
1796
|
};
|
|
1808
|
-
useEffect
|
|
1797
|
+
useEffect(function () {
|
|
1809
1798
|
var _a;
|
|
1810
1799
|
if (showBaseChannelSelector) {
|
|
1811
1800
|
return;
|
|
@@ -1916,7 +1905,7 @@ var TabCloseButton = function (_a) {
|
|
|
1916
1905
|
var normalContentClassName = "t42-tab-close-button-content";
|
|
1917
1906
|
var selectedContentClassName = "t42-tab-close-button-content t42-selected-tab-close-button-content";
|
|
1918
1907
|
var ref = useRef(null);
|
|
1919
|
-
useEffect
|
|
1908
|
+
useEffect(function () {
|
|
1920
1909
|
var _a;
|
|
1921
1910
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener("mousedown", function (e) {
|
|
1922
1911
|
e.stopPropagation();
|
|
@@ -1981,156 +1970,246 @@ function commonjsRequire () {
|
|
|
1981
1970
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
1982
1971
|
}
|
|
1983
1972
|
|
|
1973
|
+
function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k="function"===typeof Object.is?Object.is:h,l=React.useState,m=React.useEffect,n=React.useLayoutEffect,p=React.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c});},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c});})},[a]);p(d);return d}
|
|
1974
|
+
function r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k(a,d)}catch(f){return !0}}function t(a,b){return b()}var u="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t:q;var useSyncExternalStore=void 0!==React.useSyncExternalStore?React.useSyncExternalStore:u;
|
|
1975
|
+
|
|
1976
|
+
var useSyncExternalStoreShim_production_min = {
|
|
1977
|
+
useSyncExternalStore: useSyncExternalStore
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1980
|
+
var useSyncExternalStoreShim_development = createCommonjsModule(function (module, exports) {
|
|
1981
|
+
|
|
1982
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1983
|
+
(function() {
|
|
1984
|
+
|
|
1985
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
1986
|
+
if (
|
|
1987
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
1988
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
1989
|
+
'function'
|
|
1990
|
+
) {
|
|
1991
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
1992
|
+
}
|
|
1993
|
+
var React$1 = React;
|
|
1994
|
+
|
|
1995
|
+
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1996
|
+
|
|
1997
|
+
function error(format) {
|
|
1998
|
+
{
|
|
1999
|
+
{
|
|
2000
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2001
|
+
args[_key2 - 1] = arguments[_key2];
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
printWarning('error', format, args);
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
function printWarning(level, format, args) {
|
|
2010
|
+
// When changing this logic, you might want to also
|
|
2011
|
+
// update consoleWithStackDev.www.js as well.
|
|
2012
|
+
{
|
|
2013
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2014
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
2015
|
+
|
|
2016
|
+
if (stack !== '') {
|
|
2017
|
+
format += '%s';
|
|
2018
|
+
args = args.concat([stack]);
|
|
2019
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
2020
|
+
|
|
2021
|
+
|
|
2022
|
+
var argsWithFormat = args.map(function (item) {
|
|
2023
|
+
return String(item);
|
|
2024
|
+
}); // Careful: RN currently depends on this prefix
|
|
2025
|
+
|
|
2026
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
2027
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
2028
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
2029
|
+
|
|
2030
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
2036
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
2037
|
+
*/
|
|
1984
2038
|
function is(x, y) {
|
|
1985
|
-
return
|
|
2039
|
+
return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
|
|
2040
|
+
;
|
|
1986
2041
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2042
|
+
|
|
2043
|
+
var objectIs = typeof Object.is === 'function' ? Object.is : is;
|
|
2044
|
+
|
|
2045
|
+
// dispatch for CommonJS interop named imports.
|
|
2046
|
+
|
|
2047
|
+
var useState = React$1.useState,
|
|
2048
|
+
useEffect = React$1.useEffect,
|
|
2049
|
+
useLayoutEffect = React$1.useLayoutEffect,
|
|
2050
|
+
useDebugValue = React$1.useDebugValue;
|
|
2051
|
+
var didWarnOld18Alpha = false;
|
|
2052
|
+
var didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works
|
|
2053
|
+
// because of a very particular set of implementation details and assumptions
|
|
2054
|
+
// -- change any one of them and it will break. The most important assumption
|
|
2055
|
+
// is that updates are always synchronous, because concurrent rendering is
|
|
2056
|
+
// only available in versions of React that also have a built-in
|
|
2057
|
+
// useSyncExternalStore API. And we only use this shim when the built-in API
|
|
2058
|
+
// does not exist.
|
|
2059
|
+
//
|
|
2060
|
+
// Do not assume that the clever hacks used by this hook also work in general.
|
|
2061
|
+
// The point of this shim is to replace the need for hacks by other libraries.
|
|
2062
|
+
|
|
2063
|
+
function useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
2064
|
+
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
2065
|
+
// will need to track that themselves and return the correct value
|
|
2066
|
+
// from `getSnapshot`.
|
|
2067
|
+
getServerSnapshot) {
|
|
2068
|
+
{
|
|
2069
|
+
if (!didWarnOld18Alpha) {
|
|
2070
|
+
if (React$1.startTransition !== undefined) {
|
|
2071
|
+
didWarnOld18Alpha = true;
|
|
2072
|
+
|
|
2073
|
+
error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
} // Read the current snapshot from the store on every render. Again, this
|
|
2077
|
+
// breaks the rules of React, and only works here because of specific
|
|
2078
|
+
// implementation details, most importantly that updates are
|
|
2079
|
+
// always synchronous.
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
var value = getSnapshot();
|
|
2083
|
+
|
|
2084
|
+
{
|
|
2085
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
2086
|
+
var cachedValue = getSnapshot();
|
|
2087
|
+
|
|
2088
|
+
if (!objectIs(value, cachedValue)) {
|
|
2089
|
+
error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
2090
|
+
|
|
2091
|
+
didWarnUncachedGetSnapshot = true;
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
} // Because updates are synchronous, we don't queue them. Instead we force a
|
|
2095
|
+
// re-render whenever the subscribed state changes by updating an some
|
|
2096
|
+
// arbitrary useState hook. Then, during render, we call getSnapshot to read
|
|
2097
|
+
// the current value.
|
|
2098
|
+
//
|
|
2099
|
+
// Because we don't actually use the state returned by the useState hook, we
|
|
2100
|
+
// can save a bit of memory by storing other stuff in that slot.
|
|
2101
|
+
//
|
|
2102
|
+
// To implement the early bailout, we need to track some things on a mutable
|
|
2103
|
+
// object. Usually, we would put that in a useRef hook, but we can stash it in
|
|
2104
|
+
// our useState hook instead.
|
|
2105
|
+
//
|
|
2106
|
+
// To force a re-render, we call forceUpdate({inst}). That works because the
|
|
2107
|
+
// new object always fails an equality check.
|
|
2108
|
+
|
|
2109
|
+
|
|
2110
|
+
var _useState = useState({
|
|
2111
|
+
inst: {
|
|
2112
|
+
value: value,
|
|
2113
|
+
getSnapshot: getSnapshot
|
|
2114
|
+
}
|
|
2115
|
+
}),
|
|
2116
|
+
inst = _useState[0].inst,
|
|
2117
|
+
forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
|
|
2118
|
+
// in the layout phase so we can access it during the tearing check that
|
|
2119
|
+
// happens on subscribe.
|
|
2120
|
+
|
|
2121
|
+
|
|
2122
|
+
useLayoutEffect(function () {
|
|
2123
|
+
inst.value = value;
|
|
2124
|
+
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
2125
|
+
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
2126
|
+
// this can happen all the time, but even in synchronous mode, an earlier
|
|
2127
|
+
// effect may have mutated the store.
|
|
2128
|
+
|
|
2129
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
2130
|
+
// Force a re-render.
|
|
2131
|
+
forceUpdate({
|
|
2132
|
+
inst: inst
|
|
2010
2133
|
});
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
)
|
|
2134
|
+
}
|
|
2135
|
+
}, [subscribe, value, getSnapshot]);
|
|
2136
|
+
useEffect(function () {
|
|
2137
|
+
// Check for changes right before subscribing. Subsequent changes will be
|
|
2138
|
+
// detected in the subscription handler.
|
|
2139
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
2140
|
+
// Force a re-render.
|
|
2141
|
+
forceUpdate({
|
|
2142
|
+
inst: inst
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
var handleStoreChange = function () {
|
|
2147
|
+
// TODO: Because there is no cross-renderer API for batching updates, it's
|
|
2148
|
+
// up to the consumer of this library to wrap their subscription event
|
|
2149
|
+
// with unstable_batchedUpdates. Should we try to detect when this isn't
|
|
2150
|
+
// the case and print a warning in development?
|
|
2151
|
+
// The store changed. Check if the snapshot changed since the last time we
|
|
2152
|
+
// read from the store.
|
|
2153
|
+
if (checkIfSnapshotChanged(inst)) {
|
|
2154
|
+
// Force a re-render.
|
|
2155
|
+
forceUpdate({
|
|
2156
|
+
inst: inst
|
|
2157
|
+
});
|
|
2158
|
+
}
|
|
2159
|
+
}; // Subscribe to the store and return a clean-up function.
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
return subscribe(handleStoreChange);
|
|
2163
|
+
}, [subscribe]);
|
|
2014
2164
|
useDebugValue(value);
|
|
2015
2165
|
return value;
|
|
2016
2166
|
}
|
|
2167
|
+
|
|
2017
2168
|
function checkIfSnapshotChanged(inst) {
|
|
2018
2169
|
var latestGetSnapshot = inst.getSnapshot;
|
|
2019
|
-
|
|
2170
|
+
var prevValue = inst.value;
|
|
2171
|
+
|
|
2020
2172
|
try {
|
|
2021
2173
|
var nextValue = latestGetSnapshot();
|
|
2022
|
-
return !objectIs(
|
|
2174
|
+
return !objectIs(prevValue, nextValue);
|
|
2023
2175
|
} catch (error) {
|
|
2024
|
-
return
|
|
2176
|
+
return true;
|
|
2025
2177
|
}
|
|
2026
2178
|
}
|
|
2027
|
-
|
|
2179
|
+
|
|
2180
|
+
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
2181
|
+
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
2182
|
+
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
2183
|
+
// will need to track that themselves and return the correct value
|
|
2184
|
+
// from `getSnapshot`.
|
|
2028
2185
|
return getSnapshot();
|
|
2029
2186
|
}
|
|
2030
|
-
var shim$1 =
|
|
2031
|
-
"undefined" === typeof window ||
|
|
2032
|
-
"undefined" === typeof window.document ||
|
|
2033
|
-
"undefined" === typeof window.document.createElement
|
|
2034
|
-
? useSyncExternalStore$1
|
|
2035
|
-
: useSyncExternalStore$2;
|
|
2036
|
-
var useSyncExternalStore =
|
|
2037
|
-
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim$1;
|
|
2038
|
-
|
|
2039
|
-
var useSyncExternalStoreShim_production = {
|
|
2040
|
-
useSyncExternalStore: useSyncExternalStore
|
|
2041
|
-
};
|
|
2042
2187
|
|
|
2043
|
-
var
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
(console.error(
|
|
2061
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
2062
|
-
),
|
|
2063
|
-
(didWarnUncachedGetSnapshot = !0));
|
|
2064
|
-
}
|
|
2065
|
-
cachedValue = useState({
|
|
2066
|
-
inst: { value: value, getSnapshot: getSnapshot }
|
|
2067
|
-
});
|
|
2068
|
-
var inst = cachedValue[0].inst,
|
|
2069
|
-
forceUpdate = cachedValue[1];
|
|
2070
|
-
useLayoutEffect(
|
|
2071
|
-
function () {
|
|
2072
|
-
inst.value = value;
|
|
2073
|
-
inst.getSnapshot = getSnapshot;
|
|
2074
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
2075
|
-
},
|
|
2076
|
-
[subscribe, value, getSnapshot]
|
|
2077
|
-
);
|
|
2078
|
-
useEffect(
|
|
2079
|
-
function () {
|
|
2080
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
2081
|
-
return subscribe(function () {
|
|
2082
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
2083
|
-
});
|
|
2084
|
-
},
|
|
2085
|
-
[subscribe]
|
|
2086
|
-
);
|
|
2087
|
-
useDebugValue(value);
|
|
2088
|
-
return value;
|
|
2089
|
-
}
|
|
2090
|
-
function checkIfSnapshotChanged(inst) {
|
|
2091
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
2092
|
-
inst = inst.value;
|
|
2093
|
-
try {
|
|
2094
|
-
var nextValue = latestGetSnapshot();
|
|
2095
|
-
return !objectIs(inst, nextValue);
|
|
2096
|
-
} catch (error) {
|
|
2097
|
-
return !0;
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
2101
|
-
return getSnapshot();
|
|
2102
|
-
}
|
|
2103
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
2104
|
-
"function" ===
|
|
2105
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
2106
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
2107
|
-
var React$1 = React,
|
|
2108
|
-
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
2109
|
-
useState = React$1.useState,
|
|
2110
|
-
useEffect = React$1.useEffect,
|
|
2111
|
-
useLayoutEffect = React$1.useLayoutEffect,
|
|
2112
|
-
useDebugValue = React$1.useDebugValue,
|
|
2113
|
-
didWarnOld18Alpha = !1,
|
|
2114
|
-
didWarnUncachedGetSnapshot = !1,
|
|
2115
|
-
shim =
|
|
2116
|
-
"undefined" === typeof window ||
|
|
2117
|
-
"undefined" === typeof window.document ||
|
|
2118
|
-
"undefined" === typeof window.document.createElement
|
|
2119
|
-
? useSyncExternalStore$1
|
|
2120
|
-
: useSyncExternalStore$2;
|
|
2121
|
-
exports.useSyncExternalStore =
|
|
2122
|
-
void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
2123
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
2124
|
-
"function" ===
|
|
2125
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
2126
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
2188
|
+
var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
|
|
2189
|
+
|
|
2190
|
+
var isServerEnvironment = !canUseDOM;
|
|
2191
|
+
|
|
2192
|
+
var shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;
|
|
2193
|
+
var useSyncExternalStore$2 = React$1.useSyncExternalStore !== undefined ? React$1.useSyncExternalStore : shim;
|
|
2194
|
+
|
|
2195
|
+
exports.useSyncExternalStore = useSyncExternalStore$2;
|
|
2196
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
2197
|
+
if (
|
|
2198
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
2199
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
2200
|
+
'function'
|
|
2201
|
+
) {
|
|
2202
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2127
2205
|
})();
|
|
2206
|
+
}
|
|
2128
2207
|
});
|
|
2129
2208
|
|
|
2130
2209
|
var shim = createCommonjsModule(function (module) {
|
|
2131
2210
|
|
|
2132
2211
|
if (process.env.NODE_ENV === 'production') {
|
|
2133
|
-
module.exports =
|
|
2212
|
+
module.exports = useSyncExternalStoreShim_production_min;
|
|
2134
2213
|
} else {
|
|
2135
2214
|
module.exports = useSyncExternalStoreShim_development;
|
|
2136
2215
|
}
|
|
@@ -2142,6 +2221,7 @@ var GroupWrapper = /** @class */ (function (_super) {
|
|
|
2142
2221
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2143
2222
|
}
|
|
2144
2223
|
GroupWrapper.prototype.componentDidMount = function () {
|
|
2224
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2145
2225
|
var componentFactory = {
|
|
2146
2226
|
createGroupCaptionBar: this.props.onCreateGroupCaptionBarRequested,
|
|
2147
2227
|
updateGroupCaptionBar: this.props.onUpdateGroupCaptionBarRequested,
|
|
@@ -2191,6 +2271,21 @@ var GroupWrapper = /** @class */ (function (_super) {
|
|
|
2191
2271
|
hideLoadingAnimation: this.props.onHideLoadingAnimationRequested,
|
|
2192
2272
|
};
|
|
2193
2273
|
webGroupsManager.init(undefined, componentFactory);
|
|
2274
|
+
webGroupsManager.updateTabHeaderStyles((_c = (_b = (_a = this.props.styles) === null || _a === void 0 ? void 0 : _a.tabs) === null || _b === void 0 ? void 0 : _b.header) !== null && _c !== void 0 ? _c : {});
|
|
2275
|
+
webGroupsManager.updateTabMoveAreaStyles((_f = (_e = (_d = this.props.styles) === null || _d === void 0 ? void 0 : _d.tabs) === null || _e === void 0 ? void 0 : _e.moveArea) !== null && _f !== void 0 ? _f : {});
|
|
2276
|
+
webGroupsManager.updateFrameStyles((_j = (_h = (_g = this.props.styles) === null || _g === void 0 ? void 0 : _g.frame) === null || _h === void 0 ? void 0 : _h.element) !== null && _j !== void 0 ? _j : {});
|
|
2277
|
+
};
|
|
2278
|
+
GroupWrapper.prototype.componentDidUpdate = function (prevProps, prevState, snapshot) {
|
|
2279
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
2280
|
+
if (((_b = (_a = this.props.styles) === null || _a === void 0 ? void 0 : _a.tabs) === null || _b === void 0 ? void 0 : _b.header) !== ((_d = (_c = prevProps.styles) === null || _c === void 0 ? void 0 : _c.tabs) === null || _d === void 0 ? void 0 : _d.header)) {
|
|
2281
|
+
webGroupsManager.updateTabHeaderStyles((_g = (_f = (_e = this.props.styles) === null || _e === void 0 ? void 0 : _e.tabs) === null || _f === void 0 ? void 0 : _f.header) !== null && _g !== void 0 ? _g : {});
|
|
2282
|
+
}
|
|
2283
|
+
if (((_j = (_h = this.props.styles) === null || _h === void 0 ? void 0 : _h.tabs) === null || _j === void 0 ? void 0 : _j.moveArea) !== ((_l = (_k = prevProps.styles) === null || _k === void 0 ? void 0 : _k.tabs) === null || _l === void 0 ? void 0 : _l.moveArea)) {
|
|
2284
|
+
webGroupsManager.updateTabMoveAreaStyles((_p = (_o = (_m = this.props.styles) === null || _m === void 0 ? void 0 : _m.tabs) === null || _o === void 0 ? void 0 : _o.moveArea) !== null && _p !== void 0 ? _p : {});
|
|
2285
|
+
}
|
|
2286
|
+
if (((_r = (_q = this.props.styles) === null || _q === void 0 ? void 0 : _q.frame) === null || _r === void 0 ? void 0 : _r.element) !== ((_t = (_s = prevProps.styles) === null || _s === void 0 ? void 0 : _s.frame) === null || _t === void 0 ? void 0 : _t.element)) {
|
|
2287
|
+
webGroupsManager.updateFrameStyles((_w = (_v = (_u = this.props.styles) === null || _u === void 0 ? void 0 : _u.frame) === null || _v === void 0 ? void 0 : _v.element) !== null && _w !== void 0 ? _w : {});
|
|
2288
|
+
}
|
|
2194
2289
|
};
|
|
2195
2290
|
GroupWrapper.prototype.componentWillUnmount = function () {
|
|
2196
2291
|
// TODO
|
|
@@ -2908,7 +3003,7 @@ var FrameLoadingAnimation = function (_a) {
|
|
|
2908
3003
|
|
|
2909
3004
|
var GroupElementCreationWrapper = function (_a) {
|
|
2910
3005
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
2911
|
-
var components = _a.components;
|
|
3006
|
+
var components = _a.components, styles = _a.styles;
|
|
2912
3007
|
var state = shim.useSyncExternalStore(webGroupsStore.subscribe, webGroupsStore.getSnapshot);
|
|
2913
3008
|
var LoadingAnimation = (_c = (_b = components === null || components === void 0 ? void 0 : components.frame) === null || _b === void 0 ? void 0 : _b.LoadingAnimation) !== null && _c !== void 0 ? _c : FrameLoadingAnimation;
|
|
2914
3009
|
var renderGroupCaptionBar = function () {
|
|
@@ -3338,13 +3433,13 @@ var GroupElementCreationWrapper = function (_a) {
|
|
|
3338
3433
|
renderTabOverflowPopups(),
|
|
3339
3434
|
renderBelowTabs(),
|
|
3340
3435
|
renderHtmlButtons(),
|
|
3341
|
-
React.createElement(GroupWrapper, { onCreateGroupCaptionBarRequested: ((_d = components === null || components === void 0 ? void 0 : components.group) === null || _d === void 0 ? void 0 : _d.CaptionBar) ? webGroupsStore.onCreateGroupCaptionBarRequested : undefined, onCreateGroupOverlayRequested: ((_e = components === null || components === void 0 ? void 0 : components.group) === null || _e === void 0 ? void 0 : _e.Overlay) ? webGroupsStore.onCreateGroupOverlayRequested : undefined, onCreateFrameCaptionBarRequested: ((_f = components === null || components === void 0 ? void 0 : components.flat) === null || _f === void 0 ? void 0 : _f.CaptionBar) ? webGroupsStore.onCreateFrameCaptionBarRequested : undefined, onCreateFrameWindowOverlayRequested: ((_g = components === null || components === void 0 ? void 0 : components.frame) === null || _g === void 0 ? void 0 : _g.Overlay) ? webGroupsStore.onCreateFrameWindowOverlayRequested : undefined, onCreateAboveWindowRequested: ((_h = components === null || components === void 0 ? void 0 : components.frame) === null || _h === void 0 ? void 0 : _h.AboveWindow) ? webGroupsStore.onCreateAboveWindowRequested : undefined, onCreateWindowContentOverlayRequested: ((_j = components === null || components === void 0 ? void 0 : components.frame) === null || _j === void 0 ? void 0 : _j.WindowContentOverlay) ? webGroupsStore.onCreateWindowContentOverlayRequested : undefined, onCreateFrameLoadingAnimationRequested: LoadingAnimation ? webGroupsStore.onCreateFrameLoadingAnimationRequested : undefined, onCreateBelowWindowRequested: ((_k = components === null || components === void 0 ? void 0 : components.frame) === null || _k === void 0 ? void 0 : _k.BelowWindow) ? webGroupsStore.onCreateBelowWindowRequested : undefined, onCreateAboveTabsRequested: ((_l = components === null || components === void 0 ? void 0 : components.tabs) === null || _l === void 0 ? void 0 : _l.Above) ? webGroupsStore.onCreateAboveTabsComponentRequested : undefined, onCreateBeforeTabsComponentRequested: ((_m = components === null || components === void 0 ? void 0 : components.tabs) === null || _m === void 0 ? void 0 : _m.Before) ? webGroupsStore.onCreateBeforeTabsComponentRequested : undefined, onCreateTabRequested: ((_o = components === null || components === void 0 ? void 0 : components.tabs) === null || _o === void 0 ? void 0 : _o.Element) ? webGroupsStore.onCreateTabElementRequested : undefined, onCreateAfterTabsComponentRequested: ((_p = components === null || components === void 0 ? void 0 : components.tabs) === null || _p === void 0 ? void 0 : _p.After) ? webGroupsStore.onCreateAfterTabsComponentRequested : undefined, onCreateTabHeaderButtonsRequested: ((_q = components === null || components === void 0 ? void 0 : components.tabs) === null || _q === void 0 ? void 0 : _q.Buttons) ? webGroupsStore.onCreateTabHeaderButtonsRequested : undefined, onCreateBelowTabsRequested: ((_r = components === null || components === void 0 ? void 0 : components.tabs) === null || _r === void 0 ? void 0 : _r.Below) ? webGroupsStore.onCreateBelowTabsComponentRequested : undefined, onCreateHtmlButtonsRequested: ((_s = components === null || components === void 0 ? void 0 : components.html) === null || _s === void 0 ? void 0 : _s.Buttons) ? webGroupsStore.onCreateHtmlButtonsRequested : undefined, onCreateTabOverflowPopupRequested: ((_t = components === null || components === void 0 ? void 0 : components.tabs) === null || _t === void 0 ? void 0 : _t.OverflowPopup) ? webGroupsStore.onCreateTabOverflowPopupRequested : undefined, onUpdateGroupCaptionBarRequested: ((_u = components === null || components === void 0 ? void 0 : components.group) === null || _u === void 0 ? void 0 : _u.CaptionBar) ? webGroupsStore.onUpdateGroupCaptionBarRequested : undefined, onUpdateFrameWindowOverlayRequested: ((_v = components === null || components === void 0 ? void 0 : components.group) === null || _v === void 0 ? void 0 : _v.Overlay) ? webGroupsStore.onUpdateFrameWindowOverlayRequested : undefined, onUpdateFrameCaptionBarRequested: ((_w = components === null || components === void 0 ? void 0 : components.flat) === null || _w === void 0 ? void 0 : _w.CaptionBar) ? webGroupsStore.onUpdateFrameCaptionBarRequested : undefined, onUpdateFrameRequested: webGroupsStore.onUpdateFrame, onUpdateStandardButtonRequested: webGroupsStore.onUpdateStandardButton, onUpdateCustomButtonsRequested: webGroupsStore.onUpdateCustomButtons, onUpdateAboveTabsRequested: ((_x = components === null || components === void 0 ? void 0 : components.tabs) === null || _x === void 0 ? void 0 : _x.Above) ? webGroupsStore.onUpdateAboveTabsRequested : undefined, onUpdateBeforeTabsComponentRequested: ((_y = components === null || components === void 0 ? void 0 : components.tabs) === null || _y === void 0 ? void 0 : _y.Before) ? webGroupsStore.onUpdateBeforeTabsRequested : undefined, onUpdateTabRequested: ((_z = components === null || components === void 0 ? void 0 : components.tabs) === null || _z === void 0 ? void 0 : _z.Element) ? webGroupsStore.onUpdateTabElementRequested : undefined, onUpdateAfterTabsComponentRequested: ((_0 = components === null || components === void 0 ? void 0 : components.tabs) === null || _0 === void 0 ? void 0 : _0.After) ? webGroupsStore.onUpdateAfterTabsRequested : undefined, onUpdateBelowTabsRequested: ((_1 = components === null || components === void 0 ? void 0 : components.tabs) === null || _1 === void 0 ? void 0 : _1.Below) ? webGroupsStore.onUpdateBelowTabsRequested : undefined, onRemoveFrameCaptionBarRequested: webGroupsStore.onRemoveFrameCaptionBarRequested, onRemoveFrameWindowOverlayRequested: webGroupsStore.onRemoveFrameWindowOverlayRequested, onRemoveAboveWindowRequested: webGroupsStore.onRemoveAboveWindowRequested, onRemoveWindowContentOverlayRequested: webGroupsStore.onRemoveWindowContentOverlayRequested, onRemoveFrameLoadingAnimationRequested: webGroupsStore.onRemoveFrameLoadingAnimationRequested, onRemoveBelowWindowRequested: webGroupsStore.onRemoveBelowWindowRequested, onRemoveAboveTabsRequested: webGroupsStore.onRemoveAboveTabsRequested, onRemoveBeforeTabsComponentRequested: webGroupsStore.onRemoveBeforeTabsComponentRequested, onRemoveTabRequested: webGroupsStore.onRemoveTabElementRequested, onRemoveAfterTabsComponentRequested: webGroupsStore.onRemoveAfterTabsComponentRequested, onRemoveTabHeaderButtonsRequested: webGroupsStore.onRemoveTabHeaderButtonsRequested, onRemoveBelowTabsRequested: webGroupsStore.onRemoveBelowTabsRequested, onRemoveHtmlButtonsRequested: webGroupsStore.onRemoveHtmlButtonsRequested, onRemoveTabOverflowPopupRequested: webGroupsStore.onRemoveTabOverflowPopupRequested, onShowCaptionEditorRequested: webGroupsStore.onShowCaptionEditorRequested, onCommitCaptionEditingRequested: webGroupsStore.onCommitCaptionEditingRequested, onHideCaptionEditorRequested: webGroupsStore.onHideCaptionEditorRequested, onShowLoadingAnimationRequested: webGroupsStore.onShowLoadingAnimationRequested, onHideLoadingAnimationRequested: webGroupsStore.onHideLoadingAnimationRequested }));
|
|
3436
|
+
React.createElement(GroupWrapper, { onCreateGroupCaptionBarRequested: ((_d = components === null || components === void 0 ? void 0 : components.group) === null || _d === void 0 ? void 0 : _d.CaptionBar) ? webGroupsStore.onCreateGroupCaptionBarRequested : undefined, onCreateGroupOverlayRequested: ((_e = components === null || components === void 0 ? void 0 : components.group) === null || _e === void 0 ? void 0 : _e.Overlay) ? webGroupsStore.onCreateGroupOverlayRequested : undefined, onCreateFrameCaptionBarRequested: ((_f = components === null || components === void 0 ? void 0 : components.flat) === null || _f === void 0 ? void 0 : _f.CaptionBar) ? webGroupsStore.onCreateFrameCaptionBarRequested : undefined, onCreateFrameWindowOverlayRequested: ((_g = components === null || components === void 0 ? void 0 : components.frame) === null || _g === void 0 ? void 0 : _g.Overlay) ? webGroupsStore.onCreateFrameWindowOverlayRequested : undefined, onCreateAboveWindowRequested: ((_h = components === null || components === void 0 ? void 0 : components.frame) === null || _h === void 0 ? void 0 : _h.AboveWindow) ? webGroupsStore.onCreateAboveWindowRequested : undefined, onCreateWindowContentOverlayRequested: ((_j = components === null || components === void 0 ? void 0 : components.frame) === null || _j === void 0 ? void 0 : _j.WindowContentOverlay) ? webGroupsStore.onCreateWindowContentOverlayRequested : undefined, onCreateFrameLoadingAnimationRequested: LoadingAnimation ? webGroupsStore.onCreateFrameLoadingAnimationRequested : undefined, onCreateBelowWindowRequested: ((_k = components === null || components === void 0 ? void 0 : components.frame) === null || _k === void 0 ? void 0 : _k.BelowWindow) ? webGroupsStore.onCreateBelowWindowRequested : undefined, onCreateAboveTabsRequested: ((_l = components === null || components === void 0 ? void 0 : components.tabs) === null || _l === void 0 ? void 0 : _l.Above) ? webGroupsStore.onCreateAboveTabsComponentRequested : undefined, onCreateBeforeTabsComponentRequested: ((_m = components === null || components === void 0 ? void 0 : components.tabs) === null || _m === void 0 ? void 0 : _m.Before) ? webGroupsStore.onCreateBeforeTabsComponentRequested : undefined, onCreateTabRequested: ((_o = components === null || components === void 0 ? void 0 : components.tabs) === null || _o === void 0 ? void 0 : _o.Element) ? webGroupsStore.onCreateTabElementRequested : undefined, onCreateAfterTabsComponentRequested: ((_p = components === null || components === void 0 ? void 0 : components.tabs) === null || _p === void 0 ? void 0 : _p.After) ? webGroupsStore.onCreateAfterTabsComponentRequested : undefined, onCreateTabHeaderButtonsRequested: ((_q = components === null || components === void 0 ? void 0 : components.tabs) === null || _q === void 0 ? void 0 : _q.Buttons) ? webGroupsStore.onCreateTabHeaderButtonsRequested : undefined, onCreateBelowTabsRequested: ((_r = components === null || components === void 0 ? void 0 : components.tabs) === null || _r === void 0 ? void 0 : _r.Below) ? webGroupsStore.onCreateBelowTabsComponentRequested : undefined, onCreateHtmlButtonsRequested: ((_s = components === null || components === void 0 ? void 0 : components.html) === null || _s === void 0 ? void 0 : _s.Buttons) ? webGroupsStore.onCreateHtmlButtonsRequested : undefined, onCreateTabOverflowPopupRequested: ((_t = components === null || components === void 0 ? void 0 : components.tabs) === null || _t === void 0 ? void 0 : _t.OverflowPopup) ? webGroupsStore.onCreateTabOverflowPopupRequested : undefined, onUpdateGroupCaptionBarRequested: ((_u = components === null || components === void 0 ? void 0 : components.group) === null || _u === void 0 ? void 0 : _u.CaptionBar) ? webGroupsStore.onUpdateGroupCaptionBarRequested : undefined, onUpdateFrameWindowOverlayRequested: ((_v = components === null || components === void 0 ? void 0 : components.group) === null || _v === void 0 ? void 0 : _v.Overlay) ? webGroupsStore.onUpdateFrameWindowOverlayRequested : undefined, onUpdateFrameCaptionBarRequested: ((_w = components === null || components === void 0 ? void 0 : components.flat) === null || _w === void 0 ? void 0 : _w.CaptionBar) ? webGroupsStore.onUpdateFrameCaptionBarRequested : undefined, onUpdateFrameRequested: webGroupsStore.onUpdateFrame, onUpdateStandardButtonRequested: webGroupsStore.onUpdateStandardButton, onUpdateCustomButtonsRequested: webGroupsStore.onUpdateCustomButtons, onUpdateAboveTabsRequested: ((_x = components === null || components === void 0 ? void 0 : components.tabs) === null || _x === void 0 ? void 0 : _x.Above) ? webGroupsStore.onUpdateAboveTabsRequested : undefined, onUpdateBeforeTabsComponentRequested: ((_y = components === null || components === void 0 ? void 0 : components.tabs) === null || _y === void 0 ? void 0 : _y.Before) ? webGroupsStore.onUpdateBeforeTabsRequested : undefined, onUpdateTabRequested: ((_z = components === null || components === void 0 ? void 0 : components.tabs) === null || _z === void 0 ? void 0 : _z.Element) ? webGroupsStore.onUpdateTabElementRequested : undefined, onUpdateAfterTabsComponentRequested: ((_0 = components === null || components === void 0 ? void 0 : components.tabs) === null || _0 === void 0 ? void 0 : _0.After) ? webGroupsStore.onUpdateAfterTabsRequested : undefined, onUpdateBelowTabsRequested: ((_1 = components === null || components === void 0 ? void 0 : components.tabs) === null || _1 === void 0 ? void 0 : _1.Below) ? webGroupsStore.onUpdateBelowTabsRequested : undefined, onRemoveFrameCaptionBarRequested: webGroupsStore.onRemoveFrameCaptionBarRequested, onRemoveFrameWindowOverlayRequested: webGroupsStore.onRemoveFrameWindowOverlayRequested, onRemoveAboveWindowRequested: webGroupsStore.onRemoveAboveWindowRequested, onRemoveWindowContentOverlayRequested: webGroupsStore.onRemoveWindowContentOverlayRequested, onRemoveFrameLoadingAnimationRequested: webGroupsStore.onRemoveFrameLoadingAnimationRequested, onRemoveBelowWindowRequested: webGroupsStore.onRemoveBelowWindowRequested, onRemoveAboveTabsRequested: webGroupsStore.onRemoveAboveTabsRequested, onRemoveBeforeTabsComponentRequested: webGroupsStore.onRemoveBeforeTabsComponentRequested, onRemoveTabRequested: webGroupsStore.onRemoveTabElementRequested, onRemoveAfterTabsComponentRequested: webGroupsStore.onRemoveAfterTabsComponentRequested, onRemoveTabHeaderButtonsRequested: webGroupsStore.onRemoveTabHeaderButtonsRequested, onRemoveBelowTabsRequested: webGroupsStore.onRemoveBelowTabsRequested, onRemoveHtmlButtonsRequested: webGroupsStore.onRemoveHtmlButtonsRequested, onRemoveTabOverflowPopupRequested: webGroupsStore.onRemoveTabOverflowPopupRequested, onShowCaptionEditorRequested: webGroupsStore.onShowCaptionEditorRequested, onCommitCaptionEditingRequested: webGroupsStore.onCommitCaptionEditingRequested, onHideCaptionEditorRequested: webGroupsStore.onHideCaptionEditorRequested, onShowLoadingAnimationRequested: webGroupsStore.onShowLoadingAnimationRequested, onHideLoadingAnimationRequested: webGroupsStore.onHideLoadingAnimationRequested, styles: styles }));
|
|
3342
3437
|
};
|
|
3343
3438
|
|
|
3344
3439
|
function useIOConnectWindow(windowId) {
|
|
3345
|
-
var _a = useState
|
|
3440
|
+
var _a = useState(undefined), IOConnectWindow = _a[0], setIOConnectWindow = _a[1];
|
|
3346
3441
|
var io = window.io || useContext(IOConnectContext);
|
|
3347
|
-
useEffect
|
|
3442
|
+
useEffect(function () {
|
|
3348
3443
|
var unsub = io.windows.onWindowAdded(function (w) {
|
|
3349
3444
|
if (w.id === windowId) {
|
|
3350
3445
|
setIOConnectWindow(w);
|