@elice/material-external 1.251120.1 → 1.260128.0-rc.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.
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +34 -35
- package/cjs/components/material-external/MaterialExternal.d.ts +3 -2
- package/cjs/components/material-external/MaterialExternal.js +33 -7
- package/cjs/components/material-external/MaterialExternalAdminContent.d.ts +4 -4
- package/cjs/components/material-external/MaterialExternalAdminContent.js +32 -36
- package/cjs/components/material-external/MaterialExternalContent.d.ts +2 -1
- package/cjs/components/material-external/MaterialExternalContent.js +13 -6
- package/cjs/components/material-external/MaterialExternalIframe.d.ts +9 -2
- package/cjs/components/material-external/MaterialExternalIframe.js +87 -4
- package/cjs/components/material-external/MaterialExternalNewWindow.js +46 -39
- package/cjs/components/material-external/MaterialExternalNotSupported.d.ts +1 -1
- package/cjs/components/material-external/MaterialExternalNotSupported.js +1 -2
- package/cjs/components/material-external/MaterialExternalRedirect.d.ts +1 -1
- package/cjs/components/material-external/MaterialExternalRedirect.js +11 -4
- package/es/_virtual/_rollupPluginBabelHelpers.js +34 -35
- package/es/components/material-external/MaterialExternal.d.ts +3 -2
- package/es/components/material-external/MaterialExternal.js +34 -9
- package/es/components/material-external/MaterialExternalAdminContent.d.ts +4 -4
- package/es/components/material-external/MaterialExternalAdminContent.js +32 -32
- package/es/components/material-external/MaterialExternalContent.d.ts +2 -1
- package/es/components/material-external/MaterialExternalContent.js +13 -6
- package/es/components/material-external/MaterialExternalIframe.d.ts +9 -2
- package/es/components/material-external/MaterialExternalIframe.js +87 -5
- package/es/components/material-external/MaterialExternalNewWindow.js +46 -39
- package/es/components/material-external/MaterialExternalNotSupported.d.ts +1 -1
- package/es/components/material-external/MaterialExternalNotSupported.js +1 -2
- package/es/components/material-external/MaterialExternalRedirect.d.ts +1 -1
- package/es/components/material-external/MaterialExternalRedirect.js +12 -5
- package/package.json +30 -20
- package/cjs/components/material-external/MaterialExternal.styled.d.ts +0 -2
- package/cjs/components/material-external/MaterialExternal.styled.js +0 -18
- package/es/components/material-external/MaterialExternal.styled.d.ts +0 -2
- package/es/components/material-external/MaterialExternal.styled.js +0 -11
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
function _arrayLikeToArray(r, a) {
|
|
4
|
+
(null == a || a > r.length) && (a = r.length);
|
|
5
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
6
|
+
return n;
|
|
7
|
+
}
|
|
8
|
+
function _arrayWithHoles(r) {
|
|
9
|
+
if (Array.isArray(r)) return r;
|
|
10
|
+
}
|
|
11
|
+
function _iterableToArrayLimit(r, l) {
|
|
12
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
13
|
+
if (null != t) {
|
|
14
|
+
var e,
|
|
15
|
+
n,
|
|
16
|
+
i,
|
|
17
|
+
u,
|
|
18
|
+
a = [],
|
|
19
|
+
f = true,
|
|
20
|
+
o = false;
|
|
13
21
|
try {
|
|
14
|
-
if (
|
|
15
|
-
} catch (
|
|
16
|
-
|
|
22
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
23
|
+
} catch (r) {
|
|
24
|
+
o = true, n = r;
|
|
17
25
|
} finally {
|
|
18
26
|
try {
|
|
19
|
-
if (!
|
|
27
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
20
28
|
} finally {
|
|
21
|
-
if (
|
|
29
|
+
if (o) throw n;
|
|
22
30
|
}
|
|
23
31
|
}
|
|
24
|
-
return
|
|
32
|
+
return a;
|
|
25
33
|
}
|
|
26
34
|
}
|
|
27
|
-
function _slicedToArray(arr, i) {
|
|
28
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
29
|
-
}
|
|
30
|
-
function _arrayWithHoles(arr) {
|
|
31
|
-
if (Array.isArray(arr)) return arr;
|
|
32
|
-
}
|
|
33
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
34
|
-
if (!o) return;
|
|
35
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
36
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
37
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
38
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
39
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
40
|
-
}
|
|
41
|
-
function _arrayLikeToArray(arr, len) {
|
|
42
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
43
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
44
|
-
return arr2;
|
|
45
|
-
}
|
|
46
35
|
function _nonIterableRest() {
|
|
47
36
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
48
37
|
}
|
|
38
|
+
function _slicedToArray(r, e) {
|
|
39
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
40
|
+
}
|
|
41
|
+
function _unsupportedIterableToArray(r, a) {
|
|
42
|
+
if (r) {
|
|
43
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
44
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
45
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
49
48
|
|
|
50
49
|
exports.arrayLikeToArray = _arrayLikeToArray;
|
|
51
50
|
exports.arrayWithHoles = _arrayWithHoles;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { WithIntlComponentBuilderProps } from '@elice/intl';
|
|
3
|
-
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { MaterialExternalIframeSDKCommunicationProps } from './MaterialExternalIframe';
|
|
4
|
+
export interface MaterialExternalProps extends MaterialExternalIframeSDKCommunicationProps {
|
|
4
5
|
className?: string;
|
|
5
6
|
materialExternalId: number;
|
|
6
7
|
/** metadata logging */
|
|
@@ -2,29 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _styled = require('@emotion/styled/base');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var intl = require('@elice/intl');
|
|
7
8
|
var classnames = require('classnames');
|
|
8
|
-
var en = require('./locales/en.json.js');
|
|
9
|
-
var ko = require('./locales/ko.json.js');
|
|
10
9
|
var MaterialExternalAdminContent = require('./MaterialExternalAdminContent.js');
|
|
11
10
|
var MaterialExternalContent = require('./MaterialExternalContent.js');
|
|
12
|
-
var
|
|
11
|
+
var en = require('./locales/en.json.js');
|
|
12
|
+
var ko = require('./locales/ko.json.js');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
15
|
|
|
16
|
+
var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
|
|
16
17
|
var classnames__default = /*#__PURE__*/_interopDefaultCompat(classnames);
|
|
17
18
|
|
|
19
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
20
|
+
//
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
var ExternalContainer = /*#__PURE__*/_styled__default.default("div", {
|
|
24
|
+
target: "edzebp10"
|
|
25
|
+
})("production" === "production" ? {
|
|
26
|
+
name: "1b2cl51",
|
|
27
|
+
styles: "display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;background-color:#fff"
|
|
28
|
+
} : {
|
|
29
|
+
name: "1b2cl51",
|
|
30
|
+
styles: "display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;background-color:#fff",
|
|
31
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
32
|
+
});
|
|
33
|
+
//
|
|
34
|
+
//
|
|
35
|
+
//
|
|
18
36
|
var MaterialExternal = function MaterialExternal(_ref) {
|
|
19
37
|
var materialExternalId = _ref.materialExternalId,
|
|
20
38
|
userId = _ref.userId,
|
|
21
39
|
className = _ref.className,
|
|
22
40
|
courseId = _ref.courseId,
|
|
41
|
+
hasNextLecturePage = _ref.hasNextLecturePage,
|
|
42
|
+
hasPreviousLecturePage = _ref.hasPreviousLecturePage,
|
|
43
|
+
onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
|
|
44
|
+
onNavigatePreviousLecturePage = _ref.onNavigatePreviousLecturePage,
|
|
23
45
|
__intl = _ref.__intl;
|
|
24
46
|
var prefixCls = 'em-material-external';
|
|
25
47
|
return jsxRuntime.jsx(intl.RawEliceIntlProvider, {
|
|
26
48
|
value: __intl,
|
|
27
|
-
children: jsxRuntime.jsx(
|
|
49
|
+
children: jsxRuntime.jsx(ExternalContainer, {
|
|
28
50
|
className: classnames__default.default(prefixCls, className),
|
|
29
51
|
children: userId ? jsxRuntime.jsx(MaterialExternalAdminContent.default, {
|
|
30
52
|
materialExternalId: materialExternalId,
|
|
@@ -32,11 +54,15 @@ var MaterialExternal = function MaterialExternal(_ref) {
|
|
|
32
54
|
userId: userId
|
|
33
55
|
}) : jsxRuntime.jsx(MaterialExternalContent.default, {
|
|
34
56
|
materialExternalId: materialExternalId,
|
|
35
|
-
courseId: courseId
|
|
57
|
+
courseId: courseId,
|
|
58
|
+
hasNextLecturePage: hasNextLecturePage,
|
|
59
|
+
hasPreviousLecturePage: hasPreviousLecturePage,
|
|
60
|
+
onNavigateNextLecturePage: onNavigateNextLecturePage,
|
|
61
|
+
onNavigatePreviousLecturePage: onNavigatePreviousLecturePage
|
|
36
62
|
})
|
|
37
63
|
})
|
|
38
64
|
});
|
|
39
65
|
};
|
|
40
|
-
var
|
|
66
|
+
var MaterialExternal_default = new intl.IntlComponentBuilder(MaterialExternal).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('./locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('./locales/ja.json.js'); })).build();
|
|
41
67
|
|
|
42
|
-
exports.default =
|
|
68
|
+
exports.default = MaterialExternal_default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface MaterialExternalAdminContentProps {
|
|
3
3
|
materialExternalId: number;
|
|
4
4
|
userId: number;
|
|
5
5
|
courseId?: number;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
7
|
+
declare const MaterialExternalAdminContent: React.FC<MaterialExternalAdminContentProps>;
|
|
8
|
+
export default MaterialExternalAdminContent;
|
|
@@ -2,51 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
6
|
var apiClient = require('@elice/api-client');
|
|
9
|
-
var blocks = require('@elice/blocks');
|
|
10
7
|
var intl = require('@elice/intl');
|
|
8
|
+
var material = require('@mui/material');
|
|
9
|
+
var reactQuery = require('@tanstack/react-query');
|
|
11
10
|
var MaterialExternalIframe = require('./MaterialExternalIframe.js');
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var MaterialExternalContent = function MaterialExternalContent(_ref) {
|
|
12
|
+
//
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
var MaterialExternalAdminContent = function MaterialExternalAdminContent(_ref) {
|
|
18
16
|
var materialExternalId = _ref.materialExternalId,
|
|
19
17
|
userId = _ref.userId,
|
|
20
18
|
courseId = _ref.courseId;
|
|
21
19
|
var intl$1 = intl.useRawEliceIntl();
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return jsxRuntime.jsx(blocks.Spinner, {});
|
|
20
|
+
var _useQuery = reactQuery.useQuery({
|
|
21
|
+
queryKey: ['materialExternalAdminContent', materialExternalId, userId],
|
|
22
|
+
queryFn: function queryFn(_ref2) {
|
|
23
|
+
var signal = _ref2.signal;
|
|
24
|
+
return apiClient.getOrgMaterialExternalTutorExternalUrlGet({
|
|
25
|
+
materialExternalId: materialExternalId,
|
|
26
|
+
userId: userId
|
|
27
|
+
}, {
|
|
28
|
+
signal: signal
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
select: function select(data) {
|
|
32
|
+
return data.externalUrl;
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
externalUrl = _useQuery.data,
|
|
36
|
+
isLoading = _useQuery.isLoading,
|
|
37
|
+
isError = _useQuery.isError;
|
|
38
|
+
//
|
|
39
|
+
//
|
|
40
|
+
//
|
|
41
|
+
if (isLoading) {
|
|
42
|
+
return jsxRuntime.jsx(material.CircularProgress, {});
|
|
46
43
|
}
|
|
47
|
-
if (
|
|
48
|
-
return jsxRuntime.jsx(
|
|
49
|
-
role: "white",
|
|
44
|
+
if (isError || !externalUrl) {
|
|
45
|
+
return jsxRuntime.jsx(material.Typography, {
|
|
50
46
|
children: intl$1.formatMessage({
|
|
51
47
|
id: 'external.status.rejected'
|
|
52
48
|
})
|
|
@@ -62,4 +58,4 @@ var MaterialExternalContent = function MaterialExternalContent(_ref) {
|
|
|
62
58
|
});
|
|
63
59
|
};
|
|
64
60
|
|
|
65
|
-
exports.default =
|
|
61
|
+
exports.default = MaterialExternalAdminContent;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import type { MaterialExternalIframeSDKCommunicationProps } from './MaterialExternalIframe';
|
|
3
|
+
export interface MaterialExternalContentProps extends MaterialExternalIframeSDKCommunicationProps {
|
|
3
4
|
materialExternalId: number;
|
|
4
5
|
courseId?: number;
|
|
5
6
|
}
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var apiClient = require('@elice/api-client');
|
|
8
|
-
var blocks = require('@elice/blocks');
|
|
9
8
|
var intl = require('@elice/intl');
|
|
10
9
|
var materialSharedUtils = require('@elice/material-shared-utils');
|
|
11
10
|
var types = require('@elice/types');
|
|
11
|
+
var material = require('@mui/material');
|
|
12
12
|
var MaterialExternalIframe = require('./MaterialExternalIframe.js');
|
|
13
13
|
var MaterialExternalNewWindow = require('./MaterialExternalNewWindow.js');
|
|
14
14
|
var MaterialExternalNotSupported = require('./MaterialExternalNotSupported.js');
|
|
@@ -27,7 +27,11 @@ var LEGACY_RUNBOX_V2_URL_PATTERN = /^https?:\/\/api-runbox\.elice\.io/;
|
|
|
27
27
|
//
|
|
28
28
|
var MaterialExternalContent = function MaterialExternalContent(_ref) {
|
|
29
29
|
var materialExternalId = _ref.materialExternalId,
|
|
30
|
-
courseId = _ref.courseId
|
|
30
|
+
courseId = _ref.courseId,
|
|
31
|
+
hasNextLecturePage = _ref.hasNextLecturePage,
|
|
32
|
+
hasPreviousLecturePage = _ref.hasPreviousLecturePage,
|
|
33
|
+
onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
|
|
34
|
+
onNavigatePreviousLecturePage = _ref.onNavigatePreviousLecturePage;
|
|
31
35
|
var intl$1 = intl.useRawEliceIntl();
|
|
32
36
|
var _useMaterialFetch = materialSharedUtils.useMaterialFetch(types.enums.LectureMaterialType.External, React__default.default.useCallback(function (signal) {
|
|
33
37
|
return apiClient.getOrgMaterialExternalGet({
|
|
@@ -39,15 +43,14 @@ var MaterialExternalContent = function MaterialExternalContent(_ref) {
|
|
|
39
43
|
materialExternal = _useMaterialFetch.materialExternal,
|
|
40
44
|
externalGetStatus = _useMaterialFetch.status;
|
|
41
45
|
if (externalGetStatus === 'rejected') {
|
|
42
|
-
return jsxRuntime.jsx(
|
|
43
|
-
role: "white",
|
|
46
|
+
return jsxRuntime.jsx(material.Typography, {
|
|
44
47
|
children: intl$1.formatMessage({
|
|
45
48
|
id: 'external.status.rejected'
|
|
46
49
|
})
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
if (externalGetStatus === 'pending' || !materialExternal) {
|
|
50
|
-
return jsxRuntime.jsx(
|
|
53
|
+
return jsxRuntime.jsx(material.CircularProgress, {});
|
|
51
54
|
}
|
|
52
55
|
/**
|
|
53
56
|
*
|
|
@@ -57,7 +60,11 @@ var MaterialExternalContent = function MaterialExternalContent(_ref) {
|
|
|
57
60
|
case types.enums.MaterialExternalDisplayType.Iframe:
|
|
58
61
|
return jsxRuntime.jsx(MaterialExternalIframe.default, {
|
|
59
62
|
materialExternal: materialExternal,
|
|
60
|
-
courseId: courseId
|
|
63
|
+
courseId: courseId,
|
|
64
|
+
hasNextLecturePage: hasNextLecturePage,
|
|
65
|
+
hasPreviousLecturePage: hasPreviousLecturePage,
|
|
66
|
+
onNavigateNextLecturePage: onNavigateNextLecturePage,
|
|
67
|
+
onNavigatePreviousLecturePage: onNavigatePreviousLecturePage
|
|
61
68
|
});
|
|
62
69
|
case types.enums.MaterialExternalDisplayType.Redirect:
|
|
63
70
|
return jsxRuntime.jsx(MaterialExternalRedirect.default, {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GetOrgMaterialExternalGetResponses } from '@elice/types/es/typings/apis/orgMaterialExternal';
|
|
3
|
-
|
|
3
|
+
export interface MaterialExternalIframeSDKCommunicationProps {
|
|
4
|
+
hasPreviousLecturePage?: boolean;
|
|
5
|
+
hasNextLecturePage?: boolean;
|
|
6
|
+
onNavigatePreviousLecturePage?: () => void;
|
|
7
|
+
onNavigateNextLecturePage?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface MaterialExternalIframeProps extends MaterialExternalIframeSDKCommunicationProps {
|
|
4
10
|
materialExternal: Pick<GetOrgMaterialExternalGetResponses['materialExternal'], 'title' | 'externalUrl' | 'id'>;
|
|
5
11
|
courseId?: number;
|
|
6
|
-
}
|
|
12
|
+
}
|
|
13
|
+
declare const MaterialExternalIframe: React.FC<MaterialExternalIframeProps>;
|
|
7
14
|
export default MaterialExternalIframe;
|
|
@@ -2,19 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _styled = require('@emotion/styled/base');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var intl = require('@elice/intl');
|
|
8
|
-
var MaterialExternal_styled = require('./MaterialExternal.styled.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
11
|
|
|
12
|
+
var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
14
|
|
|
15
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
19
|
+
var ExternalIframe = /*#__PURE__*/_styled__default.default("iframe", {
|
|
20
|
+
target: "e1bq11yf0"
|
|
21
|
+
})("production" === "production" ? {
|
|
22
|
+
name: "1nxwo53",
|
|
23
|
+
styles: "width:100%;height:100%;border:0;background-color:#fff"
|
|
24
|
+
} : {
|
|
25
|
+
name: "1nxwo53",
|
|
26
|
+
styles: "width:100%;height:100%;border:0;background-color:#fff",
|
|
27
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
|
+
});
|
|
29
|
+
//
|
|
30
|
+
//
|
|
31
|
+
//
|
|
14
32
|
var MaterialExternalIframe = function MaterialExternalIframe(_ref) {
|
|
15
33
|
var materialExternal = _ref.materialExternal,
|
|
16
|
-
courseId = _ref.courseId
|
|
34
|
+
courseId = _ref.courseId,
|
|
35
|
+
_hasNextLecturePage = _ref.hasNextLecturePage,
|
|
36
|
+
_hasPreviousLecturePage = _ref.hasPreviousLecturePage,
|
|
37
|
+
_onNavigateNextLecturePage = _ref.onNavigateNextLecturePage,
|
|
38
|
+
_onNavigatePreviousLecturePage = _ref.onNavigatePreviousLecturePage;
|
|
17
39
|
var intl$1 = intl.useRawEliceIntl();
|
|
40
|
+
var iframeRef = React__default.default.useRef(null);
|
|
41
|
+
var hasPreviousLecturePage = React.useRef(_hasPreviousLecturePage);
|
|
42
|
+
hasPreviousLecturePage.current = _hasPreviousLecturePage;
|
|
43
|
+
var hasNextLecturePage = React.useRef(_hasNextLecturePage);
|
|
44
|
+
hasNextLecturePage.current = _hasNextLecturePage;
|
|
45
|
+
var onNavigatePreviousLecturePage = React.useRef(_onNavigatePreviousLecturePage);
|
|
46
|
+
onNavigatePreviousLecturePage.current = _onNavigatePreviousLecturePage;
|
|
47
|
+
var onNavigateNextLecturePage = React.useRef(_onNavigateNextLecturePage);
|
|
48
|
+
onNavigateNextLecturePage.current = _onNavigateNextLecturePage;
|
|
49
|
+
/**
|
|
50
|
+
* Material external URL.
|
|
51
|
+
*/
|
|
18
52
|
var materialExternalUrl = React__default.default.useMemo(function () {
|
|
19
53
|
var externalUrl = new URL(materialExternal.externalUrl);
|
|
20
54
|
externalUrl.searchParams.append('course_id', String(courseId !== null && courseId !== void 0 ? courseId : ''));
|
|
@@ -23,10 +57,59 @@ var MaterialExternalIframe = function MaterialExternalIframe(_ref) {
|
|
|
23
57
|
externalUrl.searchParams.append('locale', intl$1.locale);
|
|
24
58
|
return externalUrl.href;
|
|
25
59
|
}, [materialExternal.externalUrl, materialExternal.id, courseId, intl$1.locale]);
|
|
26
|
-
|
|
60
|
+
//
|
|
61
|
+
//
|
|
62
|
+
//
|
|
63
|
+
React__default.default.useEffect(function () {
|
|
64
|
+
var iframeEl = iframeRef.current;
|
|
65
|
+
if (!iframeEl) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
var __handle = function __handle(e) {
|
|
69
|
+
var _a, _b, _c;
|
|
70
|
+
if (e.data.from === 'eliceio-contents-sdk') {
|
|
71
|
+
switch (e.data.type) {
|
|
72
|
+
// navigation - prev
|
|
73
|
+
case 'navigate-prev':
|
|
74
|
+
{
|
|
75
|
+
(_a = onNavigatePreviousLecturePage.current) === null || _a === void 0 ? void 0 : _a.call(onNavigatePreviousLecturePage);
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
// navigation - next
|
|
79
|
+
case 'navigate-next':
|
|
80
|
+
{
|
|
81
|
+
(_b = onNavigateNextLecturePage.current) === null || _b === void 0 ? void 0 : _b.call(onNavigateNextLecturePage);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
// navigation - state-sync
|
|
85
|
+
case 'navigate-state-sync':
|
|
86
|
+
{
|
|
87
|
+
(_c = iframeEl.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage(Object.assign(Object.assign({}, e.data), {
|
|
88
|
+
from: 'elice-web',
|
|
89
|
+
type: 'navigate-state-sync',
|
|
90
|
+
payload: {
|
|
91
|
+
hasNextLecturePage: hasNextLecturePage.current,
|
|
92
|
+
hasPreviousLecturePage: hasPreviousLecturePage.current
|
|
93
|
+
}
|
|
94
|
+
}), '*');
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
window.addEventListener('message', __handle);
|
|
101
|
+
return function () {
|
|
102
|
+
window.removeEventListener('message', __handle);
|
|
103
|
+
};
|
|
104
|
+
}, []);
|
|
105
|
+
//
|
|
106
|
+
//
|
|
107
|
+
//
|
|
108
|
+
return jsxRuntime.jsx(ExternalIframe, {
|
|
27
109
|
title: materialExternal.title,
|
|
28
110
|
src: materialExternalUrl,
|
|
29
|
-
allow: "clipboard-read; clipboard-write; camera *; microphone *; bluetooth *; fullscreen;"
|
|
111
|
+
allow: "clipboard-read; clipboard-write; camera *; microphone *; bluetooth *; fullscreen;",
|
|
112
|
+
ref: iframeRef
|
|
30
113
|
});
|
|
31
114
|
};
|
|
32
115
|
|
|
@@ -5,15 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var blocks = require('@elice/blocks');
|
|
9
|
-
var designTokens = require('@elice/design-tokens');
|
|
10
8
|
var intl = require('@elice/intl');
|
|
9
|
+
var material = require('@mui/material');
|
|
11
10
|
var calendar = require('../../assets/calendar.png.js');
|
|
12
11
|
|
|
13
12
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
13
|
|
|
15
14
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
15
|
|
|
16
|
+
//
|
|
17
|
+
//
|
|
18
|
+
//
|
|
17
19
|
var MaterialExternalNewWindow = function MaterialExternalNewWindow(_ref) {
|
|
18
20
|
var materialExternal = _ref.materialExternal;
|
|
19
21
|
var intl$1 = intl.useRawEliceIntl();
|
|
@@ -36,53 +38,58 @@ var MaterialExternalNewWindow = function MaterialExternalNewWindow(_ref) {
|
|
|
36
38
|
/**
|
|
37
39
|
*
|
|
38
40
|
*/
|
|
39
|
-
var newTabReOpenContentPage = jsxRuntime.jsxs(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
41
|
+
var newTabReOpenContentPage = jsxRuntime.jsxs(material.Stack, {
|
|
42
|
+
gap: "2rem",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
children: [jsxRuntime.jsxs(material.Stack, {
|
|
45
|
+
gap: "1rem",
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
children: [jsxRuntime.jsx(material.Box, {
|
|
48
|
+
component: "img",
|
|
49
|
+
src: calendar.default,
|
|
50
|
+
alt: "newWindow",
|
|
51
|
+
sx: {
|
|
52
|
+
width: '8rem',
|
|
53
|
+
height: '6rem'
|
|
54
|
+
}
|
|
55
|
+
}), jsxRuntime.jsxs(material.Stack, {
|
|
56
|
+
gap: "0.25rem",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
59
|
+
variant: "h6",
|
|
60
|
+
color: "text.primary",
|
|
61
|
+
textAlign: "center",
|
|
62
|
+
children: intl$1.formatMessage({
|
|
63
|
+
id: 'external.newWindow.title'
|
|
64
|
+
})
|
|
65
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
66
|
+
variant: "body2",
|
|
67
|
+
color: "text.secondary",
|
|
68
|
+
textAlign: "center",
|
|
69
|
+
children: intl$1.formatMessage({
|
|
70
|
+
id: 'external.newWindow.description'
|
|
71
|
+
})
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
}), jsxRuntime.jsx(material.Button, {
|
|
65
75
|
size: "small",
|
|
66
76
|
onClick: function onClick() {
|
|
67
77
|
return window.open(materialExternal === null || materialExternal === void 0 ? void 0 : materialExternal.externalUrl);
|
|
68
78
|
},
|
|
69
|
-
children:
|
|
70
|
-
|
|
71
|
-
customStyles: {
|
|
72
|
-
color: designTokens.base.color.navy0
|
|
73
|
-
},
|
|
74
|
-
children: intl$1.formatMessage({
|
|
75
|
-
id: 'external.newWindow.button.label'
|
|
76
|
-
})
|
|
79
|
+
children: intl$1.formatMessage({
|
|
80
|
+
id: 'external.newWindow.button.label'
|
|
77
81
|
})
|
|
78
82
|
})]
|
|
79
83
|
});
|
|
80
84
|
/**
|
|
81
85
|
* Open new tab external page after 5 seconds.
|
|
82
86
|
*/
|
|
83
|
-
var waitExternalPage = jsxRuntime.jsxs(
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
var waitExternalPage = jsxRuntime.jsxs(material.Stack, {
|
|
88
|
+
gap: "0.5rem",
|
|
89
|
+
alignItems: "center",
|
|
90
|
+
children: [jsxRuntime.jsx(material.CircularProgress, {}), jsxRuntime.jsx(material.Typography, {
|
|
91
|
+
variant: "body2",
|
|
92
|
+
color: "text.secondary",
|
|
86
93
|
children: intl$1.formatMessage({
|
|
87
94
|
id: 'external.loader.newWindow.description'
|
|
88
95
|
})
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var designTokens = require('@elice/design-tokens');
|
|
7
6
|
var intl = require('@elice/intl');
|
|
8
7
|
var material = require('@mui/material');
|
|
9
8
|
var emptyDefault = require('../../assets/empty-default.png.js');
|
|
@@ -22,7 +21,7 @@ var MaterialExternalNotSupported = function MaterialExternalNotSupported() {
|
|
|
22
21
|
justifyContent: "center",
|
|
23
22
|
alignItems: "center",
|
|
24
23
|
padding: "2rem",
|
|
25
|
-
bgcolor:
|
|
24
|
+
bgcolor: "#fff",
|
|
26
25
|
gap: "2rem",
|
|
27
26
|
width: "100%",
|
|
28
27
|
height: "100%",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { GetOrgMaterialExternalGetResponses } from '@elice/types
|
|
2
|
+
import type { GetOrgMaterialExternalGetResponses } from '@elice/types';
|
|
3
3
|
declare const MaterialExternalRedirect: React.FC<GetOrgMaterialExternalGetResponses>;
|
|
4
4
|
export default MaterialExternalRedirect;
|