@elice/material-exercise 1.230821.0 → 1.230825.0

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.
@@ -8,6 +8,7 @@ var reactIntl = require('react-intl');
8
8
  var blocks = require('@elice/blocks');
9
9
  var designTokens = require('@elice/design-tokens');
10
10
  var icons = require('@elice/icons');
11
+ var muiElements = require('@elice/mui-elements');
11
12
  var recoil = require('recoil');
12
13
  var ExerciseMenuButton = require('../../shared/exercise-menu-button/ExerciseMenuButton.js');
13
14
  var recoil$1 = require('../context/recoil.js');
@@ -21,7 +22,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
21
22
 
22
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
24
 
24
- var IMAGE_NEW_WIN_IFRAME_STYLE = 'border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;';
25
25
  var ExerciseMenuStdioFileBrowser = function ExerciseMenuStdioFileBrowser() {
26
26
  var intl = reactIntl.useIntl();
27
27
  var _React$useState = React__default["default"].useState(false),
@@ -30,19 +30,6 @@ var ExerciseMenuStdioFileBrowser = function ExerciseMenuStdioFileBrowser() {
30
30
  setOpen = _React$useState2[1];
31
31
  var anchorRef = React__default["default"].useRef(null);
32
32
  var stdioFiles = recoil.useRecoilValue(recoil$1.exerciseRunnerStdioFilesState);
33
- /**
34
- * Open image as new window.
35
- */
36
- var handleImageFileClick = function handleImageFileClick(e) {
37
- e.preventDefault();
38
- var win = window.open('about:blank', e.currentTarget.target);
39
- if (win) {
40
- // since `Not allowed to navigate top frame to data URL:` error thrown by browser,
41
- // use iframe to display image at new window.
42
- win.document.write("<iframe src=\"".concat(e.currentTarget.href, "\" frameborder=\"0\" style=\"").concat(IMAGE_NEW_WIN_IFRAME_STYLE, "\" allowfullscreen></iframe>"));
43
- win.focus();
44
- }
45
- };
46
33
  //
47
34
  // Open stdio file browser, on file changes.
48
35
  //
@@ -62,15 +49,10 @@ var ExerciseMenuStdioFileBrowser = function ExerciseMenuStdioFileBrowser() {
62
49
  var filename = ext ? "image_output.".concat(ext) : 'image_output';
63
50
  return React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItem, {
64
51
  key: key
65
- }, React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItemContentImageWrap, {
66
- href: f.data,
67
- target: "_blank",
68
- rel: "noopener noreferrer",
69
- onClick: handleImageFileClick
70
- }, React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItemContentImage, {
52
+ }, React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItemContentImageWrap, null, React__default["default"].createElement(muiElements.ImageViewer, null, React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItemContentImage, {
71
53
  src: f.data,
72
54
  alt: filename
73
- })), React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItemDownloadButton, {
55
+ }))), React__default["default"].createElement(ExerciseMenuStdioFileBrowser_styled.StyledFilePopoverBodyListItemDownloadButton, {
74
56
  href: f.data,
75
57
  download: filename
76
58
  }, React__default["default"].createElement(blocks.Icon, {
@@ -7,7 +7,7 @@ export declare const StyledFilePopoverBodyList: import("styled-components").Styl
7
7
  export declare const StyledFilePopoverBodyListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
8
8
  export declare const StyledFilePopoverBodyListItemDownloadButton: import("styled-components").StyledComponent<"a", any, {}, never>;
9
9
  export declare const StyledFilePopoverBodyListItemContentFile: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const StyledFilePopoverBodyListItemContentImageWrap: import("styled-components").StyledComponent<"a", any, {}, never>;
10
+ export declare const StyledFilePopoverBodyListItemContentImageWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
11
11
  export declare const StyledFilePopoverBodyListItemContentImage: import("styled-components").StyledComponent<"img", any, {}, never>;
12
12
  export declare const StyledPreferenceBodyItem: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const StyledSelect: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/blocks").SelectProps & import("react").RefAttributes<HTMLSelectElement>>, any, {}, never>;
@@ -34,12 +34,12 @@ var StyledFilePopoverBodyListItemDownloadButton = styled__default["default"].a.w
34
34
  var StyledFilePopoverBodyListItemContentFile = styled__default["default"].div.withConfig({
35
35
  componentId: "sc-9mtuee-7"
36
36
  })(["flex:1;display:flex;align-items:center;justify-content:space-between;padding:0 0.5rem;"]);
37
- var StyledFilePopoverBodyListItemContentImageWrap = styled__default["default"].a.withConfig({
37
+ var StyledFilePopoverBodyListItemContentImageWrap = styled__default["default"].div.withConfig({
38
38
  componentId: "sc-9mtuee-8"
39
39
  })(["display:flex;padding:0.5rem;flex:1 1 0;background:", ";"], designTokens.base.color.white);
40
40
  var StyledFilePopoverBodyListItemContentImage = styled__default["default"].img.withConfig({
41
41
  componentId: "sc-9mtuee-9"
42
- })(["width:100%;max-height:128px;object-fit:contain;"]);
42
+ })(["width:100%;max-height:128px;object-fit:contain;cursor:zoom-in;"]);
43
43
  var StyledPreferenceBodyItem = styled__default["default"].div.withConfig({
44
44
  componentId: "sc-9mtuee-10"
45
45
  })(["display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;min-height:2rem;color:white;&:last-child{margin-bottom:0;}"]);
@@ -70,7 +70,7 @@ var ExerciseRunnerControllerRunningInfo = function ExerciseRunnerControllerRunni
70
70
  var abortCtrl = new AbortController();
71
71
  apiClient.getOrgMaterialExerciseExerciseRunningList({
72
72
  exerciseRoomId: exerciseRoomId,
73
- filterRunType: exercise.isNoSubmitGrade ? types.enums.ExerciseRunType.Run : undefined,
73
+ filterRunType: types.enums.ExerciseRunType.Grade,
74
74
  offset: 0,
75
75
  count: 1,
76
76
  userId: userId
@@ -4,6 +4,7 @@ import { useIntl, FormattedMessage } from 'react-intl';
4
4
  import { Popover, Flex, Text, Hspace, NotificationCount, IconButton, Icon, Vspace } from '@elice/blocks';
5
5
  import { base } from '@elice/design-tokens';
6
6
  import { eilAttachment, eilMathsignMultiplyBasic, eilDownload, eilFolder } from '@elice/icons';
7
+ import { ImageViewer } from '@elice/mui-elements';
7
8
  import { useRecoilValue } from 'recoil';
8
9
  import ExerciseMenuButton from '../../shared/exercise-menu-button/ExerciseMenuButton.js';
9
10
  import { exerciseRunnerStdioFilesState } from '../context/recoil.js';
@@ -13,7 +14,6 @@ import '../context/subjects.js';
13
14
  import '../context/ExerciseProvider.js';
14
15
  import { StyledFilePopoverContent, StyledMenuButtonFileCount, StyledFilePopoverHeader, StyledFilePopoverBody, StyledFilePopoverBodyList, StyledFilePopoverBodyListItem, StyledFilePopoverBodyListItemContentImageWrap, StyledFilePopoverBodyListItemContentImage, StyledFilePopoverBodyListItemDownloadButton, StyledFilePopoverBodyListItemContentFile } from './ExerciseMenuStdioFileBrowser.styled.js';
15
16
 
16
- var IMAGE_NEW_WIN_IFRAME_STYLE = 'border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;';
17
17
  var ExerciseMenuStdioFileBrowser = function ExerciseMenuStdioFileBrowser() {
18
18
  var intl = useIntl();
19
19
  var _React$useState = React.useState(false),
@@ -22,19 +22,6 @@ var ExerciseMenuStdioFileBrowser = function ExerciseMenuStdioFileBrowser() {
22
22
  setOpen = _React$useState2[1];
23
23
  var anchorRef = React.useRef(null);
24
24
  var stdioFiles = useRecoilValue(exerciseRunnerStdioFilesState);
25
- /**
26
- * Open image as new window.
27
- */
28
- var handleImageFileClick = function handleImageFileClick(e) {
29
- e.preventDefault();
30
- var win = window.open('about:blank', e.currentTarget.target);
31
- if (win) {
32
- // since `Not allowed to navigate top frame to data URL:` error thrown by browser,
33
- // use iframe to display image at new window.
34
- win.document.write("<iframe src=\"".concat(e.currentTarget.href, "\" frameborder=\"0\" style=\"").concat(IMAGE_NEW_WIN_IFRAME_STYLE, "\" allowfullscreen></iframe>"));
35
- win.focus();
36
- }
37
- };
38
25
  //
39
26
  // Open stdio file browser, on file changes.
40
27
  //
@@ -54,15 +41,10 @@ var ExerciseMenuStdioFileBrowser = function ExerciseMenuStdioFileBrowser() {
54
41
  var filename = ext ? "image_output.".concat(ext) : 'image_output';
55
42
  return React.createElement(StyledFilePopoverBodyListItem, {
56
43
  key: key
57
- }, React.createElement(StyledFilePopoverBodyListItemContentImageWrap, {
58
- href: f.data,
59
- target: "_blank",
60
- rel: "noopener noreferrer",
61
- onClick: handleImageFileClick
62
- }, React.createElement(StyledFilePopoverBodyListItemContentImage, {
44
+ }, React.createElement(StyledFilePopoverBodyListItemContentImageWrap, null, React.createElement(ImageViewer, null, React.createElement(StyledFilePopoverBodyListItemContentImage, {
63
45
  src: f.data,
64
46
  alt: filename
65
- })), React.createElement(StyledFilePopoverBodyListItemDownloadButton, {
47
+ }))), React.createElement(StyledFilePopoverBodyListItemDownloadButton, {
66
48
  href: f.data,
67
49
  download: filename
68
50
  }, React.createElement(Icon, {
@@ -7,7 +7,7 @@ export declare const StyledFilePopoverBodyList: import("styled-components").Styl
7
7
  export declare const StyledFilePopoverBodyListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
8
8
  export declare const StyledFilePopoverBodyListItemDownloadButton: import("styled-components").StyledComponent<"a", any, {}, never>;
9
9
  export declare const StyledFilePopoverBodyListItemContentFile: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const StyledFilePopoverBodyListItemContentImageWrap: import("styled-components").StyledComponent<"a", any, {}, never>;
10
+ export declare const StyledFilePopoverBodyListItemContentImageWrap: import("styled-components").StyledComponent<"div", any, {}, never>;
11
11
  export declare const StyledFilePopoverBodyListItemContentImage: import("styled-components").StyledComponent<"img", any, {}, never>;
12
12
  export declare const StyledPreferenceBodyItem: import("styled-components").StyledComponent<"div", any, {}, never>;
13
13
  export declare const StyledSelect: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elice/blocks").SelectProps & import("react").RefAttributes<HTMLSelectElement>>, any, {}, never>;
@@ -26,12 +26,12 @@ var StyledFilePopoverBodyListItemDownloadButton = styled.a.withConfig({
26
26
  var StyledFilePopoverBodyListItemContentFile = styled.div.withConfig({
27
27
  componentId: "sc-9mtuee-7"
28
28
  })(["flex:1;display:flex;align-items:center;justify-content:space-between;padding:0 0.5rem;"]);
29
- var StyledFilePopoverBodyListItemContentImageWrap = styled.a.withConfig({
29
+ var StyledFilePopoverBodyListItemContentImageWrap = styled.div.withConfig({
30
30
  componentId: "sc-9mtuee-8"
31
31
  })(["display:flex;padding:0.5rem;flex:1 1 0;background:", ";"], base.color.white);
32
32
  var StyledFilePopoverBodyListItemContentImage = styled.img.withConfig({
33
33
  componentId: "sc-9mtuee-9"
34
- })(["width:100%;max-height:128px;object-fit:contain;"]);
34
+ })(["width:100%;max-height:128px;object-fit:contain;cursor:zoom-in;"]);
35
35
  var StyledPreferenceBodyItem = styled.div.withConfig({
36
36
  componentId: "sc-9mtuee-10"
37
37
  })(["display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;min-height:2rem;color:white;&:last-child{margin-bottom:0;}"]);
@@ -61,7 +61,7 @@ var ExerciseRunnerControllerRunningInfo = function ExerciseRunnerControllerRunni
61
61
  var abortCtrl = new AbortController();
62
62
  getOrgMaterialExerciseExerciseRunningList({
63
63
  exerciseRoomId: exerciseRoomId,
64
- filterRunType: exercise.isNoSubmitGrade ? enums.ExerciseRunType.Run : undefined,
64
+ filterRunType: enums.ExerciseRunType.Grade,
65
65
  offset: 0,
66
66
  count: 1,
67
67
  userId: userId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-exercise",
3
- "version": "1.230821.0",
3
+ "version": "1.230825.0",
4
4
  "description": "User view and editing components of Elice material exercise",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -32,8 +32,15 @@
32
32
  "@elice/markdown": "^1",
33
33
  "@elice/material-shared-types": "*",
34
34
  "@elice/material-shared-utils": "*",
35
+ "@elice/mui-elements": "^5",
36
+ "@elice/mui-system": "^5",
35
37
  "@elice/types": "^1",
36
38
  "@elice/websocket": "^1",
39
+ "@emotion/react": "^11.10.5",
40
+ "@emotion/styled": "^11.10.5",
41
+ "@mui/icons-material": "^5.10.16",
42
+ "@mui/lab": "^5.0.0-alpha.112",
43
+ "@mui/material": "^5.10.16",
37
44
  "humps": "^2.0.1",
38
45
  "lodash": "^4.17.21",
39
46
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -75,10 +82,17 @@
75
82
  "@elice/design-tokens": "^1.220803.0",
76
83
  "@elice/icons": "^1.230814.0",
77
84
  "@elice/markdown": "^1.220815.0",
78
- "@elice/material-shared-types": "1.230821.0",
79
- "@elice/material-shared-utils": "1.230821.0",
85
+ "@elice/material-shared-types": "1.230825.0",
86
+ "@elice/material-shared-utils": "1.230825.0",
87
+ "@elice/mui-elements": "^5.230825.0",
88
+ "@elice/mui-system": "^5.230825.0",
80
89
  "@elice/types": "^1.230815.0",
81
90
  "@elice/websocket": "^1.220815.0",
91
+ "@emotion/react": "^11.10.5",
92
+ "@emotion/styled": "^11.10.5",
93
+ "@mui/icons-material": "^5.10.16",
94
+ "@mui/lab": "^5.0.0-alpha.112",
95
+ "@mui/material": "^5.10.16",
82
96
  "@types/classnames": "^2.3.1",
83
97
  "@types/color": "^3.0.3",
84
98
  "@types/file-saver": "^2.0.5",
@@ -98,5 +112,5 @@
98
112
  "recoil": "^0.6.1",
99
113
  "styled-components": "^5.2.0"
100
114
  },
101
- "gitHead": "4f85930b4b7eb23121650c5c95b14620ea2fb198"
115
+ "gitHead": "5859affd33ce2d07bb176bad73bc5cf4ed1c4138"
102
116
  }