@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,52 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useMoveHelper, usePrefix } from '../../hooks';
|
3
|
+
import { ClosestPosition } from '@mdesignable/core';
|
4
|
+
import { observer } from '@formily/reactive-react';
|
5
|
+
export var Insertion = observer(function (_a) {
|
6
|
+
var workspaceId = _a.workspaceId;
|
7
|
+
var moveHelper = useMoveHelper(workspaceId);
|
8
|
+
var prefix = usePrefix('outline-tree-insertion');
|
9
|
+
var createInsertionStyle = function () {
|
10
|
+
var closestDirection = moveHelper.outlineClosestDirection;
|
11
|
+
var closestRect = moveHelper.outlineClosestOffsetRect;
|
12
|
+
var baseStyle = {
|
13
|
+
position: 'absolute',
|
14
|
+
transform: 'perspective(1px) translate3d(0,0,0)',
|
15
|
+
top: 0,
|
16
|
+
left: 0,
|
17
|
+
};
|
18
|
+
if (!closestRect)
|
19
|
+
return baseStyle;
|
20
|
+
if (closestDirection === ClosestPosition.After ||
|
21
|
+
closestDirection === ClosestPosition.InnerAfter ||
|
22
|
+
closestDirection === ClosestPosition.Under ||
|
23
|
+
closestDirection === ClosestPosition.ForbidAfter ||
|
24
|
+
closestDirection === ClosestPosition.ForbidInnerAfter ||
|
25
|
+
closestDirection === ClosestPosition.ForbidUnder) {
|
26
|
+
baseStyle.width = closestRect.width;
|
27
|
+
baseStyle.height = 2;
|
28
|
+
baseStyle.transform = "perspective(1px) translate3d(".concat(closestRect.x, "px,").concat(closestRect.y + closestRect.height - 2, "px,0)");
|
29
|
+
}
|
30
|
+
else if (closestDirection === ClosestPosition.Before ||
|
31
|
+
closestDirection === ClosestPosition.InnerBefore ||
|
32
|
+
closestDirection === ClosestPosition.Upper ||
|
33
|
+
closestDirection === ClosestPosition.ForbidBefore ||
|
34
|
+
closestDirection === ClosestPosition.ForbidInnerBefore ||
|
35
|
+
closestDirection === ClosestPosition.ForbidUpper) {
|
36
|
+
baseStyle.width = closestRect.width;
|
37
|
+
baseStyle.height = 2;
|
38
|
+
baseStyle.transform = "perspective(1px) translate3d(".concat(closestRect.x, "px,").concat(closestRect.y, "px,0)");
|
39
|
+
}
|
40
|
+
if (closestDirection.includes('FORBID')) {
|
41
|
+
baseStyle.backgroundColor = 'red';
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
baseStyle.backgroundColor = '';
|
45
|
+
}
|
46
|
+
return baseStyle;
|
47
|
+
};
|
48
|
+
if (!(moveHelper === null || moveHelper === void 0 ? void 0 : moveHelper.closestNode))
|
49
|
+
return null;
|
50
|
+
return React.createElement("div", { className: prefix, style: createInsertionStyle() });
|
51
|
+
});
|
52
|
+
Insertion.displayName = 'Insertion';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TreeNode } from '@mdesignable/core';
|
3
|
+
import './styles.less';
|
4
|
+
export interface IOutlineTreeNodeProps {
|
5
|
+
node: TreeNode;
|
6
|
+
style?: React.CSSProperties;
|
7
|
+
className?: string;
|
8
|
+
workspaceId?: string;
|
9
|
+
}
|
10
|
+
export declare const OutlineTreeNode: React.FC<IOutlineTreeNodeProps>;
|
@@ -0,0 +1,140 @@
|
|
1
|
+
import React, { useRef, useContext, useEffect } from 'react';
|
2
|
+
import { ClosestPosition, CursorStatus, DragMoveEvent, } from '@mdesignable/core';
|
3
|
+
import { isFn } from '@mdesignable/shared';
|
4
|
+
import { autorun } from '@formily/reactive';
|
5
|
+
import { observer } from '@formily/reactive-react';
|
6
|
+
import { usePrefix, useCursor, useSelection, useMoveHelper, useDesigner, } from '../../hooks';
|
7
|
+
import { IconWidget } from '../IconWidget';
|
8
|
+
import { NodeTitleWidget } from '../NodeTitleWidget';
|
9
|
+
import { NodeContext } from './context';
|
10
|
+
import cls from 'classnames';
|
11
|
+
import './styles.less';
|
12
|
+
export var OutlineTreeNode = observer(function (_a) {
|
13
|
+
var _b, _c;
|
14
|
+
var node = _a.node, className = _a.className, style = _a.style, workspaceId = _a.workspaceId;
|
15
|
+
var prefix = usePrefix('outline-tree-node');
|
16
|
+
var engine = useDesigner();
|
17
|
+
var ref = useRef();
|
18
|
+
var ctx = useContext(NodeContext);
|
19
|
+
var request = useRef(null);
|
20
|
+
var cursor = useCursor();
|
21
|
+
var selection = useSelection(workspaceId);
|
22
|
+
var moveHelper = useMoveHelper(workspaceId);
|
23
|
+
useEffect(function () {
|
24
|
+
return engine.subscribeTo(DragMoveEvent, function () {
|
25
|
+
var _a;
|
26
|
+
var closestNodeId = (_a = moveHelper === null || moveHelper === void 0 ? void 0 : moveHelper.closestNode) === null || _a === void 0 ? void 0 : _a.id;
|
27
|
+
var closestDirection = moveHelper === null || moveHelper === void 0 ? void 0 : moveHelper.outlineClosestDirection;
|
28
|
+
var id = node.id;
|
29
|
+
if (!ref.current)
|
30
|
+
return;
|
31
|
+
if (closestNodeId === id &&
|
32
|
+
closestDirection === ClosestPosition.Inner) {
|
33
|
+
if (!ref.current.classList.contains('droppable')) {
|
34
|
+
ref.current.classList.add('droppable');
|
35
|
+
}
|
36
|
+
if (!ref.current.classList.contains('expanded')) {
|
37
|
+
if (request.current) {
|
38
|
+
clearTimeout(request.current);
|
39
|
+
request.current = null;
|
40
|
+
}
|
41
|
+
request.current = setTimeout(function () {
|
42
|
+
ref.current.classList.add('expanded');
|
43
|
+
}, 600);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
if (request.current) {
|
48
|
+
clearTimeout(request.current);
|
49
|
+
request.current = null;
|
50
|
+
}
|
51
|
+
if (ref.current.classList.contains('droppable')) {
|
52
|
+
ref.current.classList.remove('droppable');
|
53
|
+
}
|
54
|
+
}
|
55
|
+
});
|
56
|
+
}, [node, moveHelper, cursor]);
|
57
|
+
useEffect(function () {
|
58
|
+
return autorun(function () {
|
59
|
+
var _a;
|
60
|
+
var selectedIds = (selection === null || selection === void 0 ? void 0 : selection.selected) || [];
|
61
|
+
var id = node.id;
|
62
|
+
if (!ref.current)
|
63
|
+
return;
|
64
|
+
if (selectedIds.includes(id)) {
|
65
|
+
if (!ref.current.classList.contains('selected')) {
|
66
|
+
ref.current.classList.add('selected');
|
67
|
+
}
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
if (ref.current.classList.contains('selected')) {
|
71
|
+
ref.current.classList.remove('selected');
|
72
|
+
}
|
73
|
+
}
|
74
|
+
if (cursor.status === CursorStatus.Dragging &&
|
75
|
+
((_a = moveHelper === null || moveHelper === void 0 ? void 0 : moveHelper.dragNodes) === null || _a === void 0 ? void 0 : _a.length)) {
|
76
|
+
if (ref.current.classList.contains('selected')) {
|
77
|
+
ref.current.classList.remove('selected');
|
78
|
+
}
|
79
|
+
}
|
80
|
+
});
|
81
|
+
}, [node, selection, moveHelper]);
|
82
|
+
if (!node)
|
83
|
+
return null;
|
84
|
+
var renderIcon = function (node) {
|
85
|
+
var _a;
|
86
|
+
var icon = node.designerProps.icon;
|
87
|
+
if (icon) {
|
88
|
+
return React.createElement(IconWidget, { infer: icon, size: 12 });
|
89
|
+
}
|
90
|
+
if (node === (node === null || node === void 0 ? void 0 : node.root)) {
|
91
|
+
return React.createElement(IconWidget, { infer: "Page", size: 12 });
|
92
|
+
}
|
93
|
+
else if ((_a = node.designerProps) === null || _a === void 0 ? void 0 : _a.droppable) {
|
94
|
+
return React.createElement(IconWidget, { infer: "Container", size: 12 });
|
95
|
+
}
|
96
|
+
return React.createElement(IconWidget, { infer: "Component", size: 12 });
|
97
|
+
};
|
98
|
+
var renderTitle = function (node) {
|
99
|
+
if (isFn(ctx.renderTitle))
|
100
|
+
return ctx.renderTitle(node);
|
101
|
+
return (React.createElement("span", null,
|
102
|
+
React.createElement(NodeTitleWidget, { node: node })));
|
103
|
+
};
|
104
|
+
var renderActions = function (node) {
|
105
|
+
if (isFn(ctx.renderActions))
|
106
|
+
return ctx.renderActions(node);
|
107
|
+
};
|
108
|
+
return (React.createElement("div", { style: style, ref: ref, className: cls(prefix, className, 'expanded'), "data-designer-outline-node-id": node.id },
|
109
|
+
React.createElement("div", { className: prefix + '-header' },
|
110
|
+
React.createElement("div", { className: prefix + '-header-head', style: {
|
111
|
+
left: -node.depth * 16,
|
112
|
+
width: node.depth * 16,
|
113
|
+
} }),
|
114
|
+
React.createElement("div", { className: prefix + '-header-content' },
|
115
|
+
React.createElement("div", { className: prefix + '-header-base' },
|
116
|
+
(((_b = node === null || node === void 0 ? void 0 : node.children) === null || _b === void 0 ? void 0 : _b.length) > 0 || node === node.root) && (React.createElement("div", { className: prefix + '-expand', onClick: function (e) {
|
117
|
+
var _a, _b, _c, _d;
|
118
|
+
e.preventDefault();
|
119
|
+
e.stopPropagation();
|
120
|
+
if ((_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains('expanded')) {
|
121
|
+
(_c = ref.current) === null || _c === void 0 ? void 0 : _c.classList.remove('expanded');
|
122
|
+
}
|
123
|
+
else {
|
124
|
+
(_d = ref.current) === null || _d === void 0 ? void 0 : _d.classList.add('expanded');
|
125
|
+
}
|
126
|
+
} },
|
127
|
+
React.createElement(IconWidget, { infer: "Expand", size: 10 }))),
|
128
|
+
React.createElement("div", { className: prefix + '-icon' }, renderIcon(node)),
|
129
|
+
React.createElement("div", { className: prefix + '-title' }, renderTitle(node))),
|
130
|
+
React.createElement("div", { className: prefix + '-header-actions', "data-click-stop-propagation": true },
|
131
|
+
renderActions(node),
|
132
|
+
node !== node.root && (React.createElement(IconWidget, { className: cls(prefix + '-hidden-icon', {
|
133
|
+
hidden: node.hidden,
|
134
|
+
}), infer: node.hidden ? 'EyeClose' : 'Eye', size: 14, onClick: function () {
|
135
|
+
node.hidden = !node.hidden;
|
136
|
+
} }))))),
|
137
|
+
React.createElement("div", { className: prefix + '-children' }, (_c = node.children) === null || _c === void 0 ? void 0 : _c.map(function (child) {
|
138
|
+
return (React.createElement(OutlineTreeNode, { node: child, key: child.id, workspaceId: workspaceId }));
|
139
|
+
}))));
|
140
|
+
});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { TreeNode } from '@mdesignable/core';
|
2
|
+
import React from 'react';
|
3
|
+
interface INodeContext {
|
4
|
+
renderTitle?: (node: TreeNode) => React.ReactNode;
|
5
|
+
renderActions?: (node: TreeNode) => React.ReactNode;
|
6
|
+
}
|
7
|
+
export declare const NodeContext: React.Context<INodeContext>;
|
8
|
+
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TreeNode } from '@mdesignable/core';
|
3
|
+
export interface IOutlineTreeWidgetProps {
|
4
|
+
className?: string;
|
5
|
+
style?: React.CSSProperties;
|
6
|
+
onClose?: () => void;
|
7
|
+
renderTitle?: (node: TreeNode) => React.ReactNode;
|
8
|
+
renderActions?: (node: TreeNode) => React.ReactNode;
|
9
|
+
}
|
10
|
+
export declare const OutlineTreeWidget: React.FC<IOutlineTreeWidgetProps>;
|
@@ -0,0 +1,65 @@
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
23
|
+
import React, { useRef, useLayoutEffect } from 'react';
|
24
|
+
import cls from 'classnames';
|
25
|
+
import { useTree, usePrefix, useOutline, useWorkbench } from '../../hooks';
|
26
|
+
import { observer } from '@formily/reactive-react';
|
27
|
+
import { OutlineTreeNode } from './OutlineNode';
|
28
|
+
import { Insertion } from './Insertion';
|
29
|
+
import { NodeContext } from './context';
|
30
|
+
import { globalThisPolyfill } from '@mdesignable/shared';
|
31
|
+
export var OutlineTreeWidget = observer(function (_a) {
|
32
|
+
var onClose = _a.onClose, style = _a.style, renderActions = _a.renderActions, renderTitle = _a.renderTitle, className = _a.className, props = __rest(_a, ["onClose", "style", "renderActions", "renderTitle", "className"]);
|
33
|
+
var ref = useRef();
|
34
|
+
var prefix = usePrefix('outline-tree');
|
35
|
+
var workbench = useWorkbench();
|
36
|
+
var current = (workbench === null || workbench === void 0 ? void 0 : workbench.activeWorkspace) || (workbench === null || workbench === void 0 ? void 0 : workbench.currentWorkspace);
|
37
|
+
var workspaceId = current === null || current === void 0 ? void 0 : current.id;
|
38
|
+
var tree = useTree(workspaceId);
|
39
|
+
var outline = useOutline(workspaceId);
|
40
|
+
var outlineRef = useRef();
|
41
|
+
useLayoutEffect(function () {
|
42
|
+
if (!workspaceId)
|
43
|
+
return;
|
44
|
+
if (outlineRef.current && outlineRef.current !== outline) {
|
45
|
+
outlineRef.current.onUnmount();
|
46
|
+
}
|
47
|
+
if (ref.current && outline) {
|
48
|
+
outline.onMount(ref.current, globalThisPolyfill);
|
49
|
+
}
|
50
|
+
outlineRef.current = outline;
|
51
|
+
return function () {
|
52
|
+
outline.onUnmount();
|
53
|
+
};
|
54
|
+
}, [workspaceId, outline]);
|
55
|
+
if (!outline || !workspaceId)
|
56
|
+
return null;
|
57
|
+
return (React.createElement(NodeContext.Provider, { value: { renderActions: renderActions, renderTitle: renderTitle } },
|
58
|
+
React.createElement("div", __assign({}, props, { className: cls(prefix + '-container', className), style: style }),
|
59
|
+
React.createElement("div", { className: prefix + '-content', ref: ref },
|
60
|
+
React.createElement(OutlineTreeNode, { node: tree, workspaceId: workspaceId }),
|
61
|
+
React.createElement("div", { className: prefix + '-aux', style: {
|
62
|
+
pointerEvents: 'none',
|
63
|
+
} },
|
64
|
+
React.createElement(Insertion, { workspaceId: workspaceId }))))));
|
65
|
+
});
|
@@ -0,0 +1,195 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-outline-tree {
|
4
|
+
&-container {
|
5
|
+
position: relative;
|
6
|
+
min-height: 100px;
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
height: 100%;
|
10
|
+
width: 100%;
|
11
|
+
overflow: hidden;
|
12
|
+
background-color: var(--dn-outline-tree-bg-color);
|
13
|
+
}
|
14
|
+
|
15
|
+
&-header {
|
16
|
+
display: flex;
|
17
|
+
padding: 8px;
|
18
|
+
justify-content: space-between;
|
19
|
+
align-items: center;
|
20
|
+
border-bottom: 1px solid var(--dn-outline-tree-header-border-color);
|
21
|
+
color: var(--dn-outline-tree-color);
|
22
|
+
}
|
23
|
+
|
24
|
+
&-title {
|
25
|
+
font-size: 16px;
|
26
|
+
font-weight: 500;
|
27
|
+
}
|
28
|
+
|
29
|
+
&-close {
|
30
|
+
display: flex;
|
31
|
+
align-items: center;
|
32
|
+
transform: scale(1.6);
|
33
|
+
cursor: pointer;
|
34
|
+
}
|
35
|
+
|
36
|
+
&-content {
|
37
|
+
position: relative;
|
38
|
+
flex-grow: 1;
|
39
|
+
height: 100%;
|
40
|
+
width: 100%;
|
41
|
+
padding-bottom: 20px;
|
42
|
+
overflow: overlay;
|
43
|
+
}
|
44
|
+
|
45
|
+
&-aux {
|
46
|
+
position: absolute;
|
47
|
+
top: 0;
|
48
|
+
left: 0;
|
49
|
+
}
|
50
|
+
|
51
|
+
&-insertion {
|
52
|
+
background-color: var(--dn-outline-tree-insertion-bg-color);
|
53
|
+
}
|
54
|
+
|
55
|
+
&-node {
|
56
|
+
position: relative;
|
57
|
+
user-select: none;
|
58
|
+
width: fit-content;
|
59
|
+
min-width: 100%;
|
60
|
+
|
61
|
+
&.expanded {
|
62
|
+
& > .@{prefix-cls}-outline-tree-node-header {
|
63
|
+
.@{prefix-cls}-outline-tree-node-expand {
|
64
|
+
transform: rotate(0);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
& > .@{prefix-cls}-outline-tree-node-children {
|
69
|
+
display: block;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
&.selected {
|
74
|
+
& > .@{prefix-cls}-outline-tree-node-header {
|
75
|
+
background-color: var(--dn-panel-active-bg-color);
|
76
|
+
|
77
|
+
.@{prefix-cls}-outline-tree-node-header-head {
|
78
|
+
background-color: var(--dn-panel-active-bg-color);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
&.droppable {
|
84
|
+
& > .@{prefix-cls}-outline-tree-node-header {
|
85
|
+
.@{prefix-cls}-outline-tree-node-header-content {
|
86
|
+
.@{prefix-cls}-outline-tree-node-header-base {
|
87
|
+
& > .@{prefix-cls}-outline-tree-node-icon {
|
88
|
+
transform: scale(1.2);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
&-hidden-icon:not(.hidden) {
|
96
|
+
display: none;
|
97
|
+
}
|
98
|
+
|
99
|
+
&-header {
|
100
|
+
display: flex;
|
101
|
+
min-height: 32px;
|
102
|
+
width: fit-content;
|
103
|
+
min-width: 100%;
|
104
|
+
align-items: center;
|
105
|
+
color: var(--dn-outline-tree-node-header-color);
|
106
|
+
position: relative;
|
107
|
+
padding-left: 8px;
|
108
|
+
|
109
|
+
&:hover {
|
110
|
+
.@{prefix-cls}-outline-tree-node-header-content {
|
111
|
+
color: var(--dn-outline-tree-node-hover-color);
|
112
|
+
}
|
113
|
+
|
114
|
+
.@{prefix-cls}-outline-tree-node-hidden-icon {
|
115
|
+
display: block;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
&-header-head {
|
121
|
+
position: absolute;
|
122
|
+
top: 0;
|
123
|
+
left: 0;
|
124
|
+
height: 100%;
|
125
|
+
pointer-events: none;
|
126
|
+
}
|
127
|
+
|
128
|
+
&-header-content {
|
129
|
+
display: flex;
|
130
|
+
align-items: center;
|
131
|
+
transition: all 0.15s ease-in;
|
132
|
+
transform-origin: left;
|
133
|
+
width: fit-content;
|
134
|
+
min-width: 100%;
|
135
|
+
height: 100%;
|
136
|
+
justify-content: space-between;
|
137
|
+
font-size: 12px;
|
138
|
+
}
|
139
|
+
|
140
|
+
&-header-base {
|
141
|
+
display: flex;
|
142
|
+
align-items: center;
|
143
|
+
}
|
144
|
+
|
145
|
+
&-header-actions {
|
146
|
+
display: flex;
|
147
|
+
align-items: center;
|
148
|
+
margin-right: 8px;
|
149
|
+
overflow: hidden;
|
150
|
+
text-overflow: ellipsis;
|
151
|
+
white-space: nowrap;
|
152
|
+
}
|
153
|
+
|
154
|
+
&-expand {
|
155
|
+
display: flex;
|
156
|
+
align-items: center;
|
157
|
+
transition: all 0.15s ease-out;
|
158
|
+
transform: rotate(-90deg);
|
159
|
+
margin-right: 3px;
|
160
|
+
width: 12px;
|
161
|
+
}
|
162
|
+
|
163
|
+
&-icon {
|
164
|
+
margin-right: 5px;
|
165
|
+
display: flex;
|
166
|
+
align-items: center;
|
167
|
+
font-size: 12px;
|
168
|
+
text-rendering: optimizeLegibility;
|
169
|
+
-webkit-font-smoothing: antialiased;
|
170
|
+
-moz-osx-font-smoothing: grayscale;
|
171
|
+
}
|
172
|
+
|
173
|
+
&-title {
|
174
|
+
overflow: hidden;
|
175
|
+
text-overflow: ellipsis;
|
176
|
+
white-space: nowrap;
|
177
|
+
margin-right: 100px;
|
178
|
+
}
|
179
|
+
|
180
|
+
&-actions {
|
181
|
+
font-size: 12px;
|
182
|
+
flex-grow: 2;
|
183
|
+
overflow: hidden;
|
184
|
+
text-overflow: ellipsis;
|
185
|
+
white-space: nowrap;
|
186
|
+
}
|
187
|
+
|
188
|
+
&-children {
|
189
|
+
padding-left: 16px;
|
190
|
+
display: none;
|
191
|
+
width: fit-content;
|
192
|
+
min-width: 100%;
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IResourceLike, IResource } from '@mdesignable/core';
|
3
|
+
import './styles.less';
|
4
|
+
export type SourceMapper = (resource: IResource) => React.ReactChild;
|
5
|
+
export interface IResourceWidgetProps {
|
6
|
+
title: React.ReactNode;
|
7
|
+
sources?: IResourceLike[];
|
8
|
+
className?: string;
|
9
|
+
defaultExpand?: boolean;
|
10
|
+
children?: SourceMapper | React.ReactElement;
|
11
|
+
}
|
12
|
+
export declare const ResourceWidget: React.FC<IResourceWidgetProps>;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
var __read = (this && this.__read) || function (o, n) {
|
2
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
3
|
+
if (!m) return o;
|
4
|
+
var i = m.call(o), r, ar = [], e;
|
5
|
+
try {
|
6
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
7
|
+
}
|
8
|
+
catch (error) { e = { error: error }; }
|
9
|
+
finally {
|
10
|
+
try {
|
11
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
12
|
+
}
|
13
|
+
finally { if (e) throw e.error; }
|
14
|
+
}
|
15
|
+
return ar;
|
16
|
+
};
|
17
|
+
import React, { useState } from 'react';
|
18
|
+
import { isResourceHost, isResourceList, } from '@mdesignable/core';
|
19
|
+
import { isFn } from '@mdesignable/shared';
|
20
|
+
import { observer } from '@formily/reactive-react';
|
21
|
+
import { usePrefix } from '../../hooks';
|
22
|
+
import { IconWidget } from '../IconWidget';
|
23
|
+
import { TextWidget } from '../TextWidget';
|
24
|
+
import cls from 'classnames';
|
25
|
+
import './styles.less';
|
26
|
+
export var ResourceWidget = observer(function (props) {
|
27
|
+
var prefix = usePrefix('resource');
|
28
|
+
var _a = __read(useState(props.defaultExpand), 2), expand = _a[0], setExpand = _a[1];
|
29
|
+
var renderNode = function (source) {
|
30
|
+
var _a;
|
31
|
+
var node = source.node, icon = source.icon, title = source.title, thumb = source.thumb, span = source.span;
|
32
|
+
return (React.createElement("div", { className: prefix + '-item', style: { gridColumnStart: "span ".concat(span || 1) }, key: node.id, "data-designer-source-id": node.id },
|
33
|
+
thumb && React.createElement("img", { className: prefix + '-item-thumb', src: thumb }),
|
34
|
+
icon && React.isValidElement(icon) ? (React.createElement(React.Fragment, null, icon)) : (React.createElement(IconWidget, { className: prefix + '-item-icon', infer: icon, style: { width: 150, height: 40 } })),
|
35
|
+
React.createElement("span", { className: prefix + '-item-text' }, React.createElement(TextWidget, null, title || ((_a = node.children[0]) === null || _a === void 0 ? void 0 : _a.getMessage('title'))))));
|
36
|
+
};
|
37
|
+
var sources = props.sources.reduce(function (buf, source) {
|
38
|
+
if (isResourceList(source)) {
|
39
|
+
return buf.concat(source);
|
40
|
+
}
|
41
|
+
else if (isResourceHost(source)) {
|
42
|
+
return buf.concat(source.Resource);
|
43
|
+
}
|
44
|
+
return buf;
|
45
|
+
}, []);
|
46
|
+
var remainItems = sources.reduce(function (length, source) {
|
47
|
+
var _a;
|
48
|
+
return length + ((_a = source.span) !== null && _a !== void 0 ? _a : 1);
|
49
|
+
}, 0) % 3;
|
50
|
+
return (React.createElement("div", { className: cls(prefix, props.className, {
|
51
|
+
expand: expand,
|
52
|
+
}) },
|
53
|
+
React.createElement("div", { className: prefix + '-header', onClick: function (e) {
|
54
|
+
e.stopPropagation();
|
55
|
+
e.preventDefault();
|
56
|
+
setExpand(!expand);
|
57
|
+
} },
|
58
|
+
React.createElement("div", { className: prefix + '-header-expand' },
|
59
|
+
React.createElement(IconWidget, { infer: "Expand", size: 10 })),
|
60
|
+
React.createElement("div", { className: prefix + '-header-content' },
|
61
|
+
React.createElement(TextWidget, null, props.title))),
|
62
|
+
React.createElement("div", { className: prefix + '-content-wrapper' },
|
63
|
+
React.createElement("div", { className: prefix + '-content' },
|
64
|
+
sources.map(isFn(props.children) ? props.children : renderNode),
|
65
|
+
remainItems ? (React.createElement("div", { className: prefix + '-item-remain', style: { gridColumnStart: "span ".concat(3 - remainItems) } })) : null))));
|
66
|
+
});
|
67
|
+
ResourceWidget.defaultProps = {
|
68
|
+
defaultExpand: true,
|
69
|
+
};
|
@@ -0,0 +1,87 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-resource {
|
4
|
+
flex-wrap: wrap;
|
5
|
+
overflow: hidden;
|
6
|
+
|
7
|
+
&-header {
|
8
|
+
display: flex;
|
9
|
+
align-items: center;
|
10
|
+
padding: 5px 8px;
|
11
|
+
color: var(--dn-collapse-header-color);
|
12
|
+
border-bottom: 1px solid var(--dn-panel-border-color);
|
13
|
+
background-color: var(--dn-panel-active-bg-color);
|
14
|
+
cursor: pointer;
|
15
|
+
transition: all 0.25s ease-in-out;
|
16
|
+
font-size: 13px;
|
17
|
+
|
18
|
+
&-expand {
|
19
|
+
transform: rotate(-90deg);
|
20
|
+
font-size: 12px;
|
21
|
+
transition: all 0.15s ease-in-out;
|
22
|
+
margin-right: 3px;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
&-content-wrapper {
|
27
|
+
display: flex;
|
28
|
+
justify-content: center;
|
29
|
+
background: var(--dn-resource-content-bg-color);
|
30
|
+
}
|
31
|
+
|
32
|
+
&-content {
|
33
|
+
width: 100%;
|
34
|
+
display: flex;
|
35
|
+
flex-wrap: wrap;
|
36
|
+
display: none;
|
37
|
+
}
|
38
|
+
|
39
|
+
&.expand {
|
40
|
+
.@{prefix-cls}-resource-content {
|
41
|
+
display: grid;
|
42
|
+
grid-template-columns: repeat(3, 33.3333%);
|
43
|
+
grid-gap: 1px;
|
44
|
+
background-color: var(--dn-panel-border-color);
|
45
|
+
border-bottom: 1px solid var(--dn-panel-border-color);
|
46
|
+
}
|
47
|
+
|
48
|
+
.@{prefix-cls}-resource-header-expand {
|
49
|
+
transform: rotate(0);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
&-item {
|
54
|
+
position: relative;
|
55
|
+
user-select: none;
|
56
|
+
background: var(--dn-resource-content-bg-color);
|
57
|
+
min-height: 40px;
|
58
|
+
color: var(--dn-resource-item-color);
|
59
|
+
display: flex;
|
60
|
+
align-items: center;
|
61
|
+
justify-content: center;
|
62
|
+
flex-direction: column;
|
63
|
+
cursor: grab;
|
64
|
+
transition: color 0.1s ease-out;
|
65
|
+
|
66
|
+
&:hover {
|
67
|
+
color: var(--dn-resource-item-hover-color);
|
68
|
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
69
|
+
z-index: 1;
|
70
|
+
}
|
71
|
+
|
72
|
+
&-icon {
|
73
|
+
margin: 12px 0;
|
74
|
+
}
|
75
|
+
|
76
|
+
&-text {
|
77
|
+
text-align: center;
|
78
|
+
font-size: 12px;
|
79
|
+
line-height: 1;
|
80
|
+
margin-bottom: 12px;
|
81
|
+
}
|
82
|
+
|
83
|
+
&-remain {
|
84
|
+
background: var(--dn-resource-content-bg-color);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IResourceLike, IResource } from '@mdesignable/core';
|
3
|
+
import './styles.less';
|
4
|
+
export type SimpleSourceMapper = (resource: IResource) => React.ReactChild;
|
5
|
+
export interface ISimpleResourceWidgetProps {
|
6
|
+
sources?: IResourceLike[];
|
7
|
+
className?: string;
|
8
|
+
children?: SimpleSourceMapper | React.ReactElement;
|
9
|
+
}
|
10
|
+
export declare const SimpleResourceWidget: React.FC<ISimpleResourceWidgetProps>;
|