@formily-design/react 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +20 -0
- package/README.md +1 -0
- package/copy.ts +6 -0
- package/dist/designable.react.umd.production.css +1 -0
- package/dist/designable.react.umd.production.js +6 -0
- package/dist/designable.react.umd.production.min.css +1 -0
- package/dist/designable.react.umd.production.min.js +3769 -0
- package/esm/containers/Designer.d.ts +3 -0
- package/esm/containers/Designer.js +38 -0
- package/esm/containers/Layout.d.ts +3 -0
- package/esm/containers/Layout.js +32 -0
- package/esm/containers/Simulator.d.ts +3 -0
- package/esm/containers/Simulator.js +18 -0
- package/esm/containers/Viewport.d.ts +6 -0
- package/esm/containers/Viewport.js +49 -0
- package/esm/containers/Workbench.d.ts +4 -0
- package/esm/containers/Workbench.js +9 -0
- package/esm/containers/Workspace.d.ts +8 -0
- package/esm/containers/Workspace.js +26 -0
- package/esm/containers/index.d.ts +7 -0
- package/esm/containers/index.js +7 -0
- package/esm/containers/styles.less +19 -0
- package/esm/context.d.ts +7 -0
- package/esm/context.js +6 -0
- package/esm/hooks/index.d.ts +25 -0
- package/esm/hooks/index.js +25 -0
- package/esm/hooks/useComponents.d.ts +1 -0
- package/esm/hooks/useComponents.js +3 -0
- package/esm/hooks/useCursor.d.ts +1 -0
- package/esm/hooks/useCursor.js +5 -0
- package/esm/hooks/useDesigner.d.ts +5 -0
- package/esm/hooks/useDesigner.js +13 -0
- package/esm/hooks/useHistory.d.ts +1 -0
- package/esm/hooks/useHistory.js +5 -0
- package/esm/hooks/useHover.d.ts +1 -0
- package/esm/hooks/useHover.js +5 -0
- package/esm/hooks/useLayout.d.ts +2 -0
- package/esm/hooks/useLayout.js +7 -0
- package/esm/hooks/useMoveHelper.d.ts +1 -0
- package/esm/hooks/useMoveHelper.js +5 -0
- package/esm/hooks/useNodeIdProps.d.ts +4 -0
- package/esm/hooks/useNodeIdProps.js +9 -0
- package/esm/hooks/useOperation.d.ts +1 -0
- package/esm/hooks/useOperation.js +5 -0
- package/esm/hooks/useOutline.d.ts +1 -0
- package/esm/hooks/useOutline.js +5 -0
- package/esm/hooks/usePosition.d.ts +1 -0
- package/esm/hooks/usePosition.js +5 -0
- package/esm/hooks/usePrefix.d.ts +1 -0
- package/esm/hooks/usePrefix.js +5 -0
- package/esm/hooks/useRegistry.d.ts +2 -0
- package/esm/hooks/useRegistry.js +5 -0
- package/esm/hooks/useScreen.d.ts +1 -0
- package/esm/hooks/useScreen.js +4 -0
- package/esm/hooks/useSelected.d.ts +1 -0
- package/esm/hooks/useSelected.js +5 -0
- package/esm/hooks/useSelectedNode.d.ts +6 -0
- package/esm/hooks/useSelectedNode.js +13 -0
- package/esm/hooks/useSelection.d.ts +1 -0
- package/esm/hooks/useSelection.js +5 -0
- package/esm/hooks/useTheme.d.ts +1 -0
- package/esm/hooks/useTheme.js +5 -0
- package/esm/hooks/useTransformHelper.d.ts +1 -0
- package/esm/hooks/useTransformHelper.js +5 -0
- package/esm/hooks/useTree.d.ts +1 -0
- package/esm/hooks/useTree.js +5 -0
- package/esm/hooks/useTreeNode.d.ts +1 -0
- package/esm/hooks/useTreeNode.js +5 -0
- package/esm/hooks/useValidNodeOffsetRect.d.ts +2 -0
- package/esm/hooks/useValidNodeOffsetRect.js +37 -0
- package/esm/hooks/useViewport.d.ts +1 -0
- package/esm/hooks/useViewport.js +5 -0
- package/esm/hooks/useWorkbench.d.ts +1 -0
- package/esm/hooks/useWorkbench.js +5 -0
- package/esm/hooks/useWorkspace.d.ts +2 -0
- package/esm/hooks/useWorkspace.js +15 -0
- package/esm/icons/actions.d.ts +7 -0
- package/esm/icons/actions.js +28 -0
- package/esm/icons/add.d.ts +2 -0
- package/esm/icons/add.js +4 -0
- package/esm/icons/animations.d.ts +24 -0
- package/esm/icons/animations.js +323 -0
- package/esm/icons/boolean.d.ts +2 -0
- package/esm/icons/boolean.js +3 -0
- package/esm/icons/clone.d.ts +3 -0
- package/esm/icons/clone.js +3 -0
- package/esm/icons/close.d.ts +2 -0
- package/esm/icons/close.js +3 -0
- package/esm/icons/code.d.ts +2 -0
- package/esm/icons/code.js +2 -0
- package/esm/icons/command.d.ts +2 -0
- package/esm/icons/command.js +4 -0
- package/esm/icons/component.d.ts +2 -0
- package/esm/icons/component.js +2 -0
- package/esm/icons/container.d.ts +2 -0
- package/esm/icons/container.js +4 -0
- package/esm/icons/corner.d.ts +5 -0
- package/esm/icons/corner.js +5 -0
- package/esm/icons/delete.d.ts +2 -0
- package/esm/icons/delete.js +5 -0
- package/esm/icons/design.d.ts +2 -0
- package/esm/icons/design.js +3 -0
- package/esm/icons/display.d.ts +5 -0
- package/esm/icons/display.js +5 -0
- package/esm/icons/dragmove.d.ts +2 -0
- package/esm/icons/dragmove.js +3 -0
- package/esm/icons/expand.d.ts +2 -0
- package/esm/icons/expand.js +2 -0
- package/esm/icons/expression.d.ts +2 -0
- package/esm/icons/expression.js +2 -0
- package/esm/icons/eyes.d.ts +3 -0
- package/esm/icons/eyes.js +7 -0
- package/esm/icons/flex.d.ts +22 -0
- package/esm/icons/flex.js +22 -0
- package/esm/icons/flip.d.ts +2 -0
- package/esm/icons/flip.js +2 -0
- package/esm/icons/focus.d.ts +2 -0
- package/esm/icons/focus.js +2 -0
- package/esm/icons/font.d.ts +16 -0
- package/esm/icons/font.js +16 -0
- package/esm/icons/formula.d.ts +2 -0
- package/esm/icons/formula.js +2 -0
- package/esm/icons/freemove.d.ts +2 -0
- package/esm/icons/freemove.js +3 -0
- package/esm/icons/help.d.ts +2 -0
- package/esm/icons/help.js +4 -0
- package/esm/icons/hidden.d.ts +2 -0
- package/esm/icons/hidden.js +2 -0
- package/esm/icons/history.d.ts +2 -0
- package/esm/icons/history.js +3 -0
- package/esm/icons/image.d.ts +3 -0
- package/esm/icons/image.js +3 -0
- package/esm/icons/index.d.ts +53 -0
- package/esm/icons/index.js +53 -0
- package/esm/icons/json.d.ts +2 -0
- package/esm/icons/json.js +2 -0
- package/esm/icons/logo.d.ts +4 -0
- package/esm/icons/logo.js +4 -0
- package/esm/icons/menu.d.ts +2 -0
- package/esm/icons/menu.js +3 -0
- package/esm/icons/mobile.d.ts +2 -0
- package/esm/icons/mobile.js +4 -0
- package/esm/icons/move.d.ts +2 -0
- package/esm/icons/move.js +2 -0
- package/esm/icons/number.d.ts +2 -0
- package/esm/icons/number.js +3 -0
- package/esm/icons/outline.d.ts +2 -0
- package/esm/icons/outline.js +2 -0
- package/esm/icons/page.d.ts +2 -0
- package/esm/icons/page.js +5 -0
- package/esm/icons/pc.d.ts +2 -0
- package/esm/icons/pc.js +3 -0
- package/esm/icons/play.d.ts +2 -0
- package/esm/icons/play.js +2 -0
- package/esm/icons/position.d.ts +6 -0
- package/esm/icons/position.js +6 -0
- package/esm/icons/pushpin.d.ts +3 -0
- package/esm/icons/pushpin.js +5 -0
- package/esm/icons/recover.d.ts +2 -0
- package/esm/icons/recover.js +2 -0
- package/esm/icons/redo.d.ts +2 -0
- package/esm/icons/redo.js +2 -0
- package/esm/icons/remove.d.ts +2 -0
- package/esm/icons/remove.js +2 -0
- package/esm/icons/responsive.d.ts +2 -0
- package/esm/icons/responsive.js +5 -0
- package/esm/icons/return.d.ts +2 -0
- package/esm/icons/return.js +2 -0
- package/esm/icons/selection.d.ts +2 -0
- package/esm/icons/selection.js +2 -0
- package/esm/icons/setting.d.ts +2 -0
- package/esm/icons/setting.js +2 -0
- package/esm/icons/shadow.d.ts +5 -0
- package/esm/icons/shadow.js +5 -0
- package/esm/icons/shift.d.ts +2 -0
- package/esm/icons/shift.js +2 -0
- package/esm/icons/sources.d.ts +75 -0
- package/esm/icons/sources.js +544 -0
- package/esm/icons/text.d.ts +3 -0
- package/esm/icons/text.js +5 -0
- package/esm/icons/undo.d.ts +2 -0
- package/esm/icons/undo.js +3 -0
- package/esm/icons/upload.d.ts +2 -0
- package/esm/icons/upload.js +4 -0
- package/esm/index.d.ts +9 -0
- package/esm/index.js +9 -0
- package/esm/locales/global.d.ts +17 -0
- package/esm/locales/global.js +16 -0
- package/esm/locales/icons.d.ts +133 -0
- package/esm/locales/icons.js +132 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +6 -0
- package/esm/locales/operations.d.ts +51 -0
- package/esm/locales/operations.js +50 -0
- package/esm/locales/panels.d.ts +27 -0
- package/esm/locales/panels.js +26 -0
- package/esm/panels/CompositePanel.d.ts +24 -0
- package/esm/panels/CompositePanel.js +112 -0
- package/esm/panels/SettingsPanel.d.ts +7 -0
- package/esm/panels/SettingsPanel.js +53 -0
- package/esm/panels/StudioPanel.d.ts +13 -0
- package/esm/panels/StudioPanel.js +21 -0
- package/esm/panels/ToolbarPanel.d.ts +3 -0
- package/esm/panels/ToolbarPanel.js +11 -0
- package/esm/panels/ViewPanel.d.ts +9 -0
- package/esm/panels/ViewPanel.js +41 -0
- package/esm/panels/ViewportPanel.d.ts +3 -0
- package/esm/panels/ViewportPanel.js +7 -0
- package/esm/panels/WorkspacePanel.d.ts +11 -0
- package/esm/panels/WorkspacePanel.js +14 -0
- package/esm/panels/index.d.ts +8 -0
- package/esm/panels/index.js +8 -0
- package/esm/panels/styles.less +331 -0
- package/esm/simulators/MobileSimulator/body.d.ts +4 -0
- package/esm/simulators/MobileSimulator/body.js +57 -0
- package/esm/simulators/MobileSimulator/index.d.ts +7 -0
- package/esm/simulators/MobileSimulator/index.js +11 -0
- package/esm/simulators/MobileSimulator/styles.less +29 -0
- package/esm/simulators/PCSimulator/index.d.ts +7 -0
- package/esm/simulators/PCSimulator/index.js +8 -0
- package/esm/simulators/PCSimulator/styles.less +11 -0
- package/esm/simulators/ResponsiveSimulator/handle.d.ts +11 -0
- package/esm/simulators/ResponsiveSimulator/handle.js +16 -0
- package/esm/simulators/ResponsiveSimulator/index.d.ts +7 -0
- package/esm/simulators/ResponsiveSimulator/index.js +152 -0
- package/esm/simulators/ResponsiveSimulator/styles.less +56 -0
- package/esm/simulators/index.d.ts +3 -0
- package/esm/simulators/index.js +3 -0
- package/esm/theme.less +224 -0
- package/esm/types.d.ts +35 -0
- package/esm/types.js +1 -0
- package/esm/variables.less +1 -0
- package/esm/widgets/AuxToolWidget/Copy.d.ts +7 -0
- package/esm/widgets/AuxToolWidget/Copy.js +15 -0
- package/esm/widgets/AuxToolWidget/Cover.d.ts +2 -0
- package/esm/widgets/AuxToolWidget/Cover.js +52 -0
- package/esm/widgets/AuxToolWidget/DashedBox.d.ts +2 -0
- package/esm/widgets/AuxToolWidget/DashedBox.js +43 -0
- package/esm/widgets/AuxToolWidget/Delete.d.ts +7 -0
- package/esm/widgets/AuxToolWidget/Delete.js +15 -0
- package/esm/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
- package/esm/widgets/AuxToolWidget/DragHandler.js +17 -0
- package/esm/widgets/AuxToolWidget/FreeSelection.d.ts +2 -0
- package/esm/widgets/AuxToolWidget/FreeSelection.js +43 -0
- package/esm/widgets/AuxToolWidget/Helpers.d.ts +15 -0
- package/esm/widgets/AuxToolWidget/Helpers.js +82 -0
- package/esm/widgets/AuxToolWidget/Insertion.d.ts +2 -0
- package/esm/widgets/AuxToolWidget/Insertion.js +70 -0
- package/esm/widgets/AuxToolWidget/ResizeHandler.d.ts +6 -0
- package/esm/widgets/AuxToolWidget/ResizeHandler.js +27 -0
- package/esm/widgets/AuxToolWidget/Selection.d.ts +8 -0
- package/esm/widgets/AuxToolWidget/Selection.js +57 -0
- package/esm/widgets/AuxToolWidget/Selector.d.ts +7 -0
- package/esm/widgets/AuxToolWidget/Selector.js +84 -0
- package/esm/widgets/AuxToolWidget/SnapLine.d.ts +2 -0
- package/esm/widgets/AuxToolWidget/SnapLine.js +30 -0
- package/esm/widgets/AuxToolWidget/SpaceBlock.d.ts +2 -0
- package/esm/widgets/AuxToolWidget/SpaceBlock.js +66 -0
- package/esm/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
- package/esm/widgets/AuxToolWidget/TranslateHandler.js +20 -0
- package/esm/widgets/AuxToolWidget/index.d.ts +6 -0
- package/esm/widgets/AuxToolWidget/index.js +34 -0
- package/esm/widgets/AuxToolWidget/styles.less +383 -0
- package/esm/widgets/ComponentTreeWidget/index.d.ts +15 -0
- package/esm/widgets/ComponentTreeWidget/index.js +73 -0
- package/esm/widgets/ComponentTreeWidget/styles.less +6 -0
- package/esm/widgets/DesignerToolsWidget/index.d.ts +10 -0
- package/esm/widgets/DesignerToolsWidget/index.js +109 -0
- package/esm/widgets/DesignerToolsWidget/styles.less +29 -0
- package/esm/widgets/DroppableWidget/index.d.ts +15 -0
- package/esm/widgets/DroppableWidget/index.js +20 -0
- package/esm/widgets/DroppableWidget/styles.less +11 -0
- package/esm/widgets/EmptyWidget/index.d.ts +7 -0
- package/esm/widgets/EmptyWidget/index.js +46 -0
- package/esm/widgets/EmptyWidget/styles.less +27 -0
- package/esm/widgets/GhostWidget/index.d.ts +3 -0
- package/esm/widgets/GhostWidget/index.js +33 -0
- package/esm/widgets/GhostWidget/styles.less +20 -0
- package/esm/widgets/HistoryWidget/index.d.ts +3 -0
- package/esm/widgets/HistoryWidget/index.js +28 -0
- package/esm/widgets/HistoryWidget/styles.less +23 -0
- package/esm/widgets/IconWidget/index.d.ts +23 -0
- package/esm/widgets/IconWidget/index.js +102 -0
- package/esm/widgets/IconWidget/styles.less +17 -0
- package/esm/widgets/NodeActionsWidget/index.d.ts +18 -0
- package/esm/widgets/NodeActionsWidget/index.js +25 -0
- package/esm/widgets/NodeActionsWidget/styles.less +51 -0
- package/esm/widgets/NodePathWidget/index.d.ts +7 -0
- package/esm/widgets/NodePathWidget/index.js +36 -0
- package/esm/widgets/NodePathWidget/styles.less +16 -0
- package/esm/widgets/NodeTitleWidget/index.d.ts +6 -0
- package/esm/widgets/NodeTitleWidget/index.js +13 -0
- package/esm/widgets/OutlineWidget/Insertion.d.ts +5 -0
- package/esm/widgets/OutlineWidget/Insertion.js +51 -0
- package/esm/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
- package/esm/widgets/OutlineWidget/OutlineNode.js +139 -0
- package/esm/widgets/OutlineWidget/context.d.ts +8 -0
- package/esm/widgets/OutlineWidget/context.js +2 -0
- package/esm/widgets/OutlineWidget/index.d.ts +10 -0
- package/esm/widgets/OutlineWidget/index.js +42 -0
- package/esm/widgets/OutlineWidget/styles.less +195 -0
- package/esm/widgets/ResourceWidget/index.d.ts +12 -0
- package/esm/widgets/ResourceWidget/index.js +53 -0
- package/esm/widgets/ResourceWidget/styles.less +87 -0
- package/esm/widgets/TextWidget/index.d.ts +10 -0
- package/esm/widgets/TextWidget/index.js +32 -0
- package/esm/widgets/ViewToolsWidget/index.d.ts +8 -0
- package/esm/widgets/ViewToolsWidget/index.js +30 -0
- package/esm/widgets/index.d.ts +15 -0
- package/esm/widgets/index.js +15 -0
- package/lib/containers/Designer.d.ts +3 -0
- package/lib/containers/Designer.js +75 -0
- package/lib/containers/Layout.d.ts +3 -0
- package/lib/containers/Layout.js +72 -0
- package/lib/containers/Simulator.d.ts +3 -0
- package/lib/containers/Simulator.js +24 -0
- package/lib/containers/Viewport.d.ts +6 -0
- package/lib/containers/Viewport.js +89 -0
- package/lib/containers/Workbench.d.ts +4 -0
- package/lib/containers/Workbench.js +15 -0
- package/lib/containers/Workspace.d.ts +8 -0
- package/lib/containers/Workspace.js +63 -0
- package/lib/containers/index.d.ts +7 -0
- package/lib/containers/index.js +23 -0
- package/lib/containers/styles.less +19 -0
- package/lib/context.d.ts +7 -0
- package/lib/context.js +9 -0
- package/lib/hooks/index.d.ts +25 -0
- package/lib/hooks/index.js +41 -0
- package/lib/hooks/useComponents.d.ts +1 -0
- package/lib/hooks/useComponents.js +7 -0
- package/lib/hooks/useCursor.d.ts +1 -0
- package/lib/hooks/useCursor.js +9 -0
- package/lib/hooks/useDesigner.d.ts +5 -0
- package/lib/hooks/useDesigner.js +17 -0
- package/lib/hooks/useHistory.d.ts +1 -0
- package/lib/hooks/useHistory.js +9 -0
- package/lib/hooks/useHover.d.ts +1 -0
- package/lib/hooks/useHover.js +9 -0
- package/lib/hooks/useLayout.d.ts +2 -0
- package/lib/hooks/useLayout.js +11 -0
- package/lib/hooks/useMoveHelper.d.ts +1 -0
- package/lib/hooks/useMoveHelper.js +9 -0
- package/lib/hooks/useNodeIdProps.d.ts +4 -0
- package/lib/hooks/useNodeIdProps.js +13 -0
- package/lib/hooks/useOperation.d.ts +1 -0
- package/lib/hooks/useOperation.js +9 -0
- package/lib/hooks/useOutline.d.ts +1 -0
- package/lib/hooks/useOutline.js +9 -0
- package/lib/hooks/usePosition.d.ts +1 -0
- package/lib/hooks/usePosition.js +9 -0
- package/lib/hooks/usePrefix.d.ts +1 -0
- package/lib/hooks/usePrefix.js +9 -0
- package/lib/hooks/useRegistry.d.ts +2 -0
- package/lib/hooks/useRegistry.js +9 -0
- package/lib/hooks/useScreen.d.ts +1 -0
- package/lib/hooks/useScreen.js +8 -0
- package/lib/hooks/useSelected.d.ts +1 -0
- package/lib/hooks/useSelected.js +9 -0
- package/lib/hooks/useSelectedNode.d.ts +6 -0
- package/lib/hooks/useSelectedNode.js +17 -0
- package/lib/hooks/useSelection.d.ts +1 -0
- package/lib/hooks/useSelection.js +9 -0
- package/lib/hooks/useTheme.d.ts +1 -0
- package/lib/hooks/useTheme.js +9 -0
- package/lib/hooks/useTransformHelper.d.ts +1 -0
- package/lib/hooks/useTransformHelper.js +9 -0
- package/lib/hooks/useTree.d.ts +1 -0
- package/lib/hooks/useTree.js +9 -0
- package/lib/hooks/useTreeNode.d.ts +1 -0
- package/lib/hooks/useTreeNode.js +9 -0
- package/lib/hooks/useValidNodeOffsetRect.d.ts +2 -0
- package/lib/hooks/useValidNodeOffsetRect.js +41 -0
- package/lib/hooks/useViewport.d.ts +1 -0
- package/lib/hooks/useViewport.js +9 -0
- package/lib/hooks/useWorkbench.d.ts +1 -0
- package/lib/hooks/useWorkbench.js +9 -0
- package/lib/hooks/useWorkspace.d.ts +2 -0
- package/lib/hooks/useWorkspace.js +19 -0
- package/lib/icons/actions.d.ts +7 -0
- package/lib/icons/actions.js +34 -0
- package/lib/icons/add.d.ts +2 -0
- package/lib/icons/add.js +10 -0
- package/lib/icons/animations.d.ts +24 -0
- package/lib/icons/animations.js +326 -0
- package/lib/icons/boolean.d.ts +2 -0
- package/lib/icons/boolean.js +9 -0
- package/lib/icons/clone.d.ts +3 -0
- package/lib/icons/clone.js +9 -0
- package/lib/icons/close.d.ts +2 -0
- package/lib/icons/close.js +9 -0
- package/lib/icons/code.d.ts +2 -0
- package/lib/icons/code.js +8 -0
- package/lib/icons/command.d.ts +2 -0
- package/lib/icons/command.js +10 -0
- package/lib/icons/component.d.ts +2 -0
- package/lib/icons/component.js +8 -0
- package/lib/icons/container.d.ts +2 -0
- package/lib/icons/container.js +10 -0
- package/lib/icons/corner.d.ts +5 -0
- package/lib/icons/corner.js +11 -0
- package/lib/icons/delete.d.ts +2 -0
- package/lib/icons/delete.js +11 -0
- package/lib/icons/design.d.ts +2 -0
- package/lib/icons/design.js +9 -0
- package/lib/icons/display.d.ts +5 -0
- package/lib/icons/display.js +11 -0
- package/lib/icons/dragmove.d.ts +2 -0
- package/lib/icons/dragmove.js +9 -0
- package/lib/icons/expand.d.ts +2 -0
- package/lib/icons/expand.js +8 -0
- package/lib/icons/expression.d.ts +2 -0
- package/lib/icons/expression.js +8 -0
- package/lib/icons/eyes.d.ts +3 -0
- package/lib/icons/eyes.js +13 -0
- package/lib/icons/flex.d.ts +22 -0
- package/lib/icons/flex.js +28 -0
- package/lib/icons/flip.d.ts +2 -0
- package/lib/icons/flip.js +8 -0
- package/lib/icons/focus.d.ts +2 -0
- package/lib/icons/focus.js +8 -0
- package/lib/icons/font.d.ts +16 -0
- package/lib/icons/font.js +22 -0
- package/lib/icons/formula.d.ts +2 -0
- package/lib/icons/formula.js +8 -0
- package/lib/icons/freemove.d.ts +2 -0
- package/lib/icons/freemove.js +9 -0
- package/lib/icons/help.d.ts +2 -0
- package/lib/icons/help.js +10 -0
- package/lib/icons/hidden.d.ts +2 -0
- package/lib/icons/hidden.js +8 -0
- package/lib/icons/history.d.ts +2 -0
- package/lib/icons/history.js +9 -0
- package/lib/icons/image.d.ts +3 -0
- package/lib/icons/image.js +9 -0
- package/lib/icons/index.d.ts +53 -0
- package/lib/icons/index.js +69 -0
- package/lib/icons/json.d.ts +2 -0
- package/lib/icons/json.js +8 -0
- package/lib/icons/logo.d.ts +4 -0
- package/lib/icons/logo.js +7 -0
- package/lib/icons/menu.d.ts +2 -0
- package/lib/icons/menu.js +9 -0
- package/lib/icons/mobile.d.ts +2 -0
- package/lib/icons/mobile.js +10 -0
- package/lib/icons/move.d.ts +2 -0
- package/lib/icons/move.js +8 -0
- package/lib/icons/number.d.ts +2 -0
- package/lib/icons/number.js +9 -0
- package/lib/icons/outline.d.ts +2 -0
- package/lib/icons/outline.js +8 -0
- package/lib/icons/page.d.ts +2 -0
- package/lib/icons/page.js +11 -0
- package/lib/icons/pc.d.ts +2 -0
- package/lib/icons/pc.js +9 -0
- package/lib/icons/play.d.ts +2 -0
- package/lib/icons/play.js +8 -0
- package/lib/icons/position.d.ts +6 -0
- package/lib/icons/position.js +12 -0
- package/lib/icons/pushpin.d.ts +3 -0
- package/lib/icons/pushpin.js +11 -0
- package/lib/icons/recover.d.ts +2 -0
- package/lib/icons/recover.js +8 -0
- package/lib/icons/redo.d.ts +2 -0
- package/lib/icons/redo.js +8 -0
- package/lib/icons/remove.d.ts +2 -0
- package/lib/icons/remove.js +8 -0
- package/lib/icons/responsive.d.ts +2 -0
- package/lib/icons/responsive.js +11 -0
- package/lib/icons/return.d.ts +2 -0
- package/lib/icons/return.js +8 -0
- package/lib/icons/selection.d.ts +2 -0
- package/lib/icons/selection.js +8 -0
- package/lib/icons/setting.d.ts +2 -0
- package/lib/icons/setting.js +8 -0
- package/lib/icons/shadow.d.ts +5 -0
- package/lib/icons/shadow.js +11 -0
- package/lib/icons/shift.d.ts +2 -0
- package/lib/icons/shift.js +8 -0
- package/lib/icons/sources.d.ts +75 -0
- package/lib/icons/sources.js +551 -0
- package/lib/icons/text.d.ts +3 -0
- package/lib/icons/text.js +11 -0
- package/lib/icons/undo.d.ts +2 -0
- package/lib/icons/undo.js +9 -0
- package/lib/icons/upload.d.ts +2 -0
- package/lib/icons/upload.js +10 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +25 -0
- package/lib/locales/global.d.ts +17 -0
- package/lib/locales/global.js +18 -0
- package/lib/locales/icons.d.ts +133 -0
- package/lib/locales/icons.js +134 -0
- package/lib/locales/index.d.ts +1 -0
- package/lib/locales/index.js +11 -0
- package/lib/locales/operations.d.ts +51 -0
- package/lib/locales/operations.js +52 -0
- package/lib/locales/panels.d.ts +27 -0
- package/lib/locales/panels.js +28 -0
- package/lib/panels/CompositePanel.d.ts +24 -0
- package/lib/panels/CompositePanel.js +152 -0
- package/lib/panels/SettingsPanel.d.ts +7 -0
- package/lib/panels/SettingsPanel.js +92 -0
- package/lib/panels/StudioPanel.d.ts +13 -0
- package/lib/panels/StudioPanel.js +28 -0
- package/lib/panels/ToolbarPanel.d.ts +3 -0
- package/lib/panels/ToolbarPanel.js +18 -0
- package/lib/panels/ViewPanel.d.ts +9 -0
- package/lib/panels/ViewPanel.js +77 -0
- package/lib/panels/ViewportPanel.d.ts +3 -0
- package/lib/panels/ViewportPanel.js +14 -0
- package/lib/panels/WorkspacePanel.d.ts +11 -0
- package/lib/panels/WorkspacePanel.js +21 -0
- package/lib/panels/index.d.ts +8 -0
- package/lib/panels/index.js +24 -0
- package/lib/panels/styles.less +331 -0
- package/lib/simulators/MobileSimulator/body.d.ts +4 -0
- package/lib/simulators/MobileSimulator/body.js +63 -0
- package/lib/simulators/MobileSimulator/index.d.ts +7 -0
- package/lib/simulators/MobileSimulator/index.js +18 -0
- package/lib/simulators/MobileSimulator/styles.less +29 -0
- package/lib/simulators/PCSimulator/index.d.ts +7 -0
- package/lib/simulators/PCSimulator/index.js +15 -0
- package/lib/simulators/PCSimulator/styles.less +11 -0
- package/lib/simulators/ResponsiveSimulator/handle.d.ts +11 -0
- package/lib/simulators/ResponsiveSimulator/handle.js +23 -0
- package/lib/simulators/ResponsiveSimulator/index.d.ts +7 -0
- package/lib/simulators/ResponsiveSimulator/index.js +191 -0
- package/lib/simulators/ResponsiveSimulator/styles.less +56 -0
- package/lib/simulators/index.d.ts +3 -0
- package/lib/simulators/index.js +19 -0
- package/lib/theme.less +224 -0
- package/lib/types.d.ts +35 -0
- package/lib/types.js +2 -0
- package/lib/variables.less +1 -0
- package/lib/widgets/AuxToolWidget/Copy.d.ts +7 -0
- package/lib/widgets/AuxToolWidget/Copy.js +22 -0
- package/lib/widgets/AuxToolWidget/Cover.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/Cover.js +91 -0
- package/lib/widgets/AuxToolWidget/DashedBox.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/DashedBox.js +49 -0
- package/lib/widgets/AuxToolWidget/Delete.d.ts +7 -0
- package/lib/widgets/AuxToolWidget/Delete.js +22 -0
- package/lib/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
- package/lib/widgets/AuxToolWidget/DragHandler.js +23 -0
- package/lib/widgets/AuxToolWidget/FreeSelection.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/FreeSelection.js +49 -0
- package/lib/widgets/AuxToolWidget/Helpers.d.ts +15 -0
- package/lib/widgets/AuxToolWidget/Helpers.js +122 -0
- package/lib/widgets/AuxToolWidget/Insertion.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/Insertion.js +76 -0
- package/lib/widgets/AuxToolWidget/ResizeHandler.d.ts +6 -0
- package/lib/widgets/AuxToolWidget/ResizeHandler.js +34 -0
- package/lib/widgets/AuxToolWidget/Selection.d.ts +8 -0
- package/lib/widgets/AuxToolWidget/Selection.js +94 -0
- package/lib/widgets/AuxToolWidget/Selector.d.ts +7 -0
- package/lib/widgets/AuxToolWidget/Selector.js +120 -0
- package/lib/widgets/AuxToolWidget/SnapLine.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/SnapLine.js +36 -0
- package/lib/widgets/AuxToolWidget/SpaceBlock.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/SpaceBlock.js +102 -0
- package/lib/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
- package/lib/widgets/AuxToolWidget/TranslateHandler.js +27 -0
- package/lib/widgets/AuxToolWidget/index.d.ts +6 -0
- package/lib/widgets/AuxToolWidget/index.js +71 -0
- package/lib/widgets/AuxToolWidget/styles.less +383 -0
- package/lib/widgets/ComponentTreeWidget/index.d.ts +15 -0
- package/lib/widgets/ComponentTreeWidget/index.js +112 -0
- package/lib/widgets/ComponentTreeWidget/styles.less +6 -0
- package/lib/widgets/DesignerToolsWidget/index.d.ts +10 -0
- package/lib/widgets/DesignerToolsWidget/index.js +148 -0
- package/lib/widgets/DesignerToolsWidget/styles.less +29 -0
- package/lib/widgets/DroppableWidget/index.d.ts +15 -0
- package/lib/widgets/DroppableWidget/index.js +26 -0
- package/lib/widgets/DroppableWidget/styles.less +11 -0
- package/lib/widgets/EmptyWidget/index.d.ts +7 -0
- package/lib/widgets/EmptyWidget/index.js +52 -0
- package/lib/widgets/EmptyWidget/styles.less +27 -0
- package/lib/widgets/GhostWidget/index.d.ts +3 -0
- package/lib/widgets/GhostWidget/index.js +69 -0
- package/lib/widgets/GhostWidget/styles.less +20 -0
- package/lib/widgets/HistoryWidget/index.d.ts +3 -0
- package/lib/widgets/HistoryWidget/index.js +34 -0
- package/lib/widgets/HistoryWidget/styles.less +23 -0
- package/lib/widgets/IconWidget/index.d.ts +23 -0
- package/lib/widgets/IconWidget/index.js +141 -0
- package/lib/widgets/IconWidget/styles.less +17 -0
- package/lib/widgets/NodeActionsWidget/index.d.ts +18 -0
- package/lib/widgets/NodeActionsWidget/index.js +31 -0
- package/lib/widgets/NodeActionsWidget/styles.less +51 -0
- package/lib/widgets/NodePathWidget/index.d.ts +7 -0
- package/lib/widgets/NodePathWidget/index.js +42 -0
- package/lib/widgets/NodePathWidget/styles.less +16 -0
- package/lib/widgets/NodeTitleWidget/index.d.ts +6 -0
- package/lib/widgets/NodeTitleWidget/index.js +49 -0
- package/lib/widgets/OutlineWidget/Insertion.d.ts +5 -0
- package/lib/widgets/OutlineWidget/Insertion.js +57 -0
- package/lib/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
- package/lib/widgets/OutlineWidget/OutlineNode.js +178 -0
- package/lib/widgets/OutlineWidget/context.d.ts +8 -0
- package/lib/widgets/OutlineWidget/context.js +5 -0
- package/lib/widgets/OutlineWidget/index.d.ts +10 -0
- package/lib/widgets/OutlineWidget/index.js +81 -0
- package/lib/widgets/OutlineWidget/styles.less +195 -0
- package/lib/widgets/ResourceWidget/index.d.ts +12 -0
- package/lib/widgets/ResourceWidget/index.js +92 -0
- package/lib/widgets/ResourceWidget/styles.less +87 -0
- package/lib/widgets/TextWidget/index.d.ts +10 -0
- package/lib/widgets/TextWidget/index.js +68 -0
- package/lib/widgets/ViewToolsWidget/index.d.ts +8 -0
- package/lib/widgets/ViewToolsWidget/index.js +36 -0
- package/lib/widgets/index.d.ts +15 -0
- package/lib/widgets/index.js +31 -0
- package/package.json +45 -0
- package/rollup.config.js +3 -0
- package/src/containers/Designer.tsx +50 -0
- package/src/containers/Layout.tsx +50 -0
- package/src/containers/Simulator.tsx +30 -0
- package/src/containers/Viewport.tsx +69 -0
- package/src/containers/Workbench.tsx +15 -0
- package/src/containers/Workspace.tsx +41 -0
- package/src/containers/index.ts +7 -0
- package/src/containers/styles.less +19 -0
- package/src/context.ts +17 -0
- package/src/hooks/index.ts +25 -0
- package/src/hooks/useComponents.ts +3 -0
- package/src/hooks/useCursor.ts +6 -0
- package/src/hooks/useDesigner.ts +19 -0
- package/src/hooks/useHistory.ts +6 -0
- package/src/hooks/useHover.ts +6 -0
- package/src/hooks/useLayout.ts +11 -0
- package/src/hooks/useMoveHelper.ts +6 -0
- package/src/hooks/useNodeIdProps.ts +11 -0
- package/src/hooks/useOperation.ts +6 -0
- package/src/hooks/useOutline.ts +6 -0
- package/src/hooks/usePosition.ts +5 -0
- package/src/hooks/usePrefix.ts +5 -0
- package/src/hooks/useRegistry.ts +6 -0
- package/src/hooks/useScreen.ts +5 -0
- package/src/hooks/useSelected.ts +6 -0
- package/src/hooks/useSelectedNode.ts +14 -0
- package/src/hooks/useSelection.ts +6 -0
- package/src/hooks/useTheme.ts +5 -0
- package/src/hooks/useTransformHelper.ts +6 -0
- package/src/hooks/useTree.ts +6 -0
- package/src/hooks/useTreeNode.ts +6 -0
- package/src/hooks/useValidNodeOffsetRect.ts +48 -0
- package/src/hooks/useViewport.ts +6 -0
- package/src/hooks/useWorkbench.ts +6 -0
- package/src/hooks/useWorkspace.ts +16 -0
- package/src/icons/actions.tsx +138 -0
- package/src/icons/add.tsx +8 -0
- package/src/icons/animations.tsx +325 -0
- package/src/icons/boolean.tsx +7 -0
- package/src/icons/clone.tsx +9 -0
- package/src/icons/close.tsx +7 -0
- package/src/icons/code.tsx +5 -0
- package/src/icons/command.tsx +8 -0
- package/src/icons/component.tsx +5 -0
- package/src/icons/container.tsx +8 -0
- package/src/icons/corner.tsx +26 -0
- package/src/icons/delete.tsx +9 -0
- package/src/icons/design.tsx +7 -0
- package/src/icons/display.tsx +17 -0
- package/src/icons/dragmove.tsx +10 -0
- package/src/icons/expand.tsx +5 -0
- package/src/icons/expression.tsx +5 -0
- package/src/icons/eyes.tsx +15 -0
- package/src/icons/flex.tsx +85 -0
- package/src/icons/flip.tsx +5 -0
- package/src/icons/focus.tsx +5 -0
- package/src/icons/font.tsx +61 -0
- package/src/icons/formula.tsx +5 -0
- package/src/icons/freemove.tsx +10 -0
- package/src/icons/help.tsx +8 -0
- package/src/icons/hidden.tsx +5 -0
- package/src/icons/history.tsx +7 -0
- package/src/icons/image.tsx +9 -0
- package/src/icons/index.ts +53 -0
- package/src/icons/json.tsx +5 -0
- package/src/icons/logo.tsx +5 -0
- package/src/icons/menu.tsx +7 -0
- package/src/icons/mobile.tsx +8 -0
- package/src/icons/move.tsx +5 -0
- package/src/icons/number.tsx +7 -0
- package/src/icons/outline.tsx +5 -0
- package/src/icons/page.tsx +9 -0
- package/src/icons/pc.tsx +7 -0
- package/src/icons/play.tsx +8 -0
- package/src/icons/position.tsx +30 -0
- package/src/icons/pushpin.tsx +29 -0
- package/src/icons/recover.tsx +5 -0
- package/src/icons/redo.tsx +5 -0
- package/src/icons/remove.tsx +5 -0
- package/src/icons/responsive.tsx +9 -0
- package/src/icons/return.tsx +5 -0
- package/src/icons/selection.tsx +5 -0
- package/src/icons/setting.tsx +5 -0
- package/src/icons/shadow.tsx +20 -0
- package/src/icons/shift.tsx +5 -0
- package/src/icons/sources.tsx +3377 -0
- package/src/icons/text.tsx +13 -0
- package/src/icons/undo.tsx +7 -0
- package/src/icons/upload.tsx +8 -0
- package/src/index.ts +9 -0
- package/src/locales/global.ts +16 -0
- package/src/locales/icons.ts +132 -0
- package/src/locales/index.ts +7 -0
- package/src/locales/operations.ts +50 -0
- package/src/locales/panels.ts +26 -0
- package/src/panels/CompositePanel.tsx +195 -0
- package/src/panels/SettingsPanel.tsx +85 -0
- package/src/panels/StudioPanel.tsx +54 -0
- package/src/panels/ToolbarPanel.tsx +19 -0
- package/src/panels/ViewPanel.tsx +62 -0
- package/src/panels/ViewportPanel.tsx +10 -0
- package/src/panels/WorkspacePanel.tsx +31 -0
- package/src/panels/index.ts +8 -0
- package/src/panels/styles.less +331 -0
- package/src/simulators/MobileSimulator/body.tsx +78 -0
- package/src/simulators/MobileSimulator/index.tsx +21 -0
- package/src/simulators/MobileSimulator/styles.less +29 -0
- package/src/simulators/PCSimulator/index.tsx +17 -0
- package/src/simulators/PCSimulator/styles.less +11 -0
- package/src/simulators/ResponsiveSimulator/handle.tsx +29 -0
- package/src/simulators/ResponsiveSimulator/index.tsx +193 -0
- package/src/simulators/ResponsiveSimulator/styles.less +56 -0
- package/src/simulators/index.tsx +3 -0
- package/src/theme.less +224 -0
- package/src/types.ts +41 -0
- package/src/variables.less +1 -0
- package/src/widgets/AuxToolWidget/Copy.tsx +28 -0
- package/src/widgets/AuxToolWidget/Cover.tsx +76 -0
- package/src/widgets/AuxToolWidget/DashedBox.tsx +55 -0
- package/src/widgets/AuxToolWidget/Delete.tsx +29 -0
- package/src/widgets/AuxToolWidget/DragHandler.tsx +29 -0
- package/src/widgets/AuxToolWidget/FreeSelection.tsx +53 -0
- package/src/widgets/AuxToolWidget/Helpers.tsx +116 -0
- package/src/widgets/AuxToolWidget/Insertion.tsx +80 -0
- package/src/widgets/AuxToolWidget/ResizeHandler.tsx +35 -0
- package/src/widgets/AuxToolWidget/Selection.tsx +85 -0
- package/src/widgets/AuxToolWidget/Selector.tsx +125 -0
- package/src/widgets/AuxToolWidget/SnapLine.tsx +40 -0
- package/src/widgets/AuxToolWidget/SpaceBlock.tsx +112 -0
- package/src/widgets/AuxToolWidget/TranslateHandler.tsx +29 -0
- package/src/widgets/AuxToolWidget/index.tsx +40 -0
- package/src/widgets/AuxToolWidget/styles.less +383 -0
- package/src/widgets/ComponentTreeWidget/index.tsx +99 -0
- package/src/widgets/ComponentTreeWidget/styles.less +6 -0
- package/src/widgets/DesignerToolsWidget/index.tsx +206 -0
- package/src/widgets/DesignerToolsWidget/styles.less +29 -0
- package/src/widgets/DroppableWidget/index.tsx +63 -0
- package/src/widgets/DroppableWidget/styles.less +11 -0
- package/src/widgets/EmptyWidget/index.tsx +58 -0
- package/src/widgets/EmptyWidget/styles.less +27 -0
- package/src/widgets/GhostWidget/index.tsx +47 -0
- package/src/widgets/GhostWidget/styles.less +20 -0
- package/src/widgets/HistoryWidget/index.tsx +42 -0
- package/src/widgets/HistoryWidget/styles.less +23 -0
- package/src/widgets/IconWidget/index.tsx +152 -0
- package/src/widgets/IconWidget/styles.less +17 -0
- package/src/widgets/NodeActionsWidget/index.tsx +56 -0
- package/src/widgets/NodeActionsWidget/styles.less +51 -0
- package/src/widgets/NodePathWidget/index.tsx +57 -0
- package/src/widgets/NodePathWidget/styles.less +16 -0
- package/src/widgets/NodeTitleWidget/index.tsx +20 -0
- package/src/widgets/OutlineWidget/Insertion.tsx +63 -0
- package/src/widgets/OutlineWidget/OutlineNode.tsx +198 -0
- package/src/widgets/OutlineWidget/context.ts +9 -0
- package/src/widgets/OutlineWidget/index.tsx +66 -0
- package/src/widgets/OutlineWidget/styles.less +195 -0
- package/src/widgets/ResourceWidget/index.tsx +110 -0
- package/src/widgets/ResourceWidget/styles.less +87 -0
- package/src/widgets/TextWidget/index.tsx +43 -0
- package/src/widgets/ViewToolsWidget/index.tsx +72 -0
- package/src/widgets/index.ts +15 -0
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +5 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ComponentTreeWidget = exports.TreeNodeWidget = void 0;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const hooks_1 = require("../../hooks");
|
|
42
|
+
const context_1 = require("../../context");
|
|
43
|
+
const core_1 = require("@formily-design/core");
|
|
44
|
+
const reactive_react_1 = require("@formily/reactive-react");
|
|
45
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
46
|
+
require("./styles.less");
|
|
47
|
+
exports.TreeNodeWidget = (0, reactive_react_1.observer)((props) => {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
const designer = (0, hooks_1.useDesigner)((_b = (_a = props.node) === null || _a === void 0 ? void 0 : _a.designerProps) === null || _b === void 0 ? void 0 : _b.effects);
|
|
50
|
+
const components = (0, hooks_1.useComponents)();
|
|
51
|
+
const node = props.node;
|
|
52
|
+
const renderChildren = () => {
|
|
53
|
+
var _a, _b;
|
|
54
|
+
if ((_a = node === null || node === void 0 ? void 0 : node.designerProps) === null || _a === void 0 ? void 0 : _a.selfRenderChildren)
|
|
55
|
+
return [];
|
|
56
|
+
return (_b = node === null || node === void 0 ? void 0 : node.children) === null || _b === void 0 ? void 0 : _b.map((child) => {
|
|
57
|
+
return react_1.default.createElement(exports.TreeNodeWidget, { key: child.id, node: child });
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const renderProps = (extendsProps = {}) => {
|
|
61
|
+
var _a, _b, _c;
|
|
62
|
+
const props = {
|
|
63
|
+
...(_a = node.designerProps) === null || _a === void 0 ? void 0 : _a.defaultProps,
|
|
64
|
+
...extendsProps,
|
|
65
|
+
...node.props,
|
|
66
|
+
...(_c = (_b = node.designerProps) === null || _b === void 0 ? void 0 : _b.getComponentProps) === null || _c === void 0 ? void 0 : _c.call(_b, node),
|
|
67
|
+
};
|
|
68
|
+
if (node.depth === 0) {
|
|
69
|
+
delete props.style;
|
|
70
|
+
}
|
|
71
|
+
return props;
|
|
72
|
+
};
|
|
73
|
+
const renderComponent = () => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
const componentName = node.componentName;
|
|
76
|
+
const Component = components[componentName];
|
|
77
|
+
const dataId = {};
|
|
78
|
+
if (Component) {
|
|
79
|
+
if (designer) {
|
|
80
|
+
dataId[(_a = designer === null || designer === void 0 ? void 0 : designer.props) === null || _a === void 0 ? void 0 : _a.nodeIdAttrName] = node.id;
|
|
81
|
+
}
|
|
82
|
+
return react_1.default.createElement(Component, renderProps(dataId), ...renderChildren());
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if ((_b = node === null || node === void 0 ? void 0 : node.children) === null || _b === void 0 ? void 0 : _b.length) {
|
|
86
|
+
return react_1.default.createElement(react_1.Fragment, null, renderChildren());
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
if (!node)
|
|
91
|
+
return null;
|
|
92
|
+
if (node.hidden)
|
|
93
|
+
return null;
|
|
94
|
+
return react_1.default.createElement(context_1.TreeNodeContext.Provider, { value: node }, renderComponent());
|
|
95
|
+
});
|
|
96
|
+
exports.ComponentTreeWidget = (0, reactive_react_1.observer)((props) => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
const tree = (0, hooks_1.useTree)();
|
|
99
|
+
const prefix = (0, hooks_1.usePrefix)('component-tree');
|
|
100
|
+
const designer = (0, hooks_1.useDesigner)();
|
|
101
|
+
const dataId = {};
|
|
102
|
+
if (designer && tree) {
|
|
103
|
+
dataId[(_a = designer === null || designer === void 0 ? void 0 : designer.props) === null || _a === void 0 ? void 0 : _a.nodeIdAttrName] = tree.id;
|
|
104
|
+
}
|
|
105
|
+
(0, react_1.useEffect)(() => {
|
|
106
|
+
core_1.GlobalRegistry.registerDesignerBehaviors(props.components);
|
|
107
|
+
}, []);
|
|
108
|
+
return (react_1.default.createElement("div", { style: { ...props.style, ...(_b = tree === null || tree === void 0 ? void 0 : tree.props) === null || _b === void 0 ? void 0 : _b.style }, className: (0, classnames_1.default)(prefix, props.className), ...dataId },
|
|
109
|
+
react_1.default.createElement(context_1.DesignerComponentsContext.Provider, { value: props.components },
|
|
110
|
+
react_1.default.createElement(exports.TreeNodeWidget, { node: tree }))));
|
|
111
|
+
});
|
|
112
|
+
exports.ComponentTreeWidget.displayName = 'ComponentTreeWidget';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './styles.less';
|
|
3
|
+
type DesignerToolsType = 'HISTORY' | 'CURSOR' | 'SCREEN_TYPE';
|
|
4
|
+
export type IDesignerToolsWidgetProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
use?: DesignerToolsType[];
|
|
8
|
+
};
|
|
9
|
+
export declare const DesignerToolsWidget: React.FC<IDesignerToolsWidgetProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.DesignerToolsWidget = void 0;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const antd_1 = require("antd");
|
|
42
|
+
const reactive_react_1 = require("@formily/reactive-react");
|
|
43
|
+
const core_1 = require("@formily-design/core");
|
|
44
|
+
const hooks_1 = require("../../hooks");
|
|
45
|
+
const IconWidget_1 = require("../IconWidget");
|
|
46
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
47
|
+
require("./styles.less");
|
|
48
|
+
exports.DesignerToolsWidget = (0, reactive_react_1.observer)((props) => {
|
|
49
|
+
const screen = (0, hooks_1.useScreen)();
|
|
50
|
+
const cursor = (0, hooks_1.useCursor)();
|
|
51
|
+
const workbench = (0, hooks_1.useWorkbench)();
|
|
52
|
+
const history = (0, hooks_1.useHistory)();
|
|
53
|
+
const sizeRef = (0, react_1.useRef)({});
|
|
54
|
+
const prefix = (0, hooks_1.usePrefix)('designer-tools');
|
|
55
|
+
const renderHistoryController = () => {
|
|
56
|
+
if (!props.use.includes('HISTORY'))
|
|
57
|
+
return null;
|
|
58
|
+
return (react_1.default.createElement(antd_1.Button.Group, { size: "small", style: { marginRight: 20 } },
|
|
59
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: !(history === null || history === void 0 ? void 0 : history.allowUndo), onClick: () => {
|
|
60
|
+
history.undo();
|
|
61
|
+
} },
|
|
62
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Undo" })),
|
|
63
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: !(history === null || history === void 0 ? void 0 : history.allowRedo), onClick: () => {
|
|
64
|
+
history.redo();
|
|
65
|
+
} },
|
|
66
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Redo" }))));
|
|
67
|
+
};
|
|
68
|
+
const renderCursorController = () => {
|
|
69
|
+
if (workbench.type !== 'DESIGNABLE')
|
|
70
|
+
return null;
|
|
71
|
+
if (!props.use.includes('CURSOR'))
|
|
72
|
+
return null;
|
|
73
|
+
return (react_1.default.createElement(antd_1.Button.Group, { size: "small", style: { marginRight: 20 } },
|
|
74
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: cursor.type === core_1.CursorType.Normal, onClick: () => {
|
|
75
|
+
cursor.setType(core_1.CursorType.Normal);
|
|
76
|
+
} },
|
|
77
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Move" })),
|
|
78
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: cursor.type === core_1.CursorType.Selection, onClick: () => {
|
|
79
|
+
cursor.setType(core_1.CursorType.Selection);
|
|
80
|
+
} },
|
|
81
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Selection" }))));
|
|
82
|
+
};
|
|
83
|
+
const renderResponsiveController = () => {
|
|
84
|
+
if (!props.use.includes('SCREEN_TYPE'))
|
|
85
|
+
return null;
|
|
86
|
+
if (screen.type !== core_1.ScreenType.Responsive)
|
|
87
|
+
return null;
|
|
88
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
|
89
|
+
react_1.default.createElement(antd_1.InputNumber, { size: "small", value: screen.width, style: { width: 70, textAlign: 'center' }, onChange: (value) => {
|
|
90
|
+
sizeRef.current.width = value;
|
|
91
|
+
}, onPressEnter: () => {
|
|
92
|
+
screen.setSize(sizeRef.current.width, screen.height);
|
|
93
|
+
} }),
|
|
94
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { size: 10, infer: "Close", style: { padding: '0 3px', color: '#999' } }),
|
|
95
|
+
react_1.default.createElement(antd_1.InputNumber, { value: screen.height, size: "small", style: {
|
|
96
|
+
width: 70,
|
|
97
|
+
textAlign: 'center',
|
|
98
|
+
marginRight: 10,
|
|
99
|
+
}, onChange: (value) => {
|
|
100
|
+
sizeRef.current.height = value;
|
|
101
|
+
}, onPressEnter: () => {
|
|
102
|
+
screen.setSize(screen.width, sizeRef.current.height);
|
|
103
|
+
} }),
|
|
104
|
+
(screen.width !== '100%' || screen.height !== '100%') && (react_1.default.createElement(antd_1.Button, { size: "small", style: { marginRight: 20 }, onClick: () => {
|
|
105
|
+
screen.resetSize();
|
|
106
|
+
} },
|
|
107
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Recover" })))));
|
|
108
|
+
};
|
|
109
|
+
const renderScreenTypeController = () => {
|
|
110
|
+
if (!props.use.includes('SCREEN_TYPE'))
|
|
111
|
+
return null;
|
|
112
|
+
return (react_1.default.createElement(antd_1.Button.Group, { size: "small", style: { marginRight: 20 } },
|
|
113
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: screen.type === core_1.ScreenType.PC, onClick: () => {
|
|
114
|
+
screen.setType(core_1.ScreenType.PC);
|
|
115
|
+
} },
|
|
116
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "PC" })),
|
|
117
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: screen.type === core_1.ScreenType.Mobile, onClick: () => {
|
|
118
|
+
screen.setType(core_1.ScreenType.Mobile);
|
|
119
|
+
} },
|
|
120
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Mobile" })),
|
|
121
|
+
react_1.default.createElement(antd_1.Button, { size: "small", disabled: screen.type === core_1.ScreenType.Responsive, onClick: () => {
|
|
122
|
+
screen.setType(core_1.ScreenType.Responsive);
|
|
123
|
+
} },
|
|
124
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Responsive" }))));
|
|
125
|
+
};
|
|
126
|
+
const renderMobileController = () => {
|
|
127
|
+
if (!props.use.includes('SCREEN_TYPE'))
|
|
128
|
+
return null;
|
|
129
|
+
if (screen.type !== core_1.ScreenType.Mobile)
|
|
130
|
+
return;
|
|
131
|
+
return (react_1.default.createElement(antd_1.Button, { size: "small", style: { marginRight: 20 }, onClick: () => {
|
|
132
|
+
screen.setFlip(!screen.flip);
|
|
133
|
+
} },
|
|
134
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Flip", style: {
|
|
135
|
+
transition: 'all .15s ease-in',
|
|
136
|
+
transform: screen.flip ? 'rotate(-90deg)' : '',
|
|
137
|
+
} })));
|
|
138
|
+
};
|
|
139
|
+
return (react_1.default.createElement("div", { style: props.style, className: (0, classnames_1.default)(prefix, props.className) },
|
|
140
|
+
renderHistoryController(),
|
|
141
|
+
renderCursorController(),
|
|
142
|
+
renderScreenTypeController(),
|
|
143
|
+
renderMobileController(),
|
|
144
|
+
renderResponsiveController()));
|
|
145
|
+
});
|
|
146
|
+
exports.DesignerToolsWidget.defaultProps = {
|
|
147
|
+
use: ['HISTORY', 'CURSOR', 'SCREEN_TYPE'],
|
|
148
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import '../../variables.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix-cls}-designer-tools {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
7
|
+
.ant-input-number {
|
|
8
|
+
font-size: 12px !important;
|
|
9
|
+
background: var(--dn-toolbar-input-bg-color) !important;
|
|
10
|
+
border-color: var(--dn-toolbar-input-border-color) !important;
|
|
11
|
+
color: var(--dn-toolbar-input-color) !important;
|
|
12
|
+
|
|
13
|
+
.ant-input-number-handler-wrap,
|
|
14
|
+
.ant-input-number-handler {
|
|
15
|
+
background: var(--dn-toolbar-input-handler-bg-color) !important;
|
|
16
|
+
border-color: var(--dn-toolbar-input-border-color) !important;
|
|
17
|
+
color: var(--dn-toolbar-input-color) !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ant-input-number-handler-down-inner,
|
|
21
|
+
.ant-input-number-handler-up-inner {
|
|
22
|
+
color: var(--dn-toolbar-input-color) !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:hover {
|
|
26
|
+
border-color: var(--dn-toolbar-input-hover-border-color) !important;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TreeNode } from '@formily-design/core';
|
|
3
|
+
import { INodeActionsWidgetActionProps } from '../NodeActionsWidget';
|
|
4
|
+
import './styles.less';
|
|
5
|
+
export interface IDroppableWidgetProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
node?: TreeNode;
|
|
8
|
+
actions?: INodeActionsWidgetActionProps[];
|
|
9
|
+
placeholder?: boolean;
|
|
10
|
+
height?: number;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
className?: string;
|
|
13
|
+
hasChildren?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const DroppableWidget: React.FC<IDroppableWidgetProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DroppableWidget = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const reactive_react_1 = require("@formily/reactive-react");
|
|
9
|
+
const hooks_1 = require("../../hooks");
|
|
10
|
+
const NodeTitleWidget_1 = require("../NodeTitleWidget");
|
|
11
|
+
const NodeActionsWidget_1 = require("../NodeActionsWidget");
|
|
12
|
+
require("./styles.less");
|
|
13
|
+
exports.DroppableWidget = (0, reactive_react_1.observer)(({ node, actions, height, placeholder, style, className, hasChildren: hasChildrenProp, ...props }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const currentNode = (0, hooks_1.useTreeNode)();
|
|
16
|
+
const nodeId = (0, hooks_1.useNodeIdProps)(node);
|
|
17
|
+
const target = node !== null && node !== void 0 ? node : currentNode;
|
|
18
|
+
const hasChildren = hasChildrenProp !== null && hasChildrenProp !== void 0 ? hasChildrenProp : ((_a = target.children) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
19
|
+
return (react_1.default.createElement("div", { ...nodeId, ...props, className: className, style: style },
|
|
20
|
+
hasChildren ? (props.children) : placeholder ? (react_1.default.createElement("div", { style: { height }, className: "dn-droppable-placeholder" },
|
|
21
|
+
react_1.default.createElement(NodeTitleWidget_1.NodeTitleWidget, { node: target }))) : (props.children),
|
|
22
|
+
(actions === null || actions === void 0 ? void 0 : actions.length) ? (react_1.default.createElement(NodeActionsWidget_1.NodeActionsWidget, null, actions.map((action, key) => (react_1.default.createElement(NodeActionsWidget_1.NodeActionsWidget.Action, { ...action, key: key }))))) : null));
|
|
23
|
+
});
|
|
24
|
+
exports.DroppableWidget.defaultProps = {
|
|
25
|
+
placeholder: true,
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
.dn-droppable-placeholder {
|
|
2
|
+
height: 60px;
|
|
3
|
+
background-color: var(--dn-droppable-bg-color);
|
|
4
|
+
border: 1px dashed var(--dn-droppable-border-color);
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
color: var(--dn-droppable-color);
|
|
9
|
+
font-weight: lighter;
|
|
10
|
+
font-size: 13px;
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EmptyWidget = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
const reactive_react_1 = require("@formily/reactive-react");
|
|
10
|
+
const IconWidget_1 = require("../IconWidget");
|
|
11
|
+
require("./styles.less");
|
|
12
|
+
exports.EmptyWidget = (0, reactive_react_1.observer)((props) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const tree = (0, hooks_1.useTree)();
|
|
15
|
+
const prefix = (0, hooks_1.usePrefix)('empty');
|
|
16
|
+
const renderEmpty = () => {
|
|
17
|
+
return (react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
18
|
+
react_1.default.createElement("div", { className: "animations" },
|
|
19
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: props.dragTipsDirection === 'left'
|
|
20
|
+
? 'DragLeftSourceAnimation'
|
|
21
|
+
: 'DragRightSourceAnimation', size: 240 }),
|
|
22
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "BatchDragAnimation", size: 240 })),
|
|
23
|
+
react_1.default.createElement("div", { className: "hotkeys-list" },
|
|
24
|
+
react_1.default.createElement("div", null,
|
|
25
|
+
"Selection ",
|
|
26
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Command" }),
|
|
27
|
+
" + Click /",
|
|
28
|
+
' ',
|
|
29
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Shift" }),
|
|
30
|
+
" + Click /",
|
|
31
|
+
' ',
|
|
32
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Command" }),
|
|
33
|
+
" + A"),
|
|
34
|
+
react_1.default.createElement("div", null,
|
|
35
|
+
"Copy ",
|
|
36
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Command" }),
|
|
37
|
+
" + C / Paste",
|
|
38
|
+
' ',
|
|
39
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Command" }),
|
|
40
|
+
" + V"),
|
|
41
|
+
react_1.default.createElement("div", null,
|
|
42
|
+
"Delete ",
|
|
43
|
+
react_1.default.createElement(IconWidget_1.IconWidget, { infer: "Delete" })))));
|
|
44
|
+
};
|
|
45
|
+
if (!((_a = tree === null || tree === void 0 ? void 0 : tree.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
46
|
+
return (react_1.default.createElement("div", { className: prefix }, props.children ? props.children : renderEmpty()));
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
});
|
|
50
|
+
exports.EmptyWidget.defaultProps = {
|
|
51
|
+
dragTipsDirection: 'left',
|
|
52
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import '../../variables.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix-cls}-empty {
|
|
4
|
+
transform: perspective(1px) translate3d(0, 0, 0);
|
|
5
|
+
position: absolute;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
height: 100%;
|
|
11
|
+
width: 100%;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
background: var(--dn-empty-bg-color);
|
|
17
|
+
.animations {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
}
|
|
22
|
+
.hotkeys-list {
|
|
23
|
+
text-align: center;
|
|
24
|
+
line-height: 30px;
|
|
25
|
+
color: #888;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.GhostWidget = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const hooks_1 = require("../../hooks");
|
|
39
|
+
const core_1 = require("@formily-design/core");
|
|
40
|
+
const reactive_1 = require("@formily/reactive");
|
|
41
|
+
const reactive_react_1 = require("@formily/reactive-react");
|
|
42
|
+
const NodeTitleWidget_1 = require("../NodeTitleWidget");
|
|
43
|
+
require("./styles.less");
|
|
44
|
+
exports.GhostWidget = (0, reactive_react_1.observer)(() => {
|
|
45
|
+
const designer = (0, hooks_1.useDesigner)();
|
|
46
|
+
const cursor = (0, hooks_1.useCursor)();
|
|
47
|
+
const ref = (0, react_1.useRef)();
|
|
48
|
+
const prefix = (0, hooks_1.usePrefix)('ghost');
|
|
49
|
+
const movingNodes = designer.findMovingNodes();
|
|
50
|
+
const firstNode = movingNodes[0];
|
|
51
|
+
(0, react_1.useEffect)(() => (0, reactive_1.autorun)(() => {
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const transform = `perspective(1px) translate3d(${((_a = cursor.position) === null || _a === void 0 ? void 0 : _a.topClientX) - 18}px,${((_b = cursor.position) === null || _b === void 0 ? void 0 : _b.topClientY) - 12}px,0) scale(0.8)`;
|
|
54
|
+
if (!ref.current)
|
|
55
|
+
return;
|
|
56
|
+
ref.current.style.transform = transform;
|
|
57
|
+
}), [designer, cursor]);
|
|
58
|
+
const renderNodes = () => {
|
|
59
|
+
return (react_1.default.createElement("span", { style: {
|
|
60
|
+
whiteSpace: 'nowrap',
|
|
61
|
+
} },
|
|
62
|
+
react_1.default.createElement(NodeTitleWidget_1.NodeTitleWidget, { node: firstNode }),
|
|
63
|
+
movingNodes.length > 1 ? '...' : ''));
|
|
64
|
+
};
|
|
65
|
+
if (!firstNode)
|
|
66
|
+
return null;
|
|
67
|
+
return cursor.status === core_1.CursorStatus.Dragging ? (react_1.default.createElement("div", { ref: ref, className: prefix }, renderNodes())) : null;
|
|
68
|
+
});
|
|
69
|
+
exports.GhostWidget.displayName = 'GhostWidget';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import '../../variables.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix-cls}-ghost {
|
|
4
|
+
padding-left: 25px;
|
|
5
|
+
padding-right: 15px;
|
|
6
|
+
height: 30px;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
position: fixed;
|
|
11
|
+
color: var(--dn-ghost-color);
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
z-index: 9999;
|
|
14
|
+
border-radius: 50px;
|
|
15
|
+
background-color: var(--dn-ghost-bg-color);
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
left: 0;
|
|
18
|
+
top: 0;
|
|
19
|
+
transform: translate3d(0, 0, 0);
|
|
20
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HistoryWidget = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const dateformat_1 = __importDefault(require("dateformat"));
|
|
9
|
+
const reactive_react_1 = require("@formily/reactive-react");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const TextWidget_1 = require("../TextWidget");
|
|
12
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
require("./styles.less");
|
|
14
|
+
exports.HistoryWidget = (0, reactive_react_1.observer)(() => {
|
|
15
|
+
const workbench = (0, hooks_1.useWorkbench)();
|
|
16
|
+
const currentWorkspace = (workbench === null || workbench === void 0 ? void 0 : workbench.activeWorkspace) || (workbench === null || workbench === void 0 ? void 0 : workbench.currentWorkspace);
|
|
17
|
+
const prefix = (0, hooks_1.usePrefix)('history');
|
|
18
|
+
if (!currentWorkspace)
|
|
19
|
+
return null;
|
|
20
|
+
return (react_1.default.createElement("div", { className: prefix }, currentWorkspace.history.list().map((item, index) => {
|
|
21
|
+
const type = item.type || 'default_state';
|
|
22
|
+
const token = type.replace(/\:/g, '_');
|
|
23
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(prefix + '-item', {
|
|
24
|
+
active: currentWorkspace.history.current === index,
|
|
25
|
+
}), key: item.timestamp, onClick: () => {
|
|
26
|
+
currentWorkspace.history.goTo(index);
|
|
27
|
+
} },
|
|
28
|
+
react_1.default.createElement("span", { className: prefix + '-item-title' },
|
|
29
|
+
react_1.default.createElement(TextWidget_1.TextWidget, { token: `operations.${token}` })),
|
|
30
|
+
react_1.default.createElement("span", { className: prefix + '-item-timestamp' },
|
|
31
|
+
' ',
|
|
32
|
+
(0, dateformat_1.default)(item.timestamp, 'yy/mm/dd HH:MM:ss'))));
|
|
33
|
+
})));
|
|
34
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@import '../../variables.less';
|
|
2
|
+
|
|
3
|
+
.@{prefix-cls}-history {
|
|
4
|
+
&-item {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
min-height: 32px;
|
|
8
|
+
padding: 0 10px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
color: var(--dn-outline-tree-node-header-color);
|
|
12
|
+
&-timestamp {
|
|
13
|
+
font-size: 10px;
|
|
14
|
+
}
|
|
15
|
+
&:hover {
|
|
16
|
+
background-color: var(--dn-panel-active-bg-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.active {
|
|
20
|
+
background-color: var(--dn-panel-active-bg-color);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipProps } from 'antd';
|
|
3
|
+
import './styles.less';
|
|
4
|
+
export interface IconProviderProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
tooltip?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface IShadowSVGProps {
|
|
9
|
+
content?: string;
|
|
10
|
+
width?: number | string;
|
|
11
|
+
height?: number | string;
|
|
12
|
+
}
|
|
13
|
+
export interface IIconWidgetProps extends React.HTMLAttributes<HTMLElement> {
|
|
14
|
+
tooltip?: React.ReactNode | TooltipProps;
|
|
15
|
+
infer: React.ReactNode | {
|
|
16
|
+
shadow: string;
|
|
17
|
+
};
|
|
18
|
+
size?: number | string;
|
|
19
|
+
}
|
|
20
|
+
export declare const IconWidget: React.FC<IIconWidgetProps> & {
|
|
21
|
+
Provider?: React.FC<IconProviderProps>;
|
|
22
|
+
ShadowSVG?: React.FC<IShadowSVGProps>;
|
|
23
|
+
};
|