gwchq-textjam 0.1.74 → 0.1.75
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 +18 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68089,8 +68089,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68089
68089
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68090
68090
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68091
68091
|
/* harmony export */ });
|
|
68092
|
-
/* harmony import */ var
|
|
68093
|
-
/* harmony import */ var
|
|
68092
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
68093
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
|
|
68094
68094
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68095
68095
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
|
|
68096
68096
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
@@ -68114,7 +68114,7 @@ var DraggableTab = _ref => {
|
|
|
68114
68114
|
panelIndex,
|
|
68115
68115
|
fileIndex
|
|
68116
68116
|
} = _ref,
|
|
68117
|
-
otherProps = (0,
|
|
68117
|
+
otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
|
|
68118
68118
|
var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
|
|
68119
68119
|
var openFilesCount = openFiles[panelIndex].length;
|
|
68120
68120
|
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
@@ -68131,7 +68131,7 @@ var DraggableTab = _ref => {
|
|
|
68131
68131
|
switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
|
|
68132
68132
|
}
|
|
68133
68133
|
};
|
|
68134
|
-
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,
|
|
68134
|
+
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
68135
68135
|
onClick: e => {
|
|
68136
68136
|
e.stopPropagation();
|
|
68137
68137
|
switchToFileTab(panelIndex, fileIndex);
|
|
@@ -68149,7 +68149,7 @@ var DraggableTab = _ref => {
|
|
|
68149
68149
|
draggableProps,
|
|
68150
68150
|
dragHandleProps
|
|
68151
68151
|
} = _ref2;
|
|
68152
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,
|
|
68152
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
68153
68153
|
className: "draggable-tab",
|
|
68154
68154
|
ref: innerRef
|
|
68155
68155
|
}, draggableProps), dragHandleProps), {}, {
|
|
@@ -68171,8 +68171,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68171
68171
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68172
68172
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68173
68173
|
/* harmony export */ });
|
|
68174
|
-
/* harmony import */ var
|
|
68175
|
-
/* harmony import */ var
|
|
68174
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
|
|
68175
|
+
/* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
|
|
68176
68176
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68177
68177
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
|
|
68178
68178
|
/* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
|
|
@@ -68191,8 +68191,8 @@ var DroppableTabList = _ref => {
|
|
|
68191
68191
|
children: _children,
|
|
68192
68192
|
index
|
|
68193
68193
|
} = _ref,
|
|
68194
|
-
otherProps = (0,
|
|
68195
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,
|
|
68194
|
+
otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
|
|
68195
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
|
|
68196
68196
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
|
|
68197
68197
|
direction: "horizontal",
|
|
68198
68198
|
droppableId: index.toString(),
|
|
@@ -68202,7 +68202,7 @@ var DroppableTabList = _ref => {
|
|
|
68202
68202
|
droppableProps,
|
|
68203
68203
|
placeholder
|
|
68204
68204
|
} = _ref2;
|
|
68205
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,
|
|
68205
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
|
|
68206
68206
|
className: "droppable-tab-list"
|
|
68207
68207
|
}, droppableProps), {}, {
|
|
68208
68208
|
ref: innerRef,
|
|
@@ -368916,7 +368916,6 @@ function HtmlRunner() {
|
|
|
368916
368916
|
const readOnly = (0, stores_1.useAppSelector)((state) => state.editor.readOnly);
|
|
368917
368917
|
const outputOnly = (0, stores_1.useAppSelector)((state) => state.editor.isOutputOnly);
|
|
368918
368918
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
368919
|
-
const location = (0, react_router_dom_1.useLocation)();
|
|
368920
368919
|
const output = (0, react_1.useRef)(null);
|
|
368921
368920
|
const [searchParams, setSearchParams] = (0, react_router_dom_1.useSearchParams)();
|
|
368922
368921
|
// Using BroadcastChannel to communicate between the main app and the preview tab
|
|
@@ -368940,13 +368939,17 @@ function HtmlRunner() {
|
|
|
368940
368939
|
defaultPreviewFilePath = page;
|
|
368941
368940
|
}
|
|
368942
368941
|
const [runningFilePath, setRunningFilePath] = (0, react_1.useState)(defaultPreviewFilePath);
|
|
368943
|
-
const isPreviewMode =
|
|
368942
|
+
const isPreviewMode = searchParams.get("preview") === "1";
|
|
368944
368943
|
(0, react_1.useEffect)(() => {
|
|
368945
368944
|
if (isPreviewMode) {
|
|
368946
368945
|
dispatch((0, EditorSlice_1.setIsOutputOnly)(true));
|
|
368947
368946
|
dispatch((0, EditorSlice_2.triggerCodeRun)());
|
|
368948
|
-
if (page) {
|
|
368949
|
-
setSearchParams(
|
|
368947
|
+
if (page && isPreviewMode) {
|
|
368948
|
+
setSearchParams((prevParams) => {
|
|
368949
|
+
const updatedParams = new URLSearchParams(prevParams);
|
|
368950
|
+
updatedParams.set("page", page);
|
|
368951
|
+
return updatedParams;
|
|
368952
|
+
}, { replace: true });
|
|
368950
368953
|
}
|
|
368951
368954
|
}
|
|
368952
368955
|
}, [isPreviewMode, page, setSearchParams]);
|
|
@@ -369077,7 +369080,7 @@ function HtmlRunner() {
|
|
|
369077
369080
|
return () => window.removeEventListener("message", handler);
|
|
369078
369081
|
}, []);
|
|
369079
369082
|
const openPreview = () => {
|
|
369080
|
-
window.open(`${window.location.href}
|
|
369083
|
+
window.open(`${window.location.href}?preview=1&page=${runningFilePath}`, "_blank", "noopener,noreferrer");
|
|
369081
369084
|
};
|
|
369082
369085
|
const openInNewTabLink = ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.previewLink, onClick: openPreview, children: (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: open_in_new_tab_svg_1.default, size: 16 }) }));
|
|
369083
369086
|
const iframeClasses = (0, classnames_1.default)(styles_module_scss_1.default.iframe, {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gwchq-textjam",
|
|
3
3
|
"description": "Embeddable React editor used in Raspberry Pi text-based projects.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.75",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/GirlsFirst/gwchq-textjam",
|
|
7
7
|
"author": "Girls Who Code HQ",
|