@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.
Files changed (170) hide show
  1. package/package.json +4 -4
  2. package/copy.ts +0 -6
  3. package/dist/designable.react.umd.production.css +0 -1
  4. package/dist/designable.react.umd.production.js +0 -6
  5. package/dist/designable.react.umd.production.min.css +0 -1
  6. package/dist/designable.react.umd.production.min.js +0 -3769
  7. package/rollup.config.js +0 -3
  8. package/src/containers/Designer.tsx +0 -50
  9. package/src/containers/Layout.tsx +0 -50
  10. package/src/containers/Simulator.tsx +0 -30
  11. package/src/containers/Viewport.tsx +0 -69
  12. package/src/containers/Workbench.tsx +0 -15
  13. package/src/containers/Workspace.tsx +0 -41
  14. package/src/containers/index.ts +0 -7
  15. package/src/containers/styles.less +0 -19
  16. package/src/context.ts +0 -17
  17. package/src/hooks/index.ts +0 -25
  18. package/src/hooks/useComponents.ts +0 -3
  19. package/src/hooks/useCursor.ts +0 -6
  20. package/src/hooks/useDesigner.ts +0 -19
  21. package/src/hooks/useHistory.ts +0 -6
  22. package/src/hooks/useHover.ts +0 -6
  23. package/src/hooks/useLayout.ts +0 -11
  24. package/src/hooks/useMoveHelper.ts +0 -6
  25. package/src/hooks/useNodeIdProps.ts +0 -11
  26. package/src/hooks/useOperation.ts +0 -6
  27. package/src/hooks/useOutline.ts +0 -6
  28. package/src/hooks/usePosition.ts +0 -5
  29. package/src/hooks/usePrefix.ts +0 -5
  30. package/src/hooks/useRegistry.ts +0 -6
  31. package/src/hooks/useScreen.ts +0 -5
  32. package/src/hooks/useSelected.ts +0 -6
  33. package/src/hooks/useSelectedNode.ts +0 -14
  34. package/src/hooks/useSelection.ts +0 -6
  35. package/src/hooks/useTheme.ts +0 -5
  36. package/src/hooks/useTransformHelper.ts +0 -6
  37. package/src/hooks/useTree.ts +0 -6
  38. package/src/hooks/useTreeNode.ts +0 -6
  39. package/src/hooks/useValidNodeOffsetRect.ts +0 -48
  40. package/src/hooks/useViewport.ts +0 -6
  41. package/src/hooks/useWorkbench.ts +0 -6
  42. package/src/hooks/useWorkspace.ts +0 -16
  43. package/src/icons/actions.tsx +0 -138
  44. package/src/icons/add.tsx +0 -8
  45. package/src/icons/animations.tsx +0 -325
  46. package/src/icons/boolean.tsx +0 -7
  47. package/src/icons/clone.tsx +0 -9
  48. package/src/icons/close.tsx +0 -7
  49. package/src/icons/code.tsx +0 -5
  50. package/src/icons/command.tsx +0 -8
  51. package/src/icons/component.tsx +0 -5
  52. package/src/icons/container.tsx +0 -8
  53. package/src/icons/corner.tsx +0 -26
  54. package/src/icons/delete.tsx +0 -9
  55. package/src/icons/design.tsx +0 -7
  56. package/src/icons/display.tsx +0 -17
  57. package/src/icons/dragmove.tsx +0 -10
  58. package/src/icons/expand.tsx +0 -5
  59. package/src/icons/expression.tsx +0 -5
  60. package/src/icons/eyes.tsx +0 -15
  61. package/src/icons/flex.tsx +0 -85
  62. package/src/icons/flip.tsx +0 -5
  63. package/src/icons/focus.tsx +0 -5
  64. package/src/icons/font.tsx +0 -61
  65. package/src/icons/formula.tsx +0 -5
  66. package/src/icons/freemove.tsx +0 -10
  67. package/src/icons/help.tsx +0 -8
  68. package/src/icons/hidden.tsx +0 -5
  69. package/src/icons/history.tsx +0 -7
  70. package/src/icons/image.tsx +0 -9
  71. package/src/icons/index.ts +0 -53
  72. package/src/icons/json.tsx +0 -5
  73. package/src/icons/logo.tsx +0 -5
  74. package/src/icons/menu.tsx +0 -7
  75. package/src/icons/mobile.tsx +0 -8
  76. package/src/icons/move.tsx +0 -5
  77. package/src/icons/number.tsx +0 -7
  78. package/src/icons/outline.tsx +0 -5
  79. package/src/icons/page.tsx +0 -9
  80. package/src/icons/pc.tsx +0 -7
  81. package/src/icons/play.tsx +0 -8
  82. package/src/icons/position.tsx +0 -30
  83. package/src/icons/pushpin.tsx +0 -29
  84. package/src/icons/recover.tsx +0 -5
  85. package/src/icons/redo.tsx +0 -5
  86. package/src/icons/remove.tsx +0 -5
  87. package/src/icons/responsive.tsx +0 -9
  88. package/src/icons/return.tsx +0 -5
  89. package/src/icons/selection.tsx +0 -5
  90. package/src/icons/setting.tsx +0 -5
  91. package/src/icons/shadow.tsx +0 -20
  92. package/src/icons/shift.tsx +0 -5
  93. package/src/icons/sources.tsx +0 -3377
  94. package/src/icons/text.tsx +0 -13
  95. package/src/icons/undo.tsx +0 -7
  96. package/src/icons/upload.tsx +0 -8
  97. package/src/index.ts +0 -9
  98. package/src/locales/global.ts +0 -16
  99. package/src/locales/icons.ts +0 -132
  100. package/src/locales/index.ts +0 -7
  101. package/src/locales/operations.ts +0 -50
  102. package/src/locales/panels.ts +0 -26
  103. package/src/panels/CompositePanel.tsx +0 -195
  104. package/src/panels/SettingsPanel.tsx +0 -85
  105. package/src/panels/StudioPanel.tsx +0 -54
  106. package/src/panels/ToolbarPanel.tsx +0 -19
  107. package/src/panels/ViewPanel.tsx +0 -62
  108. package/src/panels/ViewportPanel.tsx +0 -10
  109. package/src/panels/WorkspacePanel.tsx +0 -31
  110. package/src/panels/index.ts +0 -8
  111. package/src/panels/styles.less +0 -331
  112. package/src/simulators/MobileSimulator/body.tsx +0 -78
  113. package/src/simulators/MobileSimulator/index.tsx +0 -21
  114. package/src/simulators/MobileSimulator/styles.less +0 -29
  115. package/src/simulators/PCSimulator/index.tsx +0 -17
  116. package/src/simulators/PCSimulator/styles.less +0 -11
  117. package/src/simulators/ResponsiveSimulator/handle.tsx +0 -29
  118. package/src/simulators/ResponsiveSimulator/index.tsx +0 -193
  119. package/src/simulators/ResponsiveSimulator/styles.less +0 -56
  120. package/src/simulators/index.tsx +0 -3
  121. package/src/theme.less +0 -224
  122. package/src/types.ts +0 -41
  123. package/src/variables.less +0 -1
  124. package/src/widgets/AuxToolWidget/Copy.tsx +0 -28
  125. package/src/widgets/AuxToolWidget/Cover.tsx +0 -76
  126. package/src/widgets/AuxToolWidget/DashedBox.tsx +0 -55
  127. package/src/widgets/AuxToolWidget/Delete.tsx +0 -29
  128. package/src/widgets/AuxToolWidget/DragHandler.tsx +0 -29
  129. package/src/widgets/AuxToolWidget/FreeSelection.tsx +0 -53
  130. package/src/widgets/AuxToolWidget/Helpers.tsx +0 -116
  131. package/src/widgets/AuxToolWidget/Insertion.tsx +0 -80
  132. package/src/widgets/AuxToolWidget/ResizeHandler.tsx +0 -35
  133. package/src/widgets/AuxToolWidget/Selection.tsx +0 -85
  134. package/src/widgets/AuxToolWidget/Selector.tsx +0 -125
  135. package/src/widgets/AuxToolWidget/SnapLine.tsx +0 -40
  136. package/src/widgets/AuxToolWidget/SpaceBlock.tsx +0 -112
  137. package/src/widgets/AuxToolWidget/TranslateHandler.tsx +0 -29
  138. package/src/widgets/AuxToolWidget/index.tsx +0 -40
  139. package/src/widgets/AuxToolWidget/styles.less +0 -383
  140. package/src/widgets/ComponentTreeWidget/index.tsx +0 -99
  141. package/src/widgets/ComponentTreeWidget/styles.less +0 -6
  142. package/src/widgets/DesignerToolsWidget/index.tsx +0 -206
  143. package/src/widgets/DesignerToolsWidget/styles.less +0 -29
  144. package/src/widgets/DroppableWidget/index.tsx +0 -63
  145. package/src/widgets/DroppableWidget/styles.less +0 -11
  146. package/src/widgets/EmptyWidget/index.tsx +0 -58
  147. package/src/widgets/EmptyWidget/styles.less +0 -27
  148. package/src/widgets/GhostWidget/index.tsx +0 -47
  149. package/src/widgets/GhostWidget/styles.less +0 -20
  150. package/src/widgets/HistoryWidget/index.tsx +0 -42
  151. package/src/widgets/HistoryWidget/styles.less +0 -23
  152. package/src/widgets/IconWidget/index.tsx +0 -152
  153. package/src/widgets/IconWidget/styles.less +0 -17
  154. package/src/widgets/NodeActionsWidget/index.tsx +0 -56
  155. package/src/widgets/NodeActionsWidget/styles.less +0 -51
  156. package/src/widgets/NodePathWidget/index.tsx +0 -57
  157. package/src/widgets/NodePathWidget/styles.less +0 -16
  158. package/src/widgets/NodeTitleWidget/index.tsx +0 -20
  159. package/src/widgets/OutlineWidget/Insertion.tsx +0 -63
  160. package/src/widgets/OutlineWidget/OutlineNode.tsx +0 -198
  161. package/src/widgets/OutlineWidget/context.ts +0 -9
  162. package/src/widgets/OutlineWidget/index.tsx +0 -66
  163. package/src/widgets/OutlineWidget/styles.less +0 -195
  164. package/src/widgets/ResourceWidget/index.tsx +0 -110
  165. package/src/widgets/ResourceWidget/styles.less +0 -87
  166. package/src/widgets/TextWidget/index.tsx +0 -43
  167. package/src/widgets/ViewToolsWidget/index.tsx +0 -72
  168. package/src/widgets/index.ts +0 -15
  169. package/tsconfig.build.json +0 -10
  170. package/tsconfig.json +0 -5
@@ -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
- }
@@ -1,8 +0,0 @@
1
- import './styles.less'
2
- export * from './StudioPanel'
3
- export * from './CompositePanel'
4
- export * from './SettingsPanel'
5
- export * from './WorkspacePanel'
6
- export * from './ToolbarPanel'
7
- export * from './ViewportPanel'
8
- export * from './ViewPanel'
@@ -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,11 +0,0 @@
1
- @import '../../variables.less';
2
-
3
- .@{prefix-cls}-pc-simulator {
4
- background-color: var(--dn-pc-simulator-bg-color);
5
- position: absolute;
6
- top: 0;
7
- left: 0;
8
- right: 0;
9
- bottom: 0;
10
- box-sizing: border-box;
11
- }
@@ -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
- }