@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,43 @@
|
|
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 from 'react';
|
24
|
+
import { observer } from '@formily/reactive-react';
|
25
|
+
import { useTreeNode, useNodeIdProps } from '../../hooks';
|
26
|
+
import { NodeTitleWidget } from '../NodeTitleWidget';
|
27
|
+
import { NodeActionsWidget, } from '../NodeActionsWidget';
|
28
|
+
import './styles.less';
|
29
|
+
export var DroppableWidget = observer(function (_a) {
|
30
|
+
var _b;
|
31
|
+
var node = _a.node, actions = _a.actions, height = _a.height, width = _a.width, placeholder = _a.placeholder, style = _a.style, className = _a.className, hasChildrenProp = _a.hasChildren, props = __rest(_a, ["node", "actions", "height", "width", "placeholder", "style", "className", "hasChildren"]);
|
32
|
+
var currentNode = useTreeNode();
|
33
|
+
var nodeId = useNodeIdProps(node);
|
34
|
+
var target = node !== null && node !== void 0 ? node : currentNode;
|
35
|
+
var hasChildren = hasChildrenProp !== null && hasChildrenProp !== void 0 ? hasChildrenProp : ((_b = target.children) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
36
|
+
return (React.createElement("div", __assign({}, nodeId, props, { className: className, style: style }),
|
37
|
+
hasChildren ? (props.children) : placeholder ? (React.createElement("div", { style: { height: height, width: width }, className: "dn-droppable-placeholder" },
|
38
|
+
React.createElement(NodeTitleWidget, { node: target }))) : (props.children),
|
39
|
+
(actions === null || actions === void 0 ? void 0 : actions.length) ? (React.createElement(NodeActionsWidget, null, actions.map(function (action, key) { return (React.createElement(NodeActionsWidget.Action, __assign({}, action, { key: key }))); }))) : null));
|
40
|
+
});
|
41
|
+
DroppableWidget.defaultProps = {
|
42
|
+
placeholder: true,
|
43
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.dn-droppable-placeholder {
|
2
|
+
height: 60px;
|
3
|
+
background-color: var(--dn-droppable-bg-color);
|
4
|
+
border: 1px dashed var(--dn-droppable-border-color);
|
5
|
+
display: flex;
|
6
|
+
align-items: center;
|
7
|
+
justify-content: center;
|
8
|
+
color: var(--dn-droppable-color);
|
9
|
+
font-weight: lighter;
|
10
|
+
font-size: 13px;
|
11
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useTree, usePrefix } from '../../hooks';
|
3
|
+
import { observer } from '@formily/reactive-react';
|
4
|
+
import { IconWidget } from '../IconWidget';
|
5
|
+
import './styles.less';
|
6
|
+
export var EmptyWidget = observer(function (props) {
|
7
|
+
var _a;
|
8
|
+
var tree = useTree();
|
9
|
+
var prefix = usePrefix('empty');
|
10
|
+
var renderEmpty = function () {
|
11
|
+
return (React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
12
|
+
React.createElement("div", { className: "animations" },
|
13
|
+
React.createElement(IconWidget, { infer: props.dragTipsDirection === 'left'
|
14
|
+
? 'DragLeftSourceAnimation'
|
15
|
+
: 'DragRightSourceAnimation', size: 240 }),
|
16
|
+
React.createElement(IconWidget, { infer: "BatchDragAnimation", size: 240 })),
|
17
|
+
React.createElement("div", { className: "hotkeys-list" },
|
18
|
+
React.createElement("div", null,
|
19
|
+
"Selection ",
|
20
|
+
React.createElement(IconWidget, { infer: "Command" }),
|
21
|
+
" + Click /",
|
22
|
+
' ',
|
23
|
+
React.createElement(IconWidget, { infer: "Shift" }),
|
24
|
+
" + Click /",
|
25
|
+
' ',
|
26
|
+
React.createElement(IconWidget, { infer: "Command" }),
|
27
|
+
" + A"),
|
28
|
+
React.createElement("div", null,
|
29
|
+
"Copy ",
|
30
|
+
React.createElement(IconWidget, { infer: "Command" }),
|
31
|
+
" + C / Paste",
|
32
|
+
' ',
|
33
|
+
React.createElement(IconWidget, { infer: "Command" }),
|
34
|
+
" + V"),
|
35
|
+
React.createElement("div", null,
|
36
|
+
"Delete ",
|
37
|
+
React.createElement(IconWidget, { infer: "Delete" })))));
|
38
|
+
};
|
39
|
+
if (!((_a = tree === null || tree === void 0 ? void 0 : tree.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
40
|
+
return (React.createElement("div", { className: prefix }, props.children ? props.children : renderEmpty()));
|
41
|
+
}
|
42
|
+
return null;
|
43
|
+
});
|
44
|
+
EmptyWidget.defaultProps = {
|
45
|
+
dragTipsDirection: 'left',
|
46
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-empty {
|
4
|
+
transform: perspective(1px) translate3d(0, 0, 0);
|
5
|
+
position: absolute;
|
6
|
+
top: 0;
|
7
|
+
left: 0;
|
8
|
+
right: 0;
|
9
|
+
bottom: 0;
|
10
|
+
height: 100%;
|
11
|
+
width: 100%;
|
12
|
+
pointer-events: none;
|
13
|
+
display: flex;
|
14
|
+
align-items: center;
|
15
|
+
justify-content: center;
|
16
|
+
background: var(--dn-empty-bg-color);
|
17
|
+
.animations {
|
18
|
+
display: flex;
|
19
|
+
flex-wrap: wrap;
|
20
|
+
justify-content: center;
|
21
|
+
}
|
22
|
+
.hotkeys-list {
|
23
|
+
text-align: center;
|
24
|
+
line-height: 30px;
|
25
|
+
color: #888;
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
2
|
+
import { useCursor, usePrefix, useDesigner } from '../../hooks';
|
3
|
+
import { CursorStatus } from '@mdesignable/core';
|
4
|
+
import { autorun } from '@formily/reactive';
|
5
|
+
import { observer } from '@formily/reactive-react';
|
6
|
+
import { NodeTitleWidget } from '../NodeTitleWidget';
|
7
|
+
import './styles.less';
|
8
|
+
export var GhostWidget = observer(function () {
|
9
|
+
var designer = useDesigner();
|
10
|
+
var cursor = useCursor();
|
11
|
+
var ref = useRef();
|
12
|
+
var prefix = usePrefix('ghost');
|
13
|
+
var movingNodes = designer.findMovingNodes();
|
14
|
+
var firstNode = movingNodes[0];
|
15
|
+
useEffect(function () {
|
16
|
+
return autorun(function () {
|
17
|
+
var _a, _b;
|
18
|
+
var transform = "perspective(1px) translate3d(".concat(((_a = cursor.position) === null || _a === void 0 ? void 0 : _a.topClientX) - 18, "px,").concat(((_b = cursor.position) === null || _b === void 0 ? void 0 : _b.topClientY) - 12, "px,0) scale(0.8)");
|
19
|
+
if (!ref.current)
|
20
|
+
return;
|
21
|
+
ref.current.style.transform = transform;
|
22
|
+
});
|
23
|
+
}, [designer, cursor]);
|
24
|
+
var renderNodes = function () {
|
25
|
+
return (React.createElement("span", { style: {
|
26
|
+
whiteSpace: 'nowrap',
|
27
|
+
} },
|
28
|
+
React.createElement(NodeTitleWidget, { node: firstNode }),
|
29
|
+
movingNodes.length > 1 ? '...' : ''));
|
30
|
+
};
|
31
|
+
if (!firstNode)
|
32
|
+
return null;
|
33
|
+
return cursor.status === CursorStatus.Dragging ? (React.createElement("div", { ref: ref, className: prefix }, renderNodes())) : null;
|
34
|
+
});
|
35
|
+
GhostWidget.displayName = 'GhostWidget';
|
@@ -0,0 +1,20 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-ghost {
|
4
|
+
padding-left: 25px;
|
5
|
+
padding-right: 15px;
|
6
|
+
height: 30px;
|
7
|
+
display: flex;
|
8
|
+
justify-content: center;
|
9
|
+
align-items: center;
|
10
|
+
position: fixed;
|
11
|
+
color: var(--dn-ghost-color);
|
12
|
+
font-size: 12px;
|
13
|
+
z-index: 9999;
|
14
|
+
border-radius: 50px;
|
15
|
+
background-color: var(--dn-ghost-bg-color);
|
16
|
+
pointer-events: none;
|
17
|
+
left: 0;
|
18
|
+
top: 0;
|
19
|
+
transform: translate3d(0, 0, 0);
|
20
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import format from 'dateformat';
|
3
|
+
import { observer } from '@formily/reactive-react';
|
4
|
+
import { usePrefix, useWorkbench } from '../../hooks';
|
5
|
+
import { TextWidget } from '../TextWidget';
|
6
|
+
import cls from 'classnames';
|
7
|
+
import './styles.less';
|
8
|
+
export var HistoryWidget = observer(function () {
|
9
|
+
var workbench = useWorkbench();
|
10
|
+
var currentWorkspace = (workbench === null || workbench === void 0 ? void 0 : workbench.activeWorkspace) || (workbench === null || workbench === void 0 ? void 0 : workbench.currentWorkspace);
|
11
|
+
var prefix = usePrefix('history');
|
12
|
+
if (!currentWorkspace)
|
13
|
+
return null;
|
14
|
+
return (React.createElement("div", { className: prefix }, currentWorkspace.history.list().map(function (item, index) {
|
15
|
+
var type = item.type || 'default_state';
|
16
|
+
var token = type.replace(/\:/g, '_');
|
17
|
+
return (React.createElement("div", { className: cls(prefix + '-item', {
|
18
|
+
active: currentWorkspace.history.current === index,
|
19
|
+
}), key: item.timestamp, onClick: function () {
|
20
|
+
currentWorkspace.history.goTo(index);
|
21
|
+
} },
|
22
|
+
React.createElement("span", { className: prefix + '-item-title' },
|
23
|
+
React.createElement(TextWidget, { token: "operations.".concat(token) })),
|
24
|
+
React.createElement("span", { className: prefix + '-item-timestamp' },
|
25
|
+
' ',
|
26
|
+
format(item.timestamp, 'yy/mm/dd HH:MM:ss'))));
|
27
|
+
})));
|
28
|
+
});
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-history {
|
4
|
+
&-item {
|
5
|
+
display: flex;
|
6
|
+
justify-content: space-between;
|
7
|
+
min-height: 32px;
|
8
|
+
padding: 0 10px;
|
9
|
+
align-items: center;
|
10
|
+
cursor: pointer;
|
11
|
+
color: var(--dn-outline-tree-node-header-color);
|
12
|
+
&-timestamp {
|
13
|
+
font-size: 10px;
|
14
|
+
}
|
15
|
+
&:hover {
|
16
|
+
background-color: var(--dn-panel-active-bg-color);
|
17
|
+
}
|
18
|
+
|
19
|
+
&.active {
|
20
|
+
background-color: var(--dn-panel-active-bg-color);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TooltipProps } from 'antd';
|
3
|
+
import './styles.less';
|
4
|
+
export interface IconProviderProps {
|
5
|
+
tooltip?: boolean;
|
6
|
+
}
|
7
|
+
export interface IShadowSVGProps {
|
8
|
+
content?: string;
|
9
|
+
width?: number | string;
|
10
|
+
height?: number | string;
|
11
|
+
}
|
12
|
+
export interface IIconWidgetProps extends React.HTMLAttributes<HTMLElement> {
|
13
|
+
tooltip?: React.ReactNode | TooltipProps;
|
14
|
+
infer: React.ReactNode | {
|
15
|
+
shadow: string;
|
16
|
+
};
|
17
|
+
size?: number | string;
|
18
|
+
}
|
19
|
+
export declare const IconWidget: React.FC<IIconWidgetProps> & {
|
20
|
+
Provider?: React.FC<IconProviderProps>;
|
21
|
+
ShadowSVG?: React.FC<IShadowSVGProps>;
|
22
|
+
};
|
@@ -0,0 +1,108 @@
|
|
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, { createContext, useContext, useEffect, useRef } from 'react';
|
13
|
+
import { isStr, isFn, isObj, isPlainObj } from '@mdesignable/shared';
|
14
|
+
import { observer } from '@formily/reactive-react';
|
15
|
+
import { Tooltip } from 'antd';
|
16
|
+
import { usePrefix, useRegistry, useTheme } from '../../hooks';
|
17
|
+
import cls from 'classnames';
|
18
|
+
import './styles.less';
|
19
|
+
var IconContext = createContext(null);
|
20
|
+
var isNumSize = function (val) { return /^[\d.]+$/.test(val); };
|
21
|
+
export var IconWidget = observer(function (props) {
|
22
|
+
var _a, _b, _c;
|
23
|
+
var theme = useTheme();
|
24
|
+
var context = useContext(IconContext);
|
25
|
+
var registry = useRegistry();
|
26
|
+
var prefix = usePrefix('icon');
|
27
|
+
var size = props.size || '1em';
|
28
|
+
var height = ((_a = props.style) === null || _a === void 0 ? void 0 : _a.height) || size;
|
29
|
+
var width = ((_b = props.style) === null || _b === void 0 ? void 0 : _b.width) || size;
|
30
|
+
var takeIcon = function (infer) {
|
31
|
+
if (isStr(infer)) {
|
32
|
+
var finded = registry.getDesignerIcon(infer);
|
33
|
+
if (finded) {
|
34
|
+
return takeIcon(finded);
|
35
|
+
}
|
36
|
+
return React.createElement("img", { src: infer, height: height, width: width });
|
37
|
+
}
|
38
|
+
else if (isFn(infer)) {
|
39
|
+
return React.createElement(infer, {
|
40
|
+
height: height,
|
41
|
+
width: width,
|
42
|
+
fill: 'currentColor',
|
43
|
+
});
|
44
|
+
}
|
45
|
+
else if (React.isValidElement(infer)) {
|
46
|
+
if (infer.type === 'svg') {
|
47
|
+
return React.cloneElement(infer, {
|
48
|
+
height: height,
|
49
|
+
width: width,
|
50
|
+
fill: 'currentColor',
|
51
|
+
viewBox: infer.props.viewBox || '0 0 1024 1024',
|
52
|
+
focusable: 'false',
|
53
|
+
'aria-hidden': 'true',
|
54
|
+
});
|
55
|
+
}
|
56
|
+
else if (infer.type === 'path' || infer.type === 'g') {
|
57
|
+
return (React.createElement("svg", { viewBox: "0 0 1024 1024", height: height, width: width, fill: "currentColor", focusable: "false", "aria-hidden": "true" }, infer));
|
58
|
+
}
|
59
|
+
return infer;
|
60
|
+
}
|
61
|
+
else if (isPlainObj(infer)) {
|
62
|
+
if (infer[theme]) {
|
63
|
+
return takeIcon(infer[theme]);
|
64
|
+
}
|
65
|
+
else if (infer['shadow']) {
|
66
|
+
return (React.createElement(IconWidget.ShadowSVG, { width: width, height: height, content: infer['shadow'] }));
|
67
|
+
}
|
68
|
+
return null;
|
69
|
+
}
|
70
|
+
};
|
71
|
+
var renderTooltips = function (children) {
|
72
|
+
if (!isStr(props.infer) && (context === null || context === void 0 ? void 0 : context.tooltip))
|
73
|
+
return children;
|
74
|
+
var tooltip = props.tooltip || registry.getDesignerMessage("icons.".concat(props.infer));
|
75
|
+
if (tooltip) {
|
76
|
+
var title = React.isValidElement(tooltip) || isStr(tooltip)
|
77
|
+
? tooltip
|
78
|
+
: tooltip.title;
|
79
|
+
var props_1 = React.isValidElement(tooltip) || isStr(tooltip)
|
80
|
+
? {}
|
81
|
+
: isObj(tooltip)
|
82
|
+
? tooltip
|
83
|
+
: {};
|
84
|
+
return (React.createElement(Tooltip, __assign({}, props_1, { title: title }), children));
|
85
|
+
}
|
86
|
+
return children;
|
87
|
+
};
|
88
|
+
if (!props.infer)
|
89
|
+
return null;
|
90
|
+
return renderTooltips(React.createElement("span", __assign({}, props, { className: cls(prefix, props.className), style: __assign(__assign({}, props.style), { cursor: props.onClick ? 'pointer' : (_c = props.style) === null || _c === void 0 ? void 0 : _c.cursor }) }), takeIcon(props.infer)));
|
91
|
+
});
|
92
|
+
IconWidget.ShadowSVG = function (props) {
|
93
|
+
var ref = useRef();
|
94
|
+
var width = isNumSize(props.width) ? "".concat(props.width, "px") : props.width;
|
95
|
+
var height = isNumSize(props.height) ? "".concat(props.height, "px") : props.height;
|
96
|
+
useEffect(function () {
|
97
|
+
if (ref.current) {
|
98
|
+
var root = ref.current.attachShadow({
|
99
|
+
mode: 'open',
|
100
|
+
});
|
101
|
+
root.innerHTML = "<svg viewBox=\"0 0 1024 1024\" style=\"width:".concat(width, ";height:").concat(height, "\">").concat(props.content, "</svg>");
|
102
|
+
}
|
103
|
+
}, []);
|
104
|
+
return React.createElement("div", { ref: ref });
|
105
|
+
};
|
106
|
+
IconWidget.Provider = function (props) {
|
107
|
+
return (React.createElement(IconContext.Provider, { value: props }, props.children));
|
108
|
+
};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-icon {
|
4
|
+
display: inline-block;
|
5
|
+
color: inherit;
|
6
|
+
font-style: normal;
|
7
|
+
line-height: 0;
|
8
|
+
text-align: center;
|
9
|
+
text-transform: none;
|
10
|
+
vertical-align: -0.125em;
|
11
|
+
text-rendering: optimizeLegibility;
|
12
|
+
-webkit-font-smoothing: antialiased;
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
14
|
+
svg {
|
15
|
+
pointer-events: none;
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TypographyProps } from 'antd';
|
3
|
+
import './styles.less';
|
4
|
+
export interface INodeActionsWidgetProps {
|
5
|
+
className?: string;
|
6
|
+
style?: React.CSSProperties;
|
7
|
+
activeShown?: boolean;
|
8
|
+
}
|
9
|
+
export interface INodeActionsWidgetActionProps extends Omit<React.ComponentProps<'a'>, 'title' | 'type' | 'ref'>, Partial<TypographyProps['Link']> {
|
10
|
+
className?: string;
|
11
|
+
style?: React.CSSProperties;
|
12
|
+
title: React.ReactNode;
|
13
|
+
icon?: React.ReactNode;
|
14
|
+
}
|
15
|
+
export declare const NodeActionsWidget: React.FC<INodeActionsWidgetProps> & {
|
16
|
+
Action?: React.FC<INodeActionsWidgetActionProps>;
|
17
|
+
};
|
@@ -0,0 +1,48 @@
|
|
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 from 'react';
|
24
|
+
import { Space, Typography, Divider } from 'antd';
|
25
|
+
import { observer } from '@formily/reactive-react';
|
26
|
+
import { usePrefix, useTreeNode, useSelected } from '../../hooks';
|
27
|
+
import { IconWidget } from '../IconWidget';
|
28
|
+
import { TextWidget } from '../TextWidget';
|
29
|
+
import cls from 'classnames';
|
30
|
+
import './styles.less';
|
31
|
+
export var NodeActionsWidget = observer(function (props) {
|
32
|
+
var node = useTreeNode();
|
33
|
+
var prefix = usePrefix('node-actions');
|
34
|
+
var selected = useSelected();
|
35
|
+
if (selected.indexOf(node.id) === -1 && props.activeShown)
|
36
|
+
return null;
|
37
|
+
return (React.createElement("div", { className: cls(prefix, props.className), style: props.style },
|
38
|
+
React.createElement("div", { className: prefix + '-content' },
|
39
|
+
React.createElement(Space, { split: React.createElement(Divider, { type: "vertical" }) }, props.children))));
|
40
|
+
});
|
41
|
+
NodeActionsWidget.Action = function (_a) {
|
42
|
+
var icon = _a.icon, title = _a.title, props = __rest(_a, ["icon", "title"]);
|
43
|
+
var prefix = usePrefix('node-actions-item');
|
44
|
+
return (React.createElement(Typography.Link, __assign({}, props, { className: cls(props.className, prefix), "data-click-stop-propagation": "true" }),
|
45
|
+
React.createElement("span", { className: prefix + '-text' },
|
46
|
+
React.createElement(IconWidget, { infer: icon }),
|
47
|
+
React.createElement(TextWidget, null, title))));
|
48
|
+
};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
.dn-node-actions {
|
2
|
+
display: flex;
|
3
|
+
align-items: center;
|
4
|
+
justify-content: center;
|
5
|
+
width: 100%;
|
6
|
+
overflow: hidden;
|
7
|
+
padding-top: 8px;
|
8
|
+
padding-bottom: 8px;
|
9
|
+
&-content {
|
10
|
+
position: relative;
|
11
|
+
padding: 0 20px;
|
12
|
+
display: flex;
|
13
|
+
align-items: center;
|
14
|
+
line-height: 1;
|
15
|
+
&::before {
|
16
|
+
position: absolute;
|
17
|
+
content: '';
|
18
|
+
display: block;
|
19
|
+
height: 0;
|
20
|
+
width: 300%;
|
21
|
+
top: 50%;
|
22
|
+
border-bottom: 1px dashed var(--border-color-split);
|
23
|
+
right: 100%;
|
24
|
+
}
|
25
|
+
&::after {
|
26
|
+
position: absolute;
|
27
|
+
content: '';
|
28
|
+
display: block;
|
29
|
+
height: 0;
|
30
|
+
width: 300%;
|
31
|
+
top: 50%;
|
32
|
+
border-bottom: 1px dashed var(--border-color-split);
|
33
|
+
left: 100%;
|
34
|
+
}
|
35
|
+
a {
|
36
|
+
color: var(--text-color-secondary);
|
37
|
+
&:hover {
|
38
|
+
color: var(--primary-color);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
&-item {
|
43
|
+
&-text {
|
44
|
+
font-size: 10px;
|
45
|
+
display: flex;
|
46
|
+
align-items: center;
|
47
|
+
line-height: 1;
|
48
|
+
.dn-icon {
|
49
|
+
margin-right: 6px;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Breadcrumb } from 'antd';
|
3
|
+
import { useSelectedNode, useSelection, usePrefix, useHover } from '../../hooks';
|
4
|
+
import { IconWidget } from '../IconWidget';
|
5
|
+
import { NodeTitleWidget } from '../NodeTitleWidget';
|
6
|
+
import { observer } from '@formily/reactive-react';
|
7
|
+
import './styles.less';
|
8
|
+
export var NodePathWidget = observer(function (props) {
|
9
|
+
var _a;
|
10
|
+
var selected = useSelectedNode(props.workspaceId);
|
11
|
+
var selection = useSelection(props.workspaceId);
|
12
|
+
var hover = useHover(props.workspaceId);
|
13
|
+
var prefix = usePrefix('node-path');
|
14
|
+
if (!selected)
|
15
|
+
return React.createElement(React.Fragment, null);
|
16
|
+
var maxItems = (_a = props.maxItems) !== null && _a !== void 0 ? _a : 3;
|
17
|
+
var nodes = selected
|
18
|
+
.getParents()
|
19
|
+
.slice(0, maxItems - 1)
|
20
|
+
.reverse()
|
21
|
+
.concat(selected);
|
22
|
+
return (React.createElement(Breadcrumb, { className: prefix }, nodes.map(function (node, key) {
|
23
|
+
return (React.createElement(Breadcrumb.Item, { key: key },
|
24
|
+
key === 0 && (React.createElement(IconWidget, { infer: "Position", style: { marginRight: 3 } })),
|
25
|
+
React.createElement("a", { href: "", onMouseEnter: function () {
|
26
|
+
hover.setHover(node);
|
27
|
+
}, onClick: function (e) {
|
28
|
+
e.stopPropagation();
|
29
|
+
e.preventDefault();
|
30
|
+
selection.select(node);
|
31
|
+
} },
|
32
|
+
React.createElement(NodeTitleWidget, { node: node }))));
|
33
|
+
})));
|
34
|
+
});
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React, { Fragment } from 'react';
|
2
|
+
import { observer } from '@formily/reactive-react';
|
3
|
+
export var NodeTitleWidget = observer(function (props) {
|
4
|
+
var takeNode = function () {
|
5
|
+
var node = props.node;
|
6
|
+
if (node.componentName === '$$ResourceNode$$') {
|
7
|
+
return node.children[0];
|
8
|
+
}
|
9
|
+
return node;
|
10
|
+
};
|
11
|
+
var node = takeNode();
|
12
|
+
return React.createElement(Fragment, null, node.getMessage('title') || node.componentName);
|
13
|
+
});
|