@luck-design-biz/luckda 0.0.24-2 → 0.0.24-3
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 +27 -22
- package/es/components/LdAutoForm/index.js +15 -5
- package/es/components/LdFormList/index.js +4 -1
- package/es/components/LdGrid/index.js +15 -18
- package/es/components/LdGridForm/index.js +12 -4
- package/es/helper/form.js +8 -2
- package/es/helper/ldBuilder.js +4 -1
- package/es/lowcode/constants/api-url.js +1 -292
- package/es/lowcode/constants/event-topics.js +1 -14
- package/es/lowcode/engine/meta/button.props.default.json +7 -15
- package/es/lowcode/engine/meta/cardlist.props.default.json +9 -17
- package/{lib/lowcode/engine/meta/button.props.json → es/lowcode/engine/meta/components/button.json} +103 -126
- package/es/lowcode/engine/meta/{cardlist.props.json → components/card-list.json} +142 -143
- package/es/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -143
- package/es/lowcode/engine/meta/{form.props.json → components/form.json} +115 -116
- package/{lib/lowcode/engine/meta/iframe.props.json → es/lowcode/engine/meta/components/iframe.json} +30 -31
- package/{lib/lowcode/engine/meta/image.props.json → es/lowcode/engine/meta/components/image.json} +112 -113
- package/{lib/lowcode/engine/meta/imex.props.json → es/lowcode/engine/meta/components/imex.json} +80 -81
- package/es/lowcode/engine/meta/{jsx.props.json → components/jsx.json} +23 -24
- package/es/lowcode/engine/meta/{layout.props.json → components/layout.json} +106 -107
- package/{lib/lowcode/engine/meta/link.props.json → es/lowcode/engine/meta/components/link.json} +110 -111
- package/es/lowcode/engine/meta/{dialog.props.json → components/modal.json} +119 -120
- package/{lib/lowcode/engine/meta/section.props.json → es/lowcode/engine/meta/components/section.json} +106 -107
- package/{lib/lowcode/engine/meta/split.props.json → es/lowcode/engine/meta/components/split.json} +70 -71
- package/es/lowcode/{view/lc-components/CardList/meta.json → engine/meta/components/table.json} +28 -11
- package/{lib/lowcode/engine/meta/tabs.props.json → es/lowcode/engine/meta/components/tabs.json} +139 -140
- package/{lib/lowcode/engine/meta/text.props.json → es/lowcode/engine/meta/components/text.json} +64 -65
- package/es/lowcode/engine/meta/{tree.props.json → components/tree.json} +155 -156
- package/es/lowcode/engine/meta/components-list.json +121 -127
- package/es/lowcode/engine/meta/drawer.props.default.json +9 -17
- package/es/lowcode/engine/meta/form.props.default.json +4 -12
- package/es/lowcode/engine/meta/iframe.props.default.json +2 -10
- package/es/lowcode/engine/meta/image.props.default.json +7 -15
- package/es/lowcode/engine/meta/imex.props.default.json +3 -11
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -10
- package/es/lowcode/engine/meta/layout.props.default.json +4 -12
- package/es/lowcode/engine/meta/link.props.default.json +5 -13
- package/es/lowcode/engine/meta/modal.props.default.json +11 -0
- package/es/lowcode/engine/meta/section.props.default.json +8 -16
- package/es/lowcode/engine/meta/split.props.default.json +4 -12
- package/es/lowcode/engine/meta/table.props.default.json +9 -29
- package/es/lowcode/engine/meta/tabs.props.default.json +9 -17
- package/es/lowcode/engine/meta/text.props.default.json +3 -11
- package/es/lowcode/engine/meta/tree.props.default.json +8 -16
- package/es/lowcode/engine/provider/ContextProvider.js +41 -46
- package/es/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/es/lowcode/engine/tools/dataProcess.js +8 -85
- package/es/lowcode/engine/tools/helper.js +0 -68
- package/es/lowcode/engine/tools/lcid.js +16 -0
- package/es/lowcode/index.js +1 -3
- package/es/lowcode/painter/Design.js +85 -40
- package/es/lowcode/painter/I18n.js +2 -202
- package/es/lowcode/painter/Outline.js +54 -63
- package/es/lowcode/painter/Panel.js +2 -239
- package/es/lowcode/painter/Ribbon.js +55 -61
- package/es/lowcode/painter/components/PanelItem.js +11 -83
- package/es/lowcode/painter/components/RuleInput.js +7 -9
- package/es/lowcode/painter/index.js +3 -33
- package/es/lowcode/painter/panel-section/LayoutRatio.js +49 -57
- package/es/lowcode/painter/panel-section/Radio.js +58 -0
- package/es/lowcode/painter/style/design.less +5 -116
- package/es/lowcode/painter/style/index.less +1 -0
- package/es/lowcode/painter/style/layout-ratio.less +1 -1
- package/es/lowcode/painter/style/outline.less +0 -2
- package/es/lowcode/painter/style/panel-item.less +12 -45
- package/es/lowcode/painter/style/panel.less +0 -124
- package/es/lowcode/painter/style/ribbon.less +0 -1
- package/es/lowcode/view/Canvas.js +70 -79
- package/es/lowcode/view/Page.js +28 -10
- package/es/lowcode/view/index.js +6 -5
- package/es/lowcode/view/lc-components/Box/index.js +5 -22
- package/es/lowcode/view/lc-components/Button/index.js +7 -75
- package/es/lowcode/view/lc-components/Dialog/index.js +11 -20
- package/es/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/es/lowcode/view/lc-components/Drawer/index.js +9 -22
- package/es/lowcode/view/lc-components/Layout/index.js +7 -40
- package/es/lowcode/view/lc-components/Table/index.js +9 -229
- package/es/lowcode/view/lc-components/Wrapper.js +23 -32
- package/es/lowcode/view/style/page.less +1 -0
- package/es/services.js +24 -7
- package/es/upload/Form/gridForm.js +5 -4
- package/es/upload/FormItem/index.js +4 -3
- package/es/utils/form.js +37 -3
- package/es/utils/grid.js +9 -8
- package/lib/components/Builder/index.js +25 -20
- package/lib/components/LdAutoForm/index.js +14 -4
- package/lib/components/LdFormList/index.js +5 -1
- package/lib/components/LdGrid/index.js +15 -18
- package/lib/components/LdGridForm/index.js +11 -3
- package/lib/helper/form.js +8 -2
- package/lib/helper/ldBuilder.js +4 -1
- package/lib/lowcode/constants/api-url.js +2 -294
- package/lib/lowcode/constants/event-topics.js +2 -15
- package/lib/lowcode/engine/meta/button.props.default.json +7 -15
- package/lib/lowcode/engine/meta/cardlist.props.default.json +9 -17
- package/{es/lowcode/engine/meta/button.props.json → lib/lowcode/engine/meta/components/button.json} +103 -126
- package/lib/lowcode/engine/meta/{cardlist.props.json → components/card-list.json} +142 -143
- package/lib/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -143
- package/lib/lowcode/engine/meta/{form.props.json → components/form.json} +115 -116
- package/{es/lowcode/engine/meta/iframe.props.json → lib/lowcode/engine/meta/components/iframe.json} +30 -31
- package/{es/lowcode/engine/meta/image.props.json → lib/lowcode/engine/meta/components/image.json} +112 -113
- package/{es/lowcode/engine/meta/imex.props.json → lib/lowcode/engine/meta/components/imex.json} +80 -81
- package/lib/lowcode/engine/meta/{jsx.props.json → components/jsx.json} +23 -24
- package/lib/lowcode/engine/meta/{layout.props.json → components/layout.json} +106 -107
- package/{es/lowcode/engine/meta/link.props.json → lib/lowcode/engine/meta/components/link.json} +110 -111
- package/lib/lowcode/engine/meta/{dialog.props.json → components/modal.json} +119 -120
- package/{es/lowcode/engine/meta/section.props.json → lib/lowcode/engine/meta/components/section.json} +106 -107
- package/{es/lowcode/engine/meta/split.props.json → lib/lowcode/engine/meta/components/split.json} +70 -71
- package/lib/lowcode/{view/lc-components/CardList/meta.json → engine/meta/components/table.json} +28 -11
- package/{es/lowcode/engine/meta/tabs.props.json → lib/lowcode/engine/meta/components/tabs.json} +139 -140
- package/{es/lowcode/engine/meta/text.props.json → lib/lowcode/engine/meta/components/text.json} +64 -65
- package/lib/lowcode/engine/meta/{tree.props.json → components/tree.json} +155 -156
- package/lib/lowcode/engine/meta/components-list.json +121 -127
- package/lib/lowcode/engine/meta/drawer.props.default.json +9 -17
- package/lib/lowcode/engine/meta/form.props.default.json +4 -12
- package/lib/lowcode/engine/meta/iframe.props.default.json +2 -10
- package/lib/lowcode/engine/meta/image.props.default.json +7 -15
- package/lib/lowcode/engine/meta/imex.props.default.json +3 -11
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -10
- package/lib/lowcode/engine/meta/layout.props.default.json +4 -12
- package/lib/lowcode/engine/meta/link.props.default.json +5 -13
- package/lib/lowcode/engine/meta/modal.props.default.json +11 -0
- package/lib/lowcode/engine/meta/section.props.default.json +8 -16
- package/lib/lowcode/engine/meta/split.props.default.json +4 -12
- package/lib/lowcode/engine/meta/table.props.default.json +9 -29
- package/lib/lowcode/engine/meta/tabs.props.default.json +9 -17
- package/lib/lowcode/engine/meta/text.props.default.json +3 -11
- package/lib/lowcode/engine/meta/tree.props.default.json +8 -16
- package/lib/lowcode/engine/provider/ContextProvider.js +41 -46
- package/lib/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/lib/lowcode/engine/tools/dataProcess.js +8 -86
- package/lib/lowcode/engine/tools/helper.js +0 -70
- package/lib/lowcode/engine/tools/lcid.js +22 -0
- package/lib/lowcode/index.js +1 -5
- package/lib/lowcode/painter/Design.js +84 -39
- package/lib/lowcode/painter/I18n.js +2 -203
- package/lib/lowcode/painter/Outline.js +53 -62
- package/lib/lowcode/painter/Panel.js +1 -238
- package/lib/lowcode/painter/Ribbon.js +64 -63
- package/lib/lowcode/painter/components/PanelItem.js +11 -84
- package/lib/lowcode/painter/components/RuleInput.js +7 -9
- package/lib/lowcode/painter/index.js +3 -35
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +48 -56
- package/lib/lowcode/painter/panel-section/Radio.js +65 -0
- package/lib/lowcode/painter/style/design.less +5 -116
- package/lib/lowcode/painter/style/index.less +1 -0
- package/lib/lowcode/painter/style/layout-ratio.less +1 -1
- package/lib/lowcode/painter/style/outline.less +0 -2
- package/lib/lowcode/painter/style/panel-item.less +12 -45
- package/lib/lowcode/painter/style/panel.less +0 -124
- package/lib/lowcode/painter/style/ribbon.less +0 -1
- package/lib/lowcode/view/Canvas.js +75 -84
- package/lib/lowcode/view/Page.js +27 -9
- package/lib/lowcode/view/index.js +6 -5
- package/lib/lowcode/view/lc-components/Box/index.js +6 -23
- package/lib/lowcode/view/lc-components/Button/index.js +8 -76
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -20
- package/lib/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/lib/lowcode/view/lc-components/Drawer/index.js +9 -22
- package/lib/lowcode/view/lc-components/Layout/index.js +8 -41
- package/lib/lowcode/view/lc-components/Table/index.js +8 -228
- package/lib/lowcode/view/lc-components/Wrapper.js +21 -30
- package/lib/lowcode/view/style/page.less +1 -0
- package/lib/services.js +25 -7
- package/lib/upload/Form/gridForm.js +5 -4
- package/lib/upload/FormItem/index.js +4 -3
- package/lib/utils/form.js +38 -3
- package/lib/utils/grid.js +11 -10
- package/package.json +6 -15
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -60
- package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +0 -53
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -21
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +0 -51
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +0 -42
- package/es/lowcode/engine/factory/panel-item-factory/index.js +0 -44
- package/es/lowcode/engine/meta/box.props.default.json +0 -12
- package/es/lowcode/engine/meta/box.props.json +0 -42
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -19
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +0 -29
- package/es/lowcode/engine/meta/table.props.json +0 -236
- package/es/lowcode/engine/tools/usePromiseState.js +0 -24
- package/es/lowcode/painter/DesignOperator.js +0 -271
- package/es/lowcode/painter/DesignToolbar.js +0 -91
- package/es/lowcode/painter/components/Collapse.js +0 -90
- package/es/lowcode/painter/components/ColorInput.js +0 -125
- package/es/lowcode/painter/components/ListEditor.js +0 -89
- package/es/lowcode/painter/components/NumberInput.js +0 -148
- package/es/lowcode/painter/components/PopConfirm.js +0 -23
- package/es/lowcode/painter/components/PopForm.js +0 -71
- package/es/lowcode/painter/components/SortBox.js +0 -92
- package/es/lowcode/painter/components/actions-editor/ActionEditor.js +0 -147
- package/es/lowcode/painter/components/actions-editor/index.js +0 -170
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +0 -96
- package/es/lowcode/painter/components/code-editor/CssEditor.js +0 -41
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +0 -87
- package/es/lowcode/painter/components/code-editor/JSEditor.js +0 -106
- package/es/lowcode/painter/components/code-editor/index.js +0 -2
- package/es/lowcode/painter/panel-section/ButtonType.js +0 -39
- package/es/lowcode/painter/panel-section/DataSetSelector.js +0 -61
- package/es/lowcode/painter/panel-section/Icon.js +0 -48
- package/es/lowcode/painter/panel-section/IconSelector.js +0 -134
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +0 -61
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +0 -150
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +0 -87
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +0 -66
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +0 -66
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +0 -296
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -543
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +0 -162
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +0 -386
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +0 -78
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +0 -23
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +0 -20
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +0 -23
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +0 -96
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +0 -60
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +0 -50
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +0 -61
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +0 -41
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +0 -216
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +0 -53
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +0 -148
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +0 -16
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +0 -51
- package/es/lowcode/painter/panel-section/StylePanel/index.js +0 -29
- package/es/lowcode/painter/panel-section/TabItems.js +0 -207
- package/es/lowcode/painter/panel-section/TableActions.js +0 -19
- package/es/lowcode/painter/panel-section/TableZebra.js +0 -14
- package/es/lowcode/painter/panel-section/WidthHeight.js +0 -39
- package/es/lowcode/painter/services/I18n.js +0 -85
- package/es/lowcode/painter/style/actions-editor.less +0 -16
- package/es/lowcode/painter/style/border-editor.less +0 -36
- package/es/lowcode/painter/style/border-radius-selector.less +0 -43
- package/es/lowcode/painter/style/border-selector.less +0 -40
- package/es/lowcode/painter/style/button-type.less +0 -5
- package/es/lowcode/painter/style/collapse.less +0 -22
- package/es/lowcode/painter/style/color-input.less +0 -19
- package/es/lowcode/painter/style/display.less +0 -17
- package/es/lowcode/painter/style/font-editor.less +0 -9
- package/es/lowcode/painter/style/fullscreen-editor.less +0 -17
- package/es/lowcode/painter/style/icon-selector.less +0 -22
- package/es/lowcode/painter/style/icon.less +0 -11
- package/es/lowcode/painter/style/list-editor.less +0 -59
- package/es/lowcode/painter/style/number-input.less +0 -17
- package/es/lowcode/painter/style/pop-confirm.less +0 -10
- package/es/lowcode/painter/style/pop-form.less +0 -20
- package/es/lowcode/painter/style/style-panel.less +0 -37
- package/es/lowcode/painter/style/tabitems.less +0 -90
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +0 -20
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Box/index.less +0 -15
- package/es/lowcode/view/lc-components/Box/meta.json +0 -42
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +0 -21
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Button/meta.json +0 -127
- package/es/lowcode/view/lc-components/Button/style.less +0 -3
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +0 -54
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -121
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +0 -20
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Drawer/index.less +0 -7
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -144
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Form/meta.json +0 -117
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Iframe/meta.json +0 -32
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/ImEx/meta.json +0 -82
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Image/meta.json +0 -114
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/JSX/meta.json +0 -25
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -75
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +0 -15
- package/es/lowcode/view/lc-components/Layout/index.less +0 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +0 -108
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Link/meta.json +0 -112
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Section/meta.json +0 -108
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Split/meta.json +0 -72
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +0 -18
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Table/meta.json +0 -225
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -141
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Text/meta.json +0 -66
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tree/meta.json +0 -157
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -73
- package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +0 -59
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -27
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +0 -57
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +0 -48
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +0 -50
- package/lib/lowcode/engine/meta/box.props.default.json +0 -12
- package/lib/lowcode/engine/meta/box.props.json +0 -42
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -19
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +0 -29
- package/lib/lowcode/engine/meta/table.props.json +0 -236
- package/lib/lowcode/engine/tools/usePromiseState.js +0 -31
- package/lib/lowcode/painter/DesignOperator.js +0 -278
- package/lib/lowcode/painter/DesignToolbar.js +0 -99
- package/lib/lowcode/painter/components/Collapse.js +0 -97
- package/lib/lowcode/painter/components/ColorInput.js +0 -132
- package/lib/lowcode/painter/components/ListEditor.js +0 -95
- package/lib/lowcode/painter/components/NumberInput.js +0 -155
- package/lib/lowcode/painter/components/PopConfirm.js +0 -29
- package/lib/lowcode/painter/components/PopForm.js +0 -77
- package/lib/lowcode/painter/components/SortBox.js +0 -99
- package/lib/lowcode/painter/components/actions-editor/ActionEditor.js +0 -155
- package/lib/lowcode/painter/components/actions-editor/index.js +0 -178
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +0 -103
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +0 -48
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +0 -94
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +0 -117
- package/lib/lowcode/painter/components/code-editor/index.js +0 -20
- package/lib/lowcode/painter/panel-section/ButtonType.js +0 -46
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +0 -69
- package/lib/lowcode/painter/panel-section/Icon.js +0 -54
- package/lib/lowcode/painter/panel-section/IconSelector.js +0 -141
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +0 -68
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +0 -158
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +0 -95
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +0 -73
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +0 -73
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +0 -303
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -550
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +0 -170
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +0 -392
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +0 -85
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +0 -29
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +0 -26
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +0 -29
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +0 -103
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +0 -67
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +0 -57
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +0 -68
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +0 -48
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +0 -224
- package/lib/lowcode/painter/panel-section/StylePanel/Size.js +0 -59
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +0 -159
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +0 -22
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +0 -58
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +0 -35
- package/lib/lowcode/painter/panel-section/TabItems.js +0 -215
- package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
- package/lib/lowcode/painter/panel-section/TableZebra.js +0 -21
- package/lib/lowcode/painter/panel-section/WidthHeight.js +0 -46
- package/lib/lowcode/painter/services/I18n.js +0 -95
- package/lib/lowcode/painter/style/actions-editor.less +0 -16
- package/lib/lowcode/painter/style/border-editor.less +0 -36
- package/lib/lowcode/painter/style/border-radius-selector.less +0 -43
- package/lib/lowcode/painter/style/border-selector.less +0 -40
- package/lib/lowcode/painter/style/button-type.less +0 -5
- package/lib/lowcode/painter/style/collapse.less +0 -22
- package/lib/lowcode/painter/style/color-input.less +0 -19
- package/lib/lowcode/painter/style/display.less +0 -17
- package/lib/lowcode/painter/style/font-editor.less +0 -9
- package/lib/lowcode/painter/style/fullscreen-editor.less +0 -17
- package/lib/lowcode/painter/style/icon-selector.less +0 -22
- package/lib/lowcode/painter/style/icon.less +0 -11
- package/lib/lowcode/painter/style/list-editor.less +0 -59
- package/lib/lowcode/painter/style/number-input.less +0 -17
- package/lib/lowcode/painter/style/pop-confirm.less +0 -10
- package/lib/lowcode/painter/style/pop-form.less +0 -20
- package/lib/lowcode/painter/style/style-panel.less +0 -37
- package/lib/lowcode/painter/style/tabitems.less +0 -90
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +0 -27
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Box/index.less +0 -15
- package/lib/lowcode/view/lc-components/Box/meta.json +0 -42
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +0 -28
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Button/meta.json +0 -127
- package/lib/lowcode/view/lc-components/Button/style.less +0 -3
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +0 -62
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -121
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +0 -27
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Drawer/index.less +0 -7
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -144
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Form/meta.json +0 -117
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Iframe/meta.json +0 -32
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/ImEx/meta.json +0 -82
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Image/meta.json +0 -114
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +0 -25
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -82
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +0 -22
- package/lib/lowcode/view/lc-components/Layout/index.less +0 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +0 -108
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Link/meta.json +0 -112
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Section/meta.json +0 -108
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Split/meta.json +0 -72
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +0 -25
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -225
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -141
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Text/meta.json +0 -66
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +0 -157
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import { useMemoizedFn } from 'ahooks';
|
|
3
|
-
import { Tooltip, Icon, Input, Segmented, Select } from 'luck-design/antd';
|
|
4
|
-
import { cloneDeep, debounce } from 'lodash';
|
|
5
|
-
import PopConfirm from "../../components/PopConfirm";
|
|
6
|
-
import { PopForm, PopFormItem, PopFormItemLeft, PopFormItemRight } from "../../components/PopForm";
|
|
7
|
-
import JSEditor from "../../components/code-editor/JSEditor";
|
|
8
|
-
import FullScreenEditor from "../../components/code-editor/FullScreenEditor";
|
|
9
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
10
|
-
import styles from "../../style/actions-editor.less";
|
|
11
|
-
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.actionEditor';
|
|
12
|
-
var _SERIAL_EFFECT_OPTIONS_ = [{
|
|
13
|
-
label: formatMessage({
|
|
14
|
-
id: "".concat(_I18N_PREFIX_, ".hidden"),
|
|
15
|
-
label: '隐藏'
|
|
16
|
-
}),
|
|
17
|
-
value: 'hidden'
|
|
18
|
-
}, {
|
|
19
|
-
label: formatMessage({
|
|
20
|
-
id: "".concat(_I18N_PREFIX_, ".disable"),
|
|
21
|
-
label: '禁用'
|
|
22
|
-
}),
|
|
23
|
-
value: 'disable'
|
|
24
|
-
}];
|
|
25
|
-
var _RISK_LEVEL_OPTIONS_ = [{
|
|
26
|
-
label: formatMessage({
|
|
27
|
-
id: "".concat(_I18N_PREFIX_, ".default"),
|
|
28
|
-
label: '一般'
|
|
29
|
-
}),
|
|
30
|
-
value: 'default'
|
|
31
|
-
}, {
|
|
32
|
-
label: formatMessage({
|
|
33
|
-
id: "".concat(_I18N_PREFIX_, ".danger"),
|
|
34
|
-
label: '危险'
|
|
35
|
-
}),
|
|
36
|
-
value: 'danger'
|
|
37
|
-
}, {
|
|
38
|
-
label: formatMessage({
|
|
39
|
-
id: "".concat(_I18N_PREFIX_, ".destroy"),
|
|
40
|
-
label: '毁灭'
|
|
41
|
-
}),
|
|
42
|
-
value: 'destroy'
|
|
43
|
-
}];
|
|
44
|
-
var ActionEditor = function ActionEditor(_ref) {
|
|
45
|
-
var action = _ref.action,
|
|
46
|
-
onChange = _ref.onChange;
|
|
47
|
-
var editorRef = useRef();
|
|
48
|
-
var valueRef = useRef(cloneDeep(action));
|
|
49
|
-
var handleCodeChange = useRef(debounce(function (code) {
|
|
50
|
-
valueRef.current.actionCode = code;
|
|
51
|
-
onChange(valueRef.current);
|
|
52
|
-
}, 400));
|
|
53
|
-
var handleChange = useMemoizedFn(function (field, value) {
|
|
54
|
-
valueRef.current[field] = value;
|
|
55
|
-
onChange(valueRef.current);
|
|
56
|
-
});
|
|
57
|
-
var handOnEditorLoad = useMemoizedFn(function () {
|
|
58
|
-
editorRef.current.editor.setValue(action.actionCode);
|
|
59
|
-
});
|
|
60
|
-
return /*#__PURE__*/React.createElement(PopForm, null, /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
61
|
-
id: "".concat(_I18N_PREFIX_, ".name"),
|
|
62
|
-
label: '名称'
|
|
63
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(Input, {
|
|
64
|
-
size: "small",
|
|
65
|
-
defaultValue: action.name,
|
|
66
|
-
onChange: function onChange(e) {
|
|
67
|
-
return handleChange('name', e.target.value);
|
|
68
|
-
},
|
|
69
|
-
placeholder: formatMessage({
|
|
70
|
-
id: "".concat(_I18N_PREFIX_, ".name.placeholder"),
|
|
71
|
-
label: '请输入行为名称'
|
|
72
|
-
})
|
|
73
|
-
}))), /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
74
|
-
id: "".concat(_I18N_PREFIX_, ".serial"),
|
|
75
|
-
label: '资源串'
|
|
76
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(Input, {
|
|
77
|
-
size: "small",
|
|
78
|
-
defaultValue: action.serial,
|
|
79
|
-
onChange: function onChange(e) {
|
|
80
|
-
return handleChange('serial', e.target.value);
|
|
81
|
-
},
|
|
82
|
-
placeholder: formatMessage({
|
|
83
|
-
id: "".concat(_I18N_PREFIX_, ".serial.placeholder"),
|
|
84
|
-
label: '请输入行为名称'
|
|
85
|
-
})
|
|
86
|
-
}))), /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
87
|
-
id: "".concat(_I18N_PREFIX_, ".serialEffect"),
|
|
88
|
-
label: '越权效果'
|
|
89
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(Segmented, {
|
|
90
|
-
size: "small",
|
|
91
|
-
options: _SERIAL_EFFECT_OPTIONS_,
|
|
92
|
-
value: action.serialEffect,
|
|
93
|
-
onChange: function onChange(value) {
|
|
94
|
-
return handleChange('serialEffect', value);
|
|
95
|
-
}
|
|
96
|
-
}))), /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
97
|
-
id: "".concat(_I18N_PREFIX_, ".serialEffect"),
|
|
98
|
-
label: '风险等级'
|
|
99
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, null, /*#__PURE__*/React.createElement(Segmented, {
|
|
100
|
-
size: "small",
|
|
101
|
-
options: _RISK_LEVEL_OPTIONS_,
|
|
102
|
-
value: action.riskLevel,
|
|
103
|
-
onChange: function onChange(value) {
|
|
104
|
-
return handleChange('riskLevel', value);
|
|
105
|
-
}
|
|
106
|
-
}))), /*#__PURE__*/React.createElement(PopFormItem, null, /*#__PURE__*/React.createElement(PopFormItemLeft, null, formatMessage({
|
|
107
|
-
id: "".concat(_I18N_PREFIX_, ".actionPool"),
|
|
108
|
-
label: '行为池'
|
|
109
|
-
})), /*#__PURE__*/React.createElement(PopFormItemRight, {
|
|
110
|
-
style: {
|
|
111
|
-
position: 'relative'
|
|
112
|
-
}
|
|
113
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
114
|
-
size: "small",
|
|
115
|
-
mode: "multiple",
|
|
116
|
-
className: styles['action-pool-selector'],
|
|
117
|
-
defaultValue: action.actionPool,
|
|
118
|
-
onChange: function onChange(value) {
|
|
119
|
-
return handleChange('actionPool', value);
|
|
120
|
-
}
|
|
121
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
122
|
-
value: "jack"
|
|
123
|
-
}, "Jack"), /*#__PURE__*/React.createElement(Select.Option, {
|
|
124
|
-
value: "lucy"
|
|
125
|
-
}, "Lucy"), /*#__PURE__*/React.createElement(Select.Option, {
|
|
126
|
-
value: "yiminghe"
|
|
127
|
-
}, "Yiminghe")), /*#__PURE__*/React.createElement(Tooltip, {
|
|
128
|
-
title: formatMessage({
|
|
129
|
-
id: 'luckda.lowcode.painter.coder',
|
|
130
|
-
label: '编码器'
|
|
131
|
-
})
|
|
132
|
-
}, /*#__PURE__*/React.createElement(PopConfirm, {
|
|
133
|
-
placement: "top",
|
|
134
|
-
title: /*#__PURE__*/React.createElement(FullScreenEditor, {
|
|
135
|
-
ref: editorRef,
|
|
136
|
-
EditorComponent: JSEditor,
|
|
137
|
-
width: "640px",
|
|
138
|
-
height: "300px",
|
|
139
|
-
onChange: handleCodeChange.current,
|
|
140
|
-
onLoad: handOnEditorLoad
|
|
141
|
-
})
|
|
142
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
143
|
-
type: "code",
|
|
144
|
-
className: styles['action-pool-coder']
|
|
145
|
-
}))))));
|
|
146
|
-
};
|
|
147
|
-
export default ActionEditor;
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useRef, useReducer } from 'react';
|
|
3
|
-
import { useMemoizedFn } from 'ahooks';
|
|
4
|
-
import { Tooltip, Icon, Segmented, InputNumber } from 'luck-design/antd';
|
|
5
|
-
import { cloneDeep } from 'lodash';
|
|
6
|
-
import ActionEditor from "./ActionEditor";
|
|
7
|
-
import PanelItem from "../PanelItem";
|
|
8
|
-
import { SortBox, SortItem } from "../../components/SortBox";
|
|
9
|
-
import { ListEditor, ListEditorItem } from "../../components/ListEditor";
|
|
10
|
-
import PopConfirm from "../../components/PopConfirm";
|
|
11
|
-
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
12
|
-
import { listReducer } from "../../../engine/tools/helper";
|
|
13
|
-
import styles from "../../style/actions-editor.less";
|
|
14
|
-
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.actionsEditor';
|
|
15
|
-
var _DISPLAY_OPTIONS_ = [{
|
|
16
|
-
label: formatMessage({
|
|
17
|
-
id: "".concat(_I18N_PREFIX_, ".button"),
|
|
18
|
-
label: '按钮'
|
|
19
|
-
}),
|
|
20
|
-
value: 'button'
|
|
21
|
-
}, {
|
|
22
|
-
label: formatMessage({
|
|
23
|
-
id: "".concat(_I18N_PREFIX_, ".text"),
|
|
24
|
-
label: '文本'
|
|
25
|
-
}),
|
|
26
|
-
value: 'text'
|
|
27
|
-
}];
|
|
28
|
-
var ActionsEditor = function ActionsEditor(_ref) {
|
|
29
|
-
var defaultValue = _ref.defaultValue,
|
|
30
|
-
onChange = _ref.onChange;
|
|
31
|
-
var valueRef = useRef(cloneDeep(defaultValue));
|
|
32
|
-
var _useReducer = useReducer(listReducer, defaultValue.todoList || []),
|
|
33
|
-
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
34
|
-
todoList = _useReducer2[0],
|
|
35
|
-
dispatch = _useReducer2[1];
|
|
36
|
-
var handleAdd = useMemoizedFn(function () {
|
|
37
|
-
dispatch({
|
|
38
|
-
type: 'add',
|
|
39
|
-
payload: {
|
|
40
|
-
id: suid(),
|
|
41
|
-
name: "\u64CD\u4F5C".concat(todoList.length + 1),
|
|
42
|
-
serial: void 0,
|
|
43
|
-
serialEffect: 'hidden',
|
|
44
|
-
riskLevel: 'default',
|
|
45
|
-
actionPool: [],
|
|
46
|
-
actionCode: void 0
|
|
47
|
-
},
|
|
48
|
-
callback: function callback(newActions) {
|
|
49
|
-
valueRef.current.todoList = newActions;
|
|
50
|
-
onChange(valueRef.current);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
var handleSortChange = useMemoizedFn(function (sortItems) {
|
|
55
|
-
dispatch({
|
|
56
|
-
type: 'sort',
|
|
57
|
-
payload: sortItems,
|
|
58
|
-
callback: function callback(newActions) {
|
|
59
|
-
valueRef.current.todoList = newActions;
|
|
60
|
-
onChange(valueRef.current);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
var handleValueChange = useMemoizedFn(function (field, value) {
|
|
65
|
-
if (field === 'action') {
|
|
66
|
-
dispatch({
|
|
67
|
-
type: 'edit',
|
|
68
|
-
payload: {
|
|
69
|
-
id: value.id,
|
|
70
|
-
data: value
|
|
71
|
-
},
|
|
72
|
-
callback: function callback(newActions) {
|
|
73
|
-
valueRef.current.todoList = newActions;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
} else {
|
|
77
|
-
valueRef.current[field] = value;
|
|
78
|
-
}
|
|
79
|
-
onChange(valueRef.current);
|
|
80
|
-
});
|
|
81
|
-
var renderItemRight = useMemoizedFn(function (action) {
|
|
82
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
83
|
-
title: formatMessage({
|
|
84
|
-
id: 'luckda.lowcode.painter.edit',
|
|
85
|
-
label: '编辑'
|
|
86
|
-
})
|
|
87
|
-
}, /*#__PURE__*/React.createElement(PopConfirm, {
|
|
88
|
-
placement: "left",
|
|
89
|
-
title: /*#__PURE__*/React.createElement(ActionEditor, {
|
|
90
|
-
action: action,
|
|
91
|
-
onChange: function onChange(value) {
|
|
92
|
-
return handleValueChange('action', value);
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
96
|
-
type: "edit",
|
|
97
|
-
style: {
|
|
98
|
-
marginRight: '8px',
|
|
99
|
-
cursor: 'pointer'
|
|
100
|
-
}
|
|
101
|
-
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
102
|
-
title: formatMessage({
|
|
103
|
-
id: 'luckda.lowcode.painter.delete',
|
|
104
|
-
label: '删除'
|
|
105
|
-
})
|
|
106
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
107
|
-
type: "delete",
|
|
108
|
-
style: {
|
|
109
|
-
marginRight: '8px',
|
|
110
|
-
cursor: 'pointer'
|
|
111
|
-
}
|
|
112
|
-
})));
|
|
113
|
-
});
|
|
114
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: styles['lc-painter-panel-section-components-actionsEditor']
|
|
116
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
style: {
|
|
118
|
-
width: '100%',
|
|
119
|
-
padding: '0 16px'
|
|
120
|
-
}
|
|
121
|
-
}, /*#__PURE__*/React.createElement(PanelItem, {
|
|
122
|
-
suppressPadding: true,
|
|
123
|
-
label: formatMessage({
|
|
124
|
-
id: "".concat(_I18N_PREFIX_, ".display"),
|
|
125
|
-
label: '展现形式'
|
|
126
|
-
})
|
|
127
|
-
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
128
|
-
size: "small",
|
|
129
|
-
options: _DISPLAY_OPTIONS_,
|
|
130
|
-
defaultValue: defaultValue.display,
|
|
131
|
-
onChange: function onChange(value) {
|
|
132
|
-
return handleValueChange('display', value);
|
|
133
|
-
}
|
|
134
|
-
})), /*#__PURE__*/React.createElement(PanelItem, {
|
|
135
|
-
suppressPadding: true,
|
|
136
|
-
label: formatMessage({
|
|
137
|
-
id: "".concat(_I18N_PREFIX_, ".max"),
|
|
138
|
-
label: '最大显示数'
|
|
139
|
-
})
|
|
140
|
-
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
141
|
-
size: "small",
|
|
142
|
-
defaultValue: defaultValue.max,
|
|
143
|
-
onChange: function onChange(value) {
|
|
144
|
-
return handleValueChange('max', value);
|
|
145
|
-
}
|
|
146
|
-
})), /*#__PURE__*/React.createElement(SortBox, {
|
|
147
|
-
datas: todoList.map(function (_ref2) {
|
|
148
|
-
var id = _ref2.id;
|
|
149
|
-
return id;
|
|
150
|
-
}),
|
|
151
|
-
onChange: handleSortChange
|
|
152
|
-
}, /*#__PURE__*/React.createElement(ListEditor, {
|
|
153
|
-
addText: formatMessage({
|
|
154
|
-
id: "".concat(_I18N_PREFIX_, ".add"),
|
|
155
|
-
label: '添加操作'
|
|
156
|
-
}),
|
|
157
|
-
handleAdd: handleAdd
|
|
158
|
-
}, todoList.map(function (action) {
|
|
159
|
-
return /*#__PURE__*/React.createElement(SortItem, {
|
|
160
|
-
key: action.id,
|
|
161
|
-
id: action.id
|
|
162
|
-
}, /*#__PURE__*/React.createElement(ListEditorItem, {
|
|
163
|
-
left: /*#__PURE__*/React.createElement("span", null, action.name),
|
|
164
|
-
right: renderItemRight(action),
|
|
165
|
-
item: action,
|
|
166
|
-
dispatch: dispatch
|
|
167
|
-
}));
|
|
168
|
-
})))));
|
|
169
|
-
};
|
|
170
|
-
export default ActionsEditor;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["onChange", "isFullscreen"],
|
|
5
|
-
_excluded2 = ["children", "language", "options"];
|
|
6
|
-
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
7
|
-
import * as monaco from 'monaco-editor';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* BaseEditor 组件是一个封装了 monaco 编辑器的 React 组件,支持前向 ref 引用。
|
|
11
|
-
* 该组件允许用户编辑代码,并在代码发生变更时触发回调函数。
|
|
12
|
-
* 它还支持通过 props 控制编辑器的语言、选项以及是否全屏显示。
|
|
13
|
-
*
|
|
14
|
-
* @component
|
|
15
|
-
* @example
|
|
16
|
-
* const handleEditorChange = (newValue, event) => {
|
|
17
|
-
* console.log('Editor content changed: ', newValue);
|
|
18
|
-
* };
|
|
19
|
-
* <BaseEditor
|
|
20
|
-
* language="javascript"
|
|
21
|
-
* onChange={handleEditorChange}
|
|
22
|
-
* isFullscreen={false}
|
|
23
|
-
* width="600px"
|
|
24
|
-
* height="400px"
|
|
25
|
-
* >
|
|
26
|
-
* {`function sayHello() {\n console.log('Hello, World!');\n}`}
|
|
27
|
-
* </BaseEditor>
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} props - 组件的属性。
|
|
30
|
-
* @param {Function} props.onChange - 当编辑器内容变更时调用的函数。接收最新的编辑器内容和事件对象作为参数。
|
|
31
|
-
* @param {boolean} props.isFullscreen - 控制编辑器是否全屏显示。
|
|
32
|
-
* @param {string} [props.language='javascript'] - 设置编辑器的编程语言,默认为 'javascript'。
|
|
33
|
-
* @param {Object} [props.options={}] - 用于自定义编辑器的选项。
|
|
34
|
-
* @param {React.ReactNode} children - 子组件,通常是编辑器的初始代码。
|
|
35
|
-
* @param {string} [props.width] - 编辑器的宽度,默认为 '100%'。
|
|
36
|
-
* @param {string} [props.height] - 编辑器的高度,默认为 '100%'。
|
|
37
|
-
* @param {Object} rest - 传递给 div 容器的其它属性。
|
|
38
|
-
* @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
|
|
39
|
-
*
|
|
40
|
-
* @returns {ReactElement} 返回一个 React 元素,其中包含了一个配置好的 monaco 编辑器实例。
|
|
41
|
-
*/
|
|
42
|
-
var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
|
-
var onChange = _ref.onChange,
|
|
44
|
-
isFullscreen = _ref.isFullscreen,
|
|
45
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
var children = props.children,
|
|
47
|
-
_props$language = props.language,
|
|
48
|
-
language = _props$language === void 0 ? 'javascript' : _props$language,
|
|
49
|
-
_props$options = props.options,
|
|
50
|
-
options = _props$options === void 0 ? {} : _props$options,
|
|
51
|
-
rest = _objectWithoutProperties(props, _excluded2);
|
|
52
|
-
var editorRef = useRef(null);
|
|
53
|
-
var editorInstance = useRef(null);
|
|
54
|
-
|
|
55
|
-
// 初始化编辑器实例
|
|
56
|
-
useEffect(function () {
|
|
57
|
-
if (editorRef.current) {
|
|
58
|
-
var code = React.Children.toArray(children).join('').trim();
|
|
59
|
-
editorInstance.current = monaco.editor.create(editorRef.current, _objectSpread({
|
|
60
|
-
value: code,
|
|
61
|
-
language: language,
|
|
62
|
-
automaticLayout: true
|
|
63
|
-
}, options));
|
|
64
|
-
editorInstance.current.onDidChangeModelContent(function (event) {
|
|
65
|
-
if (onChange) onChange(editorInstance.current.getValue(), event);
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return function () {
|
|
69
|
-
var _editorInstance$curre;
|
|
70
|
-
return (_editorInstance$curre = editorInstance.current) === null || _editorInstance$curre === void 0 ? void 0 : _editorInstance$curre.dispose();
|
|
71
|
-
};
|
|
72
|
-
}, [children, language, options]);
|
|
73
|
-
|
|
74
|
-
// 使用 ref 暴露组件方法
|
|
75
|
-
useImperativeHandle(ref, function () {
|
|
76
|
-
return {
|
|
77
|
-
get editor() {
|
|
78
|
-
return editorInstance.current;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// 根据是否全屏来设置编辑器的样式
|
|
84
|
-
var editorStyle = isFullscreen ? {
|
|
85
|
-
width: '100vw',
|
|
86
|
-
height: '100vh'
|
|
87
|
-
} : {
|
|
88
|
-
width: props.width || '100%',
|
|
89
|
-
height: props.height || '100%'
|
|
90
|
-
};
|
|
91
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
92
|
-
ref: editorRef,
|
|
93
|
-
style: editorStyle
|
|
94
|
-
}, rest));
|
|
95
|
-
});
|
|
96
|
-
export default /*#__PURE__*/React.memo(BaseEditor);
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children"];
|
|
4
|
-
import React, { forwardRef } from 'react';
|
|
5
|
-
import BaseEditor from "./BaseEditor";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* CssEditor 组件是一个专门用于编辑 CSS 代码的 React 组件,它基于 BaseEditor 组件构建。
|
|
9
|
-
* 该组件通过将 language 属性固定设置为 "css",确保编辑器环境专门用于 CSS 代码编辑。
|
|
10
|
-
* 用户可以传入 CSS 代码作为 children,并通过其他 props 控制 BaseEditor 提供的额外功能。
|
|
11
|
-
*
|
|
12
|
-
* @component
|
|
13
|
-
* @example
|
|
14
|
-
* const handleCssChange = (newCss, event) => {
|
|
15
|
-
* console.log('CSS changed: ', newCss);
|
|
16
|
-
* };
|
|
17
|
-
* <CssEditor
|
|
18
|
-
* onChange={handleCssChange}
|
|
19
|
-
* isFullscreen={false}
|
|
20
|
-
* width="600px"
|
|
21
|
-
* height="400px"
|
|
22
|
-
* >
|
|
23
|
-
* {`body { margin: 0; font-family: Arial, sans-serif; }`}
|
|
24
|
-
* </CssEditor>
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} props - 组件的属性。
|
|
27
|
-
* @param {React.ReactNode} children - 子组件,通常是编辑器的初始 CSS 代码。
|
|
28
|
-
* @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
|
|
29
|
-
* @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
|
|
30
|
-
*
|
|
31
|
-
* @returns {ReactElement} 返回一个 React 元素,该元素内部是一个专门用于 CSS 编辑的 BaseEditor 组件实例。
|
|
32
|
-
*/
|
|
33
|
-
var CssEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
|
-
var children = _ref.children,
|
|
35
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
-
return /*#__PURE__*/React.createElement(BaseEditor, _extends({
|
|
37
|
-
ref: ref,
|
|
38
|
-
language: "css"
|
|
39
|
-
}, rest), children);
|
|
40
|
-
});
|
|
41
|
-
export default /*#__PURE__*/React.memo(CssEditor);
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["EditorComponent", "onLoad", "children"];
|
|
5
|
-
import React, { useEffect, forwardRef, useRef } from 'react';
|
|
6
|
-
import { Tooltip, Icon } from 'luck-design/antd';
|
|
7
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
8
|
-
import styles from "../../style/fullscreen-editor.less";
|
|
9
|
-
import { useFullscreen } from 'ahooks';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* FullScreenEditor 组件是一个支持全屏编辑模式的 React 组件,它利用提供的 EditorComponent 来实现代码编辑功能。
|
|
13
|
-
* 该组件使用 ahooks 的 useFullscreen 钩子来实现全屏切换,并在全屏模式下调整编辑器布局。
|
|
14
|
-
* 全屏/非全屏模式下编辑器的某些选项可能会有所不同,以适应不同的布局需求。
|
|
15
|
-
*
|
|
16
|
-
* @component
|
|
17
|
-
* @example
|
|
18
|
-
* const MyEditor = React.forwardRef((props, ref) => <BaseEditor {...props} ref={ref} />);
|
|
19
|
-
* <FullScreenEditor
|
|
20
|
-
* EditorComponent={MyEditor}
|
|
21
|
-
* onLoad={() => console.log('Editor loaded')}
|
|
22
|
-
* >
|
|
23
|
-
* {`function sayHello() {\n console.log('Hello, World!');\n}`}
|
|
24
|
-
* </FullScreenEditor>
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} props - 组件的属性。
|
|
27
|
-
* @param {Function} props.EditorComponent - 用于编辑的组件,该组件需要支持 ref 引用以调用编辑器的方法。
|
|
28
|
-
* @param {Function} [props.onLoad] - 编辑器加载完成时的回调函数。
|
|
29
|
-
* @param {React.ReactNode} children - 传递给 EditorComponent 的 children,通常是初始代码或内容。
|
|
30
|
-
* @param {Object} rest - 传递给 EditorComponent 的其他属性。
|
|
31
|
-
* @param {React.Ref} ref - React ref 引用,用于在外部组件中访问 EditorComponent 实例的方法。
|
|
32
|
-
*
|
|
33
|
-
* @returns {ReactElement} 返回一个 React 元素,其中包含了一个具有全屏切换功能的编辑器界面。
|
|
34
|
-
*/
|
|
35
|
-
var FullScreenEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
|
-
var EditorComponent = _ref.EditorComponent,
|
|
37
|
-
onLoad = _ref.onLoad,
|
|
38
|
-
children = _ref.children,
|
|
39
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
-
var fullscreenRef = useRef(null);
|
|
41
|
-
var _useFullscreen = useFullscreen(fullscreenRef),
|
|
42
|
-
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
43
|
-
isFullscreen = _useFullscreen2[0],
|
|
44
|
-
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
45
|
-
var handleFullscreen = function handleFullscreen() {
|
|
46
|
-
toggleFullscreen();
|
|
47
|
-
};
|
|
48
|
-
useEffect(function () {
|
|
49
|
-
if (onLoad) onLoad();
|
|
50
|
-
}, []);
|
|
51
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: styles['lc-painter-components-fullscreen-editor']
|
|
53
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: styles['actions']
|
|
55
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
56
|
-
title: formatMessage({
|
|
57
|
-
id: 'luckda.lowcode.painter.components.fullscreen.tip',
|
|
58
|
-
label: '全屏'
|
|
59
|
-
})
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
61
|
-
type: "fullscreen",
|
|
62
|
-
onClick: handleFullscreen
|
|
63
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: isFullscreen ? styles['fullscreen'] : '',
|
|
65
|
-
ref: fullscreenRef
|
|
66
|
-
}, /*#__PURE__*/React.createElement(EditorComponent, _extends({
|
|
67
|
-
ref: ref,
|
|
68
|
-
isFullscreen: isFullscreen,
|
|
69
|
-
options: isFullscreen ? {} : {
|
|
70
|
-
lineNumbers: 'off',
|
|
71
|
-
glyphMargin: false,
|
|
72
|
-
folding: false,
|
|
73
|
-
lineDecorationsWidth: 0,
|
|
74
|
-
lineNumbersMinChars: 0,
|
|
75
|
-
minimap: {
|
|
76
|
-
enabled: false
|
|
77
|
-
},
|
|
78
|
-
overviewRulerLanes: 0,
|
|
79
|
-
scrollbar: {
|
|
80
|
-
vertical: 'hidden',
|
|
81
|
-
horizontal: 'hidden',
|
|
82
|
-
handleMouseWheel: false
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, props), children)));
|
|
86
|
-
});
|
|
87
|
-
export default /*#__PURE__*/React.memo(FullScreenEditor);
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
|
-
var _excluded = ["children"];
|
|
7
|
-
import React, { useEffect, forwardRef } from 'react';
|
|
8
|
-
import BaseEditor from "./BaseEditor";
|
|
9
|
-
import * as monaco from 'monaco-editor';
|
|
10
|
-
var _provideCompletionItems = function provideCompletionItems(monaco, model, position, module) {
|
|
11
|
-
var textUntilPosition = model.getValueInRange({
|
|
12
|
-
startLineNumber: position.lineNumber,
|
|
13
|
-
startColumn: 1,
|
|
14
|
-
endLineNumber: position.lineNumber,
|
|
15
|
-
endColumn: position.column
|
|
16
|
-
});
|
|
17
|
-
if (textUntilPosition.endsWith(module.triggerWord + '.')) {
|
|
18
|
-
var word = model.getWordUntilPosition(position);
|
|
19
|
-
var range = {
|
|
20
|
-
startLineNumber: position.lineNumber,
|
|
21
|
-
endLineNumber: position.lineNumber,
|
|
22
|
-
startColumn: word.startColumn,
|
|
23
|
-
endColumn: word.endColumn
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
// 从模块中调用 completions 函数获取补全项数组
|
|
27
|
-
// 并动态转换 kind 字段
|
|
28
|
-
return module.completions.map(function (completion) {
|
|
29
|
-
return Object.assign({}, completion, {
|
|
30
|
-
range: range,
|
|
31
|
-
// 动态转换 kind 字段
|
|
32
|
-
kind: monaco.languages.CompletionItemKind[completion.kind]
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return [];
|
|
37
|
-
};
|
|
38
|
-
var setupAutocomplete = /*#__PURE__*/function () {
|
|
39
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(monaco) {
|
|
40
|
-
var autoCompleteModules;
|
|
41
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
42
|
-
while (1) switch (_context.prev = _context.next) {
|
|
43
|
-
case 0:
|
|
44
|
-
_context.next = 2;
|
|
45
|
-
return import("../../../engine/meta/js-editor/auto-complete.json");
|
|
46
|
-
case 2:
|
|
47
|
-
autoCompleteModules = _context.sent;
|
|
48
|
-
console.log('autoCompleteModules', autoCompleteModules);
|
|
49
|
-
monaco.languages.registerCompletionItemProvider('javascript', _defineProperty({
|
|
50
|
-
triggerCharacters: ['.'],
|
|
51
|
-
provideCompletionItems: function provideCompletionItems(model, position) {
|
|
52
|
-
var allCompletionItems = [];
|
|
53
|
-
|
|
54
|
-
// 从所有模块收集补全项
|
|
55
|
-
autoCompleteModules.default.forEach(function (module) {
|
|
56
|
-
var items = _provideCompletionItems(monaco, model, position, module);
|
|
57
|
-
allCompletionItems = allCompletionItems.concat(items);
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
suggestions: allCompletionItems
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}, "triggerCharacters", ['.']));
|
|
64
|
-
case 5:
|
|
65
|
-
case "end":
|
|
66
|
-
return _context.stop();
|
|
67
|
-
}
|
|
68
|
-
}, _callee);
|
|
69
|
-
}));
|
|
70
|
-
return function setupAutocomplete(_x) {
|
|
71
|
-
return _ref.apply(this, arguments);
|
|
72
|
-
};
|
|
73
|
-
}();
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* JSEditor 组件是一个专为 JavaScript 编辑设计的 React 组件,它基于 BaseEditor 组件构建,并集成了自动完成功能。
|
|
77
|
-
* 该组件利用 monaco-editor 提供的 API,通过 setupAutocomplete 函数设置自动完成项,从而增强代码编辑体验。
|
|
78
|
-
* 自动完成逻辑包括从预定义的自动完成模块中加载补全项,以及在编辑器中键入特定字符(如".")时触发补全建议。
|
|
79
|
-
*
|
|
80
|
-
* @component
|
|
81
|
-
* @example
|
|
82
|
-
* <JSEditor
|
|
83
|
-
* language="javascript"
|
|
84
|
-
* options={{ fontSize: 14 }}
|
|
85
|
-
* >
|
|
86
|
-
* {`function sayHello() {\n console.log('Hello, World!');\n}`}
|
|
87
|
-
* </JSEditor>
|
|
88
|
-
*
|
|
89
|
-
* @param {Object} props - 组件的属性。
|
|
90
|
-
* @param {React.ReactNode} children - 传递给 BaseEditor 的 children,通常是初始代码或内容。
|
|
91
|
-
* @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
|
|
92
|
-
* @param {React.Ref} ref - React ref 引用,用于在外部组件中访问 BaseEditor 实例的方法。
|
|
93
|
-
*
|
|
94
|
-
* @returns {ReactElement} 返回一个 React 元素,其中包含了一个具有自动完成功能的 JavaScript 编辑器实例。
|
|
95
|
-
*/
|
|
96
|
-
var JSEditor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
97
|
-
var children = _ref2.children,
|
|
98
|
-
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
99
|
-
useEffect(function () {
|
|
100
|
-
setupAutocomplete(monaco);
|
|
101
|
-
}, []);
|
|
102
|
-
return /*#__PURE__*/React.createElement(BaseEditor, _extends({
|
|
103
|
-
ref: ref
|
|
104
|
-
}, rest));
|
|
105
|
-
});
|
|
106
|
-
export default /*#__PURE__*/React.memo(JSEditor);
|