@luck-design-biz/luckda 1.0.2-6 → 1.0.2-7

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.
@@ -3,6 +3,7 @@ import React, { useRef, useState } from 'react';
3
3
  import { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';
4
4
  import { Button } from 'luck-design/antd';
5
5
  import { LuckModal, SplitPane } from 'luck-design';
6
+ import { isNil } from 'lodash';
6
7
  import { formatMessage } from '@luck-design-biz/base/utils';
7
8
  import RuntimeComp from "../../view/lc-components/JSX/RuntimeComp";
8
9
  import JSEditor from "../components/code-editor/JSEditor";
@@ -35,7 +36,11 @@ var _JSEditor = function _JSEditor(_ref) {
35
36
  hasErrorOn = _useBoolean4$.setTrue,
36
37
  hasErrorOff = _useBoolean4$.setFalse;
37
38
  var handleErrorCatch = useMemoizedFn(function (error) {
38
- console.log(12121212, error);
39
+ if (isNil(error)) {
40
+ hasErrorOff();
41
+ } else {
42
+ hasErrorOn();
43
+ }
39
44
  });
40
45
  return /*#__PURE__*/React.createElement(React.Fragment, null, children || /*#__PURE__*/React.createElement(Button, {
41
46
  block: true,
@@ -58,8 +63,8 @@ var _JSEditor = function _JSEditor(_ref) {
58
63
  fullScreen: true,
59
64
  mask: false,
60
65
  maskClosable: false,
61
- closable: false,
62
66
  visible: visible,
67
+ footer: null,
63
68
  onClose: hidden
64
69
  }, /*#__PURE__*/React.createElement(SplitPane, {
65
70
  split: "vertical"
@@ -1 +1 @@
1
- {"version":3,"names":["React","useRef","useState","useBoolean","useDebounceFn","useMemoizedFn","Button","LuckModal","SplitPane","formatMessage","RuntimeComp","JSEditor","_JSEditor","_ref","defaultValue","defaultCode","onChange","children","editorRef","_useState","_useState2","_slicedToArray","code","setCode","_useDebounceFn","_code","wait","run","_useBoolean","_useBoolean2","visible","_useBoolean2$","show","setTrue","hidden","setFalse","_useBoolean3","_useBoolean4","hasError","_useBoolean4$","hasErrorOn","hasErrorOff","handleErrorCatch","error","console","log","createElement","Fragment","block","size","onClick","style","margin","width","id","label","title","height","fullScreen","mask","maskClosable","closable","onClose","split","Pane","ref","minSize","onErrorCatch"],"sources":["../../../../luckda/lowcode/painter/panel-section/JSEditor.jsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';\nimport { Button } from 'luck-design/antd';\nimport { LuckModal, SplitPane } from 'luck-design';\nimport { formatMessage } from '@luck-design-biz/base/utils';\nimport RuntimeComp from '../../view/lc-components/JSX/RuntimeComp';\nimport JSEditor from '../components/code-editor/JSEditor';\n\nconst _JSEditor = ({ defaultValue, defaultCode, onChange, children }) => {\n const editorRef = useRef();\n const [code, setCode] = useState(defaultValue || defaultCode);\n const { run } = useDebounceFn(\n (_code) => {\n setCode(_code);\n },\n { wait: 500 },\n );\n const [visible, { setTrue: show, setFalse: hidden }] = useBoolean(false);\n const [hasError, { setTrue: hasErrorOn, setFalse: hasErrorOff }] = useBoolean(false);\n\n const handleErrorCatch = useMemoizedFn((error) => {\n console.log(12121212, error);\n });\n\n return (\n <>\n {children || (\n <Button\n block\n size=\"small\"\n onClick={show}\n style={{ margin: '0 8px', width: 'calc(100% - 16px)' }}\n >\n {formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n </Button>\n )}\n <LuckModal\n title={formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n width=\"80vw\"\n height=\"80vh\"\n fullScreen\n mask={false}\n maskClosable={false}\n closable={false}\n visible={visible}\n onClose={hidden}\n >\n <SplitPane split=\"vertical\">\n <SplitPane.Pane>\n <JSEditor ref={editorRef} onChange={run}>\n {defaultValue || defaultCode}\n </JSEditor>\n </SplitPane.Pane>\n <SplitPane.Pane minSize=\"400px\">\n <RuntimeComp onErrorCatch={handleErrorCatch}>{code}</RuntimeComp>\n </SplitPane.Pane>\n </SplitPane>\n </LuckModal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C,WACT,CACI,CAAC,eACjBf,KAAA,CAAA8C,aAAA,CAACtC,SAAS,CAACwD,IAAI;IAACE,OAAO,EAAC;EAAO,gBAC7BlE,KAAA,CAAA8C,aAAA,CAACpC,WAAW;IAACyD,YAAY,EAAEzB;EAAiB,GAAEpB,IAAkB,CAClD,CACP,CACF,CACX,CAAC;AAEP,CAAC;AAED,eAAeV,SAAS"}
1
+ {"version":3,"names":["React","useRef","useState","useBoolean","useDebounceFn","useMemoizedFn","Button","LuckModal","SplitPane","isNil","formatMessage","RuntimeComp","JSEditor","_JSEditor","_ref","defaultValue","defaultCode","onChange","children","editorRef","_useState","_useState2","_slicedToArray","code","setCode","_useDebounceFn","_code","wait","run","_useBoolean","_useBoolean2","visible","_useBoolean2$","show","setTrue","hidden","setFalse","_useBoolean3","_useBoolean4","hasError","_useBoolean4$","hasErrorOn","hasErrorOff","handleErrorCatch","error","createElement","Fragment","block","size","onClick","style","margin","width","id","label","title","height","fullScreen","mask","maskClosable","footer","onClose","split","Pane","ref","minSize","onErrorCatch"],"sources":["../../../../luckda/lowcode/painter/panel-section/JSEditor.jsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';\nimport { Button } from 'luck-design/antd';\nimport { LuckModal, SplitPane } from 'luck-design';\nimport { isNil } from 'lodash';\nimport { formatMessage } from '@luck-design-biz/base/utils';\nimport RuntimeComp from '../../view/lc-components/JSX/RuntimeComp';\nimport JSEditor from '../components/code-editor/JSEditor';\n\nconst _JSEditor = ({ defaultValue, defaultCode, onChange, children }) => {\n const editorRef = useRef();\n const [code, setCode] = useState(defaultValue || defaultCode);\n const { run } = useDebounceFn(\n (_code) => {\n setCode(_code);\n },\n { wait: 500 },\n );\n const [visible, { setTrue: show, setFalse: hidden }] = useBoolean(false);\n const [hasError, { setTrue: hasErrorOn, setFalse: hasErrorOff }] = useBoolean(false);\n\n const handleErrorCatch = useMemoizedFn((error) => {\n if (isNil(error)) {\n hasErrorOff();\n } else {\n hasErrorOn();\n }\n });\n\n return (\n <>\n {children || (\n <Button\n block\n size=\"small\"\n onClick={show}\n style={{ margin: '0 8px', width: 'calc(100% - 16px)' }}\n >\n {formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n </Button>\n )}\n <LuckModal\n title={formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n width=\"80vw\"\n height=\"80vh\"\n fullScreen\n mask={false}\n maskClosable={false}\n visible={visible}\n footer={null}\n onClose={hidden}\n >\n <SplitPane split=\"vertical\">\n <SplitPane.Pane>\n <JSEditor ref={editorRef} onChange={run}>\n {defaultValue || defaultCode}\n </JSEditor>\n </SplitPane.Pane>\n <SplitPane.Pane minSize=\"400px\">\n <RuntimeComp onErrorCatch={handleErrorCatch}>{code}</RuntimeComp>\n </SplitPane.Pane>\n </SplitPane>\n </LuckModal>\n </>\n );\n};\n\nexport default _JSEditor;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/C,SAASC,UAAU,EAAEC,aAAa,EAAEC,aAAa,QAAQ,QAAQ;AACjE,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,SAAS,EAAEC,SAAS,QAAQ,aAAa;AAClD,SAASC,KAAK,QAAQ,QAAQ;AAC9B,SAASC,aAAa,QAAQ,6BAA6B;AAC3D,OAAOC,WAAW;AAClB,OAAOC,QAAQ;AAEf,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAA0D;EAAA,IAApDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;EAChE,IAAMC,SAAS,GAAGlB,MAAM,CAAC,CAAC;EAC1B,IAAAm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AK,EAAE;IAAoB;EAAE,GAEtD1C,aAAa,CAAC;IACb2C,EAAE,EAAE,6DAA6D;IACjEC,KAAK,EAAE;EACT,CAAC,CACK,CACT,eACDtD,KAAA,CAAA6C,aAAA,CAACtC,SAAS;IACRgD,KAAK,EAAE7C,aAAa,CAAC;MACnB2C,EAAE,EAAE,6DAA6D;MACjEC,KAAK,EAAE;IACT,CAAC,CAAE;IACHF,KAAK,EAAC,MAAM;IACZI,MAAM,EAAC,MAAM;IACbC,UAAU;IACVC,IAAI,EAAE,KAAM;IACZC,YAAY,EAAE,KAAM;IACpB5B,OAAO,EAAEA,OAAQ;IACjB6B,MAAM,EAAE,IAAK;IACbC,OAAO,EAAE1B;EAAO,gBAEhBnC,KAAA,CAAA6C,aAAA,CAACrC,SAAS;IAACsD,KAAK,EAAC;EAAU,gBACzB9D,KAAA,CAAA6C,aAAA,CAACrC,SAAS,CAACuD,IAAI,qBACb/D,KAAA,CAAA6C,aAAA,CAACjC,QAAQ;IAACoD,GAAG,EAAE7C,SAAU;IAACF,QAAQ,EAAEW;EAAI,GACrCb,YAAY,IAAIC,WACT,CACI,CAAC,eACjBhB,KAAA,CAAA6C,aAAA,CAACrC,SAAS,CAACuD,IAAI;IAACE,OAAO,EAAC;EAAO,gBAC7BjE,KAAA,CAAA6C,aAAA,CAAClC,WAAW;IAACuD,YAAY,EAAEvB;EAAiB,GAAEpB,IAAkB,CAClD,CACP,CACF,CACX,CAAC;AAEP,CAAC;AAED,eAAeV,SAAS"}
@@ -31,9 +31,9 @@ var ErrorBoundary = /*#__PURE__*/function (_PureComponent) {
31
31
  return _this;
32
32
  }
33
33
  _createClass(ErrorBoundary, [{
34
- key: "componentDidUpdate",
35
- value: function componentDidUpdate(prevProps) {
36
- if (this.props.children !== prevProps.children && this.state.hasError) {
34
+ key: "componentWillReceiveProps",
35
+ value: function componentWillReceiveProps(nextProps) {
36
+ if (nextProps.children !== this.props.children && this.state.hasError) {
37
37
  var _this$props$onErrorCa, _this$props;
38
38
  // 重置 hasError 为 false 以便重新渲染子组件
39
39
  (_this$props$onErrorCa = (_this$props = this.props).onErrorCatch) === null || _this$props$onErrorCa === void 0 || _this$props$onErrorCa.call(_this$props);
@@ -1 +1 @@
1
- {"version":3,"names":["React","PureComponent","styled","Wrapper","div","withConfig","displayName","componentId","Title","h3","Content","p","ErrorBoundary","_PureComponent","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","state","hasError","error","errorInfo","_createClass","key","value","componentDidUpdate","prevProps","children","_this$props$onErrorCa","_this$props","onErrorCatch","setState","componentDidCatch","_this$props$onErrorCa2","_this$props2","console","componentStack","render","createElement","dangerouslySetInnerHTML","__html"],"sources":["../../../luckda/lowcode/view/ErrorBoundary.jsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport styled from 'styled-components';\n\nconst Wrapper = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\nconst Title = styled.h3`\n white-space: pre-line;\n color: var(--luck-color-danger);\n fontSize: 1.5rem;\n`;\nconst Content = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\nclass ErrorBoundary extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: '',\n errorInfo: '',\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.children !== prevProps.children && this.state.hasError) {\n // 重置 hasError 为 false 以便重新渲染子组件\n this.props.onErrorCatch?.();\n this.setState({ hasError: false, error: '', errorInfo: '' });\n }\n }\n\n componentDidCatch(error, errorInfo) {\n // 在此处记录错误信息\n console.error(error);\n this.props.onErrorCatch?.(error, errorInfo);\n this.setState({ hasError: true, error, errorInfo: errorInfo?.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n // 如果有错误,显示备用 UI\n return (\n <Wrapper>\n <Title dangerouslySetInnerHTML={{ __html: this.state.error }} />\n <Content dangerouslySetInnerHTML={{ __html: this.state.errorInfo }} />\n </Wrapper>\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"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C,SAAS,EAAE;QAAG,CAAC,CAAC;MAC9D;IACF;EAAC;IAAAE,GAAA;IAAAC,KAAA,EAED,SAAAQ,kBAAkBZ,KAAK,EAAEC,SAAS,EAAE;MAAA,IAAAY,sBAAA,EAAAC,YAAA;MAClC;MACAC,OAAO,CAACf,KAAK,CAACA,KAAK,CAAC;MACpB,CAAAa,sBAAA,IAAAC,YAAA,OAAI,CAACpB,KAAK,EAACgB,YAAY,cAAAG,sBAAA,eAAvBA,sBAAA,CAAAhB,IAAA,CAAAiB,YAAA,EAA0Bd,KAAK,EAAEC,SAAS,CAAC;MAC3C,IAAI,CAACU,QAAQ,CAAC;QAAEZ,QAAQ,EAAE,IAAI;QAAEC,KAAK,EAALA,KAAK;QAAEC,SAAS,EAAEA,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEe;MAAe,CAAC,CAAC;IAChF;EAAC;IAAAb,GAAA;IAAAC,KAAA,EAED,SAAAa,OAAA,EAAS;MACP,IAAI,IAAI,CAACnB,KAAK,CAACC,QAAQ,EAAE;QACvB;QACA,oBACEtB,KAAA,CAAAyC,aAAA,CAACtC,OAAO,qBACNH,KAAA,CAAAyC,aAAA,CAACjC,KAAK;UAACkC,uBAAuB,EAAE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACE;UAAM;QAAE,CAAE,CAAC,eAChEvB,KAAA,CAAAyC,aAAA,CAAC/B,OAAO;UAACgC,uBAAuB,EAAE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACG;UAAU;QAAE,CAAE,CAC9D,CAAC;MAEd;MAEA,OAAO,IAAI,CAACP,KAAK,CAACa,QAAQ;IAC5B;EAAC;EAAA,OAAAlB,aAAA;AAAA,EArCyBX,aAAa;AAwCzC,eAAeW,aAAa"}
1
+ {"version":3,"names":["React","PureComponent","styled","Wrapper","div","withConfig","displayName","componentId","Title","h3","Content","p","ErrorBoundary","_PureComponent","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","state","hasError","error","errorInfo","_createClass","key","value","componentWillReceiveProps","nextProps","children","_this$props$onErrorCa","_this$props","onErrorCatch","setState","componentDidCatch","_this$props$onErrorCa2","_this$props2","console","componentStack","render","createElement","dangerouslySetInnerHTML","__html"],"sources":["../../../luckda/lowcode/view/ErrorBoundary.jsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport styled from 'styled-components';\n\nconst Wrapper = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\nconst Title = styled.h3`\n white-space: pre-line;\n color: var(--luck-color-danger);\n fontSize: 1.5rem;\n`;\nconst Content = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\nclass ErrorBoundary extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: '',\n errorInfo: '',\n };\n }\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.children !== this.props.children && this.state.hasError) {\n // 重置 hasError 为 false 以便重新渲染子组件\n this.props.onErrorCatch?.();\n this.setState({ hasError: false, error: '', errorInfo: '' });\n }\n }\n \n componentDidCatch(error, errorInfo) {\n // 在此处记录错误信息\n console.error(error);\n this.props.onErrorCatch?.(error, errorInfo);\n this.setState({ hasError: true, error, errorInfo: errorInfo?.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n // 如果有错误,显示备用 UI\n return (\n <Wrapper>\n <Title dangerouslySetInnerHTML={{ __html: this.state.error }} />\n <Content dangerouslySetInnerHTML={{ __html: this.state.errorInfo }} />\n </Wrapper>\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,IAAMC,OAAO,GAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6CAIzB;AACD,IAAMC,KAAK,GAAGN,MAAM,CAACO,EAAE,CAAAJ,UAAA;EAAAC,WAAA;EAAAC,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,cAAAG,sBAAA,eAAvBA,sBAAA,CAAAhB,IAAA,CAAAiB,YAAA,EAA0Bd,KAAK,EAAEC,SAAS,CAAC;MAC3C,IAAI,CAACU,QAAQ,CAAC;QAAEZ,QAAQ,EAAE,IAAI;QAAEC,KAAK,EAALA,KAAK;QAAEC,SAAS,EAAEA,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEe;MAAe,CAAC,CAAC;IAChF;EAAC;IAAAb,GAAA;IAAAC,KAAA,EAED,SAAAa,OAAA,EAAS;MACP,IAAI,IAAI,CAACnB,KAAK,CAACC,QAAQ,EAAE;QACvB;QACA,oBACEtB,KAAA,CAAAyC,aAAA,CAACtC,OAAO,qBACNH,KAAA,CAAAyC,aAAA,CAACjC,KAAK;UAACkC,uBAAuB,EAAE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACE;UAAM;QAAE,CAAE,CAAC,eAChEvB,KAAA,CAAAyC,aAAA,CAAC/B,OAAO;UAACgC,uBAAuB,EAAE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACG;UAAU;QAAE,CAAE,CAC9D,CAAC;MAEd;MAEA,OAAO,IAAI,CAACP,KAAK,CAACa,QAAQ;IAC5B;EAAC;EAAA,OAAAlB,aAAA;AAAA,EArCyBX,aAAa;AAwCzC,eAAeW,aAAa"}
@@ -46,6 +46,7 @@ var RuntimeCom = function RuntimeCom(_ref) {
46
46
  }
47
47
  return Fragment;
48
48
  } catch (e) {
49
+ onErrorCatch === null || onErrorCatch === void 0 || onErrorCatch(e);
49
50
  return function () {
50
51
  return /*#__PURE__*/React.createElement(ErrorContent, null, e.message);
51
52
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","Fragment","Babel","LuckAntd","LuckDesign","AHooks","styled","keys","useContext","executeCode","ErrorBoundary","ErrorContent","p","withConfig","displayName","componentId","RuntimeCom","_ref","children","onErrorCatch","rest","_objectWithoutProperties","_excluded","ctx","Component","useCreation","code","Children","toArray","join","trim","transformedCode","transform","presets","functionNameMatch","match","length","functionName","argsName","_args","map","n","apply","concat","_toConsumableArray","_objectSpread","e","createElement","message"],"sources":["../../../../../luckda/lowcode/view/lc-components/JSX/RuntimeComp.jsx"],"sourcesContent":["import React, { Fragment } from 'react';\nimport * as Babel from '@babel/standalone';\nimport * as LuckAntd from 'luck-design/antd';\nimport * as LuckDesign from 'luck-design';\nimport * as AHooks from 'ahooks';\nimport styled from 'styled-components';\nimport { keys } from 'lodash';\nimport { useContext } from '../../../engine/provider/ContextProvider';\nimport { executeCode } from '../../../engine/tools/helper';\nimport ErrorBoundary from '../../ErrorBoundary';\n\nconst ErrorContent = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\n/**\n * 实时代码渲染组件\n * todo:沙箱上下文的集成\n * todo:Loading效果的优化\n */\nconst RuntimeCom = ({ children, onErrorCatch, ...rest }) => {\n const ctx = useContext();\n\n const Component = AHooks.useCreation(() => {\n const code = React.Children.toArray(children).join('').trim();\n if (!code) return Fragment;\n\n try {\n // 使用Babel转换代码\n const transformedCode = Babel.transform(code, {\n presets: ['react'],\n }).code;\n const functionNameMatch = transformedCode.match(/function\\s+([^\\s(]+)/);\n if (functionNameMatch && functionNameMatch.length > 1) {\n const functionName = functionNameMatch[1];\n const argsName = keys(rest);\n const _args = argsName.map((n) => rest[n]);\n return executeCode(\n ctx,\n `function() {${transformedCode}; return ${functionName};}`,\n ['React', 'Antd', 'Luckd', 'styled', 'libs', ...argsName],\n React,\n LuckAntd,\n LuckDesign,\n styled,\n { ...AHooks },\n ..._args,\n );\n }\n return Fragment;\n } catch (e) {\n return () => <ErrorContent>{e.message}</ErrorContent>;\n }\n }, [children]);\n\n return (\n <ErrorBoundary onErrorCatch={onErrorCatch}>\n <Component />\n </ErrorBoundary>\n );\n};\n\nexport default RuntimeCom;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAO,KAAKC,KAAK,MAAM,mBAAmB;AAC1C,OAAO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AC3B,IAAMmB,KAAK,GAAGD,QAAQ,CAACE,GAAG,CAAC,UAACC,CAAC;UAAA,OAAKrB,IAAI,CAACqB,CAAC,CAAC;QAAA,EAAC;QAC1C,OAAOhC,WAAW,CAAAiC,KAAA,UAChBnB,GAAG,iBAAAoB,MAAA,CACYZ,eAAe,eAAAY,MAAA,CAAYN,YAAY,UACrD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAAM,MAAA,CAAAC,kBAAA,CAAKN,QAAQ,IACxDtC,KAAK,EACLG,QAAQ,EACRC,UAAU,EACVE,MAAM,EAAAuC,aAAA,KACDxC,MAAM,GAAAsC,MAAA,CAAAC,kBAAA,CACRL,KAAK,EACV,CAAC;MACH;MACA,OAAOtC,QAAQ;IACjB,CAAC,CAAC,OAAO6C,CAAC,EAAE;MACV,OAAO;QAAA,oBAAM9C,KAAA,CAAA+C,aAAA,CAACpC,YAAY,QAAEmC,CAAC,CAACE,OAAsB,CAAC;MAAA;IACvD;EACF,CAAC,EAAE,CAAC9B,QAAQ,CAAC,CAAC;EAEd,oBACElB,KAAA,CAAA+C,aAAA,CAACrC,aAAa;IAACS,YAAY,EAAEA;EAAa,gBACxCnB,KAAA,CAAA+C,aAAA,CAACvB,SAAS,MAAE,CACC,CAAC;AAEpB,CAAC;AAED,eAAeR,UAAU"}
1
+ {"version":3,"names":["React","Fragment","Babel","LuckAntd","LuckDesign","AHooks","styled","keys","useContext","executeCode","ErrorBoundary","ErrorContent","p","withConfig","displayName","componentId","RuntimeCom","_ref","children","onErrorCatch","rest","_objectWithoutProperties","_excluded","ctx","Component","useCreation","code","Children","toArray","join","trim","transformedCode","transform","presets","functionNameMatch","match","length","functionName","argsName","_args","map","n","apply","concat","_toConsumableArray","_objectSpread","e","createElement","message"],"sources":["../../../../../luckda/lowcode/view/lc-components/JSX/RuntimeComp.jsx"],"sourcesContent":["import React, { Fragment } from 'react';\nimport * as Babel from '@babel/standalone';\nimport * as LuckAntd from 'luck-design/antd';\nimport * as LuckDesign from 'luck-design';\nimport * as AHooks from 'ahooks';\nimport styled from 'styled-components';\nimport { keys } from 'lodash';\nimport { useContext } from '../../../engine/provider/ContextProvider';\nimport { executeCode } from '../../../engine/tools/helper';\nimport ErrorBoundary from '../../ErrorBoundary';\n\nconst ErrorContent = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\n/**\n * 实时代码渲染组件\n * todo:沙箱上下文的集成\n * todo:Loading效果的优化\n */\nconst RuntimeCom = ({ children, onErrorCatch, ...rest }) => {\n const ctx = useContext();\n\n const Component = AHooks.useCreation(() => {\n const code = React.Children.toArray(children).join('').trim();\n if (!code) return Fragment;\n\n try {\n // 使用Babel转换代码\n const transformedCode = Babel.transform(code, {\n presets: ['react'],\n }).code;\n const functionNameMatch = transformedCode.match(/function\\s+([^\\s(]+)/);\n if (functionNameMatch && functionNameMatch.length > 1) {\n const functionName = functionNameMatch[1];\n const argsName = keys(rest);\n const _args = argsName.map((n) => rest[n]);\n return executeCode(\n ctx,\n `function() {${transformedCode}; return ${functionName};}`,\n ['React', 'Antd', 'Luckd', 'styled', 'libs', ...argsName],\n React,\n LuckAntd,\n LuckDesign,\n styled,\n { ...AHooks },\n ..._args,\n );\n }\n return Fragment;\n } catch (e) {\n onErrorCatch?.(e);\n return () => <ErrorContent>{e.message}</ErrorContent>;\n }\n }, [children]);\n\n return (\n <ErrorBoundary onErrorCatch={onErrorCatch}>\n <Component />\n </ErrorBoundary>\n );\n};\n\nexport default RuntimeCom;\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAO,KAAKC,KAAK,MAAM,mBAAmB;AAC1C,OAAO,KAAKC,QAAQ,MAAM,kBAAkB;AAC5C,OAAO,KAAKC,UAAU,MAAM,aAAa;AACzC,OAAO,KAAKC,MAAM,MAAM,QAAQ;AAChC,OAAOC,MAAM,MAAM,mBAAmB;AACtC,SAASC,IAAI,QAAQ,QAAQ;AAC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MAAA,CACYZ,eAAe,eAAAY,MAAA,CAAYN,YAAY,UACrD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAAM,MAAA,CAAAC,kBAAA,CAAKN,QAAQ,IACxDtC,KAAK,EACLG,QAAQ,EACRC,UAAU,EACVE,MAAM,EAAAuC,aAAA,KACDxC,MAAM,GAAAsC,MAAA,CAAAC,kBAAA,CACRL,KAAK,EACV,CAAC;MACH;MACA,OAAOtC,QAAQ;IACjB,CAAC,CAAC,OAAO6C,CAAC,EAAE;MACV3B,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAG2B,CAAC,CAAC;MACjB,OAAO;QAAA,oBAAM9C,KAAA,CAAA+C,aAAA,CAACpC,YAAY,QAAEmC,CAAC,CAACE,OAAsB,CAAC;MAAA;IACvD;EACF,CAAC,EAAE,CAAC9B,QAAQ,CAAC,CAAC;EAEd,oBACElB,KAAA,CAAA+C,aAAA,CAACrC,aAAa;IAACS,YAAY,EAAEA;EAAa,gBACxCnB,KAAA,CAAA+C,aAAA,CAACvB,SAAS,MAAE,CACC,CAAC;AAEpB,CAAC;AAED,eAAeR,UAAU"}
@@ -11,6 +11,7 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var _ahooks = require("ahooks");
12
12
  var _antd = require("luck-design/antd");
13
13
  var _luckDesign = require("luck-design");
14
+ var _lodash = require("lodash");
14
15
  var _utils = require("@luck-design-biz/base/utils");
15
16
  var _RuntimeComp = _interopRequireDefault(require("../../view/lc-components/JSX/RuntimeComp"));
16
17
  var _JSEditor2 = _interopRequireDefault(require("../components/code-editor/JSEditor"));
@@ -43,7 +44,11 @@ var _JSEditor = function _JSEditor(_ref) {
43
44
  hasErrorOn = _useBoolean4$.setTrue,
44
45
  hasErrorOff = _useBoolean4$.setFalse;
45
46
  var handleErrorCatch = (0, _ahooks.useMemoizedFn)(function (error) {
46
- console.log(12121212, error);
47
+ if ((0, _lodash.isNil)(error)) {
48
+ hasErrorOff();
49
+ } else {
50
+ hasErrorOn();
51
+ }
47
52
  });
48
53
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children || /*#__PURE__*/_react.default.createElement(_antd.Button, {
49
54
  block: true,
@@ -66,8 +71,8 @@ var _JSEditor = function _JSEditor(_ref) {
66
71
  fullScreen: true,
67
72
  mask: false,
68
73
  maskClosable: false,
69
- closable: false,
70
74
  visible: visible,
75
+ footer: null,
71
76
  onClose: hidden
72
77
  }, /*#__PURE__*/_react.default.createElement(_luckDesign.SplitPane, {
73
78
  split: "vertical"
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_ahooks","_antd","_luckDesign","_utils","_RuntimeComp","_interopRequireDefault","_JSEditor2","_JSEditor","_ref","defaultValue","defaultCode","onChange","children","editorRef","useRef","_useState","useState","_useState2","_slicedToArray2","default","code","setCode","_useDebounceFn","useDebounceFn","_code","wait","run","_useBoolean","useBoolean","_useBoolean2","visible","_useBoolean2$","show","setTrue","hidden","setFalse","_useBoolean3","_useBoolean4","hasError","_useBoolean4$","hasErrorOn","hasErrorOff","handleErrorCatch","useMemoizedFn","error","console","log","createElement","Fragment","Button","block","size","onClick","style","margin","width","formatMessage","id","label","LuckModal","title","height","fullScreen","mask","maskClosable","closable","onClose","SplitPane","split","Pane","ref","minSize","onErrorCatch","_default","exports"],"sources":["../../../../luckda/lowcode/painter/panel-section/JSEditor.jsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';\nimport { Button } from 'luck-design/antd';\nimport { LuckModal, SplitPane } from 'luck-design';\nimport { formatMessage } from '@luck-design-biz/base/utils';\nimport RuntimeComp from '../../view/lc-components/JSX/RuntimeComp';\nimport JSEditor from '../components/code-editor/JSEditor';\n\nconst _JSEditor = ({ defaultValue, defaultCode, onChange, children }) => {\n const editorRef = useRef();\n const [code, setCode] = useState(defaultValue || defaultCode);\n const { run } = useDebounceFn(\n (_code) => {\n setCode(_code);\n },\n { wait: 500 },\n );\n const [visible, { setTrue: show, setFalse: hidden }] = useBoolean(false);\n const [hasError, { setTrue: hasErrorOn, setFalse: hasErrorOff }] = useBoolean(false);\n\n const handleErrorCatch = useMemoizedFn((error) => {\n console.log(12121212, error);\n });\n\n return (\n <>\n {children || (\n <Button\n block\n size=\"small\"\n onClick={show}\n style={{ margin: '0 8px', width: 'calc(100% - 16px)' }}\n >\n {formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n </Button>\n )}\n <LuckModal\n title={formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n width=\"80vw\"\n height=\"80vh\"\n fullScreen\n mask={false}\n maskClosable={false}\n closable={false}\n visible={visible}\n onClose={hidden}\n >\n <SplitPane split=\"vertical\">\n <SplitPane.Pane>\n <JSEditor ref={editorRef} onChange={run}>\n {defaultValue || defaultCode}\n </JSEditor>\n </SplitPane.Pane>\n <SplitPane.Pane minSize=\"400px\">\n <RuntimeComp onErrorCatch={handleErrorCatch}>{code}</RuntimeComp>\n </SplitPane.Pane>\n </SplitPane>\n </LuckModal>\n </>\n );\n};\n\nexport default _JSEditor;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,UAAA,GAAAD,sBAAA,CAAAN,OAAA;AAEA,IAAMQ,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAA0D;EAAA,IAApDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,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ACP,CACF,CACX,CAAC;AAEP,CAAC;AAAC,IAAAqD,QAAA,GAAAC,OAAA,CAAAvD,OAAA,GAEaZ,SAAS"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_ahooks","_antd","_luckDesign","_lodash","_utils","_RuntimeComp","_interopRequireDefault","_JSEditor2","_JSEditor","_ref","defaultValue","defaultCode","onChange","children","editorRef","useRef","_useState","useState","_useState2","_slicedToArray2","default","code","setCode","_useDebounceFn","useDebounceFn","_code","wait","run","_useBoolean","useBoolean","_useBoolean2","visible","_useBoolean2$","show","setTrue","hidden","setFalse","_useBoolean3","_useBoolean4","hasError","_useBoolean4$","hasErrorOn","hasErrorOff","handleErrorCatch","useMemoizedFn","error","isNil","createElement","Fragment","Button","block","size","onClick","style","margin","width","formatMessage","id","label","LuckModal","title","height","fullScreen","mask","maskClosable","footer","onClose","SplitPane","split","Pane","ref","minSize","onErrorCatch","_default","exports"],"sources":["../../../../luckda/lowcode/painter/panel-section/JSEditor.jsx"],"sourcesContent":["import React, { useRef, useState } from 'react';\nimport { useBoolean, useDebounceFn, useMemoizedFn } from 'ahooks';\nimport { Button } from 'luck-design/antd';\nimport { LuckModal, SplitPane } from 'luck-design';\nimport { isNil } from 'lodash';\nimport { formatMessage } from '@luck-design-biz/base/utils';\nimport RuntimeComp from '../../view/lc-components/JSX/RuntimeComp';\nimport JSEditor from '../components/code-editor/JSEditor';\n\nconst _JSEditor = ({ defaultValue, defaultCode, onChange, children }) => {\n const editorRef = useRef();\n const [code, setCode] = useState(defaultValue || defaultCode);\n const { run } = useDebounceFn(\n (_code) => {\n setCode(_code);\n },\n { wait: 500 },\n );\n const [visible, { setTrue: show, setFalse: hidden }] = useBoolean(false);\n const [hasError, { setTrue: hasErrorOn, setFalse: hasErrorOff }] = useBoolean(false);\n\n const handleErrorCatch = useMemoizedFn((error) => {\n if (isNil(error)) {\n hasErrorOff();\n } else {\n hasErrorOn();\n }\n });\n\n return (\n <>\n {children || (\n <Button\n block\n size=\"small\"\n onClick={show}\n style={{ margin: '0 8px', width: 'calc(100% - 16px)' }}\n >\n {formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n </Button>\n )}\n <LuckModal\n title={formatMessage({\n id: 'luckda.lowcode.painter.panel-section.style-panel.sourceedit',\n label: '源码编辑',\n })}\n width=\"80vw\"\n height=\"80vh\"\n fullScreen\n mask={false}\n maskClosable={false}\n visible={visible}\n footer={null}\n onClose={hidden}\n >\n <SplitPane split=\"vertical\">\n <SplitPane.Pane>\n <JSEditor ref={editorRef} onChange={run}>\n {defaultValue || defaultCode}\n </JSEditor>\n </SplitPane.Pane>\n <SplitPane.Pane minSize=\"400px\">\n <RuntimeComp onErrorCatch={handleErrorCatch}>{code}</RuntimeComp>\n </SplitPane.Pane>\n </SplitPane>\n </LuckModal>\n </>\n );\n};\n\nexport default _JSEditor;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAD,sBAAA,CAAAP,OAAA;AAEA,IAAMS,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAA0D;EAAA,IAApDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;EAChE,IAAMC,SAAS,GAAG,IAAAC,aAAM,EAAC,CAAC;EAC1B,IAAAC,SAAA,GAAwB,IAAAC,eAAQ,EAACP,YAAY,IAAIC,WAAW,CAAC;IAAAO,U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9 @@ var ErrorBoundary = /*#__PURE__*/function (_PureComponent) {
39
39
  return _this;
40
40
  }
41
41
  (0, _createClass2.default)(ErrorBoundary, [{
42
- key: "componentDidUpdate",
43
- value: function componentDidUpdate(prevProps) {
44
- if (this.props.children !== prevProps.children && this.state.hasError) {
42
+ key: "componentWillReceiveProps",
43
+ value: function componentWillReceiveProps(nextProps) {
44
+ if (nextProps.children !== this.props.children && this.state.hasError) {
45
45
  var _this$props$onErrorCa, _this$props;
46
46
  // 重置 hasError 为 false 以便重新渲染子组件
47
47
  (_this$props$onErrorCa = (_this$props = this.props).onErrorCatch) === null || _this$props$onErrorCa === void 0 || _this$props$onErrorCa.call(_this$props);
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","Wrapper","styled","div","withConfig","displayName","componentId","Title","h3","Content","p","ErrorBoundary","_PureComponent","_inherits2","default","_super","_createSuper2","props","_this","_classCallCheck2","call","state","hasError","error","errorInfo","_createClass2","key","value","componentDidUpdate","prevProps","children","_this$props$onErrorCa","_this$props","onErrorCatch","setState","componentDidCatch","_this$props$onErrorCa2","_this$props2","console","componentStack","render","createElement","dangerouslySetInnerHTML","__html","PureComponent","_default","exports"],"sources":["../../../luckda/lowcode/view/ErrorBoundary.jsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport styled from 'styled-components';\n\nconst Wrapper = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\nconst Title = styled.h3`\n white-space: pre-line;\n color: var(--luck-color-danger);\n fontSize: 1.5rem;\n`;\nconst Content = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\nclass ErrorBoundary extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: '',\n errorInfo: '',\n };\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.children !== prevProps.children && this.state.hasError) {\n // 重置 hasError 为 false 以便重新渲染子组件\n this.props.onErrorCatch?.();\n this.setState({ hasError: false, error: '', errorInfo: '' });\n }\n }\n\n componentDidCatch(error, errorInfo) {\n // 在此处记录错误信息\n console.error(error);\n this.props.onErrorCatch?.(error, errorInfo);\n this.setState({ hasError: true, error, errorInfo: errorInfo?.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n // 如果有错误,显示备用 UI\n return (\n <Wrapper>\n <Title dangerouslySetInnerHTML={{ __html: this.state.error }} />\n <Content dangerouslySetInnerHTML={{ __html: this.state.errorInfo }} />\n </Wrapper>\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,OAAO,GAAGC,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6CAIzB;AACD,IAAMC,KAAK,GAAGL,yBAAM,CAACM,EAAE,CAAAJ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4EAItB;AACD,IAAMG,OAAO,GAAGP,yBAAM,CAACQ,CAAC,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4DAGvB;AAAC,IAEIK,aAAa,0BAAAC,cAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,aAAA,EAAAC,cAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,aAAA;EACjB,SAAAA,cAAYM,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,aAAA;IACjBO,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,KAAK,GAAG;MACXC,QAAQ,EAAE,KAAK;MACfC,KAAK,EAAE,EAAE;MACTC,SAAS,EAAE;IACb,CAAC;IAAC,OAAAN,KAAA;EACJ;EAAC,IAAAO,aAAA,CAAAX,OAA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AE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACE;UAAM;QAAE,CAAE,CAAC,eAChE3B,MAAA,CAAAkB,OAAA,CAAA2B,aAAA,CAAChC,OAAO;UAACiC,uBAAuB,EAAE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACG;UAAU;QAAE,CAAE,CAC9D,CAAC;MAEd;MAEA,OAAO,IAAI,CAACP,KAAK,CAACa,QAAQ;IAC5B;EAAC;EAAA,OAAAnB,aAAA;AAAA,EArCyBiC,oBAAa;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAwC1BH,aAAa"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_styledComponents","_interopRequireDefault","Wrapper","styled","div","withConfig","displayName","componentId","Title","h3","Content","p","ErrorBoundary","_PureComponent","_inherits2","default","_super","_createSuper2","props","_this","_classCallCheck2","call","state","hasError","error","errorInfo","_createClass2","key","value","componentWillReceiveProps","nextProps","children","_this$props$onErrorCa","_this$props","onErrorCatch","setState","componentDidCatch","_this$props$onErrorCa2","_this$props2","console","componentStack","render","createElement","dangerouslySetInnerHTML","__html","PureComponent","_default","exports"],"sources":["../../../luckda/lowcode/view/ErrorBoundary.jsx"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport styled from 'styled-components';\n\nconst Wrapper = styled.div`\n width: 100%;\n height: 100%;\n overflow: auto;\n`;\nconst Title = styled.h3`\n white-space: pre-line;\n color: var(--luck-color-danger);\n fontSize: 1.5rem;\n`;\nconst Content = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\nclass ErrorBoundary extends PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n hasError: false,\n error: '',\n errorInfo: '',\n };\n }\n\n componentWillReceiveProps(nextProps) {\n if (nextProps.children !== this.props.children && this.state.hasError) {\n // 重置 hasError 为 false 以便重新渲染子组件\n this.props.onErrorCatch?.();\n this.setState({ hasError: false, error: '', errorInfo: '' });\n }\n }\n \n componentDidCatch(error, errorInfo) {\n // 在此处记录错误信息\n console.error(error);\n this.props.onErrorCatch?.(error, errorInfo);\n this.setState({ hasError: true, error, errorInfo: errorInfo?.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n // 如果有错误,显示备用 UI\n return (\n <Wrapper>\n <Title dangerouslySetInnerHTML={{ __html: this.state.error }} />\n <Content dangerouslySetInnerHTML={{ __html: this.state.errorInfo }} />\n </Wrapper>\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,OAAO,GAAGC,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6CAIzB;AACD,IAAMC,KAAK,GAAGL,yBAAM,CAACM,EAAE,CAAAJ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4EAItB;AACD,IAAMG,OAAO,GAAGP,yBAAM,CAACQ,CAAC,CAAAN,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,4DAGvB;AAAC,IAEIK,aAAa,0BAAAC,cAAA;EAAA,IAAAC,UAAA,CAAAC,OAAA,EAAAH,aAAA,EAAAC,cAAA;EAAA,IAAAG,MAAA,OAAAC,aAAA,CAAAF,OAAA,EAAAH,aAAA;EACjB,SAAAA,cAAYM,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAA,IAAAC,gBAAA,CAAAL,OAAA,QAAAH,aAAA;IACjBO,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,KAAK,GAAG;MACXC,QAAQ,EAAE,KAAK;MACfC,KAAK,EAAE,EAAE;MACTC,SAAS,EAAE;IACb,CAAC;IAAC,OAAAN,KAAA;EACJ;EAAC,IAAAO,aAAA,CAAAX,OAAA,EAAAH,aAAA;IAAAe,GAAA;IAAAC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AAK,CAACE;UAAM;QAAE,CAAE,CAAC,eAChE3B,MAAA,CAAAkB,OAAA,CAAA2B,aAAA,CAAChC,OAAO;UAACiC,uBAAuB,EAAE;YAAEC,MAAM,EAAE,IAAI,CAACtB,KAAK,CAACG;UAAU;QAAE,CAAE,CAC9D,CAAC;MAEd;MAEA,OAAO,IAAI,CAACP,KAAK,CAACa,QAAQ;IAC5B;EAAC;EAAA,OAAAnB,aAAA;AAAA,EArCyBiC,oBAAa;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAwC1BH,aAAa"}
@@ -54,6 +54,7 @@ var RuntimeCom = function RuntimeCom(_ref) {
54
54
  }
55
55
  return _react.Fragment;
56
56
  } catch (e) {
57
+ onErrorCatch === null || onErrorCatch === void 0 || onErrorCatch(e);
57
58
  return function () {
58
59
  return /*#__PURE__*/_react.default.createElement(ErrorContent, null, e.message);
59
60
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","Babel","LuckAntd","LuckDesign","AHooks","_styledComponents","_interopRequireDefault","_lodash","_ContextProvider","_helper","_ErrorBoundary","_excluded","ErrorContent","styled","p","withConfig","displayName","componentId","RuntimeCom","_ref","children","onErrorCatch","rest","_objectWithoutProperties2","default","ctx","useContext","Component","useCreation","code","React","Children","toArray","join","trim","Fragment","transformedCode","transform","presets","functionNameMatch","match","length","functionName","argsName","keys","_args","map","n","executeCode","apply","concat","_toConsumableArray2","_objectSpread2","e","createElement","message","_default","exports"],"sources":["../../../../../luckda/lowcode/view/lc-components/JSX/RuntimeComp.jsx"],"sourcesContent":["import React, { Fragment } from 'react';\nimport * as Babel from '@babel/standalone';\nimport * as LuckAntd from 'luck-design/antd';\nimport * as LuckDesign from 'luck-design';\nimport * as AHooks from 'ahooks';\nimport styled from 'styled-components';\nimport { keys } from 'lodash';\nimport { useContext } from '../../../engine/provider/ContextProvider';\nimport { executeCode } from '../../../engine/tools/helper';\nimport ErrorBoundary from '../../ErrorBoundary';\n\nconst ErrorContent = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\n/**\n * 实时代码渲染组件\n * todo:沙箱上下文的集成\n * todo:Loading效果的优化\n */\nconst RuntimeCom = ({ children, onErrorCatch, ...rest }) => {\n const ctx = useContext();\n\n const Component = AHooks.useCreation(() => {\n const code = React.Children.toArray(children).join('').trim();\n if (!code) return Fragment;\n\n try {\n // 使用Babel转换代码\n const transformedCode = Babel.transform(code, {\n presets: ['react'],\n }).code;\n const functionNameMatch = transformedCode.match(/function\\s+([^\\s(]+)/);\n if (functionNameMatch && functionNameMatch.length > 1) {\n const functionName = functionNameMatch[1];\n const argsName = keys(rest);\n const _args = argsName.map((n) => rest[n]);\n return executeCode(\n ctx,\n `function() {${transformedCode}; return ${functionName};}`,\n ['React', 'Antd', 'Luckd', 'styled', 'libs', ...argsName],\n React,\n LuckAntd,\n LuckDesign,\n styled,\n { ...AHooks },\n ..._args,\n );\n }\n return Fragment;\n } catch (e) {\n return () => <ErrorContent>{e.message}</ErrorContent>;\n }\n }, [children]);\n\n return (\n <ErrorBoundary onErrorCatch={onErrorCatch}>\n <Component />\n </ErrorBoundary>\n );\n};\n\nexport default RuntimeCom;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAJ,sBAAA,CAAAN,OAAA;AAAgD,IAAAW,SAAA;AAEhD,IAAMC,YAAY,GAAGC,y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M,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAAQ,MAAA,KAAAC,mBAAA,CAAA3B,OAAA,EAAKmB,QAAQ,IACxDb,cAAK,EACL5B,QAAQ,EACRC,UAAU,EACVU,yBAAM,MAAAuC,cAAA,CAAA5B,OAAA,MACDpB,MAAM,GAAA8C,MAAA,KAAAC,mBAAA,CAAA3B,OAAA,EACRqB,KAAK,EACV,CAAC;MACH;MACA,OAAOV,eAAQ;IACjB,CAAC,CAAC,OAAOkB,CAAC,EAAE;MACV,OAAO;QAAA,oBAAMvD,MAAA,CAAA0B,OAAA,CAAA8B,aAAA,CAAC1C,YAAY,QAAEyC,CAAC,CAACE,OAAsB,CAAC;MAAA;IACvD;EACF,CAAC,EAAE,CAACnC,QAAQ,CAAC,CAAC;EAEd,oBACEtB,MAAA,CAAA0B,OAAA,CAAA8B,aAAA,CAAC5C,cAAA,CAAAc,OAAa;IAACH,YAAY,EAAEA;EAAa,gBACxCvB,MAAA,CAAA0B,OAAA,CAAA8B,aAAA,CAAC3B,SAAS,MAAE,CACC,CAAC;AAEpB,CAAC;AAAC,IAAA6B,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEaN,UAAU"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","Babel","LuckAntd","LuckDesign","AHooks","_styledComponents","_interopRequireDefault","_lodash","_ContextProvider","_helper","_ErrorBoundary","_excluded","ErrorContent","styled","p","withConfig","displayName","componentId","RuntimeCom","_ref","children","onErrorCatch","rest","_objectWithoutProperties2","default","ctx","useContext","Component","useCreation","code","React","Children","toArray","join","trim","Fragment","transformedCode","transform","presets","functionNameMatch","match","length","functionName","argsName","keys","_args","map","n","executeCode","apply","concat","_toConsumableArray2","_objectSpread2","e","createElement","message","_default","exports"],"sources":["../../../../../luckda/lowcode/view/lc-components/JSX/RuntimeComp.jsx"],"sourcesContent":["import React, { Fragment } from 'react';\nimport * as Babel from '@babel/standalone';\nimport * as LuckAntd from 'luck-design/antd';\nimport * as LuckDesign from 'luck-design';\nimport * as AHooks from 'ahooks';\nimport styled from 'styled-components';\nimport { keys } from 'lodash';\nimport { useContext } from '../../../engine/provider/ContextProvider';\nimport { executeCode } from '../../../engine/tools/helper';\nimport ErrorBoundary from '../../ErrorBoundary';\n\nconst ErrorContent = styled.p`\n white-space: pre-line;\n color: var(--luck-color-danger);\n`;\n\n/**\n * 实时代码渲染组件\n * todo:沙箱上下文的集成\n * todo:Loading效果的优化\n */\nconst RuntimeCom = ({ children, onErrorCatch, ...rest }) => {\n const ctx = useContext();\n\n const Component = AHooks.useCreation(() => {\n const code = React.Children.toArray(children).join('').trim();\n if (!code) return Fragment;\n\n try {\n // 使用Babel转换代码\n const transformedCode = Babel.transform(code, {\n presets: ['react'],\n }).code;\n const functionNameMatch = transformedCode.match(/function\\s+([^\\s(]+)/);\n if (functionNameMatch && functionNameMatch.length > 1) {\n const functionName = functionNameMatch[1];\n const argsName = keys(rest);\n const _args = argsName.map((n) => rest[n]);\n return executeCode(\n ctx,\n `function() {${transformedCode}; return ${functionName};}`,\n ['React', 'Antd', 'Luckd', 'styled', 'libs', ...argsName],\n React,\n LuckAntd,\n LuckDesign,\n styled,\n { ...AHooks },\n ..._args,\n );\n }\n return Fragment;\n } catch (e) {\n onErrorCatch?.(e);\n return () => <ErrorContent>{e.message}</ErrorContent>;\n }\n }, [children]);\n\n return (\n <ErrorBoundary onErrorCatch={onErrorCatch}>\n <Component />\n </ErrorBoundary>\n );\n};\n\nexport default RuntimeCom;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAA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,CAAC;UAAA,OAAKzB,IAAI,CAACyB,CAAC,CAAC;QAAA,EAAC;QAC1C,OAAOC,mBAAW,CAAAC,KAAA,UAChBxB,GAAG,iBAAAyB,MAAA,CACYd,eAAe,eAAAc,MAAA,CAAYR,YAAY,UACrD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAAQ,MAAA,KAAAC,mBAAA,CAAA3B,OAAA,EAAKmB,QAAQ,IACxDb,cAAK,EACL5B,QAAQ,EACRC,UAAU,EACVU,yBAAM,MAAAuC,cAAA,CAAA5B,OAAA,MACDpB,MAAM,GAAA8C,MAAA,KAAAC,mBAAA,CAAA3B,OAAA,EACRqB,KAAK,EACV,CAAC;MACH;MACA,OAAOV,eAAQ;IACjB,CAAC,CAAC,OAAOkB,CAAC,EAAE;MACVhC,YAAY,aAAZA,YAAY,eAAZA,YAAY,CAAGgC,CAAC,CAAC;MACjB,OAAO;QAAA,oBAAMvD,MAAA,CAAA0B,OAAA,CAAA8B,aAAA,CAAC1C,YAAY,QAAEyC,CAAC,CAACE,OAAsB,CAAC;MAAA;IACvD;EACF,CAAC,EAAE,CAACnC,QAAQ,CAAC,CAAC;EAEd,oBACEtB,MAAA,CAAA0B,OAAA,CAAA8B,aAAA,CAAC5C,cAAA,CAAAc,OAAa;IAACH,YAAY,EAAEA;EAAa,gBACxCvB,MAAA,CAAA0B,OAAA,CAAA8B,aAAA,CAAC3B,SAAS,MAAE,CACC,CAAC;AAEpB,CAAC;AAAC,IAAA6B,QAAA,GAAAC,OAAA,CAAAjC,OAAA,GAEaN,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luck-design-biz/luckda",
3
- "version": "1.0.2-6",
3
+ "version": "1.0.2-7",
4
4
  "description": "前端配置管理中心业务组件库",
5
5
  "scripts": {
6
6
  "start": "cross-env NODE_OPTIONS=--max-old-space-size=10240 USER_RUNTIME=SITE RUNTIME=dev umi dev",