gwchq-textjam 0.1.89 → 0.1.91
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 +572 -470
- package/dist/style.css +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -65157,6 +65157,34 @@ function SvgGifFile(props) {
|
|
|
65157
65157
|
|
|
65158
65158
|
/***/ }),
|
|
65159
65159
|
|
|
65160
|
+
/***/ 93113:
|
|
65161
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
65162
|
+
|
|
65163
|
+
__webpack_require__.r(__webpack_exports__);
|
|
65164
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65165
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
65166
|
+
/* harmony export */ });
|
|
65167
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
65168
|
+
var _path;
|
|
65169
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
65170
|
+
|
|
65171
|
+
function SvgHistory(props) {
|
|
65172
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
|
|
65173
|
+
viewBox: "0 0 20 18",
|
|
65174
|
+
fill: "none",
|
|
65175
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
65176
|
+
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
|
|
65177
|
+
d: "M3.01 11.542a8.1 8.1 0 101.916-8.424L.75 7.042m0 0h4.5m-4.5 0v-4.5m9.9 1.8v5.4l3.601 1.8",
|
|
65178
|
+
stroke: "currentColor",
|
|
65179
|
+
strokeWidth: 1.5,
|
|
65180
|
+
strokeLinecap: "round",
|
|
65181
|
+
strokeLinejoin: "round"
|
|
65182
|
+
})));
|
|
65183
|
+
}
|
|
65184
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgHistory);
|
|
65185
|
+
|
|
65186
|
+
/***/ }),
|
|
65187
|
+
|
|
65160
65188
|
/***/ 69046:
|
|
65161
65189
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
65162
65190
|
|
|
@@ -65713,6 +65741,35 @@ function SvgRemix(props) {
|
|
|
65713
65741
|
|
|
65714
65742
|
/***/ }),
|
|
65715
65743
|
|
|
65744
|
+
/***/ 503:
|
|
65745
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
65746
|
+
|
|
65747
|
+
__webpack_require__.r(__webpack_exports__);
|
|
65748
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65749
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
65750
|
+
/* harmony export */ });
|
|
65751
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
65752
|
+
var _path;
|
|
65753
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
65754
|
+
|
|
65755
|
+
function SvgRestore(props) {
|
|
65756
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
|
|
65757
|
+
width: 32,
|
|
65758
|
+
height: 32,
|
|
65759
|
+
fill: "none",
|
|
65760
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
65761
|
+
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
|
|
65762
|
+
d: "M7.012 19.589A10.8 10.8 0 109.568 8.356L4 13.59m0 0h6m-6 0v-6m13.2 2.4v7.2l4.801 2.4",
|
|
65763
|
+
stroke: "#003046",
|
|
65764
|
+
strokeWidth: 2,
|
|
65765
|
+
strokeLinecap: "round",
|
|
65766
|
+
strokeLinejoin: "round"
|
|
65767
|
+
})));
|
|
65768
|
+
}
|
|
65769
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgRestore);
|
|
65770
|
+
|
|
65771
|
+
/***/ }),
|
|
65772
|
+
|
|
65716
65773
|
/***/ 48268:
|
|
65717
65774
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
65718
65775
|
|
|
@@ -101791,7 +101848,7 @@ var EditorPanel = _ref => {
|
|
|
101791
101848
|
|
|
101792
101849
|
/***/ }),
|
|
101793
101850
|
|
|
101794
|
-
/***/
|
|
101851
|
+
/***/ 69118:
|
|
101795
101852
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
101796
101853
|
|
|
101797
101854
|
// ESM COMPAT FLAG
|
|
@@ -101814,301 +101871,9 @@ var lib = __webpack_require__(13323);
|
|
|
101814
101871
|
// EXTERNAL MODULE: ./src/components/Editor/Output/Output.tsx
|
|
101815
101872
|
var Output = __webpack_require__(95148);
|
|
101816
101873
|
var Output_default = /*#__PURE__*/__webpack_require__.n(Output);
|
|
101817
|
-
// EXTERNAL MODULE: ./src/
|
|
101818
|
-
var
|
|
101819
|
-
|
|
101820
|
-
var text_jam_logo = __webpack_require__(97552);
|
|
101821
|
-
// EXTERNAL MODULE: ./src/redux/EditorSlice.ts
|
|
101822
|
-
var EditorSlice = __webpack_require__(68512);
|
|
101823
|
-
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
|
101824
|
-
var classnames = __webpack_require__(46942);
|
|
101825
|
-
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
101826
|
-
// EXTERNAL MODULE: ./src/components/ProjectName/styles.module.scss
|
|
101827
|
-
var styles_module = __webpack_require__(32026);
|
|
101828
|
-
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
101829
|
-
var jsx_runtime = __webpack_require__(74848);
|
|
101830
|
-
;// ./src/components/ProjectName/ProjectName.jsx
|
|
101831
|
-
|
|
101832
|
-
|
|
101833
|
-
|
|
101834
|
-
|
|
101835
|
-
|
|
101836
|
-
|
|
101837
|
-
var ProjectName = _ref => {
|
|
101838
|
-
var {
|
|
101839
|
-
className = null,
|
|
101840
|
-
showLabel = false,
|
|
101841
|
-
editable = true
|
|
101842
|
-
} = _ref;
|
|
101843
|
-
var project = (0,external_react_redux_.useSelector)(state => state.editor.project, external_react_redux_.shallowEqual);
|
|
101844
|
-
var dispatch = (0,external_react_redux_.useDispatch)();
|
|
101845
|
-
var nameInput = (0,external_react_.useRef)(null);
|
|
101846
|
-
var [isEditing, setEditing] = (0,external_react_.useState)(false);
|
|
101847
|
-
var [name, setName] = (0,external_react_.useState)(project.name || "New project");
|
|
101848
|
-
(0,external_react_.useEffect)(() => {
|
|
101849
|
-
setName(project.name);
|
|
101850
|
-
}, [project.name]);
|
|
101851
|
-
(0,external_react_.useEffect)(() => {
|
|
101852
|
-
if (isEditing) {
|
|
101853
|
-
var _nameInput$current, _nameInput$current2;
|
|
101854
|
-
(_nameInput$current = nameInput.current) === null || _nameInput$current === void 0 || _nameInput$current.focus();
|
|
101855
|
-
(_nameInput$current2 = nameInput.current) === null || _nameInput$current2 === void 0 || _nameInput$current2.select();
|
|
101856
|
-
}
|
|
101857
|
-
}, [isEditing]);
|
|
101858
|
-
var startEditing = () => {
|
|
101859
|
-
if (!editable) return;
|
|
101860
|
-
setEditing(true);
|
|
101861
|
-
};
|
|
101862
|
-
var saveName = () => {
|
|
101863
|
-
var newName = nameInput.current.value.trim();
|
|
101864
|
-
if (newName && newName !== project.name) {
|
|
101865
|
-
dispatch((0,EditorSlice.updateProjectName)(newName));
|
|
101866
|
-
}
|
|
101867
|
-
setEditing(false);
|
|
101868
|
-
};
|
|
101869
|
-
var cancelEditing = () => {
|
|
101870
|
-
setName(project.name);
|
|
101871
|
-
setEditing(false);
|
|
101872
|
-
};
|
|
101873
|
-
var handleOnChange = () => {
|
|
101874
|
-
setName(nameInput.current.value);
|
|
101875
|
-
};
|
|
101876
|
-
var handleKeyDown = event => {
|
|
101877
|
-
if (event.key === "Enter") {
|
|
101878
|
-
event.preventDefault();
|
|
101879
|
-
saveName();
|
|
101880
|
-
} else if (event.key === "Escape") {
|
|
101881
|
-
cancelEditing();
|
|
101882
|
-
}
|
|
101883
|
-
};
|
|
101884
|
-
var handleOnBlur = () => {
|
|
101885
|
-
saveName();
|
|
101886
|
-
};
|
|
101887
|
-
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
101888
|
-
children: [showLabel && /*#__PURE__*/(0,jsx_runtime.jsx)("label", {
|
|
101889
|
-
htmlFor: "project_name",
|
|
101890
|
-
id: "project_name_label",
|
|
101891
|
-
className: styles_module["default"].projectLabel,
|
|
101892
|
-
children: "Project Name"
|
|
101893
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
101894
|
-
className: classnames_default()(styles_module["default"].projectName, className),
|
|
101895
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("input", {
|
|
101896
|
-
id: "project_name",
|
|
101897
|
-
ref: nameInput,
|
|
101898
|
-
type: "text",
|
|
101899
|
-
"aria-labelledby": "project_name_label",
|
|
101900
|
-
onFocus: startEditing,
|
|
101901
|
-
onClick: startEditing,
|
|
101902
|
-
onKeyDown: handleKeyDown,
|
|
101903
|
-
value: name,
|
|
101904
|
-
readOnly: !isEditing,
|
|
101905
|
-
onChange: handleOnChange,
|
|
101906
|
-
onBlur: handleOnBlur,
|
|
101907
|
-
className: classnames_default()(styles_module["default"].projectInput, {
|
|
101908
|
-
[styles_module["default"].editing]: isEditing
|
|
101909
|
-
})
|
|
101910
|
-
})
|
|
101911
|
-
})]
|
|
101912
|
-
});
|
|
101913
|
-
};
|
|
101914
|
-
/* harmony default export */ const ProjectName_ProjectName = (ProjectName);
|
|
101915
|
-
// EXTERNAL MODULE: ./src/components/DownloadButton/DownloadButton.tsx
|
|
101916
|
-
var DownloadButton = __webpack_require__(2492);
|
|
101917
|
-
var DownloadButton_default = /*#__PURE__*/__webpack_require__.n(DownloadButton);
|
|
101918
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
101919
|
-
var objectSpread2 = __webpack_require__(89379);
|
|
101920
|
-
;// ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
101921
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
101922
|
-
try {
|
|
101923
|
-
var i = n[a](c),
|
|
101924
|
-
u = i.value;
|
|
101925
|
-
} catch (n) {
|
|
101926
|
-
return void e(n);
|
|
101927
|
-
}
|
|
101928
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
101929
|
-
}
|
|
101930
|
-
function _asyncToGenerator(n) {
|
|
101931
|
-
return function () {
|
|
101932
|
-
var t = this,
|
|
101933
|
-
e = arguments;
|
|
101934
|
-
return new Promise(function (r, o) {
|
|
101935
|
-
var a = n.apply(t, e);
|
|
101936
|
-
function _next(n) {
|
|
101937
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
101938
|
-
}
|
|
101939
|
-
function _throw(n) {
|
|
101940
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
101941
|
-
}
|
|
101942
|
-
_next(void 0);
|
|
101943
|
-
});
|
|
101944
|
-
};
|
|
101945
|
-
}
|
|
101946
|
-
|
|
101947
|
-
;// ./src/assets/icons/save.svg
|
|
101948
|
-
var _path;
|
|
101949
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
101950
|
-
|
|
101951
|
-
function SvgSave(props) {
|
|
101952
|
-
return /*#__PURE__*/external_react_.createElement("svg", _extends({
|
|
101953
|
-
width: 24,
|
|
101954
|
-
height: 24,
|
|
101955
|
-
fill: "none",
|
|
101956
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
101957
|
-
}, props), _path || (_path = /*#__PURE__*/external_react_.createElement("path", {
|
|
101958
|
-
d: "M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2v16z",
|
|
101959
|
-
stroke: "#003046",
|
|
101960
|
-
strokeWidth: 1.5,
|
|
101961
|
-
strokeLinecap: "round",
|
|
101962
|
-
strokeLinejoin: "round"
|
|
101963
|
-
})));
|
|
101964
|
-
}
|
|
101965
|
-
/* harmony default export */ const save = (SvgSave);
|
|
101966
|
-
// EXTERNAL MODULE: ./src/components/Button/Button.jsx + 1 modules
|
|
101967
|
-
var Button = __webpack_require__(60232);
|
|
101968
|
-
// EXTERNAL MODULE: ./src/redux/types.ts
|
|
101969
|
-
var types = __webpack_require__(92932);
|
|
101970
|
-
// EXTERNAL MODULE: ./src/components/SpinnerDotted/SpinnerDotted.tsx
|
|
101971
|
-
var SpinnerDotted = __webpack_require__(79458);
|
|
101972
|
-
;// ./src/components/SaveButton/styles.module.scss
|
|
101973
|
-
// extracted by mini-css-extract-plugin
|
|
101974
|
-
/* harmony default export */ const SaveButton_styles_module = ({"content":"styles-module__content--Cgvxl"});
|
|
101975
|
-
;// ./src/components/SaveButton/SaveButton.jsx
|
|
101976
|
-
|
|
101977
|
-
|
|
101978
|
-
|
|
101979
|
-
|
|
101980
|
-
|
|
101981
|
-
|
|
101982
|
-
|
|
101983
|
-
|
|
101984
|
-
|
|
101985
|
-
|
|
101986
|
-
|
|
101987
|
-
var SaveButton = props => {
|
|
101988
|
-
var dispatch = (0,external_react_redux_.useDispatch)();
|
|
101989
|
-
var loading = (0,external_react_redux_.useSelector)(state => state.editor.loading);
|
|
101990
|
-
var saving = (0,external_react_redux_.useSelector)(state => state.editor.saving);
|
|
101991
|
-
var onClickSave = (0,external_react_.useCallback)(/*#__PURE__*/_asyncToGenerator(function* () {
|
|
101992
|
-
dispatch((0,EditorSlice.setSaveTriggered)(true));
|
|
101993
|
-
}), [dispatch]);
|
|
101994
|
-
var isSaving = saving === types.SavingState.PROCESS;
|
|
101995
|
-
var buttonIcon = isSaving ? null : save;
|
|
101996
|
-
var buttonText = isSaving ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
101997
|
-
className: SaveButton_styles_module.content,
|
|
101998
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SpinnerDotted.SpinnerDotted, {}), " Saving..."]
|
|
101999
|
-
}) : "Save";
|
|
102000
|
-
return loading === types.LoadingState.SUCCESS && /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], (0,objectSpread2/* default */.A)({
|
|
102001
|
-
buttonText: buttonText,
|
|
102002
|
-
ButtonIcon: buttonIcon,
|
|
102003
|
-
buttonIconPosition: "left",
|
|
102004
|
-
variant: "secondary",
|
|
102005
|
-
onClickHandler: onClickSave,
|
|
102006
|
-
disabled: saving === types.SavingState.PROCESS
|
|
102007
|
-
}, props));
|
|
102008
|
-
};
|
|
102009
|
-
/* harmony default export */ const SaveButton_SaveButton = (SaveButton);
|
|
102010
|
-
// EXTERNAL MODULE: ./src/components/ShareButton/ShareButton.tsx
|
|
102011
|
-
var ShareButton = __webpack_require__(21422);
|
|
102012
|
-
var ShareButton_default = /*#__PURE__*/__webpack_require__.n(ShareButton);
|
|
102013
|
-
;// ./src/assets/icons/history.svg
|
|
102014
|
-
var history_path;
|
|
102015
|
-
function history_extends() { return history_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, history_extends.apply(null, arguments); }
|
|
102016
|
-
|
|
102017
|
-
function SvgHistory(props) {
|
|
102018
|
-
return /*#__PURE__*/external_react_.createElement("svg", history_extends({
|
|
102019
|
-
width: 20,
|
|
102020
|
-
height: 18,
|
|
102021
|
-
fill: "none",
|
|
102022
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
102023
|
-
}, props), history_path || (history_path = /*#__PURE__*/external_react_.createElement("path", {
|
|
102024
|
-
d: "M3.01 11.542a8.1 8.1 0 101.916-8.424L.75 7.042m0 0h4.5m-4.5 0v-4.5m9.9 1.8v5.4l3.601 1.8",
|
|
102025
|
-
stroke: "#003046",
|
|
102026
|
-
strokeWidth: 1.5,
|
|
102027
|
-
strokeLinecap: "round",
|
|
102028
|
-
strokeLinejoin: "round"
|
|
102029
|
-
})));
|
|
102030
|
-
}
|
|
102031
|
-
/* harmony default export */ const icons_history = (SvgHistory);
|
|
102032
|
-
;// ./src/components/HistoryButton/HistoryButton.jsx
|
|
102033
|
-
|
|
102034
|
-
|
|
102035
|
-
|
|
102036
|
-
|
|
102037
|
-
|
|
102038
|
-
|
|
102039
|
-
|
|
102040
|
-
|
|
102041
|
-
var HistoryButton = props => {
|
|
102042
|
-
var dispatch = (0,external_react_redux_.useDispatch)();
|
|
102043
|
-
var onClickHistory = () => {
|
|
102044
|
-
dispatch((0,EditorSlice.showModal)({
|
|
102045
|
-
modal: types.ModalType.PROJECT_HISTORY
|
|
102046
|
-
}));
|
|
102047
|
-
};
|
|
102048
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], (0,objectSpread2/* default */.A)({
|
|
102049
|
-
variant: "tertiary",
|
|
102050
|
-
ButtonIcon: icons_history,
|
|
102051
|
-
onClickHandler: onClickHistory
|
|
102052
|
-
}, props));
|
|
102053
|
-
};
|
|
102054
|
-
/* harmony default export */ const HistoryButton_HistoryButton = (HistoryButton);
|
|
102055
|
-
// EXTERNAL MODULE: ./src/components/RunButton/RunBar.jsx
|
|
102056
|
-
var RunBar = __webpack_require__(78176);
|
|
102057
|
-
// EXTERNAL MODULE: ./src/components/ProjectBar/styles.module.scss
|
|
102058
|
-
var ProjectBar_styles_module = __webpack_require__(19436);
|
|
102059
|
-
;// ./src/components/ProjectBar/ProjectBar.jsx
|
|
102060
|
-
|
|
102061
|
-
|
|
102062
|
-
|
|
102063
|
-
|
|
102064
|
-
|
|
102065
|
-
|
|
102066
|
-
|
|
102067
|
-
|
|
102068
|
-
|
|
102069
|
-
|
|
102070
|
-
|
|
102071
|
-
|
|
102072
|
-
var ProjectBar = _ref => {
|
|
102073
|
-
var {
|
|
102074
|
-
nameEditable = true
|
|
102075
|
-
} = _ref;
|
|
102076
|
-
var loading = (0,external_react_redux_.useSelector)(state => state.editor.loading);
|
|
102077
|
-
var saving = (0,external_react_redux_.useSelector)(state => state.editor.saving);
|
|
102078
|
-
var lastSavedTime = (0,external_react_redux_.useSelector)(state => state.editor.lastSavedTime);
|
|
102079
|
-
var readOnly = (0,external_react_redux_.useSelector)(state => state.editor.readOnly);
|
|
102080
|
-
return loading === "success" && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102081
|
-
className: ProjectBar_styles_module["default"].header,
|
|
102082
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102083
|
-
className: ProjectBar_styles_module["default"].wrapper,
|
|
102084
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(gwc_logo["default"], {
|
|
102085
|
-
className: ProjectBar_styles_module["default"].gwcLogo,
|
|
102086
|
-
alt: "GWC Logo"
|
|
102087
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsx)(text_jam_logo["default"], {
|
|
102088
|
-
className: ProjectBar_styles_module["default"].textJamLogo,
|
|
102089
|
-
alt: "TextJam logo"
|
|
102090
|
-
})]
|
|
102091
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102092
|
-
className: ProjectBar_styles_module["default"].wrapper,
|
|
102093
|
-
children: [loading === "success" && /*#__PURE__*/(0,jsx_runtime.jsx)(ProjectName_ProjectName, {
|
|
102094
|
-
editable: !readOnly && nameEditable,
|
|
102095
|
-
showLabel: true
|
|
102096
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsx)(HistoryButton_HistoryButton, {
|
|
102097
|
-
className: ProjectBar_styles_module["default"].btnSvg
|
|
102098
|
-
}), loading === "success" && !readOnly && /*#__PURE__*/(0,jsx_runtime.jsx)(SaveButton_SaveButton, {
|
|
102099
|
-
className: ProjectBar_styles_module["default"].headerBtn
|
|
102100
|
-
})]
|
|
102101
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102102
|
-
className: ProjectBar_styles_module["default"].wrapper,
|
|
102103
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(RunBar["default"], {}), loading === "success" && /*#__PURE__*/(0,jsx_runtime.jsx)((DownloadButton_default()), {
|
|
102104
|
-
className: ProjectBar_styles_module["default"].btnSvg
|
|
102105
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsx)((ShareButton_default()), {
|
|
102106
|
-
className: ProjectBar_styles_module["default"].btnSvg
|
|
102107
|
-
})]
|
|
102108
|
-
})]
|
|
102109
|
-
});
|
|
102110
|
-
};
|
|
102111
|
-
/* harmony default export */ const ProjectBar_ProjectBar = (ProjectBar);
|
|
101874
|
+
// EXTERNAL MODULE: ./src/components/ProjectBar/ProjectBar.tsx
|
|
101875
|
+
var ProjectBar = __webpack_require__(75724);
|
|
101876
|
+
var ProjectBar_default = /*#__PURE__*/__webpack_require__.n(ProjectBar);
|
|
102112
101877
|
// EXTERNAL MODULE: ./src/components/Menus/Sidebar/Sidebar.tsx
|
|
102113
101878
|
var Sidebar = __webpack_require__(20791);
|
|
102114
101879
|
var Sidebar_default = /*#__PURE__*/__webpack_require__.n(Sidebar);
|
|
@@ -102128,9 +101893,11 @@ var projContainer = {
|
|
|
102128
101893
|
};
|
|
102129
101894
|
;// ./src/components/Editor/Project/styles.module.scss
|
|
102130
101895
|
// extracted by mini-css-extract-plugin
|
|
102131
|
-
/* harmony default export */ const
|
|
101896
|
+
/* harmony default export */ const styles_module = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","proj":"styles-module__proj--ZFm0o","projContainer":"styles-module__projContainer--foKo4","projectWrapper":"styles-module__projectWrapper--Yq8Yr","projEditorWrapper":"styles-module__projEditorWrapper--SISJR","projEditorContainer":"styles-module__projEditorContainer--jWAlR","react-tabs__tab-panel--selected":"styles-module__react-tabs__tab-panel--selected--RwR-m","react-tabs__tab-list":"styles-module__react-tabs__tab-list--gM7uT","react-tabs__tab-container":"styles-module__react-tabs__tab-container--ycENl","btn--run":"styles-module__btn--run--u9TgZ","btn--stop":"styles-module__btn--stop--gJCsY"});
|
|
102132
101897
|
// EXTERNAL MODULE: ./src/components/ProjectBar/SharedProjectBar.tsx
|
|
102133
101898
|
var SharedProjectBar = __webpack_require__(42375);
|
|
101899
|
+
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
101900
|
+
var jsx_runtime = __webpack_require__(74848);
|
|
102134
101901
|
;// ./src/components/Editor/Project/Project.jsx
|
|
102135
101902
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
102136
101903
|
|
|
@@ -102172,22 +101939,22 @@ var Project = props => {
|
|
|
102172
101939
|
setLoading(false);
|
|
102173
101940
|
}, []);
|
|
102174
101941
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102175
|
-
className:
|
|
101942
|
+
className: styles_module.proj,
|
|
102176
101943
|
"data-testid": "project",
|
|
102177
|
-
children: [isSharedProject ? /*#__PURE__*/(0,jsx_runtime.jsx)(SharedProjectBar.SharedProjectBar, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)(
|
|
101944
|
+
children: [isSharedProject ? /*#__PURE__*/(0,jsx_runtime.jsx)(SharedProjectBar.SharedProjectBar, {}) : /*#__PURE__*/(0,jsx_runtime.jsx)((ProjectBar_default()), {
|
|
102178
101945
|
nameEditable: nameEditable
|
|
102179
101946
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102180
|
-
className:
|
|
101947
|
+
className: styles_module.projContainer,
|
|
102181
101948
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)((Sidebar_default()), {
|
|
102182
101949
|
options: sidebarOptions
|
|
102183
101950
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
102184
|
-
className:
|
|
101951
|
+
className: styles_module.projectWrapper,
|
|
102185
101952
|
ref: containerRef,
|
|
102186
101953
|
children: !loading && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102187
|
-
className:
|
|
101954
|
+
className: styles_module.projEditorWrapper,
|
|
102188
101955
|
children: [isCodeVisible && /*#__PURE__*/(0,jsx_runtime.jsx)(ResizableWithHandle/* default */.A, {
|
|
102189
101956
|
"data-testid": "proj-editor-container",
|
|
102190
|
-
className:
|
|
101957
|
+
className: styles_module.projEditorContainer,
|
|
102191
101958
|
defaultWidth: defaultWidth,
|
|
102192
101959
|
defaultHeight: defaultHeight,
|
|
102193
101960
|
handleDirection: handleDirection,
|
|
@@ -102496,131 +102263,6 @@ var ErrorModal = _ref => {
|
|
|
102496
102263
|
|
|
102497
102264
|
/***/ }),
|
|
102498
102265
|
|
|
102499
|
-
/***/ 2468:
|
|
102500
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
102501
|
-
|
|
102502
|
-
// ESM COMPAT FLAG
|
|
102503
|
-
__webpack_require__.r(__webpack_exports__);
|
|
102504
|
-
|
|
102505
|
-
// EXPORTS
|
|
102506
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
102507
|
-
"default": () => (/* binding */ ProjectHistoryModal_ProjectHistoryModal)
|
|
102508
|
-
});
|
|
102509
|
-
|
|
102510
|
-
// EXTERNAL MODULE: external "react"
|
|
102511
|
-
var external_react_ = __webpack_require__(51649);
|
|
102512
|
-
;// ./src/components/Modals/ProjectHistoryModal/styles.module.scss
|
|
102513
|
-
// extracted by mini-css-extract-plugin
|
|
102514
|
-
/* harmony default export */ const styles_module = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","content":"styles-module__content--vm091","headerText":"styles-module__headerText--O4YZK","headerIcon":"styles-module__headerIcon--F-+Vd","containerBox":"styles-module__containerBox--HK-4z","versionDate":"styles-module__versionDate--OLHbO","messageContainer":"styles-module__messageContainer--PVpY+","buttonsContainer":"styles-module__buttonsContainer--dWeY9"});
|
|
102515
|
-
// EXTERNAL MODULE: ./src/components/Modals/BaseModal/styles.module.scss
|
|
102516
|
-
var BaseModal_styles_module = __webpack_require__(41809);
|
|
102517
|
-
// EXTERNAL MODULE: ./src/redux/EditorSlice.ts
|
|
102518
|
-
var EditorSlice = __webpack_require__(68512);
|
|
102519
|
-
// EXTERNAL MODULE: ./src/redux/types.ts
|
|
102520
|
-
var types = __webpack_require__(92932);
|
|
102521
|
-
// EXTERNAL MODULE: external "react-redux"
|
|
102522
|
-
var external_react_redux_ = __webpack_require__(14062);
|
|
102523
|
-
// EXTERNAL MODULE: ./src/components/Modals/BaseModal/BaseModal.jsx
|
|
102524
|
-
var BaseModal = __webpack_require__(94738);
|
|
102525
|
-
;// ./src/assets/icons/restore.svg
|
|
102526
|
-
var _path;
|
|
102527
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
102528
|
-
|
|
102529
|
-
function SvgRestore(props) {
|
|
102530
|
-
return /*#__PURE__*/external_react_.createElement("svg", _extends({
|
|
102531
|
-
width: 32,
|
|
102532
|
-
height: 32,
|
|
102533
|
-
fill: "none",
|
|
102534
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
102535
|
-
}, props), _path || (_path = /*#__PURE__*/external_react_.createElement("path", {
|
|
102536
|
-
d: "M7.012 19.589A10.8 10.8 0 109.568 8.356L4 13.59m0 0h6m-6 0v-6m13.2 2.4v7.2l4.801 2.4",
|
|
102537
|
-
stroke: "#003046",
|
|
102538
|
-
strokeWidth: 2,
|
|
102539
|
-
strokeLinecap: "round",
|
|
102540
|
-
strokeLinejoin: "round"
|
|
102541
|
-
})));
|
|
102542
|
-
}
|
|
102543
|
-
/* harmony default export */ const restore = (SvgRestore);
|
|
102544
|
-
// EXTERNAL MODULE: ./src/assets/icons/alert.svg
|
|
102545
|
-
var icons_alert = __webpack_require__(11367);
|
|
102546
|
-
// EXTERNAL MODULE: ./src/components/Button/Button.jsx + 1 modules
|
|
102547
|
-
var Button = __webpack_require__(60232);
|
|
102548
|
-
// EXTERNAL MODULE: ./src/components/shared/SvgIcon/index.tsx
|
|
102549
|
-
var SvgIcon = __webpack_require__(82917);
|
|
102550
|
-
// EXTERNAL MODULE: ./src/assets/icons/close.svg
|
|
102551
|
-
var icons_close = __webpack_require__(80181);
|
|
102552
|
-
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
102553
|
-
var jsx_runtime = __webpack_require__(74848);
|
|
102554
|
-
;// ./src/components/Modals/ProjectHistoryModal/ProjectHistoryModal.jsx
|
|
102555
|
-
|
|
102556
|
-
|
|
102557
|
-
|
|
102558
|
-
|
|
102559
|
-
|
|
102560
|
-
|
|
102561
|
-
|
|
102562
|
-
|
|
102563
|
-
|
|
102564
|
-
|
|
102565
|
-
|
|
102566
|
-
|
|
102567
|
-
|
|
102568
|
-
var ProjectHistoryModal = () => {
|
|
102569
|
-
var dispatch = (0,external_react_redux_.useDispatch)();
|
|
102570
|
-
var isModalOpen = (0,external_react_redux_.useSelector)(state => state.editor.modalWindowShowing === types.ModalType.PROJECT_HISTORY);
|
|
102571
|
-
var handleClose = () => dispatch((0,EditorSlice.closeModal)());
|
|
102572
|
-
return /*#__PURE__*/(0,jsx_runtime.jsx)(BaseModal["default"], {
|
|
102573
|
-
isOpen: isModalOpen,
|
|
102574
|
-
closeModal: handleClose,
|
|
102575
|
-
withCloseButton: true,
|
|
102576
|
-
closeIcon: icons_close["default"],
|
|
102577
|
-
externalClasses: styles_module,
|
|
102578
|
-
heading: "",
|
|
102579
|
-
buttons: [/*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], {
|
|
102580
|
-
variant: "secondary",
|
|
102581
|
-
buttonText: "Restore",
|
|
102582
|
-
onClickHandler: () => {}
|
|
102583
|
-
}, "delete"), /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], {
|
|
102584
|
-
variant: "tertiaryGray",
|
|
102585
|
-
buttonText: "Cancel",
|
|
102586
|
-
onClickHandler: handleClose
|
|
102587
|
-
}, "cancel")],
|
|
102588
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102589
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102590
|
-
className: BaseModal_styles_module["default"].headerContainer,
|
|
102591
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SvgIcon.SvgIcon, {
|
|
102592
|
-
size: 32,
|
|
102593
|
-
SvgElement: restore,
|
|
102594
|
-
className: "".concat(BaseModal_styles_module["default"].headerText, " ").concat(styles_module.headerIcon)
|
|
102595
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
102596
|
-
className: "".concat(BaseModal_styles_module["default"].headerText, " ").concat(styles_module.headerText),
|
|
102597
|
-
children: "Restore Version"
|
|
102598
|
-
})]
|
|
102599
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102600
|
-
className: styles_module.containerBox,
|
|
102601
|
-
children: ["You are about to restore the version from:", /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
102602
|
-
className: styles_module.versionDate,
|
|
102603
|
-
children: "Today 4:00 PM"
|
|
102604
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
102605
|
-
className: styles_module.messageContainer,
|
|
102606
|
-
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
102607
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)(SvgIcon.SvgIcon, {
|
|
102608
|
-
size: 18,
|
|
102609
|
-
SvgElement: icons_alert["default"],
|
|
102610
|
-
className: "".concat(BaseModal_styles_module["default"].headerText, " ").concat(styles_module.headerIcon)
|
|
102611
|
-
})
|
|
102612
|
-
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
102613
|
-
children: "Restoring a version of a file is non-destructive. The restored content will become a new version at the top of history. You can always go back to the version you just had."
|
|
102614
|
-
})]
|
|
102615
|
-
})]
|
|
102616
|
-
})]
|
|
102617
|
-
})
|
|
102618
|
-
});
|
|
102619
|
-
};
|
|
102620
|
-
/* harmony default export */ const ProjectHistoryModal_ProjectHistoryModal = (ProjectHistoryModal);
|
|
102621
|
-
|
|
102622
|
-
/***/ }),
|
|
102623
|
-
|
|
102624
102266
|
/***/ 45829:
|
|
102625
102267
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
102626
102268
|
|
|
@@ -103152,6 +102794,107 @@ var UploadSizeLimitModal = () => {
|
|
|
103152
102794
|
|
|
103153
102795
|
/***/ }),
|
|
103154
102796
|
|
|
102797
|
+
/***/ 23559:
|
|
102798
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
102799
|
+
|
|
102800
|
+
__webpack_require__.r(__webpack_exports__);
|
|
102801
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
102802
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
102803
|
+
/* harmony export */ });
|
|
102804
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
|
|
102805
|
+
/* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
|
|
102806
|
+
/* harmony import */ var _redux_EditorSlice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(68512);
|
|
102807
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(46942);
|
|
102808
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
|
102809
|
+
/* harmony import */ var _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32026);
|
|
102810
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(74848);
|
|
102811
|
+
|
|
102812
|
+
|
|
102813
|
+
|
|
102814
|
+
|
|
102815
|
+
|
|
102816
|
+
|
|
102817
|
+
var ProjectName = _ref => {
|
|
102818
|
+
var {
|
|
102819
|
+
className = null,
|
|
102820
|
+
showLabel = false,
|
|
102821
|
+
editable = true
|
|
102822
|
+
} = _ref;
|
|
102823
|
+
var project = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.project, react_redux__WEBPACK_IMPORTED_MODULE_1__.shallowEqual);
|
|
102824
|
+
var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
|
|
102825
|
+
var nameInput = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
102826
|
+
var [isEditing, setEditing] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
102827
|
+
var [name, setName] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(project.name || "New project");
|
|
102828
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
102829
|
+
setName(project.name);
|
|
102830
|
+
}, [project.name]);
|
|
102831
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
102832
|
+
if (isEditing) {
|
|
102833
|
+
var _nameInput$current, _nameInput$current2;
|
|
102834
|
+
(_nameInput$current = nameInput.current) === null || _nameInput$current === void 0 || _nameInput$current.focus();
|
|
102835
|
+
(_nameInput$current2 = nameInput.current) === null || _nameInput$current2 === void 0 || _nameInput$current2.select();
|
|
102836
|
+
}
|
|
102837
|
+
}, [isEditing]);
|
|
102838
|
+
var startEditing = () => {
|
|
102839
|
+
if (!editable) return;
|
|
102840
|
+
setEditing(true);
|
|
102841
|
+
};
|
|
102842
|
+
var saveName = () => {
|
|
102843
|
+
var newName = nameInput.current.value.trim();
|
|
102844
|
+
if (newName && newName !== project.name) {
|
|
102845
|
+
dispatch((0,_redux_EditorSlice__WEBPACK_IMPORTED_MODULE_5__.updateProjectName)(newName));
|
|
102846
|
+
}
|
|
102847
|
+
setEditing(false);
|
|
102848
|
+
};
|
|
102849
|
+
var cancelEditing = () => {
|
|
102850
|
+
setName(project.name);
|
|
102851
|
+
setEditing(false);
|
|
102852
|
+
};
|
|
102853
|
+
var handleOnChange = () => {
|
|
102854
|
+
setName(nameInput.current.value);
|
|
102855
|
+
};
|
|
102856
|
+
var handleKeyDown = event => {
|
|
102857
|
+
if (event.key === "Enter") {
|
|
102858
|
+
event.preventDefault();
|
|
102859
|
+
saveName();
|
|
102860
|
+
} else if (event.key === "Escape") {
|
|
102861
|
+
cancelEditing();
|
|
102862
|
+
}
|
|
102863
|
+
};
|
|
102864
|
+
var handleOnBlur = () => {
|
|
102865
|
+
saveName();
|
|
102866
|
+
};
|
|
102867
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
|
|
102868
|
+
children: [showLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", {
|
|
102869
|
+
htmlFor: "project_name",
|
|
102870
|
+
id: "project_name_label",
|
|
102871
|
+
className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectLabel,
|
|
102872
|
+
children: "Project Name"
|
|
102873
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
|
|
102874
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectName, className),
|
|
102875
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input", {
|
|
102876
|
+
id: "project_name",
|
|
102877
|
+
ref: nameInput,
|
|
102878
|
+
type: "text",
|
|
102879
|
+
"aria-labelledby": "project_name_label",
|
|
102880
|
+
onFocus: startEditing,
|
|
102881
|
+
onClick: startEditing,
|
|
102882
|
+
onKeyDown: handleKeyDown,
|
|
102883
|
+
value: name,
|
|
102884
|
+
readOnly: !isEditing,
|
|
102885
|
+
onChange: handleOnChange,
|
|
102886
|
+
onBlur: handleOnBlur,
|
|
102887
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].projectInput, {
|
|
102888
|
+
[_styles_module_scss__WEBPACK_IMPORTED_MODULE_3__["default"].editing]: isEditing
|
|
102889
|
+
})
|
|
102890
|
+
})
|
|
102891
|
+
})]
|
|
102892
|
+
});
|
|
102893
|
+
};
|
|
102894
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProjectName);
|
|
102895
|
+
|
|
102896
|
+
/***/ }),
|
|
102897
|
+
|
|
103155
102898
|
/***/ 78176:
|
|
103156
102899
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
103157
102900
|
|
|
@@ -103367,6 +103110,120 @@ var RunnerControls = _ref => {
|
|
|
103367
103110
|
|
|
103368
103111
|
/***/ }),
|
|
103369
103112
|
|
|
103113
|
+
/***/ 24771:
|
|
103114
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
103115
|
+
|
|
103116
|
+
// ESM COMPAT FLAG
|
|
103117
|
+
__webpack_require__.r(__webpack_exports__);
|
|
103118
|
+
|
|
103119
|
+
// EXPORTS
|
|
103120
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
103121
|
+
"default": () => (/* binding */ SaveButton_SaveButton)
|
|
103122
|
+
});
|
|
103123
|
+
|
|
103124
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
103125
|
+
var objectSpread2 = __webpack_require__(89379);
|
|
103126
|
+
;// ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
103127
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
103128
|
+
try {
|
|
103129
|
+
var i = n[a](c),
|
|
103130
|
+
u = i.value;
|
|
103131
|
+
} catch (n) {
|
|
103132
|
+
return void e(n);
|
|
103133
|
+
}
|
|
103134
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
103135
|
+
}
|
|
103136
|
+
function _asyncToGenerator(n) {
|
|
103137
|
+
return function () {
|
|
103138
|
+
var t = this,
|
|
103139
|
+
e = arguments;
|
|
103140
|
+
return new Promise(function (r, o) {
|
|
103141
|
+
var a = n.apply(t, e);
|
|
103142
|
+
function _next(n) {
|
|
103143
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
103144
|
+
}
|
|
103145
|
+
function _throw(n) {
|
|
103146
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
103147
|
+
}
|
|
103148
|
+
_next(void 0);
|
|
103149
|
+
});
|
|
103150
|
+
};
|
|
103151
|
+
}
|
|
103152
|
+
|
|
103153
|
+
// EXTERNAL MODULE: external "react"
|
|
103154
|
+
var external_react_ = __webpack_require__(51649);
|
|
103155
|
+
// EXTERNAL MODULE: external "react-redux"
|
|
103156
|
+
var external_react_redux_ = __webpack_require__(14062);
|
|
103157
|
+
;// ./src/assets/icons/save.svg
|
|
103158
|
+
var _path;
|
|
103159
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
103160
|
+
|
|
103161
|
+
function SvgSave(props) {
|
|
103162
|
+
return /*#__PURE__*/external_react_.createElement("svg", _extends({
|
|
103163
|
+
width: 24,
|
|
103164
|
+
height: 24,
|
|
103165
|
+
fill: "none",
|
|
103166
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
103167
|
+
}, props), _path || (_path = /*#__PURE__*/external_react_.createElement("path", {
|
|
103168
|
+
d: "M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2v16z",
|
|
103169
|
+
stroke: "#003046",
|
|
103170
|
+
strokeWidth: 1.5,
|
|
103171
|
+
strokeLinecap: "round",
|
|
103172
|
+
strokeLinejoin: "round"
|
|
103173
|
+
})));
|
|
103174
|
+
}
|
|
103175
|
+
/* harmony default export */ const save = (SvgSave);
|
|
103176
|
+
// EXTERNAL MODULE: ./src/components/Button/Button.jsx + 1 modules
|
|
103177
|
+
var Button = __webpack_require__(60232);
|
|
103178
|
+
// EXTERNAL MODULE: ./src/redux/EditorSlice.ts
|
|
103179
|
+
var EditorSlice = __webpack_require__(68512);
|
|
103180
|
+
// EXTERNAL MODULE: ./src/redux/types.ts
|
|
103181
|
+
var types = __webpack_require__(92932);
|
|
103182
|
+
// EXTERNAL MODULE: ./src/components/SpinnerDotted/SpinnerDotted.tsx
|
|
103183
|
+
var SpinnerDotted = __webpack_require__(79458);
|
|
103184
|
+
;// ./src/components/SaveButton/styles.module.scss
|
|
103185
|
+
// extracted by mini-css-extract-plugin
|
|
103186
|
+
/* harmony default export */ const styles_module = ({"content":"styles-module__content--Cgvxl"});
|
|
103187
|
+
// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
|
|
103188
|
+
var jsx_runtime = __webpack_require__(74848);
|
|
103189
|
+
;// ./src/components/SaveButton/SaveButton.jsx
|
|
103190
|
+
|
|
103191
|
+
|
|
103192
|
+
|
|
103193
|
+
|
|
103194
|
+
|
|
103195
|
+
|
|
103196
|
+
|
|
103197
|
+
|
|
103198
|
+
|
|
103199
|
+
|
|
103200
|
+
|
|
103201
|
+
var SaveButton = props => {
|
|
103202
|
+
var dispatch = (0,external_react_redux_.useDispatch)();
|
|
103203
|
+
var loading = (0,external_react_redux_.useSelector)(state => state.editor.loading);
|
|
103204
|
+
var saving = (0,external_react_redux_.useSelector)(state => state.editor.saving);
|
|
103205
|
+
var onClickSave = (0,external_react_.useCallback)(/*#__PURE__*/_asyncToGenerator(function* () {
|
|
103206
|
+
dispatch((0,EditorSlice.setSaveTriggered)(true));
|
|
103207
|
+
}), [dispatch]);
|
|
103208
|
+
var isSaving = saving === types.SavingState.PROCESS;
|
|
103209
|
+
var buttonIcon = isSaving ? null : save;
|
|
103210
|
+
var buttonText = isSaving ? /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
103211
|
+
className: styles_module.content,
|
|
103212
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(SpinnerDotted.SpinnerDotted, {}), " Saving..."]
|
|
103213
|
+
}) : "Save";
|
|
103214
|
+
return loading === types.LoadingState.SUCCESS && /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], (0,objectSpread2/* default */.A)({
|
|
103215
|
+
buttonText: buttonText,
|
|
103216
|
+
ButtonIcon: buttonIcon,
|
|
103217
|
+
buttonIconPosition: "left",
|
|
103218
|
+
variant: "secondary",
|
|
103219
|
+
onClickHandler: onClickSave,
|
|
103220
|
+
disabled: saving === types.SavingState.PROCESS
|
|
103221
|
+
}, props));
|
|
103222
|
+
};
|
|
103223
|
+
/* harmony default export */ const SaveButton_SaveButton = (SaveButton);
|
|
103224
|
+
|
|
103225
|
+
/***/ }),
|
|
103226
|
+
|
|
103370
103227
|
/***/ 30272:
|
|
103371
103228
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
103372
103229
|
|
|
@@ -142652,6 +142509,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142652
142509
|
// extracted by mini-css-extract-plugin
|
|
142653
142510
|
|
|
142654
142511
|
|
|
142512
|
+
/***/ }),
|
|
142513
|
+
|
|
142514
|
+
/***/ 87383:
|
|
142515
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
142516
|
+
|
|
142517
|
+
__webpack_require__.r(__webpack_exports__);
|
|
142518
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
142519
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142520
|
+
/* harmony export */ });
|
|
142521
|
+
// extracted by mini-css-extract-plugin
|
|
142522
|
+
/* 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","historyActive":"styles-module__historyActive--aOVxD","historyButton":"styles-module__historyButton--LInbn","commitHoverElement":"styles-module__commitHoverElement--foGWE","btnContainer":"styles-module__btnContainer--OlkJ2"});
|
|
142523
|
+
|
|
142655
142524
|
/***/ }),
|
|
142656
142525
|
|
|
142657
142526
|
/***/ 50271:
|
|
@@ -142722,7 +142591,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142722
142591
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142723
142592
|
/* harmony export */ });
|
|
142724
142593
|
// extracted by mini-css-extract-plugin
|
|
142725
|
-
/* 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","contextMenu":"styles-module__contextMenu--HNX6Z","contextItem":"styles-module__contextItem--9nzMH"});
|
|
142594
|
+
/* 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","contextMenu":"styles-module__contextMenu--HNX6Z","hoverElement":"styles-module__hoverElement--GLCJ0","contextItem":"styles-module__contextItem--9nzMH","optionContent":"styles-module__optionContent--3E8Zt","contextItemActive":"styles-module__contextItemActive--KkppO","contextHeader":"styles-module__contextHeader--jA59O","withDivider":"styles-module__withDivider--X54Sw","visibleScrollbar":"styles-module__visibleScrollbar--PEea9"});
|
|
142726
142595
|
|
|
142727
142596
|
/***/ }),
|
|
142728
142597
|
|
|
@@ -142798,6 +142667,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142798
142667
|
|
|
142799
142668
|
/***/ }),
|
|
142800
142669
|
|
|
142670
|
+
/***/ 49871:
|
|
142671
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
142672
|
+
|
|
142673
|
+
__webpack_require__.r(__webpack_exports__);
|
|
142674
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
142675
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142676
|
+
/* harmony export */ });
|
|
142677
|
+
// extracted by mini-css-extract-plugin
|
|
142678
|
+
/* 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","content":"styles-module__content--vm091","headerText":"styles-module__headerText--O4YZK","headerIcon":"styles-module__headerIcon--F-+Vd","containerBox":"styles-module__containerBox--HK-4z","versionDate":"styles-module__versionDate--OLHbO","messageContainer":"styles-module__messageContainer--PVpY+","buttonsContainer":"styles-module__buttonsContainer--dWeY9"});
|
|
142679
|
+
|
|
142680
|
+
/***/ }),
|
|
142681
|
+
|
|
142801
142682
|
/***/ 79354:
|
|
142802
142683
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
142803
142684
|
|
|
@@ -142877,7 +142758,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
142877
142758
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
142878
142759
|
/* harmony export */ });
|
|
142879
142760
|
// extracted by mini-css-extract-plugin
|
|
142880
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"text":"styles-module__text--w++5r","code":"styles-module__code--E-a9Y","size-12":"styles-module__size-12--hY0wv","size-14":"styles-module__size-14--WSVwD","size-16":"styles-module__size-16--6hjvA","size-18":"styles-module__size-18--P7XJw","size-20":"styles-module__size-20--py7l4","size-24":"styles-module__size-24--tYu3W","weight-regular":"styles-module__weight-regular--S9vrI","weight-medium":"styles-module__weight-medium--JN8TI","weight-bold":"styles-module__weight-bold--JgpDo"});
|
|
142761
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"text":"styles-module__text--w++5r","code":"styles-module__code--E-a9Y","size-10":"styles-module__size-10--vObQm","size-12":"styles-module__size-12--hY0wv","size-14":"styles-module__size-14--WSVwD","size-16":"styles-module__size-16--6hjvA","size-18":"styles-module__size-18--P7XJw","size-20":"styles-module__size-20--py7l4","size-24":"styles-module__size-24--tYu3W","weight-regular":"styles-module__weight-regular--S9vrI","weight-medium":"styles-module__weight-medium--JN8TI","weight-bold":"styles-module__weight-bold--JgpDo"});
|
|
142881
142762
|
|
|
142882
142763
|
/***/ }),
|
|
142883
142764
|
|
|
@@ -368604,6 +368485,104 @@ const AssetPreview = ({ file }) => {
|
|
|
368604
368485
|
exports.n = AssetPreview;
|
|
368605
368486
|
|
|
368606
368487
|
|
|
368488
|
+
/***/ }),
|
|
368489
|
+
|
|
368490
|
+
/***/ 46175:
|
|
368491
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
368492
|
+
|
|
368493
|
+
|
|
368494
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
368495
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
368496
|
+
};
|
|
368497
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
368498
|
+
exports.CommitHistoryMenu = void 0;
|
|
368499
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
368500
|
+
const react_1 = __webpack_require__(51649);
|
|
368501
|
+
const ContextMenu_1 = __importDefault(__webpack_require__(39179));
|
|
368502
|
+
const MenuCommitElement_1 = __webpack_require__(78281);
|
|
368503
|
+
const EditorSlice_1 = __webpack_require__(68512);
|
|
368504
|
+
const types_1 = __webpack_require__(92932);
|
|
368505
|
+
const react_redux_1 = __webpack_require__(14062);
|
|
368506
|
+
const CommitHistoryMenu = ({ isOpen, onClose, commits, btnRef, activeCommitId, }) => {
|
|
368507
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
368508
|
+
const handleCommitClick = (0, react_1.useCallback)((commitId) => {
|
|
368509
|
+
dispatch((0, EditorSlice_1.showModal)({
|
|
368510
|
+
modal: types_1.ModalType.RESTORE_VERSION,
|
|
368511
|
+
args: { type: types_1.ModalType.RESTORE_VERSION, commitId },
|
|
368512
|
+
}));
|
|
368513
|
+
}, [dispatch]);
|
|
368514
|
+
const menuOptions = (0, react_1.useMemo)(() => commits?.map((commit) => ({
|
|
368515
|
+
id: commit.id,
|
|
368516
|
+
text: commit.createdAtFormatted,
|
|
368517
|
+
action: () => handleCommitClick(commit.id),
|
|
368518
|
+
})), [handleCommitClick, commits]);
|
|
368519
|
+
if (!isOpen) {
|
|
368520
|
+
return null;
|
|
368521
|
+
}
|
|
368522
|
+
return ((0, jsx_runtime_1.jsx)(ContextMenu_1.default, { opened: isOpen, onClose: onClose, menuOptions: menuOptions ?? [], hoverElement: (0, jsx_runtime_1.jsx)(MenuCommitElement_1.CommitHoverElement, {}), menuHeight: 270, title: "Version History", align: "end", direction: "bottom", anchorRef: btnRef, gap: 6, activeItemId: activeCommitId, showDivider: false }));
|
|
368523
|
+
};
|
|
368524
|
+
exports.CommitHistoryMenu = CommitHistoryMenu;
|
|
368525
|
+
|
|
368526
|
+
|
|
368527
|
+
/***/ }),
|
|
368528
|
+
|
|
368529
|
+
/***/ 21091:
|
|
368530
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
368531
|
+
|
|
368532
|
+
|
|
368533
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
368534
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
368535
|
+
};
|
|
368536
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
368537
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
368538
|
+
const react_1 = __webpack_require__(51649);
|
|
368539
|
+
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
368540
|
+
const history_svg_1 = __importDefault(__webpack_require__(93113));
|
|
368541
|
+
const Button_1 = __importDefault(__webpack_require__(60232));
|
|
368542
|
+
const stores_1 = __webpack_require__(32132);
|
|
368543
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(87383));
|
|
368544
|
+
const SvgIcon_1 = __webpack_require__(82917);
|
|
368545
|
+
const CommitHistoryMenu_1 = __webpack_require__(46175);
|
|
368546
|
+
const Tooltip_1 = __importDefault(__webpack_require__(26982));
|
|
368547
|
+
const useHover_1 = __webpack_require__(78556);
|
|
368548
|
+
const HistoryButton = ({ className }) => {
|
|
368549
|
+
const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
|
|
368550
|
+
const commits = (0, stores_1.useAppSelector)((state) => state.editor.commits);
|
|
368551
|
+
const ref = (0, react_1.useRef)(null);
|
|
368552
|
+
const { hovered, hoverProps } = (0, useHover_1.useHover)();
|
|
368553
|
+
const [isContextOpen, setIsContextOpen] = (0, react_1.useState)(false);
|
|
368554
|
+
const handleClick = () => {
|
|
368555
|
+
setIsContextOpen((prev) => !prev);
|
|
368556
|
+
};
|
|
368557
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.btnContainer, ...hoverProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.default, { message: "Nothing here yet! Once you save your work, versions will appear here so you can restore them.", visible: hovered && !commits?.length, position: "bottom" }), (0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: ref, className: (0, classnames_1.default)(styles_module_scss_1.default.historyButton, className, {
|
|
368558
|
+
[styles_module_scss_1.default.historyActive]: isContextOpen,
|
|
368559
|
+
}), variant: "tertiary", onClickHandler: handleClick, ButtonIcon: () => (0, SvgIcon_1.SvgIcon)({ SvgElement: history_svg_1.default, size: 24 }), disabled: !commits?.length })] }), (0, jsx_runtime_1.jsx)(CommitHistoryMenu_1.CommitHistoryMenu, { isOpen: isContextOpen, onClose: () => setIsContextOpen(false), commits: commits, btnRef: ref, activeCommitId: project.commitId ?? undefined })] }));
|
|
368560
|
+
};
|
|
368561
|
+
exports["default"] = HistoryButton;
|
|
368562
|
+
|
|
368563
|
+
|
|
368564
|
+
/***/ }),
|
|
368565
|
+
|
|
368566
|
+
/***/ 78281:
|
|
368567
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
368568
|
+
|
|
368569
|
+
|
|
368570
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
368571
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
368572
|
+
};
|
|
368573
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
368574
|
+
exports.CommitHoverElement = void 0;
|
|
368575
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
368576
|
+
const SvgIcon_1 = __webpack_require__(82917);
|
|
368577
|
+
const Text_1 = __webpack_require__(82803);
|
|
368578
|
+
const history_svg_1 = __importDefault(__webpack_require__(93113));
|
|
368579
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(87383));
|
|
368580
|
+
const CommitHoverElement = () => {
|
|
368581
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.commitHoverElement, children: [(0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { SvgElement: history_svg_1.default, size: 18 }), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 10, weight: "medium", children: "Restore" })] }));
|
|
368582
|
+
};
|
|
368583
|
+
exports.CommitHoverElement = CommitHoverElement;
|
|
368584
|
+
|
|
368585
|
+
|
|
368607
368586
|
/***/ }),
|
|
368608
368587
|
|
|
368609
368588
|
/***/ 2492:
|
|
@@ -368727,7 +368706,8 @@ const EditorInput = () => {
|
|
|
368727
368706
|
if (!project?.components)
|
|
368728
368707
|
return;
|
|
368729
368708
|
const defaultFile = project.components.find((component) => component.type === ProjectTypes_1.ProjectComponentType.FILE &&
|
|
368730
|
-
(0, projectHelpers_1.getFullComponentName)(component) ===
|
|
368709
|
+
(0, projectHelpers_1.getFullComponentName)(component) ===
|
|
368710
|
+
(project.defaultFileName ?? defaultFileName));
|
|
368731
368711
|
if (defaultFile) {
|
|
368732
368712
|
dispatch((0, EditorSlice_1.openFile)({ id: defaultFile.id }));
|
|
368733
368713
|
}
|
|
@@ -370493,17 +370473,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
370493
370473
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
370494
370474
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
370495
370475
|
const react_menu_1 = __webpack_require__(71231);
|
|
370476
|
+
const classnames_1 = __importDefault(__webpack_require__(46942));
|
|
370496
370477
|
const styles_module_scss_1 = __importDefault(__webpack_require__(29707));
|
|
370497
370478
|
const ContextMenu = (props) => {
|
|
370498
|
-
const { align, direction, menuOptions, menuWidth, opened, anchorRef, onClose, anchorPoint, gap, } = props;
|
|
370479
|
+
const { align, direction, menuOptions, menuWidth, menuHeight, opened, anchorRef, onClose, anchorPoint, gap, hoverElement, title, activeItemId, showDivider = true, } = props;
|
|
370499
370480
|
const portalTarget = document.getElementById("textjam-root") || document.body;
|
|
370500
|
-
return ((0, jsx_runtime_1.
|
|
370481
|
+
return ((0, jsx_runtime_1.jsxs)(react_menu_1.ControlledMenu, { transition: true, align: align, direction: direction, menuStyle: {
|
|
370482
|
+
width: menuWidth ? `${menuWidth}px` : "fit-content",
|
|
370483
|
+
maxHeight: menuHeight ? `${menuHeight}px` : "fit-content",
|
|
370484
|
+
}, position: "anchor", viewScroll: "initial", overflow: "auto", portal: {
|
|
370501
370485
|
target: portalTarget,
|
|
370502
|
-
}, menuClassName: styles_module_scss_1.default.contextMenu
|
|
370503
|
-
|
|
370504
|
-
|
|
370505
|
-
|
|
370506
|
-
|
|
370486
|
+
}, menuClassName: `${styles_module_scss_1.default.contextMenu} ${styles_module_scss_1.default.visibleScrollbar}`, menuItemFocus: { position: "first" }, state: opened ? "open" : "closed", anchorRef: anchorRef, onClose: onClose, anchorPoint: anchorPoint, gap: gap, children: [title && ((0, jsx_runtime_1.jsx)(react_menu_1.MenuHeader, { className: styles_module_scss_1.default.contextHeader, children: title })), menuOptions.map((option, i) => ((0, jsx_runtime_1.jsxs)(react_menu_1.MenuItem, { className: (0, classnames_1.default)(styles_module_scss_1.default.contextItem, {
|
|
370487
|
+
[styles_module_scss_1.default.contextItemActive]: option.id && option.id === activeItemId,
|
|
370488
|
+
[styles_module_scss_1.default.withDivider]: showDivider && i !== menuOptions.length - 1,
|
|
370489
|
+
}), onClick: (e) => {
|
|
370490
|
+
e.stopPropagation = true;
|
|
370491
|
+
option.action?.();
|
|
370492
|
+
onClose();
|
|
370493
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.optionContent, children: [option.icon ?? null, option.text] }), hoverElement && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.hoverElement, children: hoverElement }))] }, option.id ?? i)))] }));
|
|
370507
370494
|
};
|
|
370508
370495
|
exports["default"] = ContextMenu;
|
|
370509
370496
|
|
|
@@ -371560,6 +371547,58 @@ const UserMenu = (props) => {
|
|
|
371560
371547
|
exports["default"] = UserMenu;
|
|
371561
371548
|
|
|
371562
371549
|
|
|
371550
|
+
/***/ }),
|
|
371551
|
+
|
|
371552
|
+
/***/ 39345:
|
|
371553
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
371554
|
+
|
|
371555
|
+
|
|
371556
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
371557
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
371558
|
+
};
|
|
371559
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
371560
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
371561
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
371562
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(49871));
|
|
371563
|
+
const styles_module_scss_2 = __importDefault(__webpack_require__(41809));
|
|
371564
|
+
const EditorSlice_1 = __webpack_require__(68512);
|
|
371565
|
+
const types_1 = __webpack_require__(92932);
|
|
371566
|
+
const react_redux_1 = __webpack_require__(14062);
|
|
371567
|
+
const BaseModal_1 = __importDefault(__webpack_require__(94738));
|
|
371568
|
+
const restore_svg_1 = __importDefault(__webpack_require__(503));
|
|
371569
|
+
const alert_svg_1 = __importDefault(__webpack_require__(11367));
|
|
371570
|
+
const Button_1 = __importDefault(__webpack_require__(60232));
|
|
371571
|
+
const SvgIcon_1 = __webpack_require__(82917);
|
|
371572
|
+
const close_svg_1 = __importDefault(__webpack_require__(80181));
|
|
371573
|
+
const stores_1 = __webpack_require__(32132);
|
|
371574
|
+
const ProjectHistoryModal = () => {
|
|
371575
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
371576
|
+
const isModalOpen = (0, stores_1.useAppSelector)((state) => state.editor.modalWindowShowing === types_1.ModalType.RESTORE_VERSION);
|
|
371577
|
+
const commits = (0, stores_1.useAppSelector)((state) => state.editor.commits);
|
|
371578
|
+
const args = (0, stores_1.useAppSelector)((state) => state.editor.modalWindowArgs);
|
|
371579
|
+
const handleClose = () => dispatch((0, EditorSlice_1.closeModal)());
|
|
371580
|
+
const handleRevert = () => {
|
|
371581
|
+
if (args?.type === types_1.ModalType.RESTORE_VERSION && args.commitId) {
|
|
371582
|
+
dispatch((0, EditorSlice_1.setCommitIdLoadTriggered)(args.commitId));
|
|
371583
|
+
dispatch((0, EditorSlice_1.setLoading)(types_1.LoadingState.IDLE));
|
|
371584
|
+
}
|
|
371585
|
+
dispatch((0, EditorSlice_1.closeModal)());
|
|
371586
|
+
};
|
|
371587
|
+
const commitTimestamp = args?.type === types_1.ModalType.RESTORE_VERSION
|
|
371588
|
+
? commits?.find((c) => c.id === args.commitId)?.createdAtFormatted
|
|
371589
|
+
: undefined;
|
|
371590
|
+
return ((0, jsx_runtime_1.jsx)(BaseModal_1.default, { isOpen: isModalOpen, closeModal: handleClose, withCloseButton: true,
|
|
371591
|
+
// @ts-ignore
|
|
371592
|
+
closeIcon: close_svg_1.default, externalClasses: styles_module_scss_1.default, heading: "", buttons: [
|
|
371593
|
+
// @ts-ignore
|
|
371594
|
+
(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "secondary", buttonText: "Restore", onClickHandler: handleRevert }, "delete"),
|
|
371595
|
+
// @ts-ignore
|
|
371596
|
+
(0, jsx_runtime_1.jsx)(Button_1.default, { variant: "tertiaryGray", buttonText: "Cancel", onClickHandler: handleClose }, "cancel"),
|
|
371597
|
+
], children: (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_2.default.headerContainer, children: [(0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 32, SvgElement: restore_svg_1.default, className: `${styles_module_scss_2.default.headerText} ${styles_module_scss_1.default.headerIcon}` }), (0, jsx_runtime_1.jsx)("div", { className: `${styles_module_scss_2.default.headerText} ${styles_module_scss_1.default.headerText}`, children: "Restore Version" })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.containerBox, children: ["You are about to restore the version from:", (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.versionDate, children: commitTimestamp }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.messageContainer, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(SvgIcon_1.SvgIcon, { size: 18, SvgElement: alert_svg_1.default, className: `${styles_module_scss_2.default.headerText} ${styles_module_scss_1.default.headerIcon}` }) }), (0, jsx_runtime_1.jsx)("div", { children: "Restoring a version of a file is non-destructive. The restored content will become a new version at the top of history. You can always go back to the version you just had." })] })] })] }) }));
|
|
371598
|
+
};
|
|
371599
|
+
exports["default"] = ProjectHistoryModal;
|
|
371600
|
+
|
|
371601
|
+
|
|
371563
371602
|
/***/ }),
|
|
371564
371603
|
|
|
371565
371604
|
/***/ 9825:
|
|
@@ -371630,7 +371669,7 @@ exports.ModalTypeToComponentMap = void 0;
|
|
|
371630
371669
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
371631
371670
|
const types_1 = __webpack_require__(92932);
|
|
371632
371671
|
const ShareProjectModal_1 = __importDefault(__webpack_require__(58052));
|
|
371633
|
-
const ProjectHistoryModal_1 = __importDefault(__webpack_require__(
|
|
371672
|
+
const ProjectHistoryModal_1 = __importDefault(__webpack_require__(39345));
|
|
371634
371673
|
const RemoveItemModal_1 = __importDefault(__webpack_require__(3985));
|
|
371635
371674
|
const SaveProjectReminderModal_1 = __importDefault(__webpack_require__(66536));
|
|
371636
371675
|
const UploadSizeLimitModal_1 = __importDefault(__webpack_require__(16893));
|
|
@@ -371639,7 +371678,7 @@ const RemixProjectModal_1 = __importDefault(__webpack_require__(45829));
|
|
|
371639
371678
|
exports.ModalTypeToComponentMap = {
|
|
371640
371679
|
[types_1.ModalType.SHARE_PROJECT]: (0, jsx_runtime_1.jsx)(ShareProjectModal_1.default, {}),
|
|
371641
371680
|
[types_1.ModalType.REMOVE_ITEM]: (0, jsx_runtime_1.jsx)(RemoveItemModal_1.default, {}),
|
|
371642
|
-
[types_1.ModalType.
|
|
371681
|
+
[types_1.ModalType.RESTORE_VERSION]: (0, jsx_runtime_1.jsx)(ProjectHistoryModal_1.default, {}),
|
|
371643
371682
|
[types_1.ModalType.SAVE_PROJECT_REMINDER]: (0, jsx_runtime_1.jsx)(SaveProjectReminderModal_1.default, {}),
|
|
371644
371683
|
[types_1.ModalType.UPLOAD_SIZE_LIMIT]: (0, jsx_runtime_1.jsx)(UploadSizeLimitModal_1.default, {}),
|
|
371645
371684
|
[types_1.ModalType.UPLOAD_FILES]: (0, jsx_runtime_1.jsx)(UploadFilesModal_1.default, {}),
|
|
@@ -371647,6 +371686,38 @@ exports.ModalTypeToComponentMap = {
|
|
|
371647
371686
|
};
|
|
371648
371687
|
|
|
371649
371688
|
|
|
371689
|
+
/***/ }),
|
|
371690
|
+
|
|
371691
|
+
/***/ 75724:
|
|
371692
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
371693
|
+
|
|
371694
|
+
|
|
371695
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
371696
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
371697
|
+
};
|
|
371698
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
371699
|
+
const jsx_runtime_1 = __webpack_require__(74848);
|
|
371700
|
+
const gwc_logo_svg_1 = __importDefault(__webpack_require__(72865));
|
|
371701
|
+
const text_jam_logo_svg_1 = __importDefault(__webpack_require__(97552));
|
|
371702
|
+
const ProjectName_1 = __importDefault(__webpack_require__(23559));
|
|
371703
|
+
const DownloadButton_1 = __importDefault(__webpack_require__(2492));
|
|
371704
|
+
const SaveButton_1 = __importDefault(__webpack_require__(24771));
|
|
371705
|
+
const ShareButton_1 = __importDefault(__webpack_require__(21422));
|
|
371706
|
+
const HistoryButton_1 = __importDefault(__webpack_require__(21091));
|
|
371707
|
+
const RunBar_1 = __importDefault(__webpack_require__(78176));
|
|
371708
|
+
const styles_module_scss_1 = __importDefault(__webpack_require__(19436));
|
|
371709
|
+
const stores_1 = __webpack_require__(32132);
|
|
371710
|
+
const types_1 = __webpack_require__(92932);
|
|
371711
|
+
const ProjectBar = ({ nameEditable = true, }) => {
|
|
371712
|
+
const loading = (0, stores_1.useAppSelector)((state) => state.editor.loading);
|
|
371713
|
+
if (loading !== types_1.LoadingState.SUCCESS) {
|
|
371714
|
+
return null;
|
|
371715
|
+
}
|
|
371716
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(gwc_logo_svg_1.default, { className: styles_module_scss_1.default.gwcLogo, role: "img", "aria-labelledby": "GWC Logo" }), (0, jsx_runtime_1.jsx)(text_jam_logo_svg_1.default, { className: styles_module_scss_1.default.textJamLogo, role: "img", "aria-labelledby": "TextJam logo" })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(ProjectName_1.default, { editable: nameEditable, showLabel: true }), (0, jsx_runtime_1.jsx)(HistoryButton_1.default, { className: styles_module_scss_1.default.btnSvg }), (0, jsx_runtime_1.jsx)(SaveButton_1.default, { className: styles_module_scss_1.default.headerBtn })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(RunBar_1.default, {}), (0, jsx_runtime_1.jsx)(DownloadButton_1.default, { className: styles_module_scss_1.default.btnSvg }), (0, jsx_runtime_1.jsx)(ShareButton_1.default, { className: styles_module_scss_1.default.btnSvg })] })] }));
|
|
371717
|
+
};
|
|
371718
|
+
exports["default"] = ProjectBar;
|
|
371719
|
+
|
|
371720
|
+
|
|
371650
371721
|
/***/ }),
|
|
371651
371722
|
|
|
371652
371723
|
/***/ 42375:
|
|
@@ -371909,7 +371980,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
371909
371980
|
const jsx_runtime_1 = __webpack_require__(74848);
|
|
371910
371981
|
const react_1 = __webpack_require__(51649);
|
|
371911
371982
|
const marked_1 = __webpack_require__(6709);
|
|
371912
|
-
const Project_1 = __importDefault(__webpack_require__(
|
|
371983
|
+
const Project_1 = __importDefault(__webpack_require__(69118));
|
|
371913
371984
|
const Output_1 = __importDefault(__webpack_require__(95148));
|
|
371914
371985
|
const DefaultMZCriteria_1 = __webpack_require__(98748);
|
|
371915
371986
|
const WebComponentCustomEvents_1 = __webpack_require__(30272);
|
|
@@ -372058,7 +372129,7 @@ const createProjectArchive_1 = __webpack_require__(46514);
|
|
|
372058
372129
|
const Loading_1 = __importDefault(__webpack_require__(34466));
|
|
372059
372130
|
const stores_1 = __webpack_require__(32132);
|
|
372060
372131
|
const WebComponentLoader = (props) => {
|
|
372061
|
-
const { locale = "en", projectNameEditable = true, readOnly = false, sidebarOptions = [], project: projectData, saveProject, isSaving, loadProjectContent, projectContent = null, isLoading = false, packageApiUrl, user, isCodeVisible = true, isSharedProject = false, shareLinks, isContentLoaded = null, isSaveSuccess = null, } = props;
|
|
372132
|
+
const { locale = "en", projectNameEditable = true, readOnly = false, sidebarOptions = [], project: projectData, saveProject, isSaving, loadProjectContent, projectContent = null, isLoading = false, packageApiUrl, user, isCodeVisible = true, isSharedProject = false, shareLinks, isContentLoaded = null, isSaveSuccess = null, loadTemplateProjectData, isTemplateDataLoaded = false, } = props;
|
|
372062
372133
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
372063
372134
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
372064
372135
|
const [searchParams] = (0, react_router_dom_1.useSearchParams)();
|
|
@@ -372120,6 +372191,8 @@ const WebComponentLoader = (props) => {
|
|
|
372120
372191
|
isContentLoaded,
|
|
372121
372192
|
projectContent,
|
|
372122
372193
|
loadProjectContent,
|
|
372194
|
+
loadTemplateProjectData,
|
|
372195
|
+
isTemplateDataLoaded,
|
|
372123
372196
|
});
|
|
372124
372197
|
const onSave = async () => {
|
|
372125
372198
|
if (!project?.components?.length)
|
|
@@ -372802,11 +372875,12 @@ const useIsMounted_1 = __webpack_require__(76314);
|
|
|
372802
372875
|
const useProjectCache_1 = __webpack_require__(69557);
|
|
372803
372876
|
const helpers_1 = __webpack_require__(59578);
|
|
372804
372877
|
const isFinalLoadingState = (state) => state === types_1.LoadingState.SUCCESS || state === types_1.LoadingState.FAILED;
|
|
372805
|
-
const useProject = ({ projectData, projectContent = null, isContentLoaded = null, isLoading = false, loadProjectContent, }) => {
|
|
372878
|
+
const useProject = ({ projectData, projectContent = null, isContentLoaded = null, isLoading = false, loadProjectContent, loadTemplateProjectData, isTemplateDataLoaded, }) => {
|
|
372806
372879
|
const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
|
|
372807
372880
|
const loadingState = (0, stores_1.useAppSelector)((state) => state.editor.loading);
|
|
372808
372881
|
const isPreview = (0, stores_1.useAppSelector)((state) => state.editor.isOutputOnly);
|
|
372809
|
-
const
|
|
372882
|
+
const commitIdLoadTriggered = (0, stores_1.useAppSelector)((state) => state.editor.commitIdLoadTriggered);
|
|
372883
|
+
const isLoadingCommit = (0, stores_1.useAppSelector)((state) => state.editor.isLoadingCommit);
|
|
372810
372884
|
const isMounted = (0, useIsMounted_1.useIsMounted)();
|
|
372811
372885
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
372812
372886
|
const cacheKey = project.identifier ?? projectData?.identifier;
|
|
@@ -372837,7 +372911,7 @@ const useProject = ({ projectData, projectContent = null, isContentLoaded = null
|
|
|
372837
372911
|
if (isLoading ||
|
|
372838
372912
|
isLoadingCache ||
|
|
372839
372913
|
(!isCacheLoaded && cacheKey) ||
|
|
372840
|
-
|
|
372914
|
+
commitIdLoadTriggered)
|
|
372841
372915
|
return;
|
|
372842
372916
|
if (isFinalLoadingState(loadingState))
|
|
372843
372917
|
return;
|
|
@@ -372846,26 +372920,29 @@ const useProject = ({ projectData, projectContent = null, isContentLoaded = null
|
|
|
372846
372920
|
// eslint-disable-next-line eqeqeq
|
|
372847
372921
|
const isCurrentOutdated = cachedProject?.commitId != projectData?.commitId;
|
|
372848
372922
|
// if no local data found or it's outdated, and commitId provided, try to load from commit
|
|
372849
|
-
if ((hasNoData || isCurrentOutdated) &&
|
|
372850
|
-
projectData?.commitId &&
|
|
372851
|
-
loadProjectContent) {
|
|
372923
|
+
if ((hasNoData || isCurrentOutdated) && projectData?.commitId) {
|
|
372852
372924
|
// if we need to load content, but the loading is failed, set failed state and stop
|
|
372853
372925
|
if (isContentLoaded === false) {
|
|
372854
372926
|
dispatch((0, EditorSlice_1.setLoading)(types_1.LoadingState.FAILED));
|
|
372855
372927
|
return;
|
|
372856
372928
|
}
|
|
372857
|
-
dispatch((0, EditorSlice_1.
|
|
372858
|
-
loadProjectContent?.(projectData.commitId);
|
|
372859
|
-
return;
|
|
372860
|
-
}
|
|
372861
|
-
// if no specific commitId provided and not preview, set default data
|
|
372862
|
-
if (!projectData?.commitId && !isPreview) {
|
|
372863
|
-
setProjectDataFromTemplate(projectData);
|
|
372929
|
+
dispatch((0, EditorSlice_1.setCommitIdLoadTriggered)(projectData.commitId));
|
|
372864
372930
|
return;
|
|
372865
372931
|
}
|
|
372866
372932
|
// if cached data found and it's not outdated, load from cache
|
|
372867
372933
|
if (cachedProject && !isCurrentOutdated) {
|
|
372868
372934
|
dispatch((0, EditorSlice_1.setProject)(cachedProject));
|
|
372935
|
+
dispatch((0, EditorSlice_1.setCommits)({ commits: projectData?.commits ?? [] }));
|
|
372936
|
+
return;
|
|
372937
|
+
}
|
|
372938
|
+
// if no specific commitId provided and not preview, set default data
|
|
372939
|
+
if (!projectData?.commitId && !isPreview) {
|
|
372940
|
+
if (!loadTemplateProjectData || isTemplateDataLoaded) {
|
|
372941
|
+
setProjectDataFromTemplate(projectData);
|
|
372942
|
+
}
|
|
372943
|
+
else {
|
|
372944
|
+
loadTemplateProjectData?.();
|
|
372945
|
+
}
|
|
372869
372946
|
return;
|
|
372870
372947
|
}
|
|
372871
372948
|
// if no flows above applied, set failed loading status
|
|
@@ -372881,18 +372958,33 @@ const useProject = ({ projectData, projectContent = null, isContentLoaded = null
|
|
|
372881
372958
|
setProjectDataFromTemplate,
|
|
372882
372959
|
isCacheLoaded,
|
|
372883
372960
|
dispatch,
|
|
372884
|
-
|
|
372961
|
+
commitIdLoadTriggered,
|
|
372885
372962
|
isPreview,
|
|
372886
372963
|
cacheKey,
|
|
372887
372964
|
isContentLoaded,
|
|
372965
|
+
loadTemplateProjectData,
|
|
372966
|
+
isTemplateDataLoaded,
|
|
372888
372967
|
]);
|
|
372968
|
+
// Load commit data when commitIdLoadTriggered is set
|
|
372969
|
+
(0, react_1.useEffect)(() => {
|
|
372970
|
+
// if already loading a commit or no commit load triggered, do nothing
|
|
372971
|
+
if (isLoadingCommit || !commitIdLoadTriggered)
|
|
372972
|
+
return;
|
|
372973
|
+
if (!loadProjectContent) {
|
|
372974
|
+
console.warn("loadProjectContent function is not provided, cannot load project content.");
|
|
372975
|
+
dispatch((0, EditorSlice_1.setCommitIdLoadTriggered)(null));
|
|
372976
|
+
return;
|
|
372977
|
+
}
|
|
372978
|
+
loadProjectContent(commitIdLoadTriggered);
|
|
372979
|
+
dispatch((0, EditorSlice_1.setIsLoadingCommit)(true));
|
|
372980
|
+
}, [commitIdLoadTriggered, loadProjectContent, dispatch, isLoadingCommit]);
|
|
372889
372981
|
// handle project content loading
|
|
372890
372982
|
(0, react_1.useEffect)(() => {
|
|
372891
|
-
if (!
|
|
372983
|
+
if (!commitIdLoadTriggered || isLoading || !projectData)
|
|
372892
372984
|
return;
|
|
372893
372985
|
if (isContentLoaded === false) {
|
|
372894
372986
|
// if no data and not loading, stop waiting for content
|
|
372895
|
-
dispatch((0, EditorSlice_1.
|
|
372987
|
+
dispatch((0, EditorSlice_1.setIsLoadingCommit)(false));
|
|
372896
372988
|
return;
|
|
372897
372989
|
}
|
|
372898
372990
|
if (!projectContent)
|
|
@@ -372909,11 +373001,14 @@ const useProject = ({ projectData, projectContent = null, isContentLoaded = null
|
|
|
372909
373001
|
// ensure this is the latest load call to avoid race conditions
|
|
372910
373002
|
if (projectLoadCallIdRef.current !== callId)
|
|
372911
373003
|
return;
|
|
373004
|
+
const { commits, ...rest } = projectData;
|
|
372912
373005
|
dispatch((0, EditorSlice_1.setProject)({
|
|
372913
|
-
...
|
|
373006
|
+
...rest,
|
|
373007
|
+
commitId: commitIdLoadTriggered,
|
|
372914
373008
|
components: loadedProject.components,
|
|
372915
373009
|
rootDirId: loadedProject.rootDirId,
|
|
372916
373010
|
}));
|
|
373011
|
+
dispatch((0, EditorSlice_1.setCommits)({ commits: commits ?? [] }));
|
|
372917
373012
|
})
|
|
372918
373013
|
.catch((error) => {
|
|
372919
373014
|
console.error("Error loading project from zip:", error);
|
|
@@ -372921,14 +373016,15 @@ const useProject = ({ projectData, projectContent = null, isContentLoaded = null
|
|
|
372921
373016
|
.finally(() => {
|
|
372922
373017
|
if (!isMounted.current)
|
|
372923
373018
|
return;
|
|
372924
|
-
dispatch((0, EditorSlice_1.
|
|
373019
|
+
dispatch((0, EditorSlice_1.setIsLoadingCommit)(false));
|
|
372925
373020
|
});
|
|
373021
|
+
// trigger only on incoming data change
|
|
373022
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
372926
373023
|
}, [
|
|
372927
373024
|
dispatch,
|
|
372928
373025
|
isMounted,
|
|
372929
373026
|
projectContent,
|
|
372930
373027
|
projectData,
|
|
372931
|
-
isContentLoadTriggered,
|
|
372932
373028
|
isContentLoaded,
|
|
372933
373029
|
isLoading,
|
|
372934
373030
|
]);
|
|
@@ -373051,8 +373147,7 @@ const useProjectPersistence = ({ user, projectData, hasShownSavePrompt, onSave,
|
|
|
373051
373147
|
const isCommitDifferent = projectData.commitId &&
|
|
373052
373148
|
project.commitId &&
|
|
373053
373149
|
project.commitId !== projectData.commitId;
|
|
373054
|
-
|
|
373055
|
-
if (!isFirstSave && !isSaveCurrentChanges)
|
|
373150
|
+
if (!isFirstSave && !isCommitDifferent)
|
|
373056
373151
|
return;
|
|
373057
373152
|
dispatch((0, EditorSlice_1.updateProjectCommits)({ commitId: projectData.commitId, commits }));
|
|
373058
373153
|
// remove old cached project on the first save
|
|
@@ -373118,7 +373213,7 @@ exports.useProjectPersistence = useProjectPersistence;
|
|
|
373118
373213
|
|
|
373119
373214
|
var _a;
|
|
373120
373215
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
373121
|
-
exports.queueBinaryWrites = exports.
|
|
373216
|
+
exports.queueBinaryWrites = exports.setIsLoadingCommit = exports.setCommitIdLoadTriggered = exports.setShareLinks = exports.setCommits = exports.setSharedStatus = exports.setCodeVisibility = exports.applyComponentsPatch = exports.setSaving = exports.disableTheming = exports.hideSidebar = exports.showSidebar = exports.closeModal = exports.showModal = exports.closeErrorModal = exports.showErrorModal = exports.updateProjectName = exports.setSaveTriggered = exports.triggerDraw = exports.triggerCodeRun = exports.stopDraw = exports.stopCodeRun = exports.setLoading = exports.setReadOnly = exports.updateProjectIdentifier = exports.updateProjectCommits = exports.setProject = exports.setHasShownSavePrompt = exports.setError = exports.setCascadeUpdate = exports.setIsOutputOnly = exports.setAutorunEnabled = exports.setPage = exports.setFocussedFileIndex = exports.addFilePanel = exports.setOpenedFiles = exports.openFile = exports.closeFile = exports.expireJustLoaded = exports.codeRunHandled = exports.resetRunner = exports.setLoadedRunner = exports.loadingRunner = exports.updateProjectComponent = exports.addProjectComponent = exports.resetState = exports.EditorSlice = exports.editorInitialState = void 0;
|
|
373122
373217
|
const toolkit_1 = __webpack_require__(12069);
|
|
373123
373218
|
const ProjectTypes_1 = __webpack_require__(27130);
|
|
373124
373219
|
const types_1 = __webpack_require__(92932);
|
|
@@ -373129,7 +373224,8 @@ exports.editorInitialState = {
|
|
|
373129
373224
|
saveTriggered: false,
|
|
373130
373225
|
saving: types_1.SavingState.IDLE,
|
|
373131
373226
|
saveSuccess: null,
|
|
373132
|
-
|
|
373227
|
+
commitIdLoadTriggered: null,
|
|
373228
|
+
isLoadingCommit: false,
|
|
373133
373229
|
loading: types_1.LoadingState.IDLE,
|
|
373134
373230
|
justLoaded: false,
|
|
373135
373231
|
hasShownSavePrompt: false,
|
|
@@ -373255,7 +373351,7 @@ exports.EditorSlice = (0, toolkit_1.createSlice)({
|
|
|
373255
373351
|
},
|
|
373256
373352
|
updateProjectCommits: (state, action) => {
|
|
373257
373353
|
state.project.commitId = action.payload.commitId;
|
|
373258
|
-
state.
|
|
373354
|
+
state.commits = action.payload.commits;
|
|
373259
373355
|
},
|
|
373260
373356
|
updateProjectIdentifier: (state, action) => {
|
|
373261
373357
|
state.project.identifier = action.payload;
|
|
@@ -373278,8 +373374,14 @@ exports.EditorSlice = (0, toolkit_1.createSlice)({
|
|
|
373278
373374
|
state.saving = types_1.SavingState.IDLE;
|
|
373279
373375
|
}
|
|
373280
373376
|
},
|
|
373281
|
-
|
|
373282
|
-
state.
|
|
373377
|
+
setCommitIdLoadTriggered: (state, action) => {
|
|
373378
|
+
state.commitIdLoadTriggered = action.payload;
|
|
373379
|
+
},
|
|
373380
|
+
setIsLoadingCommit: (state, action) => {
|
|
373381
|
+
state.isLoadingCommit = action.payload;
|
|
373382
|
+
if (action.payload === false) {
|
|
373383
|
+
state.commitIdLoadTriggered = null;
|
|
373384
|
+
}
|
|
373283
373385
|
},
|
|
373284
373386
|
setSaving: (state, action) => {
|
|
373285
373387
|
state.saving = action.payload;
|
|
@@ -373390,7 +373492,7 @@ exports.EditorSlice = (0, toolkit_1.createSlice)({
|
|
|
373390
373492
|
},
|
|
373391
373493
|
});
|
|
373392
373494
|
// Action creators are generated for each case reducer function
|
|
373393
|
-
_a = exports.EditorSlice.actions, exports.resetState = _a.resetState, exports.addProjectComponent = _a.addProjectComponent, exports.updateProjectComponent = _a.updateProjectComponent, exports.loadingRunner = _a.loadingRunner, exports.setLoadedRunner = _a.setLoadedRunner, exports.resetRunner = _a.resetRunner, exports.codeRunHandled = _a.codeRunHandled, exports.expireJustLoaded = _a.expireJustLoaded, exports.closeFile = _a.closeFile, exports.openFile = _a.openFile, exports.setOpenedFiles = _a.setOpenedFiles, exports.addFilePanel = _a.addFilePanel, exports.setFocussedFileIndex = _a.setFocussedFileIndex, exports.setPage = _a.setPage, exports.setAutorunEnabled = _a.setAutorunEnabled, exports.setIsOutputOnly = _a.setIsOutputOnly, exports.setCascadeUpdate = _a.setCascadeUpdate, exports.setError = _a.setError, exports.setHasShownSavePrompt = _a.setHasShownSavePrompt, exports.setProject = _a.setProject, exports.updateProjectCommits = _a.updateProjectCommits, exports.updateProjectIdentifier = _a.updateProjectIdentifier, exports.setReadOnly = _a.setReadOnly, exports.setLoading = _a.setLoading, exports.stopCodeRun = _a.stopCodeRun, exports.stopDraw = _a.stopDraw, exports.triggerCodeRun = _a.triggerCodeRun, exports.triggerDraw = _a.triggerDraw, exports.setSaveTriggered = _a.setSaveTriggered, exports.updateProjectName = _a.updateProjectName, exports.showErrorModal = _a.showErrorModal, exports.closeErrorModal = _a.closeErrorModal, exports.showModal = _a.showModal, exports.closeModal = _a.closeModal, exports.showSidebar = _a.showSidebar, exports.hideSidebar = _a.hideSidebar, exports.disableTheming = _a.disableTheming, exports.setSaving = _a.setSaving, exports.applyComponentsPatch = _a.applyComponentsPatch, exports.setCodeVisibility = _a.setCodeVisibility, exports.setSharedStatus = _a.setSharedStatus, exports.setCommits = _a.setCommits, exports.setShareLinks = _a.setShareLinks, exports.
|
|
373495
|
+
_a = exports.EditorSlice.actions, exports.resetState = _a.resetState, exports.addProjectComponent = _a.addProjectComponent, exports.updateProjectComponent = _a.updateProjectComponent, exports.loadingRunner = _a.loadingRunner, exports.setLoadedRunner = _a.setLoadedRunner, exports.resetRunner = _a.resetRunner, exports.codeRunHandled = _a.codeRunHandled, exports.expireJustLoaded = _a.expireJustLoaded, exports.closeFile = _a.closeFile, exports.openFile = _a.openFile, exports.setOpenedFiles = _a.setOpenedFiles, exports.addFilePanel = _a.addFilePanel, exports.setFocussedFileIndex = _a.setFocussedFileIndex, exports.setPage = _a.setPage, exports.setAutorunEnabled = _a.setAutorunEnabled, exports.setIsOutputOnly = _a.setIsOutputOnly, exports.setCascadeUpdate = _a.setCascadeUpdate, exports.setError = _a.setError, exports.setHasShownSavePrompt = _a.setHasShownSavePrompt, exports.setProject = _a.setProject, exports.updateProjectCommits = _a.updateProjectCommits, exports.updateProjectIdentifier = _a.updateProjectIdentifier, exports.setReadOnly = _a.setReadOnly, exports.setLoading = _a.setLoading, exports.stopCodeRun = _a.stopCodeRun, exports.stopDraw = _a.stopDraw, exports.triggerCodeRun = _a.triggerCodeRun, exports.triggerDraw = _a.triggerDraw, exports.setSaveTriggered = _a.setSaveTriggered, exports.updateProjectName = _a.updateProjectName, exports.showErrorModal = _a.showErrorModal, exports.closeErrorModal = _a.closeErrorModal, exports.showModal = _a.showModal, exports.closeModal = _a.closeModal, exports.showSidebar = _a.showSidebar, exports.hideSidebar = _a.hideSidebar, exports.disableTheming = _a.disableTheming, exports.setSaving = _a.setSaving, exports.applyComponentsPatch = _a.applyComponentsPatch, exports.setCodeVisibility = _a.setCodeVisibility, exports.setSharedStatus = _a.setSharedStatus, exports.setCommits = _a.setCommits, exports.setShareLinks = _a.setShareLinks, exports.setCommitIdLoadTriggered = _a.setCommitIdLoadTriggered, exports.setIsLoadingCommit = _a.setIsLoadingCommit;
|
|
373394
373496
|
exports.queueBinaryWrites = (0, toolkit_1.createAction)("editor/queueBinaryWrites");
|
|
373395
373497
|
exports["default"] = exports.EditorSlice.reducer;
|
|
373396
373498
|
|
|
@@ -373638,7 +373740,7 @@ var ModalType;
|
|
|
373638
373740
|
(function (ModalType) {
|
|
373639
373741
|
ModalType["SHARE_PROJECT"] = "shareProject";
|
|
373640
373742
|
ModalType["REMOVE_ITEM"] = "removeItem";
|
|
373641
|
-
ModalType["
|
|
373743
|
+
ModalType["RESTORE_VERSION"] = "restoreVersion";
|
|
373642
373744
|
ModalType["SAVE_PROJECT_REMINDER"] = "saveProjectReminder";
|
|
373643
373745
|
ModalType["UPLOAD_SIZE_LIMIT"] = "uploadSizeLimit";
|
|
373644
373746
|
ModalType["UPLOAD_FILES"] = "uploadFiles";
|