@cqsjjb/course-res-design 0.1.0-beta.10 → 0.1.0-beta.12

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/Designable.d.ts CHANGED
@@ -36,6 +36,10 @@ export interface DesignableProps {
36
36
  apiBaseName?: 'res' | 'courseScd';
37
37
  [key: string]: any;
38
38
  };
39
+ // 入口类型
40
+ entry?: 'res' | 'reslib-app';
41
+ // 资源分类
42
+ sourceClassify?: ['PUBLIC' | 'PRIVATE'];
39
43
  /** 关闭事件回调 */
40
44
  onClose?: (data: DesignableCloseData) => void;
41
45
  /** iframe 的源地址,如果提供则优先级高于 host */
package/Designable.js CHANGED
@@ -9,12 +9,14 @@ export const Designable = ({
9
9
  data = {},
10
10
  onClose,
11
11
  src,
12
- visible = true
12
+ visible = true,
13
+ entry = 'res',
14
+ sourceClassify = ['PUBLIC', 'PRIVATE']
13
15
  }) => {
14
16
  const iframeRef = useRef(null);
15
17
 
16
18
  // 计算 iframe 的 src
17
- const iframeSrc = src || `${host}/res-design/setting`;
19
+ const iframeSrc = src || `${host}/res-design/setting?entry=${entry}&sourceClassify=${sourceClassify.join(',')}`;
18
20
 
19
21
  // 处理 iframe 加载完成
20
22
  const handleIframeLoad = () => {
package/Preview.d.ts CHANGED
@@ -83,6 +83,8 @@ export interface PreviewProps {
83
83
  enablePreview?: boolean;
84
84
  /** API基础名称,默认为 'res' */
85
85
  apiBaseName?: 'res' | 'courseScd';
86
+ /** 入口参数 */
87
+ entry?: 'res';
86
88
  }
87
89
 
88
90
  /**
package/Preview.js CHANGED
@@ -276,7 +276,7 @@ export default class FormPreview extends React.Component {
276
276
  }
277
277
  }, /*#__PURE__*/React.createElement(QRCode, {
278
278
  size: 180,
279
- value: `${getApiHost()}/res-design/previewH5?courseId=${courseInfo?.id || ''}`
279
+ value: `${getApiHost()}/res-design/previewH5?courseId=${courseInfo?.id || ''}&entry=${this.props.entry}`
280
280
  }))),
281
281
  trigger: "click",
282
282
  placement: "leftTop"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cqsjjb/course-res-design",
3
- "version": "0.1.0-beta.10",
3
+ "version": "0.1.0-beta.12",
4
4
  "description": "课程资源设计组件库",
5
5
  "main": "index.js",
6
6
  "author": "jiaoxiwei",