gwchq-textjam 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -68492,8 +68492,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68492
68492
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68493
68493
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68494
68494
|
/* harmony export */ });
|
|
68495
|
-
/* harmony import */ var
|
|
68496
|
-
/* harmony import */ var
|
|
68495
|
+
/* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(89379);
|
|
68496
|
+
/* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53986);
|
|
68497
68497
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68498
68498
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
68499
68499
|
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68512);
|
|
@@ -68514,7 +68514,7 @@ var DraggableTab = _ref => {
|
|
|
68514
68514
|
draggableId,
|
|
68515
68515
|
onTabClick
|
|
68516
68516
|
} = _ref,
|
|
68517
|
-
otherProps = (0,
|
|
68517
|
+
otherProps = (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .A)(_ref, _excluded);
|
|
68518
68518
|
var openedTabs = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedTabs);
|
|
68519
68519
|
var openFilesCount = openedTabs.filter(t => t && t.type === "file").length || 1;
|
|
68520
68520
|
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
@@ -68532,7 +68532,7 @@ var DraggableTab = _ref => {
|
|
|
68532
68532
|
switchToFileTab((fileIndex + openFilesCount - 1) % openFilesCount);
|
|
68533
68533
|
}
|
|
68534
68534
|
};
|
|
68535
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Tabs_DraggableTabWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], (0,
|
|
68535
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Tabs_DraggableTabWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A)({
|
|
68536
68536
|
draggableId: draggableId,
|
|
68537
68537
|
index: fileIndex,
|
|
68538
68538
|
onClick: e => {
|
|
@@ -68556,8 +68556,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68556
68556
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68557
68557
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68558
68558
|
/* harmony export */ });
|
|
68559
|
-
/* harmony import */ var
|
|
68560
|
-
/* harmony import */ var
|
|
68559
|
+
/* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
|
|
68560
|
+
/* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
|
|
68561
68561
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68562
68562
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
|
|
68563
68563
|
/* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
|
|
@@ -68576,8 +68576,8 @@ var DroppableTabList = _ref => {
|
|
|
68576
68576
|
children: _children,
|
|
68577
68577
|
index
|
|
68578
68578
|
} = _ref,
|
|
68579
|
-
otherProps = (0,
|
|
68580
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,
|
|
68579
|
+
otherProps = (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
|
|
68580
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
|
|
68581
68581
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
|
|
68582
68582
|
direction: "horizontal",
|
|
68583
68583
|
droppableId: index.toString(),
|
|
@@ -68587,7 +68587,7 @@ var DroppableTabList = _ref => {
|
|
|
68587
68587
|
droppableProps,
|
|
68588
68588
|
placeholder
|
|
68589
68589
|
} = _ref2;
|
|
68590
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,
|
|
68590
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
|
|
68591
68591
|
className: "droppable-tab-list"
|
|
68592
68592
|
}, droppableProps), {}, {
|
|
68593
68593
|
ref: innerRef,
|
|
@@ -103160,7 +103160,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
103160
103160
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
103161
103161
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
103162
103162
|
/* harmony export */ });
|
|
103163
|
-
/* harmony import */ var
|
|
103163
|
+
/* harmony import */ var _Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
103164
103164
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
103165
103165
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
103166
103166
|
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
|
|
@@ -103276,7 +103276,7 @@ var ProjectName = _ref => {
|
|
|
103276
103276
|
id: "project_name_label",
|
|
103277
103277
|
className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
|
|
103278
103278
|
children: "Project Name"
|
|
103279
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,
|
|
103279
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_ruslanmatkovskyi_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
103280
103280
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
|
|
103281
103281
|
}, hoverProps), {}, {
|
|
103282
103282
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
|
|
@@ -103399,6 +103399,9 @@ var RunButton = _ref => {
|
|
|
103399
103399
|
};
|
|
103400
103400
|
var isButtonDisabled = !activeRunner || activeRunner !== loadedRunner || codeRunLoading;
|
|
103401
103401
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", (0,objectSpread2/* default */.A)((0,objectSpread2/* default */.A)({}, hoverProps), {}, {
|
|
103402
|
+
style: {
|
|
103403
|
+
position: "relative"
|
|
103404
|
+
},
|
|
103402
103405
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)((Tooltip_default()), {
|
|
103403
103406
|
message: "We\u2019re still loading what you need to run your code. Try again in a moment!",
|
|
103404
103407
|
visible: hovered && isButtonDisabled,
|
|
@@ -142977,7 +142980,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142977
142980
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142978
142981
|
/* harmony export */ });
|
|
142979
142982
|
// extracted by mini-css-extract-plugin
|
|
142980
|
-
/* 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","tabbedPanel":"styles-module__tabbedPanel--Sovmr","viewOnlyBanner":"styles-module__viewOnlyBanner--vSOaw","scrollWrapper":"styles-module__scrollWrapper--Q8zaL","closeBtn":"styles-module__closeBtn--g8-AM","
|
|
142983
|
+
/* 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","tabbedPanel":"styles-module__tabbedPanel--Sovmr","viewOnlyBanner":"styles-module__viewOnlyBanner--vSOaw","scrollWrapper":"styles-module__scrollWrapper--Q8zaL","closeBtn":"styles-module__closeBtn--g8-AM","tabTooltip":"styles-module__tabTooltip--DO-Hr"});
|
|
142981
142984
|
|
|
142982
142985
|
/***/ }),
|
|
142983
142986
|
|
|
@@ -143017,6 +143020,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143017
143020
|
|
|
143018
143021
|
/***/ }),
|
|
143019
143022
|
|
|
143023
|
+
/***/ 37049:
|
|
143024
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
143025
|
+
|
|
143026
|
+
__webpack_require__.r(__webpack_exports__);
|
|
143027
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
143028
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
143029
|
+
/* harmony export */ });
|
|
143030
|
+
// extracted by mini-css-extract-plugin
|
|
143031
|
+
/* 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","readOnlyContainer":"styles-module__readOnlyContainer--GooG6","readOnlyContainerLeft":"styles-module__readOnlyContainerLeft--D6yHv","readOnlyBanner":"styles-module__readOnlyBanner--b4PPC"});
|
|
143032
|
+
|
|
143033
|
+
/***/ }),
|
|
143034
|
+
|
|
143020
143035
|
/***/ 38231:
|
|
143021
143036
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
143022
143037
|
|
|
@@ -143288,7 +143303,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143288
143303
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
143289
143304
|
/* harmony export */ });
|
|
143290
143305
|
// extracted by mini-css-extract-plugin
|
|
143291
|
-
/* 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--
|
|
143306
|
+
/* 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","strategy-absolute":"styles-module__strategy-absolute--ZGcl2","strategy-fixed":"styles-module__strategy-fixed--QkvjL","position-absolute-bottom":"styles-module__position-absolute-bottom--TqoQ8","position-absolute-bottom-right":"styles-module__position-absolute-bottom-right--WBFHf","position-fixed-bottom":"styles-module__position-fixed-bottom--zWfUJ","size-default":"styles-module__size-default--B+ZT4","size-fit":"styles-module__size-fit--ZW8rV"});
|
|
143292
143307
|
|
|
143293
143308
|
/***/ }),
|
|
143294
143309
|
|
|
@@ -369047,12 +369062,12 @@ const jsx_runtime_1 = __webpack_require__(74848);
|
|
|
369047
369062
|
const file_saver_1 = __importDefault(__webpack_require__(4213));
|
|
369048
369063
|
const js_convert_case_1 = __webpack_require__(61647);
|
|
369049
369064
|
const download_svg_1 = __importDefault(__webpack_require__(63279));
|
|
369050
|
-
const stores_1 = __webpack_require__(32132);
|
|
369051
369065
|
const SvgIcon_1 = __webpack_require__(82917);
|
|
369052
|
-
const Button_1 = __importDefault(__webpack_require__(79428));
|
|
369053
|
-
const createProjectArchive_1 = __webpack_require__(24133);
|
|
369054
369066
|
const Tooltip_1 = __importDefault(__webpack_require__(26982));
|
|
369067
|
+
const stores_1 = __webpack_require__(32132);
|
|
369055
369068
|
const useHover_1 = __webpack_require__(78556);
|
|
369069
|
+
const createProjectArchive_1 = __webpack_require__(24133);
|
|
369070
|
+
const Button_1 = __importDefault(__webpack_require__(79428));
|
|
369056
369071
|
const DownloadButton = (props) => {
|
|
369057
369072
|
const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
|
|
369058
369073
|
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
@@ -369071,173 +369086,288 @@ exports["default"] = DownloadButton;
|
|
|
369071
369086
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
369072
369087
|
|
|
369073
369088
|
|
|
369074
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
369075
|
-
if (k2 === undefined) k2 = k;
|
|
369076
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
369077
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
369078
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
369079
|
-
}
|
|
369080
|
-
Object.defineProperty(o, k2, desc);
|
|
369081
|
-
}) : (function(o, m, k, k2) {
|
|
369082
|
-
if (k2 === undefined) k2 = k;
|
|
369083
|
-
o[k2] = m[k];
|
|
369084
|
-
}));
|
|
369085
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
369086
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
369087
|
-
}) : function(o, v) {
|
|
369088
|
-
o["default"] = v;
|
|
369089
|
-
});
|
|
369090
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
369091
|
-
var ownKeys = function(o) {
|
|
369092
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
369093
|
-
var ar = [];
|
|
369094
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
369095
|
-
return ar;
|
|
369096
|
-
};
|
|
369097
|
-
return ownKeys(o);
|
|
369098
|
-
};
|
|
369099
|
-
return function (mod) {
|
|
369100
|
-
if (mod && mod.__esModule) return mod;
|
|
369101
|
-
var result = {};
|
|
369102
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
369103
|
-
__setModuleDefault(result, mod);
|
|
369104
|
-
return result;
|
|
369105
|
-
};
|
|
369106
|
-
})();
|
|
369107
369089
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
369108
369090
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
369109
369091
|
};
|
|
369110
369092
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369111
369093
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
369112
|
-
const react_1 = __importStar(__webpack_require__(51649));
|
|
369113
369094
|
const dnd_1 = __webpack_require__(98850);
|
|
369114
|
-
const
|
|
369115
|
-
const react_tabs_1 = __webpack_require__(39243);
|
|
369095
|
+
const react_1 = __webpack_require__(51649);
|
|
369116
369096
|
const react_responsive_1 = __webpack_require__(17988);
|
|
369117
|
-
const
|
|
369097
|
+
const react_tabs_1 = __webpack_require__(39243);
|
|
369118
369098
|
const Button_1 = __importDefault(__webpack_require__(79428));
|
|
369119
|
-
const EditorPanel_1 = __importDefault(__webpack_require__(82467));
|
|
369120
369099
|
const DraggableTab_1 = __importDefault(__webpack_require__(74215));
|
|
369121
369100
|
const DroppableTabList_1 = __importDefault(__webpack_require__(48339));
|
|
369122
|
-
const
|
|
369123
|
-
const mediaQueryBreakpoints_1 = __webpack_require__(22554);
|
|
369124
|
-
const CloseIcon_1 = __importDefault(__webpack_require__(61193));
|
|
369101
|
+
const EditorPanel_1 = __importDefault(__webpack_require__(82467));
|
|
369125
369102
|
const FileIcon_1 = __importDefault(__webpack_require__(94028));
|
|
369126
|
-
const
|
|
369127
|
-
const
|
|
369103
|
+
const Tooltip_1 = __importDefault(__webpack_require__(26982));
|
|
369104
|
+
const CloseIcon_1 = __importDefault(__webpack_require__(61193));
|
|
369105
|
+
const mediaQueryBreakpoints_1 = __webpack_require__(22554);
|
|
369106
|
+
const RunnerControls_1 = __importDefault(__webpack_require__(80263));
|
|
369107
|
+
const ReadOnlyBanner_1 = __importDefault(__webpack_require__(47918));
|
|
369108
|
+
const Text_1 = __webpack_require__(82803);
|
|
369128
369109
|
const stores_1 = __webpack_require__(32132);
|
|
369129
|
-
const ProjectTypes_1 = __webpack_require__(27130);
|
|
369130
369110
|
const EditorTypes_1 = __webpack_require__(42108);
|
|
369111
|
+
const ProjectTypes_1 = __webpack_require__(27130);
|
|
369131
369112
|
const projectHelpers_1 = __webpack_require__(2610);
|
|
369132
|
-
const
|
|
369133
|
-
|
|
369134
|
-
|
|
369135
|
-
const
|
|
369136
|
-
|
|
369137
|
-
|
|
369113
|
+
const tabIndexing_1 = __webpack_require__(57550);
|
|
369114
|
+
const hooks_1 = __webpack_require__(68856);
|
|
369115
|
+
const useTabTooltip_1 = __importDefault(__webpack_require__(58149));
|
|
369116
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(44502));
|
|
369117
|
+
const EditorInput = () => {
|
|
369118
|
+
const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
|
|
369119
|
+
const projectFiles = (0, react_1.useMemo)(() => {
|
|
369120
|
+
if (!project?.components)
|
|
369121
|
+
return [];
|
|
369122
|
+
return (project?.components.filter((component) => component.type === ProjectTypes_1.ProjectComponentType.FILE) || []);
|
|
369123
|
+
}, [project]);
|
|
369124
|
+
const unifiedTabs = (0, stores_1.useAppSelector)((state) => state.editor.openedTabs);
|
|
369125
|
+
const openedFiles = (0, react_1.useMemo)(() => unifiedTabs.flatMap((tab, openedTabIndex) => {
|
|
369126
|
+
if (tab.type !== EditorTypes_1.OpenedTabType.FILE)
|
|
369127
|
+
return [];
|
|
369128
|
+
const file = projectFiles.find((f) => f.id === tab.id);
|
|
369129
|
+
return file
|
|
369130
|
+
? [{ ...file, fullName: (0, projectHelpers_1.getFullComponentName)(file), openedTabIndex }]
|
|
369131
|
+
: [];
|
|
369132
|
+
}), [projectFiles, unifiedTabs]);
|
|
369133
|
+
const renderedFileOpenedIndices = (0, react_1.useMemo)(() => openedFiles.map((file) => file.openedTabIndex), [openedFiles]);
|
|
369134
|
+
const focussedFileIndex = (0, stores_1.useAppSelector)((state) => state.editor.focussedFileIndex);
|
|
369135
|
+
const fileTabFocusIndex = (0, react_1.useMemo)(() => {
|
|
369136
|
+
const renderedIndex = renderedFileOpenedIndices.indexOf(focussedFileIndex);
|
|
369137
|
+
if (renderedIndex >= 0)
|
|
369138
|
+
return renderedIndex;
|
|
369139
|
+
return Math.min((0, tabIndexing_1.openedTabIndexToFileTabIndex)(unifiedTabs, focussedFileIndex), Math.max(openedFiles.length - 1, 0));
|
|
369140
|
+
}, [
|
|
369141
|
+
focussedFileIndex,
|
|
369142
|
+
openedFiles.length,
|
|
369143
|
+
renderedFileOpenedIndices,
|
|
369144
|
+
unifiedTabs,
|
|
369145
|
+
]);
|
|
369146
|
+
const isMobile = (0, react_responsive_1.useMediaQuery)({ query: mediaQueryBreakpoints_1.MOBILE_MEDIA_QUERY });
|
|
369147
|
+
const justLoaded = (0, stores_1.useAppSelector)((state) => state.editor.justLoaded);
|
|
369148
|
+
const { tabTooltip, showTabTooltip, hideTabTooltip } = (0, useTabTooltip_1.default)();
|
|
369149
|
+
const defaultFile = (0, react_1.useMemo)(() => (0, projectHelpers_1.resolveDefaultFile)(project), [project]);
|
|
369150
|
+
const defaultFileName = defaultFile?.fullName ?? null;
|
|
369151
|
+
(0, hooks_1.useDefaultFileTab)(justLoaded, defaultFile);
|
|
369152
|
+
const { onDragStart, onDragEnd, selectFileTab, closeFileTab } = (0, hooks_1.useFileTabActions)(unifiedTabs, renderedFileOpenedIndices);
|
|
369153
|
+
const tabRefs = (0, hooks_1.useFileTabRefs)(projectFiles, unifiedTabs, focussedFileIndex);
|
|
369154
|
+
if (!project || !project.components) {
|
|
369155
|
+
return null;
|
|
369156
|
+
}
|
|
369157
|
+
return ((0, jsx_runtime_1.jsxs)(dnd_1.DragDropContext, { onDragStart: (input) => onDragStart(input), onDragEnd: (result) => onDragEnd(result), children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.tabbedPanel, children: (0, jsx_runtime_1.jsxs)(react_tabs_1.Tabs, { selectedIndex: fileTabFocusIndex, onSelect: selectFileTab, children: [(0, jsx_runtime_1.jsxs)("div", { className: "tabContainer", children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.scrollWrapper, children: (0, jsx_runtime_1.jsx)(DroppableTabList_1.default, { index: 0, children: openedFiles.map((file, fileIndex) => ((0, jsx_runtime_1.jsxs)(DraggableTab_1.default, { draggableId: `file-${file.id}`, fileIndex: fileIndex, onTabClick: selectFileTab, onMouseEnter: showTabTooltip(file.path), onMouseLeave: hideTabTooltip, "aria-label": file.fullName, children: [(0, jsx_runtime_1.jsxs)(Text_1.Text, { size: 12, weight: "medium", className: "tabText", ref: tabRefs.current[projectFiles.findIndex((projectFile) => projectFile.id === file.id)], children: [(0, jsx_runtime_1.jsx)(FileIcon_1.default, { ext: file.extension }), (0, projectHelpers_1.truncateFileName)(file.fullName)] }), (0, projectHelpers_1.isFileClosable)(file.fullName, defaultFileName) && ((0, jsx_runtime_1.jsx)(Button_1.default, { className: styles_module_scss_1.default.closeBtn, label: "close", onClickHandler: (e) => closeFileTab(e, file), ButtonIcon: () => (0, jsx_runtime_1.jsx)(CloseIcon_1.default, { scaleFactor: 0.85 }) }))] }, file.id))) }) }), isMobile && (0, jsx_runtime_1.jsx)(RunnerControls_1.default, {})] }), openedFiles.map((file) => ((0, jsx_runtime_1.jsxs)(react_tabs_1.TabPanel, { children: [(0, jsx_runtime_1.jsx)(ReadOnlyBanner_1.default, {}), (0, jsx_runtime_1.jsx)(EditorPanel_1.default, { file: file }, file.id)] }, file.id)))] }) }), tabTooltip && ((0, jsx_runtime_1.jsx)(Tooltip_1.default, { className: styles_module_scss_1.default.tabTooltip, message: tabTooltip.message, position: "bottom", strategy: "fixed", visible: true, style: {
|
|
369158
|
+
top: tabTooltip.top,
|
|
369159
|
+
left: tabTooltip.left,
|
|
369160
|
+
transform: "translateX(-50%)",
|
|
369161
|
+
} }))] }));
|
|
369162
|
+
};
|
|
369163
|
+
exports["default"] = EditorInput;
|
|
369164
|
+
|
|
369165
|
+
|
|
369166
|
+
/***/ }),
|
|
369167
|
+
|
|
369168
|
+
/***/ 57550:
|
|
369169
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
369170
|
+
|
|
369171
|
+
|
|
369172
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369173
|
+
exports.fileTabIndexToInsertionIndex = exports.fileTabIndexToOpenedTabIndex = exports.openedTabIndexToFileTabIndex = void 0;
|
|
369174
|
+
const EditorTypes_1 = __webpack_require__(42108);
|
|
369175
|
+
const openedTabIndexToFileTabIndex = (panel, openedTabIndex) => {
|
|
369176
|
+
const tab = panel[openedTabIndex];
|
|
369177
|
+
if (!tab)
|
|
369178
|
+
return 0;
|
|
369179
|
+
const fileCount = panel.filter((t) => t.type === EditorTypes_1.OpenedTabType.FILE).length;
|
|
369180
|
+
if (fileCount === 0)
|
|
369138
369181
|
return 0;
|
|
369139
|
-
|
|
369140
|
-
.
|
|
369182
|
+
const fileTabIndex = panel
|
|
369183
|
+
.slice(0, openedTabIndex)
|
|
369184
|
+
.filter((t) => t.type === EditorTypes_1.OpenedTabType.FILE).length;
|
|
369185
|
+
return Math.min(fileTabIndex, fileCount - 1);
|
|
369141
369186
|
};
|
|
369142
|
-
|
|
369187
|
+
exports.openedTabIndexToFileTabIndex = openedTabIndexToFileTabIndex;
|
|
369188
|
+
const fileTabIndexToOpenedTabIndex = (panel, fileTabIndex) => {
|
|
369143
369189
|
let count = 0;
|
|
369144
369190
|
for (let i = 0; i < panel.length; i++) {
|
|
369145
369191
|
const tab = panel[i];
|
|
369146
369192
|
if (tab && tab.type === EditorTypes_1.OpenedTabType.FILE) {
|
|
369147
|
-
if (count ===
|
|
369193
|
+
if (count === fileTabIndex)
|
|
369148
369194
|
return i;
|
|
369149
369195
|
count++;
|
|
369150
369196
|
}
|
|
369151
369197
|
}
|
|
369152
369198
|
return -1;
|
|
369153
369199
|
};
|
|
369154
|
-
|
|
369155
|
-
|
|
369156
|
-
|
|
369157
|
-
const fileOnlyToInsertionIndex = (panel, fileOnlyIdx) => {
|
|
369158
|
-
const idx = fileOnlyToUnifiedIndex(panel, fileOnlyIdx);
|
|
369200
|
+
exports.fileTabIndexToOpenedTabIndex = fileTabIndexToOpenedTabIndex;
|
|
369201
|
+
const fileTabIndexToInsertionIndex = (panel, fileTabIndex) => {
|
|
369202
|
+
const idx = (0, exports.fileTabIndexToOpenedTabIndex)(panel, fileTabIndex);
|
|
369159
369203
|
return idx === -1 ? panel.length : idx;
|
|
369160
369204
|
};
|
|
369161
|
-
|
|
369162
|
-
|
|
369163
|
-
|
|
369164
|
-
|
|
369165
|
-
|
|
369166
|
-
|
|
369167
|
-
|
|
369168
|
-
|
|
369169
|
-
|
|
369170
|
-
|
|
369171
|
-
|
|
369172
|
-
|
|
369173
|
-
|
|
369174
|
-
|
|
369175
|
-
|
|
369176
|
-
|
|
369177
|
-
|
|
369178
|
-
|
|
369179
|
-
|
|
369180
|
-
|
|
369181
|
-
|
|
369205
|
+
exports.fileTabIndexToInsertionIndex = fileTabIndexToInsertionIndex;
|
|
369206
|
+
|
|
369207
|
+
|
|
369208
|
+
/***/ }),
|
|
369209
|
+
|
|
369210
|
+
/***/ 68856:
|
|
369211
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
369212
|
+
|
|
369213
|
+
|
|
369214
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369215
|
+
exports.useFileTabRefs = exports.useFileTabActions = exports.useDefaultFileTab = void 0;
|
|
369216
|
+
var useDefaultFileTab_1 = __webpack_require__(16417);
|
|
369217
|
+
Object.defineProperty(exports, "useDefaultFileTab", ({ enumerable: true, get: function () { return useDefaultFileTab_1.useDefaultFileTab; } }));
|
|
369218
|
+
var useFileTabActions_1 = __webpack_require__(31303);
|
|
369219
|
+
Object.defineProperty(exports, "useFileTabActions", ({ enumerable: true, get: function () { return useFileTabActions_1.useFileTabActions; } }));
|
|
369220
|
+
var useFileTabRefs_1 = __webpack_require__(66828);
|
|
369221
|
+
Object.defineProperty(exports, "useFileTabRefs", ({ enumerable: true, get: function () { return useFileTabRefs_1.useFileTabRefs; } }));
|
|
369222
|
+
|
|
369223
|
+
|
|
369224
|
+
/***/ }),
|
|
369225
|
+
|
|
369226
|
+
/***/ 16417:
|
|
369227
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
369228
|
+
|
|
369229
|
+
|
|
369230
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369231
|
+
exports.useDefaultFileTab = void 0;
|
|
369232
|
+
const react_1 = __webpack_require__(51649);
|
|
369233
|
+
const react_redux_1 = __webpack_require__(14062);
|
|
369234
|
+
const EditorSlice_1 = __webpack_require__(68512);
|
|
369235
|
+
const useDefaultFileTab = (justLoaded, defaultFile) => {
|
|
369182
369236
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
369183
|
-
const isMobile = (0, react_responsive_1.useMediaQuery)({ query: mediaQueryBreakpoints_1.MOBILE_MEDIA_QUERY });
|
|
369184
|
-
const [numberOfComponents, setNumberOfComponents] = (0, react_1.useState)(project?.components?.length);
|
|
369185
|
-
const [fileNames, setFileNames] = (0, react_1.useState)();
|
|
369186
|
-
const defaultFile = (0, react_1.useMemo)(() => (0, projectHelpers_1.resolveDefaultFile)(project), [project]);
|
|
369187
|
-
const defaultFileName = defaultFile?.fullName ?? null;
|
|
369188
|
-
const justLoaded = (0, stores_1.useAppSelector)((state) => state.editor.justLoaded);
|
|
369189
369237
|
(0, react_1.useEffect)(() => {
|
|
369190
369238
|
if (!justLoaded || !defaultFile)
|
|
369191
369239
|
return;
|
|
369192
369240
|
dispatch((0, EditorSlice_1.openFile)({ id: defaultFile.id }));
|
|
369193
369241
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
369194
369242
|
}, [justLoaded]);
|
|
369195
|
-
|
|
369243
|
+
};
|
|
369244
|
+
exports.useDefaultFileTab = useDefaultFileTab;
|
|
369245
|
+
|
|
369246
|
+
|
|
369247
|
+
/***/ }),
|
|
369248
|
+
|
|
369249
|
+
/***/ 31303:
|
|
369250
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
369251
|
+
|
|
369252
|
+
|
|
369253
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369254
|
+
exports.useFileTabActions = void 0;
|
|
369255
|
+
const react_1 = __webpack_require__(51649);
|
|
369256
|
+
const react_redux_1 = __webpack_require__(14062);
|
|
369257
|
+
const EditorSlice_1 = __webpack_require__(68512);
|
|
369258
|
+
const tabIndexing_1 = __webpack_require__(57550);
|
|
369259
|
+
const defaultFileIndexToOpenedTabIndex = (unifiedTabs, fileIndex) => (0, tabIndexing_1.fileTabIndexToOpenedTabIndex)(unifiedTabs, fileIndex);
|
|
369260
|
+
const defaultFileIndexToInsertionIndex = (panel, fileIndex) => (0, tabIndexing_1.fileTabIndexToInsertionIndex)(panel, fileIndex);
|
|
369261
|
+
const useFileTabActions = (unifiedTabs, renderedFileOpenedIndices) => {
|
|
369262
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
369263
|
+
const fileIndexToOpenedTabIndex = (0, react_1.useCallback)((fileIndex) => renderedFileOpenedIndices?.[fileIndex] ??
|
|
369264
|
+
defaultFileIndexToOpenedTabIndex(unifiedTabs, fileIndex), [renderedFileOpenedIndices, unifiedTabs]);
|
|
369265
|
+
const onDragStart = (0, react_1.useCallback)((input) => {
|
|
369196
369266
|
const { source } = input;
|
|
369197
|
-
const unifiedIdx =
|
|
369267
|
+
const unifiedIdx = fileIndexToOpenedTabIndex(source.index);
|
|
369198
369268
|
if (unifiedIdx < 0)
|
|
369199
369269
|
return;
|
|
369200
369270
|
dispatch((0, EditorSlice_1.setFocussedFileIndex)(unifiedIdx));
|
|
369201
|
-
};
|
|
369202
|
-
const onDragEnd = (result) => {
|
|
369271
|
+
}, [dispatch, fileIndexToOpenedTabIndex]);
|
|
369272
|
+
const onDragEnd = (0, react_1.useCallback)((result) => {
|
|
369203
369273
|
const { source, destination } = result;
|
|
369204
369274
|
if (!destination)
|
|
369205
369275
|
return;
|
|
369206
369276
|
const nextTabs = [...unifiedTabs];
|
|
369207
|
-
const srcUnifiedIdx =
|
|
369277
|
+
const srcUnifiedIdx = fileIndexToOpenedTabIndex(source.index);
|
|
369208
369278
|
if (srcUnifiedIdx < 0)
|
|
369209
369279
|
return;
|
|
369210
369280
|
const removed = nextTabs.splice(srcUnifiedIdx, 1)[0];
|
|
369211
369281
|
if (!removed)
|
|
369212
369282
|
return;
|
|
369213
|
-
const
|
|
369283
|
+
const nextRenderedFileOpenedIndices = renderedFileOpenedIndices
|
|
369284
|
+
?.filter((_, index) => index !== source.index)
|
|
369285
|
+
.map((openedTabIndex) => openedTabIndex > srcUnifiedIdx ? openedTabIndex - 1 : openedTabIndex);
|
|
369286
|
+
const dstUnifiedIdx = nextRenderedFileOpenedIndices
|
|
369287
|
+
? nextRenderedFileOpenedIndices[destination.index] ?? nextTabs.length
|
|
369288
|
+
: defaultFileIndexToInsertionIndex(nextTabs, destination.index);
|
|
369214
369289
|
nextTabs.splice(dstUnifiedIdx, 0, removed);
|
|
369215
369290
|
dispatch((0, EditorSlice_1.setOpenedTabs)(nextTabs));
|
|
369216
369291
|
dispatch((0, EditorSlice_1.setFocussedFileIndex)(dstUnifiedIdx));
|
|
369217
|
-
}
|
|
369218
|
-
|
|
369292
|
+
}, [
|
|
369293
|
+
dispatch,
|
|
369294
|
+
fileIndexToOpenedTabIndex,
|
|
369295
|
+
renderedFileOpenedIndices,
|
|
369296
|
+
unifiedTabs,
|
|
369297
|
+
]);
|
|
369298
|
+
const selectFileTab = (0, react_1.useCallback)((fileIndex) => {
|
|
369299
|
+
const unifiedIdx = fileIndexToOpenedTabIndex(fileIndex);
|
|
369300
|
+
if (unifiedIdx >= 0) {
|
|
369301
|
+
dispatch((0, EditorSlice_1.setFocussedFileIndex)(unifiedIdx));
|
|
369302
|
+
}
|
|
369303
|
+
}, [dispatch, fileIndexToOpenedTabIndex]);
|
|
369304
|
+
const closeFileTab = (0, react_1.useCallback)((e, file) => {
|
|
369219
369305
|
e.stopPropagation();
|
|
369220
369306
|
dispatch((0, EditorSlice_1.closeFile)({ id: file.id }));
|
|
369307
|
+
}, [dispatch]);
|
|
369308
|
+
return {
|
|
369309
|
+
onDragStart,
|
|
369310
|
+
onDragEnd,
|
|
369311
|
+
selectFileTab,
|
|
369312
|
+
closeFileTab,
|
|
369221
369313
|
};
|
|
369314
|
+
};
|
|
369315
|
+
exports.useFileTabActions = useFileTabActions;
|
|
369316
|
+
|
|
369317
|
+
|
|
369318
|
+
/***/ }),
|
|
369319
|
+
|
|
369320
|
+
/***/ 66828:
|
|
369321
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
369322
|
+
|
|
369323
|
+
|
|
369324
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
369325
|
+
if (k2 === undefined) k2 = k;
|
|
369326
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
369327
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
369328
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
369329
|
+
}
|
|
369330
|
+
Object.defineProperty(o, k2, desc);
|
|
369331
|
+
}) : (function(o, m, k, k2) {
|
|
369332
|
+
if (k2 === undefined) k2 = k;
|
|
369333
|
+
o[k2] = m[k];
|
|
369334
|
+
}));
|
|
369335
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
369336
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
369337
|
+
}) : function(o, v) {
|
|
369338
|
+
o["default"] = v;
|
|
369339
|
+
});
|
|
369340
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
369341
|
+
var ownKeys = function(o) {
|
|
369342
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
369343
|
+
var ar = [];
|
|
369344
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
369345
|
+
return ar;
|
|
369346
|
+
};
|
|
369347
|
+
return ownKeys(o);
|
|
369348
|
+
};
|
|
369349
|
+
return function (mod) {
|
|
369350
|
+
if (mod && mod.__esModule) return mod;
|
|
369351
|
+
var result = {};
|
|
369352
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
369353
|
+
__setModuleDefault(result, mod);
|
|
369354
|
+
return result;
|
|
369355
|
+
};
|
|
369356
|
+
})();
|
|
369357
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369358
|
+
exports.useFileTabRefs = void 0;
|
|
369359
|
+
const react_1 = __importStar(__webpack_require__(51649));
|
|
369360
|
+
const EditorTypes_1 = __webpack_require__(42108);
|
|
369361
|
+
const useFileTabRefs = (projectFiles, unifiedTabs, focussedFileIndex) => {
|
|
369222
369362
|
const tabRefs = (0, react_1.useRef)(projectFiles.map(() => (0, react_1.createRef)()));
|
|
369363
|
+
const [numberOfFileRefs, setNumberOfFileRefs] = (0, react_1.useState)(tabRefs.current.length);
|
|
369223
369364
|
(0, react_1.useEffect)(() => {
|
|
369224
|
-
|
|
369225
|
-
return;
|
|
369226
|
-
setNumberOfComponents(project.components.length);
|
|
369227
|
-
for (let i = 0; i < project.components.length; i++) {
|
|
369365
|
+
for (let i = 0; i < projectFiles.length; i++) {
|
|
369228
369366
|
tabRefs.current[i] = tabRefs.current[i] || react_1.default.createRef();
|
|
369229
369367
|
}
|
|
369230
|
-
|
|
369368
|
+
setNumberOfFileRefs(projectFiles.length);
|
|
369369
|
+
}, [projectFiles.length]);
|
|
369231
369370
|
(0, react_1.useEffect)(() => {
|
|
369232
|
-
const projectFiles = project.components.filter((component) => component.type === ProjectTypes_1.ProjectComponentType.FILE);
|
|
369233
|
-
const newFileNames = projectFiles.map((file) => (0, projectHelpers_1.getFullComponentName)(file));
|
|
369234
|
-
if (newFileNames.join() !== fileNames?.join()) {
|
|
369235
|
-
setFileNames(newFileNames);
|
|
369236
|
-
}
|
|
369237
|
-
}, [fileNames, project.components]);
|
|
369238
|
-
(0, react_1.useEffect)(() => {
|
|
369239
|
-
if (!projectFiles)
|
|
369240
|
-
return;
|
|
369241
369371
|
const tab = unifiedTabs[focussedFileIndex];
|
|
369242
369372
|
const fileId = tab?.type === EditorTypes_1.OpenedTabType.FILE ? tab.id : undefined;
|
|
369243
369373
|
const componentIndex = projectFiles.findIndex((file) => file.id === fileId);
|
|
@@ -369245,54 +369375,40 @@ const EditorInput = () => {
|
|
|
369245
369375
|
if (fileRef && fileRef.current) {
|
|
369246
369376
|
fileRef.current.parentElement?.scrollIntoView();
|
|
369247
369377
|
}
|
|
369248
|
-
}, [focussedFileIndex, unifiedTabs,
|
|
369249
|
-
|
|
369250
|
-
return null;
|
|
369251
|
-
}
|
|
369252
|
-
return ((0, jsx_runtime_1.jsx)(dnd_1.DragDropContext, { onDragStart: (input) => onDragStart(input), onDragEnd: (result) => onDragEnd(result), children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.tabbedPanel, children: (0, jsx_runtime_1.jsxs)(react_tabs_1.Tabs, { selectedIndex: fileOnlyFocusIndex, children: [(0, jsx_runtime_1.jsxs)("div", { className: "tabContainer", children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.scrollWrapper, children: (0, jsx_runtime_1.jsx)(DroppableTabList_1.default, { index: 0, children: openedFiles.map((file, fileIndex) => file && ((0, jsx_runtime_1.jsxs)(DraggableTab_1.default, { draggableId: `file-${file.id}`, fileIndex: fileIndex, onTabClick: () => {
|
|
369253
|
-
const unifiedIdx = fileOnlyToUnifiedIndex(unifiedTabs, fileIndex);
|
|
369254
|
-
if (unifiedIdx >= 0) {
|
|
369255
|
-
dispatch((0, EditorSlice_1.setFocussedFileIndex)(unifiedIdx));
|
|
369256
|
-
}
|
|
369257
|
-
}, children: [(0, jsx_runtime_1.jsxs)(Text_1.Text, { size: 12, weight: "medium", className: "tabText", tooltip: file.fullName, ref: tabRefs.current[projectFiles.findIndex((projectFile) => projectFile.id === file.id)], children: [(0, jsx_runtime_1.jsx)(FileIcon_1.default, { ext: file.extension }), (0, projectHelpers_1.truncateFileName)(file.fullName)] }), (0, projectHelpers_1.isFileClosable)(file.fullName, defaultFileName) && ((0, jsx_runtime_1.jsx)(Button_1.default, { className: styles_module_scss_1.default.closeBtn, label: "close", onClickHandler: (e) => closeFileTab(e, file), ButtonIcon: () => (0, jsx_runtime_1.jsx)(CloseIcon_1.default, { scaleFactor: 0.85 }) }))] }, file.id))) }) }), isMobile && (0, jsx_runtime_1.jsx)(RunnerControls_1.default, {})] }), openedFiles.map((file) => file ? ((0, jsx_runtime_1.jsxs)(react_tabs_1.TabPanel, { children: [(0, jsx_runtime_1.jsx)(ReadOnlyBanner_1.default, {}), (0, jsx_runtime_1.jsx)(EditorPanel_1.default, { file: file }, file.id)] }, file.id)) : null)] }) }) }));
|
|
369378
|
+
}, [focussedFileIndex, unifiedTabs, numberOfFileRefs, projectFiles]);
|
|
369379
|
+
return tabRefs;
|
|
369258
369380
|
};
|
|
369259
|
-
exports
|
|
369381
|
+
exports.useFileTabRefs = useFileTabRefs;
|
|
369260
369382
|
|
|
369261
369383
|
|
|
369262
369384
|
/***/ }),
|
|
369263
369385
|
|
|
369264
|
-
/***/
|
|
369265
|
-
/***/ (
|
|
369386
|
+
/***/ 58149:
|
|
369387
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
369266
369388
|
|
|
369267
369389
|
|
|
369268
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
369269
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
369270
|
-
};
|
|
369271
369390
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369272
|
-
const jsx_runtime_1 = __webpack_require__(74848);
|
|
369273
369391
|
const react_1 = __webpack_require__(51649);
|
|
369274
|
-
const
|
|
369275
|
-
const
|
|
369276
|
-
const
|
|
369277
|
-
|
|
369278
|
-
|
|
369279
|
-
const
|
|
369280
|
-
|
|
369281
|
-
|
|
369282
|
-
|
|
369283
|
-
|
|
369284
|
-
|
|
369285
|
-
|
|
369286
|
-
|
|
369287
|
-
|
|
369288
|
-
|
|
369289
|
-
|
|
369290
|
-
|
|
369291
|
-
|
|
369292
|
-
left: readonlyTooltipLeft,
|
|
369293
|
-
} }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.readOnlyBanner, ref: readonlyRef, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 12, SvgElement: readonly_svg_1.default }), (0, jsx_runtime_1.jsx)("span", { children: "Read Only" })] })] }));
|
|
369392
|
+
const useTabTooltip = () => {
|
|
369393
|
+
const [tabTooltip, setTabTooltip] = (0, react_1.useState)(null);
|
|
369394
|
+
const showTabTooltip = (0, react_1.useCallback)((filePath) => (e) => {
|
|
369395
|
+
if (!filePath)
|
|
369396
|
+
return;
|
|
369397
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
369398
|
+
setTabTooltip({
|
|
369399
|
+
message: filePath,
|
|
369400
|
+
top: rect.bottom,
|
|
369401
|
+
left: rect.left + rect.width / 2,
|
|
369402
|
+
});
|
|
369403
|
+
}, []);
|
|
369404
|
+
const hideTabTooltip = (0, react_1.useCallback)(() => setTabTooltip(null), []);
|
|
369405
|
+
return {
|
|
369406
|
+
tabTooltip,
|
|
369407
|
+
showTabTooltip,
|
|
369408
|
+
hideTabTooltip,
|
|
369409
|
+
};
|
|
369294
369410
|
};
|
|
369295
|
-
exports["default"] =
|
|
369411
|
+
exports["default"] = useTabTooltip;
|
|
369296
369412
|
|
|
369297
369413
|
|
|
369298
369414
|
/***/ }),
|
|
@@ -369424,6 +369540,42 @@ const Output = ({ packageApiUrl }) => {
|
|
|
369424
369540
|
exports["default"] = Output;
|
|
369425
369541
|
|
|
369426
369542
|
|
|
369543
|
+
/***/ }),
|
|
369544
|
+
|
|
369545
|
+
/***/ 47918:
|
|
369546
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
369547
|
+
|
|
369548
|
+
|
|
369549
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
369550
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
369551
|
+
};
|
|
369552
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
369553
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
369554
|
+
const react_1 = __webpack_require__(51649);
|
|
369555
|
+
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
369556
|
+
const stores_1 = __webpack_require__(32132);
|
|
369557
|
+
const SvgIcon_1 = __webpack_require__(82917);
|
|
369558
|
+
const Tooltip_1 = __importDefault(__webpack_require__(26982));
|
|
369559
|
+
const useHover_1 = __webpack_require__(78556);
|
|
369560
|
+
const readonly_svg_1 = __importDefault(__webpack_require__(19297));
|
|
369561
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(37049));
|
|
369562
|
+
const ReadOnlyBanner = ({ align = "right", }) => {
|
|
369563
|
+
const readOnly = (0, stores_1.useAppSelector)((state) => state.editor.readOnly);
|
|
369564
|
+
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
369565
|
+
const readonlyRef = (0, react_1.useRef)(null);
|
|
369566
|
+
if (!readOnly)
|
|
369567
|
+
return null;
|
|
369568
|
+
const rect = readonlyRef.current?.getBoundingClientRect();
|
|
369569
|
+
const readonlyTooltipTop = rect?.top ?? 0;
|
|
369570
|
+
const readonlyTooltipLeft = rect ? rect.left + rect.width / 2 : 0;
|
|
369571
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.readOnlyContainer, align === "left" && styles_module_scss_1.default.readOnlyContainerLeft), children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "View mode. Remix to edit.", visible: hovered, position: "bottom", strategy: "fixed", style: {
|
|
369572
|
+
top: readonlyTooltipTop,
|
|
369573
|
+
left: readonlyTooltipLeft,
|
|
369574
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.readOnlyBanner, ref: readonlyRef, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 12, SvgElement: readonly_svg_1.default }), (0, jsx_runtime_1.jsx)("span", { children: "Read Only" })] })] }));
|
|
369575
|
+
};
|
|
369576
|
+
exports["default"] = ReadOnlyBanner;
|
|
369577
|
+
|
|
369578
|
+
|
|
369427
369579
|
/***/ }),
|
|
369428
369580
|
|
|
369429
369581
|
/***/ 55339:
|
|
@@ -370252,18 +370404,18 @@ const useHtmlRunner = () => {
|
|
|
370252
370404
|
};
|
|
370253
370405
|
}, [shouldUseBrowserHistory]);
|
|
370254
370406
|
(0, react_1.useEffect)(() => {
|
|
370255
|
-
if (isPreviewMode)
|
|
370256
|
-
|
|
370257
|
-
|
|
370258
|
-
|
|
370259
|
-
|
|
370260
|
-
|
|
370261
|
-
}
|
|
370262
|
-
|
|
370263
|
-
|
|
370264
|
-
|
|
370265
|
-
|
|
370266
|
-
}
|
|
370407
|
+
if (!isPreviewMode)
|
|
370408
|
+
return;
|
|
370409
|
+
const handleMessage = (event) => {
|
|
370410
|
+
if (event.data.type === BroadcastMessageType.RELOAD_PROJECT) {
|
|
370411
|
+
// Trigger a reload of a preview page
|
|
370412
|
+
window.location.reload();
|
|
370413
|
+
}
|
|
370414
|
+
};
|
|
370415
|
+
broadcastChannel.current?.addEventListener("message", handleMessage);
|
|
370416
|
+
return () => {
|
|
370417
|
+
broadcastChannel.current?.removeEventListener("message", handleMessage);
|
|
370418
|
+
};
|
|
370267
370419
|
}, [isPreviewMode]);
|
|
370268
370420
|
(0, react_1.useEffect)(() => {
|
|
370269
370421
|
const handleReloadMessage = (event) => {
|
|
@@ -370315,15 +370467,15 @@ const useHtmlRunner = () => {
|
|
|
370315
370467
|
dispatch((0, EditorSlice_1.setLoadedRunner)(EditorTypes_1.RunnerType.HTML));
|
|
370316
370468
|
}, []);
|
|
370317
370469
|
(0, react_1.useEffect)(() => {
|
|
370318
|
-
if (codeRunTriggered)
|
|
370319
|
-
|
|
370320
|
-
|
|
370321
|
-
|
|
370322
|
-
|
|
370323
|
-
|
|
370324
|
-
|
|
370325
|
-
|
|
370326
|
-
}
|
|
370470
|
+
if (!codeRunTriggered)
|
|
370471
|
+
return;
|
|
370472
|
+
// Fresh iframe for each run (clean slate); it persists across view switches
|
|
370473
|
+
createIframe();
|
|
370474
|
+
runCode();
|
|
370475
|
+
if (!isPreviewMode) {
|
|
370476
|
+
broadcastChannel.current?.postMessage({
|
|
370477
|
+
type: BroadcastMessageType.RELOAD_PROJECT,
|
|
370478
|
+
});
|
|
370327
370479
|
}
|
|
370328
370480
|
}, [codeRunTriggered, page, isPreviewMode]);
|
|
370329
370481
|
(0, react_1.useEffect)(() => {
|
|
@@ -370537,7 +370689,7 @@ const useIframeHost = ({ codeHasBeenRun, error, page, isPreviewMode, onIframeLoa
|
|
|
370537
370689
|
slotRef.current = node;
|
|
370538
370690
|
setSlotVersion((v) => v + 1);
|
|
370539
370691
|
}, []);
|
|
370540
|
-
// Create the persistent host + iframe once; tear it down on unmount
|
|
370692
|
+
// Create the persistent host + iframe once; tear it down on unmount.
|
|
370541
370693
|
(0, react_1.useEffect)(() => {
|
|
370542
370694
|
if (typeof document === "undefined")
|
|
370543
370695
|
return;
|
|
@@ -370555,6 +370707,7 @@ const useIframeHost = ({ codeHasBeenRun, error, page, isPreviewMode, onIframeLoa
|
|
|
370555
370707
|
document.body.removeChild(host);
|
|
370556
370708
|
hostRef.current = null;
|
|
370557
370709
|
output.current = null;
|
|
370710
|
+
setHostReady(false);
|
|
370558
370711
|
};
|
|
370559
370712
|
}, [createIframe]);
|
|
370560
370713
|
// Keep the host aligned with the active slot across resizes/scrolls/switches
|
|
@@ -370902,7 +371055,7 @@ const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
|
|
|
370902
371055
|
* The React component itself stays free of any worker plumbing — it just
|
|
370903
371056
|
* consumes the values returned here to drive its JSX.
|
|
370904
371057
|
*/
|
|
370905
|
-
const usePyodideRunner = ({
|
|
371058
|
+
const usePyodideRunner = ({ packageApiUrl, }) => {
|
|
370906
371059
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
370907
371060
|
// -------------------------------------------------------------------------
|
|
370908
371061
|
// Redux selectors
|
|
@@ -371067,7 +371220,11 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
371067
371220
|
const handleError = (0, react_1.useCallback)((file, line, mistake, type, info) => {
|
|
371068
371221
|
let errorMessage;
|
|
371069
371222
|
if (type === "KeyboardInterrupt") {
|
|
371070
|
-
errorMessage = "Execution interrupted";
|
|
371223
|
+
errorMessage = info || "Execution interrupted";
|
|
371224
|
+
}
|
|
371225
|
+
else if (type === "InputUnavailableError") {
|
|
371226
|
+
errorMessage =
|
|
371227
|
+
info || "Input timed out. Rerun your code and try again.";
|
|
371071
371228
|
}
|
|
371072
371229
|
else {
|
|
371073
371230
|
const message = [type, info].filter((s) => s).join(": ");
|
|
@@ -371142,7 +371299,6 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
371142
371299
|
handleVisual,
|
|
371143
371300
|
]);
|
|
371144
371301
|
const { worker: pyodideWorker, recreateWorker } = (0, usePyodideWorker_1.usePyodideWorker)({
|
|
371145
|
-
active,
|
|
371146
371302
|
projectIdentifier: project.identifier,
|
|
371147
371303
|
onMessage: handleMessage,
|
|
371148
371304
|
onBeforeRecreate: handleBeforeRecreate,
|
|
@@ -371170,7 +371326,6 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
371170
371326
|
recreateWorker();
|
|
371171
371327
|
}, [recreateWorker]);
|
|
371172
371328
|
const { ensureInputServiceWorker, registerStdinClient } = (0, useStdinServiceWorker_1.useStdinServiceWorker)({
|
|
371173
|
-
active,
|
|
371174
371329
|
tabIdRef,
|
|
371175
371330
|
onStdinRequest: handleStdinRequest,
|
|
371176
371331
|
onControllerChange: handleControllerChange,
|
|
@@ -371334,13 +371489,13 @@ const usePyodideRunner = ({ active, packageApiUrl, }) => {
|
|
|
371334
371489
|
}, [pyodideWorker, ensureInputServiceWorker, packageApiUrl]);
|
|
371335
371490
|
// Kick off a run when the Redux flag flips on.
|
|
371336
371491
|
(0, react_1.useEffect)(() => {
|
|
371337
|
-
if (codeRunTriggered &&
|
|
371492
|
+
if (codeRunTriggered && output.current) {
|
|
371338
371493
|
handleRun();
|
|
371339
371494
|
}
|
|
371340
371495
|
}, [codeRunTriggered, output.current]);
|
|
371341
371496
|
// Stop a run when the Redux flag flips on.
|
|
371342
371497
|
(0, react_1.useEffect)(() => {
|
|
371343
|
-
if (codeRunStopped
|
|
371498
|
+
if (codeRunStopped) {
|
|
371344
371499
|
handleStop();
|
|
371345
371500
|
}
|
|
371346
371501
|
}, [codeRunStopped]);
|
|
@@ -371369,7 +371524,7 @@ const assetUrls_1 = __webpack_require__(85799);
|
|
|
371369
371524
|
* Owns the lifecycle of the Pyodide Web Worker.
|
|
371370
371525
|
*
|
|
371371
371526
|
* Responsibilities:
|
|
371372
|
-
* - Create the worker
|
|
371527
|
+
* - Create the worker on mount.
|
|
371373
371528
|
* - Re-create the worker whenever the project identifier changes (each
|
|
371374
371529
|
* project starts from a clean Python environment).
|
|
371375
371530
|
* - Expose an imperative `recreateWorker` for callers that need to force a
|
|
@@ -371379,7 +371534,7 @@ const assetUrls_1 = __webpack_require__(85799);
|
|
|
371379
371534
|
* Posting messages and decoding incoming messages is the orchestrator's job —
|
|
371380
371535
|
* this hook just hands the worker over and forwards messages.
|
|
371381
371536
|
*/
|
|
371382
|
-
const usePyodideWorker = ({
|
|
371537
|
+
const usePyodideWorker = ({ projectIdentifier, onMessage, onBeforeRecreate, }) => {
|
|
371383
371538
|
const [worker, setWorker] = (0, react_1.useState)(null);
|
|
371384
371539
|
// The onMessage callback closes over orchestrator state, so we route through
|
|
371385
371540
|
// a ref to avoid rebuilding the worker every render.
|
|
@@ -371407,22 +371562,14 @@ const usePyodideWorker = ({ active, projectIdentifier, onMessage, onBeforeRecrea
|
|
|
371407
371562
|
return createWorker();
|
|
371408
371563
|
});
|
|
371409
371564
|
}, [createWorker]);
|
|
371410
|
-
// First-mount creation: only when
|
|
371565
|
+
// First-mount creation: only when no worker exists yet.
|
|
371411
371566
|
(0, react_1.useEffect)(() => {
|
|
371412
371567
|
if (worker)
|
|
371413
371568
|
return;
|
|
371414
|
-
if (!active)
|
|
371415
|
-
return;
|
|
371416
371569
|
setWorker(createWorker());
|
|
371417
|
-
}, [
|
|
371418
|
-
// Project changes always reset the worker
|
|
371419
|
-
// the active one. Without this gate the hook would spin up a Pyodide
|
|
371420
|
-
// worker for HTML projects too, since the runner factory now calls
|
|
371421
|
-
// usePythonRunner unconditionally and only skips its side effects via
|
|
371422
|
-
// `active`.
|
|
371570
|
+
}, [worker, createWorker]);
|
|
371571
|
+
// Project changes always reset the worker.
|
|
371423
371572
|
(0, react_1.useEffect)(() => {
|
|
371424
|
-
if (!active)
|
|
371425
|
-
return;
|
|
371426
371573
|
recreateWorker();
|
|
371427
371574
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
371428
371575
|
}, [projectIdentifier]);
|
|
@@ -371462,7 +371609,7 @@ const serviceWorker_1 = __webpack_require__(58158);
|
|
|
371462
371609
|
* Returns helpers (`ensureInputServiceWorker`, `registerStdinClient`) the
|
|
371463
371610
|
* orchestrator calls from `run` and from `init`.
|
|
371464
371611
|
*/
|
|
371465
|
-
const useStdinServiceWorker = ({
|
|
371612
|
+
const useStdinServiceWorker = ({ tabIdRef, onStdinRequest, onControllerChange, }) => {
|
|
371466
371613
|
// Keep latest callbacks in refs so the event listener effects don't need to
|
|
371467
371614
|
// re-subscribe whenever the parent re-renders with a new closure.
|
|
371468
371615
|
const onStdinRequestRef = (0, react_1.useRef)(onStdinRequest);
|
|
@@ -371566,9 +371713,6 @@ const useStdinServiceWorker = ({ active, tabIdRef, onStdinRequest, onControllerC
|
|
|
371566
371713
|
// Re-register stdin client and notify the orchestrator whenever the page
|
|
371567
371714
|
// gains a new SW controller (e.g. after first registration or a SW update).
|
|
371568
371715
|
(0, react_1.useEffect)(() => {
|
|
371569
|
-
if (!active) {
|
|
371570
|
-
return;
|
|
371571
|
-
}
|
|
371572
371716
|
if (!("serviceWorker" in navigator)) {
|
|
371573
371717
|
return;
|
|
371574
371718
|
}
|
|
@@ -371583,7 +371727,7 @@ const useStdinServiceWorker = ({ active, tabIdRef, onStdinRequest, onControllerC
|
|
|
371583
371727
|
return () => {
|
|
371584
371728
|
navigator.serviceWorker.removeEventListener("controllerchange", handleControllerChange);
|
|
371585
371729
|
};
|
|
371586
|
-
}, [
|
|
371730
|
+
}, [registerStdinClient]);
|
|
371587
371731
|
return { ensureInputServiceWorker, registerStdinClient };
|
|
371588
371732
|
};
|
|
371589
371733
|
exports.useStdinServiceWorker = useStdinServiceWorker;
|
|
@@ -372045,18 +372189,17 @@ const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
|
|
|
372045
372189
|
const VisualOutputPane_1 = __importDefault(__webpack_require__(39626));
|
|
372046
372190
|
const usePyodideRunner_1 = __webpack_require__(65587);
|
|
372047
372191
|
const consoleInput_1 = __webpack_require__(35660);
|
|
372048
|
-
const usePythonRunner = ({
|
|
372192
|
+
const usePythonRunner = ({ packageApiUrl, }) => {
|
|
372049
372193
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
372050
372194
|
const activeRunner = (0, stores_1.useAppSelector)((state) => state.editor.activeRunner);
|
|
372051
372195
|
const { mountConsole, visuals, setVisuals } = (0, usePyodideRunner_1.usePyodideRunner)({
|
|
372052
|
-
active,
|
|
372053
372196
|
packageApiUrl,
|
|
372054
372197
|
});
|
|
372055
372198
|
(0, react_1.useEffect)(() => {
|
|
372056
|
-
if (
|
|
372199
|
+
if (activeRunner !== EditorTypes_1.RunnerType.PYODIDE) {
|
|
372057
372200
|
dispatch((0, EditorSlice_1.loadingRunner)(EditorTypes_1.RunnerType.PYODIDE));
|
|
372058
372201
|
}
|
|
372059
|
-
}, [
|
|
372202
|
+
}, [activeRunner, dispatch]);
|
|
372060
372203
|
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]);
|
|
372061
372204
|
const renderVisualOutput = (0, react_1.useCallback)(() => ((0, jsx_runtime_1.jsx)(VisualOutputPane_1.default, { visuals: visuals, setVisuals: setVisuals })), [visuals, setVisuals]);
|
|
372062
372205
|
const outputMeta = {
|
|
@@ -372112,9 +372255,9 @@ const ProjectTypes_1 = __webpack_require__(27130);
|
|
|
372112
372255
|
const EditorTypes_1 = __webpack_require__(42108);
|
|
372113
372256
|
const useRunnerFactory = ({ projectType, packageApiUrl, }) => {
|
|
372114
372257
|
const isWeb = projectType === ProjectTypes_1.ProjectType.WEB;
|
|
372115
|
-
const
|
|
372116
|
-
|
|
372117
|
-
|
|
372258
|
+
const { renderVisualOutput, renderConsoleOutput, outputMeta, panelOrder } =
|
|
372259
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
372260
|
+
isWeb ? (0, useHtmlRunner_1.default)() : (0, usePythonRunner_1.default)({ packageApiUrl });
|
|
372118
372261
|
// The output-type → renderer mapping is identical across runners, so compose
|
|
372119
372262
|
// the public renderOutput here rather than duplicating it in each hook.
|
|
372120
372263
|
const renderOutput = (0, react_1.useCallback)((outputType) => outputType === EditorTypes_1.OutputType.VISUAL
|
|
@@ -372155,7 +372298,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
372155
372298
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
372156
372299
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
372157
372300
|
const EditorPanel_1 = __importDefault(__webpack_require__(82467));
|
|
372158
|
-
const ReadOnlyBanner_1 = __importDefault(__webpack_require__(
|
|
372301
|
+
const ReadOnlyBanner_1 = __importDefault(__webpack_require__(47918));
|
|
372159
372302
|
const FileTabContent = ({ file }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ReadOnlyBanner_1.default, { align: "left" }), (0, jsx_runtime_1.jsx)(EditorPanel_1.default, { file: file })] }));
|
|
372160
372303
|
exports["default"] = FileTabContent;
|
|
372161
372304
|
|
|
@@ -372548,7 +372691,7 @@ const Dropdown = (props) => {
|
|
|
372548
372691
|
const [isOpen, setOpen] = (0, react_1.useState)(false);
|
|
372549
372692
|
const buttonRef = (0, react_1.useRef)(null);
|
|
372550
372693
|
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
372551
|
-
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 })] }));
|
|
372694
|
+
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: "bottom", strategy: "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 })] }));
|
|
372552
372695
|
};
|
|
372553
372696
|
exports["default"] = Dropdown;
|
|
372554
372697
|
|
|
@@ -372631,7 +372774,7 @@ const FileTreeActions = ({ hasExpandedNodes, }) => {
|
|
|
372631
372774
|
const { hovered: toggleHovered, hoverProps: toggleHoverProps } = (0, useHover_1.useHover)();
|
|
372632
372775
|
const { hovered: addFolderHovered, hoverProps: addFolderHoverProps } = (0, useHover_1.useHover)();
|
|
372633
372776
|
const { hovered: addFileHovered, hoverProps: addFileHoverProps } = (0, useHover_1.useHover)();
|
|
372634
|
-
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 })] }))] }));
|
|
372777
|
+
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: "bottom", strategy: "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: "bottom", strategy: "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: "bottom", strategy: "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: "bottom", strategy: "fixed", size: "fit" })] }), (0, jsx_runtime_1.jsx)(ImportButton_1.ImportButton, { importFiles: importFiles, importFolder: importFolder })] }))] }));
|
|
372635
372778
|
};
|
|
372636
372779
|
exports.FileTreeActions = FileTreeActions;
|
|
372637
372780
|
|
|
@@ -372667,7 +372810,7 @@ const BasicItemContent = ({ item, onContextMenu, }) => {
|
|
|
372667
372810
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.itemContent, onContextMenu: onContextMenu, children: [(0, jsx_runtime_1.jsx)(ItemIcon_1.ItemIcon, { itemData: itemData }), (0, jsx_runtime_1.jsx)(Text_1.Text, { className: styles_module_scss_1.default.itemTitle, size: 12, draggable: true, ...hoverProps, children: item.getItemName() }), !isSharedProject && ((0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { className: styles_module_scss_1.default.itemButton, size: 16, SvgElement: button_dots_svg_1.default, onClick: (e) => {
|
|
372668
372811
|
onContextMenu(e);
|
|
372669
372812
|
e.stopPropagation();
|
|
372670
|
-
} }))] }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: item.getItemName(), visible: hovered, position: "bottom" })] }));
|
|
372813
|
+
} }))] }), (0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: item.getItemName(), visible: hovered, position: "bottom", strategy: "fixed" })] }));
|
|
372671
372814
|
};
|
|
372672
372815
|
exports.BasicItemContent = BasicItemContent;
|
|
372673
372816
|
|
|
@@ -374255,10 +374398,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
374255
374398
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
374256
374399
|
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
374257
374400
|
const styles_module_scss_1 = __importDefault(__webpack_require__(28188));
|
|
374258
|
-
const Tooltip = ({ message, visible = false, position = "bottom", size = "default", className, style, }) => {
|
|
374401
|
+
const Tooltip = ({ message, visible = false, position = "bottom", strategy = "absolute", size = "default", className, style, }) => {
|
|
374259
374402
|
if (!visible)
|
|
374260
374403
|
return null;
|
|
374261
|
-
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 }));
|
|
374404
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.tooltip, styles_module_scss_1.default[`strategy-${strategy}`], position && styles_module_scss_1.default[`position-${strategy}-${position}`], styles_module_scss_1.default[`size-${size}`], visible && styles_module_scss_1.default.visible, className), role: "tooltip", style: style, children: message }));
|
|
374262
374405
|
};
|
|
374263
374406
|
exports["default"] = Tooltip;
|
|
374264
374407
|
|
|
@@ -385732,7 +385875,7 @@ module.exports = webpackAsyncContext;
|
|
|
385732
385875
|
/***/ 24427:
|
|
385733
385876
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
385734
385877
|
|
|
385735
|
-
module.exports = __webpack_require__.p + "assets/
|
|
385878
|
+
module.exports = __webpack_require__.p + "assets/PyodideWorkereba24d5259c22fbe422a.js";
|
|
385736
385879
|
|
|
385737
385880
|
/***/ }),
|
|
385738
385881
|
|