@dao42/d42paas-front 0.6.16 → 0.6.17

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.
@@ -187836,6 +187836,23 @@ const Editor = ({
187836
187836
  const debounced = lodash$2.exports.debounce((callback) => {
187837
187837
  callback();
187838
187838
  }, 300);
187839
+ const cursorTool = (evt) => {
187840
+ var _a2, _b2, _c2, _d2;
187841
+ const {
187842
+ userInfo
187843
+ } = userStore.getState();
187844
+ const selection2 = [[evt.selection.startLineNumber, evt.selection.startColumn, evt.selection.endLineNumber, evt.selection.endColumn, evt.selection.selectionStartLineNumber, evt.selection.selectionStartColumn, evt.selection.positionColumn, evt.selection.positionLineNumber], ...evt.secondarySelections.map((s2) => [s2.startLineNumber, s2.startColumn, s2.endLineNumber, s2.endColumn, s2.selectionStartLineNumber, s2.selectionStartColumn, s2.positionColumn, s2.positionLineNumber])];
187845
+ const crdt = {
187846
+ timestamp: Date.now(),
187847
+ selection: selection2,
187848
+ file: {
187849
+ action: "Update",
187850
+ path: (_b2 = (_a2 = oTStore.getState()) == null ? void 0 : _a2.doc) == null ? void 0 : _b2.path
187851
+ },
187852
+ userInfo: lodash$2.exports.pick(userInfo, "uuid", "role")
187853
+ };
187854
+ (_d2 = (_c2 = useOT.getState()) == null ? void 0 : _c2.socket) == null ? void 0 : _d2.emit("selection", JSON.stringify(crdt));
187855
+ };
187839
187856
  const receiveOperation = (revision, operation, _path) => {
187840
187857
  client2.receiveOperation = operation;
187841
187858
  return {
@@ -187850,8 +187867,21 @@ const Editor = ({
187850
187867
  }
187851
187868
  });
187852
187869
  editor.onDidChangeCursorSelection((evt) => {
187853
- oTStore.getState();
187854
- return;
187870
+ const {
187871
+ appStatus
187872
+ } = oTStore.getState();
187873
+ if (appStatus === "replay")
187874
+ return;
187875
+ if (evt.source === "api") {
187876
+ debounced(() => {
187877
+ cursorTool(evt);
187878
+ });
187879
+ }
187880
+ if (evt.reason === 0 || evt.source === "model")
187881
+ return;
187882
+ debounced(() => {
187883
+ cursorTool(evt);
187884
+ });
187855
187885
  });
187856
187886
  editor.onDidChangeModelContent((evt) => {
187857
187887
  const {
@@ -195680,22 +195710,19 @@ const StopMask = newStyled.div`
195680
195710
  opacity: 0.6;
195681
195711
  `;
195682
195712
  const OutputBrowser = (_g2) => {
195683
- var _h2 = _g2, {
195684
- url: url2
195685
- } = _h2, props2 = __objRest(_h2, [
195686
- "url"
195687
- ]);
195713
+ var props2 = __objRest(_g2, []);
195714
+ var _a2;
195688
195715
  const pStatus = oTStore((state) => state.playgroundStatus);
195689
195716
  const dStatus = oTStore((state) => state.dockerStatus);
195690
195717
  const [playgroundStatus, setPlaygroundStatus] = react.exports.useState("EMPTY");
195691
195718
  const [dockerStatus, setDockerStatus] = react.exports.useState("STOP");
195692
- const urlWithProtocol = (url22) => {
195693
- if (!url22)
195719
+ const urlWithProtocol = (url2) => {
195720
+ if (!url2)
195694
195721
  return `${PROTOCOL}showmebug.com`;
195695
- if (url22.indexOf("http://") !== 0 && url22.indexOf("https://") !== 0) {
195696
- url22 = `${PROTOCOL}${url22}`;
195722
+ if (url2.indexOf("http://") !== 0 && url2.indexOf("https://") !== 0) {
195723
+ url2 = `${PROTOCOL}${url2}`;
195697
195724
  }
195698
- return url22;
195725
+ return url2;
195699
195726
  };
195700
195727
  react.exports.useEffect(() => {
195701
195728
  setPlaygroundStatus(pStatus);
@@ -195707,34 +195734,32 @@ const OutputBrowser = (_g2) => {
195707
195734
  }, 800);
195708
195735
  }, [dStatus]);
195709
195736
  const iframeRef = react.exports.useRef(null);
195710
- const [iframeSrc, setIframeSrc] = react.exports.useState(urlWithProtocol(url2));
195711
- react.exports.useEffect(() => {
195712
- setIframeSrc(urlWithProtocol(url2));
195713
- }, [url2]);
195737
+ const [iframeSrc, setIframeSrc] = react.exports.useState(urlWithProtocol((_a2 = oTStore.getState().dockerInfo) == null ? void 0 : _a2.url));
195714
195738
  react.exports.useEffect(() => {
195715
195739
  }, [iframeRef]);
195716
195740
  const onEnterKey = (e2) => {
195717
- var _a2, _b2;
195741
+ var _a3, _b2;
195718
195742
  if (e2.keyCode !== 13)
195719
195743
  return;
195720
- const url22 = urlWithProtocol(e2.target.value);
195721
- setIframeSrc(url22);
195722
- (_b2 = (_a2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.location.replace(url22);
195744
+ const url2 = urlWithProtocol(e2.target.value);
195745
+ setIframeSrc(url2);
195746
+ (_b2 = (_a3 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a3.contentWindow) == null ? void 0 : _b2.location.replace(url2);
195723
195747
  };
195724
195748
  const onRefresh = () => {
195725
- var _a2, _b2;
195726
- (_b2 = (_a2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.location.replace(iframeSrc);
195749
+ var _a3, _b2;
195750
+ (_b2 = (_a3 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a3.contentWindow) == null ? void 0 : _b2.location.replace(iframeSrc);
195727
195751
  };
195728
195752
  const onOpenInNewTab = () => {
195729
195753
  window.open(iframeSrc);
195730
195754
  };
195731
195755
  react.exports.useEffect(() => {
195732
- var _a2, _b2;
195756
+ var _a3, _b2, _c2;
195733
195757
  if (playgroundStatus === "EMPTY")
195734
195758
  return;
195759
+ setIframeSrc(urlWithProtocol((_a3 = oTStore.getState().dockerInfo) == null ? void 0 : _a3.url));
195735
195760
  if (playgroundStatus === "ACTIVE" && dockerStatus === "RUNNING") {
195736
195761
  if (iframeSrc !== "http://" && iframeSrc !== "https://") {
195737
- (_b2 = (_a2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.location.replace(iframeSrc);
195762
+ (_c2 = (_b2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _b2.contentWindow) == null ? void 0 : _c2.location.replace(iframeSrc);
195738
195763
  }
195739
195764
  }
195740
195765
  }, [playgroundStatus, dockerStatus]);
@@ -195772,10 +195797,10 @@ var index$2 = /* @__PURE__ */ Object.freeze({
195772
195797
  [Symbol.toStringTag]: "Module",
195773
195798
  "default": OutputBrowser
195774
195799
  });
195775
- const TerminalComponent = (_i) => {
195776
- var _j = _i, {
195800
+ const TerminalComponent = (_h2) => {
195801
+ var _i = _h2, {
195777
195802
  options
195778
- } = _j, props2 = __objRest(_j, [
195803
+ } = _i, props2 = __objRest(_i, [
195779
195804
  "options"
195780
195805
  ]);
195781
195806
  const defaultOptions2 = __spreadValues({}, options);
@@ -195888,12 +195913,12 @@ var index$1 = /* @__PURE__ */ Object.freeze({
195888
195913
  [Symbol.toStringTag]: "Module",
195889
195914
  "default": TerminalComponent
195890
195915
  });
195891
- const Tabs = (_k) => {
195892
- var _l = _k, {
195916
+ const Tabs = (_j) => {
195917
+ var _k = _j, {
195893
195918
  activeKey,
195894
195919
  onSelect,
195895
195920
  tabItems
195896
- } = _l, props2 = __objRest(_l, [
195921
+ } = _k, props2 = __objRest(_k, [
195897
195922
  "activeKey",
195898
195923
  "onSelect",
195899
195924
  "tabItems"
@@ -196211,10 +196236,10 @@ const AvatarLayout = newStyled.div`
196211
196236
  border-color: ${(props2) => props2.user.color};
196212
196237
  background-image: ${(props2) => 'url("' + props2.user.avatar + '")'};
196213
196238
  `;
196214
- const Avatar = (_m) => {
196215
- var _n = _m, {
196239
+ const Avatar = (_l) => {
196240
+ var _m = _l, {
196216
196241
  user
196217
- } = _n, props2 = __objRest(_n, [
196242
+ } = _m, props2 = __objRest(_m, [
196218
196243
  "user"
196219
196244
  ]);
196220
196245
  return /* @__PURE__ */ jsx(AvatarLayout, __spreadValues({
@@ -196223,8 +196248,8 @@ const Avatar = (_m) => {
196223
196248
  }, props2));
196224
196249
  };
196225
196250
  const SkeletonThemeContext = React.createContext({});
196226
- function SkeletonTheme(_o) {
196227
- var _p = _o, { children } = _p, styleOptions = __objRest(_p, ["children"]);
196251
+ function SkeletonTheme(_n) {
196252
+ var _o = _n, { children } = _o, styleOptions = __objRest(_o, ["children"]);
196228
196253
  return React.createElement(SkeletonThemeContext.Provider, { value: styleOptions }, children);
196229
196254
  }
196230
196255
  const defaultEnableAnimation = true;
@@ -196250,8 +196275,8 @@ function styleOptionsToCssProperties({ baseColor, highlightColor, width: width2,
196250
196275
  style["--highlight-color"] = highlightColor;
196251
196276
  return style;
196252
196277
  }
196253
- function Skeleton$1(_q) {
196254
- var _r = _q, { count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp } = _r, propsStyleOptions = __objRest(_r, ["count", "wrapper", "className", "containerClassName", "containerTestId", "circle", "style"]);
196278
+ function Skeleton$1(_p) {
196279
+ var _q = _p, { count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp } = _q, propsStyleOptions = __objRest(_q, ["count", "wrapper", "className", "containerClassName", "containerTestId", "circle", "style"]);
196255
196280
  var _a2, _b2;
196256
196281
  const contextStyleOptions = React.useContext(SkeletonThemeContext);
196257
196282
  const styleOptions = __spreadProps(__spreadValues(__spreadValues({}, contextStyleOptions), propsStyleOptions), {
@@ -196374,8 +196399,8 @@ const ButtonContent = ({
196374
196399
  })()
196375
196400
  });
196376
196401
  };
196377
- const ToolBar = (_s) => {
196378
- var props2 = __objRest(_s, []);
196402
+ const ToolBar = (_r) => {
196403
+ var props2 = __objRest(_r, []);
196379
196404
  const io = useOT.getState().socket;
196380
196405
  const pStatus = oTStore((state) => state.playgroundStatus);
196381
196406
  const dStatus = oTStore((state) => state.dockerStatus);