@formily-design/react 1.0.0 → 1.0.1
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/package.json +4 -4
- package/copy.ts +0 -6
- package/dist/designable.react.umd.production.css +0 -1
- package/dist/designable.react.umd.production.js +0 -6
- package/dist/designable.react.umd.production.min.css +0 -1
- package/dist/designable.react.umd.production.min.js +0 -3769
- package/rollup.config.js +0 -3
- package/src/containers/Designer.tsx +0 -50
- package/src/containers/Layout.tsx +0 -50
- package/src/containers/Simulator.tsx +0 -30
- package/src/containers/Viewport.tsx +0 -69
- package/src/containers/Workbench.tsx +0 -15
- package/src/containers/Workspace.tsx +0 -41
- package/src/containers/index.ts +0 -7
- package/src/containers/styles.less +0 -19
- package/src/context.ts +0 -17
- package/src/hooks/index.ts +0 -25
- package/src/hooks/useComponents.ts +0 -3
- package/src/hooks/useCursor.ts +0 -6
- package/src/hooks/useDesigner.ts +0 -19
- package/src/hooks/useHistory.ts +0 -6
- package/src/hooks/useHover.ts +0 -6
- package/src/hooks/useLayout.ts +0 -11
- package/src/hooks/useMoveHelper.ts +0 -6
- package/src/hooks/useNodeIdProps.ts +0 -11
- package/src/hooks/useOperation.ts +0 -6
- package/src/hooks/useOutline.ts +0 -6
- package/src/hooks/usePosition.ts +0 -5
- package/src/hooks/usePrefix.ts +0 -5
- package/src/hooks/useRegistry.ts +0 -6
- package/src/hooks/useScreen.ts +0 -5
- package/src/hooks/useSelected.ts +0 -6
- package/src/hooks/useSelectedNode.ts +0 -14
- package/src/hooks/useSelection.ts +0 -6
- package/src/hooks/useTheme.ts +0 -5
- package/src/hooks/useTransformHelper.ts +0 -6
- package/src/hooks/useTree.ts +0 -6
- package/src/hooks/useTreeNode.ts +0 -6
- package/src/hooks/useValidNodeOffsetRect.ts +0 -48
- package/src/hooks/useViewport.ts +0 -6
- package/src/hooks/useWorkbench.ts +0 -6
- package/src/hooks/useWorkspace.ts +0 -16
- package/src/icons/actions.tsx +0 -138
- package/src/icons/add.tsx +0 -8
- package/src/icons/animations.tsx +0 -325
- package/src/icons/boolean.tsx +0 -7
- package/src/icons/clone.tsx +0 -9
- package/src/icons/close.tsx +0 -7
- package/src/icons/code.tsx +0 -5
- package/src/icons/command.tsx +0 -8
- package/src/icons/component.tsx +0 -5
- package/src/icons/container.tsx +0 -8
- package/src/icons/corner.tsx +0 -26
- package/src/icons/delete.tsx +0 -9
- package/src/icons/design.tsx +0 -7
- package/src/icons/display.tsx +0 -17
- package/src/icons/dragmove.tsx +0 -10
- package/src/icons/expand.tsx +0 -5
- package/src/icons/expression.tsx +0 -5
- package/src/icons/eyes.tsx +0 -15
- package/src/icons/flex.tsx +0 -85
- package/src/icons/flip.tsx +0 -5
- package/src/icons/focus.tsx +0 -5
- package/src/icons/font.tsx +0 -61
- package/src/icons/formula.tsx +0 -5
- package/src/icons/freemove.tsx +0 -10
- package/src/icons/help.tsx +0 -8
- package/src/icons/hidden.tsx +0 -5
- package/src/icons/history.tsx +0 -7
- package/src/icons/image.tsx +0 -9
- package/src/icons/index.ts +0 -53
- package/src/icons/json.tsx +0 -5
- package/src/icons/logo.tsx +0 -5
- package/src/icons/menu.tsx +0 -7
- package/src/icons/mobile.tsx +0 -8
- package/src/icons/move.tsx +0 -5
- package/src/icons/number.tsx +0 -7
- package/src/icons/outline.tsx +0 -5
- package/src/icons/page.tsx +0 -9
- package/src/icons/pc.tsx +0 -7
- package/src/icons/play.tsx +0 -8
- package/src/icons/position.tsx +0 -30
- package/src/icons/pushpin.tsx +0 -29
- package/src/icons/recover.tsx +0 -5
- package/src/icons/redo.tsx +0 -5
- package/src/icons/remove.tsx +0 -5
- package/src/icons/responsive.tsx +0 -9
- package/src/icons/return.tsx +0 -5
- package/src/icons/selection.tsx +0 -5
- package/src/icons/setting.tsx +0 -5
- package/src/icons/shadow.tsx +0 -20
- package/src/icons/shift.tsx +0 -5
- package/src/icons/sources.tsx +0 -3377
- package/src/icons/text.tsx +0 -13
- package/src/icons/undo.tsx +0 -7
- package/src/icons/upload.tsx +0 -8
- package/src/index.ts +0 -9
- package/src/locales/global.ts +0 -16
- package/src/locales/icons.ts +0 -132
- package/src/locales/index.ts +0 -7
- package/src/locales/operations.ts +0 -50
- package/src/locales/panels.ts +0 -26
- package/src/panels/CompositePanel.tsx +0 -195
- package/src/panels/SettingsPanel.tsx +0 -85
- package/src/panels/StudioPanel.tsx +0 -54
- package/src/panels/ToolbarPanel.tsx +0 -19
- package/src/panels/ViewPanel.tsx +0 -62
- package/src/panels/ViewportPanel.tsx +0 -10
- package/src/panels/WorkspacePanel.tsx +0 -31
- package/src/panels/index.ts +0 -8
- package/src/panels/styles.less +0 -331
- package/src/simulators/MobileSimulator/body.tsx +0 -78
- package/src/simulators/MobileSimulator/index.tsx +0 -21
- package/src/simulators/MobileSimulator/styles.less +0 -29
- package/src/simulators/PCSimulator/index.tsx +0 -17
- package/src/simulators/PCSimulator/styles.less +0 -11
- package/src/simulators/ResponsiveSimulator/handle.tsx +0 -29
- package/src/simulators/ResponsiveSimulator/index.tsx +0 -193
- package/src/simulators/ResponsiveSimulator/styles.less +0 -56
- package/src/simulators/index.tsx +0 -3
- package/src/theme.less +0 -224
- package/src/types.ts +0 -41
- package/src/variables.less +0 -1
- package/src/widgets/AuxToolWidget/Copy.tsx +0 -28
- package/src/widgets/AuxToolWidget/Cover.tsx +0 -76
- package/src/widgets/AuxToolWidget/DashedBox.tsx +0 -55
- package/src/widgets/AuxToolWidget/Delete.tsx +0 -29
- package/src/widgets/AuxToolWidget/DragHandler.tsx +0 -29
- package/src/widgets/AuxToolWidget/FreeSelection.tsx +0 -53
- package/src/widgets/AuxToolWidget/Helpers.tsx +0 -116
- package/src/widgets/AuxToolWidget/Insertion.tsx +0 -80
- package/src/widgets/AuxToolWidget/ResizeHandler.tsx +0 -35
- package/src/widgets/AuxToolWidget/Selection.tsx +0 -85
- package/src/widgets/AuxToolWidget/Selector.tsx +0 -125
- package/src/widgets/AuxToolWidget/SnapLine.tsx +0 -40
- package/src/widgets/AuxToolWidget/SpaceBlock.tsx +0 -112
- package/src/widgets/AuxToolWidget/TranslateHandler.tsx +0 -29
- package/src/widgets/AuxToolWidget/index.tsx +0 -40
- package/src/widgets/AuxToolWidget/styles.less +0 -383
- package/src/widgets/ComponentTreeWidget/index.tsx +0 -99
- package/src/widgets/ComponentTreeWidget/styles.less +0 -6
- package/src/widgets/DesignerToolsWidget/index.tsx +0 -206
- package/src/widgets/DesignerToolsWidget/styles.less +0 -29
- package/src/widgets/DroppableWidget/index.tsx +0 -63
- package/src/widgets/DroppableWidget/styles.less +0 -11
- package/src/widgets/EmptyWidget/index.tsx +0 -58
- package/src/widgets/EmptyWidget/styles.less +0 -27
- package/src/widgets/GhostWidget/index.tsx +0 -47
- package/src/widgets/GhostWidget/styles.less +0 -20
- package/src/widgets/HistoryWidget/index.tsx +0 -42
- package/src/widgets/HistoryWidget/styles.less +0 -23
- package/src/widgets/IconWidget/index.tsx +0 -152
- package/src/widgets/IconWidget/styles.less +0 -17
- package/src/widgets/NodeActionsWidget/index.tsx +0 -56
- package/src/widgets/NodeActionsWidget/styles.less +0 -51
- package/src/widgets/NodePathWidget/index.tsx +0 -57
- package/src/widgets/NodePathWidget/styles.less +0 -16
- package/src/widgets/NodeTitleWidget/index.tsx +0 -20
- package/src/widgets/OutlineWidget/Insertion.tsx +0 -63
- package/src/widgets/OutlineWidget/OutlineNode.tsx +0 -198
- package/src/widgets/OutlineWidget/context.ts +0 -9
- package/src/widgets/OutlineWidget/index.tsx +0 -66
- package/src/widgets/OutlineWidget/styles.less +0 -195
- package/src/widgets/ResourceWidget/index.tsx +0 -110
- package/src/widgets/ResourceWidget/styles.less +0 -87
- package/src/widgets/TextWidget/index.tsx +0 -43
- package/src/widgets/ViewToolsWidget/index.tsx +0 -72
- package/src/widgets/index.ts +0 -15
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -5
package/src/panels/ViewPanel.tsx
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { TreeNode, ITreeNode, WorkbenchTypes } from '@formily-design/core'
|
|
3
|
-
import { observer } from '@formily/reactive-react'
|
|
4
|
-
import { useTree, useWorkbench } from '../hooks'
|
|
5
|
-
import { Viewport } from '../containers'
|
|
6
|
-
import { requestIdle } from '@formily-design/shared'
|
|
7
|
-
|
|
8
|
-
export interface IViewPanelProps {
|
|
9
|
-
type: WorkbenchTypes
|
|
10
|
-
children: (
|
|
11
|
-
tree: TreeNode,
|
|
12
|
-
onChange: (tree: ITreeNode) => void
|
|
13
|
-
) => React.ReactElement
|
|
14
|
-
scrollable?: boolean
|
|
15
|
-
dragTipsDirection?: 'left' | 'right'
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ViewPanel: React.FC<IViewPanelProps> = observer((props) => {
|
|
19
|
-
const [visible, setVisible] = useState(true)
|
|
20
|
-
const workbench = useWorkbench()
|
|
21
|
-
const tree = useTree()
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (workbench.type === props.type) {
|
|
24
|
-
requestIdle(() => {
|
|
25
|
-
requestAnimationFrame(() => {
|
|
26
|
-
setVisible(true)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
} else {
|
|
30
|
-
setVisible(false)
|
|
31
|
-
}
|
|
32
|
-
}, [workbench.type])
|
|
33
|
-
if (workbench.type !== props.type) return null
|
|
34
|
-
const render = () => {
|
|
35
|
-
return props.children(tree, (payload) => {
|
|
36
|
-
tree.from(payload)
|
|
37
|
-
tree.takeSnapshot()
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
if (workbench.type === 'DESIGNABLE')
|
|
41
|
-
return (
|
|
42
|
-
<Viewport dragTipsDirection={props.dragTipsDirection}>
|
|
43
|
-
{render()}
|
|
44
|
-
</Viewport>
|
|
45
|
-
)
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
style={{
|
|
49
|
-
overflow: props.scrollable ? 'overlay' : 'hidden',
|
|
50
|
-
height: '100%',
|
|
51
|
-
cursor: 'auto',
|
|
52
|
-
userSelect: 'text',
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
{visible && render()}
|
|
56
|
-
</div>
|
|
57
|
-
)
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
ViewPanel.defaultProps = {
|
|
61
|
-
scrollable: true,
|
|
62
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { WorkspacePanel, IWorkspaceItemProps } from './WorkspacePanel'
|
|
3
|
-
import { Simulator } from '../containers'
|
|
4
|
-
export const ViewportPanel: React.FC<IWorkspaceItemProps> = (props) => {
|
|
5
|
-
return (
|
|
6
|
-
<WorkspacePanel.Item {...props} flexable>
|
|
7
|
-
<Simulator>{props.children}</Simulator>
|
|
8
|
-
</WorkspacePanel.Item>
|
|
9
|
-
)
|
|
10
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { usePrefix } from '../hooks'
|
|
3
|
-
|
|
4
|
-
export interface IWorkspaceItemProps {
|
|
5
|
-
children?: React.ReactNode
|
|
6
|
-
style?: React.CSSProperties
|
|
7
|
-
flexable?: boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const WorkspacePanel: React.FC<{ children?: React.ReactNode }> & {
|
|
11
|
-
Item?: React.FC<IWorkspaceItemProps>
|
|
12
|
-
} = (props) => {
|
|
13
|
-
const prefix = usePrefix('workspace-panel')
|
|
14
|
-
return <div className={prefix}>{props.children}</div>
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
WorkspacePanel.Item = (props) => {
|
|
18
|
-
const prefix = usePrefix('workspace-panel-item')
|
|
19
|
-
return (
|
|
20
|
-
<div
|
|
21
|
-
className={prefix}
|
|
22
|
-
style={{
|
|
23
|
-
...props.style,
|
|
24
|
-
flexGrow: props.flexable ? 1 : 0,
|
|
25
|
-
flexShrink: props.flexable ? 1 : 0,
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
{props.children}
|
|
29
|
-
</div>
|
|
30
|
-
)
|
|
31
|
-
}
|
package/src/panels/index.ts
DELETED
package/src/panels/styles.less
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
@import '../variables.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix-cls}-main-panel {
|
|
4
|
-
display: flex;
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 100%;
|
|
7
|
-
flex: 1;
|
|
8
|
-
min-height: 0;
|
|
9
|
-
position: relative;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
|
|
12
|
-
&-container {
|
|
13
|
-
display: flex;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
flex-grow: 1;
|
|
16
|
-
|
|
17
|
-
&.root {
|
|
18
|
-
position: fixed;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
right: 0;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
}
|
|
24
|
-
&.absolute {
|
|
25
|
-
position: absolute;
|
|
26
|
-
}
|
|
27
|
-
&.relative {
|
|
28
|
-
position: relative;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&-header {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
flex-grow: 0;
|
|
36
|
-
flex-shrink: 0;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
background: var(--dn-main-panel-header-bg-color);
|
|
39
|
-
border-bottom: 1px solid var(--dn-panel-border-color);
|
|
40
|
-
padding: 4px;
|
|
41
|
-
|
|
42
|
-
&-logo {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&-actions {
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: flex-end;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&.root {
|
|
55
|
-
position: fixed;
|
|
56
|
-
top: 0;
|
|
57
|
-
left: 0;
|
|
58
|
-
right: 0;
|
|
59
|
-
bottom: 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.@{prefix-cls}-composite-panel {
|
|
64
|
-
flex-grow: 0;
|
|
65
|
-
flex-shrink: 0;
|
|
66
|
-
display: flex;
|
|
67
|
-
position: relative;
|
|
68
|
-
user-select: none;
|
|
69
|
-
z-index: 2;
|
|
70
|
-
|
|
71
|
-
&-tabs {
|
|
72
|
-
display: flex;
|
|
73
|
-
flex-direction: column;
|
|
74
|
-
border-right: 1px solid var(--dn-panel-border-color);
|
|
75
|
-
background-color: var(--dn-composite-panel-tabs-bg-color);
|
|
76
|
-
z-index: 2;
|
|
77
|
-
position: relative;
|
|
78
|
-
|
|
79
|
-
&-pane {
|
|
80
|
-
color: var(--dn-composite-panel-tabs-color);
|
|
81
|
-
min-height: 48px;
|
|
82
|
-
min-width: 48px;
|
|
83
|
-
padding: 10px;
|
|
84
|
-
display: flex;
|
|
85
|
-
align-items: center;
|
|
86
|
-
justify-content: center;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
position: relative;
|
|
89
|
-
font-size: 20px;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
|
|
92
|
-
&-title {
|
|
93
|
-
font-size: 10px;
|
|
94
|
-
margin-top: 6px;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
&:hover {
|
|
98
|
-
color: var(--dn-composite-panel-tabs-hover-color);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
&.active {
|
|
102
|
-
color: var(--dn-composite-panel-tabs-hover-color);
|
|
103
|
-
|
|
104
|
-
&::after {
|
|
105
|
-
position: absolute;
|
|
106
|
-
top: 0;
|
|
107
|
-
left: 0;
|
|
108
|
-
display: block;
|
|
109
|
-
content: '';
|
|
110
|
-
width: 3px;
|
|
111
|
-
height: 100%;
|
|
112
|
-
background-color: var(--dn-composite-panel-tabs-hover-color);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&-content {
|
|
118
|
-
width: 300px;
|
|
119
|
-
border-right: 1px solid var(--dn-panel-border-color);
|
|
120
|
-
background: var(--dn-composite-panel-tabs-content-bg-color);
|
|
121
|
-
display: flex;
|
|
122
|
-
flex-direction: column;
|
|
123
|
-
height: 100%;
|
|
124
|
-
box-sizing: content-box;
|
|
125
|
-
|
|
126
|
-
&.pinning {
|
|
127
|
-
position: absolute;
|
|
128
|
-
z-index: 1;
|
|
129
|
-
left: 100%;
|
|
130
|
-
top: 0;
|
|
131
|
-
border-right: 1px solid transparent;
|
|
132
|
-
box-shadow: -2px 5px 10px rgba(102, 102, 102, 0.42);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&-header {
|
|
137
|
-
padding: 14px 7px;
|
|
138
|
-
color: var(--dn-composite-panel-tabs-header-color);
|
|
139
|
-
line-height: 18px;
|
|
140
|
-
font-size: 16px;
|
|
141
|
-
border-bottom: 1px solid var(--dn-panel-border-color);
|
|
142
|
-
display: flex;
|
|
143
|
-
justify-content: space-between;
|
|
144
|
-
|
|
145
|
-
&-actions {
|
|
146
|
-
display: flex;
|
|
147
|
-
align-items: center;
|
|
148
|
-
|
|
149
|
-
& > * {
|
|
150
|
-
margin-right: 8px;
|
|
151
|
-
|
|
152
|
-
&:last-child {
|
|
153
|
-
margin-right: 0;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&-pin {
|
|
159
|
-
transition: all 0.15s ease-in-out;
|
|
160
|
-
|
|
161
|
-
&:hover {
|
|
162
|
-
transform: scale(1.1);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
&-title {
|
|
167
|
-
font-size: 20px;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&-close {
|
|
171
|
-
transition: all 0.15s ease-in-out;
|
|
172
|
-
|
|
173
|
-
&:hover {
|
|
174
|
-
transform: rotate(90deg);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
&-body {
|
|
180
|
-
flex-grow: 2;
|
|
181
|
-
flex-shrink: 2;
|
|
182
|
-
overflow: overlay;
|
|
183
|
-
overflow-x: hidden;
|
|
184
|
-
height: 100%;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
&.direction-right {
|
|
189
|
-
flex-direction: row-reverse;
|
|
190
|
-
|
|
191
|
-
.@{prefix-cls}-composite-panel-tabs-pane.active:after {
|
|
192
|
-
left: auto;
|
|
193
|
-
right: -1px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.@{prefix-cls}-composite-panel-tabs-content.pinning {
|
|
197
|
-
left: auto;
|
|
198
|
-
right: 100%;
|
|
199
|
-
top: 0;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.@{prefix-cls}-composite-panel-tabs-content {
|
|
203
|
-
border-right: none;
|
|
204
|
-
border-left: 1px solid var(--dn-panel-border-color);
|
|
205
|
-
}
|
|
206
|
-
.@{prefix-cls}-composite-panel-tabs {
|
|
207
|
-
border-left: 1px solid var(--dn-panel-border-color);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.@{prefix-cls}-workspace-panel {
|
|
213
|
-
display: flex;
|
|
214
|
-
flex-grow: 1;
|
|
215
|
-
flex-direction: column;
|
|
216
|
-
padding: 4px;
|
|
217
|
-
overflow: hidden;
|
|
218
|
-
box-sizing: border-box;
|
|
219
|
-
background-color: var(--dn-workspace-panel-bg-color);
|
|
220
|
-
position: relative;
|
|
221
|
-
z-index: 1;
|
|
222
|
-
|
|
223
|
-
&-item {
|
|
224
|
-
position: relative;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
button[disabled] {
|
|
228
|
-
pointer-events: none !important;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.@{prefix-cls}-settings-panel {
|
|
233
|
-
flex-grow: 0;
|
|
234
|
-
flex-shrink: 0;
|
|
235
|
-
position: relative;
|
|
236
|
-
display: flex;
|
|
237
|
-
flex-direction: column;
|
|
238
|
-
z-index: 2;
|
|
239
|
-
width: 300px;
|
|
240
|
-
background: var(--dn-composite-panel-tabs-content-bg-color);
|
|
241
|
-
border-left: 1px solid var(--dn-panel-border-color);
|
|
242
|
-
height: 100%;
|
|
243
|
-
box-sizing: content-box;
|
|
244
|
-
user-select: none;
|
|
245
|
-
|
|
246
|
-
&.pinning {
|
|
247
|
-
position: absolute;
|
|
248
|
-
z-index: 10;
|
|
249
|
-
top: 0;
|
|
250
|
-
right: 0;
|
|
251
|
-
box-shadow: 2px 5px 10px rgba(102, 102, 102, 0.52);
|
|
252
|
-
border-left: 1px solid transparent;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
&-header {
|
|
256
|
-
padding: 14px 7px;
|
|
257
|
-
color: var(--dn-composite-panel-tabs-header-color);
|
|
258
|
-
line-height: 18px;
|
|
259
|
-
font-size: 16px;
|
|
260
|
-
border-bottom: 1px solid var(--dn-panel-border-color);
|
|
261
|
-
display: flex;
|
|
262
|
-
justify-content: space-between;
|
|
263
|
-
|
|
264
|
-
&-actions {
|
|
265
|
-
display: flex;
|
|
266
|
-
align-items: center;
|
|
267
|
-
|
|
268
|
-
& > * {
|
|
269
|
-
margin-right: 8px;
|
|
270
|
-
|
|
271
|
-
&:last-child {
|
|
272
|
-
margin-right: 0;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
&-pin {
|
|
278
|
-
transition: all 0.15s ease-in-out;
|
|
279
|
-
|
|
280
|
-
&:hover {
|
|
281
|
-
transform: scale(1.1);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
&-title {
|
|
286
|
-
font-size: 20px;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
&-close {
|
|
290
|
-
transition: all 0.15s ease-in-out;
|
|
291
|
-
|
|
292
|
-
&:hover {
|
|
293
|
-
transform: rotate(90deg);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
&-body {
|
|
299
|
-
flex-grow: 2;
|
|
300
|
-
flex-shrink: 2;
|
|
301
|
-
overflow: overlay;
|
|
302
|
-
height: 100%;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
&-opener {
|
|
306
|
-
position: absolute;
|
|
307
|
-
right: 0;
|
|
308
|
-
top: 50%;
|
|
309
|
-
transform: translateY(-50%);
|
|
310
|
-
z-index: 2;
|
|
311
|
-
background: var(--dn-composite-panel-tabs-content-bg-color);
|
|
312
|
-
border: 1px solid var(--dn-panel-border-color);
|
|
313
|
-
color: var(--dn-composite-panel-tabs-color);
|
|
314
|
-
box-shadow: 0 0 6px rgb(0 0 0 / 10%);
|
|
315
|
-
border-radius: 3px;
|
|
316
|
-
display: flex;
|
|
317
|
-
align-items: center;
|
|
318
|
-
justify-content: center;
|
|
319
|
-
width: 40px;
|
|
320
|
-
height: 40px;
|
|
321
|
-
cursor: pointer;
|
|
322
|
-
|
|
323
|
-
.dn-icon {
|
|
324
|
-
transition: all 0.15s ease-in-out;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
&:hover .dn-icon {
|
|
328
|
-
transform: rotate(45deg);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { observer } from '@formily/reactive-react'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { useScreen, usePrefix, useTheme } from '../../hooks'
|
|
4
|
-
|
|
5
|
-
export interface IMobileBodyProps {}
|
|
6
|
-
|
|
7
|
-
const MockupImages = {
|
|
8
|
-
dark: [
|
|
9
|
-
'//img.alicdn.com/imgextra/i3/O1CN01zXMc8W26oJZGUaCK1_!!6000000007708-55-tps-946-459.svg',
|
|
10
|
-
'//img.alicdn.com/imgextra/i3/O1CN012KWk2i1DLduN7InSK_!!6000000000200-55-tps-459-945.svg',
|
|
11
|
-
],
|
|
12
|
-
light: [
|
|
13
|
-
'//img.alicdn.com/imgextra/i4/O1CN01vuXGe31tEy00v2xBx_!!6000000005871-55-tps-946-459.svg',
|
|
14
|
-
'//img.alicdn.com/imgextra/i4/O1CN01ehfzMc1QPqY6HONTJ_!!6000000001969-55-tps-459-945.svg',
|
|
15
|
-
],
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const MobileBody: React.FC<IMobileBodyProps> = observer((props) => {
|
|
19
|
-
const screen = useScreen()
|
|
20
|
-
const theme = useTheme()
|
|
21
|
-
const prefix = usePrefix('mobile-simulator-body')
|
|
22
|
-
const getContentStyles = (): React.CSSProperties => {
|
|
23
|
-
if (screen.flip) {
|
|
24
|
-
return {
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
width: 736,
|
|
27
|
-
height: 414,
|
|
28
|
-
top: 43.3333,
|
|
29
|
-
left: 106.667,
|
|
30
|
-
overflow: 'hidden',
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
position: 'absolute',
|
|
35
|
-
width: 414,
|
|
36
|
-
height: 736,
|
|
37
|
-
top: 126.667,
|
|
38
|
-
left: 23.3333,
|
|
39
|
-
overflow: 'hidden',
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
className={prefix}
|
|
46
|
-
style={{
|
|
47
|
-
alignItems: screen.flip ? 'center' : '',
|
|
48
|
-
minWidth: screen.flip ? 1000 : 0,
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
<div
|
|
52
|
-
className={prefix + '-wrapper'}
|
|
53
|
-
style={{
|
|
54
|
-
position: 'relative',
|
|
55
|
-
minHeight: screen.flip ? 0 : 1000,
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
<img
|
|
59
|
-
src={screen.flip ? MockupImages[theme][0] : MockupImages[theme][1]}
|
|
60
|
-
style={{
|
|
61
|
-
display: 'block',
|
|
62
|
-
margin: '20px 0',
|
|
63
|
-
width: screen.flip ? 946.667 : 460,
|
|
64
|
-
height: screen.flip ? 460 : 946.667,
|
|
65
|
-
boxShadow: '0 0 20px #0000004d',
|
|
66
|
-
borderRadius: 60,
|
|
67
|
-
backfaceVisibility: 'hidden',
|
|
68
|
-
}}
|
|
69
|
-
></img>
|
|
70
|
-
<div className={prefix + '-content'} style={getContentStyles()}>
|
|
71
|
-
{props.children}
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
)
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
MobileBody.defaultProps = {}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { MobileBody } from './body'
|
|
3
|
-
import { usePrefix } from '../../hooks'
|
|
4
|
-
import cls from 'classnames'
|
|
5
|
-
import './styles.less'
|
|
6
|
-
export interface IMobileSimulatorProps
|
|
7
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
-
className?: string
|
|
9
|
-
style?: React.CSSProperties
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const MobileSimulator: React.FC<IMobileSimulatorProps> = (props) => {
|
|
13
|
-
const prefix = usePrefix('mobile-simulator')
|
|
14
|
-
return (
|
|
15
|
-
<div {...props} className={cls(prefix, props.className)}>
|
|
16
|
-
<div className={prefix + '-content'}>
|
|
17
|
-
<MobileBody>{props.children}</MobileBody>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
@import '../../variables.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix-cls}-mobile-simulator {
|
|
4
|
-
position: relative;
|
|
5
|
-
min-height: 100px;
|
|
6
|
-
height: 100%;
|
|
7
|
-
width: 100%;
|
|
8
|
-
background-color: var(--dn-mobile-simulator-bg-color);
|
|
9
|
-
|
|
10
|
-
&-content {
|
|
11
|
-
width: 100%;
|
|
12
|
-
top: 0;
|
|
13
|
-
left: 0;
|
|
14
|
-
height: 100%;
|
|
15
|
-
position: absolute;
|
|
16
|
-
overflow: overlay;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&-body {
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
height: 100%;
|
|
23
|
-
|
|
24
|
-
&-content {
|
|
25
|
-
background-color: var(--dn-mobile-simulator-body-bg-color);
|
|
26
|
-
border: 3px solid var(--dn-mobile-simulator-border-color);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import cls from 'classnames'
|
|
3
|
-
import { usePrefix } from '../../hooks'
|
|
4
|
-
import './styles.less'
|
|
5
|
-
export interface IPCSimulatorProps
|
|
6
|
-
extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
className?: string
|
|
8
|
-
style?: React.CSSProperties
|
|
9
|
-
}
|
|
10
|
-
export const PCSimulator: React.FC<IPCSimulatorProps> = (props) => {
|
|
11
|
-
const prefix = usePrefix('pc-simulator')
|
|
12
|
-
return (
|
|
13
|
-
<div {...props} className={cls(prefix, props.className)}>
|
|
14
|
-
{props.children}
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useDesigner, usePrefix } from '../../hooks'
|
|
3
|
-
import cls from 'classnames'
|
|
4
|
-
export enum ResizeHandleType {
|
|
5
|
-
Resize = 'RESIZE',
|
|
6
|
-
ResizeWidth = 'RESIZE_WIDTH',
|
|
7
|
-
ResizeHeight = 'RESIZE_HEIGHT',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IResizeHandleProps {
|
|
11
|
-
children?: React.ReactNode
|
|
12
|
-
type?: ResizeHandleType
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const ResizeHandle: React.FC<IResizeHandleProps> = (props) => {
|
|
16
|
-
const prefix = usePrefix('resize-handle')
|
|
17
|
-
const designer = useDesigner()
|
|
18
|
-
return (
|
|
19
|
-
<div
|
|
20
|
-
{...props}
|
|
21
|
-
{...{ [designer.props.screenResizeHandlerAttrName]: props.type }}
|
|
22
|
-
className={cls(prefix, {
|
|
23
|
-
[`${prefix}-${props.type}`]: !!props.type,
|
|
24
|
-
})}
|
|
25
|
-
>
|
|
26
|
-
{props.children}
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|