@rocket.chat/fuselage 0.60.2 → 0.61.0
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/components/Accordion/AccordionItem.d.ts +1 -1
- package/dist/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/components/Banner/Banner.d.ts.map +1 -1
- package/dist/components/Box/Box.d.ts +6 -14
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/Box/index.d.ts.map +1 -1
- package/dist/components/Box/useStylingProps.d.ts +1 -1
- package/dist/components/Box/useStylingProps.d.ts.map +1 -1
- package/dist/components/Button/ActionButton.d.ts +5 -25
- package/dist/components/Button/ActionButton.d.ts.map +1 -1
- package/dist/components/Button/Button.d.ts +1 -23
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/IconButton.d.ts +5 -9
- package/dist/components/Button/IconButton.d.ts.map +1 -1
- package/dist/components/CheckBox/CheckBox.d.ts +6 -9
- package/dist/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/dist/components/Contextualbar/Contextualbar.d.ts +3 -7
- package/dist/components/Contextualbar/Contextualbar.d.ts.map +1 -1
- package/dist/components/Contextualbar/ContextualbarContent.d.ts +3 -7
- package/dist/components/Contextualbar/ContextualbarContent.d.ts.map +1 -1
- package/dist/components/Contextualbar/ContextualbarFooter.d.ts +3 -7
- package/dist/components/Contextualbar/ContextualbarFooter.d.ts.map +1 -1
- package/dist/components/Contextualbar/ContextualbarSection.d.ts +3 -7
- package/dist/components/Contextualbar/ContextualbarSection.d.ts.map +1 -1
- package/dist/components/ContextualbarV2/Contextualbar.d.ts +3 -7
- package/dist/components/ContextualbarV2/Contextualbar.d.ts.map +1 -1
- package/dist/components/ContextualbarV2/ContextualbarContent.d.ts +3 -7
- package/dist/components/ContextualbarV2/ContextualbarContent.d.ts.map +1 -1
- package/dist/components/ContextualbarV2/ContextualbarFooter.d.ts +3 -7
- package/dist/components/ContextualbarV2/ContextualbarFooter.d.ts.map +1 -1
- package/dist/components/ContextualbarV2/ContextualbarSection.d.ts +3 -7
- package/dist/components/ContextualbarV2/ContextualbarSection.d.ts.map +1 -1
- package/dist/components/EmailInput/EmailInput.d.ts +8 -20
- package/dist/components/EmailInput/EmailInput.d.ts.map +1 -1
- package/dist/components/Field/index.d.ts +18 -42
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Grid/Grid.d.ts +3 -7
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Icon/Icon.d.ts +1 -10
- package/dist/components/Icon/Icon.d.ts.map +1 -1
- package/dist/components/InputBox/Addon.d.ts +3 -7
- package/dist/components/InputBox/Addon.d.ts.map +1 -1
- package/dist/components/InputBox/Input.d.ts +3 -7
- package/dist/components/InputBox/Input.d.ts.map +1 -1
- package/dist/components/InputBox/InputBox.d.ts.map +1 -1
- package/dist/components/InputBox/Option.d.ts +3 -7
- package/dist/components/InputBox/Option.d.ts.map +1 -1
- package/dist/components/InputBox/Placeholder.d.ts +3 -7
- package/dist/components/InputBox/Placeholder.d.ts.map +1 -1
- package/dist/components/InputBox/index.d.ts +18 -42
- package/dist/components/InputBox/index.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/V2/MenuOption.d.ts +1 -15
- package/dist/components/Menu/V2/MenuOption.d.ts.map +1 -1
- package/dist/components/Message/MessageBlock.d.ts +6 -8
- package/dist/components/Message/MessageBlock.d.ts.map +1 -1
- package/dist/components/Message/MessageMetrics/MessageMetricsItem/index.d.ts +1 -10
- package/dist/components/Message/MessageMetrics/MessageMetricsItem/index.d.ts.map +1 -1
- package/dist/components/Message/MessageMetrics/index.d.ts +5 -40
- package/dist/components/Message/MessageMetrics/index.d.ts.map +1 -1
- package/dist/components/Message/MessageToolbar/MessageToolbarItem.d.ts +3 -7
- package/dist/components/Message/MessageToolbar/MessageToolbarItem.d.ts.map +1 -1
- package/dist/components/Message/MessageToolbar/index.d.ts +6 -14
- package/dist/components/Message/MessageToolbar/index.d.ts.map +1 -1
- package/dist/components/Message/index.d.ts +14 -61
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +6 -10
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/index.d.ts +3 -7
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +9 -12
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/NavBar/NavBarItem.d.ts +3 -7
- package/dist/components/NavBar/NavBarItem.d.ts.map +1 -1
- package/dist/components/Option/CheckOption.d.ts +4 -2
- package/dist/components/Option/CheckOption.d.ts.map +1 -1
- package/dist/components/Option/Option.d.ts +10 -9
- package/dist/components/Option/Option.d.ts.map +1 -1
- package/dist/components/Option/index.d.ts +8 -19
- package/dist/components/Option/index.d.ts.map +1 -1
- package/dist/components/Options/Options.d.ts +13 -21
- package/dist/components/Options/Options.d.ts.map +1 -1
- package/dist/components/Options/index.d.ts +3 -7
- package/dist/components/Options/index.d.ts.map +1 -1
- package/dist/components/OptionsPaginated/OptionsPaginated.d.ts +20 -22
- package/dist/components/OptionsPaginated/OptionsPaginated.d.ts.map +1 -1
- package/dist/components/PaginatedSelect/PaginatedMultiSelect.d.ts +3 -3
- package/dist/components/PaginatedSelect/PaginatedMultiSelect.d.ts.map +1 -1
- package/dist/components/PaginatedSelect/PaginatedSelectWrapper.d.ts +3 -7
- package/dist/components/PaginatedSelect/PaginatedSelectWrapper.d.ts.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +5 -8
- package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +8 -20
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/SelectAddon.d.ts +3 -7
- package/dist/components/Select/SelectAddon.d.ts.map +1 -1
- package/dist/components/Select/SelectFiltered.d.ts +1 -24
- package/dist/components/Select/SelectFiltered.d.ts.map +1 -1
- package/dist/components/Select/SelectFocus.d.ts +3 -7
- package/dist/components/Select/SelectFocus.d.ts.map +1 -1
- package/dist/components/Select/SelectLegacy.d.ts +1 -20
- package/dist/components/Select/SelectLegacy.d.ts.map +1 -1
- package/dist/components/SelectInput/SelectInput.d.ts +8 -21
- package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
- package/dist/components/SelectInput/index.d.ts +3 -7
- package/dist/components/SelectInput/index.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarActions.d.ts +3 -7
- package/dist/components/Sidebar/SidebarActions.d.ts.map +1 -1
- package/dist/components/Sidebar/TopBar/TopBarAction.d.ts +3 -7
- package/dist/components/Sidebar/TopBar/TopBarAction.d.ts.map +1 -1
- package/dist/components/Sidebar/TopBar/index.d.ts +3 -7
- package/dist/components/Sidebar/TopBar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.d.ts +6 -14
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/SidebarV2/SidebarAction.d.ts +3 -7
- package/dist/components/SidebarV2/SidebarAction.d.ts.map +1 -1
- package/dist/components/SidebarV2/hooks/useCollapse.d.ts +1 -1
- package/dist/components/SidebarV2/hooks/useCollapse.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +3 -7
- package/dist/components/Tabs/TabsItem.d.ts +6 -8
- package/dist/components/Tabs/TabsItem.d.ts.map +1 -1
- package/dist/components/TelephoneInput/TelephoneInput.d.ts +9 -21
- package/dist/components/TelephoneInput/TelephoneInput.d.ts.map +1 -1
- package/dist/components/TextAreaInput/TextAreaInput.d.ts +8 -20
- package/dist/components/TextAreaInput/TextAreaInput.d.ts.map +1 -1
- package/dist/components/TextInput/TextInput.d.ts +1 -19
- package/dist/components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/components/Throbber/Throbber.d.ts +9 -11
- package/dist/components/Throbber/Throbber.d.ts.map +1 -1
- package/dist/components/Tile/Tile.d.ts +3 -7
- package/dist/components/Tile/Tile.d.ts.map +1 -1
- package/dist/components/ToastBar/ToastBar.d.ts +1 -1
- package/dist/components/ToastBar/ToastBar.d.ts.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts +3 -7
- package/dist/components/ToggleSwitch/ToggleSwitch.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +7 -10
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/fuselage.development.js +223 -207
- package/dist/fuselage.development.js.map +1 -1
- package/dist/fuselage.production.js +1 -1
- package/dist/fuselage.production.js.LICENSE.txt +5 -10
- package/dist/hooks/useBoxOnlyProps.d.ts +0 -2
- package/dist/hooks/useBoxOnlyProps.d.ts.map +1 -1
- package/dist/testing.d.ts +1 -11
- package/dist/testing.d.ts.map +1 -1
- package/package.json +12 -12
|
@@ -121,106 +121,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
121
121
|
// extracted by mini-css-extract-plugin
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
/***/ }),
|
|
125
|
-
|
|
126
|
-
/***/ "../../node_modules/object-assign/index.js":
|
|
127
|
-
/*!*************************************************!*\
|
|
128
|
-
!*** ../../node_modules/object-assign/index.js ***!
|
|
129
|
-
\*************************************************/
|
|
130
|
-
/***/ (function(module) {
|
|
131
|
-
|
|
132
|
-
/*
|
|
133
|
-
object-assign
|
|
134
|
-
(c) Sindre Sorhus
|
|
135
|
-
@license MIT
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
/* eslint-disable no-unused-vars */
|
|
140
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
141
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
142
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
143
|
-
|
|
144
|
-
function toObject(val) {
|
|
145
|
-
if (val === null || val === undefined) {
|
|
146
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return Object(val);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function shouldUseNative() {
|
|
153
|
-
try {
|
|
154
|
-
if (!Object.assign) {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
159
|
-
|
|
160
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
161
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
162
|
-
test1[5] = 'de';
|
|
163
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
168
|
-
var test2 = {};
|
|
169
|
-
for (var i = 0; i < 10; i++) {
|
|
170
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
171
|
-
}
|
|
172
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
173
|
-
return test2[n];
|
|
174
|
-
});
|
|
175
|
-
if (order2.join('') !== '0123456789') {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
180
|
-
var test3 = {};
|
|
181
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
182
|
-
test3[letter] = letter;
|
|
183
|
-
});
|
|
184
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
185
|
-
'abcdefghijklmnopqrst') {
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
return true;
|
|
190
|
-
} catch (err) {
|
|
191
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
197
|
-
var from;
|
|
198
|
-
var to = toObject(target);
|
|
199
|
-
var symbols;
|
|
200
|
-
|
|
201
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
202
|
-
from = Object(arguments[s]);
|
|
203
|
-
|
|
204
|
-
for (var key in from) {
|
|
205
|
-
if (hasOwnProperty.call(from, key)) {
|
|
206
|
-
to[key] = from[key];
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (getOwnPropertySymbols) {
|
|
211
|
-
symbols = getOwnPropertySymbols(from);
|
|
212
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
213
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
214
|
-
to[symbols[i]] = from[symbols[i]];
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return to;
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
|
|
224
124
|
/***/ }),
|
|
225
125
|
|
|
226
126
|
/***/ "../../node_modules/react-is/cjs/react-is.development.js":
|
|
@@ -471,7 +371,8 @@ exports["default"] = flattenChildren;
|
|
|
471
371
|
\*********************************************************************/
|
|
472
372
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
473
373
|
|
|
474
|
-
/**
|
|
374
|
+
/**
|
|
375
|
+
* @license React
|
|
475
376
|
* react-jsx-runtime.development.js
|
|
476
377
|
*
|
|
477
378
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -487,59 +388,25 @@ if (true) {
|
|
|
487
388
|
'use strict';
|
|
488
389
|
|
|
489
390
|
var React = __webpack_require__(/*! react */ "react");
|
|
490
|
-
var _assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js");
|
|
491
391
|
|
|
492
392
|
// ATTENTION
|
|
493
393
|
// When adding new symbols to this file,
|
|
494
394
|
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
495
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
496
|
-
|
|
497
|
-
var
|
|
498
|
-
var
|
|
499
|
-
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
var
|
|
504
|
-
var
|
|
505
|
-
var
|
|
506
|
-
var
|
|
507
|
-
var
|
|
508
|
-
var
|
|
509
|
-
var
|
|
510
|
-
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
511
|
-
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
512
|
-
var REACT_SCOPE_TYPE = 0xead7;
|
|
513
|
-
var REACT_OPAQUE_ID_TYPE = 0xeae0;
|
|
514
|
-
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
515
|
-
var REACT_OFFSCREEN_TYPE = 0xeae2;
|
|
516
|
-
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
517
|
-
|
|
518
|
-
if (typeof Symbol === 'function' && Symbol.for) {
|
|
519
|
-
var symbolFor = Symbol.for;
|
|
520
|
-
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
521
|
-
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
522
|
-
exports.Fragment = symbolFor('react.fragment');
|
|
523
|
-
REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
|
|
524
|
-
REACT_PROFILER_TYPE = symbolFor('react.profiler');
|
|
525
|
-
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
526
|
-
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
527
|
-
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
528
|
-
REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
|
|
529
|
-
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
530
|
-
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
531
|
-
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
532
|
-
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
533
|
-
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
534
|
-
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
535
|
-
REACT_SCOPE_TYPE = symbolFor('react.scope');
|
|
536
|
-
REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
|
|
537
|
-
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
538
|
-
REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
|
|
539
|
-
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
395
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
396
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
397
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
398
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
399
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
400
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
401
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
402
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
403
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
404
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
405
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
406
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
407
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
408
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
409
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
543
410
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
544
411
|
function getIteratorFn(maybeIterable) {
|
|
545
412
|
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
@@ -559,11 +426,13 @@ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FI
|
|
|
559
426
|
|
|
560
427
|
function error(format) {
|
|
561
428
|
{
|
|
562
|
-
|
|
563
|
-
args
|
|
564
|
-
|
|
429
|
+
{
|
|
430
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
431
|
+
args[_key2 - 1] = arguments[_key2];
|
|
432
|
+
}
|
|
565
433
|
|
|
566
|
-
|
|
434
|
+
printWarning('error', format, args);
|
|
435
|
+
}
|
|
567
436
|
}
|
|
568
437
|
}
|
|
569
438
|
|
|
@@ -577,10 +446,11 @@ function printWarning(level, format, args) {
|
|
|
577
446
|
if (stack !== '') {
|
|
578
447
|
format += '%s';
|
|
579
448
|
args = args.concat([stack]);
|
|
580
|
-
}
|
|
449
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
450
|
+
|
|
581
451
|
|
|
582
452
|
var argsWithFormat = args.map(function (item) {
|
|
583
|
-
return
|
|
453
|
+
return String(item);
|
|
584
454
|
}); // Careful: RN currently depends on this prefix
|
|
585
455
|
|
|
586
456
|
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
@@ -591,9 +461,23 @@ function printWarning(level, format, args) {
|
|
|
591
461
|
}
|
|
592
462
|
}
|
|
593
463
|
|
|
594
|
-
//
|
|
464
|
+
// -----------------------------------------------------------------------------
|
|
595
465
|
|
|
596
466
|
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
467
|
+
var enableCacheElement = false;
|
|
468
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
469
|
+
|
|
470
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
471
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
472
|
+
// issues in DEV builds.
|
|
473
|
+
|
|
474
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
475
|
+
|
|
476
|
+
var REACT_MODULE_REFERENCE;
|
|
477
|
+
|
|
478
|
+
{
|
|
479
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
480
|
+
}
|
|
597
481
|
|
|
598
482
|
function isValidElementType(type) {
|
|
599
483
|
if (typeof type === 'string' || typeof type === 'function') {
|
|
@@ -601,12 +485,16 @@ function isValidElementType(type) {
|
|
|
601
485
|
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
602
486
|
|
|
603
487
|
|
|
604
|
-
if (type ===
|
|
488
|
+
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
605
489
|
return true;
|
|
606
490
|
}
|
|
607
491
|
|
|
608
492
|
if (typeof type === 'object' && type !== null) {
|
|
609
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
493
|
+
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
494
|
+
// types supported by any Flight configuration anywhere since
|
|
495
|
+
// we don't know which Flight build this will end up being used
|
|
496
|
+
// with.
|
|
497
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
610
498
|
return true;
|
|
611
499
|
}
|
|
612
500
|
}
|
|
@@ -615,15 +503,23 @@ function isValidElementType(type) {
|
|
|
615
503
|
}
|
|
616
504
|
|
|
617
505
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
506
|
+
var displayName = outerType.displayName;
|
|
507
|
+
|
|
508
|
+
if (displayName) {
|
|
509
|
+
return displayName;
|
|
510
|
+
}
|
|
511
|
+
|
|
618
512
|
var functionName = innerType.displayName || innerType.name || '';
|
|
619
|
-
return
|
|
620
|
-
}
|
|
513
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
514
|
+
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
515
|
+
|
|
621
516
|
|
|
622
517
|
function getContextName(type) {
|
|
623
518
|
return type.displayName || 'Context';
|
|
624
|
-
}
|
|
519
|
+
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
520
|
+
|
|
625
521
|
|
|
626
|
-
function
|
|
522
|
+
function getComponentNameFromType(type) {
|
|
627
523
|
if (type == null) {
|
|
628
524
|
// Host root, text node or just invalid type.
|
|
629
525
|
return null;
|
|
@@ -631,7 +527,7 @@ function getComponentName(type) {
|
|
|
631
527
|
|
|
632
528
|
{
|
|
633
529
|
if (typeof type.tag === 'number') {
|
|
634
|
-
error('Received an unexpected object in
|
|
530
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
635
531
|
}
|
|
636
532
|
}
|
|
637
533
|
|
|
@@ -644,7 +540,7 @@ function getComponentName(type) {
|
|
|
644
540
|
}
|
|
645
541
|
|
|
646
542
|
switch (type) {
|
|
647
|
-
case
|
|
543
|
+
case REACT_FRAGMENT_TYPE:
|
|
648
544
|
return 'Fragment';
|
|
649
545
|
|
|
650
546
|
case REACT_PORTAL_TYPE:
|
|
@@ -661,6 +557,7 @@ function getComponentName(type) {
|
|
|
661
557
|
|
|
662
558
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
663
559
|
return 'SuspenseList';
|
|
560
|
+
|
|
664
561
|
}
|
|
665
562
|
|
|
666
563
|
if (typeof type === 'object') {
|
|
@@ -677,10 +574,13 @@ function getComponentName(type) {
|
|
|
677
574
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
678
575
|
|
|
679
576
|
case REACT_MEMO_TYPE:
|
|
680
|
-
|
|
577
|
+
var outerName = type.displayName || null;
|
|
681
578
|
|
|
682
|
-
|
|
683
|
-
|
|
579
|
+
if (outerName !== null) {
|
|
580
|
+
return outerName;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
684
584
|
|
|
685
585
|
case REACT_LAZY_TYPE:
|
|
686
586
|
{
|
|
@@ -689,17 +589,21 @@ function getComponentName(type) {
|
|
|
689
589
|
var init = lazyComponent._init;
|
|
690
590
|
|
|
691
591
|
try {
|
|
692
|
-
return
|
|
592
|
+
return getComponentNameFromType(init(payload));
|
|
693
593
|
} catch (x) {
|
|
694
594
|
return null;
|
|
695
595
|
}
|
|
696
596
|
}
|
|
597
|
+
|
|
598
|
+
// eslint-disable-next-line no-fallthrough
|
|
697
599
|
}
|
|
698
600
|
}
|
|
699
601
|
|
|
700
602
|
return null;
|
|
701
603
|
}
|
|
702
604
|
|
|
605
|
+
var assign = Object.assign;
|
|
606
|
+
|
|
703
607
|
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
704
608
|
// replaying on render function. This currently only patches the object
|
|
705
609
|
// lazily which won't cover if the log function was extracted eagerly.
|
|
@@ -763,25 +667,25 @@ function reenableLogs() {
|
|
|
763
667
|
}; // $FlowFixMe Flow thinks console is immutable.
|
|
764
668
|
|
|
765
669
|
Object.defineProperties(console, {
|
|
766
|
-
log:
|
|
670
|
+
log: assign({}, props, {
|
|
767
671
|
value: prevLog
|
|
768
672
|
}),
|
|
769
|
-
info:
|
|
673
|
+
info: assign({}, props, {
|
|
770
674
|
value: prevInfo
|
|
771
675
|
}),
|
|
772
|
-
warn:
|
|
676
|
+
warn: assign({}, props, {
|
|
773
677
|
value: prevWarn
|
|
774
678
|
}),
|
|
775
|
-
error:
|
|
679
|
+
error: assign({}, props, {
|
|
776
680
|
value: prevError
|
|
777
681
|
}),
|
|
778
|
-
group:
|
|
682
|
+
group: assign({}, props, {
|
|
779
683
|
value: prevGroup
|
|
780
684
|
}),
|
|
781
|
-
groupCollapsed:
|
|
685
|
+
groupCollapsed: assign({}, props, {
|
|
782
686
|
value: prevGroupCollapsed
|
|
783
687
|
}),
|
|
784
|
-
groupEnd:
|
|
688
|
+
groupEnd: assign({}, props, {
|
|
785
689
|
value: prevGroupEnd
|
|
786
690
|
})
|
|
787
691
|
});
|
|
@@ -822,7 +726,7 @@ var componentFrameCache;
|
|
|
822
726
|
|
|
823
727
|
function describeNativeComponentFrame(fn, construct) {
|
|
824
728
|
// If something asked for a stack inside a fake render, it should get ignored.
|
|
825
|
-
if (!fn || reentry) {
|
|
729
|
+
if ( !fn || reentry) {
|
|
826
730
|
return '';
|
|
827
731
|
}
|
|
828
732
|
|
|
@@ -931,7 +835,14 @@ function describeNativeComponentFrame(fn, construct) {
|
|
|
931
835
|
|
|
932
836
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
933
837
|
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
934
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
838
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
839
|
+
// but we have a user-provided "displayName"
|
|
840
|
+
// splice it in to make the stack more readable.
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
844
|
+
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
845
|
+
}
|
|
935
846
|
|
|
936
847
|
{
|
|
937
848
|
if (typeof fn === 'function') {
|
|
@@ -1016,9 +927,6 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
|
1016
927
|
// Memo may contain any component type so we recursively resolve it.
|
|
1017
928
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1018
929
|
|
|
1019
|
-
case REACT_BLOCK_TYPE:
|
|
1020
|
-
return describeFunctionComponentFrame(type._render);
|
|
1021
|
-
|
|
1022
930
|
case REACT_LAZY_TYPE:
|
|
1023
931
|
{
|
|
1024
932
|
var lazyComponent = type;
|
|
@@ -1036,6 +944,8 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
|
1036
944
|
return '';
|
|
1037
945
|
}
|
|
1038
946
|
|
|
947
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
948
|
+
|
|
1039
949
|
var loggedTypeFailures = {};
|
|
1040
950
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1041
951
|
|
|
@@ -1054,7 +964,7 @@ function setCurrentlyValidatingElement(element) {
|
|
|
1054
964
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1055
965
|
{
|
|
1056
966
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1057
|
-
var has = Function.call.bind(
|
|
967
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
1058
968
|
|
|
1059
969
|
for (var typeSpecName in typeSpecs) {
|
|
1060
970
|
if (has(typeSpecs, typeSpecName)) {
|
|
@@ -1066,6 +976,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
|
1066
976
|
// This is intentionally an invariant that gets caught. It's the same
|
|
1067
977
|
// behavior as without this statement except with a better message.
|
|
1068
978
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
979
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
1069
980
|
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
1070
981
|
err.name = 'Invariant Violation';
|
|
1071
982
|
throw err;
|
|
@@ -1099,8 +1010,80 @@ function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
|
1099
1010
|
}
|
|
1100
1011
|
}
|
|
1101
1012
|
|
|
1013
|
+
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
1014
|
+
|
|
1015
|
+
function isArray(a) {
|
|
1016
|
+
return isArrayImpl(a);
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/*
|
|
1020
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
1021
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
1022
|
+
*
|
|
1023
|
+
* The functions in this module will throw an easier-to-understand,
|
|
1024
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
1025
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
1026
|
+
* of the `value` object).
|
|
1027
|
+
*/
|
|
1028
|
+
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
1029
|
+
function typeName(value) {
|
|
1030
|
+
{
|
|
1031
|
+
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
1032
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
1033
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
1034
|
+
return type;
|
|
1035
|
+
}
|
|
1036
|
+
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
function willCoercionThrow(value) {
|
|
1040
|
+
{
|
|
1041
|
+
try {
|
|
1042
|
+
testStringCoercion(value);
|
|
1043
|
+
return false;
|
|
1044
|
+
} catch (e) {
|
|
1045
|
+
return true;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
function testStringCoercion(value) {
|
|
1051
|
+
// If you ended up here by following an exception call stack, here's what's
|
|
1052
|
+
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
1053
|
+
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
1054
|
+
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
1055
|
+
//
|
|
1056
|
+
// The most common types that will cause this exception are `Symbol` instances
|
|
1057
|
+
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
1058
|
+
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
1059
|
+
// exception. (Library authors do this to prevent users from using built-in
|
|
1060
|
+
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
1061
|
+
// methods are needed to perform accurate arithmetic or comparison.)
|
|
1062
|
+
//
|
|
1063
|
+
// To fix the problem, coerce this object or symbol value to a string before
|
|
1064
|
+
// passing it to React. The most reliable way is usually `String(value)`.
|
|
1065
|
+
//
|
|
1066
|
+
// To find which value is throwing, check the browser or debugger console.
|
|
1067
|
+
// Before this exception was thrown, there should be `console.error` output
|
|
1068
|
+
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
1069
|
+
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
1070
|
+
// In most cases, this console output also shows the component and its
|
|
1071
|
+
// ancestor components where the exception happened.
|
|
1072
|
+
//
|
|
1073
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1074
|
+
return '' + value;
|
|
1075
|
+
}
|
|
1076
|
+
function checkKeyStringCoercion(value) {
|
|
1077
|
+
{
|
|
1078
|
+
if (willCoercionThrow(value)) {
|
|
1079
|
+
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
1080
|
+
|
|
1081
|
+
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1102
1086
|
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
1103
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1104
1087
|
var RESERVED_PROPS = {
|
|
1105
1088
|
key: true,
|
|
1106
1089
|
ref: true,
|
|
@@ -1146,10 +1129,10 @@ function hasValidKey(config) {
|
|
|
1146
1129
|
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
1147
1130
|
{
|
|
1148
1131
|
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
1149
|
-
var componentName =
|
|
1132
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1150
1133
|
|
|
1151
1134
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
1152
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref',
|
|
1135
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
1153
1136
|
|
|
1154
1137
|
didWarnAboutStringRefs[componentName] = true;
|
|
1155
1138
|
}
|
|
@@ -1288,10 +1271,18 @@ function jsxDEV(type, config, maybeKey, source, self) {
|
|
|
1288
1271
|
// key is explicitly declared to be undefined or not.
|
|
1289
1272
|
|
|
1290
1273
|
if (maybeKey !== undefined) {
|
|
1274
|
+
{
|
|
1275
|
+
checkKeyStringCoercion(maybeKey);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1291
1278
|
key = '' + maybeKey;
|
|
1292
1279
|
}
|
|
1293
1280
|
|
|
1294
1281
|
if (hasValidKey(config)) {
|
|
1282
|
+
{
|
|
1283
|
+
checkKeyStringCoercion(config.key);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1295
1286
|
key = '' + config.key;
|
|
1296
1287
|
}
|
|
1297
1288
|
|
|
@@ -1362,6 +1353,7 @@ var propTypesMisspellWarningShown;
|
|
|
1362
1353
|
* @final
|
|
1363
1354
|
*/
|
|
1364
1355
|
|
|
1356
|
+
|
|
1365
1357
|
function isValidElement(object) {
|
|
1366
1358
|
{
|
|
1367
1359
|
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
@@ -1371,7 +1363,7 @@ function isValidElement(object) {
|
|
|
1371
1363
|
function getDeclarationErrorAddendum() {
|
|
1372
1364
|
{
|
|
1373
1365
|
if (ReactCurrentOwner$1.current) {
|
|
1374
|
-
var name =
|
|
1366
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1375
1367
|
|
|
1376
1368
|
if (name) {
|
|
1377
1369
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
@@ -1451,7 +1443,7 @@ function validateExplicitKey(element, parentType) {
|
|
|
1451
1443
|
|
|
1452
1444
|
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1453
1445
|
// Give the component that originally created this child.
|
|
1454
|
-
childOwner = " It was passed a child from " +
|
|
1446
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1455
1447
|
}
|
|
1456
1448
|
|
|
1457
1449
|
setCurrentlyValidatingElement$1(element);
|
|
@@ -1478,7 +1470,7 @@ function validateChildKeys(node, parentType) {
|
|
|
1478
1470
|
return;
|
|
1479
1471
|
}
|
|
1480
1472
|
|
|
1481
|
-
if (
|
|
1473
|
+
if (isArray(node)) {
|
|
1482
1474
|
for (var i = 0; i < node.length; i++) {
|
|
1483
1475
|
var child = node[i];
|
|
1484
1476
|
|
|
@@ -1541,12 +1533,12 @@ function validatePropTypes(element) {
|
|
|
1541
1533
|
|
|
1542
1534
|
if (propTypes) {
|
|
1543
1535
|
// Intentionally inside to avoid triggering lazy initializers:
|
|
1544
|
-
var name =
|
|
1536
|
+
var name = getComponentNameFromType(type);
|
|
1545
1537
|
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1546
1538
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1547
1539
|
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1548
1540
|
|
|
1549
|
-
var _name =
|
|
1541
|
+
var _name = getComponentNameFromType(type);
|
|
1550
1542
|
|
|
1551
1543
|
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1552
1544
|
}
|
|
@@ -1589,6 +1581,7 @@ function validateFragmentProps(fragment) {
|
|
|
1589
1581
|
}
|
|
1590
1582
|
}
|
|
1591
1583
|
|
|
1584
|
+
var didWarnAboutKeySpread = {};
|
|
1592
1585
|
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1593
1586
|
{
|
|
1594
1587
|
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
@@ -1613,10 +1606,10 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
|
1613
1606
|
|
|
1614
1607
|
if (type === null) {
|
|
1615
1608
|
typeString = 'null';
|
|
1616
|
-
} else if (
|
|
1609
|
+
} else if (isArray(type)) {
|
|
1617
1610
|
typeString = 'array';
|
|
1618
1611
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1619
|
-
typeString = "<" + (
|
|
1612
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1620
1613
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1621
1614
|
} else {
|
|
1622
1615
|
typeString = typeof type;
|
|
@@ -1642,7 +1635,7 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
|
1642
1635
|
|
|
1643
1636
|
if (children !== undefined) {
|
|
1644
1637
|
if (isStaticChildren) {
|
|
1645
|
-
if (
|
|
1638
|
+
if (isArray(children)) {
|
|
1646
1639
|
for (var i = 0; i < children.length; i++) {
|
|
1647
1640
|
validateChildKeys(children[i], type);
|
|
1648
1641
|
}
|
|
@@ -1659,7 +1652,25 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
|
1659
1652
|
}
|
|
1660
1653
|
}
|
|
1661
1654
|
|
|
1662
|
-
|
|
1655
|
+
{
|
|
1656
|
+
if (hasOwnProperty.call(props, 'key')) {
|
|
1657
|
+
var componentName = getComponentNameFromType(type);
|
|
1658
|
+
var keys = Object.keys(props).filter(function (k) {
|
|
1659
|
+
return k !== 'key';
|
|
1660
|
+
});
|
|
1661
|
+
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
1662
|
+
|
|
1663
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1664
|
+
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
1665
|
+
|
|
1666
|
+
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
1667
|
+
|
|
1668
|
+
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1663
1674
|
validateFragmentProps(element);
|
|
1664
1675
|
} else {
|
|
1665
1676
|
validatePropTypes(element);
|
|
@@ -1688,6 +1699,7 @@ var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs intern
|
|
|
1688
1699
|
|
|
1689
1700
|
var jsxs = jsxWithValidationStatic ;
|
|
1690
1701
|
|
|
1702
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1691
1703
|
exports.jsx = jsx;
|
|
1692
1704
|
exports.jsxs = jsxs;
|
|
1693
1705
|
})();
|
|
@@ -2031,6 +2043,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
2031
2043
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2032
2044
|
var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_modules/react/jsx-runtime.js");
|
|
2033
2045
|
var fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
|
|
2046
|
+
var react_1 = __webpack_require__(/*! react */ "react");
|
|
2034
2047
|
var composeClassNames_1 = __webpack_require__(/*! ../../helpers/composeClassNames */ "./src/helpers/composeClassNames.ts");
|
|
2035
2048
|
var Box_1 = __webpack_require__(/*! ../Box */ "./src/components/Box/index.ts");
|
|
2036
2049
|
var Chevron_1 = __webpack_require__(/*! ../Chevron */ "./src/components/Chevron/index.tsx");
|
|
@@ -2039,8 +2052,8 @@ var AccordionItem = function (_a) {
|
|
|
2039
2052
|
var _e = __read((0, fuselage_hooks_1.useToggle)(defaultExpanded), 2), stateExpanded = _e[0], toggleStateExpanded = _e[1];
|
|
2040
2053
|
var expanded = propExpanded || stateExpanded;
|
|
2041
2054
|
var panelExpanded = noncollapsible || expanded;
|
|
2042
|
-
var titleId = (0,
|
|
2043
|
-
var panelId = (0,
|
|
2055
|
+
var titleId = (0, react_1.useId)();
|
|
2056
|
+
var panelId = (0, react_1.useId)();
|
|
2044
2057
|
var handleClick = function (e) {
|
|
2045
2058
|
var _a;
|
|
2046
2059
|
if (disabled) {
|
|
@@ -3032,9 +3045,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3032
3045
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3033
3046
|
};
|
|
3034
3047
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3035
|
-
exports.StylingBox = exports["default"] = void 0;
|
|
3048
|
+
exports.StylingBox = exports.Box = exports["default"] = void 0;
|
|
3036
3049
|
var Box_1 = __webpack_require__(/*! ./Box */ "./src/components/Box/Box.tsx");
|
|
3037
3050
|
Object.defineProperty(exports, "default", ({ enumerable: true, get: function () { return __importDefault(Box_1).default; } }));
|
|
3051
|
+
Object.defineProperty(exports, "Box", ({ enumerable: true, get: function () { return __importDefault(Box_1).default; } }));
|
|
3038
3052
|
var StylingBox_1 = __webpack_require__(/*! ./StylingBox */ "./src/components/Box/StylingBox.tsx");
|
|
3039
3053
|
Object.defineProperty(exports, "StylingBox", ({ enumerable: true, get: function () { return __importDefault(StylingBox_1).default; } }));
|
|
3040
3054
|
|
|
@@ -7621,7 +7635,8 @@ var Menu = function (_a) {
|
|
|
7621
7635
|
var _a;
|
|
7622
7636
|
if ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.classList.contains('focus-visible')) {
|
|
7623
7637
|
ref.current.classList.remove('focus-visible');
|
|
7624
|
-
|
|
7638
|
+
hide();
|
|
7639
|
+
return;
|
|
7625
7640
|
}
|
|
7626
7641
|
if (ref.current) {
|
|
7627
7642
|
ref.current.focus();
|
|
@@ -14962,12 +14977,12 @@ Object.defineProperty(exports, "Item", ({ enumerable: true, get: function () { r
|
|
|
14962
14977
|
exports.SelectAria = (0, react_1.forwardRef)(function SelectAria(_a, outerRef) {
|
|
14963
14978
|
var error = _a.error, placeholder = _a.placeholder, value = _a.value, onChange = _a.onChange, small = _a.small, isDisabledProps = _a.isDisabled, disabled = _a.disabled, id = _a.id, props = __rest(_a, ["error", "placeholder", "value", "onChange", "small", "isDisabled", "disabled", "id"]);
|
|
14964
14979
|
var isDisabled = isDisabledProps || disabled;
|
|
14965
|
-
var state = (0, react_stately_1.useSelectState)(__assign({ isDisabled: isDisabled, selectedKey: value, onSelectionChange: onChange }, props));
|
|
14980
|
+
var state = (0, react_stately_1.useSelectState)(__assign({ isDisabled: isDisabled, selectedKey: typeof value !== 'bigint' ? value : null, onSelectionChange: onChange }, props));
|
|
14966
14981
|
var _b = (0, fuselage_hooks_1.useResizeObserver)(), ref = _b.ref, borderBoxSize = _b.borderBoxSize;
|
|
14967
14982
|
var mergedRef = (0, fuselage_hooks_1.useMergedRefs)(outerRef, ref);
|
|
14968
14983
|
var _c = (0, react_aria_1.useSelect)(__assign({ isDisabled: isDisabled }, props), state, ref), triggerProps = _c.triggerProps, valueProps = _c.valueProps, menuProps = _c.menuProps;
|
|
14969
14984
|
var _d = (0, react_aria_1.useFocusRing)(), focusProps = _d.focusProps, isFocusVisible = _d.isFocusVisible;
|
|
14970
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.
|
|
14985
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(SelectTrigger_1.SelectTrigger, __assign({}, (0, react_aria_1.mergeProps)(focusProps, triggerProps), { ref: mergedRef, small: small, focus: isFocusVisible || state.isOpen, error: error, id: id, children: [(0, jsx_runtime_1.jsx)(react_aria_1.HiddenSelect, { state: state, triggerRef: ref, label: props.label, name: props.name, isDisabled: isDisabled }), (0, jsx_runtime_1.jsx)(Box_1.default, __assign({ is: 'span', color: state.selectedItem ? 'default' : 'hint' }, valueProps, (small && { fontScale: 'c1' }), { children: state.selectedItem ? state.selectedItem.rendered : placeholder })), (0, jsx_runtime_1.jsx)(Icon_1.Icon, { color: 'default', name: state.isOpen ? 'chevron-up' : 'chevron-down', size: 'x20' })] })), state.isOpen && ((0, jsx_runtime_1.jsx)(Popover_1.Popover, { state: state, triggerRef: ref, placement: 'bottom', offset: 4, containerPadding: 8, children: (0, jsx_runtime_1.jsx)(Options_1.OptionContainer, { style: {
|
|
14971
14986
|
width: borderBoxSize === null || borderBoxSize === void 0 ? void 0 : borderBoxSize.inlineSize,
|
|
14972
14987
|
}, children: (0, jsx_runtime_1.jsx)(Listbox_1.ListBox, __assign({}, menuProps, { state: state })) }) }))] }));
|
|
14973
14988
|
});
|
|
@@ -17546,6 +17561,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
17546
17561
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17547
17562
|
exports.useCollapse = void 0;
|
|
17548
17563
|
var fuselage_hooks_1 = __webpack_require__(/*! @rocket.chat/fuselage-hooks */ "@rocket.chat/fuselage-hooks");
|
|
17564
|
+
var react_1 = __webpack_require__(/*! react */ "react");
|
|
17549
17565
|
var hasPropExpanded = function (expanded) {
|
|
17550
17566
|
return expanded !== undefined;
|
|
17551
17567
|
};
|
|
@@ -17554,8 +17570,8 @@ var useCollapse = function (_a) {
|
|
|
17554
17570
|
var _c = __read((0, fuselage_hooks_1.useToggle)(defaultExpanded), 2), stateExpanded = _c[0], toggleStateExpanded = _c[1];
|
|
17555
17571
|
var expanded = hasPropExpanded(propExpanded) ? propExpanded : stateExpanded;
|
|
17556
17572
|
var panelExpanded = noncollapsible || expanded;
|
|
17557
|
-
var titleId = (0,
|
|
17558
|
-
var panelId = (0,
|
|
17573
|
+
var titleId = (0, react_1.useId)();
|
|
17574
|
+
var panelId = (0, react_1.useId)();
|
|
17559
17575
|
var handleClick = function (e) {
|
|
17560
17576
|
var _a;
|
|
17561
17577
|
if (disabled) {
|
|
@@ -18106,7 +18122,7 @@ function Slider(props) {
|
|
|
18106
18122
|
var label = props.label, formatOptions = props.formatOptions, _a = props.showOutput, showOutput = _a === void 0 ? true : _a, multiThumb = props.multiThumb, maxValue = props.maxValue, minValue = props.minValue;
|
|
18107
18123
|
// Get a defaultValue in the range for multiThumb
|
|
18108
18124
|
var getMultiThumbDefaultValue = function () {
|
|
18109
|
-
if (multiThumb && !defaultValue) {
|
|
18125
|
+
if (multiThumb && !props.defaultValue) {
|
|
18110
18126
|
if (minValue && maxValue) {
|
|
18111
18127
|
return [minValue, maxValue];
|
|
18112
18128
|
}
|
|
@@ -18280,7 +18296,7 @@ var SliderTrack = function (_a) {
|
|
|
18280
18296
|
}
|
|
18281
18297
|
return undefined;
|
|
18282
18298
|
};
|
|
18283
|
-
var track = (0, useStyle_1.useStyle)((0, css_in_js_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &::before {\n position: absolute;\n display: block;\n content:
|
|
18299
|
+
var track = (0, useStyle_1.useStyle)((0, css_in_js_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &::before {\n position: absolute;\n display: block;\n content: '';\n\n background: linear-gradient(", ");\n transform: translateX(-50%);\n border-radius: 1rem;\n }\n ", ";\n ", ";\n ", ";\n "], ["\n &::before {\n position: absolute;\n display: block;\n content: '';\n\n background: linear-gradient(", ");\n transform: translateX(-50%);\n border-radius: 1rem;\n }\n ", ";\n ", ";\n ", ";\n "])), getTrackGradient(), isHorizontal && (0, css_in_js_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 30px;\n &::before {\n top: 50%;\n width: 100%;\n height: 4px;\n transform: translateY(-50%);\n }\n "], ["\n width: 100%;\n height: 30px;\n &::before {\n top: 50%;\n width: 100%;\n height: 4px;\n transform: translateY(-50%);\n }\n "]))), isVertical && (0, css_in_js_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 30px;\n height: 100%;\n &::before {\n left: 50%;\n width: 4px;\n height: 100%;\n }\n "], ["\n width: 30px;\n height: 100%;\n &::before {\n left: 50%;\n width: 4px;\n height: 100%;\n }\n "]))), state.isDisabled && (0, css_in_js_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: not-allowed;\n opacity: 0.4;\n "], ["\n cursor: not-allowed;\n opacity: 0.4;\n "])))), state);
|
|
18284
18300
|
return ((0, jsx_runtime_1.jsx)("div", __assign({}, trackProps, { ref: trackRef, className: track, children: children })));
|
|
18285
18301
|
};
|
|
18286
18302
|
exports.SliderTrack = SliderTrack;
|
|
@@ -20068,7 +20084,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
20068
20084
|
exports.ToastBar = ToastBar;
|
|
20069
20085
|
var jsx_runtime_1 = __webpack_require__(/*! react/jsx-runtime */ "../../node_modules/react/jsx-runtime.js");
|
|
20070
20086
|
var css_in_js_1 = __webpack_require__(/*! @rocket.chat/css-in-js */ "@rocket.chat/css-in-js");
|
|
20071
|
-
var
|
|
20087
|
+
var react_1 = __webpack_require__(/*! react */ "react");
|
|
20072
20088
|
var Box_1 = __importDefault(__webpack_require__(/*! ../Box */ "./src/components/Box/index.ts"));
|
|
20073
20089
|
var Button_1 = __webpack_require__(/*! ../Button */ "./src/components/Button/index.ts");
|
|
20074
20090
|
var Icon_1 = __webpack_require__(/*! ../Icon */ "./src/components/Icon/index.ts");
|
|
@@ -20084,7 +20100,7 @@ function ToastBar(_a) {
|
|
|
20084
20100
|
var progressBar = (0, css_in_js_1.keyframes)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n from {\n width: 0%;\n }\n\n to {\n width: 100%;\n }\n "], ["\n from {\n width: 0%;\n }\n\n to {\n width: 100%;\n }\n "])));
|
|
20085
20101
|
var toastBarAnimation = (0, css_in_js_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n animation: ", " 0.5s;\n "], ["\n animation: ", " 0.5s;\n "])), sideOpen);
|
|
20086
20102
|
var progressBarAnimation = (0, css_in_js_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &::after {\n width: 0%;\n animation: ", " ", "s;\n animation-fill-mode: forwards;\n animation-play-state: ", ";\n }\n "], ["\n &::after {\n width: 0%;\n animation: ", " ", "s;\n animation-fill-mode: forwards;\n animation-play-state: ", ";\n }\n "])), progressBar, time, isPaused ? 'paused' : 'running');
|
|
20087
|
-
var uniqueId = (0,
|
|
20103
|
+
var uniqueId = (0, react_1.useId)();
|
|
20088
20104
|
var toastId = id || uniqueId;
|
|
20089
20105
|
return ((0, jsx_runtime_1.jsxs)(Box_1.default, __assign({ className: [
|
|
20090
20106
|
"rcx-toastbar rcx-toastbar--".concat(variant, " ").concat(className),
|
|
@@ -21141,7 +21157,7 @@ var useStyle = function (cssFn, arg) {
|
|
|
21141
21157
|
return content ? (0, css_in_js_1.createClassName)(content) : undefined;
|
|
21142
21158
|
}, [content]);
|
|
21143
21159
|
(0, react_1.useDebugValue)(className);
|
|
21144
|
-
(0, react_1.
|
|
21160
|
+
(0, react_1.useInsertionEffect)(function () {
|
|
21145
21161
|
if (!content || !className) {
|
|
21146
21162
|
return;
|
|
21147
21163
|
}
|