gwchq-textjam 0.3.8 → 0.3.10

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/index.js CHANGED
@@ -68492,8 +68492,8 @@ __webpack_require__.r(__webpack_exports__);
68492
68492
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68493
68493
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68494
68494
  /* harmony export */ });
68495
- /* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89379);
68496
- /* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53986);
68495
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89379);
68496
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53986);
68497
68497
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
68498
68498
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
68499
68499
  /* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68512);
@@ -68514,7 +68514,7 @@ var DraggableTab = _ref => {
68514
68514
  draggableId,
68515
68515
  onTabClick
68516
68516
  } = _ref,
68517
- otherProps = (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(_ref, _excluded);
68517
+ otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(_ref, _excluded);
68518
68518
  var openedTabs = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedTabs);
68519
68519
  var openFilesCount = openedTabs.filter(t => t && t.type === "file").length || 1;
68520
68520
  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
@@ -68532,7 +68532,7 @@ var DraggableTab = _ref => {
68532
68532
  switchToFileTab((fileIndex + openFilesCount - 1) % openFilesCount);
68533
68533
  }
68534
68534
  };
68535
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Tabs_DraggableTabWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)({
68535
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Tabs_DraggableTabWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)({
68536
68536
  draggableId: draggableId,
68537
68537
  index: fileIndex,
68538
68538
  onClick: e => {
@@ -68556,8 +68556,8 @@ __webpack_require__.r(__webpack_exports__);
68556
68556
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
68557
68557
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
68558
68558
  /* harmony export */ });
68559
- /* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
68560
- /* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
68559
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
68560
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
68561
68561
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
68562
68562
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
68563
68563
  /* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
@@ -68576,8 +68576,8 @@ var DroppableTabList = _ref => {
68576
68576
  children: _children,
68577
68577
  index
68578
68578
  } = _ref,
68579
- otherProps = (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
68580
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
68579
+ otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
68580
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
68581
68581
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
68582
68582
  direction: "horizontal",
68583
68583
  droppableId: index.toString(),
@@ -68587,7 +68587,7 @@ var DroppableTabList = _ref => {
68587
68587
  droppableProps,
68588
68588
  placeholder
68589
68589
  } = _ref2;
68590
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
68590
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
68591
68591
  className: "droppable-tab-list"
68592
68592
  }, droppableProps), {}, {
68593
68593
  ref: innerRef,
@@ -103160,7 +103160,7 @@ __webpack_require__.r(__webpack_exports__);
103160
103160
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
103161
103161
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
103162
103162
  /* harmony export */ });
103163
- /* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
103163
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
103164
103164
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
103165
103165
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
103166
103166
  /* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
@@ -103276,7 +103276,7 @@ var ProjectName = _ref => {
103276
103276
  id: "project_name_label",
103277
103277
  className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
103278
103278
  children: "Project Name"
103279
- }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
103279
+ }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
103280
103280
  className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
103281
103281
  }, hoverProps), {}, {
103282
103282
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
@@ -143208,7 +143208,7 @@ __webpack_require__.r(__webpack_exports__);
143208
143208
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
143209
143209
  /* harmony export */ });
143210
143210
  // extracted by mini-css-extract-plugin
143211
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","viewSwitcher":"styles-module__viewSwitcher--h0ODR","viewSwitcherBtn":"styles-module__viewSwitcherBtn--v6-ir","viewSwitcherBtnActive":"styles-module__viewSwitcherBtnActive--m2JP-"});
143211
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","viewSwitcher":"styles-module__viewSwitcher--h0ODR","viewSwitcherBtn":"styles-module__viewSwitcherBtn--v6-ir","viewSwitcherBtnWrapper":"styles-module__viewSwitcherBtnWrapper--OarYg","viewSwitcherBtnActive":"styles-module__viewSwitcherBtnActive--m2JP-"});
143212
143212
 
143213
143213
  /***/ }),
143214
143214
 
@@ -346986,10 +346986,10 @@ __webpack_require__.r(__webpack_exports__);
346986
346986
 
346987
346987
  // EXPORTS
346988
346988
  __webpack_require__.d(__webpack_exports__, {
346989
- Tab: () => (/* reexport */ components_Tab),
346990
- TabList: () => (/* reexport */ components_TabList),
346991
- TabPanel: () => (/* reexport */ components_TabPanel),
346992
- Tabs: () => (/* reexport */ components_Tabs),
346989
+ Tab: () => (/* reexport */ Tab),
346990
+ TabList: () => (/* reexport */ TabList),
346991
+ TabPanel: () => (/* reexport */ TabPanel),
346992
+ Tabs: () => (/* reexport */ Tabs),
346993
346993
  resetIdCounter: () => (/* reexport */ uuid_reset)
346994
346994
  });
346995
346995
 
@@ -347138,6 +347138,13 @@ function count_getTabsCount(children) {
347138
347138
  });
347139
347139
  return tabCount;
347140
347140
  }
347141
+ function count_getPanelsCount(children) {
347142
+ var panelCount = 0;
347143
+ childrenDeepMap_deepForEach(children, function (child) {
347144
+ if (elementTypes_isTabPanel(child)) panelCount++;
347145
+ });
347146
+ return panelCount;
347147
+ }
347141
347148
  ;// ./node_modules/react-tabs/esm/components/UncontrolledTabs.js
347142
347149
  var _excluded = ["children", "className", "disabledTabClassName", "domRef", "focus", "forceRenderTabPanel", "onSelect", "selectedIndex", "selectedTabClassName", "selectedTabPanelClassName", "environment", "disableUpDownKeys"];
347143
347150
 
@@ -347145,6 +347152,10 @@ function UncontrolledTabs_extends() { UncontrolledTabs_extends = Object.assign |
347145
347152
 
347146
347153
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
347147
347154
 
347155
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
347156
+
347157
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
347158
+
347148
347159
 
347149
347160
 
347150
347161
 
@@ -347180,135 +347191,219 @@ function determineCanUseActiveElement(environment) {
347180
347191
  // Refer to the following resources:
347181
347192
  // http://stackoverflow.com/a/10982960/369687
347182
347193
  // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12733599
347183
- // istanbul ignore next
347184
347194
  canUseActiveElement = false;
347185
347195
  }
347186
347196
  }
347187
347197
 
347188
- var defaultProps = {
347189
- className: 'react-tabs',
347190
- focus: false
347191
- };
347192
- var propTypes = false ? 0 : {};
347198
+ var UncontrolledTabs = /*#__PURE__*/function (_Component) {
347199
+ _inheritsLoose(UncontrolledTabs, _Component);
347200
+
347201
+ function UncontrolledTabs() {
347202
+ var _this;
347203
+
347204
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
347205
+ args[_key] = arguments[_key];
347206
+ }
347207
+
347208
+ _this = _Component.call.apply(_Component, [this].concat(args)) || this;
347209
+ _this.tabNodes = [];
347210
+
347211
+ _this.handleKeyDown = function (e) {
347212
+ var _this$props = _this.props,
347213
+ direction = _this$props.direction,
347214
+ disableUpDownKeys = _this$props.disableUpDownKeys;
347193
347215
 
347194
- var UncontrolledTabs = function UncontrolledTabs(props) {
347195
- var tabNodes = (0,external_react_.useRef)([]);
347196
- var tabIds = (0,external_react_.useRef)([]);
347197
- var panelIds = (0,external_react_.useRef)([]);
347216
+ if (_this.isTabFromContainer(e.target)) {
347217
+ var index = _this.props.selectedIndex;
347218
+ var preventDefault = false;
347219
+ var useSelectedIndex = false;
347220
+
347221
+ if (e.keyCode === 32 || e.keyCode === 13) {
347222
+ preventDefault = true;
347223
+ useSelectedIndex = false;
347224
+
347225
+ _this.handleClick(e);
347226
+ }
347227
+
347228
+ if (e.keyCode === 37 || !disableUpDownKeys && e.keyCode === 38) {
347229
+ // Select next tab to the left, validate if up arrow is not disabled
347230
+ if (direction === 'rtl') {
347231
+ index = _this.getNextTab(index);
347232
+ } else {
347233
+ index = _this.getPrevTab(index);
347234
+ }
347235
+
347236
+ preventDefault = true;
347237
+ useSelectedIndex = true;
347238
+ } else if (e.keyCode === 39 || !disableUpDownKeys && e.keyCode === 40) {
347239
+ // Select next tab to the right, validate if down arrow is not disabled
347240
+ if (direction === 'rtl') {
347241
+ index = _this.getPrevTab(index);
347242
+ } else {
347243
+ index = _this.getNextTab(index);
347244
+ }
347245
+
347246
+ preventDefault = true;
347247
+ useSelectedIndex = true;
347248
+ } else if (e.keyCode === 35) {
347249
+ // Select last tab (End key)
347250
+ index = _this.getLastTab();
347251
+ preventDefault = true;
347252
+ useSelectedIndex = true;
347253
+ } else if (e.keyCode === 36) {
347254
+ // Select first tab (Home key)
347255
+ index = _this.getFirstTab();
347256
+ preventDefault = true;
347257
+ useSelectedIndex = true;
347258
+ } // This prevents scrollbars from moving around
347259
+
347260
+
347261
+ if (preventDefault) {
347262
+ e.preventDefault();
347263
+ } // Only use the selected index in the state if we're not using the tabbed index
347264
+
347265
+
347266
+ if (useSelectedIndex) {
347267
+ _this.setSelected(index, e);
347268
+ }
347269
+ }
347270
+ };
347198
347271
 
347199
- var _ref = (0,external_react_.useRef)();
347272
+ _this.handleClick = function (e) {
347273
+ var node = e.target;
347200
347274
 
347201
- function setSelected(index, event) {
347275
+ do {
347276
+ if (_this.isTabFromContainer(node)) {
347277
+ if (isTabDisabled(node)) {
347278
+ return;
347279
+ }
347280
+
347281
+ var index = [].slice.call(node.parentNode.children).filter(isTabNode).indexOf(node);
347282
+
347283
+ _this.setSelected(index, e);
347284
+
347285
+ return;
347286
+ }
347287
+ } while ((node = node.parentNode) != null);
347288
+ };
347289
+
347290
+ return _this;
347291
+ }
347292
+
347293
+ var _proto = UncontrolledTabs.prototype;
347294
+
347295
+ _proto.setSelected = function setSelected(index, event) {
347202
347296
  // Check index boundary
347203
- if (index < 0 || index >= getTabsCount()) return;
347204
- var onSelect = props.onSelect,
347205
- selectedIndex = props.selectedIndex; // Call change event handler
347297
+ if (index < 0 || index >= this.getTabsCount()) return;
347298
+ var _this$props2 = this.props,
347299
+ onSelect = _this$props2.onSelect,
347300
+ selectedIndex = _this$props2.selectedIndex; // Call change event handler
347206
347301
 
347207
347302
  onSelect(index, selectedIndex, event);
347208
- }
347303
+ };
347209
347304
 
347210
- function getNextTab(index) {
347211
- var count = getTabsCount(); // Look for non-disabled tab from index to the last tab on the right
347305
+ _proto.getNextTab = function getNextTab(index) {
347306
+ var count = this.getTabsCount(); // Look for non-disabled tab from index to the last tab on the right
347212
347307
 
347213
347308
  for (var i = index + 1; i < count; i++) {
347214
- if (!isTabDisabled(getTab(i))) {
347309
+ if (!isTabDisabled(this.getTab(i))) {
347215
347310
  return i;
347216
347311
  }
347217
347312
  } // If no tab found, continue searching from first on left to index
347218
347313
 
347219
347314
 
347220
347315
  for (var _i = 0; _i < index; _i++) {
347221
- if (!isTabDisabled(getTab(_i))) {
347316
+ if (!isTabDisabled(this.getTab(_i))) {
347222
347317
  return _i;
347223
347318
  }
347224
- } // All tabs are disabled, return index
347225
-
347226
- /* istanbul ignore next */
347319
+ } // No tabs are disabled, return index
347227
347320
 
347228
347321
 
347229
347322
  return index;
347230
- }
347323
+ };
347231
347324
 
347232
- function getPrevTab(index) {
347325
+ _proto.getPrevTab = function getPrevTab(index) {
347233
347326
  var i = index; // Look for non-disabled tab from index to first tab on the left
347234
347327
 
347235
347328
  while (i--) {
347236
- if (!isTabDisabled(getTab(i))) {
347329
+ if (!isTabDisabled(this.getTab(i))) {
347237
347330
  return i;
347238
347331
  }
347239
347332
  } // If no tab found, continue searching from last tab on right to index
347240
347333
 
347241
347334
 
347242
- i = getTabsCount();
347335
+ i = this.getTabsCount();
347243
347336
 
347244
347337
  while (i-- > index) {
347245
- if (!isTabDisabled(getTab(i))) {
347338
+ if (!isTabDisabled(this.getTab(i))) {
347246
347339
  return i;
347247
347340
  }
347248
- } // All tabs are disabled, return index
347249
-
347250
- /* istanbul ignore next */
347341
+ } // No tabs are disabled, return index
347251
347342
 
347252
347343
 
347253
347344
  return index;
347254
- }
347345
+ };
347255
347346
 
347256
- function getFirstTab() {
347257
- var count = getTabsCount(); // Look for non disabled tab from the first tab
347347
+ _proto.getFirstTab = function getFirstTab() {
347348
+ var count = this.getTabsCount(); // Look for non disabled tab from the first tab
347258
347349
 
347259
347350
  for (var i = 0; i < count; i++) {
347260
- if (!isTabDisabled(getTab(i))) {
347351
+ if (!isTabDisabled(this.getTab(i))) {
347261
347352
  return i;
347262
347353
  }
347263
347354
  }
347264
- /* istanbul ignore next */
347265
-
347266
347355
 
347267
347356
  return null;
347268
- }
347357
+ };
347269
347358
 
347270
- function getLastTab() {
347271
- var i = getTabsCount(); // Look for non disabled tab from the last tab
347359
+ _proto.getLastTab = function getLastTab() {
347360
+ var i = this.getTabsCount(); // Look for non disabled tab from the last tab
347272
347361
 
347273
347362
  while (i--) {
347274
- if (!isTabDisabled(getTab(i))) {
347363
+ if (!isTabDisabled(this.getTab(i))) {
347275
347364
  return i;
347276
347365
  }
347277
347366
  }
347278
- /* istanbul ignore next */
347279
-
347280
347367
 
347281
347368
  return null;
347282
- }
347369
+ };
347283
347370
 
347284
- function getTabsCount() {
347285
- var children = props.children;
347371
+ _proto.getTabsCount = function getTabsCount() {
347372
+ var children = this.props.children;
347286
347373
  return count_getTabsCount(children);
347287
- }
347374
+ };
347288
347375
 
347289
- function getTab(index) {
347290
- return tabNodes.current["tabs-" + index];
347291
- }
347376
+ _proto.getPanelsCount = function getPanelsCount() {
347377
+ var children = this.props.children;
347378
+ return count_getPanelsCount(children);
347379
+ };
347380
+
347381
+ _proto.getTab = function getTab(index) {
347382
+ return this.tabNodes["tabs-" + index];
347383
+ };
347384
+
347385
+ _proto.getChildren = function getChildren() {
347386
+ var _this2 = this;
347292
347387
 
347293
- function getChildren() {
347294
347388
  var index = 0;
347295
- var children = props.children,
347296
- disabledTabClassName = props.disabledTabClassName,
347297
- focus = props.focus,
347298
- forceRenderTabPanel = props.forceRenderTabPanel,
347299
- selectedIndex = props.selectedIndex,
347300
- selectedTabClassName = props.selectedTabClassName,
347301
- selectedTabPanelClassName = props.selectedTabPanelClassName,
347302
- environment = props.environment;
347303
- tabIds.current = tabIds.current || [];
347304
- panelIds.current = panelIds.current || [];
347305
- var diff = tabIds.current.length - getTabsCount(); // Add ids if new tabs have been added
347389
+ var _this$props3 = this.props,
347390
+ children = _this$props3.children,
347391
+ disabledTabClassName = _this$props3.disabledTabClassName,
347392
+ focus = _this$props3.focus,
347393
+ forceRenderTabPanel = _this$props3.forceRenderTabPanel,
347394
+ selectedIndex = _this$props3.selectedIndex,
347395
+ selectedTabClassName = _this$props3.selectedTabClassName,
347396
+ selectedTabPanelClassName = _this$props3.selectedTabPanelClassName,
347397
+ environment = _this$props3.environment;
347398
+ this.tabIds = this.tabIds || [];
347399
+ this.panelIds = this.panelIds || [];
347400
+ var diff = this.tabIds.length - this.getTabsCount(); // Add ids if new tabs have been added
347306
347401
  // Don't bother removing ids, just keep them in case they are added again
347307
347402
  // This is more efficient, and keeps the uuid counter under control
347308
347403
 
347309
347404
  while (diff++ < 0) {
347310
- tabIds.current.push(uuid());
347311
- panelIds.current.push(uuid());
347405
+ this.tabIds.push(uuid());
347406
+ this.panelIds.push(uuid());
347312
347407
  } // Map children to dynamically setup refs
347313
347408
 
347314
347409
 
@@ -347325,11 +347420,10 @@ var UncontrolledTabs = function UncontrolledTabs(props) {
347325
347420
  determineCanUseActiveElement(environment);
347326
347421
  }
347327
347422
 
347328
- var env = environment || (typeof window !== 'undefined' ? window : undefined);
347329
-
347330
- if (canUseActiveElement && env) {
347423
+ if (canUseActiveElement) {
347331
347424
  wasTabFocused = external_react_["default"].Children.toArray(child.props.children).filter(elementTypes_isTab).some(function (tab, i) {
347332
- return env.document.activeElement === getTab(i);
347425
+ var env = environment || (typeof window !== 'undefined' ? window : undefined);
347426
+ return env && env.document.activeElement === _this2.getTab(i);
347333
347427
  });
347334
347428
  }
347335
347429
 
@@ -347339,10 +347433,10 @@ var UncontrolledTabs = function UncontrolledTabs(props) {
347339
347433
  var selected = selectedIndex === listIndex;
347340
347434
  var props = {
347341
347435
  tabRef: function tabRef(node) {
347342
- tabNodes.current[key] = node;
347436
+ _this2.tabNodes[key] = node;
347343
347437
  },
347344
- id: tabIds.current[listIndex],
347345
- panelId: panelIds.current[listIndex],
347438
+ id: _this2.tabIds[listIndex],
347439
+ panelId: _this2.panelIds[listIndex],
347346
347440
  selected: selected,
347347
347441
  focus: selected && (focus || wasTabFocused)
347348
347442
  };
@@ -347353,116 +347447,27 @@ var UncontrolledTabs = function UncontrolledTabs(props) {
347353
347447
  })
347354
347448
  });
347355
347449
  } else if (elementTypes_isTabPanel(child)) {
347356
- var _props = {
347357
- id: panelIds.current[index],
347358
- tabId: tabIds.current[index],
347450
+ var props = {
347451
+ id: _this2.panelIds[index],
347452
+ tabId: _this2.tabIds[index],
347359
347453
  selected: selectedIndex === index
347360
347454
  };
347361
- if (forceRenderTabPanel) _props.forceRender = forceRenderTabPanel;
347362
- if (selectedTabPanelClassName) _props.selectedClassName = selectedTabPanelClassName;
347455
+ if (forceRenderTabPanel) props.forceRender = forceRenderTabPanel;
347456
+ if (selectedTabPanelClassName) props.selectedClassName = selectedTabPanelClassName;
347363
347457
  index++;
347364
- result = /*#__PURE__*/(0,external_react_.cloneElement)(child, _props);
347458
+ result = /*#__PURE__*/(0,external_react_.cloneElement)(child, props);
347365
347459
  }
347366
347460
 
347367
347461
  return result;
347368
347462
  });
347369
- }
347370
-
347371
- function handleKeyDown(e) {
347372
- var direction = props.direction,
347373
- disableUpDownKeys = props.disableUpDownKeys;
347374
-
347375
- if (isTabFromContainer(e.target)) {
347376
- var index = props.selectedIndex;
347377
- var preventDefault = false;
347378
- var useSelectedIndex = false;
347379
-
347380
- if (e.code === 'Space' || e.keyCode === 32
347381
- /* space */
347382
- || e.code === 'Enter' || e.keyCode === 13
347383
- /* enter */
347384
- ) {
347385
- preventDefault = true;
347386
- useSelectedIndex = false;
347387
- handleClick(e);
347388
- } // keyCode is deprecated and only used here for IE
347389
-
347390
-
347391
- if (e.code === 'ArrowLeft' || e.keyCode === 37
347392
- /* arrow left */
347393
- || !disableUpDownKeys && (e.keyCode === 38 || e.code === 'ArrowUp')
347394
- /* arrow up */
347395
- ) {
347396
- // Select next tab to the left, validate if up arrow is not disabled
347397
- if (direction === 'rtl') {
347398
- index = getNextTab(index);
347399
- } else {
347400
- index = getPrevTab(index);
347401
- }
347402
-
347403
- preventDefault = true;
347404
- useSelectedIndex = true;
347405
- } else if (e.code === 'ArrowRight' || e.keyCode === 39
347406
- /* arrow right */
347407
- || !disableUpDownKeys && (e.keyCode === 40 || e.code === 'ArrowDown')
347408
- /* arrow down */
347409
- ) {
347410
- // Select next tab to the right, validate if down arrow is not disabled
347411
- if (direction === 'rtl') {
347412
- index = getPrevTab(index);
347413
- } else {
347414
- index = getNextTab(index);
347415
- }
347416
-
347417
- preventDefault = true;
347418
- useSelectedIndex = true;
347419
- } else if (e.keyCode === 35 || e.code === 'End') {
347420
- // Select last tab (End key)
347421
- index = getLastTab();
347422
- preventDefault = true;
347423
- useSelectedIndex = true;
347424
- } else if (e.keyCode === 36 || e.code === 'Home') {
347425
- // Select first tab (Home key)
347426
- index = getFirstTab();
347427
- preventDefault = true;
347428
- useSelectedIndex = true;
347429
- } // This prevents scrollbars from moving around
347430
-
347431
-
347432
- if (preventDefault) {
347433
- e.preventDefault();
347434
- } // Only use the selected index in the state if we're not using the tabbed index
347435
-
347436
-
347437
- if (useSelectedIndex) {
347438
- setSelected(index, e);
347439
- }
347440
- }
347441
- }
347442
-
347443
- function handleClick(e) {
347444
- var node = e.target;
347445
-
347446
- do {
347447
- if (isTabFromContainer(node)) {
347448
- if (isTabDisabled(node)) {
347449
- return;
347450
- }
347463
+ };
347451
347464
 
347452
- var index = [].slice.call(node.parentNode.children).filter(isTabNode).indexOf(node);
347453
- setSelected(index, e);
347454
- return;
347455
- }
347456
- } while ((node = node.parentNode) != null);
347457
- }
347458
347465
  /**
347459
347466
  * Determine if a node from event.target is a Tab element for the current Tabs container.
347460
347467
  * If the clicked element is not a Tab, it returns false.
347461
347468
  * If it finds another Tabs container between the Tab and `this`, it returns false.
347462
347469
  */
347463
-
347464
-
347465
- function isTabFromContainer(node) {
347470
+ _proto.isTabFromContainer = function isTabFromContainer(node) {
347466
347471
  // return immediately if the clicked element is not a Tab.
347467
347472
  if (!isTabNode(node)) {
347468
347473
  return false;
@@ -347472,45 +347477,62 @@ var UncontrolledTabs = function UncontrolledTabs(props) {
347472
347477
  var nodeAncestor = node.parentElement;
347473
347478
 
347474
347479
  do {
347475
- if (nodeAncestor === _ref.current) return true;
347480
+ if (nodeAncestor === this.node) return true;
347476
347481
  if (nodeAncestor.getAttribute('data-rttabs')) break;
347477
347482
  nodeAncestor = nodeAncestor.parentElement;
347478
347483
  } while (nodeAncestor);
347479
347484
 
347480
347485
  return false;
347481
- }
347486
+ };
347482
347487
 
347483
- var children = props.children,
347484
- className = props.className,
347485
- disabledTabClassName = props.disabledTabClassName,
347486
- domRef = props.domRef,
347487
- focus = props.focus,
347488
- forceRenderTabPanel = props.forceRenderTabPanel,
347489
- onSelect = props.onSelect,
347490
- selectedIndex = props.selectedIndex,
347491
- selectedTabClassName = props.selectedTabClassName,
347492
- selectedTabPanelClassName = props.selectedTabPanelClassName,
347493
- environment = props.environment,
347494
- disableUpDownKeys = props.disableUpDownKeys,
347495
- attributes = _objectWithoutPropertiesLoose(props, _excluded);
347496
-
347497
- return /*#__PURE__*/external_react_["default"].createElement("div", UncontrolledTabs_extends({}, attributes, {
347498
- className: (0,clsx_m/* default */.A)(className),
347499
- onClick: handleClick,
347500
- onKeyDown: handleKeyDown,
347501
- ref: function ref(node) {
347502
- _ref.current = node;
347503
- if (domRef) domRef(node);
347504
- },
347505
- "data-rttabs": true
347506
- }), getChildren());
347488
+ _proto.render = function render() {
347489
+ var _this3 = this;
347490
+
347491
+ // Delete all known props, so they don't get added to DOM
347492
+ var _this$props4 = this.props,
347493
+ children = _this$props4.children,
347494
+ className = _this$props4.className,
347495
+ disabledTabClassName = _this$props4.disabledTabClassName,
347496
+ domRef = _this$props4.domRef,
347497
+ focus = _this$props4.focus,
347498
+ forceRenderTabPanel = _this$props4.forceRenderTabPanel,
347499
+ onSelect = _this$props4.onSelect,
347500
+ selectedIndex = _this$props4.selectedIndex,
347501
+ selectedTabClassName = _this$props4.selectedTabClassName,
347502
+ selectedTabPanelClassName = _this$props4.selectedTabPanelClassName,
347503
+ environment = _this$props4.environment,
347504
+ disableUpDownKeys = _this$props4.disableUpDownKeys,
347505
+ attributes = _objectWithoutPropertiesLoose(_this$props4, _excluded);
347506
+
347507
+ return /*#__PURE__*/external_react_["default"].createElement("div", UncontrolledTabs_extends({}, attributes, {
347508
+ className: (0,clsx_m/* default */.A)(className),
347509
+ onClick: this.handleClick,
347510
+ onKeyDown: this.handleKeyDown,
347511
+ ref: function ref(node) {
347512
+ _this3.node = node;
347513
+ if (domRef) domRef(node);
347514
+ },
347515
+ "data-rttabs": true
347516
+ }), this.getChildren());
347517
+ };
347518
+
347519
+ return UncontrolledTabs;
347520
+ }(external_react_.Component);
347521
+
347522
+ UncontrolledTabs.defaultProps = {
347523
+ className: 'react-tabs',
347524
+ focus: false
347507
347525
  };
347508
347526
 
347509
- UncontrolledTabs.defaultProps = defaultProps;
347510
347527
  UncontrolledTabs.propTypes = false ? 0 : {};
347511
- /* harmony default export */ const components_UncontrolledTabs = (UncontrolledTabs);
347512
347528
  ;// ./node_modules/react-tabs/esm/components/Tabs.js
347513
- function Tabs_extends() { Tabs_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return Tabs_extends.apply(this, arguments); }
347529
+ var Tabs_excluded = ["children", "defaultIndex", "defaultFocus"];
347530
+
347531
+ function Tabs_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
347532
+
347533
+ function Tabs_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; Tabs_setPrototypeOf(subClass, superClass); }
347534
+
347535
+ function Tabs_setPrototypeOf(o, p) { Tabs_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tabs_setPrototypeOf(o, p); }
347514
347536
 
347515
347537
 
347516
347538
 
@@ -347519,106 +347541,115 @@ function Tabs_extends() { Tabs_extends = Object.assign || function (target) { fo
347519
347541
 
347520
347542
  var MODE_CONTROLLED = 0;
347521
347543
  var MODE_UNCONTROLLED = 1;
347522
- var Tabs_propTypes = false ? 0 : {};
347523
- var Tabs_defaultProps = {
347524
- defaultFocus: false,
347525
- focusTabOnClick: true,
347526
- forceRenderTabPanel: false,
347527
- selectedIndex: null,
347528
- defaultIndex: null,
347529
- environment: null,
347530
- disableUpDownKeys: false
347531
- };
347532
347544
 
347533
- var getModeFromProps = function getModeFromProps(props) {
347534
- return props.selectedIndex === null ? MODE_UNCONTROLLED : MODE_CONTROLLED;
347535
- };
347545
+ var Tabs = /*#__PURE__*/function (_Component) {
347546
+ Tabs_inheritsLoose(Tabs, _Component);
347536
347547
 
347537
- var checkForIllegalModeChange = function checkForIllegalModeChange(props, mode) {
347538
- if (false) {}
347539
- };
347540
- /**
347541
- * State:
347542
- * mode: Initialized only once from props and never changes
347543
- * selectedIndex: null if controlled mode, otherwise initialized with prop defaultIndex, changed on selection of tabs, has effect to ensure it never gets out of bound
347544
- * focus: Because we never remove focus from the Tabs this state is only used to indicate that we should focus the current tab.
347545
- * It is initialized from the prop defaultFocus, and after the first render it is reset back to false. Later it can become true again when using keys to navigate the tabs.
347546
- */
347548
+ function Tabs(props) {
347549
+ var _this;
347547
347550
 
347551
+ _this = _Component.call(this, props) || this;
347548
347552
 
347549
- var Tabs = function Tabs(props) {
347550
- var children = props.children,
347551
- defaultFocus = props.defaultFocus,
347552
- defaultIndex = props.defaultIndex,
347553
- focusTabOnClick = props.focusTabOnClick,
347554
- onSelect = props.onSelect;
347553
+ _this.handleSelected = function (index, last, event) {
347554
+ var onSelect = _this.props.onSelect;
347555
+ var mode = _this.state.mode; // Call change event handler
347555
347556
 
347556
- var _useState = (0,external_react_.useState)(defaultFocus),
347557
- focus = _useState[0],
347558
- setFocus = _useState[1];
347557
+ if (typeof onSelect === 'function') {
347558
+ // Check if the change event handler cancels the tab change
347559
+ if (onSelect(index, last, event) === false) return;
347560
+ }
347559
347561
 
347560
- var _useState2 = (0,external_react_.useState)(getModeFromProps(props)),
347561
- mode = _useState2[0];
347562
+ var state = {
347563
+ // Set focus if the change was triggered from the keyboard
347564
+ focus: event.type === 'keydown'
347565
+ };
347562
347566
 
347563
- var _useState3 = (0,external_react_.useState)(mode === MODE_UNCONTROLLED ? defaultIndex || 0 : null),
347564
- selectedIndex = _useState3[0],
347565
- setSelectedIndex = _useState3[1];
347567
+ if (mode === MODE_UNCONTROLLED) {
347568
+ // Update selected index
347569
+ state.selectedIndex = index;
347570
+ }
347566
347571
 
347567
- (0,external_react_.useEffect)(function () {
347568
- // Reset focus after initial render, see comment above
347569
- setFocus(false);
347570
- }, []);
347572
+ _this.setState(state);
347573
+ };
347571
347574
 
347572
- if (mode === MODE_UNCONTROLLED) {
347573
- // Ensure that we handle removed tabs and don't let selectedIndex get out of bounds
347574
- var tabsCount = count_getTabsCount(children);
347575
- (0,external_react_.useEffect)(function () {
347576
- if (selectedIndex != null) {
347577
- var maxTabIndex = Math.max(0, tabsCount - 1);
347578
- setSelectedIndex(Math.min(selectedIndex, maxTabIndex));
347579
- }
347580
- }, [tabsCount]);
347575
+ _this.state = Tabs.copyPropsToState(_this.props, {}, props.defaultFocus);
347576
+ return _this;
347581
347577
  }
347582
347578
 
347583
- checkForIllegalModeChange(props, mode);
347584
-
347585
- var handleSelected = function handleSelected(index, last, event) {
347586
- // Call change event handler
347587
- if (typeof onSelect === 'function') {
347588
- // Check if the change event handler cancels the tab change
347589
- if (onSelect(index, last, event) === false) return;
347590
- } // Always set focus on tabs unless it is disabled
347579
+ Tabs.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
347580
+ return Tabs.copyPropsToState(props, state);
347581
+ };
347591
347582
 
347583
+ Tabs.getModeFromProps = function getModeFromProps(props) {
347584
+ return props.selectedIndex === null ? MODE_UNCONTROLLED : MODE_CONTROLLED;
347585
+ };
347592
347586
 
347593
- if (focusTabOnClick) {
347594
- setFocus(true);
347587
+ // preserve the existing selectedIndex from state.
347588
+ // If the state has not selectedIndex, default to the defaultIndex or 0
347589
+ Tabs.copyPropsToState = function copyPropsToState(props, state, focus) {
347590
+ if (focus === void 0) {
347591
+ focus = false;
347595
347592
  }
347596
347593
 
347597
- if (mode === MODE_UNCONTROLLED) {
347598
- // Update selected index
347599
- setSelectedIndex(index);
347594
+ if (false) {}
347595
+
347596
+ var newState = {
347597
+ focus: focus,
347598
+ mode: Tabs.getModeFromProps(props)
347599
+ };
347600
+
347601
+ if (newState.mode === MODE_UNCONTROLLED) {
347602
+ var maxTabIndex = Math.max(0, count_getTabsCount(props.children) - 1);
347603
+ var selectedIndex = null;
347604
+
347605
+ if (state.selectedIndex != null) {
347606
+ selectedIndex = Math.min(state.selectedIndex, maxTabIndex);
347607
+ } else {
347608
+ selectedIndex = props.defaultIndex || 0;
347609
+ }
347610
+
347611
+ newState.selectedIndex = selectedIndex;
347600
347612
  }
347613
+
347614
+ return newState;
347601
347615
  };
347602
347616
 
347603
- var subProps = Tabs_extends({}, props);
347617
+ var _proto = Tabs.prototype;
347604
347618
 
347605
- subProps.focus = focus;
347606
- subProps.onSelect = handleSelected;
347619
+ _proto.render = function render() {
347620
+ var _this$props = this.props,
347621
+ children = _this$props.children,
347622
+ defaultIndex = _this$props.defaultIndex,
347623
+ defaultFocus = _this$props.defaultFocus,
347624
+ props = Tabs_objectWithoutPropertiesLoose(_this$props, Tabs_excluded);
347607
347625
 
347608
- if (selectedIndex != null) {
347609
- subProps.selectedIndex = selectedIndex;
347610
- }
347626
+ var _this$state = this.state,
347627
+ focus = _this$state.focus,
347628
+ selectedIndex = _this$state.selectedIndex;
347629
+ props.focus = focus;
347630
+ props.onSelect = this.handleSelected;
347631
+
347632
+ if (selectedIndex != null) {
347633
+ props.selectedIndex = selectedIndex;
347634
+ }
347635
+
347636
+ return /*#__PURE__*/external_react_["default"].createElement(UncontrolledTabs, props, children);
347637
+ };
347638
+
347639
+ return Tabs;
347640
+ }(external_react_.Component);
347611
347641
 
347612
- delete subProps.defaultFocus;
347613
- delete subProps.defaultIndex;
347614
- delete subProps.focusTabOnClick;
347615
- return /*#__PURE__*/external_react_["default"].createElement(components_UncontrolledTabs, subProps, children);
347642
+ Tabs.defaultProps = {
347643
+ defaultFocus: false,
347644
+ forceRenderTabPanel: false,
347645
+ selectedIndex: null,
347646
+ defaultIndex: null,
347647
+ environment: null,
347648
+ disableUpDownKeys: false
347616
347649
  };
347617
347650
 
347618
347651
  Tabs.propTypes = false ? 0 : {};
347619
- Tabs.defaultProps = Tabs_defaultProps;
347620
347652
  Tabs.tabsRole = 'Tabs';
347621
- /* harmony default export */ const components_Tabs = (Tabs);
347622
347653
  ;// ./node_modules/react-tabs/esm/components/TabList.js
347623
347654
  var TabList_excluded = ["children", "className"];
347624
347655
 
@@ -347626,29 +347657,44 @@ function TabList_extends() { TabList_extends = Object.assign || function (target
347626
347657
 
347627
347658
  function TabList_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
347628
347659
 
347660
+ function TabList_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; TabList_setPrototypeOf(subClass, superClass); }
347629
347661
 
347662
+ function TabList_setPrototypeOf(o, p) { TabList_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TabList_setPrototypeOf(o, p); }
347630
347663
 
347631
347664
 
347632
- var TabList_defaultProps = {
347633
- className: 'react-tabs__tab-list'
347634
- };
347635
- var TabList_propTypes = false ? 0 : {};
347636
347665
 
347637
- var TabList = function TabList(props) {
347638
- var children = props.children,
347639
- className = props.className,
347640
- attributes = TabList_objectWithoutPropertiesLoose(props, TabList_excluded);
347641
347666
 
347642
- return /*#__PURE__*/external_react_["default"].createElement("ul", TabList_extends({}, attributes, {
347643
- className: (0,clsx_m/* default */.A)(className),
347644
- role: "tablist"
347645
- }), children);
347667
+
347668
+ var TabList = /*#__PURE__*/function (_Component) {
347669
+ TabList_inheritsLoose(TabList, _Component);
347670
+
347671
+ function TabList() {
347672
+ return _Component.apply(this, arguments) || this;
347673
+ }
347674
+
347675
+ var _proto = TabList.prototype;
347676
+
347677
+ _proto.render = function render() {
347678
+ var _this$props = this.props,
347679
+ children = _this$props.children,
347680
+ className = _this$props.className,
347681
+ attributes = TabList_objectWithoutPropertiesLoose(_this$props, TabList_excluded);
347682
+
347683
+ return /*#__PURE__*/external_react_["default"].createElement("ul", TabList_extends({}, attributes, {
347684
+ className: (0,clsx_m/* default */.A)(className),
347685
+ role: "tablist"
347686
+ }), children);
347687
+ };
347688
+
347689
+ return TabList;
347690
+ }(external_react_.Component);
347691
+
347692
+ TabList.defaultProps = {
347693
+ className: 'react-tabs__tab-list'
347646
347694
  };
347647
347695
 
347648
- TabList.tabsRole = 'TabList';
347649
347696
  TabList.propTypes = false ? 0 : {};
347650
- TabList.defaultProps = TabList_defaultProps;
347651
- /* harmony default export */ const components_TabList = (TabList);
347697
+ TabList.tabsRole = 'TabList';
347652
347698
  ;// ./node_modules/react-tabs/esm/components/Tab.js
347653
347699
  var Tab_excluded = ["children", "className", "disabled", "disabledClassName", "focus", "id", "panelId", "selected", "selectedClassName", "tabIndex", "tabRef"];
347654
347700
 
@@ -347656,11 +347702,80 @@ function Tab_extends() { Tab_extends = Object.assign || function (target) { for
347656
347702
 
347657
347703
  function Tab_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
347658
347704
 
347705
+ function Tab_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; Tab_setPrototypeOf(subClass, superClass); }
347706
+
347707
+ function Tab_setPrototypeOf(o, p) { Tab_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tab_setPrototypeOf(o, p); }
347708
+
347659
347709
 
347660
347710
 
347661
347711
 
347662
347712
  var DEFAULT_CLASS = 'react-tabs__tab';
347663
- var DEFAULT_PROPS = {
347713
+
347714
+ var Tab = /*#__PURE__*/function (_Component) {
347715
+ Tab_inheritsLoose(Tab, _Component);
347716
+
347717
+ function Tab() {
347718
+ return _Component.apply(this, arguments) || this;
347719
+ }
347720
+
347721
+ var _proto = Tab.prototype;
347722
+
347723
+ _proto.componentDidMount = function componentDidMount() {
347724
+ this.checkFocus();
347725
+ };
347726
+
347727
+ _proto.componentDidUpdate = function componentDidUpdate() {
347728
+ this.checkFocus();
347729
+ };
347730
+
347731
+ _proto.checkFocus = function checkFocus() {
347732
+ var _this$props = this.props,
347733
+ selected = _this$props.selected,
347734
+ focus = _this$props.focus;
347735
+
347736
+ if (selected && focus) {
347737
+ this.node.focus();
347738
+ }
347739
+ };
347740
+
347741
+ _proto.render = function render() {
347742
+ var _cx,
347743
+ _this = this;
347744
+
347745
+ var _this$props2 = this.props,
347746
+ children = _this$props2.children,
347747
+ className = _this$props2.className,
347748
+ disabled = _this$props2.disabled,
347749
+ disabledClassName = _this$props2.disabledClassName,
347750
+ focus = _this$props2.focus,
347751
+ id = _this$props2.id,
347752
+ panelId = _this$props2.panelId,
347753
+ selected = _this$props2.selected,
347754
+ selectedClassName = _this$props2.selectedClassName,
347755
+ tabIndex = _this$props2.tabIndex,
347756
+ tabRef = _this$props2.tabRef,
347757
+ attributes = Tab_objectWithoutPropertiesLoose(_this$props2, Tab_excluded);
347758
+
347759
+ return /*#__PURE__*/external_react_["default"].createElement("li", Tab_extends({}, attributes, {
347760
+ className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx[disabledClassName] = disabled, _cx)),
347761
+ ref: function ref(node) {
347762
+ _this.node = node;
347763
+ if (tabRef) tabRef(node);
347764
+ },
347765
+ role: "tab",
347766
+ id: id,
347767
+ "aria-selected": selected ? 'true' : 'false',
347768
+ "aria-disabled": disabled ? 'true' : 'false',
347769
+ "aria-controls": panelId,
347770
+ tabIndex: tabIndex || (selected ? '0' : null),
347771
+ "data-rttab": true
347772
+ }), children);
347773
+ };
347774
+
347775
+ return Tab;
347776
+ }(external_react_.Component);
347777
+
347778
+ Tab.defaultProps = {
347664
347779
  className: DEFAULT_CLASS,
347665
347780
  disabledClassName: DEFAULT_CLASS + "--disabled",
347666
347781
  focus: false,
@@ -347669,51 +347784,9 @@ var DEFAULT_PROPS = {
347669
347784
  selected: false,
347670
347785
  selectedClassName: DEFAULT_CLASS + "--selected"
347671
347786
  };
347672
- var Tab_propTypes = false ? 0 : {};
347673
-
347674
- var Tab = function Tab(props) {
347675
- var _cx;
347676
-
347677
- var nodeRef = (0,external_react_.useRef)();
347678
-
347679
- var children = props.children,
347680
- className = props.className,
347681
- disabled = props.disabled,
347682
- disabledClassName = props.disabledClassName,
347683
- focus = props.focus,
347684
- id = props.id,
347685
- panelId = props.panelId,
347686
- selected = props.selected,
347687
- selectedClassName = props.selectedClassName,
347688
- tabIndex = props.tabIndex,
347689
- tabRef = props.tabRef,
347690
- attributes = Tab_objectWithoutPropertiesLoose(props, Tab_excluded);
347691
-
347692
- (0,external_react_.useEffect)(function () {
347693
- if (selected && focus) {
347694
- nodeRef.current.focus();
347695
- }
347696
- }, [selected, focus]);
347697
- return /*#__PURE__*/external_react_["default"].createElement("li", Tab_extends({}, attributes, {
347698
- className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx[disabledClassName] = disabled, _cx)),
347699
- ref: function ref(node) {
347700
- nodeRef.current = node;
347701
- if (tabRef) tabRef(node);
347702
- },
347703
- role: "tab",
347704
- id: id,
347705
- "aria-selected": selected ? 'true' : 'false',
347706
- "aria-disabled": disabled ? 'true' : 'false',
347707
- "aria-controls": panelId,
347708
- tabIndex: tabIndex || (selected ? '0' : null),
347709
- "data-rttab": true
347710
- }), children);
347711
- };
347712
347787
 
347713
347788
  Tab.propTypes = false ? 0 : {};
347714
347789
  Tab.tabsRole = 'Tab';
347715
- Tab.defaultProps = DEFAULT_PROPS;
347716
- /* harmony default export */ const components_Tab = (Tab);
347717
347790
  ;// ./node_modules/react-tabs/esm/components/TabPanel.js
347718
347791
  var TabPanel_excluded = ["children", "className", "forceRender", "id", "selected", "selectedClassName", "tabId"];
347719
347792
 
@@ -347721,41 +347794,56 @@ function TabPanel_extends() { TabPanel_extends = Object.assign || function (targ
347721
347794
 
347722
347795
  function TabPanel_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
347723
347796
 
347797
+ function TabPanel_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; TabPanel_setPrototypeOf(subClass, superClass); }
347798
+
347799
+ function TabPanel_setPrototypeOf(o, p) { TabPanel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TabPanel_setPrototypeOf(o, p); }
347800
+
347724
347801
 
347725
347802
 
347726
347803
 
347727
347804
  var TabPanel_DEFAULT_CLASS = 'react-tabs__tab-panel';
347728
- var TabPanel_defaultProps = {
347729
- className: TabPanel_DEFAULT_CLASS,
347730
- forceRender: false,
347731
- selectedClassName: TabPanel_DEFAULT_CLASS + "--selected"
347732
- };
347733
- var TabPanel_propTypes = false ? 0 : {};
347734
347805
 
347735
- var TabPanel = function TabPanel(props) {
347736
- var _cx;
347806
+ var TabPanel = /*#__PURE__*/function (_Component) {
347807
+ TabPanel_inheritsLoose(TabPanel, _Component);
347737
347808
 
347738
- var children = props.children,
347739
- className = props.className,
347740
- forceRender = props.forceRender,
347741
- id = props.id,
347742
- selected = props.selected,
347743
- selectedClassName = props.selectedClassName,
347744
- tabId = props.tabId,
347745
- attributes = TabPanel_objectWithoutPropertiesLoose(props, TabPanel_excluded);
347809
+ function TabPanel() {
347810
+ return _Component.apply(this, arguments) || this;
347811
+ }
347812
+
347813
+ var _proto = TabPanel.prototype;
347814
+
347815
+ _proto.render = function render() {
347816
+ var _cx;
347817
+
347818
+ var _this$props = this.props,
347819
+ children = _this$props.children,
347820
+ className = _this$props.className,
347821
+ forceRender = _this$props.forceRender,
347822
+ id = _this$props.id,
347823
+ selected = _this$props.selected,
347824
+ selectedClassName = _this$props.selectedClassName,
347825
+ tabId = _this$props.tabId,
347826
+ attributes = TabPanel_objectWithoutPropertiesLoose(_this$props, TabPanel_excluded);
347827
+
347828
+ return /*#__PURE__*/external_react_["default"].createElement("div", TabPanel_extends({}, attributes, {
347829
+ className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx)),
347830
+ role: "tabpanel",
347831
+ id: id,
347832
+ "aria-labelledby": tabId
347833
+ }), forceRender || selected ? children : null);
347834
+ };
347835
+
347836
+ return TabPanel;
347837
+ }(external_react_.Component);
347746
347838
 
347747
- return /*#__PURE__*/external_react_["default"].createElement("div", TabPanel_extends({}, attributes, {
347748
- className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx)),
347749
- role: "tabpanel",
347750
- id: id,
347751
- "aria-labelledby": tabId
347752
- }), forceRender || selected ? children : null);
347839
+ TabPanel.defaultProps = {
347840
+ className: TabPanel_DEFAULT_CLASS,
347841
+ forceRender: false,
347842
+ selectedClassName: TabPanel_DEFAULT_CLASS + "--selected"
347753
347843
  };
347754
347844
 
347755
- TabPanel.tabsRole = 'TabPanel';
347756
347845
  TabPanel.propTypes = false ? 0 : {};
347757
- TabPanel.defaultProps = TabPanel_defaultProps;
347758
- /* harmony default export */ const components_TabPanel = (TabPanel);
347846
+ TabPanel.tabsRole = 'TabPanel';
347759
347847
  ;// ./node_modules/react-tabs/esm/index.js
347760
347848
 
347761
347849
 
@@ -369736,7 +369824,9 @@ const resolveAbsolutePath = (importPath, basePath) => {
369736
369824
  // Handle relative imports (./ or ../)
369737
369825
  if (basePath &&
369738
369826
  (importPath.startsWith("./") || importPath.startsWith("../"))) {
369739
- return path_1.default.normalize(path_1.default.join(path_1.default.dirname(basePath), importPath));
369827
+ // Project paths are virtual POSIX paths — use posix semantics explicitly,
369828
+ // for same behavior of tests on all of the OS
369829
+ return path_1.default.posix.normalize(path_1.default.posix.join(path_1.default.posix.dirname(basePath), importPath));
369740
369830
  }
369741
369831
  // Bare imports (can be handled as external packages in future)
369742
369832
  console.error(`Could not resolve import path: ${importPath}. Bare imports are not supported. Use relative ('./' or '../') or absolute ('/') paths.`);
@@ -370317,6 +370407,16 @@ const useHtmlRunner = () => {
370317
370407
  // Using BroadcastChannel to communicate between the main app and the preview tab
370318
370408
  const broadcastChannel = (0, react_1.useRef)(null);
370319
370409
  const shouldUseBrowserHistoryRef = (0, react_1.useRef)(false);
370410
+ // True once runCode has written preview content into the current iframe;
370411
+ // reset at the start of every run. Let's iframeReload tell an expected
370412
+ // about:blank load (fresh iframe) apart from a history-restored blank.
370413
+ const hasWrittenContentRef = (0, react_1.useRef)(false);
370414
+ // Set when the next run is caused by a browser history traversal (Back /
370415
+ // Forward): it must write into the existing iframe instead of recreating
370416
+ // it, because replacing the iframe drops its session history entries and
370417
+ // the Forward button would lose e.g. an external page visited from the
370418
+ // preview.
370419
+ const restoreInPlaceRef = (0, react_1.useRef)(false);
370320
370420
  const currentPageParam = searchParams.get("page");
370321
370421
  const isPreviewUrl = isPreviewSearch(searchParams);
370322
370422
  // In the standalone preview tab (and any ?preview=1 URL) the browser's
@@ -370395,6 +370495,9 @@ const useHtmlRunner = () => {
370395
370495
  if (!pageFromUrl)
370396
370496
  return;
370397
370497
  const normalizedPage = (0, projectPath_1.normalizePath)(pageFromUrl);
370498
+ // History traversal: render into the existing iframe so its own
370499
+ // history entries (e.g. an external page ahead of us) survive.
370500
+ restoreInPlaceRef.current = true;
370398
370501
  dispatch((0, EditorSlice_1.setPage)(normalizedPage));
370399
370502
  dispatch((0, EditorSlice_1.triggerCodeRun)());
370400
370503
  };
@@ -370440,6 +370543,17 @@ const useHtmlRunner = () => {
370440
370543
  const iframeReload = () => {
370441
370544
  const iframe = output.current?.contentDocument;
370442
370545
  const filePath = (0, helpers_1.getFilenameFromIFrame)(iframe);
370546
+ // The iframe navigated away (e.g. an external link) and came back via the
370547
+ // browser Back button: the browser restores about:blank, not the
370548
+ // doc.write() content. Re-run the current page. Written preview
370549
+ // content always carries meta[filename], so a same-origin document without
370550
+ // it after a completed run can only be a restored blank.
370551
+ if (iframe && !filePath && hasWrittenContentRef.current) {
370552
+ hasWrittenContentRef.current = false;
370553
+ restoreInPlaceRef.current = true;
370554
+ dispatch((0, EditorSlice_1.triggerCodeRun)());
370555
+ return;
370556
+ }
370443
370557
  if (runningFilePath !== filePath) {
370444
370558
  setRunningFilePath(filePath);
370445
370559
  }
@@ -370456,7 +370570,9 @@ const useHtmlRunner = () => {
370456
370570
  if (href?.includes(".html")) {
370457
370571
  e.preventDefault();
370458
370572
  e.stopImmediatePropagation();
370459
- openPreview(`/${href}`);
370573
+ // normalizePath avoids "//about.html" for hrefs that already
370574
+ // start with "/" and adds the leading slash for relative ones
370575
+ openPreview((0, projectPath_1.normalizePath)(href));
370460
370576
  }
370461
370577
  }, true);
370462
370578
  });
@@ -370469,8 +370585,17 @@ const useHtmlRunner = () => {
370469
370585
  (0, react_1.useEffect)(() => {
370470
370586
  if (!codeRunTriggered)
370471
370587
  return;
370472
- // Fresh iframe for each run (clean slate); it persists across view switches
370473
- createIframe();
370588
+ hasWrittenContentRef.current = false;
370589
+ if (restoreInPlaceRef.current) {
370590
+ // Restoring after browser Back from an external page: write into the
370591
+ // restored (already blank, fresh-window) document so the iframe's
370592
+ // forward history entry survives and the Forward button still works.
370593
+ restoreInPlaceRef.current = false;
370594
+ }
370595
+ else {
370596
+ // Fresh iframe for each run (clean slate); it persists across view switches
370597
+ createIframe();
370598
+ }
370474
370599
  runCode();
370475
370600
  if (!isPreviewMode) {
370476
370601
  broadcastChannel.current?.postMessage({
@@ -370518,6 +370643,7 @@ const useHtmlRunner = () => {
370518
370643
  doc.open();
370519
370644
  doc.write(content);
370520
370645
  doc.close();
370646
+ hasWrittenContentRef.current = true;
370521
370647
  }
370522
370648
  if (codeRunTriggered) {
370523
370649
  dispatch((0, EditorSlice_1.codeRunHandled)());
@@ -374158,28 +374284,54 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
374158
374284
  Object.defineProperty(exports, "__esModule", ({ value: true }));
374159
374285
  exports.ViewSwitcher = void 0;
374160
374286
  const jsx_runtime_1 = __webpack_require__(74848);
374161
- const classnames_1 = __importDefault(__webpack_require__(46942));
374162
- const Button_1 = __importDefault(__webpack_require__(79428));
374163
- const SvgIcon_1 = __webpack_require__(82917);
374164
374287
  const layout_2_svg_1 = __importDefault(__webpack_require__(43064));
374165
374288
  const layout_3_svg_1 = __importDefault(__webpack_require__(47305));
374166
374289
  const layout_svg_1 = __importDefault(__webpack_require__(60497));
374290
+ const SvgIcon_1 = __webpack_require__(82917);
374291
+ const react_1 = __webpack_require__(51649);
374167
374292
  const react_redux_1 = __webpack_require__(14062);
374168
- const stores_1 = __webpack_require__(32132);
374169
374293
  const EditorSlice_1 = __webpack_require__(68512);
374294
+ const stores_1 = __webpack_require__(32132);
374170
374295
  const types_1 = __webpack_require__(92932);
374296
+ const ViewSwitcherButton_1 = __webpack_require__(62719);
374171
374297
  const styles_module_scss_1 = __importDefault(__webpack_require__(10866));
374172
374298
  const ViewSwitcher = () => {
374173
374299
  const dispatch = (0, react_redux_1.useDispatch)();
374174
374300
  const viewMode = (0, stores_1.useAppSelector)((state) => state.editor.viewMode);
374175
374301
  const isCodeVisible = (0, stores_1.useAppSelector)((state) => state.editor.isCodeVisible);
374176
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.viewSwitcher, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { className: (0, classnames_1.default)(styles_module_scss_1.default.viewSwitcherBtn, viewMode !== types_1.ViewMode.FULL_WINDOW && styles_module_scss_1.default.viewSwitcherBtnActive), ButtonIcon: isCodeVisible
374302
+ const handleSplitViewClick = (0, react_1.useCallback)(() => dispatch((0, EditorSlice_1.setViewMode)(isCodeVisible ? types_1.ViewMode.THREE_WINDOW : types_1.ViewMode.TWO_WINDOW)), [dispatch, isCodeVisible]);
374303
+ const handleFullWindowClick = (0, react_1.useCallback)(() => dispatch((0, EditorSlice_1.setViewMode)(types_1.ViewMode.FULL_WINDOW)), [dispatch]);
374304
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.viewSwitcher, children: [(0, jsx_runtime_1.jsx)(ViewSwitcherButton_1.ViewSwitcherButton, { label: "Split view", tooltip: "Switch to Split View", isActive: viewMode !== types_1.ViewMode.FULL_WINDOW, ButtonIcon: isCodeVisible
374177
374305
  ? () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: layout_3_svg_1.default, size: 24 })
374178
- : () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: layout_2_svg_1.default, size: 24 }), label: "Split view", variant: "tertiary", onClickHandler: () => dispatch((0, EditorSlice_1.setViewMode)(isCodeVisible ? types_1.ViewMode.THREE_WINDOW : types_1.ViewMode.TWO_WINDOW)) }), (0, jsx_runtime_1.jsx)(Button_1.default, { className: (0, classnames_1.default)(styles_module_scss_1.default.viewSwitcherBtn, viewMode === types_1.ViewMode.FULL_WINDOW && styles_module_scss_1.default.viewSwitcherBtnActive), ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: layout_svg_1.default, size: 24 }), label: "Full window view", variant: "tertiary", onClickHandler: () => dispatch((0, EditorSlice_1.setViewMode)(types_1.ViewMode.FULL_WINDOW)) })] }));
374306
+ : () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: layout_2_svg_1.default, size: 24 }), onClick: handleSplitViewClick }), (0, jsx_runtime_1.jsx)(ViewSwitcherButton_1.ViewSwitcherButton, { label: "Full window view", tooltip: "Switch to Full Screen", isActive: viewMode === types_1.ViewMode.FULL_WINDOW, ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: layout_svg_1.default, size: 24 }), onClick: handleFullWindowClick })] }));
374179
374307
  };
374180
374308
  exports.ViewSwitcher = ViewSwitcher;
374181
374309
 
374182
374310
 
374311
+ /***/ }),
374312
+
374313
+ /***/ 62719:
374314
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
374315
+
374316
+
374317
+ var __importDefault = (this && this.__importDefault) || function (mod) {
374318
+ return (mod && mod.__esModule) ? mod : { "default": mod };
374319
+ };
374320
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
374321
+ exports.ViewSwitcherButton = void 0;
374322
+ const jsx_runtime_1 = __webpack_require__(74848);
374323
+ const classnames_1 = __importDefault(__webpack_require__(46942));
374324
+ const Button_1 = __importDefault(__webpack_require__(79428));
374325
+ const Tooltip_1 = __importDefault(__webpack_require__(26982));
374326
+ const useHover_1 = __webpack_require__(78556);
374327
+ const styles_module_scss_1 = __importDefault(__webpack_require__(10866));
374328
+ const ViewSwitcherButton = ({ ButtonIcon, label, tooltip, isActive, onClick, }) => {
374329
+ const { hovered, hoverProps } = (0, useHover_1.useHover)();
374330
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.viewSwitcherBtnWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { className: (0, classnames_1.default)(styles_module_scss_1.default.viewSwitcherBtn, isActive && styles_module_scss_1.default.viewSwitcherBtnActive), ButtonIcon: ButtonIcon, label: label, variant: "tertiary", onClickHandler: onClick }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: tooltip, visible: hovered, position: "bottom", size: "fit" })] }));
374331
+ };
374332
+ exports.ViewSwitcherButton = ViewSwitcherButton;
374333
+
374334
+
374183
374335
  /***/ }),
374184
374336
 
374185
374337
  /***/ 15591: