@elice/material-lms-public-content 1.220803.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # elice-material-lms-public-content
2
+
3
+ User view and editing components of Elice material LMS public content.
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface MaterialLmsPublicContentProps {
3
+ className?: string;
4
+ materialLmsPublicContentId: number;
5
+ }
6
+ declare const MaterialLmsPublicContent: React.FC<MaterialLmsPublicContentProps>;
7
+ export default MaterialLmsPublicContent;
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var apiClient = require('@elice/api-client');
5
+ var blocks = require('@elice/blocks');
6
+ var materialSharedUtils = require('@elice/material-shared-utils');
7
+ var classnames = require('classnames');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+ var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
13
+
14
+ const MaterialLmsPublicContent = ({
15
+ className,
16
+ materialLmsPublicContentId
17
+ }) => {
18
+ const prefixCls = 'em-material-lms-public-content';
19
+ const [materialLmsPublicContent, materialLmsPublicContentStatus] = materialSharedUtils.useMaterialInitFetch(apiClient.config.init, React__default["default"].useCallback(signal => apiClient.getOrgMaterialLmsPublicContentGet({
20
+ materialLmsPublicContentId
21
+ }, {
22
+ signal
23
+ }), [materialLmsPublicContentId]));
24
+ /**
25
+ *
26
+ */
27
+
28
+ const renderContent = () => {
29
+ var _a, _b;
30
+
31
+ if (materialLmsPublicContentStatus === 'pending') {
32
+ return React__default["default"].createElement(blocks.Spinner, null);
33
+ }
34
+
35
+ return React__default["default"].createElement("iframe", {
36
+ title: (_a = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _a === void 0 ? void 0 : _a.title,
37
+ width: "100%",
38
+ height: "100%",
39
+ style: {
40
+ border: 0
41
+ },
42
+ src: (_b = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _b === void 0 ? void 0 : _b.url
43
+ });
44
+ }; //
45
+ //
46
+ //
47
+
48
+
49
+ return React__default["default"].createElement(blocks.Flex, {
50
+ width: "100%",
51
+ height: "100%",
52
+ align: "center",
53
+ justify: "center",
54
+ className: classnames__default["default"](prefixCls, className)
55
+ }, renderContent());
56
+ };
57
+
58
+ module.exports = MaterialLmsPublicContent;
@@ -0,0 +1,2 @@
1
+ export { default as MaterialLmsPublicContent } from './MaterialLmsPublicContent';
2
+ export type { MaterialLmsPublicContentProps } from './MaterialLmsPublicContent';
package/cjs/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './components/material-lms-public-content';
package/cjs/index.js ADDED
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var MaterialLmsPublicContent = require('./components/material-lms-public-content/MaterialLmsPublicContent.js');
6
+
7
+
8
+
9
+ exports.MaterialLmsPublicContent = MaterialLmsPublicContent;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface MaterialLmsPublicContentProps {
3
+ className?: string;
4
+ materialLmsPublicContentId: number;
5
+ }
6
+ declare const MaterialLmsPublicContent: React.FC<MaterialLmsPublicContentProps>;
7
+ export default MaterialLmsPublicContent;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { config, getOrgMaterialLmsPublicContentGet } from '@elice/api-client';
3
+ import { Flex, Spinner } from '@elice/blocks';
4
+ import { useMaterialInitFetch } from '@elice/material-shared-utils';
5
+ import classnames from 'classnames';
6
+
7
+ const MaterialLmsPublicContent = ({
8
+ className,
9
+ materialLmsPublicContentId
10
+ }) => {
11
+ const prefixCls = 'em-material-lms-public-content';
12
+ const [materialLmsPublicContent, materialLmsPublicContentStatus] = useMaterialInitFetch(config.init, React.useCallback(signal => getOrgMaterialLmsPublicContentGet({
13
+ materialLmsPublicContentId
14
+ }, {
15
+ signal
16
+ }), [materialLmsPublicContentId]));
17
+ /**
18
+ *
19
+ */
20
+
21
+ const renderContent = () => {
22
+ var _a, _b;
23
+
24
+ if (materialLmsPublicContentStatus === 'pending') {
25
+ return React.createElement(Spinner, null);
26
+ }
27
+
28
+ return React.createElement("iframe", {
29
+ title: (_a = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _a === void 0 ? void 0 : _a.title,
30
+ width: "100%",
31
+ height: "100%",
32
+ style: {
33
+ border: 0
34
+ },
35
+ src: (_b = materialLmsPublicContent === null || materialLmsPublicContent === void 0 ? void 0 : materialLmsPublicContent.materialLmsPublicContent) === null || _b === void 0 ? void 0 : _b.url
36
+ });
37
+ }; //
38
+ //
39
+ //
40
+
41
+
42
+ return React.createElement(Flex, {
43
+ width: "100%",
44
+ height: "100%",
45
+ align: "center",
46
+ justify: "center",
47
+ className: classnames(prefixCls, className)
48
+ }, renderContent());
49
+ };
50
+
51
+ export { MaterialLmsPublicContent as default };
@@ -0,0 +1,2 @@
1
+ export { default as MaterialLmsPublicContent } from './MaterialLmsPublicContent';
2
+ export type { MaterialLmsPublicContentProps } from './MaterialLmsPublicContent';
package/es/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './components/material-lms-public-content';
package/es/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default as MaterialLmsPublicContent } from './components/material-lms-public-content/MaterialLmsPublicContent.js';
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@elice/material-lms-public-content",
3
+ "version": "1.220803.0",
4
+ "description": "User view and editing components of Elice material LMS public content",
5
+ "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
+ "license": "UNLICENSED",
7
+ "main": "./cjs/index.js",
8
+ "module": "./es/index.js",
9
+ "types": "./es/index.d.ts",
10
+ "files": [
11
+ "es",
12
+ "cjs",
13
+ "package.json",
14
+ "README.md"
15
+ ],
16
+ "sideEffects": false,
17
+ "engines": {
18
+ "node": "~16.14",
19
+ "yarn": ">=1.20 <2"
20
+ },
21
+ "scripts": {
22
+ "start": "run-s watch",
23
+ "prebuild": "run-s clean",
24
+ "build": "run-p build:es build:cjs",
25
+ "build:es": "rollup -c ../../rollup.config.ts -f es",
26
+ "build:cjs": "rollup -c ../../rollup.config.ts -f cjs",
27
+ "watch": "rollup -c ../../rollup.config.ts -f es -w",
28
+ "lint": "eslint --ext .ts,.tsx ./src --max-warnings=0",
29
+ "clean": "del-cli \"es/*\" \"cjs/*\" \"dist/*\""
30
+ },
31
+ "peerDependencies": {
32
+ "@elice/api-client": "^1.220802.1",
33
+ "@elice/blocks": "^1.220803.0",
34
+ "@elice/design-tokens": "^1.220803.0",
35
+ "@elice/icons": "^1.220803.0",
36
+ "@elice/markdown": "^1.220803.0",
37
+ "@elice/material-shared-types": "22.7.2-1",
38
+ "@elice/material-shared-utils": "22.7.2-1",
39
+ "@elice/types": "^1.220802.1",
40
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
41
+ "react-intl": "^5.0.0",
42
+ "react-use": "^17.0.0",
43
+ "styled-components": "^5.2.0"
44
+ },
45
+ "dependencies": {
46
+ "classnames": "^2.2.0",
47
+ "tslib": "^2.3.1"
48
+ },
49
+ "devDependencies": {
50
+ "@elice/api-client": "^1.220802.1",
51
+ "@elice/blocks": "^1.220803.0",
52
+ "@elice/design-tokens": "^1.220803.0",
53
+ "@elice/icons": "^1.220803.0",
54
+ "@elice/icons-legacy": "npm:@elice/icons@0.220803.1",
55
+ "@elice/markdown": "^1.220803.0",
56
+ "@elice/material-shared-types": "1.220803.0",
57
+ "@elice/material-shared-utils": "1.220803.0",
58
+ "@elice/types": "^1.220802.1",
59
+ "@types/classnames": "^2.3.1",
60
+ "@types/react": "~17.0.9",
61
+ "@types/styled-components": "^5.1.21",
62
+ "react": "^17.0.2",
63
+ "react-intl": "^5.20.10",
64
+ "react-use": "^17.2.4",
65
+ "styled-components": "^5.3.0"
66
+ },
67
+ "gitHead": "21c6b42ae6550e7899c57bf39fa78cea0f47e64c"
68
+ }