gwchq-textjam 0.2.22 → 0.2.24
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 +23 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -68344,8 +68344,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68344
68344
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68345
68345
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68346
68346
|
/* harmony export */ });
|
|
68347
|
-
/* harmony import */ var
|
|
68348
|
-
/* harmony import */ var
|
|
68347
|
+
/* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
68348
|
+
/* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
|
|
68349
68349
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68350
68350
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
|
|
68351
68351
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
@@ -68369,7 +68369,7 @@ var DraggableTab = _ref => {
|
|
|
68369
68369
|
panelIndex,
|
|
68370
68370
|
fileIndex
|
|
68371
68371
|
} = _ref,
|
|
68372
|
-
otherProps = (0,
|
|
68372
|
+
otherProps = (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
|
|
68373
68373
|
var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
|
|
68374
68374
|
var openFilesCount = openFiles[panelIndex].length;
|
|
68375
68375
|
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
@@ -68386,7 +68386,7 @@ var DraggableTab = _ref => {
|
|
|
68386
68386
|
switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
|
|
68387
68387
|
}
|
|
68388
68388
|
};
|
|
68389
|
-
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,
|
|
68389
|
+
var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
68390
68390
|
onClick: e => {
|
|
68391
68391
|
e.stopPropagation();
|
|
68392
68392
|
switchToFileTab(panelIndex, fileIndex);
|
|
@@ -68404,7 +68404,7 @@ var DraggableTab = _ref => {
|
|
|
68404
68404
|
draggableProps,
|
|
68405
68405
|
dragHandleProps
|
|
68406
68406
|
} = _ref2;
|
|
68407
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,
|
|
68407
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
68408
68408
|
className: "draggable-tab",
|
|
68409
68409
|
ref: innerRef
|
|
68410
68410
|
}, draggableProps), dragHandleProps), {}, {
|
|
@@ -68426,8 +68426,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68426
68426
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
68427
68427
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
68428
68428
|
/* harmony export */ });
|
|
68429
|
-
/* harmony import */ var
|
|
68430
|
-
/* harmony import */ var
|
|
68429
|
+
/* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
|
|
68430
|
+
/* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
|
|
68431
68431
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
68432
68432
|
/* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
|
|
68433
68433
|
/* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
|
|
@@ -68446,8 +68446,8 @@ var DroppableTabList = _ref => {
|
|
|
68446
68446
|
children: _children,
|
|
68447
68447
|
index
|
|
68448
68448
|
} = _ref,
|
|
68449
|
-
otherProps = (0,
|
|
68450
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,
|
|
68449
|
+
otherProps = (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
|
|
68450
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
|
|
68451
68451
|
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
|
|
68452
68452
|
direction: "horizontal",
|
|
68453
68453
|
droppableId: index.toString(),
|
|
@@ -68457,7 +68457,7 @@ var DroppableTabList = _ref => {
|
|
|
68457
68457
|
droppableProps,
|
|
68458
68458
|
placeholder
|
|
68459
68459
|
} = _ref2;
|
|
68460
|
-
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,
|
|
68460
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
|
|
68461
68461
|
className: "droppable-tab-list"
|
|
68462
68462
|
}, droppableProps), {}, {
|
|
68463
68463
|
ref: innerRef,
|
|
@@ -103011,7 +103011,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
103011
103011
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
103012
103012
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
103013
103013
|
/* harmony export */ });
|
|
103014
|
-
/* harmony import */ var
|
|
103014
|
+
/* harmony import */ var D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
|
|
103015
103015
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
103016
103016
|
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
103017
103017
|
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68512);
|
|
@@ -103125,7 +103125,7 @@ var ProjectName = _ref => {
|
|
|
103125
103125
|
id: "project_name_label",
|
|
103126
103126
|
className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
|
|
103127
103127
|
children: "Project Name"
|
|
103128
|
-
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,
|
|
103128
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", (0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,D_gwc2_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
|
|
103129
103129
|
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className)
|
|
103130
103130
|
}, hoverProps), {}, {
|
|
103131
103131
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)((components_Tooltip_Tooltip__WEBPACK_IMPORTED_MODULE_8___default()), {
|
|
@@ -372764,10 +372764,11 @@ const WebComponentLoader = (props) => {
|
|
|
372764
372764
|
saveProject,
|
|
372765
372765
|
user,
|
|
372766
372766
|
isShared: isSharedProject,
|
|
372767
|
+
isPreviewMode: isPreviewMode,
|
|
372767
372768
|
});
|
|
372768
372769
|
(0, useProjectTabSync_1.useProjectTabSync)({
|
|
372769
372770
|
projectKey: projectIdentifier,
|
|
372770
|
-
enabled: !isPreviewMode,
|
|
372771
|
+
enabled: !isPreviewMode && !isSharedProject,
|
|
372771
372772
|
});
|
|
372772
372773
|
(0, react_1.useEffect)(() => {
|
|
372773
372774
|
dispatch((0, EditorSlice_1.setReadOnly)(readOnly));
|
|
@@ -373920,7 +373921,7 @@ const LeaveFlowSlice_1 = __webpack_require__(52990);
|
|
|
373920
373921
|
const projectSnapshotHelpers_1 = __webpack_require__(22390);
|
|
373921
373922
|
const selectors_1 = __webpack_require__(43551);
|
|
373922
373923
|
const AUTO_SAVE_INTERVAL = 2000;
|
|
373923
|
-
const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProject, isShared, }) => {
|
|
373924
|
+
const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProject, isShared, isPreviewMode = false, }) => {
|
|
373924
373925
|
const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
|
|
373925
373926
|
const saveTriggered = (0, stores_1.useAppSelector)((state) => state.editor.saveTriggered);
|
|
373926
373927
|
const saving = (0, stores_1.useAppSelector)((state) => state.editor.saving);
|
|
@@ -373945,6 +373946,8 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
|
|
|
373945
373946
|
console.warn("No changes detected. Save won't be processed.");
|
|
373946
373947
|
return;
|
|
373947
373948
|
}
|
|
373949
|
+
// skip the post-save URL sync only when this save is part of a leave flow
|
|
373950
|
+
const skipRedirect = leaveFlow.status === LeaveFlowSlice_1.LeaveFlowStatus.SAVING;
|
|
373948
373951
|
// Name-only save: patch repository name, but do not create/upload a new commit.
|
|
373949
373952
|
// Do not set PROCESS here because no archive is being created.
|
|
373950
373953
|
if (!hasContentChanges && hasNameChanges && !isInitialSave) {
|
|
@@ -373953,6 +373956,7 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
|
|
|
373953
373956
|
commitBlob: null,
|
|
373954
373957
|
hasContentChanges: false,
|
|
373955
373958
|
hasNameChanges: true,
|
|
373959
|
+
skipRedirect,
|
|
373956
373960
|
});
|
|
373957
373961
|
return;
|
|
373958
373962
|
}
|
|
@@ -373964,8 +373968,6 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
|
|
|
373964
373968
|
dispatch((0, EditorSlice_1.setSaving)(types_1.SavingState.IDLE));
|
|
373965
373969
|
return;
|
|
373966
373970
|
}
|
|
373967
|
-
// should skip redirect to project on the first save to avoid conflicts with leave flow
|
|
373968
|
-
const skipRedirect = project?.commits?.length === 0;
|
|
373969
373971
|
await saveProject?.({
|
|
373970
373972
|
project,
|
|
373971
373973
|
commitBlob: zipBlob,
|
|
@@ -373989,6 +373991,7 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
|
|
|
373989
373991
|
project.identifier,
|
|
373990
373992
|
hasContentChanges,
|
|
373991
373993
|
hasNameChanges,
|
|
373994
|
+
leaveFlow.status,
|
|
373992
373995
|
]);
|
|
373993
373996
|
// finish the process if save failed
|
|
373994
373997
|
(0, react_1.useEffect)(() => {
|
|
@@ -374111,7 +374114,10 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, saveProj
|
|
|
374111
374114
|
}
|
|
374112
374115
|
upsertCacheValue(project.identifier, project)
|
|
374113
374116
|
.then(() => {
|
|
374114
|
-
|
|
374117
|
+
// Shared (read-only) and preview tabs must not emit cross-tab change events
|
|
374118
|
+
if (!isShared && !isPreviewMode) {
|
|
374119
|
+
(0, projectTabSync_1.notifyProjectUpdated)(project.identifier);
|
|
374120
|
+
}
|
|
374115
374121
|
})
|
|
374116
374122
|
.catch(console.error);
|
|
374117
374123
|
}, AUTO_SAVE_INTERVAL);
|
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.2.
|
|
4
|
+
"version": "0.2.24",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/GirlsFirst/gwchq-textjam",
|
|
7
7
|
"author": "Girls Who Code HQ",
|