@mdesignable/react 1.0.0-beta.64
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/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 +3580 -0
- package/esm/containers/Designer.d.ts +3 -0
- package/esm/containers/Designer.js +49 -0
- package/esm/containers/Layout.d.ts +3 -0
- package/esm/containers/Layout.js +33 -0
- package/esm/containers/Simulator.d.ts +3 -0
- package/esm/containers/Simulator.js +29 -0
- package/esm/containers/Viewport.d.ts +6 -0
- package/esm/containers/Viewport.js +84 -0
- package/esm/containers/Workbench.d.ts +2 -0
- package/esm/containers/Workbench.js +9 -0
- package/esm/containers/Workspace.d.ts +7 -0
- package/esm/containers/Workspace.js +38 -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 +10 -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 +6 -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 +54 -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 +24 -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 +22 -0
- package/esm/panels/CompositePanel.js +140 -0
- package/esm/panels/SettingsPanel.d.ts +6 -0
- package/esm/panels/SettingsPanel.js +69 -0
- package/esm/panels/SourceBarPanel.d.ts +4 -0
- package/esm/panels/SourceBarPanel.js +31 -0
- package/esm/panels/StudioPanel.d.ts +12 -0
- package/esm/panels/StudioPanel.js +44 -0
- package/esm/panels/ToolbarPanel.d.ts +3 -0
- package/esm/panels/ToolbarPanel.js +16 -0
- package/esm/panels/ViewPanel.d.ts +9 -0
- package/esm/panels/ViewPanel.js +57 -0
- package/esm/panels/ViewportPanel.d.ts +3 -0
- package/esm/panels/ViewportPanel.js +18 -0
- package/esm/panels/WorkspacePanel.d.ts +8 -0
- package/esm/panels/WorkspacePanel.js +21 -0
- package/esm/panels/index.d.ts +9 -0
- package/esm/panels/index.js +9 -0
- package/esm/panels/sourceBarPanel.less +4 -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 +22 -0
- package/esm/simulators/MobileSimulator/styles.less +29 -0
- package/esm/simulators/PCSimulator/index.d.ts +7 -0
- package/esm/simulators/PCSimulator/index.js +19 -0
- package/esm/simulators/PCSimulator/styles.less +11 -0
- package/esm/simulators/ResponsiveSimulator/handle.d.ts +10 -0
- package/esm/simulators/ResponsiveSimulator/handle.js +28 -0
- package/esm/simulators/ResponsiveSimulator/index.d.ts +7 -0
- package/esm/simulators/ResponsiveSimulator/index.js +157 -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 +32 -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 +16 -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 +16 -0
- package/esm/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
- package/esm/widgets/AuxToolWidget/DragHandler.js +30 -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 +100 -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 +39 -0
- package/esm/widgets/AuxToolWidget/Selection.d.ts +8 -0
- package/esm/widgets/AuxToolWidget/Selection.js +69 -0
- package/esm/widgets/AuxToolWidget/Selector.d.ts +7 -0
- package/esm/widgets/AuxToolWidget/Selector.js +101 -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 +68 -0
- package/esm/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
- package/esm/widgets/AuxToolWidget/TranslateHandler.js +32 -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 +106 -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 +43 -0
- package/esm/widgets/DroppableWidget/styles.less +11 -0
- package/esm/widgets/EmptyWidget/index.d.ts +6 -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 +35 -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 +22 -0
- package/esm/widgets/IconWidget/index.js +108 -0
- package/esm/widgets/IconWidget/styles.less +17 -0
- package/esm/widgets/NodeActionsWidget/index.d.ts +17 -0
- package/esm/widgets/NodeActionsWidget/index.js +48 -0
- package/esm/widgets/NodeActionsWidget/styles.less +53 -0
- package/esm/widgets/NodePathWidget/index.d.ts +7 -0
- package/esm/widgets/NodePathWidget/index.js +34 -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 +52 -0
- package/esm/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
- package/esm/widgets/OutlineWidget/OutlineNode.js +140 -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 +65 -0
- package/esm/widgets/OutlineWidget/styles.less +195 -0
- package/esm/widgets/ResourceWidget/index.d.ts +12 -0
- package/esm/widgets/ResourceWidget/index.js +69 -0
- package/esm/widgets/ResourceWidget/styles.less +87 -0
- package/esm/widgets/SimpleResourceWidget/index.d.ts +10 -0
- package/esm/widgets/SimpleResourceWidget/index.js +42 -0
- package/esm/widgets/SimpleResourceWidget/styles.less +57 -0
- package/esm/widgets/TextWidget/index.d.ts +9 -0
- package/esm/widgets/TextWidget/index.js +32 -0
- package/esm/widgets/ViewToolsWidget/index.d.ts +8 -0
- package/esm/widgets/ViewToolsWidget/index.js +31 -0
- package/esm/widgets/index.d.ts +16 -0
- package/esm/widgets/index.js +16 -0
- package/lib/containers/Designer.d.ts +3 -0
- package/lib/containers/Designer.js +76 -0
- package/lib/containers/Layout.d.ts +3 -0
- package/lib/containers/Layout.js +63 -0
- package/lib/containers/Simulator.d.ts +3 -0
- package/lib/containers/Simulator.js +35 -0
- package/lib/containers/Viewport.d.ts +6 -0
- package/lib/containers/Viewport.js +114 -0
- package/lib/containers/Workbench.d.ts +2 -0
- package/lib/containers/Workbench.js +15 -0
- package/lib/containers/Workspace.d.ts +7 -0
- package/lib/containers/Workspace.js +65 -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 +14 -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 +10 -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 +58 -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 +27 -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 +22 -0
- package/lib/panels/CompositePanel.js +170 -0
- package/lib/panels/SettingsPanel.d.ts +6 -0
- package/lib/panels/SettingsPanel.js +98 -0
- package/lib/panels/SourceBarPanel.d.ts +4 -0
- package/lib/panels/SourceBarPanel.js +38 -0
- package/lib/panels/StudioPanel.d.ts +12 -0
- package/lib/panels/StudioPanel.js +51 -0
- package/lib/panels/ToolbarPanel.d.ts +3 -0
- package/lib/panels/ToolbarPanel.js +23 -0
- package/lib/panels/ViewPanel.d.ts +9 -0
- package/lib/panels/ViewPanel.js +83 -0
- package/lib/panels/ViewportPanel.d.ts +3 -0
- package/lib/panels/ViewportPanel.js +25 -0
- package/lib/panels/WorkspacePanel.d.ts +8 -0
- package/lib/panels/WorkspacePanel.js +28 -0
- package/lib/panels/index.d.ts +9 -0
- package/lib/panels/index.js +25 -0
- package/lib/panels/sourceBarPanel.less +4 -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 +29 -0
- package/lib/simulators/MobileSimulator/styles.less +29 -0
- package/lib/simulators/PCSimulator/index.d.ts +7 -0
- package/lib/simulators/PCSimulator/index.js +26 -0
- package/lib/simulators/PCSimulator/styles.less +11 -0
- package/lib/simulators/ResponsiveSimulator/handle.d.ts +10 -0
- package/lib/simulators/ResponsiveSimulator/handle.js +35 -0
- package/lib/simulators/ResponsiveSimulator/index.d.ts +7 -0
- package/lib/simulators/ResponsiveSimulator/index.js +186 -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 +32 -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 +23 -0
- package/lib/widgets/AuxToolWidget/Cover.d.ts +2 -0
- package/lib/widgets/AuxToolWidget/Cover.js +81 -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 +23 -0
- package/lib/widgets/AuxToolWidget/DragHandler.d.ts +7 -0
- package/lib/widgets/AuxToolWidget/DragHandler.js +36 -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 +130 -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 +46 -0
- package/lib/widgets/AuxToolWidget/Selection.d.ts +8 -0
- package/lib/widgets/AuxToolWidget/Selection.js +96 -0
- package/lib/widgets/AuxToolWidget/Selector.d.ts +7 -0
- package/lib/widgets/AuxToolWidget/Selector.js +127 -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 +94 -0
- package/lib/widgets/AuxToolWidget/TranslateHandler.d.ts +6 -0
- package/lib/widgets/AuxToolWidget/TranslateHandler.js +39 -0
- package/lib/widgets/AuxToolWidget/index.d.ts +6 -0
- package/lib/widgets/AuxToolWidget/index.js +61 -0
- package/lib/widgets/AuxToolWidget/styles.less +383 -0
- package/lib/widgets/ComponentTreeWidget/index.d.ts +15 -0
- package/lib/widgets/ComponentTreeWidget/index.js +135 -0
- package/lib/widgets/ComponentTreeWidget/styles.less +6 -0
- package/lib/widgets/DesignerToolsWidget/index.d.ts +10 -0
- package/lib/widgets/DesignerToolsWidget/index.js +138 -0
- package/lib/widgets/DesignerToolsWidget/styles.less +29 -0
- package/lib/widgets/DroppableWidget/index.d.ts +15 -0
- package/lib/widgets/DroppableWidget/index.js +49 -0
- package/lib/widgets/DroppableWidget/styles.less +11 -0
- package/lib/widgets/EmptyWidget/index.d.ts +6 -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 +61 -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 +22 -0
- package/lib/widgets/IconWidget/index.js +137 -0
- package/lib/widgets/IconWidget/styles.less +17 -0
- package/lib/widgets/NodeActionsWidget/index.d.ts +17 -0
- package/lib/widgets/NodeActionsWidget/index.js +54 -0
- package/lib/widgets/NodeActionsWidget/styles.less +53 -0
- package/lib/widgets/NodePathWidget/index.d.ts +7 -0
- package/lib/widgets/NodePathWidget/index.js +40 -0
- package/lib/widgets/NodePathWidget/styles.less +16 -0
- package/lib/widgets/NodeTitleWidget/index.d.ts +6 -0
- package/lib/widgets/NodeTitleWidget/index.js +39 -0
- package/lib/widgets/OutlineWidget/Insertion.d.ts +5 -0
- package/lib/widgets/OutlineWidget/Insertion.js +58 -0
- package/lib/widgets/OutlineWidget/OutlineNode.d.ts +10 -0
- package/lib/widgets/OutlineWidget/OutlineNode.js +169 -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 +94 -0
- package/lib/widgets/OutlineWidget/styles.less +195 -0
- package/lib/widgets/ResourceWidget/index.d.ts +12 -0
- package/lib/widgets/ResourceWidget/index.js +98 -0
- package/lib/widgets/ResourceWidget/styles.less +87 -0
- package/lib/widgets/SimpleResourceWidget/index.d.ts +10 -0
- package/lib/widgets/SimpleResourceWidget/index.js +48 -0
- package/lib/widgets/SimpleResourceWidget/styles.less +57 -0
- package/lib/widgets/TextWidget/index.d.ts +9 -0
- package/lib/widgets/TextWidget/index.js +58 -0
- package/lib/widgets/ViewToolsWidget/index.d.ts +8 -0
- package/lib/widgets/ViewToolsWidget/index.js +37 -0
- package/lib/widgets/index.d.ts +16 -0
- package/lib/widgets/index.js +32 -0
- package/package.json +50 -0
@@ -0,0 +1,331 @@
|
|
1
|
+
@import '../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-main-panel {
|
4
|
+
display: flex;
|
5
|
+
width: 100%;
|
6
|
+
height: 100%;
|
7
|
+
flex: 1;
|
8
|
+
min-height: 0;
|
9
|
+
position: relative;
|
10
|
+
overflow: hidden;
|
11
|
+
|
12
|
+
&-container {
|
13
|
+
display: flex;
|
14
|
+
flex-direction: column;
|
15
|
+
flex-grow: 1;
|
16
|
+
|
17
|
+
&.root {
|
18
|
+
position: fixed;
|
19
|
+
top: 0;
|
20
|
+
left: 0;
|
21
|
+
right: 0;
|
22
|
+
bottom: 0;
|
23
|
+
}
|
24
|
+
&.absolute {
|
25
|
+
position: absolute;
|
26
|
+
}
|
27
|
+
&.relative {
|
28
|
+
position: relative;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
&-header {
|
33
|
+
display: flex;
|
34
|
+
align-items: center;
|
35
|
+
flex-grow: 0;
|
36
|
+
flex-shrink: 0;
|
37
|
+
justify-content: space-between;
|
38
|
+
background: var(--dn-main-panel-header-bg-color);
|
39
|
+
border-bottom: 1px solid var(--dn-panel-border-color);
|
40
|
+
padding: 4px;
|
41
|
+
|
42
|
+
&-logo {
|
43
|
+
display: flex;
|
44
|
+
align-items: center;
|
45
|
+
}
|
46
|
+
|
47
|
+
&-actions {
|
48
|
+
display: flex;
|
49
|
+
align-items: center;
|
50
|
+
justify-content: flex-end;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
&.root {
|
55
|
+
position: fixed;
|
56
|
+
top: 0;
|
57
|
+
left: 0;
|
58
|
+
right: 0;
|
59
|
+
bottom: 0;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
.@{prefix-cls}-composite-panel {
|
64
|
+
flex-grow: 0;
|
65
|
+
flex-shrink: 0;
|
66
|
+
display: flex;
|
67
|
+
position: relative;
|
68
|
+
user-select: none;
|
69
|
+
z-index: 2;
|
70
|
+
|
71
|
+
&-tabs {
|
72
|
+
display: flex;
|
73
|
+
flex-direction: column;
|
74
|
+
border-right: 1px solid var(--dn-panel-border-color);
|
75
|
+
background-color: var(--dn-composite-panel-tabs-bg-color);
|
76
|
+
z-index: 2;
|
77
|
+
position: relative;
|
78
|
+
|
79
|
+
&-pane {
|
80
|
+
color: var(--dn-composite-panel-tabs-color);
|
81
|
+
min-height: 48px;
|
82
|
+
min-width: 48px;
|
83
|
+
padding: 10px;
|
84
|
+
display: flex;
|
85
|
+
align-items: center;
|
86
|
+
justify-content: center;
|
87
|
+
cursor: pointer;
|
88
|
+
position: relative;
|
89
|
+
font-size: 20px;
|
90
|
+
flex-direction: column;
|
91
|
+
|
92
|
+
&-title {
|
93
|
+
font-size: 10px;
|
94
|
+
margin-top: 6px;
|
95
|
+
}
|
96
|
+
|
97
|
+
&:hover {
|
98
|
+
color: var(--dn-composite-panel-tabs-hover-color);
|
99
|
+
}
|
100
|
+
|
101
|
+
&.active {
|
102
|
+
color: var(--dn-composite-panel-tabs-hover-color);
|
103
|
+
|
104
|
+
&::after {
|
105
|
+
position: absolute;
|
106
|
+
top: 0;
|
107
|
+
left: 0;
|
108
|
+
display: block;
|
109
|
+
content: '';
|
110
|
+
width: 3px;
|
111
|
+
height: 100%;
|
112
|
+
background-color: var(--dn-composite-panel-tabs-hover-color);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
&-content {
|
118
|
+
width: 300px;
|
119
|
+
border-right: 1px solid var(--dn-panel-border-color);
|
120
|
+
background: var(--dn-composite-panel-tabs-content-bg-color);
|
121
|
+
display: flex;
|
122
|
+
flex-direction: column;
|
123
|
+
height: 100%;
|
124
|
+
box-sizing: content-box;
|
125
|
+
|
126
|
+
&.pinning {
|
127
|
+
position: absolute;
|
128
|
+
z-index: 1;
|
129
|
+
left: 100%;
|
130
|
+
top: 0;
|
131
|
+
border-right: 1px solid transparent;
|
132
|
+
box-shadow: -2px 5px 10px rgba(102, 102, 102, 0.42);
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
&-header {
|
137
|
+
padding: 14px 7px;
|
138
|
+
color: var(--dn-composite-panel-tabs-header-color);
|
139
|
+
line-height: 18px;
|
140
|
+
font-size: 16px;
|
141
|
+
border-bottom: 1px solid var(--dn-panel-border-color);
|
142
|
+
display: flex;
|
143
|
+
justify-content: space-between;
|
144
|
+
|
145
|
+
&-actions {
|
146
|
+
display: flex;
|
147
|
+
align-items: center;
|
148
|
+
|
149
|
+
& > * {
|
150
|
+
margin-right: 8px;
|
151
|
+
|
152
|
+
&:last-child {
|
153
|
+
margin-right: 0;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
&-pin {
|
159
|
+
transition: all 0.15s ease-in-out;
|
160
|
+
|
161
|
+
&:hover {
|
162
|
+
transform: scale(1.1);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
&-title {
|
167
|
+
font-size: 20px;
|
168
|
+
}
|
169
|
+
|
170
|
+
&-close {
|
171
|
+
transition: all 0.15s ease-in-out;
|
172
|
+
|
173
|
+
&:hover {
|
174
|
+
transform: rotate(90deg);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
&-body {
|
180
|
+
flex-grow: 2;
|
181
|
+
flex-shrink: 2;
|
182
|
+
overflow: overlay;
|
183
|
+
overflow-x: hidden;
|
184
|
+
height: 100%;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
&.direction-right {
|
189
|
+
flex-direction: row-reverse;
|
190
|
+
|
191
|
+
.@{prefix-cls}-composite-panel-tabs-pane.active:after {
|
192
|
+
left: auto;
|
193
|
+
right: -1px;
|
194
|
+
}
|
195
|
+
|
196
|
+
.@{prefix-cls}-composite-panel-tabs-content.pinning {
|
197
|
+
left: auto;
|
198
|
+
right: 100%;
|
199
|
+
top: 0;
|
200
|
+
}
|
201
|
+
|
202
|
+
.@{prefix-cls}-composite-panel-tabs-content {
|
203
|
+
border-right: none;
|
204
|
+
border-left: 1px solid var(--dn-panel-border-color);
|
205
|
+
}
|
206
|
+
.@{prefix-cls}-composite-panel-tabs {
|
207
|
+
border-left: 1px solid var(--dn-panel-border-color);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
.@{prefix-cls}-workspace-panel {
|
213
|
+
display: flex;
|
214
|
+
flex-grow: 1;
|
215
|
+
flex-direction: column;
|
216
|
+
padding: 4px;
|
217
|
+
overflow: hidden;
|
218
|
+
box-sizing: border-box;
|
219
|
+
background-color: var(--dn-workspace-panel-bg-color);
|
220
|
+
position: relative;
|
221
|
+
z-index: 1;
|
222
|
+
|
223
|
+
&-item {
|
224
|
+
position: relative;
|
225
|
+
}
|
226
|
+
|
227
|
+
button[disabled] {
|
228
|
+
pointer-events: none !important;
|
229
|
+
}
|
230
|
+
}
|
231
|
+
|
232
|
+
.@{prefix-cls}-settings-panel {
|
233
|
+
flex-grow: 0;
|
234
|
+
flex-shrink: 0;
|
235
|
+
position: relative;
|
236
|
+
display: flex;
|
237
|
+
flex-direction: column;
|
238
|
+
z-index: 2;
|
239
|
+
width: 300px;
|
240
|
+
background: var(--dn-composite-panel-tabs-content-bg-color);
|
241
|
+
border-left: 1px solid var(--dn-panel-border-color);
|
242
|
+
height: 100%;
|
243
|
+
box-sizing: content-box;
|
244
|
+
user-select: none;
|
245
|
+
|
246
|
+
&.pinning {
|
247
|
+
position: absolute;
|
248
|
+
z-index: 10;
|
249
|
+
top: 0;
|
250
|
+
right: 0;
|
251
|
+
box-shadow: 2px 5px 10px rgba(102, 102, 102, 0.52);
|
252
|
+
border-left: 1px solid transparent;
|
253
|
+
}
|
254
|
+
|
255
|
+
&-header {
|
256
|
+
padding: 14px 7px;
|
257
|
+
color: var(--dn-composite-panel-tabs-header-color);
|
258
|
+
line-height: 18px;
|
259
|
+
font-size: 16px;
|
260
|
+
border-bottom: 1px solid var(--dn-panel-border-color);
|
261
|
+
display: flex;
|
262
|
+
justify-content: space-between;
|
263
|
+
|
264
|
+
&-actions {
|
265
|
+
display: flex;
|
266
|
+
align-items: center;
|
267
|
+
|
268
|
+
& > * {
|
269
|
+
margin-right: 8px;
|
270
|
+
|
271
|
+
&:last-child {
|
272
|
+
margin-right: 0;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
}
|
276
|
+
|
277
|
+
&-pin {
|
278
|
+
transition: all 0.15s ease-in-out;
|
279
|
+
|
280
|
+
&:hover {
|
281
|
+
transform: scale(1.1);
|
282
|
+
}
|
283
|
+
}
|
284
|
+
|
285
|
+
&-title {
|
286
|
+
font-size: 20px;
|
287
|
+
}
|
288
|
+
|
289
|
+
&-close {
|
290
|
+
transition: all 0.15s ease-in-out;
|
291
|
+
|
292
|
+
&:hover {
|
293
|
+
transform: rotate(90deg);
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
&-body {
|
299
|
+
flex-grow: 2;
|
300
|
+
flex-shrink: 2;
|
301
|
+
overflow: overlay;
|
302
|
+
height: 100%;
|
303
|
+
}
|
304
|
+
|
305
|
+
&-opener {
|
306
|
+
position: absolute;
|
307
|
+
right: 0;
|
308
|
+
top: 50%;
|
309
|
+
transform: translateY(-50%);
|
310
|
+
z-index: 2;
|
311
|
+
background: var(--dn-composite-panel-tabs-content-bg-color);
|
312
|
+
border: 1px solid var(--dn-panel-border-color);
|
313
|
+
color: var(--dn-composite-panel-tabs-color);
|
314
|
+
box-shadow: 0 0 6px rgb(0 0 0 / 10%);
|
315
|
+
border-radius: 3px;
|
316
|
+
display: flex;
|
317
|
+
align-items: center;
|
318
|
+
justify-content: center;
|
319
|
+
width: 40px;
|
320
|
+
height: 40px;
|
321
|
+
cursor: pointer;
|
322
|
+
|
323
|
+
.dn-icon {
|
324
|
+
transition: all 0.15s ease-in-out;
|
325
|
+
}
|
326
|
+
|
327
|
+
&:hover .dn-icon {
|
328
|
+
transform: rotate(45deg);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { observer } from '@formily/reactive-react';
|
2
|
+
import React from 'react';
|
3
|
+
import { useScreen, usePrefix, useTheme } from '../../hooks';
|
4
|
+
var MockupImages = {
|
5
|
+
dark: [
|
6
|
+
'//img.alicdn.com/imgextra/i3/O1CN01zXMc8W26oJZGUaCK1_!!6000000007708-55-tps-946-459.svg',
|
7
|
+
'//img.alicdn.com/imgextra/i3/O1CN012KWk2i1DLduN7InSK_!!6000000000200-55-tps-459-945.svg',
|
8
|
+
],
|
9
|
+
light: [
|
10
|
+
'//img.alicdn.com/imgextra/i4/O1CN01vuXGe31tEy00v2xBx_!!6000000005871-55-tps-946-459.svg',
|
11
|
+
'//img.alicdn.com/imgextra/i4/O1CN01ehfzMc1QPqY6HONTJ_!!6000000001969-55-tps-459-945.svg',
|
12
|
+
],
|
13
|
+
};
|
14
|
+
export var MobileBody = observer(function (props) {
|
15
|
+
var screen = useScreen();
|
16
|
+
var theme = useTheme();
|
17
|
+
var prefix = usePrefix('mobile-simulator-body');
|
18
|
+
var getContentStyles = function () {
|
19
|
+
if (screen.flip) {
|
20
|
+
return {
|
21
|
+
position: 'absolute',
|
22
|
+
width: 736,
|
23
|
+
height: 414,
|
24
|
+
top: 43.3333,
|
25
|
+
left: 106.667,
|
26
|
+
overflow: 'hidden',
|
27
|
+
};
|
28
|
+
}
|
29
|
+
return {
|
30
|
+
position: 'absolute',
|
31
|
+
width: 414,
|
32
|
+
height: 736,
|
33
|
+
top: 126.667,
|
34
|
+
left: 23.3333,
|
35
|
+
overflow: 'hidden',
|
36
|
+
};
|
37
|
+
};
|
38
|
+
return (React.createElement("div", { className: prefix, style: {
|
39
|
+
alignItems: screen.flip ? 'center' : '',
|
40
|
+
minWidth: screen.flip ? 1000 : 0,
|
41
|
+
} },
|
42
|
+
React.createElement("div", { className: prefix + '-wrapper', style: {
|
43
|
+
position: 'relative',
|
44
|
+
minHeight: screen.flip ? 0 : 1000,
|
45
|
+
} },
|
46
|
+
React.createElement("img", { src: screen.flip ? MockupImages[theme][0] : MockupImages[theme][1], style: {
|
47
|
+
display: 'block',
|
48
|
+
margin: '20px 0',
|
49
|
+
width: screen.flip ? 946.667 : 460,
|
50
|
+
height: screen.flip ? 460 : 946.667,
|
51
|
+
boxShadow: '0 0 20px #0000004d',
|
52
|
+
borderRadius: 60,
|
53
|
+
backfaceVisibility: 'hidden',
|
54
|
+
} }),
|
55
|
+
React.createElement("div", { className: prefix + '-content', style: getContentStyles() }, props.children))));
|
56
|
+
});
|
57
|
+
MobileBody.defaultProps = {};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './styles.less';
|
3
|
+
export interface IMobileSimulatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
4
|
+
className?: string;
|
5
|
+
style?: React.CSSProperties;
|
6
|
+
}
|
7
|
+
export declare const MobileSimulator: React.FC<IMobileSimulatorProps>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
import React from 'react';
|
13
|
+
import { MobileBody } from './body';
|
14
|
+
import { usePrefix } from '../../hooks';
|
15
|
+
import cls from 'classnames';
|
16
|
+
import './styles.less';
|
17
|
+
export var MobileSimulator = function (props) {
|
18
|
+
var prefix = usePrefix('mobile-simulator');
|
19
|
+
return (React.createElement("div", __assign({}, props, { className: cls(prefix, props.className) }),
|
20
|
+
React.createElement("div", { className: prefix + '-content' },
|
21
|
+
React.createElement(MobileBody, null, props.children))));
|
22
|
+
};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-mobile-simulator {
|
4
|
+
position: relative;
|
5
|
+
min-height: 100px;
|
6
|
+
height: 100%;
|
7
|
+
width: 100%;
|
8
|
+
background-color: var(--dn-mobile-simulator-bg-color);
|
9
|
+
|
10
|
+
&-content {
|
11
|
+
width: 100%;
|
12
|
+
top: 0;
|
13
|
+
left: 0;
|
14
|
+
height: 100%;
|
15
|
+
position: absolute;
|
16
|
+
overflow: overlay;
|
17
|
+
}
|
18
|
+
|
19
|
+
&-body {
|
20
|
+
display: flex;
|
21
|
+
justify-content: center;
|
22
|
+
height: 100%;
|
23
|
+
|
24
|
+
&-content {
|
25
|
+
background-color: var(--dn-mobile-simulator-body-bg-color);
|
26
|
+
border: 3px solid var(--dn-mobile-simulator-border-color)
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
import React from 'react';
|
13
|
+
import cls from 'classnames';
|
14
|
+
import { usePrefix } from '../../hooks';
|
15
|
+
import './styles.less';
|
16
|
+
export var PCSimulator = function (props) {
|
17
|
+
var prefix = usePrefix('pc-simulator');
|
18
|
+
return (React.createElement("div", __assign({}, props, { className: cls(prefix, props.className) }), props.children));
|
19
|
+
};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare enum ResizeHandleType {
|
3
|
+
Resize = "RESIZE",
|
4
|
+
ResizeWidth = "RESIZE_WIDTH",
|
5
|
+
ResizeHeight = "RESIZE_HEIGHT"
|
6
|
+
}
|
7
|
+
export interface IResizeHandleProps {
|
8
|
+
type?: ResizeHandleType;
|
9
|
+
}
|
10
|
+
export declare const ResizeHandle: React.FC<IResizeHandleProps>;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
import React from 'react';
|
13
|
+
import { useDesigner, usePrefix } from '../../hooks';
|
14
|
+
import cls from 'classnames';
|
15
|
+
export var ResizeHandleType;
|
16
|
+
(function (ResizeHandleType) {
|
17
|
+
ResizeHandleType["Resize"] = "RESIZE";
|
18
|
+
ResizeHandleType["ResizeWidth"] = "RESIZE_WIDTH";
|
19
|
+
ResizeHandleType["ResizeHeight"] = "RESIZE_HEIGHT";
|
20
|
+
})(ResizeHandleType || (ResizeHandleType = {}));
|
21
|
+
export var ResizeHandle = function (props) {
|
22
|
+
var _a, _b;
|
23
|
+
var prefix = usePrefix('resize-handle');
|
24
|
+
var designer = useDesigner();
|
25
|
+
return (React.createElement("div", __assign({}, props, (_a = {}, _a[designer.props.screenResizeHandlerAttrName] = props.type, _a.className = cls(prefix, (_b = {},
|
26
|
+
_b["".concat(prefix, "-").concat(props.type)] = !!props.type,
|
27
|
+
_b)), _a)), props.children));
|
28
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import './styles.less';
|
3
|
+
export interface IResponsiveSimulatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
4
|
+
className?: string;
|
5
|
+
style?: React.CSSProperties;
|
6
|
+
}
|
7
|
+
export declare const ResponsiveSimulator: React.FC<IResponsiveSimulatorProps>;
|
@@ -0,0 +1,157 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
import React, { useRef } from 'react';
|
13
|
+
import { observer } from '@formily/reactive-react';
|
14
|
+
import { DragStartEvent, DragMoveEvent, DragStopEvent, CursorDragType, } from '@mdesignable/core';
|
15
|
+
import { calcSpeedFactor, createUniformSpeedAnimation, } from '@mdesignable/shared';
|
16
|
+
import { useScreen, useDesigner, usePrefix } from '../../hooks';
|
17
|
+
import { IconWidget } from '../../widgets';
|
18
|
+
import { ResizeHandle, ResizeHandleType } from './handle';
|
19
|
+
import cls from 'classnames';
|
20
|
+
import './styles.less';
|
21
|
+
var useResizeEffect = function (container, content, engine) {
|
22
|
+
var status = null;
|
23
|
+
var startX = 0;
|
24
|
+
var startY = 0;
|
25
|
+
var startWidth = 0;
|
26
|
+
var startHeight = 0;
|
27
|
+
var animationX = null;
|
28
|
+
var animationY = null;
|
29
|
+
var getStyle = function (status) {
|
30
|
+
if (status === ResizeHandleType.Resize)
|
31
|
+
return 'nwse-resize';
|
32
|
+
if (status === ResizeHandleType.ResizeHeight)
|
33
|
+
return 'ns-resize';
|
34
|
+
if (status === ResizeHandleType.ResizeWidth)
|
35
|
+
return 'ew-resize';
|
36
|
+
};
|
37
|
+
var updateSize = function (deltaX, deltaY) {
|
38
|
+
var _a;
|
39
|
+
var containerRect = (_a = container.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
40
|
+
if (status === ResizeHandleType.Resize) {
|
41
|
+
engine.screen.setSize(startWidth + deltaX, startHeight + deltaY);
|
42
|
+
container.current.scrollBy(containerRect.width + deltaX, containerRect.height + deltaY);
|
43
|
+
}
|
44
|
+
else if (status === ResizeHandleType.ResizeHeight) {
|
45
|
+
engine.screen.setSize(startWidth, startHeight + deltaY);
|
46
|
+
container.current.scrollBy(container.current.scrollLeft, containerRect.height + deltaY);
|
47
|
+
}
|
48
|
+
else if (status === ResizeHandleType.ResizeWidth) {
|
49
|
+
engine.screen.setSize(startWidth + deltaX, startHeight);
|
50
|
+
container.current.scrollBy(containerRect.width + deltaX, container.current.scrollTop);
|
51
|
+
}
|
52
|
+
};
|
53
|
+
engine.subscribeTo(DragStartEvent, function (e) {
|
54
|
+
var _a, _b;
|
55
|
+
if (!((_a = engine.workbench.currentWorkspace) === null || _a === void 0 ? void 0 : _a.viewport))
|
56
|
+
return;
|
57
|
+
var target = e.data.target;
|
58
|
+
if (target === null || target === void 0 ? void 0 : target.closest("*[".concat(engine.props.screenResizeHandlerAttrName, "]"))) {
|
59
|
+
var rect = (_b = content.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
60
|
+
if (!rect)
|
61
|
+
return;
|
62
|
+
status = target.getAttribute(engine.props.screenResizeHandlerAttrName);
|
63
|
+
engine.cursor.setStyle(getStyle(status));
|
64
|
+
startX = e.data.topClientX;
|
65
|
+
startY = e.data.topClientY;
|
66
|
+
startWidth = rect.width;
|
67
|
+
startHeight = rect.height;
|
68
|
+
engine.cursor.setDragType(CursorDragType.Resize);
|
69
|
+
}
|
70
|
+
});
|
71
|
+
engine.subscribeTo(DragMoveEvent, function (e) {
|
72
|
+
var _a, _b;
|
73
|
+
if (!((_a = engine.workbench.currentWorkspace) === null || _a === void 0 ? void 0 : _a.viewport))
|
74
|
+
return;
|
75
|
+
if (!status)
|
76
|
+
return;
|
77
|
+
var deltaX = e.data.topClientX - startX;
|
78
|
+
var deltaY = e.data.topClientY - startY;
|
79
|
+
var containerRect = (_b = container.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
80
|
+
var distanceX = Math.floor(containerRect.right - e.data.topClientX);
|
81
|
+
var distanceY = Math.floor(containerRect.bottom - e.data.topClientY);
|
82
|
+
var factorX = calcSpeedFactor(distanceX, 10);
|
83
|
+
var factorY = calcSpeedFactor(distanceY, 10);
|
84
|
+
updateSize(deltaX, deltaY);
|
85
|
+
if (distanceX <= 10) {
|
86
|
+
if (!animationX) {
|
87
|
+
animationX = createUniformSpeedAnimation(1000 * factorX, function (delta) {
|
88
|
+
updateSize(deltaX + delta, deltaY);
|
89
|
+
});
|
90
|
+
}
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
if (animationX) {
|
94
|
+
animationX = animationX();
|
95
|
+
}
|
96
|
+
}
|
97
|
+
if (distanceY <= 10) {
|
98
|
+
if (!animationY) {
|
99
|
+
animationY = createUniformSpeedAnimation(300 * factorY, function (delta) {
|
100
|
+
updateSize(deltaX, deltaY + delta);
|
101
|
+
});
|
102
|
+
}
|
103
|
+
}
|
104
|
+
else {
|
105
|
+
if (animationY) {
|
106
|
+
animationY = animationY();
|
107
|
+
}
|
108
|
+
}
|
109
|
+
});
|
110
|
+
engine.subscribeTo(DragStopEvent, function () {
|
111
|
+
if (!status)
|
112
|
+
return;
|
113
|
+
status = null;
|
114
|
+
engine.cursor.setStyle('');
|
115
|
+
engine.cursor.setDragType(CursorDragType.Move);
|
116
|
+
if (animationX) {
|
117
|
+
animationX = animationX();
|
118
|
+
}
|
119
|
+
if (animationY) {
|
120
|
+
animationY = animationY();
|
121
|
+
}
|
122
|
+
});
|
123
|
+
};
|
124
|
+
export var ResponsiveSimulator = observer(function (props) {
|
125
|
+
var container = useRef();
|
126
|
+
var content = useRef();
|
127
|
+
var prefix = usePrefix('responsive-simulator');
|
128
|
+
var screen = useScreen();
|
129
|
+
useDesigner(function (engine) {
|
130
|
+
useResizeEffect(container, content, engine);
|
131
|
+
});
|
132
|
+
return (React.createElement("div", __assign({}, props, { className: cls(prefix, props.className), style: __assign({ height: '100%', width: '100%', minHeight: 100, position: 'relative' }, props.style) }),
|
133
|
+
React.createElement("div", { ref: container, style: {
|
134
|
+
position: 'absolute',
|
135
|
+
top: 0,
|
136
|
+
left: 0,
|
137
|
+
height: '100%',
|
138
|
+
width: '100%',
|
139
|
+
overflow: 'overlay',
|
140
|
+
} },
|
141
|
+
React.createElement("div", { ref: content, style: {
|
142
|
+
width: screen.width,
|
143
|
+
height: screen.height,
|
144
|
+
paddingRight: 15,
|
145
|
+
paddingBottom: 15,
|
146
|
+
position: 'relative',
|
147
|
+
boxSizing: 'border-box',
|
148
|
+
overflow: 'hidden',
|
149
|
+
} },
|
150
|
+
props.children,
|
151
|
+
React.createElement(ResizeHandle, { type: ResizeHandleType.Resize },
|
152
|
+
React.createElement(IconWidget, { infer: "DragMove", style: { pointerEvents: 'none' } })),
|
153
|
+
React.createElement(ResizeHandle, { type: ResizeHandleType.ResizeHeight },
|
154
|
+
React.createElement(IconWidget, { infer: "Menu", style: { pointerEvents: 'none' } })),
|
155
|
+
React.createElement(ResizeHandle, { type: ResizeHandleType.ResizeWidth },
|
156
|
+
React.createElement(IconWidget, { infer: "Menu", style: { pointerEvents: 'none' } }))))));
|
157
|
+
});
|