@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,42 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { isResourceHost, isResourceList, } from '@mdesignable/core';
|
3
|
+
import { isFn } from '@mdesignable/shared';
|
4
|
+
import { observer } from '@formily/reactive-react';
|
5
|
+
import { usePrefix } from '../../hooks';
|
6
|
+
import { IconWidget } from '../IconWidget';
|
7
|
+
import cls from 'classnames';
|
8
|
+
import './styles.less';
|
9
|
+
import { Tooltip } from 'antd';
|
10
|
+
import { TextWidget } from '../TextWidget';
|
11
|
+
export var SimpleResourceWidget = observer(function (props) {
|
12
|
+
var prefix = usePrefix('simple-resource');
|
13
|
+
var renderNode = function (source) {
|
14
|
+
var _a;
|
15
|
+
var node = source.node, icon = source.icon, title = source.title, thumb = source.thumb, span = source.span, _b = source.showTitle, showTitle = _b === void 0 ? true : _b;
|
16
|
+
var titleTxt = title || ((_a = node.children[0]) === null || _a === void 0 ? void 0 : _a.getMessage('title'));
|
17
|
+
return (React.createElement(Tooltip, { title: titleTxt },
|
18
|
+
React.createElement("div", { className: prefix + '-item', style: { gridColumnStart: "span ".concat(span || 1) }, key: node.id, "data-designer-source-id": node.id },
|
19
|
+
thumb && React.createElement("img", { className: prefix + '-item-thumb', src: thumb }),
|
20
|
+
icon && React.isValidElement(icon) ? (React.createElement(React.Fragment, null, icon)) : (React.createElement(IconWidget, { title: titleTxt, className: prefix + '-item-icon', infer: icon, style: { width: 24, height: 24, color: 'red' } })),
|
21
|
+
showTitle ? (React.createElement("span", { className: prefix + '-item-text' }, React.createElement(TextWidget, null, titleTxt))) : null)));
|
22
|
+
};
|
23
|
+
var sources = props.sources.reduce(function (buf, source) {
|
24
|
+
if (isResourceList(source)) {
|
25
|
+
return buf.concat(source);
|
26
|
+
}
|
27
|
+
else if (isResourceHost(source)) {
|
28
|
+
return buf.concat(source.Resource);
|
29
|
+
}
|
30
|
+
return buf;
|
31
|
+
}, []);
|
32
|
+
var remainItems = sources.reduce(function (length, source) {
|
33
|
+
var _a;
|
34
|
+
return length + ((_a = source.span) !== null && _a !== void 0 ? _a : 1);
|
35
|
+
}, 0) % 3;
|
36
|
+
return (React.createElement("div", { className: cls(prefix, props.className) },
|
37
|
+
React.createElement("div", { className: prefix + '-content-wrapper' },
|
38
|
+
React.createElement("div", { className: prefix + '-content' },
|
39
|
+
sources.map(isFn(props.children) ? props.children : renderNode),
|
40
|
+
remainItems ? (React.createElement("div", { className: prefix + '-item-remain', style: { gridColumnStart: "span ".concat(3 - remainItems) } })) : null))));
|
41
|
+
});
|
42
|
+
SimpleResourceWidget.defaultProps = {};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@import '../../variables.less';
|
2
|
+
|
3
|
+
.@{prefix-cls}-simple-resource {
|
4
|
+
flex-wrap: wrap;
|
5
|
+
overflow: hidden;
|
6
|
+
|
7
|
+
&-content-wrapper {
|
8
|
+
display: flex;
|
9
|
+
justify-content: center;
|
10
|
+
background: var(--dn-resource-content-bg-color);
|
11
|
+
}
|
12
|
+
|
13
|
+
&-content {
|
14
|
+
width: 100%;
|
15
|
+
display: flex;
|
16
|
+
flex-wrap: wrap;
|
17
|
+
gap: 20px;
|
18
|
+
}
|
19
|
+
|
20
|
+
&-item {
|
21
|
+
position: relative;
|
22
|
+
user-select: none;
|
23
|
+
background: var(--dn-resource-content-bg-color);
|
24
|
+
min-height: 40px;
|
25
|
+
min-width: 40px;
|
26
|
+
color: var(--dn-resource-item-color);
|
27
|
+
display: flex;
|
28
|
+
align-items: center;
|
29
|
+
justify-content: center;
|
30
|
+
flex-direction: column;
|
31
|
+
cursor: grab;
|
32
|
+
transition: color 0.1s ease-out;
|
33
|
+
gap: 8px;
|
34
|
+
|
35
|
+
&-text {
|
36
|
+
color: inherit;
|
37
|
+
font-size: 12px;
|
38
|
+
}
|
39
|
+
|
40
|
+
&:hover {
|
41
|
+
z-index: 1;
|
42
|
+
color: var(--ant-color-primary);
|
43
|
+
}
|
44
|
+
|
45
|
+
&-icon {
|
46
|
+
width: 30px;
|
47
|
+
height: 30px;
|
48
|
+
display: flex;
|
49
|
+
align-items: center;
|
50
|
+
justify-content: center;
|
51
|
+
}
|
52
|
+
|
53
|
+
&-remain {
|
54
|
+
background: var(--dn-resource-content-bg-color);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IDesignerMiniLocales } from '@mdesignable/core';
|
3
|
+
export interface ITextWidgetProps {
|
4
|
+
componentName?: string;
|
5
|
+
sourceName?: string;
|
6
|
+
token?: string | IDesignerMiniLocales;
|
7
|
+
defaultMessage?: string | IDesignerMiniLocales;
|
8
|
+
}
|
9
|
+
export declare const TextWidget: React.FC<ITextWidgetProps>;
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import React, { Fragment } from 'react';
|
2
|
+
import { isStr, isPlainObj } from '@mdesignable/shared';
|
3
|
+
import { GlobalRegistry } from '@mdesignable/core';
|
4
|
+
import { observer } from '@formily/reactive-react';
|
5
|
+
export var TextWidget = observer(function (props) {
|
6
|
+
var takeLocale = function (message) {
|
7
|
+
if (isStr(message))
|
8
|
+
return message;
|
9
|
+
if (isPlainObj(message)) {
|
10
|
+
var lang = GlobalRegistry.getDesignerLanguage();
|
11
|
+
for (var key in message) {
|
12
|
+
if (key.toLocaleLowerCase() === lang)
|
13
|
+
return message[key];
|
14
|
+
}
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
return message;
|
18
|
+
};
|
19
|
+
var takeMessage = function (token) {
|
20
|
+
if (!token)
|
21
|
+
return;
|
22
|
+
var message = isStr(token)
|
23
|
+
? GlobalRegistry.getDesignerMessage(token)
|
24
|
+
: token;
|
25
|
+
if (message)
|
26
|
+
return takeLocale(message);
|
27
|
+
return token;
|
28
|
+
};
|
29
|
+
return (React.createElement(Fragment, null, takeMessage(props.children) ||
|
30
|
+
takeMessage(props.token) ||
|
31
|
+
takeMessage(props.defaultMessage)));
|
32
|
+
});
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { WorkbenchTypes } from '@mdesignable/core';
|
3
|
+
export interface IViewToolsWidget {
|
4
|
+
use?: WorkbenchTypes[];
|
5
|
+
style?: React.CSSProperties;
|
6
|
+
className?: string;
|
7
|
+
}
|
8
|
+
export declare const ViewToolsWidget: React.FC<IViewToolsWidget>;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Button } from 'antd';
|
3
|
+
import { observer } from '@formily/reactive-react';
|
4
|
+
import { IconWidget } from '../IconWidget';
|
5
|
+
import { usePrefix, useWorkbench } from '../../hooks';
|
6
|
+
import cls from 'classnames';
|
7
|
+
export var ViewToolsWidget = observer(function (_a) {
|
8
|
+
var use = _a.use, style = _a.style, className = _a.className;
|
9
|
+
var workbench = useWorkbench();
|
10
|
+
var prefix = usePrefix('view-tools');
|
11
|
+
return (React.createElement(Button.Group, { style: style, className: cls(prefix, className) },
|
12
|
+
use.includes('DESIGNABLE') && (React.createElement(Button, { disabled: workbench.type === 'DESIGNABLE', onClick: function () {
|
13
|
+
workbench.type = 'DESIGNABLE';
|
14
|
+
}, size: "small" },
|
15
|
+
React.createElement(IconWidget, { infer: "Design" }))),
|
16
|
+
use.includes('JSONTREE') && (React.createElement(Button, { disabled: workbench.type === 'JSONTREE', onClick: function () {
|
17
|
+
workbench.type = 'JSONTREE';
|
18
|
+
}, size: "small" },
|
19
|
+
React.createElement(IconWidget, { infer: "JSON" }))),
|
20
|
+
use.includes('MARKUP') && (React.createElement(Button, { disabled: workbench.type === 'MARKUP', onClick: function () {
|
21
|
+
workbench.type = 'MARKUP';
|
22
|
+
}, size: "small" },
|
23
|
+
React.createElement(IconWidget, { infer: "Code" }))),
|
24
|
+
use.includes('PREVIEW') && (React.createElement(Button, { disabled: workbench.type === 'PREVIEW', onClick: function () {
|
25
|
+
workbench.type = 'PREVIEW';
|
26
|
+
}, size: "small" },
|
27
|
+
React.createElement(IconWidget, { infer: "Play" })))));
|
28
|
+
});
|
29
|
+
ViewToolsWidget.defaultProps = {
|
30
|
+
use: ['DESIGNABLE', 'JSONTREE', 'PREVIEW'],
|
31
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export * from './AuxToolWidget';
|
2
|
+
export * from './ComponentTreeWidget';
|
3
|
+
export * from './DesignerToolsWidget';
|
4
|
+
export * from './ViewToolsWidget';
|
5
|
+
export * from './ResourceWidget';
|
6
|
+
export * from './GhostWidget';
|
7
|
+
export * from './EmptyWidget';
|
8
|
+
export * from './OutlineWidget';
|
9
|
+
export * from './IconWidget';
|
10
|
+
export * from './TextWidget';
|
11
|
+
export * from './HistoryWidget';
|
12
|
+
export * from './NodePathWidget';
|
13
|
+
export * from './NodeTitleWidget';
|
14
|
+
export * from './DroppableWidget';
|
15
|
+
export * from './NodeActionsWidget';
|
16
|
+
export * from './SimpleResourceWidget';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export * from './AuxToolWidget';
|
2
|
+
export * from './ComponentTreeWidget';
|
3
|
+
export * from './DesignerToolsWidget';
|
4
|
+
export * from './ViewToolsWidget';
|
5
|
+
export * from './ResourceWidget';
|
6
|
+
export * from './GhostWidget';
|
7
|
+
export * from './EmptyWidget';
|
8
|
+
export * from './OutlineWidget';
|
9
|
+
export * from './IconWidget';
|
10
|
+
export * from './TextWidget';
|
11
|
+
export * from './HistoryWidget';
|
12
|
+
export * from './NodePathWidget';
|
13
|
+
export * from './NodeTitleWidget';
|
14
|
+
export * from './DroppableWidget';
|
15
|
+
export * from './NodeActionsWidget';
|
16
|
+
export * from './SimpleResourceWidget';
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
14
|
+
if (k2 === undefined) k2 = k;
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
18
|
+
}
|
19
|
+
Object.defineProperty(o, k2, desc);
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
37
|
+
exports.Designer = void 0;
|
38
|
+
var react_1 = __importStar(require("react"));
|
39
|
+
var core_1 = require("@mdesignable/core");
|
40
|
+
var context_1 = require("../context");
|
41
|
+
var widgets_1 = require("../widgets");
|
42
|
+
var hooks_1 = require("../hooks");
|
43
|
+
var Layout_1 = require("./Layout");
|
44
|
+
var icons = __importStar(require("../icons"));
|
45
|
+
core_1.GlobalRegistry.registerDesignerIcons(icons);
|
46
|
+
var Designer = function (props) {
|
47
|
+
var engine = (0, hooks_1.useDesigner)();
|
48
|
+
var ref = (0, react_1.useRef)();
|
49
|
+
(0, react_1.useEffect)(function () {
|
50
|
+
if (props.engine) {
|
51
|
+
if (props.engine && ref.current) {
|
52
|
+
if (props.engine !== ref.current) {
|
53
|
+
ref.current.unmount();
|
54
|
+
}
|
55
|
+
}
|
56
|
+
props.engine.mount();
|
57
|
+
ref.current = props.engine;
|
58
|
+
}
|
59
|
+
return function () {
|
60
|
+
if (props.engine) {
|
61
|
+
props.engine.unmount();
|
62
|
+
}
|
63
|
+
};
|
64
|
+
}, [props.engine]);
|
65
|
+
if (engine)
|
66
|
+
throw new Error('There can only be one Designable Engine Context in the React Tree');
|
67
|
+
return (react_1.default.createElement(Layout_1.Layout, __assign({}, props),
|
68
|
+
react_1.default.createElement(context_1.DesignerEngineContext.Provider, { value: props.engine },
|
69
|
+
props.children,
|
70
|
+
react_1.default.createElement(widgets_1.GhostWidget, null))));
|
71
|
+
};
|
72
|
+
exports.Designer = Designer;
|
73
|
+
exports.Designer.defaultProps = {
|
74
|
+
prefixCls: 'dn-',
|
75
|
+
theme: 'light',
|
76
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.Layout = void 0;
|
30
|
+
var react_1 = __importStar(require("react"));
|
31
|
+
var shared_1 = require("@mdesignable/shared");
|
32
|
+
var context_1 = require("../context");
|
33
|
+
var classnames_1 = __importDefault(require("classnames"));
|
34
|
+
var Layout = function (props) {
|
35
|
+
var _a;
|
36
|
+
var layout = (0, react_1.useContext)(context_1.DesignerLayoutContext);
|
37
|
+
var ref = (0, react_1.useRef)();
|
38
|
+
(0, react_1.useLayoutEffect)(function () {
|
39
|
+
if (ref.current) {
|
40
|
+
(0, shared_1.each)(props.variables, function (value, key) {
|
41
|
+
ref.current.style.setProperty("--".concat(key), value);
|
42
|
+
});
|
43
|
+
}
|
44
|
+
}, []);
|
45
|
+
if (layout) {
|
46
|
+
return react_1.default.createElement(react_1.Fragment, null, props.children);
|
47
|
+
}
|
48
|
+
return (react_1.default.createElement("div", { ref: ref, className: (0, classnames_1.default)((_a = {},
|
49
|
+
_a["".concat(props.prefixCls, "app")] = true,
|
50
|
+
_a["".concat(props.prefixCls).concat(props.theme)] = props.theme,
|
51
|
+
_a)) },
|
52
|
+
react_1.default.createElement(context_1.DesignerLayoutContext.Provider, { value: {
|
53
|
+
theme: props.theme,
|
54
|
+
prefixCls: props.prefixCls,
|
55
|
+
position: props.position,
|
56
|
+
} }, props.children)));
|
57
|
+
};
|
58
|
+
exports.Layout = Layout;
|
59
|
+
exports.Layout.defaultProps = {
|
60
|
+
theme: 'light',
|
61
|
+
prefixCls: 'dn-',
|
62
|
+
position: 'fixed',
|
63
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
exports.Simulator = void 0;
|
18
|
+
var react_1 = __importDefault(require("react"));
|
19
|
+
var core_1 = require("@mdesignable/core");
|
20
|
+
var shared_1 = require("@mdesignable/shared");
|
21
|
+
var reactive_react_1 = require("@formily/reactive-react");
|
22
|
+
var hooks_1 = require("../hooks");
|
23
|
+
var simulators_1 = require("../simulators");
|
24
|
+
exports.Simulator = (0, reactive_react_1.observer)(function (props) {
|
25
|
+
var screen = (0, hooks_1.useScreen)();
|
26
|
+
if (screen.type === core_1.ScreenType.PC)
|
27
|
+
return react_1.default.createElement(simulators_1.PCSimulator, __assign({}, props), props.children);
|
28
|
+
if (screen.type === core_1.ScreenType.Mobile)
|
29
|
+
return react_1.default.createElement(simulators_1.MobileSimulator, __assign({}, props), props.children);
|
30
|
+
if (screen.type === core_1.ScreenType.Responsive)
|
31
|
+
return (react_1.default.createElement(simulators_1.ResponsiveSimulator, __assign({}, props), props.children));
|
32
|
+
return react_1.default.createElement(simulators_1.PCSimulator, __assign({}, props), props.children);
|
33
|
+
}, {
|
34
|
+
scheduler: shared_1.requestIdle,
|
35
|
+
});
|
@@ -0,0 +1,114 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
14
|
+
if (k2 === undefined) k2 = k;
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
18
|
+
}
|
19
|
+
Object.defineProperty(o, k2, desc);
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
37
|
+
var t = {};
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
39
|
+
t[p] = s[p];
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
43
|
+
t[p[i]] = s[p[i]];
|
44
|
+
}
|
45
|
+
return t;
|
46
|
+
};
|
47
|
+
var __read = (this && this.__read) || function (o, n) {
|
48
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
49
|
+
if (!m) return o;
|
50
|
+
var i = m.call(o), r, ar = [], e;
|
51
|
+
try {
|
52
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
53
|
+
}
|
54
|
+
catch (error) { e = { error: error }; }
|
55
|
+
finally {
|
56
|
+
try {
|
57
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
58
|
+
}
|
59
|
+
finally { if (e) throw e.error; }
|
60
|
+
}
|
61
|
+
return ar;
|
62
|
+
};
|
63
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
64
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
65
|
+
};
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
67
|
+
exports.Viewport = void 0;
|
68
|
+
var react_1 = __importStar(require("react"));
|
69
|
+
var hooks_1 = require("../hooks");
|
70
|
+
var widgets_1 = require("../widgets");
|
71
|
+
var shared_1 = require("@mdesignable/shared");
|
72
|
+
var classnames_1 = __importDefault(require("classnames"));
|
73
|
+
var Viewport = function (_a) {
|
74
|
+
var placeholder = _a.placeholder, dragTipsDirection = _a.dragTipsDirection, props = __rest(_a, ["placeholder", "dragTipsDirection"]);
|
75
|
+
var _b = __read((0, react_1.useState)(false), 2), loaded = _b[0], setLoaded = _b[1];
|
76
|
+
var prefix = (0, hooks_1.usePrefix)('viewport');
|
77
|
+
var viewport = (0, hooks_1.useViewport)();
|
78
|
+
var ref = (0, react_1.useRef)();
|
79
|
+
var viewportRef = (0, react_1.useRef)();
|
80
|
+
var isFrameRef = (0, react_1.useRef)(false);
|
81
|
+
(0, react_1.useLayoutEffect)(function () {
|
82
|
+
var frameElement = ref.current.querySelector('iframe');
|
83
|
+
if (!viewport)
|
84
|
+
return;
|
85
|
+
if (viewportRef.current && viewportRef.current !== viewport) {
|
86
|
+
viewportRef.current.onUnmount();
|
87
|
+
}
|
88
|
+
if (frameElement) {
|
89
|
+
frameElement.addEventListener('load', function () {
|
90
|
+
viewport.onMount(frameElement, frameElement.contentWindow);
|
91
|
+
(0, shared_1.requestIdle)(function () {
|
92
|
+
isFrameRef.current = true;
|
93
|
+
setLoaded(true);
|
94
|
+
});
|
95
|
+
});
|
96
|
+
}
|
97
|
+
else {
|
98
|
+
viewport.onMount(ref.current, shared_1.globalThisPolyfill);
|
99
|
+
(0, shared_1.requestIdle)(function () {
|
100
|
+
isFrameRef.current = false;
|
101
|
+
setLoaded(true);
|
102
|
+
});
|
103
|
+
}
|
104
|
+
viewportRef.current = viewport;
|
105
|
+
return function () {
|
106
|
+
viewport.onUnmount();
|
107
|
+
};
|
108
|
+
}, [viewport]);
|
109
|
+
return (react_1.default.createElement("div", __assign({}, props, { ref: ref, className: (0, classnames_1.default)(prefix, props.className), style: __assign({ opacity: !loaded ? 0 : 1, overflow: isFrameRef.current ? 'hidden' : 'overlay' }, props.style) }),
|
110
|
+
props.children,
|
111
|
+
react_1.default.createElement(widgets_1.AuxToolWidget, null),
|
112
|
+
react_1.default.createElement(widgets_1.EmptyWidget, { dragTipsDirection: dragTipsDirection }, placeholder)));
|
113
|
+
};
|
114
|
+
exports.Viewport = Viewport;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.Workbench = void 0;
|
7
|
+
var react_1 = __importDefault(require("react"));
|
8
|
+
var reactive_react_1 = require("@formily/reactive-react");
|
9
|
+
var hooks_1 = require("../hooks");
|
10
|
+
var Workspace_1 = require("./Workspace");
|
11
|
+
exports.Workbench = (0, reactive_react_1.observer)(function (props) {
|
12
|
+
var _a;
|
13
|
+
var workbench = (0, hooks_1.useWorkbench)();
|
14
|
+
return (react_1.default.createElement(Workspace_1.Workspace, { id: (_a = workbench.currentWorkspace) === null || _a === void 0 ? void 0 : _a.id }, props.children));
|
15
|
+
});
|
@@ -0,0 +1,65 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
26
|
+
var t = {};
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
28
|
+
t[p] = s[p];
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
32
|
+
t[p[i]] = s[p[i]];
|
33
|
+
}
|
34
|
+
return t;
|
35
|
+
};
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
37
|
+
exports.Workspace = void 0;
|
38
|
+
var react_1 = __importStar(require("react"));
|
39
|
+
var hooks_1 = require("../hooks");
|
40
|
+
var context_1 = require("../context");
|
41
|
+
var Workspace = function (_a) {
|
42
|
+
var id = _a.id, title = _a.title, description = _a.description, props = __rest(_a, ["id", "title", "description"]);
|
43
|
+
var oldId = (0, react_1.useRef)();
|
44
|
+
var designer = (0, hooks_1.useDesigner)();
|
45
|
+
var workspace = (0, react_1.useMemo)(function () {
|
46
|
+
if (!designer)
|
47
|
+
return;
|
48
|
+
if (oldId.current && oldId.current !== id) {
|
49
|
+
var old = designer.workbench.findWorkspaceById(oldId.current);
|
50
|
+
if (old)
|
51
|
+
old.viewport.detachEvents();
|
52
|
+
}
|
53
|
+
var workspace = {
|
54
|
+
id: id || 'index',
|
55
|
+
title: title,
|
56
|
+
description: description,
|
57
|
+
};
|
58
|
+
designer.workbench.ensureWorkspace(workspace);
|
59
|
+
oldId.current = workspace.id;
|
60
|
+
return workspace;
|
61
|
+
}, [id, designer]);
|
62
|
+
return (react_1.default.createElement(react_1.Fragment, null,
|
63
|
+
react_1.default.createElement(context_1.WorkspaceContext.Provider, { value: workspace }, props.children)));
|
64
|
+
};
|
65
|
+
exports.Workspace = Workspace;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
require("./styles.less");
|
18
|
+
__exportStar(require("./Layout"), exports);
|
19
|
+
__exportStar(require("./Designer"), exports);
|
20
|
+
__exportStar(require("./Workspace"), exports);
|
21
|
+
__exportStar(require("./Simulator"), exports);
|
22
|
+
__exportStar(require("./Viewport"), exports);
|
23
|
+
__exportStar(require("./Workbench"), exports);
|