@luck-design-biz/luckda 1.0.2-2 → 1.0.2-20temp
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/es/components/Builder/index.js +37 -27
- package/es/components/ComplexItem/index.js +5 -3
- package/es/components/ComplexItem/service.js +6 -3
- package/es/components/LDActions/index.js +1 -0
- package/es/components/LdAutoForm/index.js +18 -8
- package/es/components/LdCard/index.js +10 -8
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +10 -7
- package/es/components/LdGrid/index.js +24 -16
- package/es/components/LdGridForm/index.js +16 -7
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +2 -0
- package/es/helper/form.js +7 -1
- package/es/helper/ldBuilder.js +9 -5
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +61 -6
- package/es/lowcode/constants/api-url.js +359 -190
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.json +3 -5
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/es/lowcode/engine/meta/dialog.props.json +24 -4
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -1
- package/es/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/es/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/es/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +3 -19
- package/es/lowcode/engine/meta/grouptree.props.json +0 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/es/lowcode/engine/meta/jsx.props.json +4 -3
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/table.props.json +0 -7
- package/es/lowcode/engine/meta/tabs.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.json +1 -5
- package/es/lowcode/engine/provider/ContextProvider/index.js +45 -9
- package/es/lowcode/engine/provider/ContextProvider/router.js +21 -1
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +36 -30
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/helper.js +25 -1
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +135 -27
- package/es/lowcode/painter/DesignToolbar.js +102 -188
- package/es/lowcode/painter/History.js +300 -0
- package/es/lowcode/painter/Panel.js +1 -1
- package/es/lowcode/painter/Ribbon.js +37 -1
- package/es/lowcode/painter/components/AdvancePanel.js +55 -51
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/TreeEditor.js +76 -8
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/es/lowcode/painter/components/code-editor/DiffEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -5
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/DialogSize.js +76 -0
- package/es/lowcode/painter/panel-section/DialogWidthHeight.js +60 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +174 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.js +181 -0
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/es/lowcode/painter/style/action-bind-modal.less +1 -1
- package/es/lowcode/painter/style/components.less +1 -1
- package/es/lowcode/painter/style/history.less +46 -0
- package/es/lowcode/painter/style/outline.less +1 -1
- package/es/lowcode/painter/style/panel-item.less +1 -0
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/ErrorBoundary.js +80 -0
- package/es/lowcode/view/Page.js +11 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Box/index.less +2 -2
- package/es/lowcode/view/lc-components/Box/meta.json +1 -1
- package/es/lowcode/view/lc-components/CardList/index.js +3 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/es/lowcode/view/lc-components/Dialog/index.js +13 -5
- package/es/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/es/lowcode/view/lc-components/Drawer/index.js +5 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/es/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/es/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/index.js +15 -19
- package/es/lowcode/view/lc-components/Form/meta.json +3 -19
- package/es/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +32 -16
- package/es/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Section/meta.json +2 -2
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/es/lowcode/view/lc-components/Table/index.js +11 -3
- package/es/lowcode/view/lc-components/Table/meta.json +0 -7
- package/es/lowcode/view/lc-components/Tabs/index.js +6 -2
- package/es/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/index.js +3 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/es/lowcode/view/lc-components/Wrapper.js +9 -1
- package/es/services.js +24 -7
- package/es/upload/FilesWall/index.js +16 -6
- package/es/upload/Form/gridForm.js +16 -6
- package/es/upload/FormItem/index.js +16 -4
- package/es/utils/action.js +3 -2
- package/es/utils/form.js +40 -6
- package/es/utils/grid.js +12 -3
- package/lib/components/Builder/index.js +36 -26
- package/lib/components/ComplexItem/index.js +5 -3
- package/lib/components/ComplexItem/service.js +6 -3
- package/lib/components/LDActions/index.js +1 -0
- package/lib/components/LdAutoForm/index.js +15 -5
- package/lib/components/LdCard/index.js +10 -8
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +9 -6
- package/lib/components/LdGrid/index.js +24 -16
- package/lib/components/LdGridForm/index.js +13 -4
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +2 -0
- package/lib/helper/form.js +7 -1
- package/lib/helper/ldBuilder.js +8 -5
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +61 -6
- package/lib/lowcode/constants/api-url.js +360 -190
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +3 -5
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -1
- package/lib/lowcode/engine/meta/dialog.props.json +24 -4
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -1
- package/lib/lowcode/engine/meta/fieldeditor.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldgroup.props.json +0 -1
- package/lib/lowcode/engine/meta/fieldyear.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +3 -19
- package/lib/lowcode/engine/meta/grouptree.props.json +0 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +5 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -2
- package/lib/lowcode/engine/meta/jsx.props.json +4 -3
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/table.props.json +0 -7
- package/lib/lowcode/engine/meta/tabs.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.json +1 -5
- package/lib/lowcode/engine/provider/ContextProvider/index.js +50 -13
- package/lib/lowcode/engine/provider/ContextProvider/router.js +22 -1
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +37 -31
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/helper.js +25 -0
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +132 -24
- package/lib/lowcode/painter/DesignToolbar.js +98 -184
- package/lib/lowcode/painter/History.js +308 -0
- package/lib/lowcode/painter/Panel.js +1 -1
- package/lib/lowcode/painter/Ribbon.js +37 -1
- package/lib/lowcode/painter/components/AdvancePanel.js +53 -49
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +10 -3
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/TreeEditor.js +76 -8
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +10 -6
- package/lib/lowcode/painter/components/code-editor/DiffEditor.js +49 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +2 -2
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -4
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/DialogSize.js +83 -0
- package/lib/lowcode/painter/panel-section/DialogWidthHeight.js +67 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +181 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +189 -0
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +7 -2
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +37 -26
- package/lib/lowcode/painter/style/action-bind-modal.less +1 -1
- package/lib/lowcode/painter/style/components.less +1 -1
- package/lib/lowcode/painter/style/history.less +46 -0
- package/lib/lowcode/painter/style/outline.less +1 -1
- package/lib/lowcode/painter/style/panel-item.less +1 -0
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/ErrorBoundary.js +88 -0
- package/lib/lowcode/view/Page.js +12 -7
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Box/index.less +2 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -1
- package/lib/lowcode/view/lc-components/CardList/index.js +3 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +3 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +24 -4
- package/lib/lowcode/view/lc-components/Drawer/index.js +3 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -1
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +48 -1
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +0 -1
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/index.js +15 -19
- package/lib/lowcode/view/lc-components/Form/meta.json +3 -19
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +0 -1
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +33 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +4 -3
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/PageLayout/index.js +1 -1
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +16 -13
- package/lib/lowcode/view/lc-components/Table/index.js +11 -3
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -7
- package/lib/lowcode/view/lc-components/Tabs/index.js +5 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +3 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +1 -5
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -0
- package/lib/services.js +25 -7
- package/lib/upload/FilesWall/index.js +13 -3
- package/lib/upload/Form/gridForm.js +13 -3
- package/lib/upload/FormItem/index.js +15 -3
- package/lib/utils/action.js +6 -0
- package/lib/utils/form.js +40 -5
- package/lib/utils/grid.js +13 -4
- package/package.json +1 -2
- package/es/lowcode/painter/panel-section/JSEditor.js +0 -49
- package/es/lowcode/view/errorBoundary.js +0 -61
- package/lib/lowcode/painter/panel-section/JSEditor.js +0 -57
- package/lib/lowcode/view/errorBoundary.js +0 -69
|
@@ -8,12 +8,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.RemoteSourceContext = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
10
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
16
|
var _ahooks = require("ahooks");
|
|
16
17
|
var _umi = require("umi");
|
|
18
|
+
var _lodash = require("lodash");
|
|
17
19
|
var _launcher = _interopRequireDefault(require("../launcher"));
|
|
18
20
|
var _Builder = require("../../../components/Builder");
|
|
19
21
|
var _action2 = require("../../../helper/action");
|
|
@@ -31,12 +33,10 @@ var _default = exports.default = function _default(_ref) {
|
|
|
31
33
|
var _usePageDataStore = (0, _usePageDataStore2.default)(function (state) {
|
|
32
34
|
return {
|
|
33
35
|
initialize: state.initialize,
|
|
34
|
-
initializeModule: state.initializeModule,
|
|
35
36
|
reset: state.reset
|
|
36
37
|
};
|
|
37
38
|
}),
|
|
38
39
|
initialize = _usePageDataStore.initialize,
|
|
39
|
-
initializeModule = _usePageDataStore.initializeModule,
|
|
40
40
|
reset = _usePageDataStore.reset;
|
|
41
41
|
var _useTemporalStore = (0, _usePageDataStore2.useTemporalStore)(function (state) {
|
|
42
42
|
return {
|
|
@@ -78,7 +78,6 @@ var _default = exports.default = function _default(_ref) {
|
|
|
78
78
|
setRemoteSource({
|
|
79
79
|
module: data
|
|
80
80
|
});
|
|
81
|
-
initializeModule(data);
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
}),
|
|
@@ -161,7 +160,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
161
160
|
}),
|
|
162
161
|
runFetchAllBehaviorExport = _useRequest6.run;
|
|
163
162
|
(0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
164
|
-
var fetchPageDataRes, data, list, detail, source;
|
|
163
|
+
var fetchPageDataRes, data, list, detail, source, _pageData;
|
|
165
164
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
166
165
|
while (1) switch (_context.prev = _context.next) {
|
|
167
166
|
case 0:
|
|
@@ -181,16 +180,17 @@ var _default = exports.default = function _default(_ref) {
|
|
|
181
180
|
break;
|
|
182
181
|
}
|
|
183
182
|
_umi.history.replace('/404');
|
|
184
|
-
_context.next =
|
|
183
|
+
_context.next = 21;
|
|
185
184
|
break;
|
|
186
185
|
case 9:
|
|
187
|
-
source = detail[list[0]].source;
|
|
188
186
|
(0, _helper.setMetaAttrs)(_constants.META_TAG_NAME, data);
|
|
189
|
-
|
|
187
|
+
source = detail[list[0]].source;
|
|
188
|
+
_pageData = (0, _dataProcess.decompress)(source);
|
|
189
|
+
_context.next = 14;
|
|
190
190
|
return runFetchModlueData(data.dataModelKey, {
|
|
191
|
-
moduleCode: data.moduleCode
|
|
191
|
+
moduleCode: [data.moduleCode].concat((0, _toConsumableArray2.default)((0, _lodash.values)(_pageData.props.proxy))).join(',')
|
|
192
192
|
});
|
|
193
|
-
case
|
|
193
|
+
case 14:
|
|
194
194
|
runFetchAllBehaviorImport({
|
|
195
195
|
behaviorMode: 'IMPORT',
|
|
196
196
|
moduleCode: data.moduleCode
|
|
@@ -205,11 +205,9 @@ var _default = exports.default = function _default(_ref) {
|
|
|
205
205
|
runFetchAllSerials({
|
|
206
206
|
uid: data.moduleId
|
|
207
207
|
});
|
|
208
|
-
initialize(
|
|
208
|
+
initialize(_pageData);
|
|
209
209
|
resume();
|
|
210
210
|
eventBus.$publisher(_eventTopics.PAGE_LOAD_MOUNT);
|
|
211
|
-
case 20:
|
|
212
|
-
;
|
|
213
211
|
case 21:
|
|
214
212
|
case "end":
|
|
215
213
|
return _context.stop();
|
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.dataToTree = dataToTree;
|
|
7
8
|
exports.executeCode = executeCode;
|
|
8
9
|
exports.extractKeywords = extractKeywords;
|
|
9
10
|
exports.findFirstLeafNode = findFirstLeafNode;
|
|
@@ -282,4 +283,28 @@ function findFirstLeafNode(node) {
|
|
|
282
283
|
_iterator2.f();
|
|
283
284
|
}
|
|
284
285
|
return null;
|
|
286
|
+
}
|
|
287
|
+
function dataToTree(data, params) {
|
|
288
|
+
var _ref = params || {},
|
|
289
|
+
_ref$parentKey = _ref.parentKey,
|
|
290
|
+
parentKey = _ref$parentKey === void 0 ? 'parentId' : _ref$parentKey,
|
|
291
|
+
_ref$childKey = _ref.childKey,
|
|
292
|
+
childKey = _ref$childKey === void 0 ? 'children' : _ref$childKey,
|
|
293
|
+
_ref$rootId = _ref.rootId,
|
|
294
|
+
rootId = _ref$rootId === void 0 ? '0' : _ref$rootId,
|
|
295
|
+
_ref$id = _ref.id,
|
|
296
|
+
id = _ref$id === void 0 ? 'id' : _ref$id,
|
|
297
|
+
_ref$stain = _ref.stain,
|
|
298
|
+
stain = _ref$stain === void 0 ? false : _ref$stain;
|
|
299
|
+
var _data = stain ? data : (0, _lodash.cloneDeep)(data);
|
|
300
|
+
var groupedByParents = (0, _lodash.groupBy)(_data, parentKey);
|
|
301
|
+
var itemsById = (0, _lodash.keyBy)(_data, id);
|
|
302
|
+
try {
|
|
303
|
+
(0, _lodash.each)((0, _lodash.omit)(groupedByParents, rootId), function (children, parentId) {
|
|
304
|
+
itemsById[parentId][childKey] = children;
|
|
305
|
+
});
|
|
306
|
+
} catch (e) {
|
|
307
|
+
console.error('helper.dataToTree error', e);
|
|
308
|
+
}
|
|
309
|
+
return groupedByParents[rootId];
|
|
285
310
|
}
|
|
@@ -147,8 +147,8 @@ var wrapPromise = function wrapPromise(promise) {
|
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
|
-
function initialize(ctx) {
|
|
151
|
-
var pageVars = _usePageDataStore.default.getState()
|
|
150
|
+
function initialize(ctx, proxyCode) {
|
|
151
|
+
var pageVars = _usePageDataStore.default.getState()[proxyCode || 'pageData'].props.vars;
|
|
152
152
|
if ((0, _lodash.isNil)(pageVars)) return null;
|
|
153
153
|
var remoteApis = new Map();
|
|
154
154
|
var _reduce = (0, _lodash.reduce)(pageVars, function (ret, val) {
|
|
@@ -177,8 +177,8 @@ function initialize(ctx) {
|
|
|
177
177
|
_reduce2 = (0, _toArray2.default)(_reduce),
|
|
178
178
|
variables = _reduce2[0],
|
|
179
179
|
autoTasks = _reduce2.slice(1);
|
|
180
|
-
_usePageVar.useStateStore.getState().initialize(variables);
|
|
181
|
-
ctx._initRemoteApiMap(remoteApis);
|
|
180
|
+
_usePageVar.useStateStore.getState().initialize(variables, !!proxyCode);
|
|
181
|
+
ctx._initRemoteApiMap(remoteApis, !!proxyCode);
|
|
182
182
|
function run() {
|
|
183
183
|
return _run2.apply(this, arguments);
|
|
184
184
|
}
|
|
@@ -73,6 +73,7 @@ var Design = function Design() {
|
|
|
73
73
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
74
74
|
className: _design.default['lc-painter-design']
|
|
75
75
|
}, /*#__PURE__*/_react.default.createElement(_DesignToolbar.default, {
|
|
76
|
+
canvas: simulatorRef,
|
|
76
77
|
locale: locale,
|
|
77
78
|
onLangChange: handleLangChange
|
|
78
79
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _umi = require("umi");
|
|
11
12
|
var _lodash = require("lodash");
|
|
12
13
|
var _ahooks = require("ahooks");
|
|
13
14
|
var _antd = require("luck-design/antd");
|
|
@@ -50,6 +51,18 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
50
51
|
setOperatorId = _useSetState2[1];
|
|
51
52
|
var lastSelectorId = (0, _ahooks.useLatest)(operatorId.selector);
|
|
52
53
|
var currentModal = (0, _react.useRef)(null);
|
|
54
|
+
var _useTemporalStore = (0, _ContextProvider.useTemporalStore)(function (state) {
|
|
55
|
+
return {
|
|
56
|
+
undo: state.undo,
|
|
57
|
+
redo: state.redo,
|
|
58
|
+
pastStates: state.pastStates,
|
|
59
|
+
futureStates: state.futureStates
|
|
60
|
+
};
|
|
61
|
+
}),
|
|
62
|
+
canUndo = _useTemporalStore.canUndo,
|
|
63
|
+
canRedo = _useTemporalStore.canRedo,
|
|
64
|
+
undo = _useTemporalStore.undo,
|
|
65
|
+
redo = _useTemporalStore.redo;
|
|
53
66
|
var getElement = (0, _ahooks.useMemoizedFn)(function (_target) {
|
|
54
67
|
var _context$componentMap;
|
|
55
68
|
return (0, _lodash.isString)(_target) ? (_context$componentMap = context.componentMap.get(_target)) === null || _context$componentMap === void 0 ? void 0 : _context$componentMap.api.getSelfDom() : _target;
|
|
@@ -70,9 +83,109 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
70
83
|
id: id
|
|
71
84
|
});
|
|
72
85
|
});
|
|
86
|
+
var handleShortcutEmit = (0, _ahooks.useMemoizedFn)(function (_ref3) {
|
|
87
|
+
var key = _ref3.key;
|
|
88
|
+
switch (key) {
|
|
89
|
+
case 'meta.s':
|
|
90
|
+
case 'ctrl.s':
|
|
91
|
+
context.$publisher(context.topics.DESIGN_OPERATE_SAVE);
|
|
92
|
+
break;
|
|
93
|
+
case 'meta.p':
|
|
94
|
+
case 'ctrl.p':
|
|
95
|
+
{
|
|
96
|
+
var _getCreateHistoryOpti = (0, _umi.getCreateHistoryOptions)(),
|
|
97
|
+
basename = _getCreateHistoryOpti.basename;
|
|
98
|
+
var previewUrl = "".concat(basename === '/' ? '' : basename, "/byteman/preview/").concat(context.router.getQuery('code'));
|
|
99
|
+
window.open(previewUrl, '_blank');
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case 'meta.z':
|
|
103
|
+
case 'ctrl.z':
|
|
104
|
+
canUndo && undo();
|
|
105
|
+
break;
|
|
106
|
+
case 'meta.shift.z':
|
|
107
|
+
case 'ctrl.shift.z':
|
|
108
|
+
canRedo && redo();
|
|
109
|
+
break;
|
|
110
|
+
case 'meta.c':
|
|
111
|
+
case 'ctrl.c':
|
|
112
|
+
if (operatorId.selector) {
|
|
113
|
+
var _context$$$api$getSel = context.$(operatorId.selector).api.getSelfAndParentData(),
|
|
114
|
+
node = _context$$$api$getSel.node,
|
|
115
|
+
parent = _context$$$api$getSel.parent;
|
|
116
|
+
if (_constants.CONTAINER_UNITS.includes(parent === null || parent === void 0 ? void 0 : parent.props.component)) {
|
|
117
|
+
addComponent((0, _lodash.omit)(node.props), parent.props.id);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
break;
|
|
121
|
+
case 'backspace':
|
|
122
|
+
if (operatorId.selector && operatorId.deletable) {
|
|
123
|
+
handleDelete({
|
|
124
|
+
id: operatorId.selector
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
case 'uparrow':
|
|
129
|
+
if (operatorId.selector) {
|
|
130
|
+
var _context$$$api$getSel2 = context.$(operatorId.selector).api.getSelfAndParentData(),
|
|
131
|
+
_parent = _context$$$api$getSel2.parent;
|
|
132
|
+
if (_parent) {
|
|
133
|
+
handleSelect(_parent.props.id);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
case 'downarrow':
|
|
138
|
+
if (operatorId.selector) {
|
|
139
|
+
var _node$children;
|
|
140
|
+
var _node = context.$(operatorId.selector).api.getSelfData();
|
|
141
|
+
if (_node !== null && _node !== void 0 && (_node$children = _node.children) !== null && _node$children !== void 0 && _node$children.length) {
|
|
142
|
+
handleSelect(_node.children[0]);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
case 'leftarrow':
|
|
147
|
+
case 'rightarrow':
|
|
148
|
+
if (operatorId.selector) {
|
|
149
|
+
var _parent2$children;
|
|
150
|
+
var _context$$$api$getSel3 = context.$(operatorId.selector).api.getSelfAndParentData(),
|
|
151
|
+
_parent2 = _context$$$api$getSel3.parent;
|
|
152
|
+
if (_parent2 !== null && _parent2 !== void 0 && (_parent2$children = _parent2.children) !== null && _parent2$children !== void 0 && _parent2$children.length) {
|
|
153
|
+
var index = _parent2.children.findIndex(function (c) {
|
|
154
|
+
return c === operatorId.selector;
|
|
155
|
+
});
|
|
156
|
+
if (key === 'leftarrow' && index > 0) {
|
|
157
|
+
handleSelect(_parent2.children[index - 1]);
|
|
158
|
+
} else if (key === 'rightarrow' && index < _parent2.children.length - 1) {
|
|
159
|
+
handleSelect(_parent2.children[index + 1]);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
break;
|
|
164
|
+
case 'alt.leftarrow':
|
|
165
|
+
case 'alt.rightarrow':
|
|
166
|
+
if (operatorId.selector) {
|
|
167
|
+
var _parent3$children;
|
|
168
|
+
var _context$$$api$getSel4 = context.$(operatorId.selector).api.getSelfAndParentData(),
|
|
169
|
+
_parent3 = _context$$$api$getSel4.parent;
|
|
170
|
+
if (_parent3 !== null && _parent3 !== void 0 && (_parent3$children = _parent3.children) !== null && _parent3$children !== void 0 && _parent3$children.length) {
|
|
171
|
+
var _index = _parent3.children.findIndex(function (c) {
|
|
172
|
+
return c === operatorId.selector;
|
|
173
|
+
});
|
|
174
|
+
if (key === 'alt.leftarrow' && _index > 0) {
|
|
175
|
+
(0, _ContextProvider.moveNode)(_parent3.children[_index], _parent3.children[_index - 1], 'left');
|
|
176
|
+
} else if (key === 'alt.rightarrow' && _index < _parent3.children.length - 1) {
|
|
177
|
+
(0, _ContextProvider.moveNode)(_parent3.children[_index], _parent3.children[_index + 1], 'right');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
73
186
|
var addComponent = (0, _ahooks.useMemoizedFn)(function (data, targetId) {
|
|
74
|
-
context.$subscriber(context.topics.COMPONENT_MOUNT).once(function (
|
|
75
|
-
var mountCompId =
|
|
187
|
+
context.$subscriber(context.topics.COMPONENT_MOUNT).once(function (_ref4) {
|
|
188
|
+
var mountCompId = _ref4.id;
|
|
76
189
|
if (mountCompId === _id) {
|
|
77
190
|
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
78
191
|
id: _id
|
|
@@ -121,10 +234,10 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
121
234
|
};
|
|
122
235
|
}, [operatorId.selector]);
|
|
123
236
|
var activeDomPosition = (0, _ahooks.useCreation)(function () {
|
|
124
|
-
var _getElement;
|
|
237
|
+
var _getElement, _canvas$current;
|
|
125
238
|
if (!operatorId.selector && !operatorId.selectorTarget) return null;
|
|
126
239
|
var targetTop = (_getElement = getElement((0, _lodash.isNil)(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element)) === null || _getElement === void 0 ? void 0 : _getElement.getBoundingClientRect().top;
|
|
127
|
-
var delat = targetTop - canvas.current.getBoundingClientRect().top;
|
|
240
|
+
var delat = targetTop - (((_canvas$current = canvas.current) === null || _canvas$current === void 0 ? void 0 : _canvas$current.getBoundingClientRect().top) || 0);
|
|
128
241
|
return {
|
|
129
242
|
top: delat > 24 ? -24 : 0
|
|
130
243
|
};
|
|
@@ -133,15 +246,6 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
133
246
|
var _last;
|
|
134
247
|
return operatorId.detector && (0, _lodash.isString)(operatorId.detector) ? (_last = (0, _lodash.last)(context.componentMap.get(operatorId.detector).api.getLevelNodes())) === null || _last === void 0 ? void 0 : _last.name : void 0;
|
|
135
248
|
}, [operatorId.detector]);
|
|
136
|
-
(0, _ahooks.useKeyPress)('backspace', function () {
|
|
137
|
-
if (operatorId.selector && operatorId.deletable) {
|
|
138
|
-
handleDelete({
|
|
139
|
-
id: operatorId.selector
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
}, {
|
|
143
|
-
target: canvas
|
|
144
|
-
});
|
|
145
249
|
(0, _ahooks.useEventListener)('mousemove', function (event) {
|
|
146
250
|
var elem = event.target;
|
|
147
251
|
var targetFormItem = elem.closest("[".concat(_constants.LC_COMPONENT_UNIT_KEY, "=\"").concat(_constants.LC_FORMITEM_UNIT, "\"]"));
|
|
@@ -204,11 +308,11 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
204
308
|
target: canvas
|
|
205
309
|
});
|
|
206
310
|
(0, _react.useEffect)(function () {
|
|
207
|
-
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (
|
|
208
|
-
var data =
|
|
311
|
+
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (_ref5) {
|
|
312
|
+
var data = _ref5.data;
|
|
209
313
|
if (_MODAL_COMPONENT_.includes(data.component)) {
|
|
210
|
-
context.$subscriber(context.topics.COMPONENT_APPEND).once(function (
|
|
211
|
-
var compId =
|
|
314
|
+
context.$subscriber(context.topics.COMPONENT_APPEND).once(function (_ref6) {
|
|
315
|
+
var compId = _ref6.id;
|
|
212
316
|
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
213
317
|
toggle: true,
|
|
214
318
|
id: compId
|
|
@@ -264,18 +368,20 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
264
368
|
});
|
|
265
369
|
}
|
|
266
370
|
}).watch();
|
|
267
|
-
var cmtid = context.$subscriber(context.topics.COMPONENT_MODAL_TOGGLE).on(function (
|
|
268
|
-
var toggle =
|
|
269
|
-
id =
|
|
371
|
+
var cmtid = context.$subscriber(context.topics.COMPONENT_MODAL_TOGGLE).on(function (_ref7) {
|
|
372
|
+
var toggle = _ref7.toggle,
|
|
373
|
+
id = _ref7.id;
|
|
270
374
|
if (toggle && id !== currentModal.current) {
|
|
271
|
-
|
|
375
|
+
var _canvas$current2;
|
|
376
|
+
(_canvas$current2 = canvas.current) === null || _canvas$current2 === void 0 || _canvas$current2.style.setProperty('overflow', 'hidden');
|
|
272
377
|
var _modal = context.componentMap.get(id);
|
|
273
378
|
var _prevModal = currentModal.current ? context.componentMap.get(currentModal.current) : null;
|
|
274
379
|
_prevModal === null || _prevModal === void 0 || _prevModal.api.doClose();
|
|
275
380
|
_modal.api.doOpen();
|
|
276
381
|
currentModal.current = id;
|
|
277
382
|
} else if (!toggle) {
|
|
278
|
-
|
|
383
|
+
var _canvas$current3;
|
|
384
|
+
(_canvas$current3 = canvas.current) === null || _canvas$current3 === void 0 || _canvas$current3.style.removeProperty('overflow');
|
|
279
385
|
var _id = id || currentModal.current;
|
|
280
386
|
if (_id) {
|
|
281
387
|
var _modal2 = context.componentMap.get(_id);
|
|
@@ -284,19 +390,21 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
284
390
|
}
|
|
285
391
|
}
|
|
286
392
|
}).watch();
|
|
287
|
-
var cdid = context.$subscriber(context.topics.COMPONENT_DELETE).on(function (
|
|
288
|
-
var id =
|
|
393
|
+
var cdid = context.$subscriber(context.topics.COMPONENT_DELETE).on(function (_ref8) {
|
|
394
|
+
var id = _ref8.id;
|
|
289
395
|
if (lastSelectorId.current === id) {
|
|
290
396
|
handleSelect();
|
|
291
397
|
}
|
|
292
398
|
(0, _ContextProvider.deleteNode)(id);
|
|
293
399
|
});
|
|
400
|
+
var dseid = context.$subscriber(context.topics.DESIGN_SHORTCUT_EMIT).on(handleShortcutEmit);
|
|
294
401
|
return function () {
|
|
295
402
|
context.$unsubscriber(context.topics.COMPONENT_SETTING_CLICK, csid);
|
|
296
403
|
context.$unsubscriber(context.topics.COMPONENT_HOVER, hcid);
|
|
297
404
|
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, acid);
|
|
298
405
|
context.$unsubscriber(context.topics.MODAL_OPEN, cmtid);
|
|
299
406
|
context.$unsubscriber(context.topics.COMPONENT_DELETE, cdid);
|
|
407
|
+
context.$unsubscriber(context.topics.COMPONENT_DELETE, dseid);
|
|
300
408
|
};
|
|
301
409
|
}, []);
|
|
302
410
|
(0, _react.useEffect)(function () {
|