gwchq-textjam 0.3.3 → 0.3.4
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/assets/pyodide-stdin-sw.js +7 -0
- package/dist/index.js +819 -612
- package/dist/style.css +9 -11
- package/package.json +1 -1
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
|
|
68496
|
-
/* harmony import */ var
|
|
68495
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89379);
|
|
68496
|
+
/* harmony import */ var _Users_valeriya_projects_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);
|
|
@@ -68513,7 +68513,7 @@ var DraggableTab = _ref => {
|
|
|
68513
68513
|
fileIndex,
|
|
68514
68514
|
onTabClick
|
|
68515
68515
|
} = _ref,
|
|
68516
|
-
otherProps = (0,
|
|
68516
|
+
otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(_ref, _excluded);
|
|
68517
68517
|
var openedTabs = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedTabs);
|
|
68518
68518
|
var openFilesCount = openedTabs.filter(t => t && t.type === "file").length || 1;
|
|
68519
68519
|
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
@@ -68531,7 +68531,7 @@ var DraggableTab = _ref => {
|
|
|
68531
68531
|
switchToFileTab((fileIndex + openFilesCount - 1) % openFilesCount);
|
|
68532
68532
|
}
|
|
68533
68533
|
};
|
|
68534
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Tabs_DraggableTabWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], (0,
|
|
68534
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Tabs_DraggableTabWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)({
|
|
68535
68535
|
draggableId: "draggable".concat(fileIndex),
|
|
68536
68536
|
index: fileIndex,
|
|
68537
68537
|
onClick: e => {
|
|
@@ -68555,8 +68555,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68555
68555
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68556
68556
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68557
68557
|
/* harmony export */ });
|
|
68558
|
-
/* harmony import */ var
|
|
68559
|
-
/* harmony import */ var
|
|
68558
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
|
|
68559
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
|
|
68560
68560
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68561
68561
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
|
|
68562
68562
|
/* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
|
|
@@ -68575,8 +68575,8 @@ var DroppableTabList = _ref => {
|
|
|
68575
68575
|
children: _children,
|
|
68576
68576
|
index
|
|
68577
68577
|
} = _ref,
|
|
68578
|
-
otherProps = (0,
|
|
68579
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,
|
|
68578
|
+
otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
|
|
68579
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
|
|
68580
68580
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
|
|
68581
68581
|
direction: "horizontal",
|
|
68582
68582
|
droppableId: index.toString(),
|
|
@@ -68586,7 +68586,7 @@ var DroppableTabList = _ref => {
|
|
|
68586
68586
|
droppableProps,
|
|
68587
68587
|
placeholder
|
|
68588
68588
|
} = _ref2;
|
|
68589
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,
|
|
68589
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
|
|
68590
68590
|
className: "droppable-tab-list"
|
|
68591
68591
|
}, droppableProps), {}, {
|
|
68592
68592
|
ref: innerRef,
|
|
@@ -103159,7 +103159,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
103159
103159
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
103160
103160
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
103161
103161
|
/* harmony export */ });
|
|
103162
|
-
/* harmony import */ var
|
|
103162
|
+
/* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
103163
103163
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
103164
103164
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
103165
103165
|
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
|
|
@@ -103273,7 +103273,7 @@ var ProjectName = _ref => {
|
|
|
103273
103273
|
id: "project_name_label",
|
|
103274
103274
|
className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
|
|
103275
103275
|
children: "Project Name"
|
|
103276
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,
|
|
103276
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
103277
103277
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
|
|
103278
103278
|
}, hoverProps), {}, {
|
|
103279
103279
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
|
|
@@ -103654,7 +103654,7 @@ var SaveButton = props => {
|
|
|
103654
103654
|
}, hoverProps), {}, {
|
|
103655
103655
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)((Tooltip_default()), {
|
|
103656
103656
|
message: DEFAULT_TOOLTIP + (hasChangesToSave ? "" : "\n" + NO_CHANGES_TO_SAVE_MESSAGE),
|
|
103657
|
-
visible: hovered,
|
|
103657
|
+
visible: hovered && !hasChangesToSave,
|
|
103658
103658
|
position: "bottom"
|
|
103659
103659
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], (0,objectSpread2/* default */.A)({
|
|
103660
103660
|
buttonText: buttonText,
|
|
@@ -107294,50 +107294,6 @@ var _excluded = ["children", "defaultWidth", "defaultHeight", "handleDirection",
|
|
|
107294
107294
|
|
|
107295
107295
|
|
|
107296
107296
|
|
|
107297
|
-
var VerticalHandle = _ref => {
|
|
107298
|
-
var {
|
|
107299
|
-
className
|
|
107300
|
-
} = _ref;
|
|
107301
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
|
|
107302
|
-
"data-testid": "verticalHandle",
|
|
107303
|
-
width: "44",
|
|
107304
|
-
height: "56",
|
|
107305
|
-
viewBox: "0 0 44 56",
|
|
107306
|
-
fill: "none",
|
|
107307
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
107308
|
-
className: className,
|
|
107309
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("rect", {
|
|
107310
|
-
x: "20",
|
|
107311
|
-
width: "4",
|
|
107312
|
-
height: "56",
|
|
107313
|
-
rx: "2",
|
|
107314
|
-
fill: "#616575"
|
|
107315
|
-
})
|
|
107316
|
-
});
|
|
107317
|
-
};
|
|
107318
|
-
var HorizontalHandle = _ref2 => {
|
|
107319
|
-
var {
|
|
107320
|
-
className
|
|
107321
|
-
} = _ref2;
|
|
107322
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)("svg", {
|
|
107323
|
-
"data-testid": "horizontalHandle",
|
|
107324
|
-
width: "56",
|
|
107325
|
-
height: "44",
|
|
107326
|
-
viewBox: "0 0 56 44",
|
|
107327
|
-
fill: "none",
|
|
107328
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
107329
|
-
className: className,
|
|
107330
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("rect", {
|
|
107331
|
-
x: "56",
|
|
107332
|
-
y: "20",
|
|
107333
|
-
width: "4",
|
|
107334
|
-
height: "56",
|
|
107335
|
-
rx: "2",
|
|
107336
|
-
transform: "rotate(90 56 20)",
|
|
107337
|
-
fill: "#616575"
|
|
107338
|
-
})
|
|
107339
|
-
});
|
|
107340
|
-
};
|
|
107341
107297
|
var ResizableWithHandle = props => {
|
|
107342
107298
|
var {
|
|
107343
107299
|
children,
|
|
@@ -107352,22 +107308,13 @@ var ResizableWithHandle = props => {
|
|
|
107352
107308
|
(0,external_react_.useMemo)(() => setWidth(defaultWidth), [defaultWidth]);
|
|
107353
107309
|
(0,external_react_.useMemo)(() => setHeight(defaultHeight), [defaultHeight]);
|
|
107354
107310
|
var onResizeStop = function onResizeStop() {
|
|
107355
|
-
for (var _len = arguments.length,
|
|
107356
|
-
|
|
107311
|
+
for (var _len = arguments.length, _ref = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
107312
|
+
_ref[_key] = arguments[_key];
|
|
107357
107313
|
}
|
|
107358
|
-
var [,,, d] =
|
|
107314
|
+
var [,,, d] = _ref;
|
|
107359
107315
|
setWidth(width + d.width);
|
|
107360
107316
|
setHeight(height + d.height);
|
|
107361
107317
|
};
|
|
107362
|
-
var handleComponent = ["right", "left"].includes(handleDirection) ? {
|
|
107363
|
-
[handleDirection]: /*#__PURE__*/(0,jsx_runtime.jsx)(VerticalHandle, {
|
|
107364
|
-
className: handleClassName
|
|
107365
|
-
})
|
|
107366
|
-
} : ["top", "bottom"].includes(handleDirection) ? {
|
|
107367
|
-
[handleDirection]: /*#__PURE__*/(0,jsx_runtime.jsx)(HorizontalHandle, {
|
|
107368
|
-
className: handleClassName
|
|
107369
|
-
})
|
|
107370
|
-
} : {};
|
|
107371
107318
|
var handleWrapperClass = "resizable-with-handle__handle resizable-with-handle__handle--".concat(handleDirection);
|
|
107372
107319
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(Resizable, (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({
|
|
107373
107320
|
enable: (0,objectSpread2/* default */.A)({
|
|
@@ -107378,7 +107325,6 @@ var ResizableWithHandle = props => {
|
|
|
107378
107325
|
}, {
|
|
107379
107326
|
[handleDirection]: true
|
|
107380
107327
|
}),
|
|
107381
|
-
handleComponent: handleComponent,
|
|
107382
107328
|
handleWrapperClass: handleWrapperClass,
|
|
107383
107329
|
onResizeStop: onResizeStop,
|
|
107384
107330
|
size: {
|
|
@@ -107386,9 +107332,13 @@ var ResizableWithHandle = props => {
|
|
|
107386
107332
|
height: height
|
|
107387
107333
|
},
|
|
107388
107334
|
handleStyles: {
|
|
107335
|
+
top: {
|
|
107336
|
+
top: "-9px"
|
|
107337
|
+
},
|
|
107389
107338
|
right: {
|
|
107390
107339
|
height: "96%",
|
|
107391
|
-
top: "2%"
|
|
107340
|
+
top: "2%",
|
|
107341
|
+
marginRight: "-12px"
|
|
107392
107342
|
}
|
|
107393
107343
|
},
|
|
107394
107344
|
handleClasses: handleClassName
|
|
@@ -143077,7 +143027,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143077
143027
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
143078
143028
|
/* harmony export */ });
|
|
143079
143029
|
// extracted by mini-css-extract-plugin
|
|
143080
|
-
/* 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","pythonrunnerContainer":"styles-module__pythonrunnerContainer---nPGz","outputStackContainer":"styles-module__outputStackContainer--7Y14r","resizeHandleContainer":"styles-module__resizeHandleContainer--FID6p","console":"styles-module__console--B8x1A","pythonGraphic":"styles-module__pythonGraphic--V+du6","pyodiderunner":"styles-module__pyodiderunner--DKTtB","active":"styles-module__active--bKVnT","visualOutput":"styles-module__visualOutput--WLaca","outputPanel":"styles-module__outputPanel--W1TnW","pythonConsoleLine":"styles-module__pythonConsoleLine--bwFQC","stderr":"styles-module__stderr--PIyhL","pythonrunnerInput":"styles-module__pythonrunnerInput--dOXEa","webConsole":"styles-module__webConsole--MTdnk","webConsoleLine":"styles-module__webConsoleLine--j31U1","consoleMessageContent":"styles-module__consoleMessageContent--vXp1a","consoleMessageInline":"styles-module__consoleMessageInline--5pNbC","consoleCount":"styles-module__consoleCount--JLMn5","string":"styles-module__string--YDxWc","stringInsideStructure":"styles-module__stringInsideStructure--KJtZp","number":"styles-module__number--7h5TG","boolean":"styles-module__boolean--WYb4I","null":"styles-module__null--BZCmR","undefined":"styles-module__undefined--nQkol","key":"styles-module__key--ZZTlD","error":"styles-module__error--RL5Lt","errorIcon":"styles-module__errorIcon--Gnn4-","warn":"styles-module__warn--B+MPR","warnIcon":"styles-module__warnIcon--Q82Y5","timestamp":"styles-module__timestamp--HDZxD","details":"styles-module__details--W1bGT","summary":"styles-module__summary--vms5d","nestedEntry":"styles-module__nestedEntry--OU25X","previewLink":"styles-module__previewLink--rWLII","visualPanePadding":"styles-module__visualPanePadding--ytRHn","iframe":"styles-module__iframe--YfQ0V","codeHasBeenRun":"styles-module__codeHasBeenRun--fqiYL"});
|
|
143030
|
+
/* 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","pythonrunnerContainer":"styles-module__pythonrunnerContainer---nPGz","outputStackContainer":"styles-module__outputStackContainer--7Y14r","resizeHandleContainer":"styles-module__resizeHandleContainer--FID6p","console":"styles-module__console--B8x1A","consoleMount":"styles-module__consoleMount--1BJWe","pythonGraphic":"styles-module__pythonGraphic--V+du6","pyodiderunner":"styles-module__pyodiderunner--DKTtB","active":"styles-module__active--bKVnT","visualOutput":"styles-module__visualOutput--WLaca","outputPanel":"styles-module__outputPanel--W1TnW","pythonConsoleLine":"styles-module__pythonConsoleLine--bwFQC","stderr":"styles-module__stderr--PIyhL","pythonrunnerInput":"styles-module__pythonrunnerInput--dOXEa","webConsole":"styles-module__webConsole--MTdnk","webConsoleLine":"styles-module__webConsoleLine--j31U1","consoleMessageContent":"styles-module__consoleMessageContent--vXp1a","consoleMessageInline":"styles-module__consoleMessageInline--5pNbC","consoleCount":"styles-module__consoleCount--JLMn5","string":"styles-module__string--YDxWc","stringInsideStructure":"styles-module__stringInsideStructure--KJtZp","number":"styles-module__number--7h5TG","boolean":"styles-module__boolean--WYb4I","null":"styles-module__null--BZCmR","undefined":"styles-module__undefined--nQkol","key":"styles-module__key--ZZTlD","error":"styles-module__error--RL5Lt","errorIcon":"styles-module__errorIcon--Gnn4-","warn":"styles-module__warn--B+MPR","warnIcon":"styles-module__warnIcon--Q82Y5","timestamp":"styles-module__timestamp--HDZxD","details":"styles-module__details--W1bGT","summary":"styles-module__summary--vms5d","nestedEntry":"styles-module__nestedEntry--OU25X","previewLink":"styles-module__previewLink--rWLII","visualPanePadding":"styles-module__visualPanePadding--ytRHn","iframe":"styles-module__iframe--YfQ0V","codeHasBeenRun":"styles-module__codeHasBeenRun--fqiYL","previewSlot":"styles-module__previewSlot--V8txy","previewHost":"styles-module__previewHost--20-DL"});
|
|
143081
143031
|
|
|
143082
143032
|
/***/ }),
|
|
143083
143033
|
|
|
@@ -143245,7 +143195,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143245
143195
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
143246
143196
|
/* harmony export */ });
|
|
143247
143197
|
// extracted by mini-css-extract-plugin
|
|
143248
|
-
/* 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","wrapper":"styles-module__wrapper--NmEQI","header":"styles-module__header--UkMi-","headerBtn":"styles-module__headerBtn--kUJII","gwcLogo":"styles-module__gwcLogo--svs9k","textJamLogo":"styles-module__textJamLogo--dZcnz","btnSvg":"styles-module__btnSvg--Ri2uZ","projectName":"styles-module__projectName--6o3NT","linkButton":"styles-module__linkButton--bj6aP","sharedProject":"styles-module__sharedProject--baj0W","remixBtnContent":"styles-module__remixBtnContent--sJf5m"});
|
|
143198
|
+
/* 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","wrapper":"styles-module__wrapper--NmEQI","tooltipAnchor":"styles-module__tooltipAnchor--nyFj4","header":"styles-module__header--UkMi-","headerBtn":"styles-module__headerBtn--kUJII","gwcLogo":"styles-module__gwcLogo--svs9k","textJamLogo":"styles-module__textJamLogo--dZcnz","btnSvg":"styles-module__btnSvg--Ri2uZ","projectName":"styles-module__projectName--6o3NT","linkButton":"styles-module__linkButton--bj6aP","sharedProject":"styles-module__sharedProject--baj0W","remixBtnContent":"styles-module__remixBtnContent--sJf5m"});
|
|
143249
143199
|
|
|
143250
143200
|
/***/ }),
|
|
143251
143201
|
|
|
@@ -143316,7 +143266,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143316
143266
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
143317
143267
|
/* harmony export */ });
|
|
143318
143268
|
// extracted by mini-css-extract-plugin
|
|
143319
|
-
/* 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","toastContainer":"styles-module__toastContainer--SzERA","toastMessage":"styles-module__toastMessage--5Ze6a","errorIcon":"styles-module__errorIcon--v90W6","successIcon":"styles-module__successIcon--gCtAd","closeIcon":"styles-module__closeIcon--iZ9ey","infoIcon":"styles-module__infoIcon--tva-x"});
|
|
143269
|
+
/* 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","toastContainer":"styles-module__toastContainer--SzERA","toastMessage":"styles-module__toastMessage--5Ze6a","errorIcon":"styles-module__errorIcon--v90W6","successIcon":"styles-module__successIcon--gCtAd","closeIcon":"styles-module__closeIcon--iZ9ey","toastList":"styles-module__toastList--7K4rT","toast":"styles-module__toast--LJOJf","toastBody":"styles-module__toastBody--0iN2Q","infoIcon":"styles-module__infoIcon--tva-x"});
|
|
143320
143270
|
|
|
143321
143271
|
/***/ }),
|
|
143322
143272
|
|
|
@@ -143328,7 +143278,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143328
143278
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
143329
143279
|
/* harmony export */ });
|
|
143330
143280
|
// extracted by mini-css-extract-plugin
|
|
143331
|
-
/* 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","tooltip":"styles-module__tooltip--7XFyr","visible":"styles-module__visible--wGPCM","position-bottom":"styles-module__position-bottom--Lwi+l","position-fixed":"styles-module__position-fixed--t8yrP"});
|
|
143281
|
+
/* 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","tooltip":"styles-module__tooltip--7XFyr","visible":"styles-module__visible--wGPCM","position-bottom":"styles-module__position-bottom--Lwi+l","position-bottom-right":"styles-module__position-bottom-right--SMrip","position-fixed":"styles-module__position-fixed--t8yrP","size-default":"styles-module__size-default--B+ZT4","size-fit":"styles-module__size-fit--ZW8rV"});
|
|
143332
143282
|
|
|
143333
143283
|
/***/ }),
|
|
143334
143284
|
|
|
@@ -347011,10 +346961,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
347011
346961
|
|
|
347012
346962
|
// EXPORTS
|
|
347013
346963
|
__webpack_require__.d(__webpack_exports__, {
|
|
347014
|
-
Tab: () => (/* reexport */
|
|
347015
|
-
TabList: () => (/* reexport */
|
|
347016
|
-
TabPanel: () => (/* reexport */
|
|
347017
|
-
Tabs: () => (/* reexport */
|
|
346964
|
+
Tab: () => (/* reexport */ components_Tab),
|
|
346965
|
+
TabList: () => (/* reexport */ components_TabList),
|
|
346966
|
+
TabPanel: () => (/* reexport */ components_TabPanel),
|
|
346967
|
+
Tabs: () => (/* reexport */ components_Tabs),
|
|
347018
346968
|
resetIdCounter: () => (/* reexport */ uuid_reset)
|
|
347019
346969
|
});
|
|
347020
346970
|
|
|
@@ -347163,13 +347113,6 @@ function count_getTabsCount(children) {
|
|
|
347163
347113
|
});
|
|
347164
347114
|
return tabCount;
|
|
347165
347115
|
}
|
|
347166
|
-
function count_getPanelsCount(children) {
|
|
347167
|
-
var panelCount = 0;
|
|
347168
|
-
childrenDeepMap_deepForEach(children, function (child) {
|
|
347169
|
-
if (elementTypes_isTabPanel(child)) panelCount++;
|
|
347170
|
-
});
|
|
347171
|
-
return panelCount;
|
|
347172
|
-
}
|
|
347173
347116
|
;// ./node_modules/react-tabs/esm/components/UncontrolledTabs.js
|
|
347174
347117
|
var _excluded = ["children", "className", "disabledTabClassName", "domRef", "focus", "forceRenderTabPanel", "onSelect", "selectedIndex", "selectedTabClassName", "selectedTabPanelClassName", "environment", "disableUpDownKeys"];
|
|
347175
347118
|
|
|
@@ -347177,10 +347120,6 @@ function UncontrolledTabs_extends() { UncontrolledTabs_extends = Object.assign |
|
|
|
347177
347120
|
|
|
347178
347121
|
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; }
|
|
347179
347122
|
|
|
347180
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
347181
|
-
|
|
347182
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
347183
|
-
|
|
347184
347123
|
|
|
347185
347124
|
|
|
347186
347125
|
|
|
@@ -347216,219 +347155,135 @@ function determineCanUseActiveElement(environment) {
|
|
|
347216
347155
|
// Refer to the following resources:
|
|
347217
347156
|
// http://stackoverflow.com/a/10982960/369687
|
|
347218
347157
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12733599
|
|
347158
|
+
// istanbul ignore next
|
|
347219
347159
|
canUseActiveElement = false;
|
|
347220
347160
|
}
|
|
347221
347161
|
}
|
|
347222
347162
|
|
|
347223
|
-
var
|
|
347224
|
-
|
|
347225
|
-
|
|
347226
|
-
|
|
347227
|
-
|
|
347228
|
-
|
|
347229
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
347230
|
-
args[_key] = arguments[_key];
|
|
347231
|
-
}
|
|
347232
|
-
|
|
347233
|
-
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
347234
|
-
_this.tabNodes = [];
|
|
347235
|
-
|
|
347236
|
-
_this.handleKeyDown = function (e) {
|
|
347237
|
-
var _this$props = _this.props,
|
|
347238
|
-
direction = _this$props.direction,
|
|
347239
|
-
disableUpDownKeys = _this$props.disableUpDownKeys;
|
|
347240
|
-
|
|
347241
|
-
if (_this.isTabFromContainer(e.target)) {
|
|
347242
|
-
var index = _this.props.selectedIndex;
|
|
347243
|
-
var preventDefault = false;
|
|
347244
|
-
var useSelectedIndex = false;
|
|
347245
|
-
|
|
347246
|
-
if (e.keyCode === 32 || e.keyCode === 13) {
|
|
347247
|
-
preventDefault = true;
|
|
347248
|
-
useSelectedIndex = false;
|
|
347249
|
-
|
|
347250
|
-
_this.handleClick(e);
|
|
347251
|
-
}
|
|
347252
|
-
|
|
347253
|
-
if (e.keyCode === 37 || !disableUpDownKeys && e.keyCode === 38) {
|
|
347254
|
-
// Select next tab to the left, validate if up arrow is not disabled
|
|
347255
|
-
if (direction === 'rtl') {
|
|
347256
|
-
index = _this.getNextTab(index);
|
|
347257
|
-
} else {
|
|
347258
|
-
index = _this.getPrevTab(index);
|
|
347259
|
-
}
|
|
347260
|
-
|
|
347261
|
-
preventDefault = true;
|
|
347262
|
-
useSelectedIndex = true;
|
|
347263
|
-
} else if (e.keyCode === 39 || !disableUpDownKeys && e.keyCode === 40) {
|
|
347264
|
-
// Select next tab to the right, validate if down arrow is not disabled
|
|
347265
|
-
if (direction === 'rtl') {
|
|
347266
|
-
index = _this.getPrevTab(index);
|
|
347267
|
-
} else {
|
|
347268
|
-
index = _this.getNextTab(index);
|
|
347269
|
-
}
|
|
347270
|
-
|
|
347271
|
-
preventDefault = true;
|
|
347272
|
-
useSelectedIndex = true;
|
|
347273
|
-
} else if (e.keyCode === 35) {
|
|
347274
|
-
// Select last tab (End key)
|
|
347275
|
-
index = _this.getLastTab();
|
|
347276
|
-
preventDefault = true;
|
|
347277
|
-
useSelectedIndex = true;
|
|
347278
|
-
} else if (e.keyCode === 36) {
|
|
347279
|
-
// Select first tab (Home key)
|
|
347280
|
-
index = _this.getFirstTab();
|
|
347281
|
-
preventDefault = true;
|
|
347282
|
-
useSelectedIndex = true;
|
|
347283
|
-
} // This prevents scrollbars from moving around
|
|
347284
|
-
|
|
347285
|
-
|
|
347286
|
-
if (preventDefault) {
|
|
347287
|
-
e.preventDefault();
|
|
347288
|
-
} // Only use the selected index in the state if we're not using the tabbed index
|
|
347289
|
-
|
|
347290
|
-
|
|
347291
|
-
if (useSelectedIndex) {
|
|
347292
|
-
_this.setSelected(index, e);
|
|
347293
|
-
}
|
|
347294
|
-
}
|
|
347295
|
-
};
|
|
347296
|
-
|
|
347297
|
-
_this.handleClick = function (e) {
|
|
347298
|
-
var node = e.target;
|
|
347299
|
-
|
|
347300
|
-
do {
|
|
347301
|
-
if (_this.isTabFromContainer(node)) {
|
|
347302
|
-
if (isTabDisabled(node)) {
|
|
347303
|
-
return;
|
|
347304
|
-
}
|
|
347305
|
-
|
|
347306
|
-
var index = [].slice.call(node.parentNode.children).filter(isTabNode).indexOf(node);
|
|
347307
|
-
|
|
347308
|
-
_this.setSelected(index, e);
|
|
347309
|
-
|
|
347310
|
-
return;
|
|
347311
|
-
}
|
|
347312
|
-
} while ((node = node.parentNode) != null);
|
|
347313
|
-
};
|
|
347163
|
+
var defaultProps = {
|
|
347164
|
+
className: 'react-tabs',
|
|
347165
|
+
focus: false
|
|
347166
|
+
};
|
|
347167
|
+
var propTypes = false ? 0 : {};
|
|
347314
347168
|
|
|
347315
|
-
|
|
347316
|
-
|
|
347169
|
+
var UncontrolledTabs = function UncontrolledTabs(props) {
|
|
347170
|
+
var tabNodes = (0,external_react_.useRef)([]);
|
|
347171
|
+
var tabIds = (0,external_react_.useRef)([]);
|
|
347172
|
+
var panelIds = (0,external_react_.useRef)([]);
|
|
347317
347173
|
|
|
347318
|
-
var
|
|
347174
|
+
var _ref = (0,external_react_.useRef)();
|
|
347319
347175
|
|
|
347320
|
-
|
|
347176
|
+
function setSelected(index, event) {
|
|
347321
347177
|
// Check index boundary
|
|
347322
|
-
if (index < 0 || index >=
|
|
347323
|
-
var
|
|
347324
|
-
|
|
347325
|
-
selectedIndex = _this$props2.selectedIndex; // Call change event handler
|
|
347178
|
+
if (index < 0 || index >= getTabsCount()) return;
|
|
347179
|
+
var onSelect = props.onSelect,
|
|
347180
|
+
selectedIndex = props.selectedIndex; // Call change event handler
|
|
347326
347181
|
|
|
347327
347182
|
onSelect(index, selectedIndex, event);
|
|
347328
|
-
}
|
|
347183
|
+
}
|
|
347329
347184
|
|
|
347330
|
-
|
|
347331
|
-
var count =
|
|
347185
|
+
function getNextTab(index) {
|
|
347186
|
+
var count = getTabsCount(); // Look for non-disabled tab from index to the last tab on the right
|
|
347332
347187
|
|
|
347333
347188
|
for (var i = index + 1; i < count; i++) {
|
|
347334
|
-
if (!isTabDisabled(
|
|
347189
|
+
if (!isTabDisabled(getTab(i))) {
|
|
347335
347190
|
return i;
|
|
347336
347191
|
}
|
|
347337
347192
|
} // If no tab found, continue searching from first on left to index
|
|
347338
347193
|
|
|
347339
347194
|
|
|
347340
347195
|
for (var _i = 0; _i < index; _i++) {
|
|
347341
|
-
if (!isTabDisabled(
|
|
347196
|
+
if (!isTabDisabled(getTab(_i))) {
|
|
347342
347197
|
return _i;
|
|
347343
347198
|
}
|
|
347344
|
-
} //
|
|
347199
|
+
} // All tabs are disabled, return index
|
|
347200
|
+
|
|
347201
|
+
/* istanbul ignore next */
|
|
347345
347202
|
|
|
347346
347203
|
|
|
347347
347204
|
return index;
|
|
347348
|
-
}
|
|
347205
|
+
}
|
|
347349
347206
|
|
|
347350
|
-
|
|
347207
|
+
function getPrevTab(index) {
|
|
347351
347208
|
var i = index; // Look for non-disabled tab from index to first tab on the left
|
|
347352
347209
|
|
|
347353
347210
|
while (i--) {
|
|
347354
|
-
if (!isTabDisabled(
|
|
347211
|
+
if (!isTabDisabled(getTab(i))) {
|
|
347355
347212
|
return i;
|
|
347356
347213
|
}
|
|
347357
347214
|
} // If no tab found, continue searching from last tab on right to index
|
|
347358
347215
|
|
|
347359
347216
|
|
|
347360
|
-
i =
|
|
347217
|
+
i = getTabsCount();
|
|
347361
347218
|
|
|
347362
347219
|
while (i-- > index) {
|
|
347363
|
-
if (!isTabDisabled(
|
|
347220
|
+
if (!isTabDisabled(getTab(i))) {
|
|
347364
347221
|
return i;
|
|
347365
347222
|
}
|
|
347366
|
-
} //
|
|
347223
|
+
} // All tabs are disabled, return index
|
|
347224
|
+
|
|
347225
|
+
/* istanbul ignore next */
|
|
347367
347226
|
|
|
347368
347227
|
|
|
347369
347228
|
return index;
|
|
347370
|
-
}
|
|
347229
|
+
}
|
|
347371
347230
|
|
|
347372
|
-
|
|
347373
|
-
var count =
|
|
347231
|
+
function getFirstTab() {
|
|
347232
|
+
var count = getTabsCount(); // Look for non disabled tab from the first tab
|
|
347374
347233
|
|
|
347375
347234
|
for (var i = 0; i < count; i++) {
|
|
347376
|
-
if (!isTabDisabled(
|
|
347235
|
+
if (!isTabDisabled(getTab(i))) {
|
|
347377
347236
|
return i;
|
|
347378
347237
|
}
|
|
347379
347238
|
}
|
|
347239
|
+
/* istanbul ignore next */
|
|
347240
|
+
|
|
347380
347241
|
|
|
347381
347242
|
return null;
|
|
347382
|
-
}
|
|
347243
|
+
}
|
|
347383
347244
|
|
|
347384
|
-
|
|
347385
|
-
var i =
|
|
347245
|
+
function getLastTab() {
|
|
347246
|
+
var i = getTabsCount(); // Look for non disabled tab from the last tab
|
|
347386
347247
|
|
|
347387
347248
|
while (i--) {
|
|
347388
|
-
if (!isTabDisabled(
|
|
347249
|
+
if (!isTabDisabled(getTab(i))) {
|
|
347389
347250
|
return i;
|
|
347390
347251
|
}
|
|
347391
347252
|
}
|
|
347253
|
+
/* istanbul ignore next */
|
|
347254
|
+
|
|
347392
347255
|
|
|
347393
347256
|
return null;
|
|
347394
|
-
}
|
|
347257
|
+
}
|
|
347395
347258
|
|
|
347396
|
-
|
|
347397
|
-
var children =
|
|
347259
|
+
function getTabsCount() {
|
|
347260
|
+
var children = props.children;
|
|
347398
347261
|
return count_getTabsCount(children);
|
|
347399
|
-
}
|
|
347400
|
-
|
|
347401
|
-
_proto.getPanelsCount = function getPanelsCount() {
|
|
347402
|
-
var children = this.props.children;
|
|
347403
|
-
return count_getPanelsCount(children);
|
|
347404
|
-
};
|
|
347405
|
-
|
|
347406
|
-
_proto.getTab = function getTab(index) {
|
|
347407
|
-
return this.tabNodes["tabs-" + index];
|
|
347408
|
-
};
|
|
347262
|
+
}
|
|
347409
347263
|
|
|
347410
|
-
|
|
347411
|
-
|
|
347264
|
+
function getTab(index) {
|
|
347265
|
+
return tabNodes.current["tabs-" + index];
|
|
347266
|
+
}
|
|
347412
347267
|
|
|
347268
|
+
function getChildren() {
|
|
347413
347269
|
var index = 0;
|
|
347414
|
-
var
|
|
347415
|
-
|
|
347416
|
-
|
|
347417
|
-
|
|
347418
|
-
|
|
347419
|
-
|
|
347420
|
-
|
|
347421
|
-
|
|
347422
|
-
|
|
347423
|
-
|
|
347424
|
-
|
|
347425
|
-
var diff = this.tabIds.length - this.getTabsCount(); // Add ids if new tabs have been added
|
|
347270
|
+
var children = props.children,
|
|
347271
|
+
disabledTabClassName = props.disabledTabClassName,
|
|
347272
|
+
focus = props.focus,
|
|
347273
|
+
forceRenderTabPanel = props.forceRenderTabPanel,
|
|
347274
|
+
selectedIndex = props.selectedIndex,
|
|
347275
|
+
selectedTabClassName = props.selectedTabClassName,
|
|
347276
|
+
selectedTabPanelClassName = props.selectedTabPanelClassName,
|
|
347277
|
+
environment = props.environment;
|
|
347278
|
+
tabIds.current = tabIds.current || [];
|
|
347279
|
+
panelIds.current = panelIds.current || [];
|
|
347280
|
+
var diff = tabIds.current.length - getTabsCount(); // Add ids if new tabs have been added
|
|
347426
347281
|
// Don't bother removing ids, just keep them in case they are added again
|
|
347427
347282
|
// This is more efficient, and keeps the uuid counter under control
|
|
347428
347283
|
|
|
347429
347284
|
while (diff++ < 0) {
|
|
347430
|
-
|
|
347431
|
-
|
|
347285
|
+
tabIds.current.push(uuid());
|
|
347286
|
+
panelIds.current.push(uuid());
|
|
347432
347287
|
} // Map children to dynamically setup refs
|
|
347433
347288
|
|
|
347434
347289
|
|
|
@@ -347445,10 +347300,11 @@ var UncontrolledTabs = /*#__PURE__*/function (_Component) {
|
|
|
347445
347300
|
determineCanUseActiveElement(environment);
|
|
347446
347301
|
}
|
|
347447
347302
|
|
|
347448
|
-
|
|
347303
|
+
var env = environment || (typeof window !== 'undefined' ? window : undefined);
|
|
347304
|
+
|
|
347305
|
+
if (canUseActiveElement && env) {
|
|
347449
347306
|
wasTabFocused = external_react_["default"].Children.toArray(child.props.children).filter(elementTypes_isTab).some(function (tab, i) {
|
|
347450
|
-
|
|
347451
|
-
return env && env.document.activeElement === _this2.getTab(i);
|
|
347307
|
+
return env.document.activeElement === getTab(i);
|
|
347452
347308
|
});
|
|
347453
347309
|
}
|
|
347454
347310
|
|
|
@@ -347458,10 +347314,10 @@ var UncontrolledTabs = /*#__PURE__*/function (_Component) {
|
|
|
347458
347314
|
var selected = selectedIndex === listIndex;
|
|
347459
347315
|
var props = {
|
|
347460
347316
|
tabRef: function tabRef(node) {
|
|
347461
|
-
|
|
347317
|
+
tabNodes.current[key] = node;
|
|
347462
347318
|
},
|
|
347463
|
-
id:
|
|
347464
|
-
panelId:
|
|
347319
|
+
id: tabIds.current[listIndex],
|
|
347320
|
+
panelId: panelIds.current[listIndex],
|
|
347465
347321
|
selected: selected,
|
|
347466
347322
|
focus: selected && (focus || wasTabFocused)
|
|
347467
347323
|
};
|
|
@@ -347472,27 +347328,116 @@ var UncontrolledTabs = /*#__PURE__*/function (_Component) {
|
|
|
347472
347328
|
})
|
|
347473
347329
|
});
|
|
347474
347330
|
} else if (elementTypes_isTabPanel(child)) {
|
|
347475
|
-
var
|
|
347476
|
-
id:
|
|
347477
|
-
tabId:
|
|
347331
|
+
var _props = {
|
|
347332
|
+
id: panelIds.current[index],
|
|
347333
|
+
tabId: tabIds.current[index],
|
|
347478
347334
|
selected: selectedIndex === index
|
|
347479
347335
|
};
|
|
347480
|
-
if (forceRenderTabPanel)
|
|
347481
|
-
if (selectedTabPanelClassName)
|
|
347336
|
+
if (forceRenderTabPanel) _props.forceRender = forceRenderTabPanel;
|
|
347337
|
+
if (selectedTabPanelClassName) _props.selectedClassName = selectedTabPanelClassName;
|
|
347482
347338
|
index++;
|
|
347483
|
-
result = /*#__PURE__*/(0,external_react_.cloneElement)(child,
|
|
347339
|
+
result = /*#__PURE__*/(0,external_react_.cloneElement)(child, _props);
|
|
347484
347340
|
}
|
|
347485
347341
|
|
|
347486
347342
|
return result;
|
|
347487
347343
|
});
|
|
347488
|
-
}
|
|
347344
|
+
}
|
|
347345
|
+
|
|
347346
|
+
function handleKeyDown(e) {
|
|
347347
|
+
var direction = props.direction,
|
|
347348
|
+
disableUpDownKeys = props.disableUpDownKeys;
|
|
347349
|
+
|
|
347350
|
+
if (isTabFromContainer(e.target)) {
|
|
347351
|
+
var index = props.selectedIndex;
|
|
347352
|
+
var preventDefault = false;
|
|
347353
|
+
var useSelectedIndex = false;
|
|
347354
|
+
|
|
347355
|
+
if (e.code === 'Space' || e.keyCode === 32
|
|
347356
|
+
/* space */
|
|
347357
|
+
|| e.code === 'Enter' || e.keyCode === 13
|
|
347358
|
+
/* enter */
|
|
347359
|
+
) {
|
|
347360
|
+
preventDefault = true;
|
|
347361
|
+
useSelectedIndex = false;
|
|
347362
|
+
handleClick(e);
|
|
347363
|
+
} // keyCode is deprecated and only used here for IE
|
|
347364
|
+
|
|
347365
|
+
|
|
347366
|
+
if (e.code === 'ArrowLeft' || e.keyCode === 37
|
|
347367
|
+
/* arrow left */
|
|
347368
|
+
|| !disableUpDownKeys && (e.keyCode === 38 || e.code === 'ArrowUp')
|
|
347369
|
+
/* arrow up */
|
|
347370
|
+
) {
|
|
347371
|
+
// Select next tab to the left, validate if up arrow is not disabled
|
|
347372
|
+
if (direction === 'rtl') {
|
|
347373
|
+
index = getNextTab(index);
|
|
347374
|
+
} else {
|
|
347375
|
+
index = getPrevTab(index);
|
|
347376
|
+
}
|
|
347377
|
+
|
|
347378
|
+
preventDefault = true;
|
|
347379
|
+
useSelectedIndex = true;
|
|
347380
|
+
} else if (e.code === 'ArrowRight' || e.keyCode === 39
|
|
347381
|
+
/* arrow right */
|
|
347382
|
+
|| !disableUpDownKeys && (e.keyCode === 40 || e.code === 'ArrowDown')
|
|
347383
|
+
/* arrow down */
|
|
347384
|
+
) {
|
|
347385
|
+
// Select next tab to the right, validate if down arrow is not disabled
|
|
347386
|
+
if (direction === 'rtl') {
|
|
347387
|
+
index = getPrevTab(index);
|
|
347388
|
+
} else {
|
|
347389
|
+
index = getNextTab(index);
|
|
347390
|
+
}
|
|
347489
347391
|
|
|
347392
|
+
preventDefault = true;
|
|
347393
|
+
useSelectedIndex = true;
|
|
347394
|
+
} else if (e.keyCode === 35 || e.code === 'End') {
|
|
347395
|
+
// Select last tab (End key)
|
|
347396
|
+
index = getLastTab();
|
|
347397
|
+
preventDefault = true;
|
|
347398
|
+
useSelectedIndex = true;
|
|
347399
|
+
} else if (e.keyCode === 36 || e.code === 'Home') {
|
|
347400
|
+
// Select first tab (Home key)
|
|
347401
|
+
index = getFirstTab();
|
|
347402
|
+
preventDefault = true;
|
|
347403
|
+
useSelectedIndex = true;
|
|
347404
|
+
} // This prevents scrollbars from moving around
|
|
347405
|
+
|
|
347406
|
+
|
|
347407
|
+
if (preventDefault) {
|
|
347408
|
+
e.preventDefault();
|
|
347409
|
+
} // Only use the selected index in the state if we're not using the tabbed index
|
|
347410
|
+
|
|
347411
|
+
|
|
347412
|
+
if (useSelectedIndex) {
|
|
347413
|
+
setSelected(index, e);
|
|
347414
|
+
}
|
|
347415
|
+
}
|
|
347416
|
+
}
|
|
347417
|
+
|
|
347418
|
+
function handleClick(e) {
|
|
347419
|
+
var node = e.target;
|
|
347420
|
+
|
|
347421
|
+
do {
|
|
347422
|
+
if (isTabFromContainer(node)) {
|
|
347423
|
+
if (isTabDisabled(node)) {
|
|
347424
|
+
return;
|
|
347425
|
+
}
|
|
347426
|
+
|
|
347427
|
+
var index = [].slice.call(node.parentNode.children).filter(isTabNode).indexOf(node);
|
|
347428
|
+
setSelected(index, e);
|
|
347429
|
+
return;
|
|
347430
|
+
}
|
|
347431
|
+
} while ((node = node.parentNode) != null);
|
|
347432
|
+
}
|
|
347490
347433
|
/**
|
|
347491
347434
|
* Determine if a node from event.target is a Tab element for the current Tabs container.
|
|
347492
347435
|
* If the clicked element is not a Tab, it returns false.
|
|
347493
347436
|
* If it finds another Tabs container between the Tab and `this`, it returns false.
|
|
347494
347437
|
*/
|
|
347495
|
-
|
|
347438
|
+
|
|
347439
|
+
|
|
347440
|
+
function isTabFromContainer(node) {
|
|
347496
347441
|
// return immediately if the clicked element is not a Tab.
|
|
347497
347442
|
if (!isTabNode(node)) {
|
|
347498
347443
|
return false;
|
|
@@ -347502,62 +347447,45 @@ var UncontrolledTabs = /*#__PURE__*/function (_Component) {
|
|
|
347502
347447
|
var nodeAncestor = node.parentElement;
|
|
347503
347448
|
|
|
347504
347449
|
do {
|
|
347505
|
-
if (nodeAncestor ===
|
|
347450
|
+
if (nodeAncestor === _ref.current) return true;
|
|
347506
347451
|
if (nodeAncestor.getAttribute('data-rttabs')) break;
|
|
347507
347452
|
nodeAncestor = nodeAncestor.parentElement;
|
|
347508
347453
|
} while (nodeAncestor);
|
|
347509
347454
|
|
|
347510
347455
|
return false;
|
|
347511
|
-
}
|
|
347512
|
-
|
|
347513
|
-
_proto.render = function render() {
|
|
347514
|
-
var _this3 = this;
|
|
347515
|
-
|
|
347516
|
-
// Delete all known props, so they don't get added to DOM
|
|
347517
|
-
var _this$props4 = this.props,
|
|
347518
|
-
children = _this$props4.children,
|
|
347519
|
-
className = _this$props4.className,
|
|
347520
|
-
disabledTabClassName = _this$props4.disabledTabClassName,
|
|
347521
|
-
domRef = _this$props4.domRef,
|
|
347522
|
-
focus = _this$props4.focus,
|
|
347523
|
-
forceRenderTabPanel = _this$props4.forceRenderTabPanel,
|
|
347524
|
-
onSelect = _this$props4.onSelect,
|
|
347525
|
-
selectedIndex = _this$props4.selectedIndex,
|
|
347526
|
-
selectedTabClassName = _this$props4.selectedTabClassName,
|
|
347527
|
-
selectedTabPanelClassName = _this$props4.selectedTabPanelClassName,
|
|
347528
|
-
environment = _this$props4.environment,
|
|
347529
|
-
disableUpDownKeys = _this$props4.disableUpDownKeys,
|
|
347530
|
-
attributes = _objectWithoutPropertiesLoose(_this$props4, _excluded);
|
|
347531
|
-
|
|
347532
|
-
return /*#__PURE__*/external_react_["default"].createElement("div", UncontrolledTabs_extends({}, attributes, {
|
|
347533
|
-
className: (0,clsx_m/* default */.A)(className),
|
|
347534
|
-
onClick: this.handleClick,
|
|
347535
|
-
onKeyDown: this.handleKeyDown,
|
|
347536
|
-
ref: function ref(node) {
|
|
347537
|
-
_this3.node = node;
|
|
347538
|
-
if (domRef) domRef(node);
|
|
347539
|
-
},
|
|
347540
|
-
"data-rttabs": true
|
|
347541
|
-
}), this.getChildren());
|
|
347542
|
-
};
|
|
347543
|
-
|
|
347544
|
-
return UncontrolledTabs;
|
|
347545
|
-
}(external_react_.Component);
|
|
347456
|
+
}
|
|
347546
347457
|
|
|
347547
|
-
|
|
347548
|
-
|
|
347549
|
-
|
|
347458
|
+
var children = props.children,
|
|
347459
|
+
className = props.className,
|
|
347460
|
+
disabledTabClassName = props.disabledTabClassName,
|
|
347461
|
+
domRef = props.domRef,
|
|
347462
|
+
focus = props.focus,
|
|
347463
|
+
forceRenderTabPanel = props.forceRenderTabPanel,
|
|
347464
|
+
onSelect = props.onSelect,
|
|
347465
|
+
selectedIndex = props.selectedIndex,
|
|
347466
|
+
selectedTabClassName = props.selectedTabClassName,
|
|
347467
|
+
selectedTabPanelClassName = props.selectedTabPanelClassName,
|
|
347468
|
+
environment = props.environment,
|
|
347469
|
+
disableUpDownKeys = props.disableUpDownKeys,
|
|
347470
|
+
attributes = _objectWithoutPropertiesLoose(props, _excluded);
|
|
347471
|
+
|
|
347472
|
+
return /*#__PURE__*/external_react_["default"].createElement("div", UncontrolledTabs_extends({}, attributes, {
|
|
347473
|
+
className: (0,clsx_m/* default */.A)(className),
|
|
347474
|
+
onClick: handleClick,
|
|
347475
|
+
onKeyDown: handleKeyDown,
|
|
347476
|
+
ref: function ref(node) {
|
|
347477
|
+
_ref.current = node;
|
|
347478
|
+
if (domRef) domRef(node);
|
|
347479
|
+
},
|
|
347480
|
+
"data-rttabs": true
|
|
347481
|
+
}), getChildren());
|
|
347550
347482
|
};
|
|
347551
347483
|
|
|
347484
|
+
UncontrolledTabs.defaultProps = defaultProps;
|
|
347552
347485
|
UncontrolledTabs.propTypes = false ? 0 : {};
|
|
347486
|
+
/* harmony default export */ const components_UncontrolledTabs = (UncontrolledTabs);
|
|
347553
347487
|
;// ./node_modules/react-tabs/esm/components/Tabs.js
|
|
347554
|
-
var
|
|
347555
|
-
|
|
347556
|
-
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; }
|
|
347557
|
-
|
|
347558
|
-
function Tabs_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; Tabs_setPrototypeOf(subClass, superClass); }
|
|
347559
|
-
|
|
347560
|
-
function Tabs_setPrototypeOf(o, p) { Tabs_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tabs_setPrototypeOf(o, p); }
|
|
347488
|
+
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); }
|
|
347561
347489
|
|
|
347562
347490
|
|
|
347563
347491
|
|
|
@@ -347566,115 +347494,106 @@ function Tabs_setPrototypeOf(o, p) { Tabs_setPrototypeOf = Object.setPrototypeOf
|
|
|
347566
347494
|
|
|
347567
347495
|
var MODE_CONTROLLED = 0;
|
|
347568
347496
|
var MODE_UNCONTROLLED = 1;
|
|
347497
|
+
var Tabs_propTypes = false ? 0 : {};
|
|
347498
|
+
var Tabs_defaultProps = {
|
|
347499
|
+
defaultFocus: false,
|
|
347500
|
+
focusTabOnClick: true,
|
|
347501
|
+
forceRenderTabPanel: false,
|
|
347502
|
+
selectedIndex: null,
|
|
347503
|
+
defaultIndex: null,
|
|
347504
|
+
environment: null,
|
|
347505
|
+
disableUpDownKeys: false
|
|
347506
|
+
};
|
|
347569
347507
|
|
|
347570
|
-
var
|
|
347571
|
-
|
|
347508
|
+
var getModeFromProps = function getModeFromProps(props) {
|
|
347509
|
+
return props.selectedIndex === null ? MODE_UNCONTROLLED : MODE_CONTROLLED;
|
|
347510
|
+
};
|
|
347572
347511
|
|
|
347573
|
-
|
|
347574
|
-
|
|
347512
|
+
var checkForIllegalModeChange = function checkForIllegalModeChange(props, mode) {
|
|
347513
|
+
if (false) {}
|
|
347514
|
+
};
|
|
347515
|
+
/**
|
|
347516
|
+
* State:
|
|
347517
|
+
* mode: Initialized only once from props and never changes
|
|
347518
|
+
* 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
|
|
347519
|
+
* focus: Because we never remove focus from the Tabs this state is only used to indicate that we should focus the current tab.
|
|
347520
|
+
* 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.
|
|
347521
|
+
*/
|
|
347575
347522
|
|
|
347576
|
-
_this = _Component.call(this, props) || this;
|
|
347577
347523
|
|
|
347578
|
-
|
|
347579
|
-
|
|
347580
|
-
|
|
347524
|
+
var Tabs = function Tabs(props) {
|
|
347525
|
+
var children = props.children,
|
|
347526
|
+
defaultFocus = props.defaultFocus,
|
|
347527
|
+
defaultIndex = props.defaultIndex,
|
|
347528
|
+
focusTabOnClick = props.focusTabOnClick,
|
|
347529
|
+
onSelect = props.onSelect;
|
|
347581
347530
|
|
|
347582
|
-
|
|
347583
|
-
|
|
347584
|
-
|
|
347585
|
-
}
|
|
347531
|
+
var _useState = (0,external_react_.useState)(defaultFocus),
|
|
347532
|
+
focus = _useState[0],
|
|
347533
|
+
setFocus = _useState[1];
|
|
347586
347534
|
|
|
347587
|
-
|
|
347588
|
-
|
|
347589
|
-
focus: event.type === 'keydown'
|
|
347590
|
-
};
|
|
347535
|
+
var _useState2 = (0,external_react_.useState)(getModeFromProps(props)),
|
|
347536
|
+
mode = _useState2[0];
|
|
347591
347537
|
|
|
347592
|
-
|
|
347593
|
-
|
|
347594
|
-
|
|
347595
|
-
}
|
|
347538
|
+
var _useState3 = (0,external_react_.useState)(mode === MODE_UNCONTROLLED ? defaultIndex || 0 : null),
|
|
347539
|
+
selectedIndex = _useState3[0],
|
|
347540
|
+
setSelectedIndex = _useState3[1];
|
|
347596
347541
|
|
|
347597
|
-
|
|
347598
|
-
|
|
347542
|
+
(0,external_react_.useEffect)(function () {
|
|
347543
|
+
// Reset focus after initial render, see comment above
|
|
347544
|
+
setFocus(false);
|
|
347545
|
+
}, []);
|
|
347599
347546
|
|
|
347600
|
-
|
|
347601
|
-
|
|
347547
|
+
if (mode === MODE_UNCONTROLLED) {
|
|
347548
|
+
// Ensure that we handle removed tabs and don't let selectedIndex get out of bounds
|
|
347549
|
+
var tabsCount = count_getTabsCount(children);
|
|
347550
|
+
(0,external_react_.useEffect)(function () {
|
|
347551
|
+
if (selectedIndex != null) {
|
|
347552
|
+
var maxTabIndex = Math.max(0, tabsCount - 1);
|
|
347553
|
+
setSelectedIndex(Math.min(selectedIndex, maxTabIndex));
|
|
347554
|
+
}
|
|
347555
|
+
}, [tabsCount]);
|
|
347602
347556
|
}
|
|
347603
347557
|
|
|
347604
|
-
|
|
347605
|
-
return Tabs.copyPropsToState(props, state);
|
|
347606
|
-
};
|
|
347558
|
+
checkForIllegalModeChange(props, mode);
|
|
347607
347559
|
|
|
347608
|
-
|
|
347609
|
-
|
|
347610
|
-
|
|
347611
|
-
|
|
347612
|
-
|
|
347613
|
-
|
|
347614
|
-
Tabs.copyPropsToState = function copyPropsToState(props, state, focus) {
|
|
347615
|
-
if (focus === void 0) {
|
|
347616
|
-
focus = false;
|
|
347617
|
-
}
|
|
347560
|
+
var handleSelected = function handleSelected(index, last, event) {
|
|
347561
|
+
// Call change event handler
|
|
347562
|
+
if (typeof onSelect === 'function') {
|
|
347563
|
+
// Check if the change event handler cancels the tab change
|
|
347564
|
+
if (onSelect(index, last, event) === false) return;
|
|
347565
|
+
} // Always set focus on tabs unless it is disabled
|
|
347618
347566
|
|
|
347619
|
-
if (false) {}
|
|
347620
|
-
|
|
347621
|
-
var newState = {
|
|
347622
|
-
focus: focus,
|
|
347623
|
-
mode: Tabs.getModeFromProps(props)
|
|
347624
|
-
};
|
|
347625
|
-
|
|
347626
|
-
if (newState.mode === MODE_UNCONTROLLED) {
|
|
347627
|
-
var maxTabIndex = Math.max(0, count_getTabsCount(props.children) - 1);
|
|
347628
|
-
var selectedIndex = null;
|
|
347629
|
-
|
|
347630
|
-
if (state.selectedIndex != null) {
|
|
347631
|
-
selectedIndex = Math.min(state.selectedIndex, maxTabIndex);
|
|
347632
|
-
} else {
|
|
347633
|
-
selectedIndex = props.defaultIndex || 0;
|
|
347634
|
-
}
|
|
347635
347567
|
|
|
347636
|
-
|
|
347568
|
+
if (focusTabOnClick) {
|
|
347569
|
+
setFocus(true);
|
|
347637
347570
|
}
|
|
347638
347571
|
|
|
347639
|
-
|
|
347572
|
+
if (mode === MODE_UNCONTROLLED) {
|
|
347573
|
+
// Update selected index
|
|
347574
|
+
setSelectedIndex(index);
|
|
347575
|
+
}
|
|
347640
347576
|
};
|
|
347641
347577
|
|
|
347642
|
-
var
|
|
347643
|
-
|
|
347644
|
-
_proto.render = function render() {
|
|
347645
|
-
var _this$props = this.props,
|
|
347646
|
-
children = _this$props.children,
|
|
347647
|
-
defaultIndex = _this$props.defaultIndex,
|
|
347648
|
-
defaultFocus = _this$props.defaultFocus,
|
|
347649
|
-
props = Tabs_objectWithoutPropertiesLoose(_this$props, Tabs_excluded);
|
|
347578
|
+
var subProps = Tabs_extends({}, props);
|
|
347650
347579
|
|
|
347651
|
-
|
|
347652
|
-
|
|
347653
|
-
selectedIndex = _this$state.selectedIndex;
|
|
347654
|
-
props.focus = focus;
|
|
347655
|
-
props.onSelect = this.handleSelected;
|
|
347580
|
+
subProps.focus = focus;
|
|
347581
|
+
subProps.onSelect = handleSelected;
|
|
347656
347582
|
|
|
347657
|
-
|
|
347658
|
-
|
|
347659
|
-
|
|
347660
|
-
|
|
347661
|
-
return /*#__PURE__*/external_react_["default"].createElement(UncontrolledTabs, props, children);
|
|
347662
|
-
};
|
|
347663
|
-
|
|
347664
|
-
return Tabs;
|
|
347665
|
-
}(external_react_.Component);
|
|
347583
|
+
if (selectedIndex != null) {
|
|
347584
|
+
subProps.selectedIndex = selectedIndex;
|
|
347585
|
+
}
|
|
347666
347586
|
|
|
347667
|
-
|
|
347668
|
-
|
|
347669
|
-
|
|
347670
|
-
|
|
347671
|
-
defaultIndex: null,
|
|
347672
|
-
environment: null,
|
|
347673
|
-
disableUpDownKeys: false
|
|
347587
|
+
delete subProps.defaultFocus;
|
|
347588
|
+
delete subProps.defaultIndex;
|
|
347589
|
+
delete subProps.focusTabOnClick;
|
|
347590
|
+
return /*#__PURE__*/external_react_["default"].createElement(components_UncontrolledTabs, subProps, children);
|
|
347674
347591
|
};
|
|
347675
347592
|
|
|
347676
347593
|
Tabs.propTypes = false ? 0 : {};
|
|
347594
|
+
Tabs.defaultProps = Tabs_defaultProps;
|
|
347677
347595
|
Tabs.tabsRole = 'Tabs';
|
|
347596
|
+
/* harmony default export */ const components_Tabs = (Tabs);
|
|
347678
347597
|
;// ./node_modules/react-tabs/esm/components/TabList.js
|
|
347679
347598
|
var TabList_excluded = ["children", "className"];
|
|
347680
347599
|
|
|
@@ -347682,44 +347601,29 @@ function TabList_extends() { TabList_extends = Object.assign || function (target
|
|
|
347682
347601
|
|
|
347683
347602
|
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; }
|
|
347684
347603
|
|
|
347685
|
-
function TabList_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; TabList_setPrototypeOf(subClass, superClass); }
|
|
347686
|
-
|
|
347687
|
-
function TabList_setPrototypeOf(o, p) { TabList_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TabList_setPrototypeOf(o, p); }
|
|
347688
|
-
|
|
347689
347604
|
|
|
347690
347605
|
|
|
347691
347606
|
|
|
347607
|
+
var TabList_defaultProps = {
|
|
347608
|
+
className: 'react-tabs__tab-list'
|
|
347609
|
+
};
|
|
347610
|
+
var TabList_propTypes = false ? 0 : {};
|
|
347692
347611
|
|
|
347693
|
-
var TabList =
|
|
347694
|
-
|
|
347695
|
-
|
|
347696
|
-
|
|
347697
|
-
return _Component.apply(this, arguments) || this;
|
|
347698
|
-
}
|
|
347699
|
-
|
|
347700
|
-
var _proto = TabList.prototype;
|
|
347701
|
-
|
|
347702
|
-
_proto.render = function render() {
|
|
347703
|
-
var _this$props = this.props,
|
|
347704
|
-
children = _this$props.children,
|
|
347705
|
-
className = _this$props.className,
|
|
347706
|
-
attributes = TabList_objectWithoutPropertiesLoose(_this$props, TabList_excluded);
|
|
347707
|
-
|
|
347708
|
-
return /*#__PURE__*/external_react_["default"].createElement("ul", TabList_extends({}, attributes, {
|
|
347709
|
-
className: (0,clsx_m/* default */.A)(className),
|
|
347710
|
-
role: "tablist"
|
|
347711
|
-
}), children);
|
|
347712
|
-
};
|
|
347713
|
-
|
|
347714
|
-
return TabList;
|
|
347715
|
-
}(external_react_.Component);
|
|
347612
|
+
var TabList = function TabList(props) {
|
|
347613
|
+
var children = props.children,
|
|
347614
|
+
className = props.className,
|
|
347615
|
+
attributes = TabList_objectWithoutPropertiesLoose(props, TabList_excluded);
|
|
347716
347616
|
|
|
347717
|
-
|
|
347718
|
-
|
|
347617
|
+
return /*#__PURE__*/external_react_["default"].createElement("ul", TabList_extends({}, attributes, {
|
|
347618
|
+
className: (0,clsx_m/* default */.A)(className),
|
|
347619
|
+
role: "tablist"
|
|
347620
|
+
}), children);
|
|
347719
347621
|
};
|
|
347720
347622
|
|
|
347721
|
-
TabList.propTypes = false ? 0 : {};
|
|
347722
347623
|
TabList.tabsRole = 'TabList';
|
|
347624
|
+
TabList.propTypes = false ? 0 : {};
|
|
347625
|
+
TabList.defaultProps = TabList_defaultProps;
|
|
347626
|
+
/* harmony default export */ const components_TabList = (TabList);
|
|
347723
347627
|
;// ./node_modules/react-tabs/esm/components/Tab.js
|
|
347724
347628
|
var Tab_excluded = ["children", "className", "disabled", "disabledClassName", "focus", "id", "panelId", "selected", "selectedClassName", "tabIndex", "tabRef"];
|
|
347725
347629
|
|
|
@@ -347727,80 +347631,11 @@ function Tab_extends() { Tab_extends = Object.assign || function (target) { for
|
|
|
347727
347631
|
|
|
347728
347632
|
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; }
|
|
347729
347633
|
|
|
347730
|
-
function Tab_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; Tab_setPrototypeOf(subClass, superClass); }
|
|
347731
|
-
|
|
347732
|
-
function Tab_setPrototypeOf(o, p) { Tab_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Tab_setPrototypeOf(o, p); }
|
|
347733
|
-
|
|
347734
347634
|
|
|
347735
347635
|
|
|
347736
347636
|
|
|
347737
347637
|
var DEFAULT_CLASS = 'react-tabs__tab';
|
|
347738
|
-
|
|
347739
|
-
var Tab = /*#__PURE__*/function (_Component) {
|
|
347740
|
-
Tab_inheritsLoose(Tab, _Component);
|
|
347741
|
-
|
|
347742
|
-
function Tab() {
|
|
347743
|
-
return _Component.apply(this, arguments) || this;
|
|
347744
|
-
}
|
|
347745
|
-
|
|
347746
|
-
var _proto = Tab.prototype;
|
|
347747
|
-
|
|
347748
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
347749
|
-
this.checkFocus();
|
|
347750
|
-
};
|
|
347751
|
-
|
|
347752
|
-
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
347753
|
-
this.checkFocus();
|
|
347754
|
-
};
|
|
347755
|
-
|
|
347756
|
-
_proto.checkFocus = function checkFocus() {
|
|
347757
|
-
var _this$props = this.props,
|
|
347758
|
-
selected = _this$props.selected,
|
|
347759
|
-
focus = _this$props.focus;
|
|
347760
|
-
|
|
347761
|
-
if (selected && focus) {
|
|
347762
|
-
this.node.focus();
|
|
347763
|
-
}
|
|
347764
|
-
};
|
|
347765
|
-
|
|
347766
|
-
_proto.render = function render() {
|
|
347767
|
-
var _cx,
|
|
347768
|
-
_this = this;
|
|
347769
|
-
|
|
347770
|
-
var _this$props2 = this.props,
|
|
347771
|
-
children = _this$props2.children,
|
|
347772
|
-
className = _this$props2.className,
|
|
347773
|
-
disabled = _this$props2.disabled,
|
|
347774
|
-
disabledClassName = _this$props2.disabledClassName,
|
|
347775
|
-
focus = _this$props2.focus,
|
|
347776
|
-
id = _this$props2.id,
|
|
347777
|
-
panelId = _this$props2.panelId,
|
|
347778
|
-
selected = _this$props2.selected,
|
|
347779
|
-
selectedClassName = _this$props2.selectedClassName,
|
|
347780
|
-
tabIndex = _this$props2.tabIndex,
|
|
347781
|
-
tabRef = _this$props2.tabRef,
|
|
347782
|
-
attributes = Tab_objectWithoutPropertiesLoose(_this$props2, Tab_excluded);
|
|
347783
|
-
|
|
347784
|
-
return /*#__PURE__*/external_react_["default"].createElement("li", Tab_extends({}, attributes, {
|
|
347785
|
-
className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx[disabledClassName] = disabled, _cx)),
|
|
347786
|
-
ref: function ref(node) {
|
|
347787
|
-
_this.node = node;
|
|
347788
|
-
if (tabRef) tabRef(node);
|
|
347789
|
-
},
|
|
347790
|
-
role: "tab",
|
|
347791
|
-
id: id,
|
|
347792
|
-
"aria-selected": selected ? 'true' : 'false',
|
|
347793
|
-
"aria-disabled": disabled ? 'true' : 'false',
|
|
347794
|
-
"aria-controls": panelId,
|
|
347795
|
-
tabIndex: tabIndex || (selected ? '0' : null),
|
|
347796
|
-
"data-rttab": true
|
|
347797
|
-
}), children);
|
|
347798
|
-
};
|
|
347799
|
-
|
|
347800
|
-
return Tab;
|
|
347801
|
-
}(external_react_.Component);
|
|
347802
|
-
|
|
347803
|
-
Tab.defaultProps = {
|
|
347638
|
+
var DEFAULT_PROPS = {
|
|
347804
347639
|
className: DEFAULT_CLASS,
|
|
347805
347640
|
disabledClassName: DEFAULT_CLASS + "--disabled",
|
|
347806
347641
|
focus: false,
|
|
@@ -347809,9 +347644,51 @@ Tab.defaultProps = {
|
|
|
347809
347644
|
selected: false,
|
|
347810
347645
|
selectedClassName: DEFAULT_CLASS + "--selected"
|
|
347811
347646
|
};
|
|
347647
|
+
var Tab_propTypes = false ? 0 : {};
|
|
347648
|
+
|
|
347649
|
+
var Tab = function Tab(props) {
|
|
347650
|
+
var _cx;
|
|
347651
|
+
|
|
347652
|
+
var nodeRef = (0,external_react_.useRef)();
|
|
347653
|
+
|
|
347654
|
+
var children = props.children,
|
|
347655
|
+
className = props.className,
|
|
347656
|
+
disabled = props.disabled,
|
|
347657
|
+
disabledClassName = props.disabledClassName,
|
|
347658
|
+
focus = props.focus,
|
|
347659
|
+
id = props.id,
|
|
347660
|
+
panelId = props.panelId,
|
|
347661
|
+
selected = props.selected,
|
|
347662
|
+
selectedClassName = props.selectedClassName,
|
|
347663
|
+
tabIndex = props.tabIndex,
|
|
347664
|
+
tabRef = props.tabRef,
|
|
347665
|
+
attributes = Tab_objectWithoutPropertiesLoose(props, Tab_excluded);
|
|
347666
|
+
|
|
347667
|
+
(0,external_react_.useEffect)(function () {
|
|
347668
|
+
if (selected && focus) {
|
|
347669
|
+
nodeRef.current.focus();
|
|
347670
|
+
}
|
|
347671
|
+
}, [selected, focus]);
|
|
347672
|
+
return /*#__PURE__*/external_react_["default"].createElement("li", Tab_extends({}, attributes, {
|
|
347673
|
+
className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx[disabledClassName] = disabled, _cx)),
|
|
347674
|
+
ref: function ref(node) {
|
|
347675
|
+
nodeRef.current = node;
|
|
347676
|
+
if (tabRef) tabRef(node);
|
|
347677
|
+
},
|
|
347678
|
+
role: "tab",
|
|
347679
|
+
id: id,
|
|
347680
|
+
"aria-selected": selected ? 'true' : 'false',
|
|
347681
|
+
"aria-disabled": disabled ? 'true' : 'false',
|
|
347682
|
+
"aria-controls": panelId,
|
|
347683
|
+
tabIndex: tabIndex || (selected ? '0' : null),
|
|
347684
|
+
"data-rttab": true
|
|
347685
|
+
}), children);
|
|
347686
|
+
};
|
|
347812
347687
|
|
|
347813
347688
|
Tab.propTypes = false ? 0 : {};
|
|
347814
347689
|
Tab.tabsRole = 'Tab';
|
|
347690
|
+
Tab.defaultProps = DEFAULT_PROPS;
|
|
347691
|
+
/* harmony default export */ const components_Tab = (Tab);
|
|
347815
347692
|
;// ./node_modules/react-tabs/esm/components/TabPanel.js
|
|
347816
347693
|
var TabPanel_excluded = ["children", "className", "forceRender", "id", "selected", "selectedClassName", "tabId"];
|
|
347817
347694
|
|
|
@@ -347819,56 +347696,41 @@ function TabPanel_extends() { TabPanel_extends = Object.assign || function (targ
|
|
|
347819
347696
|
|
|
347820
347697
|
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; }
|
|
347821
347698
|
|
|
347822
|
-
function TabPanel_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; TabPanel_setPrototypeOf(subClass, superClass); }
|
|
347823
|
-
|
|
347824
|
-
function TabPanel_setPrototypeOf(o, p) { TabPanel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TabPanel_setPrototypeOf(o, p); }
|
|
347825
|
-
|
|
347826
347699
|
|
|
347827
347700
|
|
|
347828
347701
|
|
|
347829
347702
|
var TabPanel_DEFAULT_CLASS = 'react-tabs__tab-panel';
|
|
347830
|
-
|
|
347831
|
-
var TabPanel = /*#__PURE__*/function (_Component) {
|
|
347832
|
-
TabPanel_inheritsLoose(TabPanel, _Component);
|
|
347833
|
-
|
|
347834
|
-
function TabPanel() {
|
|
347835
|
-
return _Component.apply(this, arguments) || this;
|
|
347836
|
-
}
|
|
347837
|
-
|
|
347838
|
-
var _proto = TabPanel.prototype;
|
|
347839
|
-
|
|
347840
|
-
_proto.render = function render() {
|
|
347841
|
-
var _cx;
|
|
347842
|
-
|
|
347843
|
-
var _this$props = this.props,
|
|
347844
|
-
children = _this$props.children,
|
|
347845
|
-
className = _this$props.className,
|
|
347846
|
-
forceRender = _this$props.forceRender,
|
|
347847
|
-
id = _this$props.id,
|
|
347848
|
-
selected = _this$props.selected,
|
|
347849
|
-
selectedClassName = _this$props.selectedClassName,
|
|
347850
|
-
tabId = _this$props.tabId,
|
|
347851
|
-
attributes = TabPanel_objectWithoutPropertiesLoose(_this$props, TabPanel_excluded);
|
|
347852
|
-
|
|
347853
|
-
return /*#__PURE__*/external_react_["default"].createElement("div", TabPanel_extends({}, attributes, {
|
|
347854
|
-
className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx)),
|
|
347855
|
-
role: "tabpanel",
|
|
347856
|
-
id: id,
|
|
347857
|
-
"aria-labelledby": tabId
|
|
347858
|
-
}), forceRender || selected ? children : null);
|
|
347859
|
-
};
|
|
347860
|
-
|
|
347861
|
-
return TabPanel;
|
|
347862
|
-
}(external_react_.Component);
|
|
347863
|
-
|
|
347864
|
-
TabPanel.defaultProps = {
|
|
347703
|
+
var TabPanel_defaultProps = {
|
|
347865
347704
|
className: TabPanel_DEFAULT_CLASS,
|
|
347866
347705
|
forceRender: false,
|
|
347867
347706
|
selectedClassName: TabPanel_DEFAULT_CLASS + "--selected"
|
|
347868
347707
|
};
|
|
347708
|
+
var TabPanel_propTypes = false ? 0 : {};
|
|
347709
|
+
|
|
347710
|
+
var TabPanel = function TabPanel(props) {
|
|
347711
|
+
var _cx;
|
|
347712
|
+
|
|
347713
|
+
var children = props.children,
|
|
347714
|
+
className = props.className,
|
|
347715
|
+
forceRender = props.forceRender,
|
|
347716
|
+
id = props.id,
|
|
347717
|
+
selected = props.selected,
|
|
347718
|
+
selectedClassName = props.selectedClassName,
|
|
347719
|
+
tabId = props.tabId,
|
|
347720
|
+
attributes = TabPanel_objectWithoutPropertiesLoose(props, TabPanel_excluded);
|
|
347721
|
+
|
|
347722
|
+
return /*#__PURE__*/external_react_["default"].createElement("div", TabPanel_extends({}, attributes, {
|
|
347723
|
+
className: (0,clsx_m/* default */.A)(className, (_cx = {}, _cx[selectedClassName] = selected, _cx)),
|
|
347724
|
+
role: "tabpanel",
|
|
347725
|
+
id: id,
|
|
347726
|
+
"aria-labelledby": tabId
|
|
347727
|
+
}), forceRender || selected ? children : null);
|
|
347728
|
+
};
|
|
347869
347729
|
|
|
347870
|
-
TabPanel.propTypes = false ? 0 : {};
|
|
347871
347730
|
TabPanel.tabsRole = 'TabPanel';
|
|
347731
|
+
TabPanel.propTypes = false ? 0 : {};
|
|
347732
|
+
TabPanel.defaultProps = TabPanel_defaultProps;
|
|
347733
|
+
/* harmony default export */ const components_TabPanel = (TabPanel);
|
|
347872
347734
|
;// ./node_modules/react-tabs/esm/index.js
|
|
347873
347735
|
|
|
347874
347736
|
|
|
@@ -369132,7 +368994,7 @@ const HistoryButton = ({ className }) => {
|
|
|
369132
368994
|
const handleClick = () => {
|
|
369133
368995
|
setIsContextOpen((prev) => !prev);
|
|
369134
368996
|
};
|
|
369135
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.btnContainer, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Nothing here yet! Once you save your work, versions will appear here so you can restore them.", visible: hovered && !commits?.length, position: "bottom" }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Load previous versions", visible: hovered && !!commits?.length, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: ref, className: (0, classnames_1.default)(styles_module_scss_1.default.historyButton, className, {
|
|
368997
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.btnContainer, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Nothing here yet! Once you save your work, versions will appear here so you can restore them.", visible: hovered && !commits?.length, position: "bottom" }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Load previous versions", visible: hovered && !!commits?.length, position: "bottom", size: "fit" }), (0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: ref, className: (0, classnames_1.default)(styles_module_scss_1.default.historyButton, className, {
|
|
369136
368998
|
[styles_module_scss_1.default.historyActive]: isContextOpen,
|
|
369137
368999
|
}), variant: "tertiary", onClickHandler: handleClick, ButtonIcon: () => (0, SvgIcon_1.SvgIcon)({ SvgElement: history_svg_1.default, size: 24 }), disabled: !commits?.length })] }), (0, jsx_runtime_1.jsx)(CommitHistoryMenu_1.CommitHistoryMenu, { isOpen: isContextOpen, onClose: () => setIsContextOpen(false), commits: commits, btnRef: ref, activeCommitId: project.commitId ?? undefined })] }));
|
|
369138
369000
|
};
|
|
@@ -369188,7 +369050,7 @@ const DownloadButton = (props) => {
|
|
|
369188
369050
|
const { zipBlob: content } = await (0, createProjectArchive_1.createProjectArchive)(project);
|
|
369189
369051
|
file_saver_1.default.saveAs(content, `${(0, js_convert_case_1.toSnakeCase)(project.name || "untitled_project")}.zip`);
|
|
369190
369052
|
};
|
|
369191
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: download_svg_1.default, size: 24 }), onClickHandler: onClickDownload, ...props }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Download project", visible: hovered, position: "bottom" })] }));
|
|
369053
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, style: { position: "relative" }, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: download_svg_1.default, size: 24 }), onClickHandler: onClickDownload, ...props }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Download project files", visible: hovered, position: "bottom", size: "fit" })] }));
|
|
369192
369054
|
};
|
|
369193
369055
|
exports["default"] = DownloadButton;
|
|
369194
369056
|
|
|
@@ -369311,19 +369173,15 @@ const EditorInput = () => {
|
|
|
369311
369173
|
const isMobile = (0, react_responsive_1.useMediaQuery)({ query: mediaQueryBreakpoints_1.MOBILE_MEDIA_QUERY });
|
|
369312
369174
|
const [numberOfComponents, setNumberOfComponents] = (0, react_1.useState)(project?.components?.length);
|
|
369313
369175
|
const [fileNames, setFileNames] = (0, react_1.useState)();
|
|
369314
|
-
const
|
|
369315
|
-
const
|
|
369316
|
-
|
|
369317
|
-
// Open the default file on first project load only if no file is open yet
|
|
369176
|
+
const defaultFile = (0, react_1.useMemo)(() => (0, projectHelpers_1.resolveDefaultFile)(project), [project]);
|
|
369177
|
+
const defaultFileName = defaultFile?.fullName ?? null;
|
|
369178
|
+
const justLoaded = (0, stores_1.useAppSelector)((state) => state.editor.justLoaded);
|
|
369318
369179
|
(0, react_1.useEffect)(() => {
|
|
369319
|
-
if (!
|
|
369180
|
+
if (!justLoaded || !defaultFile)
|
|
369320
369181
|
return;
|
|
369321
|
-
|
|
369322
|
-
if (!hasOpenFile && defaultFile) {
|
|
369323
|
-
dispatch((0, EditorSlice_1.openFile)({ id: defaultFile.id }));
|
|
369324
|
-
}
|
|
369182
|
+
dispatch((0, EditorSlice_1.openFile)({ id: defaultFile.id }));
|
|
369325
369183
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
369326
|
-
}, []);
|
|
369184
|
+
}, [justLoaded]);
|
|
369327
369185
|
const onDragStart = (input) => {
|
|
369328
369186
|
const { source } = input;
|
|
369329
369187
|
const unifiedIdx = fileOnlyToUnifiedIndex(unifiedTabs, source.index);
|
|
@@ -369567,14 +369425,48 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
369567
369425
|
};
|
|
369568
369426
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369569
369427
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
369428
|
+
const react_1 = __webpack_require__(51649);
|
|
369570
369429
|
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
369571
369430
|
const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
|
|
369572
369431
|
const LogRenderer_1 = __importDefault(__webpack_require__(67278));
|
|
369573
369432
|
const SvgIcon_1 = __webpack_require__(82917);
|
|
369574
369433
|
const alert_svg_1 = __importDefault(__webpack_require__(11367));
|
|
369575
369434
|
const alertTriangle_svg_1 = __importDefault(__webpack_require__(30103));
|
|
369435
|
+
const consoleScroll_1 = __webpack_require__(27955);
|
|
369576
369436
|
function HtmlConsole({ consoleLogs, }) {
|
|
369577
|
-
|
|
369437
|
+
const containerRef = (0, react_1.useRef)(null);
|
|
369438
|
+
const stickToBottomRef = (0, react_1.useRef)(true);
|
|
369439
|
+
const handleScroll = () => {
|
|
369440
|
+
const el = containerRef.current;
|
|
369441
|
+
if (el)
|
|
369442
|
+
stickToBottomRef.current = (0, consoleScroll_1.isNearBottom)(el);
|
|
369443
|
+
};
|
|
369444
|
+
(0, react_1.useEffect)(() => {
|
|
369445
|
+
const el = containerRef.current;
|
|
369446
|
+
if (!el)
|
|
369447
|
+
return;
|
|
369448
|
+
if (consoleLogs.length === 0) {
|
|
369449
|
+
stickToBottomRef.current = true;
|
|
369450
|
+
return;
|
|
369451
|
+
}
|
|
369452
|
+
if (stickToBottomRef.current) {
|
|
369453
|
+
(0, consoleScroll_1.scrollToBottom)(el);
|
|
369454
|
+
}
|
|
369455
|
+
}, [consoleLogs]);
|
|
369456
|
+
// in full-window the console can be hidden (zero size) while logs stream;
|
|
369457
|
+
// when it becomes visible again, pin it to the bottom
|
|
369458
|
+
(0, react_1.useEffect)(() => {
|
|
369459
|
+
const el = containerRef.current;
|
|
369460
|
+
if (!el || typeof ResizeObserver === "undefined")
|
|
369461
|
+
return;
|
|
369462
|
+
const observer = new ResizeObserver(() => {
|
|
369463
|
+
if (stickToBottomRef.current)
|
|
369464
|
+
(0, consoleScroll_1.scrollToBottom)(el);
|
|
369465
|
+
});
|
|
369466
|
+
observer.observe(el);
|
|
369467
|
+
return () => observer.disconnect();
|
|
369468
|
+
}, []);
|
|
369469
|
+
return ((0, jsx_runtime_1.jsx)("pre", { className: (0, classnames_1.default)(styles_module_scss_1.default.console, styles_module_scss_1.default.webConsole), ref: containerRef, onScroll: handleScroll, children: consoleLogs.length === 0 ? ((0, jsx_runtime_1.jsx)("span", { children: "No logs received yet" })) : (consoleLogs.map((log, i) => {
|
|
369578
369470
|
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.webConsoleLine, styles_module_scss_1.default[log.method]), children: [(0, jsx_runtime_1.jsxs)("span", { children: [(log.method === "error" || log.method === "warn") && ((0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: log.method === "error" ? alert_svg_1.default : alertTriangle_svg_1.default, size: 12, className: log.method === "error"
|
|
369579
369471
|
? styles_module_scss_1.default.errorIcon
|
|
369580
369472
|
: styles_module_scss_1.default.warnIcon })), log.timestamp && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.timestamp, children: log.timestamp }))] }), (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.consoleMessageContent, children: (0, jsx_runtime_1.jsxs)("span", { className: styles_module_scss_1.default.consoleMessageInline, children: [log.data?.map((node, idx) => ((0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)(LogRenderer_1.default, { node: node }), log.data && idx < log.data.length - 1 && " "] }, idx))), log.count && log.count > 1 && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.consoleCount, children: log.count }))] }) })] }, i));
|
|
@@ -370237,6 +370129,7 @@ const scripts_1 = __webpack_require__(57621);
|
|
|
370237
370129
|
const Errors_1 = __webpack_require__(20339);
|
|
370238
370130
|
const NotFoundPage_1 = __webpack_require__(87931);
|
|
370239
370131
|
const HtmlConsole_1 = __importDefault(__webpack_require__(55339));
|
|
370132
|
+
const useIframeHost_1 = __importDefault(__webpack_require__(86970));
|
|
370240
370133
|
const BROADCAST_CHANNEL = "html_runner_channel";
|
|
370241
370134
|
var BroadcastMessageType;
|
|
370242
370135
|
(function (BroadcastMessageType) {
|
|
@@ -370257,9 +370150,7 @@ const useHtmlRunner = () => {
|
|
|
370257
370150
|
const codeHasBeenRun = (0, stores_1.useAppSelector)((state) => state.editor.codeHasBeenRun);
|
|
370258
370151
|
const page = (0, stores_1.useAppSelector)((state) => state.editor.page);
|
|
370259
370152
|
const isPreviewMode = (0, stores_1.useAppSelector)((state) => state.editor.isOutputOnly);
|
|
370260
|
-
const viewMode = (0, stores_1.useAppSelector)((state) => state.editor.viewMode);
|
|
370261
370153
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
370262
|
-
const output = (0, react_1.useRef)(null);
|
|
370263
370154
|
const [searchParams] = (0, react_router_dom_1.useSearchParams)();
|
|
370264
370155
|
// Using BroadcastChannel to communicate between the main app and the preview tab
|
|
370265
370156
|
const broadcastChannel = (0, react_1.useRef)(null);
|
|
@@ -370269,7 +370160,13 @@ const useHtmlRunner = () => {
|
|
|
370269
370160
|
// In the standalone preview tab (and any ?preview=1 URL) the browser's
|
|
370270
370161
|
// back/forward/refresh buttons must drive page navigation.
|
|
370271
370162
|
const shouldUseBrowserHistory = isPreviewMode || isPreviewUrl;
|
|
370272
|
-
const
|
|
370163
|
+
const { output, createIframe, mountPreview } = (0, useIframeHost_1.default)({
|
|
370164
|
+
codeHasBeenRun,
|
|
370165
|
+
error,
|
|
370166
|
+
page,
|
|
370167
|
+
isPreviewMode,
|
|
370168
|
+
onIframeLoad: () => iframeReload(),
|
|
370169
|
+
});
|
|
370273
370170
|
(0, react_1.useEffect)(() => {
|
|
370274
370171
|
shouldUseBrowserHistoryRef.current = shouldUseBrowserHistory;
|
|
370275
370172
|
}, [shouldUseBrowserHistory]);
|
|
@@ -370409,8 +370306,8 @@ const useHtmlRunner = () => {
|
|
|
370409
370306
|
}, []);
|
|
370410
370307
|
(0, react_1.useEffect)(() => {
|
|
370411
370308
|
if (codeRunTriggered) {
|
|
370412
|
-
//
|
|
370413
|
-
|
|
370309
|
+
// Fresh iframe for each run (clean slate); it persists across view switches
|
|
370310
|
+
createIframe();
|
|
370414
370311
|
runCode();
|
|
370415
370312
|
if (!isPreviewMode) {
|
|
370416
370313
|
broadcastChannel.current?.postMessage({
|
|
@@ -370419,19 +370316,6 @@ const useHtmlRunner = () => {
|
|
|
370419
370316
|
}
|
|
370420
370317
|
}
|
|
370421
370318
|
}, [codeRunTriggered, page, isPreviewMode]);
|
|
370422
|
-
// When viewMode changes, the iframe is unmounted under a
|
|
370423
|
-
// different parent (TabsContainer vs OutputStack), wiping its srcdoc. If the
|
|
370424
|
-
// user had already run the project, re-trigger so the preview is restored
|
|
370425
|
-
const didMountForViewMode = (0, react_1.useRef)(false);
|
|
370426
|
-
(0, react_1.useEffect)(() => {
|
|
370427
|
-
if (!didMountForViewMode.current) {
|
|
370428
|
-
didMountForViewMode.current = true;
|
|
370429
|
-
return;
|
|
370430
|
-
}
|
|
370431
|
-
if (codeHasBeenRun) {
|
|
370432
|
-
dispatch((0, EditorSlice_1.triggerCodeRun)());
|
|
370433
|
-
}
|
|
370434
|
-
}, [viewMode]);
|
|
370435
370319
|
(0, react_1.useEffect)(() => {
|
|
370436
370320
|
if (!currentPageParam)
|
|
370437
370321
|
return;
|
|
@@ -370517,8 +370401,9 @@ const useHtmlRunner = () => {
|
|
|
370517
370401
|
if (error) {
|
|
370518
370402
|
return ((0, jsx_runtime_1.jsx)("div", { className: iframeClasses, children: (0, jsx_runtime_1.jsx)(NotFoundPage_1.NotFoundPage, {}) }));
|
|
370519
370403
|
}
|
|
370520
|
-
|
|
370521
|
-
|
|
370404
|
+
// placeholder div - the real iframe is positioned over this
|
|
370405
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: mountPreview, className: styles_module_scss_1.default.previewSlot });
|
|
370406
|
+
}, [error, iframeClasses, mountPreview]);
|
|
370522
370407
|
const renderConsoleOutput = (0, react_1.useCallback)(() => (0, jsx_runtime_1.jsx)(HtmlConsole_1.default, { consoleLogs: consoleLogs }), [consoleLogs]);
|
|
370523
370408
|
const outputMeta = {
|
|
370524
370409
|
[EditorTypes_1.OutputType.VISUAL]: {
|
|
@@ -370540,6 +370425,170 @@ const useHtmlRunner = () => {
|
|
|
370540
370425
|
exports["default"] = useHtmlRunner;
|
|
370541
370426
|
|
|
370542
370427
|
|
|
370428
|
+
/***/ }),
|
|
370429
|
+
|
|
370430
|
+
/***/ 86970:
|
|
370431
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
370432
|
+
|
|
370433
|
+
|
|
370434
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
370435
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
370436
|
+
};
|
|
370437
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
370438
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
370439
|
+
const react_1 = __webpack_require__(51649);
|
|
370440
|
+
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
370441
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
|
|
370442
|
+
const IFRAME_ALLOW = `
|
|
370443
|
+
accelerometer 'none';
|
|
370444
|
+
camera 'none';
|
|
370445
|
+
encrypted-media;
|
|
370446
|
+
fullscreen;
|
|
370447
|
+
picture-in-picture;
|
|
370448
|
+
geolocation 'none';
|
|
370449
|
+
gyroscope 'none';
|
|
370450
|
+
magnetometer 'none';
|
|
370451
|
+
microphone 'none';
|
|
370452
|
+
midi 'none';
|
|
370453
|
+
payment 'none';
|
|
370454
|
+
usb 'none';
|
|
370455
|
+
`;
|
|
370456
|
+
/**
|
|
370457
|
+
* Owns the persistent, body-mounted iframe host and keeps it visually glued to
|
|
370458
|
+
* whichever placeholder slot is currently mounted
|
|
370459
|
+
*/
|
|
370460
|
+
const useIframeHost = ({ codeHasBeenRun, error, page, isPreviewMode, onIframeLoad, }) => {
|
|
370461
|
+
const output = (0, react_1.useRef)(null);
|
|
370462
|
+
// Refs to the persistent iframe host and the currently active slot
|
|
370463
|
+
const hostRef = (0, react_1.useRef)(null);
|
|
370464
|
+
const slotRef = (0, react_1.useRef)(null);
|
|
370465
|
+
const [slotVersion, setSlotVersion] = (0, react_1.useState)(0);
|
|
370466
|
+
const [hostReady, setHostReady] = (0, react_1.useState)(false);
|
|
370467
|
+
// Latest-value mirrors so the stable callbacks below never read stale state
|
|
370468
|
+
const codeHasBeenRunRef = (0, react_1.useRef)(codeHasBeenRun);
|
|
370469
|
+
const errorRef = (0, react_1.useRef)(error);
|
|
370470
|
+
const iframeReloadRef = (0, react_1.useRef)(onIframeLoad);
|
|
370471
|
+
const applyIframeClass = (0, react_1.useCallback)((iframe) => {
|
|
370472
|
+
iframe.className = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
|
|
370473
|
+
[styles_module_scss_1.default.codeHasBeenRun]: codeHasBeenRunRef.current,
|
|
370474
|
+
});
|
|
370475
|
+
}, []);
|
|
370476
|
+
// Build a fresh iframe inside the persistent host
|
|
370477
|
+
const createIframe = (0, react_1.useCallback)(() => {
|
|
370478
|
+
const host = hostRef.current;
|
|
370479
|
+
if (!host || typeof document === "undefined")
|
|
370480
|
+
return;
|
|
370481
|
+
// Remove old iframe before building a new one
|
|
370482
|
+
const previous = output.current;
|
|
370483
|
+
if (previous && previous.parentNode === host) {
|
|
370484
|
+
host.removeChild(previous);
|
|
370485
|
+
}
|
|
370486
|
+
const iframe = document.createElement("iframe");
|
|
370487
|
+
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin allow-modals allow-popups allow-popups-to-escape-sandbox");
|
|
370488
|
+
iframe.setAttribute("referrerpolicy", "strict-origin-when-cross-origin");
|
|
370489
|
+
iframe.setAttribute("allow", IFRAME_ALLOW);
|
|
370490
|
+
iframe.id = "output-frame";
|
|
370491
|
+
iframe.title = "HTML Output Preview";
|
|
370492
|
+
applyIframeClass(iframe);
|
|
370493
|
+
iframe.addEventListener("load", () => iframeReloadRef.current());
|
|
370494
|
+
iframe.src = "about:blank";
|
|
370495
|
+
host.appendChild(iframe);
|
|
370496
|
+
output.current = iframe;
|
|
370497
|
+
}, [applyIframeClass]);
|
|
370498
|
+
// Glue the host to the currently mounted slot; hide it when there is no
|
|
370499
|
+
// visible slot (wrong full-window tab, error state, or unmounted layout)
|
|
370500
|
+
const positionIframe = (0, react_1.useCallback)(() => {
|
|
370501
|
+
const host = hostRef.current;
|
|
370502
|
+
const slot = slotRef.current;
|
|
370503
|
+
if (!host)
|
|
370504
|
+
return;
|
|
370505
|
+
if (!slot || !slot.isConnected || errorRef.current) {
|
|
370506
|
+
host.style.display = "none";
|
|
370507
|
+
return;
|
|
370508
|
+
}
|
|
370509
|
+
const rect = slot.getBoundingClientRect();
|
|
370510
|
+
if (rect.width === 0 && rect.height === 0) {
|
|
370511
|
+
host.style.display = "none";
|
|
370512
|
+
return;
|
|
370513
|
+
}
|
|
370514
|
+
// Match the host to the slot's box. getBoundingClientRect() is
|
|
370515
|
+
// viewport-relative, but the host is position:absolute (document-relative),
|
|
370516
|
+
// so add the scroll offset to convert top/left into document coords —
|
|
370517
|
+
// otherwise the host drifts by the scroll amount.
|
|
370518
|
+
host.style.display = "block";
|
|
370519
|
+
host.style.top = `${rect.top + window.scrollY}px`;
|
|
370520
|
+
host.style.left = `${rect.left + window.scrollX}px`;
|
|
370521
|
+
host.style.width = `${rect.width}px`;
|
|
370522
|
+
host.style.height = `${rect.height}px`;
|
|
370523
|
+
}, []);
|
|
370524
|
+
// Slot ref-callback handed to renderVisualOutput (kept dumb): records the
|
|
370525
|
+
// active slot node and bumps a version so the observer effect re-binds.
|
|
370526
|
+
const mountPreview = (0, react_1.useCallback)((node) => {
|
|
370527
|
+
slotRef.current = node;
|
|
370528
|
+
setSlotVersion((v) => v + 1);
|
|
370529
|
+
}, []);
|
|
370530
|
+
// Create the persistent host + iframe once; tear it down on unmount
|
|
370531
|
+
(0, react_1.useEffect)(() => {
|
|
370532
|
+
if (typeof document === "undefined")
|
|
370533
|
+
return;
|
|
370534
|
+
const host = document.createElement("div");
|
|
370535
|
+
host.className = styles_module_scss_1.default.previewHost;
|
|
370536
|
+
document.body.appendChild(host);
|
|
370537
|
+
hostRef.current = host;
|
|
370538
|
+
createIframe();
|
|
370539
|
+
setHostReady(true);
|
|
370540
|
+
return () => {
|
|
370541
|
+
const iframe = output.current;
|
|
370542
|
+
if (iframe && iframe.parentNode === host)
|
|
370543
|
+
host.removeChild(iframe);
|
|
370544
|
+
if (host.parentNode)
|
|
370545
|
+
document.body.removeChild(host);
|
|
370546
|
+
hostRef.current = null;
|
|
370547
|
+
output.current = null;
|
|
370548
|
+
};
|
|
370549
|
+
}, [createIframe]);
|
|
370550
|
+
// Keep the host aligned with the active slot across resizes/scrolls/switches
|
|
370551
|
+
(0, react_1.useEffect)(() => {
|
|
370552
|
+
if (!hostReady)
|
|
370553
|
+
return;
|
|
370554
|
+
positionIframe();
|
|
370555
|
+
const slot = slotRef.current;
|
|
370556
|
+
const onChange = () => positionIframe();
|
|
370557
|
+
window.addEventListener("resize", onChange);
|
|
370558
|
+
window.addEventListener("scroll", onChange, true);
|
|
370559
|
+
let observer;
|
|
370560
|
+
if (slot && typeof ResizeObserver !== "undefined") {
|
|
370561
|
+
observer = new ResizeObserver(onChange);
|
|
370562
|
+
observer.observe(slot);
|
|
370563
|
+
}
|
|
370564
|
+
return () => {
|
|
370565
|
+
window.removeEventListener("resize", onChange);
|
|
370566
|
+
window.removeEventListener("scroll", onChange, true);
|
|
370567
|
+
observer?.disconnect();
|
|
370568
|
+
};
|
|
370569
|
+
}, [hostReady, slotVersion, positionIframe]);
|
|
370570
|
+
// Re-apply class + reposition when run/error/page state changes
|
|
370571
|
+
(0, react_1.useEffect)(() => {
|
|
370572
|
+
if (output.current)
|
|
370573
|
+
applyIframeClass(output.current);
|
|
370574
|
+
positionIframe();
|
|
370575
|
+
}, [
|
|
370576
|
+
codeHasBeenRun,
|
|
370577
|
+
error,
|
|
370578
|
+
page,
|
|
370579
|
+
isPreviewMode,
|
|
370580
|
+
applyIframeClass,
|
|
370581
|
+
positionIframe,
|
|
370582
|
+
]);
|
|
370583
|
+
// Keep the latest-value mirrors in sync for the stable iframe callbacks
|
|
370584
|
+
codeHasBeenRunRef.current = codeHasBeenRun;
|
|
370585
|
+
errorRef.current = error;
|
|
370586
|
+
iframeReloadRef.current = onIframeLoad;
|
|
370587
|
+
return { output, hostReady, createIframe, mountPreview };
|
|
370588
|
+
};
|
|
370589
|
+
exports["default"] = useIframeHost;
|
|
370590
|
+
|
|
370591
|
+
|
|
370543
370592
|
/***/ }),
|
|
370544
370593
|
|
|
370545
370594
|
/***/ 2996:
|
|
@@ -370662,6 +370711,13 @@ const VisualOutputPane = ({ visuals, setVisuals }) => {
|
|
|
370662
370711
|
return visual;
|
|
370663
370712
|
}, []);
|
|
370664
370713
|
const showVisuals = (0, react_1.useCallback)((visuals, output) => visuals.map((v) => (v.showing ? v : showVisual(v, output))), [showVisual]);
|
|
370714
|
+
// repaint visual output if view switched (2/3 window view - full window view)
|
|
370715
|
+
(0, react_1.useEffect)(() => {
|
|
370716
|
+
if (visuals.length) {
|
|
370717
|
+
setVisuals((vs) => vs.map((v) => ({ ...v, showing: false })));
|
|
370718
|
+
}
|
|
370719
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
370720
|
+
}, []);
|
|
370665
370721
|
(0, react_1.useEffect)(() => {
|
|
370666
370722
|
if (visuals.length === 0 && output.current) {
|
|
370667
370723
|
if (output.current) {
|
|
@@ -370795,9 +370851,12 @@ exports.SERVICE_WORKER_PROBE_TIMEOUT_MS = 1500;
|
|
|
370795
370851
|
/***/ }),
|
|
370796
370852
|
|
|
370797
370853
|
/***/ 65587:
|
|
370798
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
370854
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
370799
370855
|
|
|
370800
370856
|
|
|
370857
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
370858
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
370859
|
+
};
|
|
370801
370860
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
370802
370861
|
exports.usePyodideRunner = void 0;
|
|
370803
370862
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
@@ -370813,12 +370872,14 @@ const assetUrls_1 = __webpack_require__(85799);
|
|
|
370813
370872
|
const helpers_1 = __webpack_require__(55717);
|
|
370814
370873
|
const consoleInput_1 = __webpack_require__(35660);
|
|
370815
370874
|
const consoleOutput_1 = __webpack_require__(98131);
|
|
370875
|
+
const consoleScroll_1 = __webpack_require__(27955);
|
|
370816
370876
|
const fileWrite_1 = __webpack_require__(45230);
|
|
370817
370877
|
const serviceWorker_1 = __webpack_require__(58158);
|
|
370818
370878
|
const stdinFallbackMessages_1 = __webpack_require__(94879);
|
|
370819
370879
|
const tabId_1 = __webpack_require__(95369);
|
|
370820
370880
|
const usePyodideWorker_1 = __webpack_require__(93895);
|
|
370821
370881
|
const useStdinServiceWorker_1 = __webpack_require__(86357);
|
|
370882
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
|
|
370822
370883
|
/**
|
|
370823
370884
|
* Top-level coordinator for the Pyodide runner.
|
|
370824
370885
|
*
|
|
@@ -370865,7 +370926,21 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
370865
370926
|
// -------------------------------------------------------------------------
|
|
370866
370927
|
// Component-managed state
|
|
370867
370928
|
// -------------------------------------------------------------------------
|
|
370929
|
+
// create python terminal <pre> element once in order to survive view-mode switches
|
|
370930
|
+
// when switch happens, we move this node between layouts via `mountConsole`
|
|
370868
370931
|
const output = (0, react_1.useRef)(null);
|
|
370932
|
+
if (output.current === null && typeof document !== "undefined") {
|
|
370933
|
+
const pre = document.createElement("pre");
|
|
370934
|
+
pre.className = styles_module_scss_1.default.console ?? "";
|
|
370935
|
+
output.current = pre;
|
|
370936
|
+
}
|
|
370937
|
+
// re-parent <pre> into the currently mounted layout slot
|
|
370938
|
+
const mountConsole = (0, react_1.useCallback)((container) => {
|
|
370939
|
+
const pre = output.current;
|
|
370940
|
+
if (container && pre && pre.parentNode !== container) {
|
|
370941
|
+
container.appendChild(pre); // move <pre> into the new layout's slot
|
|
370942
|
+
}
|
|
370943
|
+
}, []);
|
|
370869
370944
|
const [visuals, setVisuals] = (0, react_1.useState)([]);
|
|
370870
370945
|
// -------------------------------------------------------------------------
|
|
370871
370946
|
// Local helpers
|
|
@@ -370935,6 +371010,8 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
370935
371010
|
}
|
|
370936
371011
|
const outputPane = output.current;
|
|
370937
371012
|
outputPane?.appendChild((0, consoleInput_1.inputSpan)());
|
|
371013
|
+
// Always scroll the input prompt into view, even if user scrolled up
|
|
371014
|
+
(0, consoleScroll_1.scrollToBottom)(outputPane);
|
|
370938
371015
|
const element = (0, consoleInput_1.getInputElement)();
|
|
370939
371016
|
if (!element) {
|
|
370940
371017
|
return;
|
|
@@ -371259,6 +371336,7 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
371259
371336
|
}, [codeRunStopped]);
|
|
371260
371337
|
return {
|
|
371261
371338
|
output,
|
|
371339
|
+
mountConsole,
|
|
371262
371340
|
visuals,
|
|
371263
371341
|
setVisuals,
|
|
371264
371342
|
workerInitialized: Boolean(pyodideWorker),
|
|
@@ -371614,21 +371692,29 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
371614
371692
|
exports.appendConsoleLine = void 0;
|
|
371615
371693
|
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
371616
371694
|
const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
|
|
371695
|
+
const consoleScroll_1 = __webpack_require__(27955);
|
|
371617
371696
|
/**
|
|
371618
371697
|
* Append a line of Python stdout/stderr to the console `pre` element.
|
|
371619
371698
|
*
|
|
371620
371699
|
* The element's innerHTML is set via `new Option(...).innerHTML` to escape
|
|
371621
371700
|
* any HTML control characters in the worker's output.
|
|
371701
|
+
*
|
|
371702
|
+
* Auto-scroll follows a "stick to bottom" rule: we only chase the newest line
|
|
371703
|
+
* if the user was already at the bottom. If the user scrolled up to read
|
|
371704
|
+
* earlier output, we leave its position as-is.
|
|
371622
371705
|
*/
|
|
371623
371706
|
const appendConsoleLine = (outputElement, stream, content) => {
|
|
371624
371707
|
if (!outputElement) {
|
|
371625
371708
|
return;
|
|
371626
371709
|
}
|
|
371710
|
+
const stick = (0, consoleScroll_1.isNearBottom)(outputElement);
|
|
371627
371711
|
const span = document.createElement("span");
|
|
371628
371712
|
span.className = (0, classnames_1.default)(styles_module_scss_1.default.pythonConsoleLine, stream === "stderr" && styles_module_scss_1.default["stderr"], stream === "stdout" && styles_module_scss_1.default["stdout"]);
|
|
371629
371713
|
span.innerHTML = new Option(content || " ").innerHTML + "\n";
|
|
371630
371714
|
outputElement.appendChild(span);
|
|
371631
|
-
|
|
371715
|
+
if (stick) {
|
|
371716
|
+
(0, consoleScroll_1.scrollToBottom)(outputElement);
|
|
371717
|
+
}
|
|
371632
371718
|
};
|
|
371633
371719
|
exports.appendConsoleLine = appendConsoleLine;
|
|
371634
371720
|
|
|
@@ -371741,40 +371827,42 @@ const waitForServiceWorkerControl = (timeoutMs = constants_1.SERVICE_WORKER_CONT
|
|
|
371741
371827
|
});
|
|
371742
371828
|
exports.waitForServiceWorkerControl = waitForServiceWorkerControl;
|
|
371743
371829
|
/**
|
|
371744
|
-
* Probe the stdin Service Worker
|
|
371745
|
-
* intercepting
|
|
371746
|
-
*
|
|
371747
|
-
*
|
|
371830
|
+
* Probe the stdin Service Worker via postMessage to confirm it's actually
|
|
371831
|
+
* intercepting messages. The SW replies with PYODIDE_STDIN_PROBE_ACK when it
|
|
371832
|
+
* receives a PYODIDE_STDIN_PROBE message. Using postMessage avoids the HTTP
|
|
371833
|
+
* 400 probe response appearing in the browser's DevTools console.
|
|
371748
371834
|
*/
|
|
371749
|
-
const verifyStdinServiceWorkerRoute =
|
|
371835
|
+
const verifyStdinServiceWorkerRoute = (timeoutMs = constants_1.SERVICE_WORKER_PROBE_TIMEOUT_MS) => {
|
|
371750
371836
|
if (typeof window === "undefined") {
|
|
371751
|
-
return false;
|
|
371837
|
+
return Promise.resolve(false);
|
|
371752
371838
|
}
|
|
371753
371839
|
if (!("serviceWorker" in navigator)) {
|
|
371754
|
-
return false;
|
|
371840
|
+
return Promise.resolve(false);
|
|
371755
371841
|
}
|
|
371756
371842
|
if (!navigator.serviceWorker.controller) {
|
|
371757
|
-
return false;
|
|
371843
|
+
return Promise.resolve(false);
|
|
371758
371844
|
}
|
|
371759
|
-
|
|
371760
|
-
|
|
371761
|
-
|
|
371762
|
-
|
|
371763
|
-
|
|
371764
|
-
|
|
371765
|
-
|
|
371766
|
-
|
|
371767
|
-
|
|
371845
|
+
return new Promise((resolve) => {
|
|
371846
|
+
let settled = false;
|
|
371847
|
+
const finish = (result) => {
|
|
371848
|
+
if (settled)
|
|
371849
|
+
return;
|
|
371850
|
+
settled = true;
|
|
371851
|
+
window.clearTimeout(timeoutId);
|
|
371852
|
+
navigator.serviceWorker.removeEventListener("message", onMessage);
|
|
371853
|
+
resolve(result);
|
|
371854
|
+
};
|
|
371855
|
+
const onMessage = (event) => {
|
|
371856
|
+
if (event.data?.type === "PYODIDE_STDIN_PROBE_ACK") {
|
|
371857
|
+
finish(true);
|
|
371858
|
+
}
|
|
371859
|
+
};
|
|
371860
|
+
const timeoutId = window.setTimeout(() => finish(false), timeoutMs);
|
|
371861
|
+
navigator.serviceWorker.addEventListener("message", onMessage);
|
|
371862
|
+
navigator.serviceWorker.controller.postMessage({
|
|
371863
|
+
type: "PYODIDE_STDIN_PROBE",
|
|
371768
371864
|
});
|
|
371769
|
-
|
|
371770
|
-
return response.status === 400;
|
|
371771
|
-
}
|
|
371772
|
-
catch (_) {
|
|
371773
|
-
return false;
|
|
371774
|
-
}
|
|
371775
|
-
finally {
|
|
371776
|
-
window.clearTimeout(timeoutId);
|
|
371777
|
-
}
|
|
371865
|
+
});
|
|
371778
371866
|
};
|
|
371779
371867
|
exports.verifyStdinServiceWorkerRoute = verifyStdinServiceWorkerRoute;
|
|
371780
371868
|
/**
|
|
@@ -371950,7 +372038,7 @@ const consoleInput_1 = __webpack_require__(35660);
|
|
|
371950
372038
|
const usePythonRunner = ({ active, packageApiUrl, }) => {
|
|
371951
372039
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
371952
372040
|
const activeRunner = (0, stores_1.useAppSelector)((state) => state.editor.activeRunner);
|
|
371953
|
-
const {
|
|
372041
|
+
const { mountConsole, visuals, setVisuals } = (0, usePyodideRunner_1.usePyodideRunner)({
|
|
371954
372042
|
active,
|
|
371955
372043
|
packageApiUrl,
|
|
371956
372044
|
});
|
|
@@ -371959,7 +372047,7 @@ const usePythonRunner = ({ active, packageApiUrl, }) => {
|
|
|
371959
372047
|
dispatch((0, EditorSlice_1.loadingRunner)(EditorTypes_1.RunnerType.PYODIDE));
|
|
371960
372048
|
}
|
|
371961
372049
|
}, [active, activeRunner, dispatch]);
|
|
371962
|
-
const renderConsoleOutput = (0, react_1.useCallback)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ErrorMessage_1.default, {}), (0, jsx_runtime_1.jsx)("
|
|
372050
|
+
const renderConsoleOutput = (0, react_1.useCallback)(() => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ErrorMessage_1.default, {}), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.consoleMount, onClick: consoleInput_1.shiftFocusToInput, ref: mountConsole })] })), [mountConsole]);
|
|
371963
372051
|
const renderVisualOutput = (0, react_1.useCallback)(() => ((0, jsx_runtime_1.jsx)(VisualOutputPane_1.default, { visuals: visuals, setVisuals: setVisuals })), [visuals, setVisuals]);
|
|
371964
372052
|
const outputMeta = {
|
|
371965
372053
|
[EditorTypes_1.OutputType.VISUAL]: { label: "VNC", icon: preview_svg_1.default },
|
|
@@ -371974,6 +372062,28 @@ const usePythonRunner = ({ active, packageApiUrl, }) => {
|
|
|
371974
372062
|
exports["default"] = usePythonRunner;
|
|
371975
372063
|
|
|
371976
372064
|
|
|
372065
|
+
/***/ }),
|
|
372066
|
+
|
|
372067
|
+
/***/ 27955:
|
|
372068
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
372069
|
+
|
|
372070
|
+
|
|
372071
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
372072
|
+
exports.scrollToBottom = exports.isNearBottom = exports.STICK_THRESHOLD = void 0;
|
|
372073
|
+
// How many px are counted as "at the bottom"
|
|
372074
|
+
exports.STICK_THRESHOLD = 24;
|
|
372075
|
+
// True when the element is scrolled to (or within the threshold of) the bottom
|
|
372076
|
+
const isNearBottom = (el) => el.scrollHeight - el.scrollTop - el.clientHeight <= exports.STICK_THRESHOLD;
|
|
372077
|
+
exports.isNearBottom = isNearBottom;
|
|
372078
|
+
// Jump an element to its newest content
|
|
372079
|
+
const scrollToBottom = (el) => {
|
|
372080
|
+
if (el) {
|
|
372081
|
+
el.scrollTop = el.scrollHeight;
|
|
372082
|
+
}
|
|
372083
|
+
};
|
|
372084
|
+
exports.scrollToBottom = scrollToBottom;
|
|
372085
|
+
|
|
372086
|
+
|
|
371977
372087
|
/***/ }),
|
|
371978
372088
|
|
|
371979
372089
|
/***/ 71274:
|
|
@@ -372428,7 +372538,7 @@ const Dropdown = (props) => {
|
|
|
372428
372538
|
const [isOpen, setOpen] = (0, react_1.useState)(false);
|
|
372429
372539
|
const buttonRef = (0, react_1.useRef)(null);
|
|
372430
372540
|
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
372431
|
-
return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", "aria-label": ariaLabel, className: (0, classnames_1.default)(buttonClassname, isOpen && styles_module_scss_1.default.buttonActive), onClick: () => setOpen((prev) => !prev), ref: buttonRef, children: [ButtonIcon && ((0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: ButtonIcon, size: 16, "aria-hidden": "true", focusable: "false" })), (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { className: (0, classnames_1.default)(styles_module_scss_1.default.arrowIcon, isOpen && styles_module_scss_1.default.arrowIconOpen), style: { rotate: `${isOpen ? "-" : ""}90deg` }, SvgElement: arrow_right_svg_1.default, size: 8, "aria-hidden": "true", focusable: "false" })] }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Upload files", visible: hovered && !isOpen, position: "fixed" }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { anchorRef: buttonRef, menuOptions: menuOptions, opened: isOpen, onClose: () => setOpen(false), align: align, direction: direction, gap: 4 })] }));
|
|
372541
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ...hoverProps, children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", "aria-label": ariaLabel, className: (0, classnames_1.default)(buttonClassname, isOpen && styles_module_scss_1.default.buttonActive), onClick: () => setOpen((prev) => !prev), ref: buttonRef, children: [ButtonIcon && ((0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: ButtonIcon, size: 16, "aria-hidden": "true", focusable: "false" })), (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { className: (0, classnames_1.default)(styles_module_scss_1.default.arrowIcon, isOpen && styles_module_scss_1.default.arrowIconOpen), style: { rotate: `${isOpen ? "-" : ""}90deg` }, SvgElement: arrow_right_svg_1.default, size: 8, "aria-hidden": "true", focusable: "false" })] }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Upload files", visible: hovered && !isOpen, position: "fixed", size: "fit" }), (0, jsx_runtime_1.jsx)(ContextMenu_1.default, { anchorRef: buttonRef, menuOptions: menuOptions, opened: isOpen, onClose: () => setOpen(false), align: align, direction: direction, gap: 4 })] }));
|
|
372432
372542
|
};
|
|
372433
372543
|
exports["default"] = Dropdown;
|
|
372434
372544
|
|
|
@@ -372511,7 +372621,7 @@ const FileTreeActions = ({ hasExpandedNodes, }) => {
|
|
|
372511
372621
|
const { hovered: toggleHovered, hoverProps: toggleHoverProps } = (0, useHover_1.useHover)();
|
|
372512
372622
|
const { hovered: addFolderHovered, hoverProps: addFolderHoverProps } = (0, useHover_1.useHover)();
|
|
372513
372623
|
const { hovered: addFileHovered, hoverProps: addFileHoverProps } = (0, useHover_1.useHover)();
|
|
372514
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fileTreeActions, children: [hasExpandedNodes ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...toggleHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Collapse all folders", onClick: collapseAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(minus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Collapse all folders", visible: toggleHovered, position: "fixed" })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...toggleHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Expand all folders", onClick: expandAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(plus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Expand all folders", visible: toggleHovered, position: "fixed" })] })), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, weight: "medium", className: styles_module_scss_1.default.fileTreeActionsLabel, children: "Project files" }), !isReadOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...addFolderHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add folder", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.DIR), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_folder_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Add folder", visible: addFolderHovered, position: "fixed" })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...addFileHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add file", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.FILE), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_file_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Add file", visible: addFileHovered, position: "fixed" })] }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles, importFolder: importFolder })] }))] }));
|
|
372624
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fileTreeActions, children: [hasExpandedNodes ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...toggleHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Collapse all folders", onClick: collapseAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(minus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Collapse all folders", visible: toggleHovered, position: "fixed", size: "fit" })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...toggleHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Expand all folders", onClick: expandAll, className: styles_module_scss_1.default.iconButton, children: (0, jsx_runtime_1.jsx)(plus_circle_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Expand all folders", visible: toggleHovered, position: "fixed", size: "fit" })] })), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 12, weight: "medium", className: styles_module_scss_1.default.fileTreeActionsLabel, children: "Project files" }), !isReadOnly && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...addFolderHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add folder", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.DIR), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_folder_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Add folder", visible: addFolderHovered, position: "fixed", size: "fit" })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.tooltipWrapper, ...addFileHoverProps, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", "aria-label": "Add file", onClick: () => createComponent(ProjectTypes_1.ProjectComponentType.FILE), className: (0, classnames_1.default)([styles_module_scss_1.default.iconButtonFilled, styles_module_scss_1.default.iconButton]), children: (0, jsx_runtime_1.jsx)(add_file_svg_1.default, { "aria-hidden": "true", focusable: "false" }) }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Add file", visible: addFileHovered, position: "fixed", size: "fit" })] }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles, importFolder: importFolder })] }))] }));
|
|
372515
372625
|
};
|
|
372516
372626
|
exports.FileTreeActions = FileTreeActions;
|
|
372517
372627
|
|
|
@@ -373391,7 +373501,7 @@ const getSidebarOptions = (initials, homeAction, isCodeVisible) => [
|
|
|
373391
373501
|
{
|
|
373392
373502
|
name: "user",
|
|
373393
373503
|
buttonText: initials,
|
|
373394
|
-
title: "
|
|
373504
|
+
title: "Your Profile",
|
|
373395
373505
|
position: "bottom",
|
|
373396
373506
|
},
|
|
373397
373507
|
]
|
|
@@ -373453,12 +373563,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
373453
373563
|
};
|
|
373454
373564
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
373455
373565
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
373566
|
+
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
373456
373567
|
const react_1 = __webpack_require__(51649);
|
|
373457
373568
|
const stores_1 = __webpack_require__(32132);
|
|
373458
373569
|
const Button_1 = __importDefault(__webpack_require__(79428));
|
|
373459
|
-
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
373460
|
-
const styles_module_scss_1 = __importDefault(__webpack_require__(21852));
|
|
373461
373570
|
const UserMenu_1 = __importDefault(__webpack_require__(2957));
|
|
373571
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(21852));
|
|
373462
373572
|
const backgroundColors = [
|
|
373463
373573
|
"D7F9F4",
|
|
373464
373574
|
"43D6B9",
|
|
@@ -373846,8 +373956,11 @@ const ViewSwitcher_1 = __webpack_require__(59859);
|
|
|
373846
373956
|
const stores_1 = __webpack_require__(32132);
|
|
373847
373957
|
const types_2 = __webpack_require__(92932);
|
|
373848
373958
|
const SpinnerDotted_1 = __webpack_require__(79458);
|
|
373959
|
+
const Tooltip_1 = __importDefault(__webpack_require__(26982));
|
|
373960
|
+
const useHover_1 = __webpack_require__(78556);
|
|
373849
373961
|
const SharedProjectBar = () => {
|
|
373850
373962
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
373963
|
+
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
373851
373964
|
const isCodeVisible = (0, stores_1.useAppSelector)((state) => state.editor.isCodeVisible);
|
|
373852
373965
|
const saving = (0, stores_1.useAppSelector)((state) => state.editor.saving);
|
|
373853
373966
|
const userId = (0, stores_1.useAppSelector)((state) => state.user.userId);
|
|
@@ -373875,7 +373988,7 @@ const SharedProjectBar = () => {
|
|
|
373875
373988
|
},
|
|
373876
373989
|
}));
|
|
373877
373990
|
};
|
|
373878
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.header, styles_module_scss_1.default.sharedProject), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(gwc_logo_svg_1.default, { className: styles_module_scss_1.default.gwcLogo }), (0, jsx_runtime_1.jsx)(text_jam_logo_svg_1.default, { className: styles_module_scss_1.default.textJamLogo })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, styles_module_scss_1.default.projectName), children: (0, jsx_runtime_1.jsx)(SharedProjectName_1.default, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [isCodeVisible && userId && ((0, jsx_runtime_1.jsx)(Button_1.default, { ButtonIcon: remixButtonIcon, buttonText: remixButtonText, className: styles_module_scss_1.default.headerBtn, variant: "secondary", onClickHandler: handleOpenRemixModal, disabled: isSaving })), (0, jsx_runtime_1.jsx)(RunBar_1.default, {})] }), (0, jsx_runtime_1.
|
|
373991
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.header, styles_module_scss_1.default.sharedProject), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(gwc_logo_svg_1.default, { className: styles_module_scss_1.default.gwcLogo }), (0, jsx_runtime_1.jsx)(text_jam_logo_svg_1.default, { className: styles_module_scss_1.default.textJamLogo })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, styles_module_scss_1.default.projectName), children: (0, jsx_runtime_1.jsx)(SharedProjectName_1.default, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [isCodeVisible && userId && ((0, jsx_runtime_1.jsx)(Button_1.default, { ButtonIcon: remixButtonIcon, buttonText: remixButtonText, className: styles_module_scss_1.default.headerBtn, variant: "secondary", onClickHandler: handleOpenRemixModal, disabled: isSaving })), (0, jsx_runtime_1.jsx)(RunBar_1.default, {})] }), (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, styles_module_scss_1.default.tooltipAnchor), ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { className: (0, classnames_1.default)(styles_module_scss_1.default.linkButton, styles_module_scss_1.default.btnSvg), variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: link_svg_1.default, size: 24 }), onClickHandler: handleOpenShareModal }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Share this project", visible: hovered, position: "bottom", size: "fit" })] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.wrapper, children: (0, jsx_runtime_1.jsx)(ViewSwitcher_1.ViewSwitcher, {}) })] }));
|
|
373879
373992
|
};
|
|
373880
373993
|
exports.SharedProjectBar = SharedProjectBar;
|
|
373881
373994
|
|
|
@@ -373978,7 +374091,7 @@ const ShareButton = (props) => {
|
|
|
373978
374091
|
}, [dispatch, shareLinks]);
|
|
373979
374092
|
const canShare = Boolean(shareLinks);
|
|
373980
374093
|
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
373981
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.shareButtonWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "To share your project, please save it first.", visible: hovered && !canShare, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: !canShare, variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: share_svg_1.default, size: 24 }), onClickHandler: onClickShare, ...props })] }));
|
|
374094
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.shareButtonWrapper, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "To share your project, please save it first.", visible: hovered && !canShare, position: "bottom" }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Share this project", visible: hovered && canShare, position: "bottom", size: "fit" }), (0, jsx_runtime_1.jsx)(Button_1.default, { disabled: !canShare, variant: "tertiary", ButtonIcon: () => (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: share_svg_1.default, size: 24 }), onClickHandler: onClickShare, ...props })] }));
|
|
373982
374095
|
};
|
|
373983
374096
|
exports["default"] = ShareButton;
|
|
373984
374097
|
|
|
@@ -374068,15 +374181,19 @@ exports.ToastItem = ToastItem;
|
|
|
374068
374181
|
/***/ }),
|
|
374069
374182
|
|
|
374070
374183
|
/***/ 6459:
|
|
374071
|
-
/***/ ((__unused_webpack_module, exports, __webpack_require__)
|
|
374184
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
374072
374185
|
|
|
374073
374186
|
|
|
374187
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
374188
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
374189
|
+
};
|
|
374074
374190
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
374075
374191
|
exports.ToastMessagesProvider = void 0;
|
|
374076
374192
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
374077
374193
|
const react_toastify_1 = __webpack_require__(21241);
|
|
374194
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(27112));
|
|
374078
374195
|
const ToastMessagesProvider = () => {
|
|
374079
|
-
return ((0, jsx_runtime_1.jsx)(react_toastify_1.ToastContainer, { theme: "colored", position: "bottom-right", hideProgressBar: true, icon: false, closeButton: false, closeOnClick: false }));
|
|
374196
|
+
return ((0, jsx_runtime_1.jsx)(react_toastify_1.ToastContainer, { theme: "colored", position: "bottom-right", hideProgressBar: true, icon: false, closeButton: false, closeOnClick: false, pauseOnHover: true, toastClassName: styles_module_scss_1.default.toast, bodyClassName: styles_module_scss_1.default.toastBody, className: styles_module_scss_1.default.toastList }));
|
|
374080
374197
|
};
|
|
374081
374198
|
exports.ToastMessagesProvider = ToastMessagesProvider;
|
|
374082
374199
|
|
|
@@ -374125,10 +374242,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
374125
374242
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
374126
374243
|
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
374127
374244
|
const styles_module_scss_1 = __importDefault(__webpack_require__(28188));
|
|
374128
|
-
const Tooltip = ({ message, visible = false, position = "bottom", className, style, }) => {
|
|
374245
|
+
const Tooltip = ({ message, visible = false, position = "bottom", size = "default", className, style, }) => {
|
|
374129
374246
|
if (!visible)
|
|
374130
374247
|
return null;
|
|
374131
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tooltip, position && styles_module_scss_1.default[`position-${position}`], visible && styles_module_scss_1.default.visible, className), role: "tooltip", style: style, children: message }));
|
|
374248
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tooltip, position && styles_module_scss_1.default[`position-${position}`], styles_module_scss_1.default[`size-${size}`], visible && styles_module_scss_1.default.visible, className), role: "tooltip", style: style, children: message }));
|
|
374132
374249
|
};
|
|
374133
374250
|
exports["default"] = Tooltip;
|
|
374134
374251
|
|
|
@@ -374286,6 +374403,7 @@ const useProject_1 = __webpack_require__(54095);
|
|
|
374286
374403
|
const useProjectPersistence_1 = __webpack_require__(72300);
|
|
374287
374404
|
const useProjectRemix_1 = __webpack_require__(35602);
|
|
374288
374405
|
const useProjectTabSync_1 = __webpack_require__(17299);
|
|
374406
|
+
const useRevertNotifications_1 = __webpack_require__(57484);
|
|
374289
374407
|
const settings_1 = __webpack_require__(62161);
|
|
374290
374408
|
const ErrorModal_1 = __importDefault(__webpack_require__(15382));
|
|
374291
374409
|
__webpack_require__(7703);
|
|
@@ -374380,6 +374498,7 @@ const WebComponentLoader = (props) => {
|
|
|
374380
374498
|
projectKey: projectIdentifier,
|
|
374381
374499
|
enabled: !isPreviewMode && !isSharedProject,
|
|
374382
374500
|
});
|
|
374501
|
+
(0, useRevertNotifications_1.useRevertNotifications)();
|
|
374383
374502
|
(0, react_1.useEffect)(() => {
|
|
374384
374503
|
dispatch((0, EditorSlice_1.setReadOnly)(readOnly));
|
|
374385
374504
|
}, [readOnly, dispatch]);
|
|
@@ -375880,6 +375999,74 @@ const useProjectTabSync = ({ projectKey, enabled = true, }) => {
|
|
|
375880
375999
|
exports.useProjectTabSync = useProjectTabSync;
|
|
375881
376000
|
|
|
375882
376001
|
|
|
376002
|
+
/***/ }),
|
|
376003
|
+
|
|
376004
|
+
/***/ 57484:
|
|
376005
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
376006
|
+
|
|
376007
|
+
|
|
376008
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
376009
|
+
exports.useRevertNotifications = void 0;
|
|
376010
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
376011
|
+
const react_1 = __webpack_require__(51649);
|
|
376012
|
+
const react_redux_1 = __webpack_require__(14062);
|
|
376013
|
+
const EditorSlice_1 = __webpack_require__(68512);
|
|
376014
|
+
const types_1 = __webpack_require__(92932);
|
|
376015
|
+
const stores_1 = __webpack_require__(32132);
|
|
376016
|
+
const sendToast_1 = __webpack_require__(50068);
|
|
376017
|
+
const SUCCESS_MESSAGE = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["All set! Your project is back to the old version.", (0, jsx_runtime_1.jsx)("br", {}), "Click ", (0, jsx_runtime_1.jsx)("b", { children: "Save" }), " to apply changes to server."] }));
|
|
376018
|
+
const ERROR_MESSAGE = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Oops! The version couldn't be restored.", (0, jsx_runtime_1.jsx)("br", {}), "Please try again."] }));
|
|
376019
|
+
/**
|
|
376020
|
+
* Fires a success or error toast when a user-triggered version revert completes.
|
|
376021
|
+
* Should be called from a persistently mounted component (e.g. WebComponentLoader).
|
|
376022
|
+
*
|
|
376023
|
+
* Two resolution paths:
|
|
376024
|
+
* 1. loading reaches SUCCESS/FAILED → normal terminal state.
|
|
376025
|
+
* 2. isLoadingCommit goes true→false while loading is still non-terminal
|
|
376026
|
+
* (e.g. commit fetch was canceled or failed upstream) → treated as failure
|
|
376027
|
+
* so revertPending never gets stuck.
|
|
376028
|
+
*/
|
|
376029
|
+
const useRevertNotifications = () => {
|
|
376030
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
376031
|
+
const revertPending = (0, stores_1.useAppSelector)((state) => state.editor.revertPending);
|
|
376032
|
+
const loading = (0, stores_1.useAppSelector)((state) => state.editor.loading);
|
|
376033
|
+
const isLoadingCommit = (0, stores_1.useAppSelector)((state) => state.editor.isLoadingCommit);
|
|
376034
|
+
const prevLoadingRef = (0, react_1.useRef)(loading);
|
|
376035
|
+
const prevIsLoadingCommitRef = (0, react_1.useRef)(isLoadingCommit);
|
|
376036
|
+
(0, react_1.useEffect)(() => {
|
|
376037
|
+
const prevLoading = prevLoadingRef.current;
|
|
376038
|
+
const prevIsLoadingCommit = prevIsLoadingCommitRef.current;
|
|
376039
|
+
prevLoadingRef.current = loading;
|
|
376040
|
+
prevIsLoadingCommitRef.current = isLoadingCommit;
|
|
376041
|
+
if (!revertPending)
|
|
376042
|
+
return;
|
|
376043
|
+
// Path 1: loading reached a terminal state
|
|
376044
|
+
if (loading === types_1.LoadingState.SUCCESS &&
|
|
376045
|
+
prevLoading !== types_1.LoadingState.SUCCESS) {
|
|
376046
|
+
(0, sendToast_1.showSuccess)(SUCCESS_MESSAGE);
|
|
376047
|
+
dispatch((0, EditorSlice_1.setRevertPending)(false));
|
|
376048
|
+
return;
|
|
376049
|
+
}
|
|
376050
|
+
if (loading === types_1.LoadingState.FAILED &&
|
|
376051
|
+
prevLoading !== types_1.LoadingState.FAILED) {
|
|
376052
|
+
(0, sendToast_1.showError)(ERROR_MESSAGE);
|
|
376053
|
+
dispatch((0, EditorSlice_1.setRevertPending)(false));
|
|
376054
|
+
return;
|
|
376055
|
+
}
|
|
376056
|
+
// Path 2 (fallback): commit load finished but loading never became terminal.
|
|
376057
|
+
// Clear the pending flag so it can't trigger a false toast on a later
|
|
376058
|
+
// unrelated loading transition.
|
|
376059
|
+
const commitLoadJustFinished = prevIsLoadingCommit && !isLoadingCommit;
|
|
376060
|
+
const loadingIsNonTerminal = loading !== types_1.LoadingState.SUCCESS && loading !== types_1.LoadingState.FAILED;
|
|
376061
|
+
if (commitLoadJustFinished && loadingIsNonTerminal) {
|
|
376062
|
+
(0, sendToast_1.showError)(ERROR_MESSAGE);
|
|
376063
|
+
dispatch((0, EditorSlice_1.setRevertPending)(false));
|
|
376064
|
+
}
|
|
376065
|
+
}, [loading, isLoadingCommit, revertPending, dispatch]);
|
|
376066
|
+
};
|
|
376067
|
+
exports.useRevertNotifications = useRevertNotifications;
|
|
376068
|
+
|
|
376069
|
+
|
|
375883
376070
|
/***/ }),
|
|
375884
376071
|
|
|
375885
376072
|
/***/ 83289:
|
|
@@ -375994,7 +376181,7 @@ exports.useUnsavedDraftResolution = useUnsavedDraftResolution;
|
|
|
375994
376181
|
var _a;
|
|
375995
376182
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
375996
376183
|
exports.setRemixTriggered = exports.setIsLoadingCommit = exports.setCommitIdLoadTriggered = exports.setShareLinks = exports.setCommits = exports.setSharedStatus = exports.setViewMode = exports.setCodeVisibility = exports.applyComponentsPatch = exports.setSaving = exports.disableTheming = exports.hideSidebar = exports.showSidebar = exports.closeModal = exports.showModal = exports.closeErrorModal = exports.showErrorModal = exports.updateProjectName = exports.setProjectNameDraft = exports.setSaveTriggered = exports.triggerDraw = exports.triggerCodeRun = exports.stopDraw = exports.stopCodeRun = exports.setLoading = exports.setReadOnly = exports.updateProjectIdentifier = exports.updateProjectCommits = exports.updateProjectSnapshot = exports.setProject = exports.setHasShownSavePrompt = exports.setError = exports.setCascadeUpdate = exports.setIsOutputOnly = exports.setAutorunEnabled = exports.setPage = exports.setFocussedFileIndex = exports.setOpenedTabs = exports.openFile = exports.closeFile = exports.expireJustLoaded = exports.codeRunHandled = exports.resetRunner = exports.setLoadedRunner = exports.loadingRunner = exports.updateProjectComponent = exports.addProjectComponent = exports.resetState = exports.EditorSlice = exports.editorInitialState = void 0;
|
|
375997
|
-
exports.queueBinaryWrites = exports.revertProject = void 0;
|
|
376184
|
+
exports.queueBinaryWrites = exports.setRevertPending = exports.revertProject = void 0;
|
|
375998
376185
|
const toolkit_1 = __webpack_require__(12069);
|
|
375999
376186
|
const ProjectTypes_1 = __webpack_require__(27130);
|
|
376000
376187
|
const types_1 = __webpack_require__(92932);
|
|
@@ -376014,6 +376201,7 @@ exports.editorInitialState = {
|
|
|
376014
376201
|
saveSuccess: null,
|
|
376015
376202
|
commitIdLoadTriggered: null,
|
|
376016
376203
|
isLoadingCommit: false,
|
|
376204
|
+
revertPending: false,
|
|
376017
376205
|
loading: types_1.LoadingState.IDLE,
|
|
376018
376206
|
justLoaded: false,
|
|
376019
376207
|
hasShownSavePrompt: false,
|
|
@@ -376182,8 +376370,12 @@ exports.EditorSlice = (0, toolkit_1.createSlice)({
|
|
|
376182
376370
|
state.commitIdLoadTriggered = action.payload.commitId;
|
|
376183
376371
|
if (action.payload.resetProject) {
|
|
376184
376372
|
state.loading = types_1.LoadingState.IDLE;
|
|
376373
|
+
state.revertPending = true;
|
|
376185
376374
|
}
|
|
376186
376375
|
},
|
|
376376
|
+
setRevertPending: (state, action) => {
|
|
376377
|
+
state.revertPending = action.payload;
|
|
376378
|
+
},
|
|
376187
376379
|
setCommitIdLoadTriggered: (state, action) => {
|
|
376188
376380
|
state.commitIdLoadTriggered = action.payload;
|
|
376189
376381
|
},
|
|
@@ -376329,7 +376521,7 @@ exports.EditorSlice = (0, toolkit_1.createSlice)({
|
|
|
376329
376521
|
},
|
|
376330
376522
|
});
|
|
376331
376523
|
// Action creators are generated for each case reducer function
|
|
376332
|
-
_a = exports.EditorSlice.actions, exports.resetState = _a.resetState, exports.addProjectComponent = _a.addProjectComponent, exports.updateProjectComponent = _a.updateProjectComponent, exports.loadingRunner = _a.loadingRunner, exports.setLoadedRunner = _a.setLoadedRunner, exports.resetRunner = _a.resetRunner, exports.codeRunHandled = _a.codeRunHandled, exports.expireJustLoaded = _a.expireJustLoaded, exports.closeFile = _a.closeFile, exports.openFile = _a.openFile, exports.setOpenedTabs = _a.setOpenedTabs, exports.setFocussedFileIndex = _a.setFocussedFileIndex, exports.setPage = _a.setPage, exports.setAutorunEnabled = _a.setAutorunEnabled, exports.setIsOutputOnly = _a.setIsOutputOnly, exports.setCascadeUpdate = _a.setCascadeUpdate, exports.setError = _a.setError, exports.setHasShownSavePrompt = _a.setHasShownSavePrompt, exports.setProject = _a.setProject, exports.updateProjectSnapshot = _a.updateProjectSnapshot, exports.updateProjectCommits = _a.updateProjectCommits, exports.updateProjectIdentifier = _a.updateProjectIdentifier, exports.setReadOnly = _a.setReadOnly, exports.setLoading = _a.setLoading, exports.stopCodeRun = _a.stopCodeRun, exports.stopDraw = _a.stopDraw, exports.triggerCodeRun = _a.triggerCodeRun, exports.triggerDraw = _a.triggerDraw, exports.setSaveTriggered = _a.setSaveTriggered, exports.setProjectNameDraft = _a.setProjectNameDraft, exports.updateProjectName = _a.updateProjectName, exports.showErrorModal = _a.showErrorModal, exports.closeErrorModal = _a.closeErrorModal, exports.showModal = _a.showModal, exports.closeModal = _a.closeModal, exports.showSidebar = _a.showSidebar, exports.hideSidebar = _a.hideSidebar, exports.disableTheming = _a.disableTheming, exports.setSaving = _a.setSaving, exports.applyComponentsPatch = _a.applyComponentsPatch, exports.setCodeVisibility = _a.setCodeVisibility, exports.setViewMode = _a.setViewMode, exports.setSharedStatus = _a.setSharedStatus, exports.setCommits = _a.setCommits, exports.setShareLinks = _a.setShareLinks, exports.setCommitIdLoadTriggered = _a.setCommitIdLoadTriggered, exports.setIsLoadingCommit = _a.setIsLoadingCommit, exports.setRemixTriggered = _a.setRemixTriggered, exports.revertProject = _a.revertProject;
|
|
376524
|
+
_a = exports.EditorSlice.actions, exports.resetState = _a.resetState, exports.addProjectComponent = _a.addProjectComponent, exports.updateProjectComponent = _a.updateProjectComponent, exports.loadingRunner = _a.loadingRunner, exports.setLoadedRunner = _a.setLoadedRunner, exports.resetRunner = _a.resetRunner, exports.codeRunHandled = _a.codeRunHandled, exports.expireJustLoaded = _a.expireJustLoaded, exports.closeFile = _a.closeFile, exports.openFile = _a.openFile, exports.setOpenedTabs = _a.setOpenedTabs, exports.setFocussedFileIndex = _a.setFocussedFileIndex, exports.setPage = _a.setPage, exports.setAutorunEnabled = _a.setAutorunEnabled, exports.setIsOutputOnly = _a.setIsOutputOnly, exports.setCascadeUpdate = _a.setCascadeUpdate, exports.setError = _a.setError, exports.setHasShownSavePrompt = _a.setHasShownSavePrompt, exports.setProject = _a.setProject, exports.updateProjectSnapshot = _a.updateProjectSnapshot, exports.updateProjectCommits = _a.updateProjectCommits, exports.updateProjectIdentifier = _a.updateProjectIdentifier, exports.setReadOnly = _a.setReadOnly, exports.setLoading = _a.setLoading, exports.stopCodeRun = _a.stopCodeRun, exports.stopDraw = _a.stopDraw, exports.triggerCodeRun = _a.triggerCodeRun, exports.triggerDraw = _a.triggerDraw, exports.setSaveTriggered = _a.setSaveTriggered, exports.setProjectNameDraft = _a.setProjectNameDraft, exports.updateProjectName = _a.updateProjectName, exports.showErrorModal = _a.showErrorModal, exports.closeErrorModal = _a.closeErrorModal, exports.showModal = _a.showModal, exports.closeModal = _a.closeModal, exports.showSidebar = _a.showSidebar, exports.hideSidebar = _a.hideSidebar, exports.disableTheming = _a.disableTheming, exports.setSaving = _a.setSaving, exports.applyComponentsPatch = _a.applyComponentsPatch, exports.setCodeVisibility = _a.setCodeVisibility, exports.setViewMode = _a.setViewMode, exports.setSharedStatus = _a.setSharedStatus, exports.setCommits = _a.setCommits, exports.setShareLinks = _a.setShareLinks, exports.setCommitIdLoadTriggered = _a.setCommitIdLoadTriggered, exports.setIsLoadingCommit = _a.setIsLoadingCommit, exports.setRemixTriggered = _a.setRemixTriggered, exports.revertProject = _a.revertProject, exports.setRevertPending = _a.setRevertPending;
|
|
376333
376525
|
exports.queueBinaryWrites = (0, toolkit_1.createAction)("editor/queueBinaryWrites");
|
|
376334
376526
|
exports["default"] = exports.EditorSlice.reducer;
|
|
376335
376527
|
|
|
@@ -376556,13 +376748,13 @@ const fsImportFiles = ({ files, parentId }) => async (dispatch, getState) => {
|
|
|
376556
376748
|
(0, sendToast_1.showError)(error.reason);
|
|
376557
376749
|
}
|
|
376558
376750
|
if (validFiles.length > 0) {
|
|
376559
|
-
(0, sendToast_1.showSuccess)(`Selected files uploaded successfully
|
|
376751
|
+
(0, sendToast_1.showSuccess)(`Selected files uploaded successfully.\n${validFiles.length} of ${importableFiles.length} file(s) uploaded.`);
|
|
376560
376752
|
if (hasDuplicates) {
|
|
376561
376753
|
(0, sendToast_1.showInfo)(DUPLICATE_UPLOAD_TOAST);
|
|
376562
376754
|
}
|
|
376563
376755
|
}
|
|
376564
376756
|
else {
|
|
376565
|
-
(0, sendToast_1.showError)(`Selected files couldn’t be uploaded
|
|
376757
|
+
(0, sendToast_1.showError)(`Selected files couldn’t be uploaded.\n${importableFiles.length} file(s) failed to upload.`);
|
|
376566
376758
|
return;
|
|
376567
376759
|
}
|
|
376568
376760
|
const componentsMap = (0, utils_1.buildComponentsById)(components);
|
|
@@ -376594,13 +376786,13 @@ const fsImportFolder = ({ files, parentId }) => async (dispatch, getState) => {
|
|
|
376594
376786
|
(0, sendToast_1.showError)(error.reason);
|
|
376595
376787
|
}
|
|
376596
376788
|
if (validFiles.length > 0) {
|
|
376597
|
-
(0, sendToast_1.showSuccess)(`Folder '${folderName}' upload complete
|
|
376789
|
+
(0, sendToast_1.showSuccess)(`Folder '${folderName}' upload complete.\n${validFiles.length} of ${importableFiles.length} file(s) uploaded successfully.`);
|
|
376598
376790
|
if (hasDuplicates) {
|
|
376599
376791
|
(0, sendToast_1.showInfo)(DUPLICATE_UPLOAD_TOAST);
|
|
376600
376792
|
}
|
|
376601
376793
|
}
|
|
376602
376794
|
else {
|
|
376603
|
-
(0, sendToast_1.showError)(`'${folderName}' folder couldn't be uploaded
|
|
376795
|
+
(0, sendToast_1.showError)(`'${folderName}' folder couldn't be uploaded.\n${importableFiles.length} file(s) failed to upload.`);
|
|
376604
376796
|
return;
|
|
376605
376797
|
}
|
|
376606
376798
|
const componentsMap = (0, utils_1.buildComponentsById)(components);
|
|
@@ -377719,20 +377911,35 @@ async function removeBinaryIdsFromProjectIndex(projectKey, fileIds) {
|
|
|
377719
377911
|
|
|
377720
377912
|
|
|
377721
377913
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
377722
|
-
exports.getAuthorName = exports.truncateFileName = exports.sortChildren = exports.parseComponentPath = exports.getFullComponentName = exports.parseFileName = exports.isOwner = exports.isFileClosable = exports.getDefaultFileName = void 0;
|
|
377914
|
+
exports.getAuthorName = exports.truncateFileName = exports.sortChildren = exports.parseComponentPath = exports.getFullComponentName = exports.parseFileName = exports.isOwner = exports.isFileClosable = exports.getDefaultFileName = exports.resolveDefaultFile = void 0;
|
|
377723
377915
|
exports.getInsertChildIndex = getInsertChildIndex;
|
|
377724
377916
|
const ProjectTypes_1 = __webpack_require__(27130);
|
|
377725
|
-
|
|
377726
|
-
|
|
377727
|
-
|
|
377728
|
-
|
|
377729
|
-
const
|
|
377730
|
-
|
|
377731
|
-
if (!defaultFileName)
|
|
377917
|
+
const DEFAULT_FILE_BY_TYPE = {
|
|
377918
|
+
[ProjectTypes_1.ProjectType.WEB]: "index.html",
|
|
377919
|
+
[ProjectTypes_1.ProjectType.PYTHON]: "main.py",
|
|
377920
|
+
};
|
|
377921
|
+
const resolveDefaultFile = (project) => {
|
|
377922
|
+
if (!project)
|
|
377732
377923
|
return null;
|
|
377733
|
-
const
|
|
377734
|
-
|
|
377735
|
-
|
|
377924
|
+
const candidates = [
|
|
377925
|
+
project.defaultFileName,
|
|
377926
|
+
project.project_type
|
|
377927
|
+
? DEFAULT_FILE_BY_TYPE[project.project_type]
|
|
377928
|
+
: undefined,
|
|
377929
|
+
].filter((name) => Boolean(name));
|
|
377930
|
+
const files = (project.components ?? []).filter((component) => component.type === ProjectTypes_1.ProjectComponentType.FILE);
|
|
377931
|
+
for (const candidate of candidates) {
|
|
377932
|
+
const target = candidate.toLowerCase();
|
|
377933
|
+
const match = files.find((file) => (0, exports.getFullComponentName)(file).toLowerCase() === target);
|
|
377934
|
+
if (match) {
|
|
377935
|
+
return { id: match.id, fullName: (0, exports.getFullComponentName)(match) };
|
|
377936
|
+
}
|
|
377937
|
+
}
|
|
377938
|
+
return null;
|
|
377939
|
+
};
|
|
377940
|
+
exports.resolveDefaultFile = resolveDefaultFile;
|
|
377941
|
+
const getDefaultFileName = (project) => {
|
|
377942
|
+
return (0, exports.resolveDefaultFile)(project)?.fullName ?? null;
|
|
377736
377943
|
};
|
|
377737
377944
|
exports.getDefaultFileName = getDefaultFileName;
|
|
377738
377945
|
const isFileClosable = (fileFullName, defaultFileName) => fileFullName !== defaultFileName;
|