@interopio/groups-ui-react 2.6.0 → 2.6.2
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/index.js +133 -223
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +146 -236
- package/dist/esm/index.js.map +1 -1
- package/dist/styles/groups.css +51 -17
- package/dist/styles/vars.css +1 -2
- package/package.json +3 -3
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useLayoutEffect, useState, useContext } from 'react';
|
|
1
|
+
import React, { useRef, useEffect as useEffect$1, useLayoutEffect as useLayoutEffect$1, useState as useState$1, useContext } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import { IOConnectContext } from '@interopio/react-hooks';
|
|
4
4
|
|
|
@@ -393,7 +393,7 @@ function parseToRgba(color) {
|
|
|
393
393
|
|
|
394
394
|
if (reducedHexMatch) {
|
|
395
395
|
const arr = Array.from(reducedHexMatch).slice(1);
|
|
396
|
-
return [...arr.slice(0, 3).map(x => parseInt(r
|
|
396
|
+
return [...arr.slice(0, 3).map(x => parseInt(r(x, 2), 16)), parseInt(r(arr[3] || 'f', 2), 16) / 255];
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
const hexMatch = hexRegex.exec(normalizedColor);
|
|
@@ -464,11 +464,11 @@ function nameToHex(color) {
|
|
|
464
464
|
return `#${result}`;
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
-
const r
|
|
467
|
+
const r = (str, amount) => Array.from(Array(amount)).map(() => str).join('');
|
|
468
468
|
|
|
469
|
-
const reducedHexRegex = new RegExp(`^#${r
|
|
470
|
-
const hexRegex = new RegExp(`^#${r
|
|
471
|
-
const rgbaRegex = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r
|
|
469
|
+
const reducedHexRegex = new RegExp(`^#${r('([a-f0-9])', 3)}([a-f0-9])?$`, 'i');
|
|
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');
|
|
472
472
|
const hslaRegex = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;
|
|
473
473
|
const namedColorRegex = /^[a-z]+$/i;
|
|
474
474
|
|
|
@@ -607,7 +607,7 @@ var BaseChannelSelector = function (_a) {
|
|
|
607
607
|
height: bounds.height,
|
|
608
608
|
});
|
|
609
609
|
};
|
|
610
|
-
useEffect(function () {
|
|
610
|
+
useEffect$1(function () {
|
|
611
611
|
var handler = function (e) {
|
|
612
612
|
e.stopPropagation();
|
|
613
613
|
};
|
|
@@ -1658,7 +1658,7 @@ var index = (function () {
|
|
|
1658
1658
|
})();
|
|
1659
1659
|
|
|
1660
1660
|
function useEditableCaption(ref, options) {
|
|
1661
|
-
useLayoutEffect(function () {
|
|
1661
|
+
useLayoutEffect$1(function () {
|
|
1662
1662
|
if (!ref.current) {
|
|
1663
1663
|
return;
|
|
1664
1664
|
}
|
|
@@ -1685,7 +1685,7 @@ var FlatCaption = function (_a) {
|
|
|
1685
1685
|
};
|
|
1686
1686
|
|
|
1687
1687
|
function useCaptionEditor(ref, options) {
|
|
1688
|
-
useEffect(function () {
|
|
1688
|
+
useEffect$1(function () {
|
|
1689
1689
|
if (!(ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
1690
1690
|
return;
|
|
1691
1691
|
}
|
|
@@ -1707,7 +1707,7 @@ function useCaptionEditor(ref, options) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
|
|
1709
1709
|
function useCommitEditingRequested(targetType, targetId, text) {
|
|
1710
|
-
useEffect(function () {
|
|
1710
|
+
useEffect$1(function () {
|
|
1711
1711
|
var unsub = webGroupsManager.onCommitCaptionEditingRequested(targetType, targetId, function () {
|
|
1712
1712
|
webGroupsManager.commitCaptionEditing(targetType, targetId, text);
|
|
1713
1713
|
});
|
|
@@ -1719,8 +1719,8 @@ function useCommitEditingRequested(targetType, targetId, text) {
|
|
|
1719
1719
|
|
|
1720
1720
|
var CaptionEditor = function (_a) {
|
|
1721
1721
|
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(caption), captionInEditor = _b[0], setCaptionInEditor = _b[1];
|
|
1723
|
-
var _c = useState(0), inputWidth = _c[0], setInputWidth = _c[1];
|
|
1722
|
+
var _b = useState$1(caption), captionInEditor = _b[0], setCaptionInEditor = _b[1];
|
|
1723
|
+
var _c = useState$1(0), inputWidth = _c[0], setInputWidth = _c[1];
|
|
1724
1724
|
var ref = useRef(null);
|
|
1725
1725
|
var measurementRef = useRef(null);
|
|
1726
1726
|
var onBlur = function () {
|
|
@@ -1745,7 +1745,7 @@ var CaptionEditor = function (_a) {
|
|
|
1745
1745
|
};
|
|
1746
1746
|
useCaptionEditor(ref, { notifyBoundsChanged: notifyBoundsChanged, notifyEditorVisibilityChanged: notifyEditorVisibilityChanged });
|
|
1747
1747
|
useCommitEditingRequested(targetType, targetId, captionInEditor);
|
|
1748
|
-
useEffect(function () {
|
|
1748
|
+
useEffect$1(function () {
|
|
1749
1749
|
if (!ref.current) {
|
|
1750
1750
|
return;
|
|
1751
1751
|
}
|
|
@@ -1765,7 +1765,7 @@ var CaptionEditor = function (_a) {
|
|
|
1765
1765
|
element === null || element === void 0 ? void 0 : element.removeEventListener("mousedown", onMouseDown);
|
|
1766
1766
|
};
|
|
1767
1767
|
}, [ref]);
|
|
1768
|
-
useEffect(function () {
|
|
1768
|
+
useEffect$1(function () {
|
|
1769
1769
|
if (!measurementRef.current) {
|
|
1770
1770
|
return;
|
|
1771
1771
|
}
|
|
@@ -1805,7 +1805,7 @@ var BaseMultiChannelSelector = function (_a) {
|
|
|
1805
1805
|
height: bounds.height,
|
|
1806
1806
|
});
|
|
1807
1807
|
};
|
|
1808
|
-
useEffect(function () {
|
|
1808
|
+
useEffect$1(function () {
|
|
1809
1809
|
var _a;
|
|
1810
1810
|
if (showBaseChannelSelector) {
|
|
1811
1811
|
return;
|
|
@@ -1916,7 +1916,7 @@ var TabCloseButton = function (_a) {
|
|
|
1916
1916
|
var normalContentClassName = "t42-tab-close-button-content";
|
|
1917
1917
|
var selectedContentClassName = "t42-tab-close-button-content t42-selected-tab-close-button-content";
|
|
1918
1918
|
var ref = useRef(null);
|
|
1919
|
-
useEffect(function () {
|
|
1919
|
+
useEffect$1(function () {
|
|
1920
1920
|
var _a;
|
|
1921
1921
|
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener("mousedown", function (e) {
|
|
1922
1922
|
e.stopPropagation();
|
|
@@ -1981,246 +1981,156 @@ function commonjsRequire () {
|
|
|
1981
1981
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
1982
1982
|
}
|
|
1983
1983
|
|
|
1984
|
-
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}
|
|
1985
|
-
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;
|
|
1986
|
-
|
|
1987
|
-
var useSyncExternalStoreShim_production_min = {
|
|
1988
|
-
useSyncExternalStore: useSyncExternalStore
|
|
1989
|
-
};
|
|
1990
|
-
|
|
1991
|
-
var useSyncExternalStoreShim_development = createCommonjsModule(function (module, exports) {
|
|
1992
|
-
|
|
1993
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1994
|
-
(function() {
|
|
1995
|
-
|
|
1996
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
1997
|
-
if (
|
|
1998
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
1999
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
|
|
2000
|
-
'function'
|
|
2001
|
-
) {
|
|
2002
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
2003
|
-
}
|
|
2004
|
-
var React$1 = React;
|
|
2005
|
-
|
|
2006
|
-
var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2007
|
-
|
|
2008
|
-
function error(format) {
|
|
2009
|
-
{
|
|
2010
|
-
{
|
|
2011
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
2012
|
-
args[_key2 - 1] = arguments[_key2];
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
printWarning('error', format, args);
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
function printWarning(level, format, args) {
|
|
2021
|
-
// When changing this logic, you might want to also
|
|
2022
|
-
// update consoleWithStackDev.www.js as well.
|
|
2023
|
-
{
|
|
2024
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2025
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
2026
|
-
|
|
2027
|
-
if (stack !== '') {
|
|
2028
|
-
format += '%s';
|
|
2029
|
-
args = args.concat([stack]);
|
|
2030
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
var argsWithFormat = args.map(function (item) {
|
|
2034
|
-
return String(item);
|
|
2035
|
-
}); // Careful: RN currently depends on this prefix
|
|
2036
|
-
|
|
2037
|
-
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
2038
|
-
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
2039
|
-
// eslint-disable-next-line react-internal/no-production-logging
|
|
2040
|
-
|
|
2041
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
2042
|
-
}
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
/**
|
|
2046
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
2047
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
2048
|
-
*/
|
|
2049
1984
|
function is(x, y) {
|
|
2050
|
-
return x === y && (
|
|
2051
|
-
;
|
|
1985
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
2052
1986
|
}
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
function
|
|
2075
|
-
|
|
2076
|
-
// will need to track that themselves and return the correct value
|
|
2077
|
-
// from `getSnapshot`.
|
|
2078
|
-
getServerSnapshot) {
|
|
2079
|
-
{
|
|
2080
|
-
if (!didWarnOld18Alpha) {
|
|
2081
|
-
if (React$1.startTransition !== undefined) {
|
|
2082
|
-
didWarnOld18Alpha = true;
|
|
2083
|
-
|
|
2084
|
-
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.');
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
} // Read the current snapshot from the store on every render. Again, this
|
|
2088
|
-
// breaks the rules of React, and only works here because of specific
|
|
2089
|
-
// implementation details, most importantly that updates are
|
|
2090
|
-
// always synchronous.
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
var value = getSnapshot();
|
|
2094
|
-
|
|
2095
|
-
{
|
|
2096
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
2097
|
-
var cachedValue = getSnapshot();
|
|
2098
|
-
|
|
2099
|
-
if (!objectIs(value, cachedValue)) {
|
|
2100
|
-
error('The result of getSnapshot should be cached to avoid an infinite loop');
|
|
2101
|
-
|
|
2102
|
-
didWarnUncachedGetSnapshot = true;
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
} // Because updates are synchronous, we don't queue them. Instead we force a
|
|
2106
|
-
// re-render whenever the subscribed state changes by updating an some
|
|
2107
|
-
// arbitrary useState hook. Then, during render, we call getSnapshot to read
|
|
2108
|
-
// the current value.
|
|
2109
|
-
//
|
|
2110
|
-
// Because we don't actually use the state returned by the useState hook, we
|
|
2111
|
-
// can save a bit of memory by storing other stuff in that slot.
|
|
2112
|
-
//
|
|
2113
|
-
// To implement the early bailout, we need to track some things on a mutable
|
|
2114
|
-
// object. Usually, we would put that in a useRef hook, but we can stash it in
|
|
2115
|
-
// our useState hook instead.
|
|
2116
|
-
//
|
|
2117
|
-
// To force a re-render, we call forceUpdate({inst}). That works because the
|
|
2118
|
-
// new object always fails an equality check.
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
var _useState = useState({
|
|
2122
|
-
inst: {
|
|
2123
|
-
value: value,
|
|
2124
|
-
getSnapshot: getSnapshot
|
|
2125
|
-
}
|
|
2126
|
-
}),
|
|
2127
|
-
inst = _useState[0].inst,
|
|
2128
|
-
forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated
|
|
2129
|
-
// in the layout phase so we can access it during the tearing check that
|
|
2130
|
-
// happens on subscribe.
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
useLayoutEffect(function () {
|
|
2134
|
-
inst.value = value;
|
|
2135
|
-
inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the
|
|
2136
|
-
// commit phase if there was an interleaved mutation. In concurrent mode
|
|
2137
|
-
// this can happen all the time, but even in synchronous mode, an earlier
|
|
2138
|
-
// effect may have mutated the store.
|
|
2139
|
-
|
|
2140
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
2141
|
-
// Force a re-render.
|
|
2142
|
-
forceUpdate({
|
|
2143
|
-
inst: inst
|
|
2144
|
-
});
|
|
2145
|
-
}
|
|
2146
|
-
}, [subscribe, value, getSnapshot]);
|
|
2147
|
-
useEffect(function () {
|
|
2148
|
-
// Check for changes right before subscribing. Subsequent changes will be
|
|
2149
|
-
// detected in the subscription handler.
|
|
2150
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
2151
|
-
// Force a re-render.
|
|
2152
|
-
forceUpdate({
|
|
2153
|
-
inst: inst
|
|
1987
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
1988
|
+
useState = React.useState,
|
|
1989
|
+
useEffect = React.useEffect,
|
|
1990
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
1991
|
+
useDebugValue = React.useDebugValue;
|
|
1992
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
1993
|
+
var value = getSnapshot(),
|
|
1994
|
+
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
1995
|
+
inst = _useState[0].inst,
|
|
1996
|
+
forceUpdate = _useState[1];
|
|
1997
|
+
useLayoutEffect(
|
|
1998
|
+
function () {
|
|
1999
|
+
inst.value = value;
|
|
2000
|
+
inst.getSnapshot = getSnapshot;
|
|
2001
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
2002
|
+
},
|
|
2003
|
+
[subscribe, value, getSnapshot]
|
|
2004
|
+
);
|
|
2005
|
+
useEffect(
|
|
2006
|
+
function () {
|
|
2007
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
2008
|
+
return subscribe(function () {
|
|
2009
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
2154
2010
|
});
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
// TODO: Because there is no cross-renderer API for batching updates, it's
|
|
2159
|
-
// up to the consumer of this library to wrap their subscription event
|
|
2160
|
-
// with unstable_batchedUpdates. Should we try to detect when this isn't
|
|
2161
|
-
// the case and print a warning in development?
|
|
2162
|
-
// The store changed. Check if the snapshot changed since the last time we
|
|
2163
|
-
// read from the store.
|
|
2164
|
-
if (checkIfSnapshotChanged(inst)) {
|
|
2165
|
-
// Force a re-render.
|
|
2166
|
-
forceUpdate({
|
|
2167
|
-
inst: inst
|
|
2168
|
-
});
|
|
2169
|
-
}
|
|
2170
|
-
}; // Subscribe to the store and return a clean-up function.
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
return subscribe(handleStoreChange);
|
|
2174
|
-
}, [subscribe]);
|
|
2011
|
+
},
|
|
2012
|
+
[subscribe]
|
|
2013
|
+
);
|
|
2175
2014
|
useDebugValue(value);
|
|
2176
2015
|
return value;
|
|
2177
2016
|
}
|
|
2178
|
-
|
|
2179
2017
|
function checkIfSnapshotChanged(inst) {
|
|
2180
2018
|
var latestGetSnapshot = inst.getSnapshot;
|
|
2181
|
-
|
|
2182
|
-
|
|
2019
|
+
inst = inst.value;
|
|
2183
2020
|
try {
|
|
2184
2021
|
var nextValue = latestGetSnapshot();
|
|
2185
|
-
return !objectIs(
|
|
2022
|
+
return !objectIs(inst, nextValue);
|
|
2186
2023
|
} catch (error) {
|
|
2187
|
-
return
|
|
2024
|
+
return !0;
|
|
2188
2025
|
}
|
|
2189
2026
|
}
|
|
2190
|
-
|
|
2191
|
-
function useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {
|
|
2192
|
-
// Note: The shim does not use getServerSnapshot, because pre-18 versions of
|
|
2193
|
-
// React do not expose a way to check if we're hydrating. So users of the shim
|
|
2194
|
-
// will need to track that themselves and return the correct value
|
|
2195
|
-
// from `getSnapshot`.
|
|
2027
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
2196
2028
|
return getSnapshot();
|
|
2197
2029
|
}
|
|
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
|
+
};
|
|
2198
2042
|
|
|
2199
|
-
var
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
)
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2043
|
+
var useSyncExternalStoreShim_development = createCommonjsModule(function (module, exports) {
|
|
2044
|
+
"production" !== process.env.NODE_ENV &&
|
|
2045
|
+
(function () {
|
|
2046
|
+
function is(x, y) {
|
|
2047
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
2048
|
+
}
|
|
2049
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
2050
|
+
didWarnOld18Alpha ||
|
|
2051
|
+
void 0 === React$1.startTransition ||
|
|
2052
|
+
((didWarnOld18Alpha = !0),
|
|
2053
|
+
console.error(
|
|
2054
|
+
"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."
|
|
2055
|
+
));
|
|
2056
|
+
var value = getSnapshot();
|
|
2057
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
2058
|
+
var cachedValue = getSnapshot();
|
|
2059
|
+
objectIs(value, cachedValue) ||
|
|
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());
|
|
2216
2127
|
})();
|
|
2217
|
-
}
|
|
2218
2128
|
});
|
|
2219
2129
|
|
|
2220
2130
|
var shim = createCommonjsModule(function (module) {
|
|
2221
2131
|
|
|
2222
2132
|
if (process.env.NODE_ENV === 'production') {
|
|
2223
|
-
module.exports =
|
|
2133
|
+
module.exports = useSyncExternalStoreShim_production;
|
|
2224
2134
|
} else {
|
|
2225
2135
|
module.exports = useSyncExternalStoreShim_development;
|
|
2226
2136
|
}
|
|
@@ -3432,9 +3342,9 @@ var GroupElementCreationWrapper = function (_a) {
|
|
|
3432
3342
|
};
|
|
3433
3343
|
|
|
3434
3344
|
function useIOConnectWindow(windowId) {
|
|
3435
|
-
var _a = useState(undefined), IOConnectWindow = _a[0], setIOConnectWindow = _a[1];
|
|
3345
|
+
var _a = useState$1(undefined), IOConnectWindow = _a[0], setIOConnectWindow = _a[1];
|
|
3436
3346
|
var io = window.io || useContext(IOConnectContext);
|
|
3437
|
-
useEffect(function () {
|
|
3347
|
+
useEffect$1(function () {
|
|
3438
3348
|
var unsub = io.windows.onWindowAdded(function (w) {
|
|
3439
3349
|
if (w.id === windowId) {
|
|
3440
3350
|
setIOConnectWindow(w);
|